Sign Transaction
ArConnect Injected API sign() function
To submit a transaction to the Arweave Network, it first has to be signed using a private key. The sign()
function is meant to replicate the behavior of the transactions.sign()
function of arweave-js
, but instead of mutating the transaction object, it returns a new and signed transaction instance.
transaction
A valid Arweave transaction instance (without a keyfile)
options?
Arweave transaction signature options
Note: This function requires the SIGN_TRANSACTION
permission.
Note: The options
argument is optional, if it is not provided, the extension will use the default signature options (default salt length) to sign the transaction.
Tip: A better alternative to this function is using the arweave-js
transactions.sign()
instead. Just omit the second parameter (JWK
key) when calling the method, and arweave-js
will automatically use ArConnect.
Note: If you are trying to sign a larger piece of data (5 MB <), make sure to notify the user to not switch / close the browser tab. Larger transactions are split into chunks in the background and will take longer to sign.
Example usage
With arweave-js
(recommended)
arweave-js
(recommended)Directly using ArConnect
Last updated