Skip to main content

avalanche_signTransaction

Core

Takes an unsigned transaction, prompts the user for approval, and returns the signed transaction to the caller.

Params

(3)

1. transactionHex (required)

string

The unsigned transaction in hexadecimal format.

2. chainAlias (required)

string

The chain alias for which the transaction is meant.

Allowed values:
XP

3. utxos

array[string]

Array of the UTXO ids consumed by the transaction.

Result

(AvalancheSignTransactionResult)
signedTransactionHex
string

The signed transaction in a hexadecimal format.

signatures
array[object]
signature
string

Signature of the transaction

sigIndices
array[number]

Contains input - signature index pair

Errors

CodeMessage
-32602Missing mandatory param(s)
-32600No active account found
-32602Missing signer address
-32600This account has nothing to sign
-32000Unable to parse transaction data. Unsupported tx type
-32000Expected a signedTx to be returned by the wallet, {value} returned.
-32000Failed to sign [${inputIndex}, ${sigIndex}]
4001User rejected the request.

Params

transactionHex

chainAlias

utxos


Request

await window.ethereum.request({
"method": "avalanche_signTransaction",
"params": {}
});

Was this page helpful?