Aller au contenu

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

Send a user transaction through the modal, and resolve with its hash

FrakClient

The current Frak Client

The parameters

ModalRpcMetadata

Custom metadata to be passed to the modal

SendTransactionTxType | SendTransactionTxType[]

The transaction to be sent (either a single tx or multiple ones)

Promise<{ hash: `0x${string}`; }>

The hash of the transaction that was sent in a promise

This function will display a modal to the user with the provided transaction and metadata.

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);