sign() (transaction)

Othent JS SDK sign() function

The sign() function signs an Arweave Transactionarrow-up-right using the current user's private key. It's meant to replicate the behavior of the transactions.sign() function of arweave-jsarrow-up-right, but instead of mutating the transaction object, it returns a new and signed transaction instance.

circle-exclamation
circle-info

Tip: 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.

Tip: A better alternative to this function is using the arweave-jsarrow-up-right transactions.sign() instead. Just omit the second parameter (JWK key) when calling the method, and arweave-jsarrow-up-right will automatically use Othent (if it was instantiated with inject = true).

See Indirect Usage (through arweave-js)

API

sign(transaction: Transaction): Promise<Transaction>;

transaction: Transaction

A valid Arweave Transactionarrow-up-right instance, without a keyfile.

return Promise<Transaction>

A Promise containing a new signed Transactionarrow-up-right instance.

Example usage

Directly using Othent

Last updated