dispatch() (transaction)
Othent JS SDK dispatch() function
The dispatch() function allows you to quickly sign and send a transaction to the network in a bundled format. It is best for smaller datas and contract interactions. If the bundled transaction cannot be submitted, it will fall back to a base layer transaction. The function returns the result of the API call.
This function assumes (and requires) a user is authenticated. See requireAuth().
API
dispatch(
transaction: Transaction,
options?: DispatchOptions,
): Promise<ArDriveBundledTransactionData | UploadedTransactionData>;transaction: Transaction
transaction: TransactionA valid Arweave Transaction instance, without a keyfile.
options?: DispatchOptions
options?: DispatchOptionsoptions?.node?: UrlString(string)Node used for bundling transactions. Defaults to ArDrive Turbo's node.
Custom Arweave instance. Defaults to an instance connected to https://arweave.net:443.
return Promise<ArDriveBundledTransactionData | UploadedTransactionData>
return Promise<ArDriveBundledTransactionData | UploadedTransactionData>A Promise containing the result of the upload request, including the ID of the submitted transaction, as as well as a type property indicating if it was uploaded by a bundle or directly to the base layer, as well as some additional properties:
Example usage
Last updated