Skip to main content

avalanche_sendTransaction

Core

This method processes an unsigned transaction, prompting the user for approval, and then sends the signed transaction to the network.

Params

(6)

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:
XPC

3. externalIndices

array[number]

Array of external indices used in the transaction.

4. internalIndices

array[number]

Array of internal indices used in the transaction.

5. utxos

array[string]

Array of the UTXO ids consumed by the transaction.

6. feeTolerance

number

Tolerance percentage range where the burned amount is considered valid. e.g.: with FeeTolerance = 20% -> (expectedFee <= burnedAmount <= expectedFee * 1.2)

Result

(SendTransactionResult)
txHash
string
required

The hash of the successfully sent transaction.

Errors

CodeMessage
-32602Missing mandatory param(s)
-32600No active account found
-32602Unable to parse transaction data. Unsupported tx type
-32600The requested account and/or method has not been authorized by the user.
-32000Transaction contains multiple addresses, but indices were not provided
-32000Signing error, missing signatures.
-32000Signing error, invalid result
4001User rejected the request.

Params

transactionHex

chainAlias

externalIndices

internalIndices

utxos

feeTolerance


Request

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

Was this page helpful?