Dispatch Transaction
Wander Injected API dispatch() function
Argument
Type
Description
Dispatch result
export interface DispatchResult {
id: string;
type?: "BASE" | "BUNDLED";
}Example usage
import Arweave from "arweave";
// create arweave client
const arweave = new Arweave({
host: "ar-io.net",
port: 443,
protocol: "https"
});
// connect to the extension
await window.arweaveWallet.connect(["DISPATCH"]);
// create a transaction
const transaction = await arweave.createTransaction({
data: '<html><head><meta charset="UTF-8"><title>Hello permanent world! This was signed via Wander!!!</title></head><body></body></html>'
});
// dispatch the tx
const res = await window.arweaveWallet.dispatch(transaction);
console.log(`The transaction was dispatched as a ${res.type === "BUNDLED" ? "bundled" : "base layer"} Arweave transaction.`)Last updated
Was this helpful?