useWriteTransactionWithSessionKey
Description
This hook provides functionality to send either a single transaction or multiple transactions in batch using a session key. It uses the smart account client to process and send these transactions. It supports both synchronous and asynchronous methods for sending transactions, making it versatile for various use cases.
Returns
data (
Hash | undefined
): The hash of the transaction if it was successfully sent, otherwiseundefined
.Commenterror (
Error | null
): An error object if the transaction failed, otherwisenull
.CommentisPending (
boolean
): A boolean indicating whether the transaction is currently pending.CommentisSuccess (
boolean
): A boolean indicating whether the transaction was successfully sent.CommentisError (
boolean
): A boolean indicating whether an error occurred during the transaction process.CommentwriteContractWithSessionKey: A function to trigger the transaction sending using a session key without waiting for a result.Comment
writeContractWithSessionKeyAsync: A function to trigger the transaction sending using a session key and return a promise that resolves to the transaction hash.Comment
Example
Last updated