Skip to main content
All CollectionsDevelop with Core
Core API Calls: avalanche_signTransaction
Core API Calls: avalanche_signTransaction

Developer documentation for JSON-RPC API calls to use with Core

Amanda avatar
Written by Amanda
Updated this week

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

Params (3)

  1. transactionHex (required)

    1. string

    2. The unsigned transaction in hexadecimal format
      ​

  2. chainAlias (required)

    1. string

    2. The chain alias for which the transaction is meant

    3. Allowed values: X, P
      ​

  3. utxos

    1. array[string]

    2. Array of the UTXO IDs consumed by the transaction
      ​

Result (AvalancheSignTransactionResult)

signedTransactionHex: String

The signed transaction in a hexadecimal format.

signatures: array[object]

  1. signature

    1. string

    2. Signature of the transaction

  2. sigIndices

    1. array[number]

    2. Contains input - signature index pair

Errors:

Code

Message

-32602

Missing mandatory param(s)

-32600

No active account found

-32602

Missing signer address

-32600

This account has nothing to sign

-32000

Unable to parse transaction data. Unsupported tx type

-32000

Expected a signedTx to be returned by the wallet, {value} returned.

-32000

Failed to sign [${inputIndex}, ${sigIndex}]

4001

User rejected the request.


For any additional questions, please view our other knowledge base articles or contact a Product Support team member via the chat button. Examples are for illustrative purposes only.

Did this answer your question?