sendTransaction
Ce contenu n’est pas encore disponible dans votre langue.
sendTransaction(
client,args):Promise<{hash:`0x${string}`; }>
Defined in: actions/wrapper/sendTransaction.ts:47
Function used to send a user transaction, simple wrapper around the displayModal function to ease the send transaction process
Parameters
Section titled “Parameters”client
Section titled “client”The current Frak Client
The parameters
metadata?
Section titled “metadata?”Custom metadata to be passed to the modal
SendTransactionTxType | SendTransactionTxType[]
The transaction to be sent (either a single tx or multiple ones)
Returns
Section titled “Returns”Promise<{ hash: `0x${string}`; }>
The hash of the transaction that was sent in a promise
Description
Section titled “Description”This function will display a modal to the user with the provided transaction and metadata.
Example
Section titled “Example”const { hash } = await sendTransaction(frakConfig, { tx: { to: "0xdeadbeef", value: toHex(100n), }, metadata: { header: { title: "Sending eth", }, context: "Send 100wei to 0xdeadbeef", },});console.log("Transaction hash:", hash);