Broadcast Transactions
Broadcast to the Network.
If you'd like your transactions to also be broadcast to the associated blockchain network for each ContractAction
created, you can pass in the optional broadcast parameter as true
to the start
method.
Please note that broadcast is only supported for ContractActions
. If any of your transaction data is under funded or unapproved the broadcast will be unsuccessful and an error logged and thrown.
Make sure your PKP address or other wallets are correctly funded and approved on the network specified in each ContractAction
.
For a more reliable and controlled experience it's suggested that you broadcast your transactions outside of the SDK, which is necessary anyway if you plan to broadcast any FetchAction
or CustomAction
signed data. Broadcasts are non blocking to each run of the circuit.
For a quick start to broadcasting your signed transactions, obtain the correct unsigned transaction data parameters returned in the SetActions object. You can also create this manually yourself by invoking generateUnsignedTransactionData
.
The unsignedTransactionDataObject
is populated according to the number of ContractActions
added in SetActions
. Each field within this object is named in the following format: generatedUnsignedDataContract${priorityNumberOfTheAction}
.
This transaction data can then be serialized alongside the returned s,r,recid
values from the signed transaction response object in the LogCategory.RESPONSE
field.
Last updated