Node API - Avalanche X-Chain
API AuthenticationClick to view API Authentication details
Authorization
request header or URL
property. Calls are made to one of the Avalanche X Chain Node API endpoints found in your app's dashboard. For example:
https://avalanche--mainnet--rpc.datahub.figment.io
- Fetch with Header
- Fetch with Parameter
- CURL with Header
- CURL with Parameter
fetch("https://avalanche--mainnet--rpc.datahub.figment.io/ext/vm/avm", {
method: 'POST', // can also be 'GET', 'PUT' or any appropriate method
headers: {
"Authorization" : "<api_key>",
"Content-Type": "application/json" // if method is 'POST'
},
body: JSON.stringify({
// JSON Payload
})
})
fetch("https://avalanche--mainnet--rpc.datahub.figment.io/apikey/{{apikey}}/ext/vm/avm", {
method: 'POST', // can also be 'GET', 'PUT' or any appropriate method
headers: {
"Content-Type": "application/json" // if method is 'POST'
},
body: JSON.stringify({
// JSON Payload
})
})
curl -X POST 'https://avalanche--mainnet--rpc.datahub.figment.io/ext/vm/avm' \
--header 'Content-Type: application/json' \
--header 'Authorization: <api_key>' \
--data '{
// JSON Payload
}'
curl -X POST 'https://avalanche--mainnet--rpc.datahub.figment.io/apikey/{{apikey}}/ext/vm/avm' \
--header 'Content-Type: application/json' \
--data '{
// JSON Payload
}'
Available Methods
avm.buildGenesis
Given a JSON representation of this Virtual Machine’s genesis state, create the byte representation of that state.
{
"jsonrpc": "2.0",
"result": {
"bytes": "0x0000000000010006617373657431000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f6d794669786564436170417373657400044d464341000000000100000000000000010000000700000000000186a10000000000000000000000010000000152b219bc1b9ab0a9f2e3f9216e4460bd5db8d153bfa57c3c",
"encoding": "hex"
},
"id": 1
}
SpecificationView Specification
Endpoint - This call is made to the AVM’s static API endpoint: /ext/vm/avm
Note: addresses should not include a chain prefix (ie. X-) in calls to the static API endpoint because these prefixes refer to a specific chain.
Parameters
Encoding specifies the encoding format to use for arbitrary bytes ie. the genesis bytes that are returned. Can only be hex
when a value is provided.
genesisData
has this form:
{
"genesisData" :
{
"assetAlias1": { // Each object defines an asset
"name": "human readable name",
"symbol":"AVAL", // Symbol is between 0 and 4 characters
"initialState": {
"fixedCap" : [ // Choose the asset type.
{ // Can be "fixedCap", "variableCap", "limitedTransfer", "nonFungible"
"amount":1000, // At genesis, address A has
"address":"A" // 1000 units of asset
},
{
"amount":5000, // At genesis, address B has
"address":"B" // 1000 units of asset
},
... // Can have many initial holders
]
}
},
"assetAliasCanBeAnythingUnique": { // Asset alias can be used in place of assetID in calls
"name": "human readable name", // names need not be unique
"symbol": "AVAL", // symbols need not be unique
"initialState": {
"variableCap" : [ // No units of the asset exist at genesis
{
"minters": [ // The signature of A or B can mint more of
"A", // the asset.
"B"
],
"threshold":1
},
{
"minters": [ // The signatures of 2 of A, B and C can mint
"A", // more of the asset
"B",
"C"
],
"threshold":2
},
... // Can have many minter sets
]
}
},
... // Can list more assets
}
}
Response
byes
- stringencoding
- Encoding specifies the encoding format to use for arbitrary bytes.
avm.createAddress
Create a new address controlled by the given user.
{
"jsonrpc": "2.0",
"result": {
"address": "X-avax18jma8ppw3nhx5r4ap8clazz0dps7rv5ukulre5"
},
"id": 1
}
SpecificationView Specification
Not recommended for use on Mainnet. See warning notice in Keystore API.
Parameters
username
- stringpassword
- string
Response
address
- New address controlled by the given user.
avm.createFixedCapAsset
Create a new fixed-cap, fungible asset. A quantity of it is created at initialization and then no more is ever created. The asset can be sent with avm.send
.
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"assetID": "ZiKfqRXCZgHLgZ4rxGU9Qbycdzuq5DRY4tdSNS9ku8kcNxNLD",
"changeAddr": "X-avax1turszjwn05lflpewurw96rfrd3h6x8flgs5uf8"
}
}
SpecificationView Specification
Not recommended for use on Mainnet. See warning notice in Keystore API.
Parameters
name
is a human-readable name for the asset. Not necessarily unique.symbol
is a shorthand symbol for the asset. Between 0 and 4 characters. Not necessarily unique. May be omitted.denomination
determines how balances of this asset are displayed by user interfaces. Ifdenomination
is 0, 100 units of this asset are displayed as 100. Ifdenomination
is 1, 100 units of this asset are displayed as 10.0. Ifdenomination
is 2, 100 units of this asset are displayed as 1.00, etc. Defaults to 0.from
are the addresses that you want to use for this operation. If omitted, uses any of your addresses as needed.changeAddr
is the address any change will be sent to. If omitted, change is sent to one of the addresses controlled by the user.username
andpassword
denote the user paying the transaction fee.- Each element in
initialHolders
specifies thataddress
holdsamount
units of the asset at genesis.
Response
assetID
is the ID of the new asset.changeAddr
is the address any change sent to.
avm.mint
Mint units of a variable-cap asset created with avm.createVariableCapAsset
.
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"txID": "2oGdPdfw2qcNUHeqjw8sU2hPVrFyNUTgn6A8HenDra7oLCDtja",
"changeAddr": "X-avax1turszjwn05lflpewurw96rfrd3h6x8flgs5uf8"
}
}
SpecificationView Specification
Not recommended for use on Mainnet. See warning notice in Keystore API.
Parameters
amount
units ofassetID
will be created and controlled by addressto
.from
are the addresses that you want to use for this operation. If omitted, uses any of your addresses as needed.changeAddr
is the address any change will be sent to. If omitted, change is sent to one of the addresses controlled by the user.username
is the user that pays the transaction fee.username
must hold keys giving it permission to mint more of this asset. That is, it must control at least threshold keys for one of the minter sets.
Response
txID
is this transaction’s ID.changeAddr
in the result is the address where any change was sent.
avm.createVariableCapAsset
Create a new variable-cap, fungible asset. No units of the asset exist at initialization. Minters can mint units of this asset using avm.mint
.
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"assetID": "2QbZFE7J4MAny9iXHUwq8Pz8SpFhWk3maCw4SkinVPv6wPmAbK",
"changeAddr": "X-avax1turszjwn05lflpewurw96rfrd3h6x8flgs5uf8"
}
}
SpecificationView Specification
Not recommended for use on Mainnet. See warning notice in Keystore API.
Parameters
name
is a human-readable name for the asset. Not necessarily unique.symbol
is a shorthand symbol for the asset. Between 0 and 4 characters. Not necessarily unique. May be omitted.denomination
determines how balances of this asset are displayed by user interfaces. If denomination is 0, 100 units of this asset are displayed as 100. If denomination is 1, 100 units of this asset are displayed as 10.0. If denomination is 2, 100 units of this asset are displays as .100, etc.minterSets
is a list where each element specifies thatthreshold
of the addresses inminters
may together mint more of the asset by signing a minting transaction.from
are the addresses that you want to use for this operation. If omitted, uses any of your addresses as needed.changeAddr
is the address any change will be sent to. If omitted, change is sent to one of the addresses controlled by the user.username
pays the transaction fee.
Response
assetID
is the ID of the new asset.changeAddr
in the result is the address where any change was sent.
avm.createNFTAsset
Create a new non-fungible asset. No units of the asset exist at initialization. Minters can mint units of this asset using avm.mintNFT
.
{
"jsonrpc": "2.0",
"result": {
"assetID": "2KGdt2HpFKpTH5CtGZjYt5XPWs6Pv9DLoRBhiFfntbezdRvZWP",
"changeAddr": "X-avax1turszjwn05lflpewurw96rfrd3h6x8flgs5uf8"
},
"id": 1
}
SpecificationView Specification
Not recommended for use on Mainnet. See warning notice in Keystore API.
Parameters
name
is a human-readable name for the asset. Not necessarily unique.symbol
is a shorthand symbol for the asset. Between 0 and 4 characters. Not necessarily unique. May be omitted.minterSets
is a list where each element specifies thatthreshold
of the addresses inminters
may together mint more of the asset by signing a minting transaction.from
are the addresses that you want to use for this operation. If omitted, uses any of your addresses as needed.changeAddr
is the address any change will be sent to. If omitted, change is sent to one of the addresses controlled by the user.username
pays the transaction fee.
Response
assetID
is the ID of the new asset.changeAddr
in the result is the address where any change was sent.
avm.mintNFT
Mint non-fungible tokens which were created with avm.createNFTAsset
.
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"txID": "2oGdPdfw2qcNUHeqjw8sU2hPVrFyNUTgn6A8HenDra7oLCDtja",
"changeAddr": "X-avax1turszjwn05lflpewurw96rfrd3h6x8flgs5uf8"
}
}
SpecificationView Specification
Not recommended for use on Mainnet. See warning notice in Keystore API.
Parameters
assetID
is the assetID of the newly created NFT asset.payload
is an arbitrary payload of up to 1024 bytes. Its encoding format is specified by theencoding
argument.from
are the addresses that you want to use for this operation. If omitted, uses any of your addresses as needed.changeAddr
is the address any change will be sent to. If omitted, change is sent to one of the addresses controlled by the user.username
is the user that pays the transaction fee.username
must hold keys giving it permission to mint more of this asset. That is, it must control at least threshold keys for one of the minter sets.
Response
txID
is this transaction’s ID.changeAddr
in the result is the address where any change was sent.encoding
is the encoding format to use for the payload argument. Can only behex
when a value is provided.
avm.export
Send an asset from the X-Chain to the P-Chain or C-Chain. After calling this method,
{
"jsonrpc": "2.0",
"result": {
"txID": "2Eu16yNaepP57XrrJgjKGpiEDandpiGWW8xbUm6wcTYny3fejj",
"changeAddr": "X-avax1turszjwn05lflpewurw96rfrd3h6x8flgs5uf8"
},
"id": 1
}
SpecificationView Specification
you must call the C-Chain's avax.import
or the P-Chain's platform.importAVAX
to complete the transfer.
Not recommended for use on Mainnet. See warning notice in Keystore API.
Parameters
to
is the P-Chain or C-Chain address the asset is sent to.amount
is the amount of the asset to send.assetID
is the asset id of the asset which is sent. UseAVAX
for AVAX exports.from
are the addresses that you want to use for this operation. If omitted, uses any of your addresses as needed.changeAddr
is the address any change will be sent to. If omitted, change is sent to one of the addresses controlled by the user.- The asset is sent from addresses controlled by
username
password
isusername
‘s password.
Response
txID
is this transaction’s ID.changeAddr
in the result is the address where any change was sent.
avm.exportKey
Get the private key that controls a given address. The returned private key can be added to a user with avm.importKey
.
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"privateKey": "PrivateKey-2w4XiXxPfQK4TypYqnohRL8DRNTz9cGiGmwQ1zmgEqD9c9KWLq"
}
}
SpecificationView Specification
Not recommended for use on Mainnet. See warning notice in Keystore API.
Parameters
username
that controladdress
.address
to get the private key
Response
privateKey
is the string representation of the private key that controlsaddress
.
avm.getAllBalances
Get the balances of all assets controlled by a given address.
{
"jsonrpc": "2.0",
"result": {
"balances": [
{
"asset": "AVAX",
"balance": "102"
},
{
"asset": "2sdnziCz37Jov3QSNMXcFRGFJ1tgauaj6L7qfk7yUcRPfQMC79",
"balance": "10000"
}
]
},
"id": 1
}
SpecificationView Specification
Parameters
address
to get the balances of all assets.
Response
asset
controlled by a given address.balances
of all assets.
avm.getAssetDescription
Get information about an asset.
{
"jsonrpc": "2.0",
"result": {
"assetID": "FvwEAhmxKfeiG8SnEvq42hc6whRyY3EFYAvebMqDNDGCgxN5Z",
"name": "Avalanche",
"symbol": "AVAX",
"denomination": "9"
},
"id": 1
}
SpecificationView Specification
Parameters
assetID
is the id of the asset for which the information is requested.
Response
assetID
is the id of the asset for which the information is requested.name
is the asset’s human-readable, not necessarily unique name.symbol
is the asset’s symbol.denomination
determines how balances of this asset are displayed by user interfaces. If denomination is 0, 100 units of this asset are displayed as 100. If denomination is 1, 100 units of this asset are displayed as 10.0. If denomination is 2, 100 units of this asset are displays as .100, etc.
avm.getBalance
Get the balance of an asset controlled by a given address.
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"balance": "299999999999900",
"utxoIDs": [
{
"txID": "WPQdyLNqHfiEKp4zcCpayRHYDVYuh1hqs9c1RqgZXS4VPgdvo",
"outputIndex": 1
}
]
}
}
SpecificationView Specification
Parameters
address
owner of the assetassetID
id of the asset for which the balance is requested
Response
balance
of an asset controlled by a given address.utxoIDs
txID
outputIndex
avm.getAddressTxs
Returns all transactions that change the balance of the given address. A transaction is said to change an address's balance if either is true:
{
"jsonrpc": "2.0",
"result": {
"txIDs": null,
"cursor": "0"
},
"id": 1
}
SpecificationView Specification
- A UTXO that the transaction consumes was at least partially owned by the address.
- A UTXO that the transaction produces is at least partially owned by the address.
Parameters
address
: The address for which we're fetching related transactionsassetID
: Only return transactions that changed the balance of this asset. Must be an ID or an alias for an asset.pageSize
: Number of items to return per page. Optional. Defaults to 1024.
Response
txIDs
: List of transaction IDs that affected the balance of this address.cursor
: Page number or offset. Use this in request to get the next page.
avm.getTx
Returns the specified transaction. The encoding
parameter sets the format of the returned transaction. Can be either "hex"
or "json"
. Defaults to "hex".
{
"jsonrpc": "2.0",
"result": {
"tx": {
"unsignedTx": {
"networkID": 1,
"blockchainID": "2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM",
"outputs": [
{
"assetID": "FvwEAhmxKfeiG8SnEvq42hc6whRyY3EFYAvebMqDNDGCgxN5Z",
"fxID": "spdxUxVJQbX85MGxMHbKw1sHxMnSqJ3QBzDyDYEP3h6TLuxqQ",
"output": {
"addresses": [
"X-avax126rd3w35xwkmj8670zvf7y5r8k36qa9z9803wm"
],
"amount": 1530084210,
"locktime": 0,
"threshold": 1
}
}
],
"inputs": [],
"memo": "0x",
"sourceChain": "11111111111111111111111111111111LpoYY",
"importedInputs": [
{
"txID": "28jfD1CViCz7CKawJBzmHCQRWtk6xwzcBjCVErH6dBo11JLvmw",
"outputIndex": 0,
"assetID": "FvwEAhmxKfeiG8SnEvq42hc6whRyY3EFYAvebMqDNDGCgxN5Z",
"fxID": "spdxUxVJQbX85MGxMHbKw1sHxMnSqJ3QBzDyDYEP3h6TLuxqQ",
"input": {
"amount": 1531084210,
"signatureIndices": [
0
]
}
}
]
},
"credentials": [
{
"fxID": "spdxUxVJQbX85MGxMHbKw1sHxMnSqJ3QBzDyDYEP3h6TLuxqQ",
"credential": {
"signatures": [
"0x447ea3c6725add24e240b3179f9cc28ab5410c48f822d32d12459861ca816765297dbfe07e1957e3b470d39e6f56f10269dd7f8c4e108857db874b2c4ba1a22401"
]
}
}
]
},
"encoding": "json"
},
"id": 1
}
SpecificationView Specification
Parameters
txID
Specific Transaction's IDencoding
parameter sets the format of the returned transaction. Can be either"hex"
or"json"
. Defaults to "hex".
Response
credentials
is a list of this transaction's credentials. Each credential proves that this transaction's creator is allowed to consume one of this transaction's inputs. Each credential is a list of signatures.unsignedTx
is the non-signature portion of the transaction.networkID
is the ID of the network this transaction happened on. (Avalanche Mainnet is1
.)blockchainID
is the ID of the blockchain this transaction happened on. (Avalanche Mainnet X-Chain is2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM
.)- Each element of
outputs
is an output (UTXO) of this transaction that is not being exported to another chain. - Each element of
inputs
is an input of this transaction which has not been imported from another chain. - Import Transactions have additional fields
sourceChain
andimportedInputs
, which specify the blockchain ID that assets are being imported from, and the inputs that are being imported. - Export Transactions have additional fields
destinationChain
andexportedOutputs
, which specify the blockchain ID that assets are being exported to, and the UTXOs that are being exported. An output contains: assetID
: The ID of the asset being transferred. (The Mainnet Avax ID isFvwEAhmxKfeiG8SnEvq42hc6whRyY3EFYAvebMqDNDGCgxN5Z
.)fxID
: The ID of the FX this output uses.output
: The FX-specific contents of this output.
avm.getTxStatus
Get the status of a transaction sent to the network.
{
"jsonrpc": "2.0",
"result": {
"status": "Accepted"
},
"id": 1
}
SpecificationView Specification
Parameters
txID
ID of the transaction.
Response
status
is one of:
Accepted
: The transaction is (or will be) accepted by every nodeProcessing
: The transaction is being voted on by this nodeRejected
: The transaction will never be accepted by any node in the networkUnknown
: The transaction hasn’t been seen by this node
avm.getUTXOs
Gets the UTXOs that reference a given address. If sourceChain is specified, then it will retrieve the atomic UTXOs exported from that chain to the X Chain.
{
"jsonrpc": "2.0",
"result": {
"numFetched": "0",
"utxos": [],
"endIndex": {
"address": "X-avax1d09qn852zcy03sfc9hay2llmn9hsgnw4tp3dv6",
"utxo": "11111111111111111111111111111111LpoYY"
},
"encoding": "hex"
},
"id": 1
}
SpecificationView Specification
Parameters
utxos
is a list of UTXOs such that each UTXO references at least one address inaddresses
.- At most
limit
UTXOs are returned. Iflimit
is omitted or greater than 1024, it is set to 1024. - If
startIndex
is omitted, will fetch all UTXOs up tolimit
. - When using pagination (when
startIndex
is provided), UTXOs are not guaranteed to be unique across multiple calls. That is, a UTXO may appear in the result of the first call, and then again in the second call. - When using pagination, consistency is not guaranteed across multiple calls. That is, the UTXO set of the addresses may have changed between calls.
encoding
sets the format for the returned UTXOs. Can only behex
when a value is provided.
Response
utxos
is a list of UTXOs such that each UTXO references at least one address inaddresses
.- This method supports pagination.
endIndex
denotes the last UTXO returned. To get the next set of UTXOs, use the value ofendIndex
asstartIndex
in the next call. encoding
sets the format for the returned UTXOs. Can only behex
when a value is provided.
avm.import
Finalize a transfer of an asset from the P-Chain or C-Chain to the X-Chain. Before this method is called, you must call the P-Chain’s platform.exportAVAX
or C-Chain’s avax.export
method to initiate the transfer.
{
"jsonrpc": "2.0",
"result": {
"txID": "2gXpf4jFoMAWQ3rxBfavgFfSdLkL2eFUYprKsUQuEdB5H6Jo1H"
},
"id": 1
}
SpecificationView Specification
Not recommended for use on Mainnet. See warning notice in Keystore API.
Parameters
to
is the address the AVAX is sent to. This must be the same as theto
argument in the corresponding call to the P-Chain’sexportAVAX
or C-Chain'sexport
.sourceChain
is the ID or alias of the chain the AVAX is being imported from. To import funds from the C-Chain, use"C"
.username
is the user that controlsto
.
Response
txID
is the ID of the newly created atomic transaction.
avm.importKey
Give a user control over an address by providing the private key that controls the address.
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"address": "X-avax18jma8ppw3nhx5r4ap8clazz0dps7rv5ukulre5"
}
}
SpecificationView Specification
Not recommended for use on Mainnet. See warning notice in Keystore API.
Parameters
- Add
privateKey
tousername
‘s set of private keys.address
is the addressusername
now controls with the private key.
Response
address
to give user control over this address.
avm.issueTx
Send a signed transaction to the network.
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"txID": "NUPLwbt2hsYxpQg4H2o451hmTWQ4JZx2zMzM4SinwtHgAdX1JLPHXvWSXEnpecStLj"
}
}
SpecificationView Specification
Parameters
tx
transaction string.encoding
specifies the format of the signed transaction. Can only behex
when a value is provided.
Response
txID
Transaction ID of this transaction.
avm.listAddresses
List addresses controlled by the given user.
{
"jsonrpc": "2.0",
"result": {
"addresses": [
"X-avax18jma8ppw3nhx5r4ap8clazz0dps7rv5ukulre5"
]
},
"id": 1
}
SpecificationView Specification
Not recommended for use on Mainnet. See warning notice in Keystore API.
Parameters
username
password
Response
addresses
List of addresses controlled by the given user.
avm.send
Send a quantity of an asset to an address.
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"txID": "2iXSVLPNVdnFqn65rRvLrsu8WneTFqBJRMqkBJx5vZTwAQb8c1",
"changeAddr": "X-avax1turszjwn05lflpewurw96rfrd3h6x8flgs5uf8"
}
}
SpecificationView Specification
Not recommended for use on Mainnet. See warning notice in Keystore API.
Parameters
- Sends
amount
units of asset with IDassetID
to addressto
.amount
is denominated in the smallest increment of the asset. For AVAX this is 1 nAVAX (one billionth of 1 AVAX.) to
is the X-Chain address the asset is sent to.from
are the addresses that you want to use for this operation. If omitted, uses any of your addresses as needed.changeAddr
is the address any change will be sent to. If omitted, change is sent to one of the addresses controlled by the user.- You can attach a
memo
, whose length can be up to 256 bytes. - The asset is sent from addresses controlled by user
username
. (Of course, that user will need to hold at least the balance of the asset being sent.)
Response
txID
ID of this transaction.changeAddr
is the address to which changes was sent to.
avm.sendMultiple
Sends multiple transfers of amount
of assetID
, to a specified address from a list of owned addresses.
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"txID": "2iXSVLPNVdnFqn65rRvLrsu8WneTFqBJRMqkBJx5vZTwAQb8c1",
"changeAddr": "X-avax1turszjwn05lflpewurw96rfrd3h6x8flgs5uf8"
}
}
SpecificationView Specification
Not recommended for use on Mainnet. See warning notice in Keystore API.
Parameters
outputs
is an array of object literals which each contain anassetID
,amount
andto
.memo
is an optional message, whose length can be up to 256 bytes.from
are the addresses that you want to use for this operation. If omitted, uses any of your addresses as needed.changeAddr
is the address any change will be sent to. If omitted, change is sent to one of the addresses controlled by the user.- The asset is sent from addresses controlled by user
username
. (Of course, that user will need to hold at least the balance of the asset being sent.)
Response
txID
ID of this transaction.changeAddr
is the address to which changes was sent to.
avm.sendNFT
Send a non-fungible token.
{
"jsonrpc": "2.0",
"result": {
"txID": "DoR2UtG1Trd3Q8gWXVevNxD666Q3DPqSFmBSMPQ9dWTV8Qtuy",
"changeAddr": "X-avax1turszjwn05lflpewurw96rfrd3h6x8flgs5uf8"
},
"id": 1
}
SpecificationView Specification
Not recommended for use on Mainnet. See warning notice in Keystore API.
Parameters
assetID
is the asset ID of the NFT being sent.groupID
is the NFT group from which to send the NFT. NFT creation allows multiple groups under each NFT ID. You can issue multiple NFTs to each group.to
is the X-Chain address the NFT is sent to.from
are the addresses that you want to use for this operation. If omitted, uses any of your addresses as needed.changeAddr
is the address any change will be sent to. If omitted, change is sent to one of the addresses controlled by the user.- The asset is sent from addresses controlled by user
username
. (Of course, that user will need to hold at least the balance of the NFT being sent.)
Response
txID
ID of this transaction.changeAddr
is the address to which changes was sent to.
wallet.issueTx
Send a signed transaction to the network and assume the tx will be accepted.
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"txID": "NUPLwbt2hsYxpQg4H2o451hmTWQ4JZx2zMzM4SinwtHgAdX1JLPHXvWSXEnpecStLj"
}
}
SpecificationView Specification
This call is made to the wallet API endpoint:
/ext/bc/X/wallet
Parameters
tx
Transaction stringencoding
specifies the format of the signed transaction. Can only behex
when a value is provided.
Response
txID
Transaction ID of this transaction.
wallet.send
Send a quantity of an asset to an address and assume the tx will be accepted so that future calls can use the modified UTXO set.
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"txID": "2iXSVLPNVdnFqn65rRvLrsu8WneTFqBJRMqkBJx5vZTwAQb8c1",
"changeAddr": "X-avax1turszjwn05lflpewurw96rfrd3h6x8flgs5uf8"
}
}
SpecificationView Specification
This call is made to the wallet API endpoint:
/ext/bc/X/wallet
Not recommended for use on Mainnet. See warning notice in Keystore API.
Parameters
- Sends
amount
units of asset with IDassetID
to addressto
.amount
is denominated in the smallest increment of the asset. For AVAX this is 1 nAVAX (one billionth of 1 AVAX.) to
is the X-Chain address the asset is sent to.from
are the addresses that you want to use for this operation. If omitted, uses any of your addresses as needed.changeAddr
is the address any change will be sent to. If omitted, change is sent to one of the addresses controlled by the user.- You can attach a
memo
, whose length can be up to 256 bytes. - The asset is sent from addresses controlled by user
username
. (Of course, that user will need to hold at least the balance of the asset being sent.)
Response
txID
Transaction ID of this transaction.changeAddr
is the address to which change was sent to.
wallet.sendMultiple
Send multiple transfers of amount
of assetID
, to a specified address from a list of owned of addresses and assume the tx will be accepted so that future calls can use the modified UTXO set.
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"txID": "2iXSVLPNVdnFqn65rRvLrsu8WneTFqBJRMqkBJx5vZTwAQb8c1",
"changeAddr": "X-avax1turszjwn05lflpewurw96rfrd3h6x8flgs5uf8"
}
}
SpecificationView Specification
This call is made to the wallet API endpoint:
/ext/bc/X/wallet
Not recommended for use on Mainnet. See warning notice in Keystore API.
Parameters
outputs
is an array of object literals which each contain anassetID
,amount
andto
.from
are the addresses that you want to use for this operation. If omitted, uses any of your addresses as needed.changeAddr
is the address any change will be sent to. If omitted, change is sent to one of the addresses controlled by the user.- You can attach a
memo
, whose length can be up to 256 bytes. - The asset is sent from addresses controlled by user
username
. (Of course, that user will need to hold at least the balance of the asset being sent.)
Response
txID
Transaction ID of this transaction.changeAddr
is the address to which change was sent to.