The HD key to convert. HDKey
-The options for the account. HDKeyToAvalancheAccountOptions
-The Avalanche account AvalancheAccount.
-Converts a mnemonic to an Avalanche account.
-The mnemonic to convert.
-The options for the account. MnemonicToAccountOptions
-The Avalanche account AvalancheAccount.
-Parse an account or address to an AvalancheAccount
-The account or address to parse AvalancheAccount
-The parsed account AvalancheAccount or undefined if not provided
-Converts a private key to an Avalanche account.
-The private key to convert with the 0x prefix.
The options for the account. PrivateKeyToAccountOptions
-The Avalanche account AvalancheAccount.
-Converts a private key to an XP account.
-The private key.
-The XP account XPAccount.
-Converts a private key to an XP address.
-The private key to convert.
-The human readable prefix to use for the address.
-The XP address as a 0x prefixed string.
Converts a private key to an XP public key.
-The private key to convert.
-The XP public key as a 0x prefixed string.
Converts a public key to an XP address.
-The public key to convert.
-The human readable prefix to use for the address.
-The XP address as a 0x prefixed string.
Recovers a public key from a signature and message.
-The message that was signed.
-The signature.
-The recovered public key as a 0x prefixed string.
Signs a message with an XP private key.
-The message to sign.
-The private key to sign with.
-A promise that resolves to the signature as a 0x prefixed string.
Signs a transaction hash with an XP private key.
-The transaction hash to sign.
-The private key to sign with.
-A promise that resolves to the signature as a 0x prefixed string.
Verifies a signature.
-The signature to verify.
-The message that was signed.
-The public key to verify with.
-A boolean indicating whether the signature is valid.
-Creates an Admin API Client with a given transport configured for a Chain.
-An Admin API Client. AdminApiClient
-Assign an API endpoint an alias, a different endpoint for the API. -The original endpoint will still work. This change only affects this node.
- -Give a blockchain an alias, a different name that can be used any place the blockchain's ID is used. -Note: The alias is set for each chain on each node individually.
- -import { createAvalancheClient} from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
const client = createAvalancheClient({
chain: avalanche,
transport: {
type: "http",
},
})
await client.admin.aliasChain({
chain: "sV6o671RtkGBcno1FiaDbVcFv2sG5aVXMZYzKdP4VQAWmJQnM",
alias: "myBlockchainAlias"
})
-
-
-Returns the aliases of the chain.
- -import { createAvalancheClient} from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
const client = createAvalancheClient({
chain: avalanche,
transport: {
type: "http",
},
})
const aliases = await client.admin.getChainAliases({
chain: "sV6o671RtkGBcno1FiaDbVcFv2sG5aVXMZYzKdP4VQAWmJQnM"
})
-
-
-Returns log and display levels of loggers.
- -Dynamically loads any virtual machines installed on the node as plugins.
- -Writes a profile of mutex statistics to lock.profile.
Writes a memory profile of the node to mem.profile.
Sets log and display levels of loggers.
- -import { createAvalancheClient} from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
const client = createAvalancheClient({
chain: avalanche,
transport: {
type: "http",
},
})
await client.admin.setLoggerLevel({
loggerName: "C",
logLevel: "DEBUG",
displayLevel: "INFO"
})
-
-
-Start profiling the CPU utilization of the node.
-To stop, call stopCPUProfiler. On stop, writes the profile to cpu.profile.
Stop the CPU profile that was previously started.
- -import { createAdminApiClient} from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
const client = createAdminApiClient({
chain: avalanche,
transport: {
type: "http",
url: "https://api.avax.network/ext/admin",
},
})
// Set endpoint alias
const alias = await client.alias({ endpoint: "bc/X", alias: "myAlias" })
-
-
-Creates an Avalanche Client with a given transport configured for a Chain.
-The Avalanche Client is an interface to interact with the Avalanche network through various JSON-RPC API methods. -It provides access to multiple sub-clients for different chains and APIs:
-An Avalanche Client with access to all sub-clients. AvalancheClient
-import { createAvalancheClient} from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
const client = createAvalancheClient({
chain: avalanche,
transport: {
type: "http",
},
})
// Access different chain clients
const pChainClient = client.pChain
const xChainClient = client.xChain
const cChainClient = client.cChain
// Access API clients
const adminClient = client.admin
const infoClient = client.info
const healthClient = client.health
const indexPChainBlockClient = client.indexPChainBlock
// Get the latest block number
const blockNumber = await client.pChain.getBlockNumber()
// Get base fee
const baseFee = await client.getBaseFee()
-
-
-Creates an Avalanche Core Client with a given transport configured for a Chain.
-The Avalanche Core Client is a base client that can be used to create other -Avalanche clients or make rpc requests.
-A Avalanche Core Client. AvalancheCoreClient
-Optionalchain: Chain | chainCreates an Avalanche Wallet Client with a given transport configured for a Chain.
-The Avalanche Wallet Client is an interface to interact with the Core Wallet API through Avalanche-specific JSON-RPC API methods.
-A Avalanche Wallet Client. AvalancheWalletClient
-Gets the public key associated with the wallet account.
- -import { createAvalancheWalletClient } from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
// You can pass a local account otherwise a custom provider can be used
const account = privateKeyToAvalancheAccount("0x...")
const walletClient = createAvalancheWalletClient({
account,
chain: avalanche,
transport: { type: "http" },
})
const pubKey = await walletClient.getAccountPubKey()
// Or you can use a custom provider (e.g. window.avalanche, window.ethereum, etc.)
const walletClient = createAvalancheWalletClient({
chain: avalanche,
transport: { type: "custom", provider: window.avalanche! },
})
const pubKey = await walletClient.getAccountPubKey()
-
-
-Sends tokens from the source chain to the destination chain.
-import { createAvalancheWalletClient } from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
const walletClient = createAvalancheWalletClient({
chain: avalanche,
transport: { type: "http" },
})
const result = await walletClient.send({
amount: 1,
to: "0x0000000000000000000000000000000000000000",
-
-
-Sends an XP transaction to the network.
- -import { createAvalancheWalletClient } from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
// You can pass a local account otherwise a custom provider can be used
const account = privateKeyToAvalancheAccount("0x...")
const walletClient = createAvalancheWalletClient({
account,
chain: avalanche,
transport: { type: "http" },
})
const result = await walletClient.sendXPTransaction({
amount: "1000000000",
to: "X-avax1...",
assetID: "AVAX"
})
// Or you can use a custom provider (e.g. window.avalanche, window.ethereum, etc.)
const walletClient = createAvalancheWalletClient({
chain: avalanche,
transport: { type: "custom", provider: window.avalanche! },
})
const result = await walletClient.sendXPTransaction({
amount: "1000000000",
to: "X-avax1...",
assetID: "AVAX"
})
-
-
-Signs a message using the wallet's private key.
- -import { createAvalancheWalletClient } from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
// You can pass a local account otherwise a custom provider can be used
const account = privateKeyToAvalancheAccount("0x...")
const walletClient = createAvalancheWalletClient({
account,
chain: avalanche,
transport: { type: "http" },
})
const signedMessage = await walletClient.signXPMessage({
message: "Hello Avalanche",
address: "X-avax1..."
})
// Or you can use a custom provider (e.g. window.avalanche, window.ethereum, etc.)
const walletClient = createAvalancheWalletClient({
chain: avalanche,
transport: { type: "custom", provider: window.avalanche! },
})
const signedMessage = await walletClient.signXPMessage({
message: "Hello Avalanche",
address: "X-avax1..."
})
-
-
-Signs an XP transaction using the wallet's private key.
- -import { createAvalancheWalletClient } from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
// You can pass a local account otherwise a custom provider can be used
const account = privateKeyToAvalancheAccount("0x...")
const walletClient = createAvalancheWalletClient({
account,
chain: avalanche,
transport: { type: "http" },
})
const signedTx = await walletClient.signXPTransaction({
tx: "0x...",
address: "X-avax1..."
})
// Or you can use a custom provider (e.g. window.avalanche, window.ethereum, etc.)
const walletClient = createAvalancheWalletClient({
chain: avalanche,
transport: { type: "custom", provider: window.avalanche! },
})
const signedTx = await walletClient.signXPTransaction({
tx: "0x...",
address: "X-avax1..."
})
-
-
-Waits for a transaction to be confirmed on the network.
- -import { createAvalancheWalletClient } from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
const walletClient = createAvalancheWalletClient({
chain: avalanche,
transport: { type: "http" },
})
const result = await walletClient.waitForTxn({
txID: "0x...",
chainAlias: "P"
})
-
-
-OptionalxpAccount?: LocalXPAccountCreates a C-Chain (Contract Chain) Client with a given transport configured for a Chain.
-The C-Chain Client is an interface to interact with the Avalanche Contract Chain through Avalanche-specific JSON-RPC API methods. -The Contract Chain is an instance of the Ethereum Virtual Machine (EVM) that supports:
-A C-Chain Client. CChainClient
-Get the atomic transaction by its ID.
- -import { createAvalancheClient} from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
const client = createAvalancheClient({
chain: avalanche,
transport: {
type: "http",
},
})
const tx = await client.cChain.getAtomicTx({
txID: "2QouvMUbQ6oy7yQ9tLvL3L8tGQG2QK1wJ1q1wJ1q1wJ1q1wJ1q1wJ1q1wJ1"
})
-
-
-Get the status of an atomic transaction.
- -import { createAvalancheClient} from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
const client = createAvalancheClient({
chain: avalanche,
transport: {
type: "http",
},
})
const status = await client.cChain.getAtomicTxStatus({
txID: "2QouvMUbQ6oy7yQ9tLvL3L8tGQG2QK1wJ1q1wJ1q1wJ1q1wJ1q1wJ1q1wJ1"
})
-
-
-Get the UTXOs for a set of addresses.
- -import { createAvalancheClient} from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
const client = createAvalancheClient({
chain: avalanche,
transport: {
type: "http",
},
})
const utxos = await client.cChain.getUTXOs({
addresses: ["X-avax1...", "X-avax2..."],
limit: 100
})
-
-
-Send a signed transaction to the network.
- -import { createAvalancheClient} from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
const client = createAvalancheClient({
chain: avalanche,
transport: {
type: "http",
},
})
const txID = await client.cChain.issueTx({
tx: "0x00000009de31b4d8b22991d51aa6aa1fc733f23a851a8c9400000000000186a0000000005f041280000000005f9ca900000030390000000000000001fceda8f90fcb5d30614b99d79fc4baa29307762668f16eb0259a57c2d3b78c875c86ec2045792d4df2d926c40f829196e0bb97ee697af71f5b0a966dabff749634c8b729855e937715b0e44303fd1014daedc752006011b730",
encoding: "hex"
})
-
-
-Creates a Health API Client with a given transport configured for a Chain.
-The Health API Client is an interface to interact with the Health API through Avalanche-specific JSON-RPC API methods.
-A Health API Client. HealthApiClient
-Returns the last set of health check results for the node. -This includes checks for all chains, network, database, and other components.
- -import { createAvalancheClient} from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
const client = createAvalancheClient({
chain: avalanche,
transport: {
type: "http",
},
})
const healthStatus = await client.health.health({
tags: ["11111111111111111111111111111111LpoYY", "29uVeLPJB1eQJkzRemU8g8wZDw5uJRqpab5U2mX9euieVwiEbL"]
})
-
-
-Returns a simple health check indicating if the node is alive and can handle requests. -This is a lightweight check that always returns healthy if the endpoint is available.
- -Returns the last evaluation of the startup health check results. -This indicates if the node has finished initializing and is ready to handle requests.
- -import { createAvalancheClient} from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
const client = createAvalancheClient({
chain: avalanche,
transport: {
type: "http",
},
})
const readinessStatus = await client.health.readiness({
tags: ["11111111111111111111111111111111LpoYY"]
})
-
-
-Creates an Index API Client with a given transport configured for a Chain.
-The Index API Client is an interface to interact with the Index API through Avalanche-specific JSON-RPC API methods.
-An Index API Client. IndexApiClient
-Get container by ID.
- -import { createAvalancheClient} from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
const client = createAvalancheClient({
chain: avalanche,
transport: {
type: "http",
},
})
const container = await client.indexPChainBlock.getContainerByID({
id: "6fXf5hncR8LXvwtM8iezFQBpK5cubV6y1dWgpJCcNyzGB1EzY",
encoding: "hex"
})
-
-
-Get container by index.
- -import { createAvalancheClient} from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
const client = createAvalancheClient({
chain: avalanche,
transport: {
type: "http",
},
})
const container = await client.indexPChainBlock.getContainerByIndex({
index: 1,
encoding: "hex"
})
-
-
-Get a range of containers by their indices.
- -import { createAvalancheClient} from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
const client = createAvalancheClient({
chain: avalanche,
transport: {
type: "http",
},
})
const containers = await client.indexPChainBlock.getContainerRange({
startIndex: 0,
endIndex: 10,
encoding: "hex"
})
-
-
-Get the index of a container by its ID.
- -import { createAvalancheClient} from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
const client = createAvalancheClient({
chain: avalanche,
transport: {
type: "http",
},
})
const index = await client.indexPChainBlock.getIndex({
id: "6fXf5hncR8LXvwtM8iezFQBpK5cubV6y1dWgpJCcNyzGB1EzY",
encoding: "hex"
})
-
-
-Get the last accepted container.
- -import { createAvalancheClient} from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
const client = createAvalancheClient({
chain: avalanche,
transport: {
type: "http",
},
})
const lastAccepted = await client.indexPChainBlock.getLastAccepted({
encoding: "hex"
})
-
-
-Check if a container is accepted.
- -import { createAvalancheClient} from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
const client = createAvalancheClient({
chain: avalanche,
transport: {
type: "http",
},
})
const isAccepted = await client.indexPChainBlock.isAccepted({
id: "6fXf5hncR8LXvwtM8iezFQBpK5cubV6y1dWgpJCcNyzGB1EzY",
encoding: "hex"
})
-
-
-import { createIndexApiClient} from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
const client = createIndexApiClient({
chain: avalanche,
transport: {
type: "http",
},
})
// Get index P-Chain block
const block = await client.indexPChainBlock.getContainerByID({
id: '0x1',
encoding: 'hex'
})
-
-
-Creates an Info API Client with a given transport configured for a Chain.
-The Info API Client is an interface to interact with the Info API through Avalanche-specific JSON-RPC API methods.
-An Info API Client. InfoApiClient
-Returns peer preferences for Avalanche Community Proposals (ACPs).
- -Given a blockchain's alias, get its ID.
- -Get the ID of the network this node is participating in. -Network ID of 1 = Mainnet, Network ID of 5 = Fuji (testnet).
- -Get the name of the network this node is participating in.
- -Get the ID, the BLS key, and the proof of possession of this node. -Note: This endpoint is only available on specific nodes, not on public servers.
- -Get the IP address of this node.
- -Get the version of this node.
- -Get the transaction fee for this node.
- -Get the virtual machines (VMs) this node is running.
- -Check whether a given chain is done bootstrapping.
- -Get a description of peer connections.
- -Returns the upgrade history and configuration of the network.
- -Returns the network's observed uptime of this node. -This is the only reliable source of data for your node's uptime.
- -Creates a P-Chain (Platform Chain) Client with a given transport configured for a Chain.
-The P-Chain Client is an interface to interact with the Avalanche Platform Chain through JSON-RPC API methods. -The Platform Chain is responsible for:
-A P-Chain Client. PChainClient
-Get the balance of AVAX controlled by a given address.
- -import { createAvalancheClient} from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
const client = createAvalancheClient({
chain: avalanche,
transport: {
type: "http",
},
})
const balance = await client.pChain.getBalance({
addresses: ["P-custom18jma8ppw3nhx5r4ap8clazz0dps7rv5u9xde7p"]
})
-
-
-Get a block by its ID.
- -import { createAvalancheClient} from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
const client = createAvalancheClient({
chain: avalanche,
transport: {
type: "http",
},
})
const block = await client.pChain.getBlock({
blockID: "d7WYmb8VeZNHsny3EJCwMm6QA37s1EHwMxw1Y71V3FqPZ5EFG",
encoding: "hex"
})
-
-
-Get a block by its height.
- -import { createAvalancheClient} from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
const client = createAvalancheClient({
chain: avalanche,
transport: {
type: "http",
},
})
const block = await client.pChain.getBlockByHeight({
height: 1000001,
encoding: "hex"
})
-
-
-Get all the blockchains that exist (excluding the P-Chain).
- -Get the status of a blockchain.
- -import { createAvalancheClient} from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
const client = createAvalancheClient({
chain: avalanche,
transport: {
type: "http",
},
})
const status = await client.pChain.getBlockchainStatus({
blockchainID: "11111111111111111111111111111111LpoYY"
})
-
-
-Get the current supply of an asset.
- -import { createAvalancheClient} from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
const client = createAvalancheClient({
chain: avalanche,
transport: {
type: "http",
},
})
const supply = await client.pChain.getCurrentSupply({
assetID: "FvwEAhmxKfeiG8SnEvq42hc6whRyY3EFYAvebMqDNDGCgxN5Z"
})
-
-
-Get the current validators of the specified Subnet.
- -import { createAvalancheClient} from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
const client = createAvalancheClient({
chain: avalanche,
transport: {
type: "http",
},
})
const validators = await client.pChain.getCurrentValidators({
subnetID: "11111111111111111111111111111111LpoYY"
})
-
-
-Get the fee configuration for the P-Chain.
- -Get the current fee state of the P-Chain.
- -Get the height of the last accepted block.
- -Get the L1 validator information.
- -import { createAvalancheClient} from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
const client = createAvalancheClient({
chain: avalanche,
transport: {
type: "http",
},
})
const validator = await client.pChain.getL1Validator({
nodeID: "NodeID-111111111111111111111111111111111111111"
})
-
-
-Get the minimum stake amount for a subnet.
- -import { createAvalancheClient} from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
const client = createAvalancheClient({
chain: avalanche,
transport: {
type: "http",
},
})
const minStake = await client.pChain.getMinStake({
subnetID: "11111111111111111111111111111111LpoYY"
})
-
-
-Get the proposed height of the P-Chain.
- -Get the reward UTXOs for a transaction.
- -import { createAvalancheClient} from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
const client = createAvalancheClient({
chain: avalanche,
transport: {
type: "http",
},
})
const rewardUTXOs = await client.pChain.getRewardUTXOs({
txID: "11111111111111111111111111111111LpoYY",
encoding: "hex"
})
-
-
-Get the stake amount for a set of addresses.
- -import { createAvalancheClient} from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
const client = createAvalancheClient({
chain: avalanche,
transport: {
type: "http",
},
})
const stake = await client.pChain.getStake({
addresses: ["P-custom18jma8ppw3nhx5r4ap8clazz0dps7rv5u9xde7p"],
subnetID: "11111111111111111111111111111111LpoYY"
})
-
-
-Get the staking asset ID for a subnet.
- -import { createAvalancheClient} from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
const client = createAvalancheClient({
chain: avalanche,
transport: {
type: "http",
},
})
const stakingAssetID = await client.pChain.getStakingAssetID({
subnetID: "11111111111111111111111111111111LpoYY"
})
-
-
-Get information about a subnet.
- -import { createAvalancheClient} from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
const client = createAvalancheClient({
chain: avalanche,
transport: {
type: "http",
},
})
const subnet = await client.pChain.getSubnet({
subnetID: "11111111111111111111111111111111LpoYY"
})
-
-
-Get all subnets.
- -Get the current timestamp of the P-Chain.
- -Get the total stake amount for a subnet.
- -import { createAvalancheClient} from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
const client = createAvalancheClient({
chain: avalanche,
transport: {
type: "http",
},
})
const totalStake = await client.pChain.getTotalStake({
subnetID: "11111111111111111111111111111111LpoYY"
})
-
-
-Get a transaction by its ID.
- -import { createAvalancheClient} from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
const client = createAvalancheClient({
chain: avalanche,
transport: {
type: "http",
},
})
const tx = await client.pChain.getTx({
txID: "11111111111111111111111111111111LpoYY",
encoding: "hex"
})
-
-
-Get the status of a transaction.
- -import { createAvalancheClient} from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
const client = createAvalancheClient({
chain: avalanche,
transport: {
type: "http",
},
})
const status = await client.pChain.getTxStatus({
txID: "11111111111111111111111111111111LpoYY"
})
-
-
-Get the UTXOs for a set of addresses.
- -import { createAvalancheClient} from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
const client = createAvalancheClient({
chain: avalanche,
transport: {
type: "http",
},
})
const utxos = await client.pChain.getUTXOs({
addresses: ["P-custom18jma8ppw3nhx5r4ap8clazz0dps7rv5u9xde7p"],
sourceChain: "X"
})
-
-
-Get the validators at a specific height.
- -import { createAvalancheClient} from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
const client = createAvalancheClient({
chain: avalanche,
transport: {
type: "http",
},
})
const validators = await client.pChain.getValidatorsAt({
height: 1000001,
subnetID: "11111111111111111111111111111111LpoYY"
})
-
-
-Issue a transaction to the Platform Chain.
- -import { createAvalancheClient} from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
const client = createAvalancheClient({
chain: avalanche,
transport: {
type: "http",
},
})
const txID = await client.pChain.issueTx({
tx: "0x00000009de31b4d8b22991d51aa6aa1fc733f23a851a8c9400000000000186a0000000005f041280000000005f9ca900000030390000000000000001fceda8f90fcb5d30614b99d79fc4baa29307762668f16eb0259a57c2d3b78c875c86ec2045792d4df2d926c40f829196e0bb97ee697af71f5b0a966dabff749634c8b729855e937715b0e44303fd1014daedc752006011b730",
encoding: "hex"
})
-
-
-Sample validators from the specified Subnet.
- -import { createAvalancheClient} from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
const client = createAvalancheClient({
chain: avalanche,
transport: {
type: "http",
},
})
const validators = await client.pChain.sampleValidators({
size: 2,
subnetID: "11111111111111111111111111111111LpoYY"
})
-
-
-Get the Subnet that validates a given blockchain.
- -import { createAvalancheClient} from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
const client = createAvalancheClient({
chain: avalanche,
transport: {
type: "http",
},
})
const subnetID = await client.pChain.validatedBy({
blockchainID: "11111111111111111111111111111111LpoYY"
})
-
-
-Get the IDs of the blockchains a Subnet validates.
- -import { createAvalancheClient} from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
const client = createAvalancheClient({
chain: avalanche,
transport: {
type: "http",
},
})
const blockchainIDs = await client.pChain.validates({
subnetID: "11111111111111111111111111111111LpoYY"
})
-
-
-import { createPChainClient} from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
const client = createPChainClient({
chain: avalanche,
transport: {
type: "http",
},
})
// Get the current validators
const validators = await client.getCurrentValidators({})
// Get subnet information
const subnet = await client.getSubnet({ subnetID: 'subnet-id' })
-
-
-Creates an X-Chain (Exchange Chain) Client with a given transport configured for a Chain.
-The X-Chain Client is an interface to interact with the Avalanche Exchange Chain through JSON-RPC API methods. -The Exchange Chain is responsible for:
-An X-Chain Client. XChainClient
-Given a JSON representation of this Virtual Machine's genesis state, create the byte representation of that state.
- -import { createAvalancheClient} from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
const client = createAvalancheClient({
chain: avalanche,
transport: {
type: "http",
},
})
const genesis = await client.xChain.buildGenesis({
networkID: 16,
genesisData: {
asset1: {
name: "myFixedCapAsset",
symbol: "MFCA",
initialState: {
fixedCap: [
{
amount: 100000,
address: "avax13ery2kvdrkd2nkquvs892gl8hg7mq4a6ufnrn6"
}
]
}
}
}
})
-
-
-Get the balances of all assets controlled by given addresses.
- -import { createAvalancheClient} from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
const client = createAvalancheClient({
chain: avalanche,
transport: {
type: "http",
},
})
const balances = await client.xChain.getAllBalances({
addresses: ["X-avax18jma8ppw3nhx5r4ap8clazz0dps7rv5ukulre5"]
})
-
-
-Get information about an asset.
- -import { createAvalancheClient} from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
const client = createAvalancheClient({
chain: avalanche,
transport: {
type: "http",
},
})
const asset = await client.xChain.getAssetDescription({
assetID: "FvwEAhmxKfeiG8SnEvq42hc6whRyY3EFYAvebMqDNDGCgxN5Z"
})
-
-
-Get the balance of an asset controlled by given addresses.
- -import { createAvalancheClient} from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
const client = createAvalancheClient({
chain: avalanche,
transport: {
type: "http",
},
})
const balance = await client.xChain.getBalance({
addresses: ["X-avax18jma8ppw3nhx5r4ap8clazz0dps7rv5ukulre5"],
assetID: "FvwEAhmxKfeiG8SnEvq42hc6whRyY3EFYAvebMqDNDGCgxN5Z"
})
-
-
-Get a block by its ID.
- -import { createAvalancheClient} from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
const client = createAvalancheClient({
chain: avalanche,
transport: {
type: "http",
},
})
const block = await client.xChain.getBlock({
blockID: "d7WYmb8VeZNHsny3EJCwMm6QA37s1EHwMxw1Y71V3FqPZ5EFG",
encoding: "hex"
})
-
-
-Get a block by its height.
- -import { createAvalancheClient} from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
const client = createAvalancheClient({
chain: avalanche,
transport: {
type: "http",
},
})
const block = await client.xChain.getBlockByHeight({
height: 1000001,
encoding: "hex"
})
-
-
-Get the height of the last accepted block.
- -Get a transaction by its ID.
- -import { createAvalancheClient} from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
const client = createAvalancheClient({
chain: avalanche,
transport: {
type: "http",
},
})
const tx = await client.xChain.getTx({
txID: "11111111111111111111111111111111LpoYY",
encoding: "hex"
})
-
-
-Get the transaction fee for this node.
- -Get the status of a transaction.
- -import { createAvalancheClient} from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
const client = createAvalancheClient({
chain: avalanche,
transport: {
type: "http",
},
})
const status = await client.xChain.getTxStatus({
txID: "11111111111111111111111111111111LpoYY"
})
-
-
-Get the UTXOs for a set of addresses.
- -import { createAvalancheClient} from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
const client = createAvalancheClient({
chain: avalanche,
transport: {
type: "http",
},
})
const utxos = await client.xChain.getUTXOs({
addresses: ["X-avax18jma8ppw3nhx5r4ap8clazz0dps7rv5ukulre5"],
sourceChain: "P"
})
-
-
-Send a signed transaction to the network.
- -import { createAvalancheClient} from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
const client = createAvalancheClient({
chain: avalanche,
transport: {
type: "http",
},
})
const txID = await client.xChain.issueTx({
tx: "0x00000009de31b4d8b22991d51aa6aa1fc733f23a851a8c9400000000000186a0000000005f041280000000005f9ca900000030390000000000000001fceda8f90fcb5d30614b99d79fc4baa29307762668f16eb0259a57c2d3b78c875c86ec2045792d4df2d926c40f829196e0bb97ee697af71f5b0a966dabff749634c8b729855e937715b0e44303fd1014daedc752006011b730",
encoding: "hex"
})
-
-
-import { createXChainClient} from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
const client = createXChainClient({
chain: avalanche,
transport: {
type: "http",
},
})
// Get asset information
const asset = await client.getAssetDescription({ assetID: 'asset-id' })
// Get balance for an address
const balance = await client.getBalance({ address: 'X-avax...' })
-
-
-Assign an API endpoint an alias, a different endpoint for the API. -The original endpoint will still work. This change only affects this node.
- -The client to use. AvalancheCoreClient
-The endpoint and alias. AliasParameters
-Promise that resolves when the alias is set
-import { createAvalancheCoreClient } from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
import { alias } from '@avalanche-sdk/client/methods/admin'
const client = createAvalancheCoreClient({
chain: avalanche,
transport: {
type: "http",
url: "<url>",
},
});
await alias(client, {
endpoint: "bc/X",
alias: "myAlias"
});
-
-
-Give a blockchain an alias, a different name that can be used any place the blockchain's ID is used. -Note: The alias is set for each chain on each node individually.
- -The client to use. AvalancheCoreClient
-The chain and alias. AliasChainParameters
-Promise that resolves when the chain alias is set
-import { createAvalancheCoreClient } from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
import { aliasChain } from '@avalanche-sdk/client/methods/admin'
const client = createAvalancheCoreClient({
chain: avalanche,
transport: {
type: "http",
url: "<url>",
},
});
await aliasChain(client, {
chain: "sV6o671RtkGBcno1FiaDbVcFv2sG5aVXMZYzKdP4VQAWmJQnM",
alias: "myBlockchainAlias"
});
-
-
-Returns the aliases of the chain.
- -The client to use. AvalancheCoreClient
-The chain. GetChainAliasesParameters
-The aliases of the chain. GetChainAliasesReturnType
-import { createAvalancheCoreClient } from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
import { getChainAliases } from '@avalanche-sdk/client/methods/admin'
const client = createAvalancheCoreClient({
chain: avalanche,
transport: {
type: "http",
url: "<url>",
},
});
const aliases = await getChainAliases(client, {
chain: "sV6o671RtkGBcno1FiaDbVcFv2sG5aVXMZYzKdP4VQAWmJQnM"
});
-
-
-Returns log and display levels of loggers.
- -The client to use. AvalancheCoreClient
-The logger name. GetLoggerLevelParameters
-The log and display levels of loggers. GetLoggerLevelReturnType
-import { createAvalancheCoreClient } from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
import { getLoggerLevel } from '@avalanche-sdk/client/methods/admin'
const client = createAvalancheCoreClient({
chain: avalanche,
transport: {
type: "http",
url: "<url>",
},
});
const loggerLevels = await getLoggerLevel(client, {
loggerName: "C"
});
-
-
-Dynamically loads any virtual machines installed on the node as plugins.
- -The client to use. AvalancheCoreClient
-The virtual machines installed on the node. LoadVMsReturnType
-import { createAvalancheCoreClient } from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
import { loadVMs } from '@avalanche-sdk/client/methods/admin'
const client = createAvalancheCoreClient({
chain: avalanche,
transport: {
type: "http",
url: "<url>",
},
});
const vms = await loadVMs(client);
-
-
-Writes a profile of mutex statistics to lock.profile.
The client to use. AvalancheCoreClient
-Promise that resolves when the profile is written
-import { createAvalancheCoreClient } from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
import { lockProfile } from '@avalanche-sdk/client/methods/admin'
const client = createAvalancheCoreClient({
chain: avalanche,
transport: {
type: "http",
url: "<url>",
},
});
await lockProfile(client);
-
-
-Writes a memory profile of the node to mem.profile.
The client to use. AvalancheCoreClient
-Promise that resolves when the profile is written
-import { createAvalancheCoreClient } from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
import { memoryProfile } from '@avalanche-sdk/client/methods/admin'
const client = createAvalancheCoreClient({
chain: avalanche,
transport: {
type: "http",
url: "<url>",
},
});
await memoryProfile(client);
-
-
-Sets log and display levels of loggers.
- -The client to use. AvalancheCoreClient
-The logger name, log level, and display level. SetLoggerLevelParameters
-Promise that resolves when the logger levels are set
-import { createAvalancheCoreClient } from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
import { setLoggerLevel } from '@avalanche-sdk/client/methods/admin'
const client = createAvalancheCoreClient({
chain: avalanche,
transport: {
type: "http",
url: "<url>",
},
});
await setLoggerLevel(client, {
loggerName: "C",
logLevel: "DEBUG",
displayLevel: "INFO"
});
-
-
-Start profiling the CPU utilization of the node.
-To stop, call stopCPUProfiler. On stop, writes the profile to cpu.profile.
The client to use. AvalancheCoreClient
-Promise that resolves when the profiler is started
-import { createAvalancheCoreClient} from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
import { startCPUProfiler } from '@avalanche-sdk/client/methods/admin'
const client = createAvalancheCoreClient({
chain: avalanche,
transport: {
type: "http",
url: "<url>",
},
});
await startCPUProfiler(client);
-
-
-Stop the CPU profile that was previously started.
- -The client to use. AvalancheCoreClient
-Promise that resolves when the profiler is stopped
-import { createAvalancheCoreClient } from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
import { stopCPUProfiler } from '@avalanche-sdk/client/methods/admin'
const client = createAvalancheCoreClient({
chain: avalanche,
transport: {
type: "http",
url: "<url>",
},
});
await stopCPUProfiler(client);
-
-
-Get the atomic transaction by its ID.
- -The client to use. AvalancheCoreClient
-The parameters to use. GetAtomicTxParameters
-The atomic transaction. GetAtomicTxReturnType
-import { createAvalancheCoreClient } from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
const client = createAvalancheCoreClient({
chain: avalanche,
transport: {
type: "http",
url: "<url>",
},
})
const tx = await getAtomicTx(client, {
txID: "2QouvMUbQ6oy7yQ9tLvL3L8tGQG2QK1wJ1q1wJ1q1wJ1q1wJ1q1wJ1q1wJ1"
})
-
-
-Get the status of an atomic transaction.
- -The client to use. AvalancheCoreClient
-The parameters to use. GetAtomicTxStatusParameters
-The status of the atomic transaction. GetAtomicTxStatusReturnType
-import { createAvalancheCoreClient } from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
import { getAtomicTxStatus } from '@avalanche-sdk/client/methods/cChain'
const client = createAvalancheCoreClient({
chain: avalanche,
transport: {
type: "http",
url: "<url>",
},
})
const status = await getAtomicTxStatus(client, {
txID: "2QouvMUbQ6oy7yQ9tLvL3L8tGQG2QK1wJ1q1wJ1q1wJ1q1wJ1q1wJ1q1wJ1"
})
-
-
-Get the UTXOs for a set of addresses.
- -The client to use. AvalancheCoreClient
-The parameters to use. GetUTXOsParameters
-The UTXOs for a set of addresses. GetUTXOsReturnType
-import { createAvalancheCoreClient } from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
import { getUTXOs } from '@avalanche-sdk/client/methods/cChain'
const client = createAvalancheCoreClient({
chain: avalanche,
transport: {
type: "http",
url: "<url>",
},
})
const utxos = await getUTXOs(client, {
addresses: ["X-avax1...", "X-avax2..."],
limit: 100
})
-
-
-Issue a transaction to the C-Chain.
- -The client to use. AvalancheCoreClient
-The parameters to use. IssueTxParameters
-The transaction ID. IssueTxReturnType
-import { createAvalancheCoreClient } from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
import { issueTx } from '@avalanche-sdk/client/methods/cChain'
const client = createAvalancheCoreClient({
chain: avalanche,
transport: {
type: "http",
url: "<url>",
},
})
const txID = await issueTx(client, {
tx: "0x00000009de31b4d8b22991d51aa6aa1fc733f23a851a8c9400000000000186a0000000005f041280000000005f9ca900000030390000000000000001fceda8f90fcb5d30614b99d79fc4baa29307762668f16eb0259a57c2d3b78c875c86ec2045792d4df2d926c40f829196e0bb97ee697af71f5b0a966dabff749634c8b729855e937715b0e44303fd1014daedc752006011b730",
encoding: "hex"
})
-
-
-Returns the last set of health check results for the node. -This includes checks for all chains, network, database, and other components.
- -The client to use. AvalancheCoreClient
-Optional tags to filter health checks. HealthParameters
-The health check results. HealthReturnType
-import { createAvalancheCoreClient } from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
import { health } from '@avalanche-sdk/client/methods/health'
const client = createAvalancheCoreClient({
chain: avalanche,
transport: {
type: "http",
url: "<url>",
},
})
const healthStatus = await health(client, {
tags: ["11111111111111111111111111111111LpoYY", "29uVeLPJB1eQJkzRemU8g8wZDw5uJRqpab5U2mX9euieVwiEbL"]
})
-
-
-Returns a simple health check indicating if the node is alive and can handle requests. -This is a lightweight check that always returns healthy if the endpoint is available.
- -The client to use. AvalancheCoreClient
-The liveness check results. LivenessReturnType
-import { createAvalancheCoreClient } from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
import { liveness } from '@avalanche-sdk/client/methods/health'
const client = createAvalancheCoreClient({
chain: avalanche,
transport: {
type: "http",
url: "<url>",
},
})
const livenessStatus = await liveness(client)
-
-
-Returns the last evaluation of the startup health check results. -This indicates if the node has finished initializing and is ready to handle requests.
- -The client to use. AvalancheCoreClient
-Optional tags to filter readiness checks. ReadinessParameters
-The readiness check results. ReadinessReturnType
-import { createAvalancheCoreClient } from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
import { readiness } from '@avalanche-sdk/client/methods/health'
const client = createAvalancheCoreClient({
chain: avalanche,
transport: {
type: "http",
url: "<url>",
},
})
const readinessStatus = await readiness(client, {
tags: ["11111111111111111111111111111111LpoYY"]
})
-
-
-Get container by ID.
- -The client to use. AvalancheCoreClient
-The container ID and encoding. GetContainerByIDParameters
-The container details. GetContainerByIDReturnType
-import { createAvalancheCoreClient } from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
import { getContainerByID } from '@avalanche-sdk/client/methods/index'
const client = createAvalancheCoreClient({
chain: avalanche,
transport: {
type: "http",
url: "<url>",
},
})
const container = await getContainerByID(client, {
id: "6fXf5hncR8LXvwtM8iezFQBpK5cubV6y1dWgpJCcNyzGB1EzY",
encoding: "hex"
})
-
-
-Get container by index.
- -The client to use. AvalancheCoreClient
-The index and encoding. GetContainerByIndexParameters
-The container details. GetContainerByIndexReturnType
-import { createAvalancheCoreClient } from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
import { getContainerByIndex } from '@avalanche-sdk/client/methods/index'
const client = createAvalancheCoreClient({
chain: avalanche,
transport: {
type: "http",
url: "<url>",
},
})
const container = await getContainerByIndex(client, {
index: 1,
encoding: "hex"
})
-
-
-Get a range of containers by their indices.
- -The client to use. AvalancheCoreClient
-The start index, end index, and encoding. GetContainerRangeParameters
-The container details. GetContainerRangeReturnType
-import { createAvalancheCoreClient } from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
import { getContainerRange } from '@avalanche-sdk/client/methods/index'
const client = createAvalancheCoreClient({
chain: avalanche,
transport: {
type: "http",
url: "<url>",
},
})
const containers = await getContainerRange(client, {
startIndex: 0,
endIndex: 10,
encoding: "hex"
})
-
-
-Get the index of a container by its ID.
- -The client to use. AvalancheCoreClient
-The container ID and encoding. GetIndexParameters
-The container index. GetIndexReturnType
-import { createAvalancheCoreClient } from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
import { getIndex } from '@avalanche-sdk/client/methods/index'
const client = createAvalancheCoreClient({
chain: avalanche,
transport: {
type: "http",
url: "<url>",
},
})
const index = await getIndex(client, {
id: "6fXf5hncR8LXvwtM8iezFQBpK5cubV6y1dWgpJCcNyzGB1EzY",
encoding: "hex"
})
-
-
-Get the last accepted container.
- -The client to use. AvalancheCoreClient
-The encoding. GetLastAcceptedParameters
-The last accepted container. GetLastAcceptedReturnType
-import { createAvalancheCoreClient } from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
import { getLastAccepted } from '@avalanche-sdk/client/methods/index'
const client = createAvalancheCoreClient({
chain: avalanche,
transport: {
type: "http",
url: "<url>",
},
})
const lastAccepted = await getLastAccepted(client, {
encoding: "hex"
})
-
-
-Check if a container is accepted.
- -The client to use. AvalancheCoreClient
-The container ID and encoding. IsAcceptedParameters
-Whether the container is accepted. IsAcceptedReturnType
-import { createAvalancheCoreClient } from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
import { isAccepted } from '@avalanche-sdk/client/methods/index'
const client = createAvalancheCoreClient({
chain: avalanche,
transport: {
type: "http",
url: "<url>",
},
})
const accepted = await isAccepted(client, {
id: "6fXf5hncR8LXvwtM8iezFQBpK5cubV6y1dWgpJCcNyzGB1EzY",
encoding: "hex"
})
-
-
-Returns peer preferences for Avalanche Community Proposals (ACPs).
- -The client to use.
-The ACP preferences. AcpsReturnType
-import { createInfoApiClient } from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
import { acps } from '@avalanche-sdk/client/methods/info'
const client = createInfoApiClient({
chain: avalanche,
transport: {
type: "http",
},
})
const acpPreferences = await acps(client)
-
-
-Given a blockchain's alias, get its ID.
- -The client to use. AvalancheCoreClient
-The blockchain alias. GetBlockchainIDParameters
-The blockchain ID. GetBlockchainIDReturnType
-import { createAvalancheCoreClient } from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
import { getBlockchainID } from '@avalanche-sdk/client/methods/info'
const client = createAvalancheCoreClient({
chain: avalanche,
transport: {
type: "http",
url: "<url>",
},
})
const blockchainID = await getBlockchainID(client, {
alias: "X"
})
-
-
-Get the ID of the network this node is participating in. -Network ID of 1 = Mainnet, Network ID of 5 = Fuji (testnet).
- -The client to use. AvalancheCoreClient
-The network ID. GetNetworkIDReturnType
-import { createAvalancheCoreClient } from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
import { getNetworkID } from '@avalanche-sdk/client/methods/info'
const client = createAvalancheCoreClient({
chain: avalanche,
transport: {
type: "http",
url: "<url>",
},
})
const networkID = await getNetworkID(client)
-
-
-Get the name of the network this node is participating in.
- -The client to use. AvalancheCoreClient
-The network name. GetNetworkNameReturnType
-import { createAvalancheCoreClient } from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
import { getNetworkName } from '@avalanche-sdk/client/methods/info'
const client = createAvalancheCoreClient({
chain: avalanche,
transport: {
type: "http",
url: "<url>",
},
})
const networkName = await getNetworkName(client)
-
-
-Get the ID, the BLS key, and the proof of possession of this node. -Note: This endpoint is only available on specific nodes, not on public servers.
- -The client to use. AvalancheCoreClient
-The node ID and BLS key information. GetNodeIDReturnType
-import { createAvalancheCoreClient } from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
import { getNodeID } from '@avalanche-sdk/client/methods/info'
const client = createAvalancheCoreClient({
chain: avalanche,
transport: {
type: "http",
url: "<url>",
},
})
const nodeInfo = await getNodeID(client)
-
-
-Get the IP address of this node.
- -The client to use. AvalancheCoreClient
-The node's IP address. GetNodeIPReturnType
-import { createAvalancheCoreClient } from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
import { getNodeIP } from '@avalanche-sdk/client/methods/info'
const client = createAvalancheCoreClient({
chain: avalanche,
transport: {
type: "http",
url: "<url>",
},
})
const nodeIP = await getNodeIP(client)
-
-
-Get the version of this node.
- -The client to use. AvalancheCoreClient
-The node's version. GetNodeVersionReturnType
-import { createAvalancheCoreClient } from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
import { getNodeVersion } from '@avalanche-sdk/client/methods/info'
const client = createAvalancheCoreClient({
chain: avalanche,
transport: {
type: "http",
url: "<url>",
},
})
const nodeVersion = await getNodeVersion(client)
-
-
-Get the transaction fee for this node.
- -The client to use. AvalancheCoreClient
-The transaction fee. GetTxFeeReturnType
-import { createAvalancheCoreClient } from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
import { getTxFee } from '@avalanche-sdk/client/methods/info'
const client = createAvalancheCoreClient({
chain: avalanche,
transport: {
type: "http",
url: "<url>",
},
})
const txFee = await getTxFee(client)
-
-
-Get the virtual machines (VMs) this node is running.
- -The client to use. AvalancheCoreClient
-The VMs running on this node. GetVMsReturnType
-import { createAvalancheCoreClient } from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
import { getVMs } from '@avalanche-sdk/client/methods/info'
const client = createAvalancheCoreClient({
chain: avalanche,
transport: {
type: "http",
url: "<url>",
},
})
const vms = await getVMs(client)
-
-
-Check whether a given chain is done bootstrapping.
- -The client to use. AvalancheCoreClient
-The chain ID or alias. IsBootstrappedParameters
-Whether the chain is bootstrapped. IsBootstrappedReturnType
-import { createAvalancheCoreClient } from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
import { isBootstrapped } from '@avalanche-sdk/client/methods/info'
const client = createAvalancheCoreClient({
chain: avalanche,
transport: {
type: "http",
url: "<url>",
},
})
const isBootstrapped = await isBootstrapped(client, {
chain: "X"
})
-
-
-Get a description of peer connections.
- -The client to use. AvalancheCoreClient
-Optional node IDs to filter peers. PeersParameters
-Information about connected peers. PeersReturnType
-import { createAvalancheCoreClient } from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
import { peers } from '@avalanche-sdk/client/methods/info'
const client = createAvalancheCoreClient({
chain: avalanche,
transport: {
type: "http",
url: "<url>",
},
})
const peers = await peers(client, {
nodeIDs: []
})
-
-
-Returns the upgrade history and configuration of the network.
- -The client to use. AvalancheCoreClient
-The network upgrade information. UpgradesReturnType
-import { createAvalancheCoreClient } from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
import { upgrades } from '@avalanche-sdk/client/methods/info'
const client = createAvalancheCoreClient({
chain: avalanche,
transport: {
type: "http",
url: "<url>",
},
})
const upgrades = await upgrades(client)
-
-
-Returns the network's observed uptime of this node. -This is the only reliable source of data for your node's uptime.
- -The client to use. AvalancheCoreClient
-The node's uptime statistics. UptimeReturnType
-import { createAvalancheCoreClient } from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
import { uptime } from '@avalanche-sdk/client/methods/info'
const client = createAvalancheCoreClient({
chain: avalanche,
transport: {
type: "http",
url: "<url>",
},
})
const uptime = await uptime(client)
-
-
-Get the balance of AVAX controlled by a given address.
- -The client to use. AvalancheCoreClient
-The addresses to get the balance of GetBalanceParameters
-The balance information. GetBalanceReturnType
-import { createAvalancheCoreClient } from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
import { getBalance } from '@avalanche-sdk/client/methods/pChain'
const client = createAvalancheCoreClient({
chain: avalanche,
transport: {
type: "http",
url: "<url>",
},
})
const balance = await getBalance(client, {
addresses: ["P-custom18jma8ppw3nhx5r4ap8clazz0dps7rv5u9xde7p"]
})
-
-
-Get a block by its ID.
- -The client to use. AvalancheCoreClient
-The block ID and encoding format GetBlockParameters
-The block data. GetBlockReturnType
-import { createAvalancheCoreClient } from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
import { getBlock } from '@avalanche-sdk/client/methods/pChain'
const client = createAvalancheCoreClient({
chain: avalanche,
transport: {
type: "http",
url: "<url>",
},
})
const block = await getBlock(client, {
blockID: "d7WYmb8VeZNHsny3EJCwMm6QA37s1EHwMxw1Y71V3FqPZ5EFG",
encoding: "hex"
})
-
-
-Get a block by its height.
- -The client to use to make the request AvalancheCoreClient
-The block height and encoding format GetBlockByHeightParameters
-The block data. GetBlockByHeightReturnType
-import { createAvalancheCoreClient } from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
import { getBlockByHeight } from '@avalanche-sdk/client/methods/pChain'
const client = createAvalancheCoreClient({
chain: avalanche,
transport: {
type: "http",
url: "<url>",
},
})
const block = await getBlockByHeight(client, {
height: 1000001,
encoding: "hex"
})
-
-
-Get the status of a blockchain.
- -The client to use to make the request AvalancheCoreClient
-The blockchain ID GetBlockchainStatusParameters
-The blockchain status. GetBlockchainStatusReturnType
-import { createAvalancheCoreClient } from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
import { getBlockchainStatus } from '@avalanche-sdk/client/methods/pChain'
const client = createAvalancheCoreClient({
chain: avalanche,
transport: {
type: "http",
url: "<url>",
},
})
const status = await getBlockchainStatus(client, {
blockchainID: "11111111111111111111111111111111LpoYY"
})
-
-
-Get all the blockchains that exist (excluding the P-Chain).
- -The client to use to make the request AvalancheCoreClient
-The list of blockchains. GetBlockchainsReturnType
-import { createAvalancheCoreClient } from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
import { getBlockchains } from '@avalanche-sdk/client/methods/pChain'
const client = createAvalancheCoreClient({
chain: avalanche,
transport: {
type: "http",
url: "<url>",
},
})
const blockchains = await getBlockchains(client)
-
-
-Get the current supply of an asset.
- -The client to use to make the request AvalancheCoreClient
-The asset ID GetCurrentSupplyParameters
-The current supply. GetCurrentSupplyReturnType
-import { createAvalancheCoreClient } from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
import { getCurrentSupply } from '@avalanche-sdk/client/methods/pChain'
const client = createAvalancheCoreClient({
chain: avalanche,
transport: {
type: "http",
url: "<url>",
},
})
const supply = await getCurrentSupply(client, {
assetID: "FvwEAhmxKfeiG8SnEvq42hc6whRyY3EFYAvebMqDNDGCgxN5Z"
})
-
-
-Get the current validators of the specified Subnet.
- -The client to use. AvalancheCoreClient
-The subnet ID GetCurrentValidatorsParameters
-The current validators. GetCurrentValidatorsReturnType
-import { createAvalancheCoreClient } from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
import { getCurrentValidators } from '@avalanche-sdk/client/methods/pChain'
const client = createAvalancheCoreClient({
chain: avalanche,
transport: {
type: "http",
url: "<url>",
},
})
const validators = await getCurrentValidators(client, {
subnetID: "11111111111111111111111111111111LpoYY"
})
-
-
-Get the fee configuration for the P-Chain.
- -The client to use. AvalancheCoreClient
-The fee configuration. GetFeeConfigReturnType
-import { createAvalancheCoreClient } from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
import { getFeeConfig } from '@avalanche-sdk/client/methods/pChain'
const client = createAvalancheCoreClient({
chain: avalanche,
transport: {
type: "http",
url: "<url>",
},
})
const feeConfig = await getFeeConfig(client)
-
-
-Get the current fee state of the P-Chain.
- -The client to use. AvalancheCoreClient
-The fee state. GetFeeStateReturnType
-import { createAvalancheCoreClient } from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
import { getFeeState } from '@avalanche-sdk/client/methods/pChain'
const client = createAvalancheCoreClient({
chain: avalanche,
transport: {
type: "http",
url: "<url>",
},
})
const feeState = await getFeeState(client)
-
-
-Get the height of the last accepted block.
- -The client to use. AvalancheCoreClient
-The current height. GetHeightReturnType
-import { createAvalancheCoreClient } from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
import { getHeight } from '@avalanche-sdk/client/methods/pChain'
const client = createAvalancheCoreClient({
chain: avalanche,
transport: {
type: "http",
url: "<url>",
},
})
const height = await getHeight(client)
-
-
-Get the L1 validator information.
- -The client to use. AvalancheCoreClient
-The validator node ID GetL1ValidatorParameters
-The L1 validator information. GetL1ValidatorReturnType
-import { createAvalancheCoreClient } from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
import { getL1Validator } from '@avalanche-sdk/client/methods/pChain'
const client = createAvalancheCoreClient({
chain: avalanche,
transport: {
type: "http",
url: "<url>",
},
})
const validator = await getL1Validator(client, {
nodeID: "NodeID-111111111111111111111111111111111111111"
})
-
-
-Get the minimum stake amount for a subnet.
- -The client to use. AvalancheCoreClient
-The subnet ID GetMinStakeParameters
-The minimum stake amount. GetMinStakeReturnType
-import { createAvalancheCoreClient } from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
import { getMinStake } from '@avalanche-sdk/client/methods/pChain'
const client = createAvalancheCoreClient({
chain: avalanche,
transport: {
type: "http",
url: "<url>",
},
})
const minStake = await getMinStake(client, {
subnetID: "11111111111111111111111111111111LpoYY"
})
-
-
-Get the proposed height of the P-Chain.
- -The client to use to make the request AvalancheCoreClient
-The proposed height. GetProposedHeightReturnType
-import { createAvalancheCoreClient } from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
import { getProposedHeight } from '@avalanche-sdk/client/methods/pChain'
const client = createAvalancheCoreClient({
chain: avalanche,
transport: {
type: "http",
url: "<url>",
},
})
const proposedHeight = await getProposedHeight(client)
-
-
-Get the reward UTXOs for a transaction.
- -The client to use. AvalancheCoreClient
-The transaction ID and encoding GetRewardUTXOsParameters
-The reward UTXOs. GetRewardUTXOsReturnType
-import { createAvalancheCoreClient } from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
import { getRewardUTXOs } from '@avalanche-sdk/client/methods/pChain'
const client = createAvalancheCoreClient({
chain: avalanche,
transport: {
type: "http",
url: "<url>",
},
})
const rewardUTXOs = await getRewardUTXOs(client, {
txID: "11111111111111111111111111111111LpoYY",
encoding: "hex"
})
-
-
-Get the stake amount for a set of addresses.
- -The client to use. AvalancheCoreClient
-The addresses and subnet ID GetStakeParameters
-The stake amount. GetStakeReturnType
-import { createAvalancheCoreClient } from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
import { getStake } from '@avalanche-sdk/client/methods/pChain'
const client = createAvalancheCoreClient({
chain: avalanche,
transport: {
type: "http",
url: "<url>",
},
})
const stake = await getStake(client, {
addresses: ["P-custom18jma8ppw3nhx5r4ap8clazz0dps7rv5u9xde7p"],
subnetID: "11111111111111111111111111111111LpoYY"
})
-
-
-Get the staking asset ID for a subnet.
- -The client to use. AvalancheCoreClient
-The subnet ID GetStakingAssetIDParameters
-The staking asset ID. GetStakingAssetIDReturnType
-import { createAvalancheCoreClient } from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
import { getStakingAssetID } from '@avalanche-sdk/client/methods/pChain'
const client = createAvalancheCoreClient({
chain: avalanche,
transport: {
type: "http",
url: "<url>",
},
})
const stakingAssetID = await getStakingAssetID(client, {
subnetID: "11111111111111111111111111111111LpoYY"
})
-
-
-Get information about a subnet.
- -The client to use. AvalancheCoreClient
-The subnet ID GetSubnetParameters
-Information about the subnet. GetSubnetReturnType
-import { createAvalancheCoreClient } from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
import { getSubnet } from '@avalanche-sdk/client/methods/pChain'
const client = createAvalancheCoreClient({
chain: avalanche,
transport: {
type: "http",
url: "<url>",
},
})
const subnet = await getSubnet(client, {
subnetID: "11111111111111111111111111111111LpoYY"
})
-
-
-Get all subnets.
- -The client to use. AvalancheCoreClient
-Optional parameters GetSubnetsParameters
-The list of subnets. GetSubnetsReturnType
-import { createAvalancheCoreClient } from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
import { getSubnets } from '@avalanche-sdk/client/methods/pChain'
const client = createAvalancheCoreClient({
chain: avalanche,
transport: {
type: "http",
url: "<url>",
},
})
const subnets = await getSubnets(client, {})
-
-
-Get the current timestamp of the P-Chain.
- -The client to use. AvalancheCoreClient
-The current timestamp. GetTimestampReturnType
-import { createAvalancheCoreClient } from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
import { getTimestamp } from '@avalanche-sdk/client/methods/pChain'
const client = createAvalancheCoreClient({
chain: avalanche,
transport: {
type: "http",
url: "<url>",
},
})
const timestamp = await getTimestamp(client)
-
-
-Get the total stake amount for a subnet.
- -The client to use. AvalancheCoreClient
-The subnet ID GetTotalStakeParameters
-The total stake amount. GetTotalStakeReturnType
-import { createAvalancheCoreClient } from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
import { getTotalStake } from '@avalanche-sdk/client/methods/pChain'
const client = createAvalancheCoreClient({
chain: avalanche,
transport: {
type: "http",
url: "<url>",
},
})
const totalStake = await getTotalStake(client, {
subnetID: "11111111111111111111111111111111LpoYY"
})
-
-
-Get a transaction by its ID.
- -The client to use. AvalancheCoreClient
-The transaction ID and encoding GetTxParameters
-The transaction data. GetTxReturnType
-import { createAvalancheCoreClient } from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
import { getTx } from '@avalanche-sdk/client/methods/pChain'
const client = createAvalancheCoreClient({
chain: avalanche,
transport: {
type: "http",
url: "<url>",
},
})
const tx = await getTx(client, {
txID: "11111111111111111111111111111111LpoYY",
encoding: "hex"
})
-
-
-Get the status of a transaction.
- -The client to use. AvalancheCoreClient
-The transaction ID GetTxStatusParameters
-The transaction status. GetTxStatusReturnType
-import { createAvalancheCoreClient } from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
import { getTxStatus } from '@avalanche-sdk/client/methods/pChain'
const client = createAvalancheCoreClient({
chain: avalanche,
transport: {
type: "http",
url: "<url>",
},
})
const status = await getTxStatus(client, {
txID: "11111111111111111111111111111111LpoYY"
})
-
-
-Get the UTXOs for a set of addresses.
- -The client to use. AvalancheCoreClient
-The addresses and source chain GetUTXOsParameters
-The UTXOs. GetUTXOsReturnType
-import { createAvalancheCoreClient } from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
import { getUTXOs } from '@avalanche-sdk/client/methods/pChain'
const client = createAvalancheCoreClient({
chain: avalanche,
transport: {
type: "http",
url: "<url>",
},
})
const utxos = await getUTXOs(client, {
addresses: ["P-custom18jma8ppw3nhx5r4ap8clazz0dps7rv5u9xde7p"],
sourceChain: "X"
})
-
-
-Get the validators at a specific height.
- -The client to use. AvalancheCoreClient
-The height and subnet ID GetValidatorsAtParameters
-The validators at that height. GetValidatorsAtReturnType
-import { createAvalancheCoreClient } from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
import { getValidatorsAt } from '@avalanche-sdk/client/methods/pChain'
const client = createAvalancheCoreClient({
chain: avalanche,
transport: {
type: "http",
url: "<url>",
},
})
const validators = await getValidatorsAt(client, {
height: 1000001,
subnetID: "11111111111111111111111111111111LpoYY"
})
-
-
-Issue a transaction to the Platform Chain.
- -The client to use. AvalancheCoreClient
-The transaction bytes and encoding IssueTxParameters
-The transaction ID. IssueTxReturnType
-import { createAvalancheCoreClient } from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
import { issueTx } from '@avalanche-sdk/client/methods/pChain'
const client = createAvalancheCoreClient({
chain: avalanche,
transport: {
type: "http",
url: "<url>",
},
})
const txID = await issueTx(client, {
tx: "0x00000009de31b4d8b22991d51aa6aa1fc733f23a851a8c9400000000000186a0000000005f041280000000005f9ca900000030390000000000000001fceda8f90fcb5d30614b99d79fc4baa29307762668f16eb0259a57c2d3b78c875c86ec2045792d4df2d926c40f829196e0bb97ee697af71f5b0a966dabff749634c8b729855e937715b0e44303fd1014daedc752006011b730",
encoding: "hex"
})
-
-
-Sample validators from the specified Subnet.
- -The client to use. AvalancheCoreClient
-The number of validators to sample and subnet ID SampleValidatorsParameters
-The sampled validators. SampleValidatorsReturnType
-import { createAvalancheCoreClient } from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
import { sampleValidators } from '@avalanche-sdk/client/methods/pChain'
const client = createAvalancheCoreClient({
chain: avalanche,
transport: {
type: "http",
url: "<url>",
},
})
const validators = await sampleValidators(client, {
size: 2,
subnetID: "11111111111111111111111111111111LpoYY"
})
-
-
-Get the validators that validated a transaction.
- -The client to use. AvalancheCoreClient
-The transaction ID ValidatedByParameters
-The validators that validated the transaction. ValidatedByReturnType
-import { createAvalancheCoreClient } from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
import { validatedBy } from '@avalanche-sdk/client/methods/pChain'
const client = createAvalancheCoreClient({
chain: avalanche,
transport: {
type: "http",
url: "<url>",
},
})
const validators = await validatedBy(client, {
txID: "11111111111111111111111111111111LpoYY"
})
-
-
-Validates a transaction.
- -The client to use. AvalancheCoreClient
-The parameters for the request
-The result of the validation. ValidatesReturnType
-import { createAvalancheCoreClient } from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
import { validates } from '@avalanche-sdk/client/methods/pChain'
const client = createAvalancheCoreClient({
chain: avalanche,
transport: {
type: "http",
url: "<url>",
},
})
const result = await validates(client, {
tx: "0x1234567890abcdef",
})
-
-
-Get the base fee for the next block.
- -The client to use.
-The base fee for the next block. BaseFeeReturnType
-Get the fee config for a specific block.
-The client to use.
-The block number or hash to get the fee config for. FeeConfigParameters
-The fee config for the specified block. FeeConfigReturnType
-import { createClient, http } from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
import { feeConfig } from '@avalanche-sdk/client/methods/public'
const client = createClient({
chain: avalanche,
transport: http(),
})
const feeConfig = await feeConfig(client, { blk: "0x1" })
-
-
-Get the active rules at a specific timestamp.
-The client to use.
-The timestamp to get the active rules at. GetActiveRulesAtParameters
-The active rules at the specified timestamp. GetActiveRulesAtReturnType
-import { createClient, http } from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
import { getActiveRulesAt } from '@avalanche-sdk/client/methods/public'
const client = createClient({
chain: avalanche,
transport: http(),
})
const activeRules = await getActiveRulesAt(client, { timestamp: "0x1" })
-
-
-Get the chain configuration for the C-Chain.
- -The client to use.
-The chain configuration for the C-Chain. GetChainConfigReturnType
-import { createClient, http } from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
import { getChainConfig } from '@avalanche-sdk/client/methods/public'
const client = createClient({
chain: avalanche,
transport: http(),
})
const chainConfig = await getChainConfig(client)
-
-
-Get the maximum priority fee per gas for the next block.
- -The client to use.
-The maximum priority fee per gas for the next block. MaxPriorityFeePerGasReturnType
-import { createClient, http } from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
import { maxPriorityFeePerGas } from '@avalanche-sdk/client/methods/public'
const client = createClient({
chain: avalanche,
transport: http(),
})
const maxPriorityFeePerGas = await maxPriorityFeePerGas(client)
-
-
-Get the public key of the account
-The client to use AvalancheWalletCoreClient
-The public key of the account GetAccountPubKeyReturnType
-import { createWalletCoreClient, http } from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
import { getAccountPubKey } from '@avalanche-sdk/client/methods/wallet'
// Create an local avalanche account otherwise pass custom transport
const privateKey = "0x..."
const account = privateKeyToAvalancheAccount(privateKey)
// Create a wallet core client
const client = createWalletCoreClient({
chain: avalanche,
transport: {
type: "http",
url: "https://api.avax.network/ext/bc/C/rpc",
},
account,
})
// or pass custom transport
const client = createWalletCoreClient({
chain: avalanche,
transport: {
type: "custom",
provider: window.avalanche!,
},
})
const pubKey = await getAccountPubKey(client)
-
-
-Sends tokens from the source chain to the destination chain.
-The client to use for the transaction. AvalancheWalletCoreClient
-The parameters for the transaction. SendParameters
-The hashes of the transactions. SendReturnType
-import { AvalancheWalletCoreClient } from "@avalabs/wallet-core-client";
import { send } from "@avalabs/wallet-core-client/methods/wallet/send";
const client = new AvalancheWalletCoreClient({
network: "mainnet",
transport: {
type: "custom",
provider: window.avalanche,
},
});
const txHashes = await send(client, {
amount: 1,
to: "0x0000000000000000000000000000000000000000",
-
-
-Send an transaction to the X, P or C chain
-The client to use AvalancheWalletCoreClient
-The parameters for the transaction SendXPTransactionParameters
-The transaction hash SendXPTransactionReturnType
-import { createWalletCoreClient, http } from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
import { sendXPTransaction } from '@avalanche-sdk/client/methods/wallet'
const client = createWalletCoreClient({
chain: avalanche,
transport: {
type: "custom",
provider: window.avalanche!,
},
})
const txHash = await sendXPTransaction(client, {
txOrTxHex: "0x...",
chainAlias: "P",
})
-
-
-Sign a message with the account
-The client to use AvalancheWalletCoreClient
-The parameters for the message SignXPMessageParameters
-The signature of the message with double checksum SignXPMessageReturnType encoded in CB58 format -The signature is for the following string: -"0x1A" + "Avalanche Signed Message:\n" + "size of message represented in 4 bytes" + message
-import { createWalletCoreClient, http } from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
import { signXPMessage } from '@avalanche-sdk/client/methods/wallet'
const client = createWalletCoreClient({
chain: avalanche,
transport: {
type: "custom",
provider: window.avalanche!,
},
})
const signature = await signXPMessage(client, {
message: "Hello, world!",
})
-
-
-Sign an XP transaction
-The client to use AvalancheWalletCoreClient
-The parameters for the transaction SignXPTransactionParameters
-The signed transaction SignXPTransactionReturnType
-import { createWalletCoreClient, http } from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
import { signXPTransaction } from '@avalanche-sdk/client/methods/wallet'
const client = createWalletCoreClient({
chain: avalanche,
transport: {
type: "custom",
provider: window.avalanche!,
},
})
const signedTx = await signXPTransaction(client, {
txOrTxHex: "0x...",
chainAlias: "P",
utxos: [],
})
-
-
-Prepares an export transaction for the C-chain.
-The client to use for the transaction. AvalancheWalletCoreClient
-The parameters for the transaction. PrepareExportTxnParameters
-The unsigned transaction. PrepareExportTxnReturnType
-import { prepareExportTxn } from "@avalanche-sdk/client/methods/wallet/cChain/prepareExportTxn";
import { createAvalancheWalletClient } from "@avalanche-sdk/client/clients/createAvalancheWalletClient";
import { privateKeyToAvalancheAccount } from "@avalanche-sdk/client/accounts";
import { avalanche } from "@avalanche-sdk/client/chains";
const account = privateKeyToAvalancheAccount("0x1234567890123456789012345678901234567890");
const walletClient = createAvalancheWalletClient({
account,
chain: avalanche,
});
const cChainExportTxnRequest = await prepareExportTxn(walletClient, {
destinationChain: "P",
fromAddress: "0x76Dd3d7b2f635c2547B861e55aE8A374E587742D",
exportedOutput: {
addresses: ["P-fuji19fc97zn3mzmwr827j4d3n45refkksgms4y2yzz"],
amount: 0.0001,
},
});
console.log(cChainExportTxnRequest);
-
-
-Prepares an import transaction for the C-chain.
-The client to use for the transaction. AvalancheWalletCoreClient
-The parameters for the transaction. PrepareImportTxnParameters
-The unsigned transaction. PrepareImportTxnReturnType
-import { prepareImportTxn } from "@avalanche-sdk/client/methods/wallet/cChain/prepareImportTxn";
import { createAvalancheWalletClient } from "@avalanche-sdk/client/clients/createAvalancheWalletClient";
import { privateKeyToAvalancheAccount } from "@avalanche-sdk/client/accounts";
import { avalanche } from "@avalanche-sdk/client/chains";
const account = privateKeyToAvalancheAccount("0x1234567890123456789012345678901234567890");
const walletClient = createAvalancheWalletClient({
account,
chain: avalanche,
});
const cChainImportTxnRequest = await prepareImportTxn(walletClient, {
sourceChain: "P",
toAddress: "0x1234567890123456789012345678901234567890",
});
console.log(cChainImportTxnRequest);
-
-
-Prepares an add permissionless delegator transaction for the P-chain.
-The client to use for the transaction. AvalancheWalletCoreClient
-The parameters for the transaction. PrepareAddPermissionlessDelegatorTxnParameters
-The unsigned transaction. PrepareAddPermissionlessDelegatorTxnReturnType
-import { prepareAddPermissionlessDelegatorTxn } from "@avalanche-sdk/client/methods/wallet/pChain/prepareAddPermissionlessDelegatorTxn";
import { createAvalancheWalletClient } from "@avalanche-sdk/client/clients/createAvalancheWalletClient";
import { privateKeyToAvalancheAccount } from "@avalanche-sdk/client/accounts";
import { avalanche } from "@avalanche-sdk/client/chains";
const account = privateKeyToAvalancheAccount("0x1234567890123456789012345678901234567890");
const walletClient = createAvalancheWalletClient({
account,
chain: avalanche,
});
const pChainAddPermissionlessDelegatorTxnRequest = await prepareAddPermissionlessDelegatorTxn(walletClient, {
nodeId: "NodeID-7Xhw2mDxuDS44j42TCB6U5579esbSt3Lg",
stakeInAvax: 1,
end: 1716441600,
rewardAddresses: ["P-fuji19fc97zn3mzmwr827j4d3n45refkksgms4y2yzz"],
threshold: 1,
});
console.log(pChainAddPermissionlessDelegatorTxnRequest);
-
-
-Prepares an add permissionless validator transaction for the P-chain.
-The client to use for the transaction. AvalancheWalletCoreClient
-The parameters for the transaction. PrepareAddPermissionlessValidatorTxnParameters
-The unsigned transaction. PrepareAddPermissionlessValidatorTxnReturnType
-import { prepareAddPermissionlessValidatorTxn } from "@avalanche-sdk/client/methods/wallet/pChain/prepareAddPermissionlessValidatorTxn";
import { createAvalancheWalletClient } from "@avalanche-sdk/client/clients/createAvalancheWalletClient";
import { privateKeyToAvalancheAccount } from "@avalanche-sdk/client/accounts";
import { avalanche } from "@avalanche-sdk/client/chains";
const account = privateKeyToAvalancheAccount("0x1234567890123456789012345678901234567890");
const walletClient = createAvalancheWalletClient({
account,
chain: avalanche,
});
const pChainAddPermissionlessValidatorTxnRequest = await prepareAddPermissionlessValidatorTxn(walletClient, {
nodeId: "NodeID-7Xhw2mDxuDS44j42TCB6U5579esbSt3Lg",
stakeInAvax: 1,
end: 1716441600,
rewardAddresses: ["P-fuji19fc97zn3mzmwr827j4d3n45refkksgms4y2yzz"],
threshold: 1,
publicKey: "0x1234567890123456789012345678901234567890",
signature: "0x1234567890123456789012345678901234567890",
locktime: 1716441600,
delegatorRewardPercentage: 2.5,
delegatorRewardAddresses: ["P-fuji19fc97zn3mzmwr827j4d3n45refkksgms4y2yzz"],
});
console.log(pChainAddPermissionlessValidatorTxnRequest);
-
-
-Prepares an add subnet validator transaction for the P-chain.
-The client to use for the transaction. AvalancheWalletCoreClient
-The parameters for the transaction. PrepareAddSubnetValidatorTxnParameters
-The unsigned transaction. PrepareAddSubnetValidatorTxnReturnType
-import { prepareAddSubnetValidatorTxn } from "@avalanche-sdk/client/methods/wallet/pChain/prepareAddSubnetValidatorTxn";
import { createAvalancheWalletClient } from "@avalanche-sdk/client/clients/createAvalancheWalletClient";
import { privateKeyToAvalancheAccount } from "@avalanche-sdk/client/accounts";
import { avalanche } from "@avalanche-sdk/client/chains";
const account = privateKeyToAvalancheAccount("0x1234567890123456789012345678901234567890");
const walletClient = createAvalancheWalletClient({
account,
chain: avalanche,
});
const pChainAddSubnetValidatorTxnRequest = await prepareAddSubnetValidatorTxn(walletClient, {
subnetId: "11111111111111111111111111111111LpoYY",
nodeId: "NodeID-7Xhw2mDxuDS44j42TCB6U5579esbSt3Lg",
weight: 1n,
end: 1716441600n,
subnetAuth: [1],
});
console.log(pChainAddSubnetValidatorTxnRequest);
-
-
-Prepares a base transaction for the P-chain.
-The client to use for the transaction. AvalancheWalletCoreClient
-The parameters for the transaction. PrepareBaseTxnParameters
-The unsigned transaction. PrepareBaseTxnReturnType
-import { prepareBaseTxn } from "@avalanche-sdk/client/methods/wallet/pChain/prepareBaseTxn";
import { createAvalancheWalletClient } from "@avalanche-sdk/client/clients/createAvalancheWalletClient";
import { privateKeyToAvalancheAccount } from "@avalanche-sdk/client/accounts";
import { avalanche } from "@avalanche-sdk/client/chains";
const account = privateKeyToAvalancheAccount("0x1234567890123456789012345678901234567890");
const walletClient = createAvalancheWalletClient({
account,
chain: avalanche,
});
const pChainBaseTxnRequest = await prepareBaseTxn(walletClient, {
outputs: [{
addresses: "P-fuji19fc97zn3mzmwr827j4d3n45refkksgms4y2yzz",
amount: 1,
}],
});
console.log(pChainBaseTxnRequest);
-
-
-Prepares a convert subnet to L1 transaction for the P-chain.
-The client to use for the transaction. AvalancheWalletCoreClient
-The parameters for the transaction. PrepareConvertSubnetToL1TxnParameters
-The unsigned transaction. PrepareConvertSubnetToL1TxnReturnType
-https://build.avax.network/docs/api-reference/p-chain/txn-format#unsigned-convert-subnet-to-l1-tx
-import { prepareConvertSubnetToL1Txn } from "@avalanche-sdk/client/methods/wallet/pChain/prepareConvertSubnetToL1Txn";
import { createAvalancheWalletClient } from "@avalanche-sdk/client/clients/createAvalancheWalletClient";
import { privateKeyToAvalancheAccount } from "@avalanche-sdk/client/accounts";
import { avalanche } from "@avalanche-sdk/client/chains";
const account = privateKeyToAvalancheAccount("0x1234567890123456789012345678901234567890");
const walletClient = createAvalancheWalletClient({
account,
chain: avalanche,
});
const pChainConvertSubnetToL1TxnRequest = await prepareConvertSubnetToL1Txn(walletClient, {
subnetId: "11111111111111111111111111111111LpoYY",
blockchainId: 1,
managerContractAddress: "0x1234567890123456789012345678901234567890",
subnetAuth: [1],
validators: [
{
nodeId: "NodeID-7Xhw2mDxuDS44j42TCB6U5579esbSt3Lg",
weight: 1n,
initialBalanceInAvax: 1,
nodePoP: {
publicKey: "0x1234567890123456789012345678901234567890",
proofOfPossession: "0x1234567890123456789012345678901234567890",
},
remainingBalanceOwner: {
addresses: ["P-fuji19fc97zn3mzmwr827j4d3n45refkksgms4y2yzz"],
threshold: 1,
},
deactivationOwner: {
addresses: ["P-fuji19fc97zn3mzmwr827j4d3n45refkksgms4y2yzz"],
threshold: 1,
},
},
],
});
console.log(pChainConvertSubnetToL1TxnRequest);
-
-
-Prepares a create chain transaction for the P-chain.
-The client to use for the transaction. AvalancheWalletCoreClient
-The parameters for the transaction. PrepareCreateChainTxnParameters
-The unsigned transaction. PrepareCreateChainTxnReturnType
-import { prepareCreateChainTxn } from "@avalanche-sdk/client/methods/wallet/pChain/prepareCreateChainTxn";
import { createAvalancheWalletClient } from "@avalanche-sdk/client/clients/createAvalancheWalletClient";
import { privateKeyToAvalancheAccount } from "@avalanche-sdk/client/accounts";
import { avalanche } from "@avalanche-sdk/client/chains";
const account = privateKeyToAvalancheAccount("0x1234567890123456789012345678901234567890");
const walletClient = createAvalancheWalletClient({
account,
chain: avalanche,
});
const pChainCreateChainTxnRequest = await prepareCreateChainTxn(walletClient, {
subnetId: "..",
vmId: "..",
chainName: "My Chain",
genesisData: "0x1234567890123456789012345678901234567890",
subnetAuth: [1],
});
console.log(pChainCreateChainTxnRequest);
-
-
-Prepares a create subnet transaction for the P-chain.
-The client to use for the transaction. AvalancheWalletCoreClient
-The parameters for the transaction. PrepareCreateSubnetTxnParameters
-The unsigned transaction. PrepareCreateSubnetTxnReturnType
-import { prepareCreateSubnetTxn } from "@avalanche-sdk/client/methods/wallet/pChain/prepareCreateSubnetTxn";
import { createAvalancheWalletClient } from "@avalanche-sdk/client/clients/createAvalancheWalletClient";
import { privateKeyToAvalancheAccount } from "@avalanche-sdk/client/accounts";
import { avalanche } from "@avalanche-sdk/client/chains";
const account = privateKeyToAvalancheAccount("0x1234567890123456789012345678901234567890");
const walletClient = createAvalancheWalletClient({
account,
chain: avalanche,
});
const pChainCreateSubnetTxnRequest = await prepareCreateSubnetTxn(walletClient, {
subnetOwners: {
addresses: ["P-fuji19fc97zn3mzmwr827j4d3n45refkksgms4y2yzz"],
threshold: 1,
},
});
console.log(pChainCreateSubnetTxnRequest);
-
-
-Prepares a disable L1 validator transaction for the P-chain.
-The client to use for the transaction. AvalancheWalletCoreClient
-The parameters for the transaction. PrepareDisableL1ValidatorTxnParameters
-The unsigned transaction. PrepareDisableL1ValidatorTxnReturnType
-https://build.avax.network/docs/api-reference/p-chain/txn-format#unsigned-disable-l1-validator-tx
-import { prepareDisableL1ValidatorTxn } from "@avalanche-sdk/client/methods/wallet/pChain/prepareDisableL1ValidatorTxn";
import { createAvalancheWalletClient } from "@avalanche-sdk/client/clients/createAvalancheWalletClient";
import { privateKeyToAvalancheAccount } from "@avalanche-sdk/client/accounts";
import { avalanche } from "@avalanche-sdk/client/chains";
const account = privateKeyToAvalancheAccount("0x1234567890123456789012345678901234567890");
const walletClient = createAvalancheWalletClient({
account,
chain: avalanche,
});
const pChainDisableL1ValidatorTxnRequest = await prepareDisableL1ValidatorTxn(walletClient, {
validationId: "11111111111111111111111111111111LpoYY",
disableAuth: [0],
});
console.log(pChainDisableL1ValidatorTxnRequest);
-
-
-Prepares an export transaction for the P-chain.
-The client to use for the transaction. AvalancheWalletCoreClient
-The parameters for the transaction. PrepareExportTxnParameters
-The unsigned transaction. PrepareExportTxnReturnType
-import { prepareExportTxn } from "@avalanche-sdk/client/methods/wallet/pChain/prepareExportTxn";
import { createAvalancheWalletClient } from "@avalanche-sdk/client/clients/createAvalancheWalletClient";
import { privateKeyToAvalancheAccount } from "@avalanche-sdk/client/accounts";
import { avalanche } from "@avalanche-sdk/client/chains";
const account = privateKeyToAvalancheAccount("0x1234567890123456789012345678901234567890");
const walletClient = createAvalancheWalletClient({
account,
chain: avalanche,
});
const pChainExportTxnRequest = await prepareExportTxn(walletClient, {
destinationChain: "P",
exportedOutputs: [{
addresses: ["P-fuji19fc97zn3mzmwr827j4d3n45refkksgms4y2yzz"],
amount: 0.0001,
}],
-
-
-Prepares an import transaction for the P-chain.
-The client to use for the transaction. AvalancheWalletCoreClient
-The parameters for the transaction. PrepareImportTxnParameters
-The unsigned transaction. PrepareImportTxnReturnType
-import { prepareImportTxn } from "@avalanche-sdk/client/methods/wallet/pChain/prepareImportTxn";
import { createAvalancheWalletClient } from "@avalanche-sdk/client/clients/createAvalancheWalletClient";
import { privateKeyToAvalancheAccount } from "@avalanche-sdk/client/accounts";
import { avalanche } from "@avalanche-sdk/client/chains";
const account = privateKeyToAvalancheAccount("0x1234567890123456789012345678901234567890");
const walletClient = createAvalancheWalletClient({
account,
chain: avalanche,
});
const pChainImportTxnRequest = await prepareImportTxn(walletClient, {
sourceChain: "C",
importedOutput: {
addresses: ["P-fuji19fc97zn3mzmwr827j4d3n45refkksgms4y2yzz"],
},
});
console.log(pChainImportTxnRequest);
-
-
-Prepares an increase L1 validator balance transaction for the P-chain.
-The client to use for the transaction. AvalancheWalletCoreClient
-The parameters for the transaction. PrepareIncreaseL1ValidatorBalanceTxnParameters
-The unsigned transaction. PrepareIncreaseL1ValidatorBalanceTxnReturnType
-import { prepareIncreaseL1ValidatorBalanceTxn } from "@avalanche-sdk/client/methods/wallet/pChain/prepareIncreaseL1ValidatorBalanceTxn";
import { createAvalancheWalletClient } from "@avalanche-sdk/client/clients/createAvalancheWalletClient";
import { privateKeyToAvalancheAccount } from "@avalanche-sdk/client/accounts";
import { avalanche } from "@avalanche-sdk/client/chains";
const account = privateKeyToAvalancheAccount("0x1234567890123456789012345678901234567890");
const walletClient = createAvalancheWalletClient({
account,
chain: avalanche,
});
const pChainIncreaseL1ValidatorBalanceTxnRequest = await prepareIncreaseL1ValidatorBalanceTxn(walletClient, {
balanceInAvax: 1,
validationId: "11111111111111111111111111111111LpoYY",
});
console.log(pChainIncreaseL1ValidatorBalanceTxnRequest);
-
-
-Prepares a register L1 validator transaction for the P-chain.
-The client to use for the transaction. AvalancheWalletCoreClient
-The parameters for the transaction. PrepareRegisterL1ValidatorTxnParameters
-The unsigned transaction. PrepareRegisterL1ValidatorTxnReturnType
-https://build.avax.network/docs/api-reference/p-chain/txn-format#unsigned-register-l1-validator-tx
-import { prepareRegisterL1ValidatorTxn } from "@avalanche-sdk/client/methods/wallet/pChain/prepareRegisterL1ValidatorTxn";
import { createAvalancheWalletClient } from "@avalanche-sdk/client/clients/createAvalancheWalletClient";
import { privateKeyToAvalancheAccount } from "@avalanche-sdk/client/accounts";
import { avalanche } from "@avalanche-sdk/client/chains";
const account = privateKeyToAvalancheAccount("0x1234567890123456789012345678901234567890");
const walletClient = createAvalancheWalletClient({
account,
chain: avalanche,
});
const pChainRegisterL1ValidatorTxnRequest = await prepareRegisterL1ValidatorTxn(walletClient, {
initialBalanceInAvax: 1,
blsSignature: "0x1234567890123456789012345678901234567890",
message: "0x1234567890123456789012345678901234567890",
});
console.log(pChainRegisterL1ValidatorTxnRequest);
-
-
-Prepares a remove subnet validator transaction for the P-chain.
-The client to use for the transaction. AvalancheWalletCoreClient
-The parameters for the transaction. PrepareRemoveSubnetValidatorTxnParameters
-The unsigned transaction. PrepareRemoveSubnetValidatorTxnReturnType
-import { prepareRemoveSubnetValidatorTxn } from "@avalanche-sdk/client/methods/wallet/pChain/prepareRemoveSubnetValidatorTxn";
import { createAvalancheWalletClient } from "@avalanche-sdk/client/clients/createAvalancheWalletClient";
import { privateKeyToAvalancheAccount } from "@avalanche-sdk/client/accounts";
import { avalanche } from "@avalanche-sdk/client/chains";
const account = privateKeyToAvalancheAccount("0x1234567890123456789012345678901234567890");
const walletClient = createAvalancheWalletClient({
account,
chain: avalanche,
});
const pChainRemoveSubnetValidatorTxnRequest = await prepareRemoveSubnetValidatorTxn(walletClient, {
subnetId: "11111111111111111111111111111111LpoYY",
nodeId: "NodeID-7Xhw2mDxuDS44j42TCB6U5579esbSt3Lg",
subnetAuth: [1],
});
console.log(pChainRemoveSubnetValidatorTxnRequest);
-
-
-Prepares a set L1 validator weight transaction for the P-chain.
-The client to use for the transaction. AvalancheWalletCoreClient
-The parameters for the transaction. PrepareSetL1ValidatorWeightTxnParameters
-The unsigned transaction. PrepareSetL1ValidatorWeightTxnReturnType
-https://build.avax.network/docs/api-reference/p-chain/txn-format#unsigned-set-l1-validator-weight-tx
-import { prepareSetL1ValidatorWeightTxn } from "@avalanche-sdk/client/methods/wallet/pChain/prepareSetL1ValidatorWeightTxn";
import { createAvalancheWalletClient } from "@avalanche-sdk/client/clients/createAvalancheWalletClient";
import { privateKeyToAvalancheAccount } from "@avalanche-sdk/client/accounts";
import { avalanche } from "@avalanche-sdk/client/chains";
const account = privateKeyToAvalancheAccount("0x1234567890123456789012345678901234567890");
const walletClient = createAvalancheWalletClient({
account,
chain: avalanche,
});
const pChainSetL1ValidatorWeightTxnRequest = await prepareSetL1ValidatorWeightTxn(walletClient, {
message: "0x1234567890123456789012345678901234567890",
});
console.log(pChainSetL1ValidatorWeightTxnRequest);
-
-
-Prepares a base transaction for the X-chain.
-The client to use for the transaction. AvalancheWalletCoreClient
-The parameters for the transaction. PrepareBaseTxnParameters
-The unsigned transaction. PrepareBaseTxnReturnType
-import { prepareBaseTxn } from "@avalanche-sdk/client/methods/wallet/xChain";
import { privateKeyToAvalancheAccount } from "@avalanche-sdk/client/accounts";
import { avalanche } from "@avalanche-sdk/client/chains";
const account = privateKeyToAvalancheAccount(privateKeyForTest);
const walletClient = new AvalancheWalletCoreClient({
chain: avalanche,
transport: {
url: "https://api.avax.network/ext/bc/C/rpc",
},
account,
});
const xChainBaseTxnRequest = await prepareBaseTxn(walletClient, {
outputs: [
{
amount: 1000000000000000000,
to: "P-fuji19fc97zn3mzmwr827j4d3n45refkksgms4y2yzz",
},
],
-
-
-Prepares an export transaction for the X-chain.
-The client to use for the transaction. AvalancheWalletCoreClient
-The parameters for the transaction. PrepareExportTxnParameters
-The unsigned transaction. PrepareExportTxnReturnType
-import { prepareExportTxn } from "@avalanche-sdk/client/methods/wallet/xChain";
import { privateKeyToAvalancheAccount } from "@avalanche-sdk/client/accounts";
import { avalanche } from "@avalanche-sdk/client/chains";
const account = privateKeyToAvalancheAccount(privateKeyForTest);
const walletClient = new AvalancheWalletCoreClient({
chain: avalanche,
transport: {
url: "https://api.avax.network/ext/bc/C/rpc",
},
account,
});
const xChainExportTxnRequest = await prepareExportTxn(walletClient, {
destinationChain: "P",
exportedOutputs: [
{
amount: 1000000000000000000,
to: "P-fuji19fc97zn3mzmwr827j4d3n45refkksgms4y2yzz",
},
],
-
-
-Prepares an import transaction for the X-chain.
-The client to use for the transaction. AvalancheWalletCoreClient
-The parameters for the transaction. PrepareImportTxnParameters
-The unsigned transaction. PrepareImportTxnReturnType
-import { prepareImportTxn } from "@avalanche-sdk/client/methods/wallet/xChain";
import { privateKeyToAvalancheAccount } from "@avalanche-sdk/client/accounts";
import { avalanche } from "@avalanche-sdk/client/chains";
const account = privateKeyToAvalancheAccount(privateKeyForTest);
const walletClient = new AvalancheWalletCoreClient({
chain: avalanche,
transport: {
url: "https://api.avax.network/ext/bc/C/rpc",
},
account,
});
const xChainImportTxnRequest = await prepareImportTxn(walletClient, {
sourceChain: "P",
importedOutput: {
amount: 1000000000000000000,
to: "P-fuji19fc97zn3mzmwr827j4d3n45refkksgms4y2yzz",
},
-
-
-Given a JSON representation of this Virtual Machine's genesis state, create the byte representation of that state.
- -The client to use. AvalancheCoreClient
-The network ID and genesis data. BuildGenesisParameters
-The genesis bytes. BuildGenesisReturnType
-import { createAvalancheCoreClient } from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
import { buildGenesis } from '@avalanche-sdk/client/methods/xChain'
const client = createAvalancheCoreClient({
chain: avalanche,
transport: {
type: "http",
url: "<url>",
},
})
const genesis = await buildGenesis(client, {
networkID: 16,
genesisData: {
asset1: {
name: "myFixedCapAsset",
symbol: "MFCA",
initialState: {
fixedCap: [
{
amount: 100000,
address: "avax13ery2kvdrkd2nkquvs892gl8hg7mq4a6ufnrn6"
}
]
}
}
}
})
-
-
-Get the balances of all assets controlled by given addresses.
- -The client to use. AvalancheCoreClient
-The addresses to get balances for. GetAllBalancesParameters
-The balances of all assets. GetAllBalancesReturnType
-import { createAvalancheCoreClient } from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
import { getAllBalances } from '@avalanche-sdk/client/methods/xChain'
const client = createAvalancheCoreClient({
chain: avalanche,
transport: {
type: "http",
url: "<url>",
},
})
const balances = await getAllBalances(client, {
addresses: ["X-avax18jma8ppw3nhx5r4ap8clazz0dps7rv5ukulre5"]
})
-
-
-Get information about an asset.
- -The client to use. AvalancheCoreClient
-The asset ID. GetAssetDescriptionParameters
-The asset description. GetAssetDescriptionReturnType
-import { createAvalancheCoreClient } from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
import { getAssetDescription } from '@avalanche-sdk/client/methods/xChain'
const client = createAvalancheCoreClient({
chain: avalanche,
transport: {
type: "http",
url: "<url>",
},
})
const asset = await getAssetDescription(client, {
assetID: "FvwEAhmxKfeiG8SnEvq42hc6whRyY3EFYAvebMqDNDGCgxN5Z"
})
-
-
-Get the balance of an asset controlled by given addresses.
- -The client to use. AvalancheCoreClient
-The addresses and asset ID. GetBalanceParameters
-The balance of the asset. GetBalanceReturnType
-import { createAvalancheCoreClient } from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
import { getBalance } from '@avalanche-sdk/client/methods/xChain'
const client = createAvalancheCoreClient({
chain: avalanche,
transport: {
type: "http",
url: "<url>",
},
})
const balance = await getBalance(client, {
addresses: ["X-avax18jma8ppw3nhx5r4ap8clazz0dps7rv5ukulre5"],
assetID: "FvwEAhmxKfeiG8SnEvq42hc6whRyY3EFYAvebMqDNDGCgxN5Z"
})
-
-
-Get a block by its ID.
- -The client to use. AvalancheCoreClient
-The block ID and encoding format. GetBlockParameters
-The block data. GetBlockReturnType
-import { createAvalancheCoreClient } from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
import { getBlock } from '@avalanche-sdk/client/methods/xChain'
const client = createAvalancheCoreClient({
chain: avalanche,
transport: {
type: "http",
url: "<url>",
},
})
const block = await getBlock(client, {
blockID: "d7WYmb8VeZNHsny3EJCwMm6QA37s1EHwMxw1Y71V3FqPZ5EFG",
encoding: "hex"
})
-
-
-Get a block by its height.
- -The client to use. AvalancheCoreClient
-The block height and encoding format. GetBlockByHeightParameters
-The block data. GetBlockByHeightReturnType
-import { createAvalancheCoreClient } from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
import { getBlockByHeight } from '@avalanche-sdk/client/methods/xChain'
const client = createAvalancheCoreClient({
chain: avalanche,
transport: {
type: "http",
url: "<url>",
},
})
const block = await getBlockByHeight(client, {
height: 1000001,
encoding: "hex"
})
-
-
-Get the height of the blockchain.
- -The client to use. AvalancheCoreClient
-The height of the blockchain. GetHeightReturnType
-import { createAvalancheCoreClient } from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
import { getHeight } from '@avalanche-sdk/client/methods/xChain'
const client = createAvalancheCoreClient({
chain: avalanche,
transport: {
type: "http",
url: "<url>",
},
})
const height = await getHeight(client)
-
-
-Get a transaction by its ID.
- -The client to use. AvalancheCoreClient
-The transaction ID and encoding format. GetTxParameters
-The transaction data. GetTxReturnType
-import { createAvalancheCoreClient } from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
import { getTx } from '@avalanche-sdk/client/methods/xchain'
const client = createAvalancheCoreClient({
chain: avalanche,
transport: {
type: "http",
url: "<url>",
},
})
const tx = await getTx(client, {
txID: "2QouvMUbQ6tchBHSJdZ7MoFhsQhHt5KqZQqHdZ7MoFhsQhHt5KqZQ",
encoding: "hex"
})
-
-
-Get the transaction fee for a given transaction.
- -The client to use. AvalancheCoreClient
-The transaction fee. GetTxFeeReturnType
-import { createAvalancheCoreClient } from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
import { getTxFee } from '@avalanche-sdk/client/methods/xChain'
const client = createAvalancheCoreClient({
chain: avalanche,
transport: {
type: "http",
url: "<url>",
},
});
const txFee = await getTxFee(client
-
-
-Get the status of a transaction.
- -The client to use. AvalancheCoreClient
-The transaction ID. GetTxStatusParameters
-The transaction status. GetTxStatusReturnType
-import { createAvalancheCoreClient } from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
import { getTxStatus } from '@avalanche-sdk/client/methods/xchain'
const client = createAvalancheCoreClient({
chain: avalanche,
transport: {
type: "http",
url: "<url>",
},
})
const status = await getTxStatus(client, {
txID: "2QouvMUbQ6tchBHSJdZ7MoFhsQhHt5KqZQqHdZ7MoFhsQhHt5KqZQ"
})
-
-
-Get the UTXOs for a set of addresses.
- -The client to use. AvalancheCoreClient
-The addresses and source chain. GetUTXOsParameters
-The UTXOs. GetUTXOsReturnType
-import { createAvalancheCoreClient } from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
import { getUTXOs } from '@avalanche-sdk/client/methods/xChain'
const client = createAvalancheCoreClient({
chain: avalanche,
transport: {
type: "http",
url: "<url>",
},
})
const utxos = await getUTXOs(client, {
addresses: ["X-avax1wstkjcj4z8n0n6utxmcxap6mn9nrdz5k0v3fjh"],
sourceChain: "X"
})
-
-
-Issue a transaction.
- -The client to use. AvalancheCoreClient
-The transaction to issue. IssueTxParameters
-The transaction ID. IssueTxReturnType
-import { createAvalancheCoreClient } from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
import { issueTx } from '@avalanche-sdk/client/methods/xChain'
const client = createAvalancheCoreClient({
chain: avalanche,
transport: {
type: "http",
url: "<url>",
},
})
const tx = await issueTx(client, {
tx: "0x1234567890abcdef"
})
-
-
-Get a transaction from a buffer or hex string
-The buffer or hex string to get the transaction from string or Uint8Array
The chain alias to get the transaction from "P" | "X" | "C"
A array with the transaction Common.Transaction and credentials []
-Get an unsigned transaction from a buffer or hex string
-The buffer or hex string to get the transaction from string or Uint8Array
The chain alias to get the transaction from "P" | "X" | "C"
An unsigned transaction UnsignedTx
-Get the UTXOs for an address.
-The client to use. AvalancheWalletCoreClient
-The parameters. GetUtxosForAddressParams
-The array of UTXOs. May contain duplicates. []
-import { createAvalancheWalletCoreClient } from "@avalanche-sdk/client";
import { avalanche } from "@avalanche-sdk/client/chains";
const client = createAvalancheWalletCoreClient({
chain: avalanche,
transport: {
type: "http",
},
});
const utxos = await getUtxosForAddress(client, {
address: "0x1234567890123456789012345678901234567890",
chainAlias: "P",
});
-
-
-A TypeScript SDK for interacting with the Avalanche network through JSON-RPC APIs. This SDK provides a comprehensive set of tools to interact with all Avalanche chains (P-Chain, X-Chain, C-Chain) and various APIs, including wallet functionality for transaction signing and management.
-npm install @avalanche-sdk/client
# or
yarn add @avalanche-sdk/client
# or
pnpm add @avalanche-sdk/client
-
-
-import { createAvalancheClient } from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
// Create an Avalanche client
const client = createAvalancheClient({
chain: avalanche,
transport: {
type: "http",
},
})
// Access different chain clients
const pChainClient = client.pChain
const xChainClient = client.xChain
const cChainClient = client.cChain
// Access API clients
const adminClient = client.admin
const infoClient = client.info
const healthClient = client.health
const indexPChainBlockClient = client.indexPChainBlock
// Example: Get the latest block number
const blockNumber = await pChainClient.getBlockNumber()
// Example: Get base fee
const baseFee = await client.getBaseFee()
-
-
-import { createAvalancheWalletClient, privateKeyToAvalancheAccount } from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
// Create an account from private key
const account = privateKeyToAvalancheAccount("0x1234567890123456789012345678901234567890123456789012345678901234")
// Get P chain Address and Evm Address
const evmAddress = account.getEVMAddress()
const pchainAddress = account.getXPAddress("P", "fuji")
// Create a wallet client
const walletClient = createAvalancheWalletClient({
account,
chain: avalanche,
transport: {
type: "http",
},
})
// Prepare a txn request
const xChainExportTxnRequest = await walletClient.xChain.prepareExportTxn({
exportedOutputs: [
{
addresses: [account.getXPAddress("X", "fuji")], // X-fuji19fc97zn3mzmwr827j4d3n45refkksgms4y2yzz
amount: 0.001,
},
],
destinationChain: "P",
});
// Send an XP transaction
const result = await walletClient.sendXPTransaction(xChainExportTxnRequest)
// Sign a message
const signedMessage = await walletClient.signXPMessage({
message: "Hello Avalanche",
})
// Get account public key
const pubKey = await walletClient.getAccountPubKey()
// Wait for transaction confirmation
await walletClient.waitForTxn({
txID: "2QouvMUbQ6oy7yQ9tLvL3L8tGQG2QK1wJ1q1wJ1q1wJ1q1wJ1q1wJ1q1wJ1",
chainAlias: "X"
})
-
-
-// P-Chain wallet operations
const pChainWallet = walletClient.pChain
// Prepare add validator transaction
const validatorTx = await pChainWallet.prepareAddPermissionlessValidatorTxn({
nodeId: "NodeID-7Xhw2mDxuDS44j42TCB6U5579esbSt3Lg",
stakeInAvax: 1,
end: 1716441600,
rewardAddresses: ["P-fuji19fc97zn3mzmwr827j4d3n45refkksgms4y2yzz"],
threshold: 1,
publicKey: "0x1234567890123456789012345678901234567890",
signature: "0x1234567890123456789012345678901234567890",
locktime: 1716441600,
delegatorRewardPercentage: 2.5,
delegatorRewardAddresses: ["P-fuji19fc97zn3mzmwr827j4d3n45refkksgms4y2yzz"],
})
// X-Chain wallet operations
const xChainWallet = walletClient.xChain
// Prepare base transaction
const baseTx = await xChainWallet.prepareBaseTxn({
outputs: [{
addresses: ["X-avax18jma8ppw3nhx5r4ap8clazz0dps7rv5ukulre5"],
amount: 1000000000, // 1 AVAX
}],
})
// C-Chain wallet operations
const cChainWallet = walletClient.cChain
// Prepare export transaction
const exportTx = await cChainWallet.prepareExportTxn({
to: "P-fuji1j2zllfqv4mgg7ytn9m2u2x0q3h3jqkzq8q8q8q8",
amount: "1000000000000000000", // 1 AVAX in wei
destinationChain: "X"
})
-
-
-The SDK can be configured with various options:
-const client = createAvalancheClient({
chain: avalanche, // Chain configuration
transport: {
type: "<transportType>", // Transport type
url: "<url>",
},
apiKey: "", // Optional API key
rlToken: "", // Optional rate limit token
})
-
-
-The SDK exports all viem utilities and types, plus Avalanche-specific functionality:
-import {
createAvalancheClient,
createAvalancheWalletClient,
// All viem exports
createClient,
createPublicClient,
createWalletClient,
// ... and many more
} from '@avalanche-sdk/client'
-
-
-import {
privateKeyToAvalancheAccount,
memonicsToAvalancheAccount,
hdKeyToAvalancheAccount,
privateKeyToXPAddress,
publicKeyToXPAddress,
// ... and more
} from '@avalanche-sdk/client/accounts'
-
-
-import {
avalanche,
avalancheFuji,
// ... and more
} from '@avalanche-sdk/client/chains'
-
-
-Access specific method categories:
-// P-Chain methods
import { /* P-Chain methods */ } from '@avalanche-sdk/client/methods/pChain'
// X-Chain methods
import { /* X-Chain methods */ } from '@avalanche-sdk/client/methods/xChain'
// C-Chain methods
import { /* C-Chain methods */ } from '@avalanche-sdk/client/methods/cChain'
// Wallet methods
import { /* Wallet methods */ } from '@avalanche-sdk/client/methods/wallet'
// Public methods
import { /* Public methods */ } from '@avalanche-sdk/client/methods/public'
// Admin methods
import { /* Admin methods */ } from '@avalanche-sdk/client/methods/admin'
// Info methods
import { /* Info methods */ } from '@avalanche-sdk/client/methods/info'
// Health methods
import { /* Health methods */ } from '@avalanche-sdk/client/methods/health'
// Index methods
import { /* Index methods */ } from '@avalanche-sdk/client/methods/index'
-
-
-import {
CB58ToHex,
hexToCB58,
getTxFromBytes,
getUnsignedTxFromBytes,
getUtxoFromBytes,
getUtxosForAddress,
// All viem utilities
formatEther,
parseEther,
keccak256,
// ... and many more
} from '@avalanche-sdk/client/utils'
-
-
-// Node utilities
import { /* Node utilities */ } from '@avalanche-sdk/client/node'
// Nonce management
import { /* Nonce utilities */ } from '@avalanche-sdk/client/nonce'
// Serializable utilities
import { /* Serializable utilities */ } from '@avalanche-sdk/client/serializable'
// SIWE (Sign-In with Ethereum)
import { /* SIWE utilities */ } from '@avalanche-sdk/client/siwe'
// Window utilities
import { /* Window utilities */ } from '@avalanche-sdk/client/window'
-
-
-getBalance - Returns the balance of an address on the Platform Chain. DocsgetBlock - Gets a block by its ID. DocsgetBlockByHeight - Gets a block by its height. DocsgetBlockchainStatus - Returns the status of a blockchain. DocsgetBlockchains - Returns all the blockchains that exist (excluding the P-Chain). DocsgetCurrentSupply - Returns the current supply of AVAX in the system. DocsgetCurrentValidators - Returns the current validators of the given Subnet. DocsgetFeeConfig - Returns the fee configuration for the P-Chain. DocsgetFeeState - Returns the current fee state of the P-Chain. DocsgetHeight - Returns the height of the most recent block. DocsgetL1Validator - Returns information about an L1 validator. DocsgetMinStake - Returns the minimum amount of nAVAX required to validate the requested Subnet. DocsgetProposedHeight - Returns the proposed height of the most recent block. DocsgetRewardUTXOs - Returns the reward UTXOs for a list of address:utxo_index pairs. DocsgetStake - Returns the amount of nAVAX staked by a set of addresses. DocsgetStakingAssetID - Returns the assetID of the asset used for staking on the requested Subnet. DocsgetSubnet - Returns information about a Subnet. DocsgetSubnets - Returns all the blockchains that exist (excluding the P-Chain). DocsgetTimestamp - Returns the current timestamp of the P-Chain. DocsgetTotalStake - Returns the total amount staked on the requested Subnet. DocsgetTx - Returns the specified transaction. DocsgetTxStatus - Returns the status of the specified transaction. DocsgetUTXOs - Returns the UTXOs that reference a given address. DocsgetValidatorsAt - Returns the validators and their weights of a Subnet at the specified height. DocsissueTx - Issues a transaction to the Platform Chain. DocssampleValidators - Samples validators from the specified Subnet. DocsvalidatedBy - Gets the Subnet that validates a given blockchain. Docsvalidates - Gets the IDs of the blockchains a Subnet validates. DocsbuildGenesis - Builds a genesis block for the X-Chain. DocsgetAllBalances - Returns all balances for a given address. DocsgetAssetDescription - Returns information about an asset. DocsgetBalance - Returns the balance of an asset held by an address. DocsgetBlock - Gets a block by its ID. DocsgetBlockByHeight - Gets a block by its height. DocsgetHeight - Returns the height of the most recent block. DocsgetTx - Returns the specified transaction. DocsgetTxFee - Returns the fee for the specified transaction. DocsgetTxStatus - Returns the status of the specified transaction. DocsgetUTXOs - Returns the UTXOs that reference a given address. DocsissueTx - Issues a transaction to the X-Chain. DocsgetAtomicTx - Returns the specified atomic transaction. DocsgetAtomicTxStatus - Returns the status of the specified atomic transaction. DocsgetUTXOs - Returns the UTXOs that reference a given address. DocsissueTx - Issues a transaction to the C-Chain. DocsgetAccountPubKey - Get the public key of the current account. Docssend - Send a transaction using the wallet. DocssendXPTransaction - Sign and Send a transaction on X-Chain or P-Chain. DocssignXPMessage - Sign a message on X-Chain or P-Chain. DocssignXPTransaction - Sign a transaction on X-Chain or P-Chain. DocswaitForTxn - Wait for a transaction to be accepted. DocsprepareAddPermissionlessDelegatorTx - Prepare an add permissionless delegator transaction. DocsprepareAddPermissionlessValidatorTxn - Prepare an add permissionless validator transaction. DocsprepareAddSubnetValidatorTxn - Prepare an add subnet validator transaction. DocsprepareBaseTxn - Prepare a base transaction. DocsprepareConvertSubnetToL1Txn - Prepare a convert subnet to L1 transaction. DocsprepareCreateChainTxn - Prepare a create chain transaction. DocsprepareCreateSubnetTxn - Prepare a create subnet transaction. DocsprepareDisableL1ValidatorTxn - Prepare a disable L1 validator transaction. DocsprepareExportTxn - Prepare an export transaction. DocsprepareImportTxn - Prepare an import transaction. DocsprepareIncreaseL1ValidatorBalanceTxn - Prepare an increase L1 validator balance transaction. DocsprepareRegisterL1ValidatorTxn - Prepare a register L1 validator transaction. DocsprepareRemoveSubnetValidatorTxn - Prepare a remove subnet validator transaction. DocsprepareSetL1ValidatorWeightTxn - Prepare a set L1 validator weight transaction. DocsprepareBaseTxn - Prepare a base transaction for the X-Chain. DocsprepareExportTxn - Prepare an export transaction for the X-Chain. DocsprepareImportTxn - Prepare an import transaction for the X-Chain. DocsprepareExportTxn - Prepare an export transaction from C-Chain to another chain. DocsprepareImportTxn - Prepare an import transaction from another chain to C-Chain. DocsbaseFee - Returns the base fee for the next block. DocsgetChainConfig - Returns the chain configuration. DocsmaxPriorityFeePerGas - Returns the maximum priority fee per gas. DocsfeeConfig - Returns the fee configuration for the specified block. DocsgetActiveRulesAt - Returns the active rules at the specified timestamp. Docsalias - Assign an API endpoint an alias. DocsaliasChain - Give a blockchain an alias. DocsgetChainAliases - Returns the aliases of the chain. DocsgetLoggerLevel - Returns log and display levels of loggers. DocsloadVMs - Dynamically loads any virtual machines installed on the node as plugins. DocslockProfile - Writes a profile of mutex statistics to lock.profile. DocsmemoryProfile - Writes a memory profile to mem.profile. DocssetLoggerLevel - Sets log and display levels of loggers. DocsstartCPUProfiler - Start profiling the CPU utilization of the node. DocsstopCPUProfiler - Stop the CPU profile that was previously started. Docsacps - Returns peer preferences for Avalanche Community Proposals (ACPs). DocsgetBlockchainID - Given a blockchain's alias, get its ID. DocsgetNetworkID - Get the ID of the network this node is participating in. DocsgetNetworkName - Get the name of the network this node is participating in. DocsgetNodeID - Get the ID, the BLS key, and the proof of possession of this node. DocsgetNodeIP - Get the IP of this node. DocsgetNodeVersion - Get the version of this node. DocsgetTxFee - Get the transaction fee for the specified transaction type. DocsgetVMs - Get the virtual machines supported by this node. DocsisBootstrapped - Check whether a given chain is done bootstrapping. Docspeers - Get a description of peer connections. Docsuptime - Returns the network's observed uptime of this node. Docsupgrades - Returns the upgrade history and configuration of the network. Docshealth - Returns the last set of health check results. Docsliveness - Returns healthy once the endpoint is available. Docsreadiness - Returns healthy once the node has finished initializing. DocsgetContainerByID - Get container by ID. DocsgetContainerByIndex - Get container by index. DocsgetContainerRange - Get containers by index range. DocsgetIndex - Get the index of a container. DocsgetLastAccepted - Get the last accepted container. DocsisAccepted - Returns true if the container is in this index. DocsCheck out the examples folder for comprehensive usage examples:
-sendAvax.ts - Basic example of sending AVAX using the SDKThe prepare-primary-network-txns folder contains examples for preparing various types of transactions:
transfer-avax-from-x-chain-to-p-chain.ts - Transfer AVAX from X-Chain to P-Chaintransfer-avax-from-p-chain-to-x-chain.ts - Transfer AVAX from P-Chain to X-Chaintransfer-avax-from-x-chain-to-c-chain.ts - Transfer AVAX from X-Chain to C-Chaintransfer-avax-from-c-chain-to-x-chain.ts - Transfer AVAX from C-Chain to X-Chaintransfer-avax-from-p-chain-to-c-chain.ts - Transfer AVAX from P-Chain to C-Chaintransfer-avax-from-c-chain-to-p-chain.ts - Transfer AVAX from C-Chain to P-ChainexportTx.ts - Prepare X-Chain export transactionimportTx.ts - Prepare X-Chain import transactionaddSubnetValidatorTx.ts - Add subnet validator transactionbaseTx.ts - Base transaction exampleconvertSubnetToL1Tx.ts - Convert subnet to L1 transactioncreateChainTx.ts - Create chain transactioncreateSubnetTx.ts - Create subnet transactionexportTx.ts - Prepare P-Chain export transactionimportTx.ts - Prepare P-Chain import transactionremoveSubnetValidatorTx.ts - Remove subnet validator transactionexportTx.ts - Prepare C-Chain export transactionimportTx.ts - Prepare C-Chain import transactionFor more detailed information about each example, see the examples README.
-Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
-This project is licensed under the MIT License - see the LICENSE file for details.
-If you encounter any issues or have questions, please:
-AvalancheAccount is a type that represents an account on the Avalanche network. -It can be a combination of an EVM account and an XP account.
-Options for the hdKeyToAvalancheAccount function.
-LocalXPAccount is a type that represents an X or P chain account. -It is a local account.
-XPAccount is a type that represents an X or P chain account. -It can be a local account or a remote account.
-XPAddress is a type that represents an X or P chain address.
-Converts a HD key to an Avalanche account.
-Converts a mnemonic to an Avalanche account.
-Parse an account or address to an AvalancheAccount
-Converts a private key to an Avalanche account.
-Converts a private key to an XP account.
-Converts a private key to an XP address.
-Converts a private key to an XP public key.
-Converts a public key to an XP address.
-Recovers a public key from a signature and message.
-Signs a message with an XP private key.
-Signs a transaction hash with an XP private key.
-Verifies a signature.
-The RPC schema for the Admin methods.
-The RPC schema for the Avalanche Public methods.
-The RPC schema for the Avalanche Wallet methods.
-The RPC schema for the C-Chain methods.
-The RPC schema for the Health methods.
-The RPC schema for the Index methods.
-The RPC schema for the Info methods.
-The RPC schema for the P-Chain methods.
-The RPC schema for the X-Chain methods.
-Creates an Admin API Client with a given transport configured for a Chain.
-Creates an Avalanche Client with a given transport configured for a Chain.
-Creates an Avalanche Core Client with a given transport configured for a Chain.
-Creates an Avalanche Wallet Client with a given transport configured for a Chain.
-Creates a C-Chain (Contract Chain) Client with a given transport configured for a Chain.
-Creates a Health API Client with a given transport configured for a Chain.
-Creates an Index API Client with a given transport configured for a Chain.
-Creates an Info API Client with a given transport configured for a Chain.
-Creates a P-Chain (Platform Chain) Client with a given transport configured for a Chain.
-Creates an X-Chain (Exchange Chain) Client with a given transport configured for a Chain.
-Parameters for the admin.aliasChain method.
Parameters for the admin.alias method.
Parameters for the admin.getChainAliases method.
Return type for the admin.getChainAliases method.
Parameters for the admin.getLoggerLevel method.
-Return type for the admin.getLoggerLevel method.
Return type for the admin.loadVMs method.
Parameters for the admin.setLoggerLevel method.
Assign an API endpoint an alias, a different endpoint for the API. -The original endpoint will still work. This change only affects this node.
-Give a blockchain an alias, a different name that can be used any place the blockchain's ID is used. -Note: The alias is set for each chain on each node individually.
-Returns the aliases of the chain.
-Returns log and display levels of loggers.
-Dynamically loads any virtual machines installed on the node as plugins.
-Writes a profile of mutex statistics to lock.profile.
Writes a memory profile of the node to mem.profile.
Sets log and display levels of loggers.
-Start profiling the CPU utilization of the node.
-To stop, call stopCPUProfiler. On stop, writes the profile to cpu.profile.
Stop the CPU profile that was previously started.
-The status of an atomic transaction
-The parameters for the avax.getAtomicTx method.
The return type for the avax.getAtomicTx method.
The parameters for the avax.getAtomicTxStatus method.
The return type for the avax.getAtomicTxStatus method.
The parameters for the avax.getUTXOs method.
The return type for the avax.getUTXOs method.
The parameters for the platform.issueTx method.
The return type for the platform.issueTx method.
Get the atomic transaction by its ID.
-Get the status of an atomic transaction.
-Get the UTXOs for a set of addresses.
-Issue a transaction to the C-Chain.
-Parameters for the health.health method.
Return type for the health.health method.
Return type for the health.liveness method.
Parameters for the health.readiness method.
Return type for the health.readiness method.
Returns the last set of health check results for the node. -This includes checks for all chains, network, database, and other components.
-Returns a simple health check indicating if the node is alive and can handle requests. -This is a lightweight check that always returns healthy if the endpoint is available.
-Returns the last evaluation of the startup health check results. -This indicates if the node has finished initializing and is ready to handle requests.
-Parameters for the index.getContainerByID method.
Return type for the index.getContainerByID method.
Parameters for the index.getContainerByIndex method.
Return type for the index.getContainerByIndex method.
-Parameters for the index.getContainerRange method.
Return type for the index.getContainerRange method.
-Parameters for the index.getIndex method.
Return type for the index.getIndex method.
Parameters for the index.getLastAccepted method.
Return type for the index.getLastAccepted method.
Parameters for the index.isAccepted method.
Return type for the index.isAccepted method.
Get container by ID.
-Get container by index.
-Get a range of containers by their indices.
-Get the index of a container by its ID.
-Get the last accepted container.
-Check if a container is accepted.
-Return type for the info.acps method.
-Parameters for the info.getBlockchainID method.
-Return type for the info.getBlockchainID method.
-Return type for the info.getNetworkID method.
-Return type for the info.getNetworkName method.
-Return type for the info.getNodeID method.
-Return type for the info.getNodeIP method.
-Return type for the info.getNodeVersion method.
-Return type for the info.getTxFee method.
-Return type for the info.getVMs method.
-Parameters for the info.isBootstrapped method.
-Return type for the info.isBootstrapped method.
-Parameters for the info.peers method.
-Return type for the info.peers method.
-Return type for the info.upgrades method.
-Return type for the info.uptime method.
-Returns peer preferences for Avalanche Community Proposals (ACPs).
-Given a blockchain's alias, get its ID.
-Get the ID of the network this node is participating in. -Network ID of 1 = Mainnet, Network ID of 5 = Fuji (testnet).
-Get the name of the network this node is participating in.
-Get the ID, the BLS key, and the proof of possession of this node. -Note: This endpoint is only available on specific nodes, not on public servers.
-Get the IP address of this node.
-Get the version of this node.
-Get the transaction fee for this node.
-Get the virtual machines (VMs) this node is running.
-Check whether a given chain is done bootstrapping.
-Get a description of peer connections.
-Returns the upgrade history and configuration of the network.
-Returns the network's observed uptime of this node. -This is the only reliable source of data for your node's uptime.
-Describes the status of a blockchain.
-Parameters for the platform.getBalance method.
-Get the balance of AVAX controlled by a given address.
Return type for the platform.getBalance method.
Parameters for the platform.getBlockByHeight method.
-Get a block by its height.
The return type for the platform.getBlockByHeight method.
Return type for the platform.getBlockchains method.
-Get all the blockchains that exist (excluding the P-Chain).
Parameters for the platform.getBlockchainStatus method.
-Get the status of a blockchain.
Return type for the platform.getBlockchainStatus method.
Parameters for the platform.getBlock method.
-Get a block by its ID.
The return type for the platform.getBlock method.
Parameters for the platform.getCurrentSupply method.
-Get the current supply of a token.
Return type for the platform.getCurrentSupply method.
Parameters for the platform.getCurrentValidators method.
-Get the current validators of a Subnet.
Return type for the platform.getCurrentValidators method.
Return type for the platform.getFeeConfig method.
-Get the fee configuration for the P-Chain.
Return type for the platform.getFeeState method.
-Get the current fee state of the P-Chain.
Return type for the platform.getHeight method.
-Get the current height of the P-Chain.
Parameters for the platform.getL1Validator method.
-Get information about an L1 validator.
Return type for the platform.getL1Validator method.
Parameters for the platform.getMinStake method.
-Get the minimum stake required for validators and delegators.
Return type for the platform.getMinStake method.
Return type for the platform.getProposedHeight method.
-Get the proposed height of the P-Chain.
Parameters for the platform.getRewardUTXOs method.
-Get the reward UTXOs for a transaction.
Return type for the platform.getRewardUTXOs method.
Parameters for the platform.getStake method.
-Get the amount of stake for a set of addresses.
Return type for the platform.getStake method.
Parameters for the platform.getStakingAssetID method.
-Get the ID of the asset used for staking on a Subnet.
Return type for the platform.getStakingAssetID method.
Parameters for the platform.getSubnet method.
-Get information about a Subnet.
Return type for the platform.getSubnet method.
Parameters for the platform.getSubnets method.
-Get information about a set of Subnets.
Return type for the platform.getSubnets method.
Return type for the platform.getTimestamp method.
-Get the current timestamp of the P-Chain.
Parameters for the platform.getTotalStake method.
-Get the total amount of stake on a Subnet.
Return type for the platform.getTotalStake method.
Parameters for the platform.getTx method.
-Get a transaction by its ID.
Return type for the platform.getTx method.
-Returns the transaction encoded to the specified format PChainTransactionType
Parameters for the platform.getTxStatus method.
-Get the status of a transaction.
Return type for the platform.getTxStatus method.
Parameters for the platform.getUTXOs method.
-Get the UTXOs that reference a given set of addresses.
Return type for the platform.getUTXOs method.
Parameters for the platform.getValidatorsAt method.
-Get the validators at a given height.
Return type for the platform.getValidatorsAt method.
Parameters for the platform.issueTx method.
-Issue a transaction to the Platform Chain.
Return type for the platform.issueTx method.
Represents the status of a transaction.
-Parameters for the platform.sampleValidators method.
-Sample validators from the specified Subnet.
Return type for the platform.sampleValidators method.
Parameters for the platform.validatedBy method.
-Get the Subnet that validates a given blockchain.
Return type for the platform.validatedBy method.
Parameters for the platform.validates method.
-Get the IDs of the blockchains a Subnet validates.
Return type for the platform.validates method.
Get the balance of AVAX controlled by a given address.
-Get a block by its ID.
-Get a block by its height.
-Get all the blockchains that exist (excluding the P-Chain).
-Get the status of a blockchain.
-Get the current supply of an asset.
-Get the current validators of the specified Subnet.
-Get the fee configuration for the P-Chain.
-Get the current fee state of the P-Chain.
-Get the height of the last accepted block.
-Get the L1 validator information.
-Get the minimum stake amount for a subnet.
-Get the proposed height of the P-Chain.
-Get the reward UTXOs for a transaction.
-Get the stake amount for a set of addresses.
-Get the staking asset ID for a subnet.
-Get information about a subnet.
-Get all subnets.
-Get the current timestamp of the P-Chain.
-Get the total stake amount for a subnet.
-Get a transaction by its ID.
-Get the status of a transaction.
-Get the UTXOs for a set of addresses.
-Get the validators at a specific height.
-Issue a transaction to the Platform Chain.
-Sample validators from the specified Subnet.
-Get the validators that validated a transaction.
-Validates a transaction.
-The return type for the eth_baseFee method.
The parameters for the feeConfig method.
The return type for the feeConfig method.
The parameters for the eth_getActiveRulesAt method.
The return type for the eth_getActiveRulesAt method.
The return type for the eth_maxPriorityFeePerGas method.
Get the base fee for the next block.
-Get the fee config for a specific block.
-Get the active rules at a specific timestamp.
-Get the chain configuration for the C-Chain.
-Get the maximum priority fee per gas for the next block.
-The public key of the account
-The parameters for the send method.
-The parameters for the sendXPTransaction method
-The return type for the sendXPTransaction method
-The signatures for the transaction
-The parameters for the signXPMessage method
-The return type for the signXPMessage method
-The parameters for the signXPTransaction method
-The return type for the signXPTransaction method
-The details of a transaction.
-Get the public key of the account
-Sends tokens from the source chain to the destination chain.
-Send an transaction to the X, P or C chain
-Sign a message with the account
-Sign an XP transaction
-Prepares an export transaction for the C-chain.
-Prepares an import transaction for the C-chain.
-L1 validator
-P-Chain owner information
-Prepares an add permissionless delegator transaction for the P-chain.
-Prepares an add permissionless validator transaction for the P-chain.
-Prepares an add subnet validator transaction for the P-chain.
-Prepares a base transaction for the P-chain.
-Prepares a convert subnet to L1 transaction for the P-chain.
-Prepares a create chain transaction for the P-chain.
-Prepares a create subnet transaction for the P-chain.
-Prepares a disable L1 validator transaction for the P-chain.
-Prepares an export transaction for the P-chain.
-Prepares an import transaction for the P-chain.
-Prepares an increase L1 validator balance transaction for the P-chain.
-Prepares a register L1 validator transaction for the P-chain.
-Prepares a remove subnet validator transaction for the P-chain.
-Prepares a set L1 validator weight transaction for the P-chain.
-Prepares a base transaction for the X-chain.
-Prepares an export transaction for the X-chain.
-Prepares an import transaction for the X-chain.
-The parameters for the avm.buildGenesis method.
The return type for the avm.buildGenesis method.
The parameters for the avm.getAllBalances method.
The return type for the avm.getAllBalances method.
The parameters for the avm.getAssetDescription method.
The return type for the avm.getAssetDescription method.
The parameters for the avm.getBalance method.
The return type for the avm.getBalance method.
The parameters for the avm.getBlockByHeight method.
The return type for the avm.getBlockByHeight method.
The parameters for the avm.getBlock method.
The return type for the avm.getBlock method.
The return type for the avm.getHeight method.
The return type for the avm.getTxFee method.
Parameters for the avm.getTx method.
Return type for the avm.getTx method.
-Returns the transaction in the requested format.
The parameters for the avm.getTxStatus method.
The return type for the avm.getTxStatus method.
The parameters for the avm.getUTXOs method.
The return type for the avm.getUTXOs method.
Parameters for the avm.issueTx method.
-This method sends a signed transaction to the network.
Return type for the avm.issueTx method.
-Returns the ID of the issued transaction.
Represents an X-Chain block in either JSON or hex format. -The X-Chain is Avalanche's native platform for creating and trading assets.
-Represents the possible statuses of an X-Chain transaction.
-Represents an X-Chain transaction in either JSON or hex format. -Transactions on the X-Chain can transfer assets between addresses or export assets to other chains.
-Given a JSON representation of this Virtual Machine's genesis state, create the byte representation of that state.
-Get the balances of all assets controlled by given addresses.
-Get information about an asset.
-Get the balance of an asset controlled by given addresses.
-Get a block by its ID.
-Get a block by its height.
-Get the height of the blockchain.
-Get a transaction by its ID.
-Get the transaction fee for a given transaction.
-Get the status of a transaction.
-Get the UTXOs for a set of addresses.
-Issue a transaction.
-Decodes a CB58 string into a hex string (0x...).
-Get a transaction from a buffer or hex string
-Get an unsigned transaction from a buffer or hex string
-Get a Utxo from a buffer or hex string
-Get the UTXOs for an address.
-Encodes a hex string (0x...) into CB58.
-AvalancheAccount is a type that represents an account on the Avalanche network. -It can be a combination of an EVM account and an XP account.
-The EVM account used for C-chain or any EVM chain operations. -Type: Account
-Get the EVM address for the account.
-The EVM address for the account. Address
-Get the XP address for the X and P chain account.
-Optionalchain: "X" | "P" | "C"The chain to get the XP address for. "X" | "P" | "C"
Optionalhrp: stringThe human readable prefix to use for the XP address. Default to "avax". "avax" | "fuji" | any custom hrp
The XP address for the account. XPAddress
-OptionalxpThe AVM and PVM account used for X and P chain operations. -Type: XPAccount
-Options for the hdKeyToAvalancheAccount function.
-LocalXPAccount is a type that represents an X or P chain account. -It is a local account.
-XPAccount is a type that represents an X or P chain account. -It can be a local account or a remote account.
-XPAddress is a type that represents an X or P chain address.
-Assign an API endpoint an alias, a different endpoint for the API. -The original endpoint will still work. This change only affects this node.
- -Promise that resolves when the alias is set
-Give a blockchain an alias, a different name that can be used any place the blockchain's ID is used. -Note: The alias is set for each chain on each node individually.
- -Promise that resolves when the chain alias is set
-import { createAvalancheClient} from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
const client = createAvalancheClient({
chain: avalanche,
transport: {
type: "http",
},
})
await client.admin.aliasChain({
chain: "sV6o671RtkGBcno1FiaDbVcFv2sG5aVXMZYzKdP4VQAWmJQnM",
alias: "myBlockchainAlias"
})
-
-
-Returns the aliases of the chain.
- -The aliases of the chain. GetChainAliasesReturnType
-import { createAvalancheClient} from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
const client = createAvalancheClient({
chain: avalanche,
transport: {
type: "http",
},
})
const aliases = await client.admin.getChainAliases({
chain: "sV6o671RtkGBcno1FiaDbVcFv2sG5aVXMZYzKdP4VQAWmJQnM"
})
-
-
-Returns log and display levels of loggers.
- -The log and display levels of loggers. GetLoggerLevelReturnType
-Dynamically loads any virtual machines installed on the node as plugins.
- -The virtual machines installed on the node. LoadVMsReturnType
-Writes a profile of mutex statistics to lock.profile.
Promise that resolves when the profile is written
-Writes a memory profile of the node to mem.profile.
Promise that resolves when the profile is written
-Sets log and display levels of loggers.
- -Promise that resolves when the logger levels are set
-import { createAvalancheClient} from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
const client = createAvalancheClient({
chain: avalanche,
transport: {
type: "http",
},
})
await client.admin.setLoggerLevel({
loggerName: "C",
logLevel: "DEBUG",
displayLevel: "INFO"
})
-
-
-Start profiling the CPU utilization of the node.
-To stop, call stopCPUProfiler. On stop, writes the profile to cpu.profile.
Promise that resolves when the profiler is started
-Stop the CPU profile that was previously started.
- -Promise that resolves when the profiler is stopped
-Get the base fee for the next block.
- -The base fee for the next block as a hex value. BaseFeeReturnType
-Get the fee config for a specific block.
- -The parameters for the fee config for a specific block. FeeConfigParameters
-The fee config for the specified block. FeeConfigReturnType
-Get the active rules at a specific timestamp.
- -The parameters for the active rules at a specific timestamp. GetActiveRulesAtParameters
-The active rules at the specified timestamp. GetActiveRulesAtReturnType
-Get the chain configuration for the C-Chain.
- -The chain configuration including chainId, block numbers for various forks, -and timestamps for Avalanche-specific upgrades. GetChainConfigReturnType
-Get the priority fee needed to be included in a block.
- -The priority fee needed to be included in a block as a hex value. MaxPriorityFeePerGasReturnType
-The RPC schema for the Avalanche Public methods.
-Gets the public key associated with the wallet account.
- -A promise that resolves to the account's public key. GetAccountPubKeyReturnType
-import { createAvalancheWalletClient } from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
// You can pass a local account otherwise a custom provider can be used
const account = privateKeyToAvalancheAccount("0x...")
const walletClient = createAvalancheWalletClient({
account,
chain: avalanche,
transport: { type: "http" },
})
const pubKey = await walletClient.getAccountPubKey()
// Or you can use a custom provider (e.g. window.avalanche, window.ethereum, etc.)
const walletClient = createAvalancheWalletClient({
chain: avalanche,
transport: { type: "custom", provider: window.avalanche! },
})
const pubKey = await walletClient.getAccountPubKey()
-
-
-Sends tokens from the source chain to the destination chain.
-The parameters for the transaction. SendParameters
-The hashes of the transactions. SendReturnType
-import { createAvalancheWalletClient } from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
const walletClient = createAvalancheWalletClient({
chain: avalanche,
transport: { type: "http" },
})
const result = await walletClient.send({
amount: 1,
to: "0x0000000000000000000000000000000000000000",
-
-
-Sends an XP transaction to the network.
- -The parameters for sending the transaction. SendXPTransactionParameters
-A promise that resolves to the transaction result. SendXPTransactionReturnType
-import { createAvalancheWalletClient } from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
// You can pass a local account otherwise a custom provider can be used
const account = privateKeyToAvalancheAccount("0x...")
const walletClient = createAvalancheWalletClient({
account,
chain: avalanche,
transport: { type: "http" },
})
const result = await walletClient.sendXPTransaction({
amount: "1000000000",
to: "X-avax1...",
assetID: "AVAX"
})
// Or you can use a custom provider (e.g. window.avalanche, window.ethereum, etc.)
const walletClient = createAvalancheWalletClient({
chain: avalanche,
transport: { type: "custom", provider: window.avalanche! },
})
const result = await walletClient.sendXPTransaction({
amount: "1000000000",
to: "X-avax1...",
assetID: "AVAX"
})
-
-
-Signs a message using the wallet's private key.
- -The parameters for signing the message. SignXPMessageParameters
-A promise that resolves to the signed message. SignXPMessageReturnType
-import { createAvalancheWalletClient } from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
// You can pass a local account otherwise a custom provider can be used
const account = privateKeyToAvalancheAccount("0x...")
const walletClient = createAvalancheWalletClient({
account,
chain: avalanche,
transport: { type: "http" },
})
const signedMessage = await walletClient.signXPMessage({
message: "Hello Avalanche",
address: "X-avax1..."
})
// Or you can use a custom provider (e.g. window.avalanche, window.ethereum, etc.)
const walletClient = createAvalancheWalletClient({
chain: avalanche,
transport: { type: "custom", provider: window.avalanche! },
})
const signedMessage = await walletClient.signXPMessage({
message: "Hello Avalanche",
address: "X-avax1..."
})
-
-
-Signs an XP transaction using the wallet's private key.
- -The parameters for signing the transaction. SignXPTransactionParameters
-A promise that resolves to the signed transaction. SignXPTransactionReturnType
-import { createAvalancheWalletClient } from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
// You can pass a local account otherwise a custom provider can be used
const account = privateKeyToAvalancheAccount("0x...")
const walletClient = createAvalancheWalletClient({
account,
chain: avalanche,
transport: { type: "http" },
})
const signedTx = await walletClient.signXPTransaction({
tx: "0x...",
address: "X-avax1..."
})
// Or you can use a custom provider (e.g. window.avalanche, window.ethereum, etc.)
const walletClient = createAvalancheWalletClient({
chain: avalanche,
transport: { type: "custom", provider: window.avalanche! },
})
const signedTx = await walletClient.signXPTransaction({
tx: "0x...",
address: "X-avax1..."
})
-
-
-Waits for a transaction to be confirmed on the network.
- -The parameters for waiting for the transaction. WaitForTxnParameters
-A promise that resolves when the transaction is confirmed.
-import { createAvalancheWalletClient } from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
const walletClient = createAvalancheWalletClient({
chain: avalanche,
transport: { type: "http" },
})
const result = await walletClient.waitForTxn({
txID: "0x...",
chainAlias: "P"
})
-
-
-The RPC schema for the Avalanche Wallet methods.
-Get the atomic transaction by its ID.
- -The atomic transaction. GetAtomicTxReturnType
-import { createAvalancheClient} from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
const client = createAvalancheClient({
chain: avalanche,
transport: {
type: "http",
},
})
const tx = await client.cChain.getAtomicTx({
txID: "2QouvMUbQ6oy7yQ9tLvL3L8tGQG2QK1wJ1q1wJ1q1wJ1q1wJ1q1wJ1q1wJ1"
})
-
-
-Get the status of an atomic transaction.
- -The status of the atomic transaction. GetAtomicTxStatusReturnType
-import { createAvalancheClient} from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
const client = createAvalancheClient({
chain: avalanche,
transport: {
type: "http",
},
})
const status = await client.cChain.getAtomicTxStatus({
txID: "2QouvMUbQ6oy7yQ9tLvL3L8tGQG2QK1wJ1q1wJ1q1wJ1q1wJ1q1wJ1q1wJ1"
})
-
-
-Get the UTXOs for a set of addresses.
- -The UTXOs for a set of addresses. GetUTXOsReturnType
-import { createAvalancheClient} from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
const client = createAvalancheClient({
chain: avalanche,
transport: {
type: "http",
},
})
const utxos = await client.cChain.getUTXOs({
addresses: ["X-avax1...", "X-avax2..."],
limit: 100
})
-
-
-Send a signed transaction to the network.
- -The transaction ID. IssueTxReturnType
-import { createAvalancheClient} from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
const client = createAvalancheClient({
chain: avalanche,
transport: {
type: "http",
},
})
const txID = await client.cChain.issueTx({
tx: "0x00000009de31b4d8b22991d51aa6aa1fc733f23a851a8c9400000000000186a0000000005f041280000000005f9ca900000030390000000000000001fceda8f90fcb5d30614b99d79fc4baa29307762668f16eb0259a57c2d3b78c875c86ec2045792d4df2d926c40f829196e0bb97ee697af71f5b0a966dabff749634c8b729855e937715b0e44303fd1014daedc752006011b730",
encoding: "hex"
})
-
-
-Prepare an export transaction from C-Chain to another chain (X-Chain or P-Chain). -This method creates the transaction data needed to export AVAX from the C-Chain.
-Export transaction data. PrepareExportTxnReturnType
-import { createAvalancheWalletClient } from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
const client = createAvalancheWalletClient({
chain: avalanche,
transport: {
type: "http",
},
})
const exportTxn = await client.cChain.prepareExportTxn({
to: "P-fuji1j2zllfqv4mgg7ytn9m2u2x0q3h3jqkzq8q8q8q8",
amount: "1", // 1 AVAX
destinationChain: "X"
})
-
-
-Prepare an import transaction from another chain (X-Chain or P-Chain) to C-Chain. -This method creates the transaction data needed to import AVAX to the C-Chain.
-Import transaction data. PrepareImportTxnReturnType
-import { createAvalancheWalletClient } from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
const client = createAvalancheWalletClient({
chain: avalanche,
transport: {
type: "http",
},
})
const importTxn = await client.cChain.prepareImportTxn({
to: "0x742d35Cc6634C0532925a3b8D4C9db96C4b4d8b6",
sourceChain: "X"
})
-
-
-Returns the last set of health check results for the node. -This includes checks for all chains, network, database, and other components.
- -HealthParameters Optional tags to filter health checks
-The health check results. HealthReturnType
-import { createAvalancheClient} from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
const client = createAvalancheClient({
chain: avalanche,
transport: {
type: "http",
},
})
const healthStatus = await client.health.health({
tags: ["11111111111111111111111111111111LpoYY", "29uVeLPJB1eQJkzRemU8g8wZDw5uJRqpab5U2mX9euieVwiEbL"]
})
-
-
-Returns a simple health check indicating if the node is alive and can handle requests. -This is a lightweight check that always returns healthy if the endpoint is available.
- -The liveness check results. LivenessReturnType
-Returns the last evaluation of the startup health check results. -This indicates if the node has finished initializing and is ready to handle requests.
- -ReadinessParameters Optional tags to filter readiness checks
-The readiness check results. ReadinessReturnType
-import { createAvalancheClient} from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
const client = createAvalancheClient({
chain: avalanche,
transport: {
type: "http",
},
})
const readinessStatus = await client.health.readiness({
tags: ["11111111111111111111111111111111LpoYY"]
})
-
-
-Get container by ID.
- -GetContainerByIDParameters The container ID and encoding
-The container details. GetContainerByIDReturnType
-import { createAvalancheClient} from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
const client = createAvalancheClient({
chain: avalanche,
transport: {
type: "http",
},
})
const container = await client.indexPChainBlock.getContainerByID({
id: "6fXf5hncR8LXvwtM8iezFQBpK5cubV6y1dWgpJCcNyzGB1EzY",
encoding: "hex"
})
-
-
-Get container by index.
- -GetContainerByIndexParameters The index and encoding
-The container details. GetContainerByIndexReturnType
-import { createAvalancheClient} from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
const client = createAvalancheClient({
chain: avalanche,
transport: {
type: "http",
},
})
const container = await client.indexPChainBlock.getContainerByIndex({
index: 1,
encoding: "hex"
})
-
-
-Get a range of containers by their indices.
- -GetContainerRangeParameters The start index, end index, and encoding
-The container details. GetContainerRangeReturnType
-import { createAvalancheClient} from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
const client = createAvalancheClient({
chain: avalanche,
transport: {
type: "http",
},
})
const containers = await client.indexPChainBlock.getContainerRange({
startIndex: 0,
endIndex: 10,
encoding: "hex"
})
-
-
-Get the index of a container by its ID.
- -GetIndexParameters The container ID and encoding
-The container index. GetIndexReturnType
-import { createAvalancheClient} from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
const client = createAvalancheClient({
chain: avalanche,
transport: {
type: "http",
},
})
const index = await client.indexPChainBlock.getIndex({
id: "6fXf5hncR8LXvwtM8iezFQBpK5cubV6y1dWgpJCcNyzGB1EzY",
encoding: "hex"
})
-
-
-Get the last accepted container.
- -GetLastAcceptedParameters The encoding
-The last accepted container. GetLastAcceptedReturnType
-import { createAvalancheClient} from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
const client = createAvalancheClient({
chain: avalanche,
transport: {
type: "http",
},
})
const lastAccepted = await client.indexPChainBlock.getLastAccepted({
encoding: "hex"
})
-
-
-Check if a container is accepted.
- -IsAcceptedParameters The container ID and encoding
-Whether the container is accepted. IsAcceptedReturnType
-import { createAvalancheClient} from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
const client = createAvalancheClient({
chain: avalanche,
transport: {
type: "http",
},
})
const isAccepted = await client.indexPChainBlock.isAccepted({
id: "6fXf5hncR8LXvwtM8iezFQBpK5cubV6y1dWgpJCcNyzGB1EzY",
encoding: "hex"
})
-
-
-Returns peer preferences for Avalanche Community Proposals (ACPs).
- -The ACP preferences. AcpsReturnType
-Given a blockchain's alias, get its ID.
- -GetBlockchainIDParameters The blockchain alias
-The blockchain ID. GetBlockchainIDReturnType
-Get the ID of the network this node is participating in. -Network ID of 1 = Mainnet, Network ID of 5 = Fuji (testnet).
- -The network ID. GetNetworkIDReturnType
-Get the name of the network this node is participating in.
- -The network name. GetNetworkNameReturnType
-Get the ID, the BLS key, and the proof of possession of this node. -Note: This endpoint is only available on specific nodes, not on public servers.
- -The node ID and BLS key information. GetNodeIDReturnType
-Get the IP address of this node.
- -The node's IP address. GetNodeIPReturnType
-Get the version of this node.
- -The node's version. GetNodeVersionReturnType
-Get the transaction fee for this node.
- -The transaction fee. GetTxFeeReturnType
-Get the virtual machines (VMs) this node is running.
- -The VMs running on this node. GetVMsReturnType
-Check whether a given chain is done bootstrapping.
- -IsBootstrappedParameters The chain ID or alias
-Whether the chain is bootstrapped. IsBootstrappedReturnType
-Get a description of peer connections.
- -PeersParameters Optional node IDs to filter peers
-Information about connected peers. PeersReturnType
-Returns the upgrade history and configuration of the network.
- -The network upgrade information. UpgradesReturnType
-Returns the network's observed uptime of this node. -This is the only reliable source of data for your node's uptime.
- -The node's uptime statistics. UptimeReturnType
-Get the balance of AVAX controlled by a given address.
- -GetBalanceParameters The addresses to get the balance of
-The balance information. GetBalanceReturnType
-import { createAvalancheClient} from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
const client = createAvalancheClient({
chain: avalanche,
transport: {
type: "http",
},
})
const balance = await client.pChain.getBalance({
addresses: ["P-custom18jma8ppw3nhx5r4ap8clazz0dps7rv5u9xde7p"]
})
-
-
-Get a block by its ID.
- -GetBlockParameters The block ID and encoding format
-The block data. GetBlockReturnType
-import { createAvalancheClient} from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
const client = createAvalancheClient({
chain: avalanche,
transport: {
type: "http",
},
})
const block = await client.pChain.getBlock({
blockID: "d7WYmb8VeZNHsny3EJCwMm6QA37s1EHwMxw1Y71V3FqPZ5EFG",
encoding: "hex"
})
-
-
-Get a block by its height.
- -GetBlockByHeightParameters The block height and encoding format
-The block data. GetBlockByHeightReturnType
-import { createAvalancheClient} from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
const client = createAvalancheClient({
chain: avalanche,
transport: {
type: "http",
},
})
const block = await client.pChain.getBlockByHeight({
height: 1000001,
encoding: "hex"
})
-
-
-Get all the blockchains that exist (excluding the P-Chain).
- -The list of blockchains. GetBlockchainsReturnType
-Get the status of a blockchain.
- -GetBlockchainStatusParameters The blockchain ID
-The blockchain status. GetBlockchainStatusReturnType
-import { createAvalancheClient} from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
const client = createAvalancheClient({
chain: avalanche,
transport: {
type: "http",
},
})
const status = await client.pChain.getBlockchainStatus({
blockchainID: "11111111111111111111111111111111LpoYY"
})
-
-
-Get the current supply of an asset.
- -GetCurrentSupplyParameters The asset ID
-The current supply. GetCurrentSupplyReturnType
-import { createAvalancheClient} from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
const client = createAvalancheClient({
chain: avalanche,
transport: {
type: "http",
},
})
const supply = await client.pChain.getCurrentSupply({
assetID: "FvwEAhmxKfeiG8SnEvq42hc6whRyY3EFYAvebMqDNDGCgxN5Z"
})
-
-
-Get the current validators of the specified Subnet.
- -GetCurrentValidatorsParameters The subnet ID
-The current validators. GetCurrentValidatorsReturnType
-import { createAvalancheClient} from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
const client = createAvalancheClient({
chain: avalanche,
transport: {
type: "http",
},
})
const validators = await client.pChain.getCurrentValidators({
subnetID: "11111111111111111111111111111111LpoYY"
})
-
-
-Get the fee configuration for the P-Chain.
- -The fee configuration. GetFeeConfigReturnType
-Get the current fee state of the P-Chain.
- -The fee state. GetFeeStateReturnType
-Get the height of the last accepted block.
- -The current height. GetHeightReturnType
-Get the L1 validator information.
- -GetL1ValidatorParameters The validator node ID
-The L1 validator information. GetL1ValidatorReturnType
-import { createAvalancheClient} from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
const client = createAvalancheClient({
chain: avalanche,
transport: {
type: "http",
},
})
const validator = await client.pChain.getL1Validator({
nodeID: "NodeID-111111111111111111111111111111111111111"
})
-
-
-Get the minimum stake amount for a subnet.
- -GetMinStakeParameters The subnet ID
-The minimum stake amount. GetMinStakeReturnType
-import { createAvalancheClient} from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
const client = createAvalancheClient({
chain: avalanche,
transport: {
type: "http",
},
})
const minStake = await client.pChain.getMinStake({
subnetID: "11111111111111111111111111111111LpoYY"
})
-
-
-Get the proposed height of the P-Chain.
- -The proposed height. GetProposedHeightReturnType
-Get the reward UTXOs for a transaction.
- -GetRewardUTXOsParameters The transaction ID and encoding
-The reward UTXOs. GetRewardUTXOsReturnType
-import { createAvalancheClient} from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
const client = createAvalancheClient({
chain: avalanche,
transport: {
type: "http",
},
})
const rewardUTXOs = await client.pChain.getRewardUTXOs({
txID: "11111111111111111111111111111111LpoYY",
encoding: "hex"
})
-
-
-Get the stake amount for a set of addresses.
- -GetStakeParameters The addresses and subnet ID
-The stake amount. GetStakeReturnType
-import { createAvalancheClient} from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
const client = createAvalancheClient({
chain: avalanche,
transport: {
type: "http",
},
})
const stake = await client.pChain.getStake({
addresses: ["P-custom18jma8ppw3nhx5r4ap8clazz0dps7rv5u9xde7p"],
subnetID: "11111111111111111111111111111111LpoYY"
})
-
-
-Get the staking asset ID for a subnet.
- -GetStakingAssetIDParameters The subnet ID
-The staking asset ID. GetStakingAssetIDReturnType
-import { createAvalancheClient} from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
const client = createAvalancheClient({
chain: avalanche,
transport: {
type: "http",
},
})
const stakingAssetID = await client.pChain.getStakingAssetID({
subnetID: "11111111111111111111111111111111LpoYY"
})
-
-
-Get information about a subnet.
- -GetSubnetParameters The subnet ID
-The subnet information. GetSubnetReturnType
-import { createAvalancheClient} from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
const client = createAvalancheClient({
chain: avalanche,
transport: {
type: "http",
},
})
const subnet = await client.pChain.getSubnet({
subnetID: "11111111111111111111111111111111LpoYY"
})
-
-
-Get all subnets.
- -GetSubnetsParameters Optional parameters
-The list of subnets. GetSubnetsReturnType
-Get the current timestamp of the P-Chain.
- -The current timestamp. GetTimestampReturnType
-Get the total stake amount for a subnet.
- -GetTotalStakeParameters The subnet ID
-The total stake amount. GetTotalStakeReturnType
-import { createAvalancheClient} from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
const client = createAvalancheClient({
chain: avalanche,
transport: {
type: "http",
},
})
const totalStake = await client.pChain.getTotalStake({
subnetID: "11111111111111111111111111111111LpoYY"
})
-
-
-Get a transaction by its ID.
- -GetTxParameters The transaction ID and encoding
-The transaction data. GetTxReturnType
-import { createAvalancheClient} from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
const client = createAvalancheClient({
chain: avalanche,
transport: {
type: "http",
},
})
const tx = await client.pChain.getTx({
txID: "11111111111111111111111111111111LpoYY",
encoding: "hex"
})
-
-
-Get the status of a transaction.
- -GetTxStatusParameters The transaction ID
-The transaction status. GetTxStatusReturnType
-import { createAvalancheClient} from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
const client = createAvalancheClient({
chain: avalanche,
transport: {
type: "http",
},
})
const status = await client.pChain.getTxStatus({
txID: "11111111111111111111111111111111LpoYY"
})
-
-
-Get the UTXOs for a set of addresses.
- -GetUTXOsParameters The addresses and source chain
-The UTXOs. GetUTXOsReturnType
-import { createAvalancheClient} from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
const client = createAvalancheClient({
chain: avalanche,
transport: {
type: "http",
},
})
const utxos = await client.pChain.getUTXOs({
addresses: ["P-custom18jma8ppw3nhx5r4ap8clazz0dps7rv5u9xde7p"],
sourceChain: "X"
})
-
-
-Get the validators at a specific height.
- -GetValidatorsAtParameters The height and subnet ID
-The validators at that height. GetValidatorsAtReturnType
-import { createAvalancheClient} from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
const client = createAvalancheClient({
chain: avalanche,
transport: {
type: "http",
},
})
const validators = await client.pChain.getValidatorsAt({
height: 1000001,
subnetID: "11111111111111111111111111111111LpoYY"
})
-
-
-Issue a transaction to the Platform Chain.
- -IssueTxParameters The transaction bytes and encoding
-The transaction ID. IssueTxReturnType
-import { createAvalancheClient} from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
const client = createAvalancheClient({
chain: avalanche,
transport: {
type: "http",
},
})
const txID = await client.pChain.issueTx({
tx: "0x00000009de31b4d8b22991d51aa6aa1fc733f23a851a8c9400000000000186a0000000005f041280000000005f9ca900000030390000000000000001fceda8f90fcb5d30614b99d79fc4baa29307762668f16eb0259a57c2d3b78c875c86ec2045792d4df2d926c40f829196e0bb97ee697af71f5b0a966dabff749634c8b729855e937715b0e44303fd1014daedc752006011b730",
encoding: "hex"
})
-
-
-Sample validators from the specified Subnet.
- -SampleValidatorsParameters The number of validators to sample and subnet ID
-The sampled validators. SampleValidatorsReturnType
-import { createAvalancheClient} from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
const client = createAvalancheClient({
chain: avalanche,
transport: {
type: "http",
},
})
const validators = await client.pChain.sampleValidators({
size: 2,
subnetID: "11111111111111111111111111111111LpoYY"
})
-
-
-Get the Subnet that validates a given blockchain.
- -ValidatedByParameters The blockchain ID
-The subnet ID. ValidatedByReturnType
-import { createAvalancheClient} from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
const client = createAvalancheClient({
chain: avalanche,
transport: {
type: "http",
},
})
const subnetID = await client.pChain.validatedBy({
blockchainID: "11111111111111111111111111111111LpoYY"
})
-
-
-Get the IDs of the blockchains a Subnet validates.
- -ValidatesParameters The subnet ID
-The blockchain IDs. ValidatesReturnType
-import { createAvalancheClient} from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
const client = createAvalancheClient({
chain: avalanche,
transport: {
type: "http",
},
})
const blockchainIDs = await client.pChain.validates({
subnetID: "11111111111111111111111111111111LpoYY"
})
-
-
-Given a JSON representation of this Virtual Machine's genesis state, create the byte representation of that state.
- -BuildGenesisParameters The network ID and genesis data
-The genesis bytes. BuildGenesisReturnType
-import { createAvalancheClient} from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
const client = createAvalancheClient({
chain: avalanche,
transport: {
type: "http",
},
})
const genesis = await client.xChain.buildGenesis({
networkID: 16,
genesisData: {
asset1: {
name: "myFixedCapAsset",
symbol: "MFCA",
initialState: {
fixedCap: [
{
amount: 100000,
address: "avax13ery2kvdrkd2nkquvs892gl8hg7mq4a6ufnrn6"
}
]
}
}
}
})
-
-
-Get the balances of all assets controlled by given addresses.
- -GetAllBalancesParameters The addresses to get balances for
-The balances of all assets. GetAllBalancesReturnType
-import { createAvalancheClient} from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
const client = createAvalancheClient({
chain: avalanche,
transport: {
type: "http",
},
})
const balances = await client.xChain.getAllBalances({
addresses: ["X-avax18jma8ppw3nhx5r4ap8clazz0dps7rv5ukulre5"]
})
-
-
-Get information about an asset.
- -GetAssetDescriptionParameters The asset ID
-The asset description. GetAssetDescriptionReturnType
-import { createAvalancheClient} from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
const client = createAvalancheClient({
chain: avalanche,
transport: {
type: "http",
},
})
const asset = await client.xChain.getAssetDescription({
assetID: "FvwEAhmxKfeiG8SnEvq42hc6whRyY3EFYAvebMqDNDGCgxN5Z"
})
-
-
-Get the balance of an asset controlled by given addresses.
- -GetBalanceParameters The addresses and asset ID
-The balance of the asset. GetBalanceReturnType
-import { createAvalancheClient} from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
const client = createAvalancheClient({
chain: avalanche,
transport: {
type: "http",
},
})
const balance = await client.xChain.getBalance({
addresses: ["X-avax18jma8ppw3nhx5r4ap8clazz0dps7rv5ukulre5"],
assetID: "FvwEAhmxKfeiG8SnEvq42hc6whRyY3EFYAvebMqDNDGCgxN5Z"
})
-
-
-Get a block by its ID.
- -GetBlockParameters The block ID and encoding format
-The block data. GetBlockReturnType
-import { createAvalancheClient} from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
const client = createAvalancheClient({
chain: avalanche,
transport: {
type: "http",
},
})
const block = await client.xChain.getBlock({
blockID: "d7WYmb8VeZNHsny3EJCwMm6QA37s1EHwMxw1Y71V3FqPZ5EFG",
encoding: "hex"
})
-
-
-Get a block by its height.
- -GetBlockByHeightParameters The block height and encoding format
-The block data. GetBlockByHeightReturnType
-import { createAvalancheClient} from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
const client = createAvalancheClient({
chain: avalanche,
transport: {
type: "http",
},
})
const block = await client.xChain.getBlockByHeight({
height: 1000001,
encoding: "hex"
})
-
-
-Get the height of the last accepted block.
- -The current height. GetHeightReturnType
-Get a transaction by its ID.
- -GetTxParameters The transaction ID and encoding
-The transaction data. GetTxReturnType
-import { createAvalancheClient} from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
const client = createAvalancheClient({
chain: avalanche,
transport: {
type: "http",
},
})
const tx = await client.xChain.getTx({
txID: "11111111111111111111111111111111LpoYY",
encoding: "hex"
})
-
-
-Get the transaction fee for this node.
- -The transaction fee. GetTxFeeReturnType
-Get the status of a transaction.
- -GetTxStatusParameters The transaction ID
-The transaction status. GetTxStatusReturnType
-import { createAvalancheClient} from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
const client = createAvalancheClient({
chain: avalanche,
transport: {
type: "http",
},
})
const status = await client.xChain.getTxStatus({
txID: "11111111111111111111111111111111LpoYY"
})
-
-
-Get the UTXOs for a set of addresses.
- -GetUTXOsParameters The addresses and source chain
-The UTXOs. GetUTXOsReturnType
-import { createAvalancheClient} from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
const client = createAvalancheClient({
chain: avalanche,
transport: {
type: "http",
},
})
const utxos = await client.xChain.getUTXOs({
addresses: ["X-avax18jma8ppw3nhx5r4ap8clazz0dps7rv5ukulre5"],
sourceChain: "P"
})
-
-
-Send a signed transaction to the network.
- -IssueTxParameters The transaction bytes and encoding
-The transaction ID. IssueTxReturnType
-import { createAvalancheClient} from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
const client = createAvalancheClient({
chain: avalanche,
transport: {
type: "http",
},
})
const txID = await client.xChain.issueTx({
tx: "0x00000009de31b4d8b22991d51aa6aa1fc733f23a851a8c9400000000000186a0000000005f041280000000005f9ca900000030390000000000000001fceda8f90fcb5d30614b99d79fc4baa29307762668f16eb0259a57c2d3b78c875c86ec2045792d4df2d926c40f829196e0bb97ee697af71f5b0a966dabff749634c8b729855e937715b0e44303fd1014daedc752006011b730",
encoding: "hex"
})
-
-
-Parameters for the admin.getLoggerLevel method.
-Return type for the admin.getLoggerLevel method.
Parameters for the admin.setLoggerLevel method.
The status of an atomic transaction
-The parameters for the avax.getAtomicTx method.
The return type for the avax.getAtomicTx method.
The return type for the avax.getAtomicTxStatus method.
The status of the atomic transaction. CChainAtomicTxStatus
-The parameters for the avax.getUTXOs method.
The addresses to get the UTXOs for. Each returned UTXO will reference at least one address in this list.
-The maximum number of UTXOs to return. If omitted or greater than 1024, it is set to 1024.
-The return type for the avax.getUTXOs method.
Return type for the health.health method.
Object containing health check results for each component
-Overall health status of the node
-Parameters for the index.getContainerByID method.
Return type for the index.getContainerByID method.
The byte representation of the container
-The encoding format used for the container data. Only "hex" is supported.
-The container's ID
-How many containers were accepted in this index before this one
-The time at which this node accepted the container
-Parameters for the index.getContainerByIndex method.
Return type for the index.getContainerByIndex method.
-The byte representation of the container
-The encoding format used for the container data. Only "hex" is supported.
-The container's ID
-How many containers were accepted in this index before this one
-The time at which this node accepted the container
-Parameters for the index.getContainerRange method.
Return type for the index.getContainerRange method.
-Array of container details, each containing:
-Return type for the index.getLastAccepted method.
The byte representation of the container
-The encoding format used for the container data. Only "hex" is supported.
-The container's ID
-How many containers were accepted in this index before this one
-The time at which this node accepted the container
-Return type for the index.isAccepted method.
Return type for the info.getBlockchainID method.
-Return type for the info.getNetworkName method.
-Return type for the info.getNodeVersion method.
-The version of the database
-The version of the RPC protocol
-The version of the node (e.g. "avalanche/1.9.4")
-Map of VM IDs to their versions
-Return type for the info.getTxFee method.
-The fee for adding a primary network delegator
-The fee for adding a primary network validator
-The fee for adding a subnet delegator
-The fee for adding a subnet validator
-The fee for creating an asset
-The fee for creating a blockchain
-The fee for creating a subnet
-The fee for transforming a subnet
-The base transaction fee
-Return type for the info.isBootstrapped method.
-Return type for the info.peers method.
-The number of connected peers
-Array of peer information
-Array of chain IDs the peer is benched on
-The remote IP of the peer
-Timestamp of last message received from the peer
-Timestamp of last message sent to the peer
-The prefixed Node ID of the peer
-The node's primary network uptime observed by the peer
-The public IP of the peer
-The version the peer is running
-Return type for the info.upgrades method.
-Timestamp of Apricot Phase 1 upgrade
-Timestamp of Apricot Phase 2 upgrade
-Timestamp of Apricot Phase 3 upgrade
-Minimum P-Chain height for Apricot Phase 4
-Timestamp of Apricot Phase 4 upgrade
-Timestamp of Apricot Phase 5 upgrade
-Timestamp of Apricot Phase 6 upgrade
-Timestamp of Apricot Phase Post-6 upgrade
-Timestamp of Apricot Phase Pre-6 upgrade
-Timestamp of Banff upgrade
-Timestamp of Cortina upgrade
-X-Chain stop vertex ID for Cortina upgrade
-Timestamp of Durango upgrade
-Timestamp of Etna upgrade
-OptionalfortunaTimestamp of Fortuna upgrade
-Return type for the info.uptime method.
-Describes the status of a blockchain.
-Validating: The blockchain is being validated by this node.Created: The blockchain exists but isn’t being validated by this node.Preferred: The blockchain was proposed to be created and is likely to be created, but the transaction isn’t yet accepted.Syncing: This node is participating in the blockchain as a non-validating node.Unknown: The blockchain either wasn’t proposed or the proposal isn’t preferred.Return type for the platform.getBalance method.
The total balance of the queried addresses
-The locked and not stakeable balance of the queried addresses
-The locked stakeable balance of the queried addresses
-The unlocked balance of the queried addresses
-The IDs of the UTXOs that reference the queried addresses
-The output index of the UTXO.
-The transaction ID of the UTXO.
-Parameters for the platform.getBlockchainStatus method.
-Get the status of a blockchain.
Return type for the platform.getBlockchainStatus method.
Return type for the platform.getBlockchains method.
-Get all the blockchains that exist (excluding the P-Chain).
Parameters for the platform.getCurrentSupply method.
-Get the current supply of a token.
Parameters for the platform.getCurrentValidators method.
-Get the current validators of a Subnet.
OptionalnodeList of the NodeIDs of current validators to request. If omitted, all current validators are returned. If a specified NodeID is not in the set of current validators, it will not be included in the response
-OptionalsubnetThe Subnet whose current validators are returned. If omitted, returns the current validators of the Primary Network
-Return type for the platform.getCurrentValidators method.
List of validators for the specified Subnet or the Primary Network
-The accrued delegatee reward for the validator.
-Optionalconnected?: booleanIndicates if the node is connected and tracks the Subnet.
-Omitted if subnetID is not the Primary Network.
OptionaldelegationFee?: stringThe percent fee this validator charges when others delegate stake to them.
-Omitted if subnetID is not the Primary Network.
OptionaldelegationRewardOwner?: { addresses: ...; locktime: ...; threshold: ... }Specifies the owner of the potential reward earned from delegations.
-Includes locktime, threshold, and an array of addresses.
-Omitted if subnetID is not the Primary Network.
OptionaldelegatorCount?: stringThe number of delegators on this validator.
-Omitted if subnetID is not the Primary Network.
Optionaldelegators?: (...)[]List of delegators to this validator.
-Omitted if subnetID is not the Primary Network.
-Omitted unless nodeIDs specifies a single NodeID.
OptionaldelegatorWeight?: stringThe total weight of delegators on this validator.
-Omitted if subnetID is not the Primary Network.
The Unix time when the validator stops validating the Subnet.
-Omitted if subnetID is an L1 Subnet.
The validator's node ID.
-OptionalpotentialReward?: stringThe potential reward earned from staking.
-Omitted if subnetID is not the Primary Network.
Optionalsigner?: { proofOfPosession: ...; publicKey: ... }The node's BLS public key and proof of possession.
-Omitted if the validator doesn't have a BLS public key.
-Omitted if subnetID is not the Primary Network.
The amount of stake for the validator.
-The Unix time when the validator starts validating the Subnet.
-The validator transaction ID.
-Optionaluptime?: stringThe percentage of time the queried node has reported the peer as online and validating the Subnet.
-Omitted if subnetID is not the Primary Network.
OptionalvalidationRewardOwner?: { addresses: ...; locktime: ...; threshold: ... }Specifies the owner of the potential reward earned from staking.
-Includes locktime, threshold, and an array of addresses.
-Omitted if subnetID is not the Primary Network.
The validator's weight (stake) when sampling validators.
-Return type for the platform.getFeeConfig method.
-Get the fee configuration for the P-Chain.
A constant used to convert excess gas into a gas price
-The maximum amount of gas the chain is allowed to store for future use
-The maximum amount of gas the chain is allowed to consume per second
-The minimum price per unit of gas
-The target amount of gas the chain should consume per second to maintain stable fees
-Weights to merge fee dimensions into a single gas value
-Return type for the platform.getFeeState method.
-Get the current fee state of the P-Chain.
Parameters for the platform.getL1Validator method.
-Get information about an L1 validator.
Return type for the platform.getL1Validator method.
OptionalbalanceThe current remaining balance that can be used to pay for the validator's continuous fee
-Specifies the owner that can withdraw the balance
-OptionalheightThe height of the last accepted block
-OptionalminThe minimum nonce that must be included in a SetL1ValidatorWeightTx for the transaction to be valid
-The node ID of the validator
-The compressed BLS public key of the validator
-Specifies the owner that will receive any withdrawn balance
-The Unix timestamp, in seconds, of when this validator was added to the validator set
-The L1 subnet ID this validator is validating
-The weight of this validator used for consensus voting and ICM
-Parameters for the platform.getMinStake method.
-Get the minimum stake required for validators and delegators.
Return type for the platform.getMinStake method.
Parameters for the platform.getRewardUTXOs method.
-Get the reward UTXOs for a transaction.
Return type for the platform.getRewardUTXOs method.
Parameters for the platform.getStake method.
-Get the amount of stake for a set of addresses.
Return type for the platform.getStake method.
Parameters for the platform.getStakingAssetID method.
-Get the ID of the asset used for staking on a Subnet.
Return type for the platform.getSubnet method.
The control keys of the Subnet
-The ID of the conversion
-Whether the Subnet is permissioned
-The locktime of the Subnet
-The address of the manager
-The ID of the manager chain
-The ID of the transaction that transformed the Subnet
-The threshold of control keys required to make changes to the Subnet
-Return type for the platform.getSubnets method.
Information about the requested Subnets
-The control keys of the Subnet.
-The ID of the Subnet.
-The threshold of control keys required to make changes to the Subnet.
-Return type for the platform.getTotalStake method.
Return type for the platform.getTx method.
-Returns the transaction encoded to the specified format PChainTransactionType
Parameters for the platform.getUTXOs method.
-Get the UTXOs that reference a given set of addresses.
The addresses to get UTXOs for
-OptionalencodingThe encoding format to use. Can only be hex when a value is provided
-OptionallimitThe maximum number of UTXOs to return
-OptionalsourceThe chain to get UTXOs from. If omitted, gets UTXOs from the P-Chain
-OptionalstartThe index to start from. If omitted, starts from the beginning
-Return type for the platform.getUTXOs method.
The encoding format used
-The index of the last UTXO returned
-The number of UTXOs returned
-OptionalsourceThe chain the UTXOs are from
-The UTXOs that reference the given addresses
-Parameters for the platform.getValidatorsAt method.
-Get the validators at a given height.
Return type for the platform.getValidatorsAt method.
Parameters for the platform.issueTx method.
-Issue a transaction to the Platform Chain.
Represents the status of a transaction.
-Committed: The transaction is (or will be) accepted by every node.Pending: The transaction is being voted on by this node.Dropped: The transaction will never be accepted by any node in the network. Check the reason field for more information.Unknown: The transaction hasn’t been seen by this node.Parameters for the platform.sampleValidators method.
-Sample validators from the specified Subnet.
Return type for the platform.sampleValidators method.
Parameters for the platform.validatedBy method.
-Get the Subnet that validates a given blockchain.
Return type for the platform.validates method.
The return type for the feeConfig method.
The return type for the eth_getActiveRulesAt method.
OptionalchangeOptional. Addresses to send remaining change to.
-If not provided, fromAddresses will be used.
-Preference would be given to changeAddresses array.
OptionalfromOptional. Addresses to send funds from.
-If not provided, utxos can be used.
-Preference would be given to utxos array.
OptionalmemoOptional. Memo to include in the transaction.
-OptionalminOptional. Earliest time this transaction can be issued. -Useful for building transactions using UTXOs -that are currently locked but will unlock after this time. -If not provided, the current time will be used.
-OptionalutxosOptional. UTXOs to use as inputs for the transaction.
-If not provided, utxos will be fetched from the fromAddresses.
-Preference would be given to utxos array.
Addresses who can sign the consuming of this UTXO.
-Amount holding in this UTXO.
-OptionalassetOptional. Asset ID of the UTXO.
-OptionallocktimeOptional. Timestamp in seconds after which this UTXO can be consumed.
-OptionalthresholdOptional. Threshold of addresses' signatures required to consume this UTXO.
The parameters for the send method.
-OptionalaccountThe account to send the transaction from.
-The amount of tokens to send in AVAX.
-OptionalcontextOptional. The context to use for the transaction. If not provided, the context will be fetched.
-OptionaldestinationThe chain to send the tokens to. Default is C. Only P and C are supported.
-OptionalfromThe address to send the tokens from. Default is the account address.
-OptionalsourceThe chain to send the tokens from. Default is C. Only P and C are supported.
-The address to send the tokens to. If the destination chain is P, this should be a P chain address. If the destination chain is C, this should be a C chain address.
-OptionaltokenThe token to send. Default is AVAX. Only AVAX is supported.
-The parameters for the sendXPTransaction method
-OptionalaccountOptional, the account to use for the transaction. AvalancheAccount or Address
-The chain to send the transaction to. "X" | "P" | "C"
OptionaldisableOptional, the disable auth to use for the transaction. number[]
OptionaldisableOptional, the disable owners to use for the transaction. PChainOwner
-OptionalexternalOptional, the external indices to use for the transaction. number[]
OptionalfeeOptional, the fee tolerance to use for the transaction. number
OptionalinternalOptional, the internal indices to use for the transaction. number[]
OptionalsubnetOptional, the subnet auth to use for the transaction. number[]
OptionalsubnetOptional, the subnet owners to use for the transaction. PChainOwner
-The transaction to send, either a hex string or an UnsignedTx object. string or UnsignedTx
OptionalutxoOptional, the utxo ids to use for the transaction. string[]
The return type for the sendXPTransaction method
-The parameters for the signXPMessage method
-OptionalaccountOptional, the account to use for the message. AvalancheAccount, Address
-OptionalaccountOptional, the account index to use for the message from custom transport (eg: core extension). number
The message to sign. string
The parameters for the signXPTransaction method
-OptionalaccountOptional, the account to use for the transaction. AvalancheAccount, Address
-The chain to sign the transaction on. "X" | "P" | "C"
OptionalcontextOptional, the context to use for the transaction. ContextType.Context
-OptionaldisableOptional, the disable auth to use for the transaction. number[]
OptionaldisableOptional, the disable owners to use for the transaction. PChainOwner
-OptionalsignedThe signed transaction in hex format. string
OptionalsubnetOptional, the subnet auth to use for the transaction. number[]
OptionalsubnetOptional, the subnet owners to use for the transaction. PChainOwner
-OptionaltxThe transaction to sign, either a hex string or an UnsignedTx object. string or UnsignedTx
OptionalutxoOptional, the utxo ids to use for the transaction. string[]
The return type for the signXPTransaction method
-Optional, the chain to sign the transaction on. "X" | "P" | "C"
OptionaldisableOptional, the disable auth to use for the transaction. number[]
OptionaldisableOptional, the disable owners to use for the transaction. PChainOwner
-The signatures array for the transaction. Signatures
-The signed transaction in hex format. string
OptionalsubnetOptional, the subnet auth to use for the transaction. number[]
OptionalsubnetOptional, the subnet owners to use for the transaction. PChainOwner
-The signatures for the transaction
-OptionalcontextOptional. The context to use for the transaction. If not provided, the context will be fetched.
-The chain alias to export the funds to. P_CHAIN_ALIAS | X_CHAIN_ALIAS
-The consolidated exported output (UTXO)
-Addresses who can sign the consuming of this UTXO.
-The amount (in AVAX) held by this exported output.
-Optionallocktime?: numberOptional. Timestamp in seconds after which this UTXO can be consumed.
-Optionalthreshold?: numberOptional. Threshold of addresses' signatures required to consume this UTXO.
The EVM address to export the funds from.
-The chain alias. C_CHAIN_ALIAS
-The export transaction instance.
-The unsigned transaction.
-OptionalaccountThe account to use for the transaction. AvalancheAccount or Address -If not provided, the account will be fetched from the client.
-OptionalcontextOptional. The context to use for the transaction. If not provided, the context will be fetched.
-OptionalfromThe addresses to import the funds from. If not provided, the wallet will be used to fetch the addresses.
-The chain alias to import the funds from. P_CHAIN_ALIAS | X_CHAIN_ALIAS
-The EVM address to import the funds to.
-OptionalutxosOptional. UTXOs to use as inputs for the transaction. These UTXOs
-must be in the atomic memory i.e. should already have been exported
-from the source chain. If not provided, utxos will be fetched from
-the fromAddresses. Preference would be given to utxos array.
The chain alias. C_CHAIN_ALIAS
-The import transaction instance.
-The unsigned transaction.
-The addresses to import the funds to. These are the -addresses who can sign the consuming of this UTXO.
-OptionallocktimeOptional. Timestamp in seconds after which this UTXO can be consumed.
-OptionalthresholdOptional. The number of signatures required out of the total addresses
-to spend the imported output.
L1 validator
-Owner information which can remove or disable the validator -from the L1 validator set.
-Initial balance (in AVAX) of the L1 validator required for paying -a contiguous fee to the Primary Network to validate the L1.
-Node ID of the validator.
-Proof of possession of the validator.
-Proof of possession of the public key.
-Public key of the validator.
-Owner information to which the remaining L1 validator balance will be assigned, in case -the validator is removed or disabled from the L1 validator set.
-Weight of the validator on the L1 used during the consensus participation.
-Optionalcontext?: ContextType.ContextOptional. The context to use for the transaction. If not provided, the context will be fetched.
-The Unix time in seconds when the delegation stops -(and staked AVAX is returned).
-Optionallocktime?: numberOptional. The unix timestamp in seconds after which the reward UTXO -can be spent, once they are created after the staking period ends.
-NodeID of the validator to delegate AVAX to.
-The addresses which will receive the rewards from the delegated stake. -Given addresses will share the reward UTXO.
-Amount of AVAX to stake. This amount will be locked until
-the end of the staking period. The staked outputs will be
-consolidated into a single output and owned by the
-changeAddresses or the fromAddresses array.
Optionalthreshold?: numberOptional. The number of signatures required to spend the funds in the -resultant reward UTXO.
-Optionalcontext?: ContextType.ContextOptional. The context to use for the transaction. If not provided, the context will be fetched.
-The addresses which will receive the delegator fee rewards. Given addresses -will share the reward UTXO.
-The percentage of delegator rewards given to validator or delegatorRewardAddresses
-as a delgation fee. Valid upto 3 decimal places.
The Unix time in seconds when the validator will be removed from staking set. -(and staked AVAX is returned).
-Optionallocktime?: numberOptional. The unix timestamp in seconds after which the reward UTXO -can be spent, once they are created after the staking period ends -(both validator and delegator fee rewards).
-The NodeID of the validator being added.
-OptionalpublicKey?: stringOptional. The BLS public key (in hex format) of the validator being added.
-The addresses which will receive the validator rewards. Given addresses -will share the reward UTXO.
-Optionalsignature?: stringOptional. The BLS signature (in hex format) of the validator being added.
-Amount of AVAX to stake. The staked amount in nAVAX will
-represent the weight of this validator on the network.
-This amount will be locked until the end of the staking period.
-The staked outputs will be consolidated into a single output
-and owned by the changeAddresses or the fromAddresses array.
Optionalthreshold?: numberOptional. The number of signatures required to spend the funds in the -resultant reward UTXO (both validator and delegator fee rewards).
-Optionalcontext?: ContextType.ContextOptional. The context to use for the transaction. If not provided, the context will be fetched.
-End timestamp in seconds after which the subnet validator -will be removed from the subnet's validator set.
-Node ID of the validator being added.
-Array of indices from the subnet's owners array
-who will sign this AddSubnetValidatorTx.
Subnet ID to add the validator to.
-Weight of the validator that will be used during -consensus.
-The add subnet validator transaction instance.
-The chain alias.
-Array of indices from the subnet's owners array
-who will sign this AddSubnetValidatorTx.
The subnet owners.
-The unsigned transaction.
-Optionalcontext?: ContextType.ContextOptional. The context to use for the transaction. If not provided, the context will be fetched.
-Optionaloutputs?: Output[]Optional. Outputs to send funds to. It can -be used to specify resulting UTXOs.
-Blockchain ID of the L1 where the validator manager contract is deployed.
-Optionalcontext?: ContextType.ContextOptional. The context to use for the transaction. If not provided, the context will be fetched.
-Address of the validator manager contract.
-Array of indices from the subnet's owners array
-who will sign this ConvertSubnetToL1Tx.
Subnet ID of the subnet to convert to an L1.
-Initial set of L1 validators after the conversion. -[]
-Name of the chain being created.
-Optionalcontext?: ContextType.ContextOptional. The context to use for the transaction. If not provided, the context will be fetched.
-OptionalfxIds?: readonly (...)[]Optional. Array of FX IDs to be added to the chain.
-Genesis JSON data of the chain being created.
-Array of indices from the subnet's owners array
-who will sign this CreateChainTx.
Subnet ID to create the chain on.
-VM ID of the chain being created.
-Optionalcontext?: ContextType.ContextOptional. The context to use for the transaction. If not provided, the context will be fetched. ContextType.Context
-Subnet owners of the subnet being created. Signatures -from these addresses will be required to any Subnet related -transactions. SubnetOwners
-Optionalcontext?: ContextType.ContextOptional. The context to use for the transaction. If not provided, the context will be fetched.
-Array of indices from the L1 validator's disable owners array
-who will sign this DisableL1ValidatorTx.
Validation ID of the L1 validator.
-Optionalcontext?: ContextType.ContextOptional. The context to use for the transaction. If not provided, the context will be fetched.
-The chain to export the funds to. X_CHAIN_ALIAS | C_CHAIN_ALIAS
-The outputs to export.
-The chain alias. P_CHAIN_ALIAS
-The export transaction instance.
-The unsigned transaction.
-Optionalcontext?: ContextType.ContextOptional. The context to use for the transaction. If not provided, the context will be fetched.
-Consolidated imported output from the atomic memory (source chain). Users -cannot specify the amount, as it will be consolidation of all the UTXOs -pending for import from the source chain.
-The chain to import the funds from. X_CHAIN_ALIAS | C_CHAIN_ALIAS
-The chain alias. P_CHAIN_ALIAS
-The import transaction instance.
-The unsigned transaction.
-Amount of AVAX to increase the L1 validator balance by.
-Optionalcontext?: ContextType.ContextOptional. The context to use for the transaction. If not provided, the context will be fetched.
-Validation ID of the L1 validator.
-BLS signature of the validator.
-Optionalcontext?: ContextType.ContextOptional. The context to use for the transaction. If not provided, the context will be fetched.
-Initial balance (in AVAX) of the L1 validator getting registered, -Balance is required for paying a contiguous fee to the Primary -Network to validate the L1.
-Signed warp message hex with the AddressedCall payload
-containing message of type RegisterL1ValidatorMessage.
Optionalcontext?: ContextType.ContextOptional. The context to use for the transaction. If not provided, the context will be fetched.
-Node ID of the validator being removed.
-Array of indices from the subnet's owners array
-who will sign this RemoveSubnetValidatorTx.
Subnet ID of the subnet to remove the validator from.
-Optionalcontext?: ContextType.ContextOptional. The context to use for the transaction. If not provided, the context will be fetched.
-Signed warp message hex with the AddressedCall payload
-containing message of type SetL1ValidatorWeightMessage.
A list of unique addresses that correspond to the private keys that can be used to spend this output. Addresses must be sorted lexicographically.
-OptionallocktimeContains the Unix timestamp that this output can be spent after. The Unix timestamp is specific to the second.
-OptionalthresholdAn int that names the number of unique signatures required to spend the output. Must be less than or equal to the length of Addresses. If Addresses is empty, must be 0.
-The addresses to import the funds to. These are the -addresses who can sign the consuming of this UTXO.
-OptionallocktimeOptional. Timestamp in seconds after which this UTXO can be consumed.
-OptionalthresholdOptional. The number of signatures required out of the total addresses
-to spend the imported output.
Optionalcontext?: ContextType.ContextThe context to use for the transaction.
-Optionaloutputs?: Output[]Optional. Outputs to send funds to. It can -be used to specify resulting UTXOs.
-The base transaction instance.
-The chain alias. X_CHAIN_ALIAS
-The unsigned transaction.
-Optionalcontext?: ContextType.ContextThe context to use for the transaction.
-The chain to export the funds to. P_CHAIN_ALIAS | C_CHAIN_ALIAS
-The outputs to export.
-The chain alias. X_CHAIN_ALIAS
-The export transaction instance.
-The unsigned transaction.
-Optionalcontext?: ContextType.ContextThe context to use for the transaction.
-Consolidated imported output from the atomic memory (source chain). Users -cannot specify the amount, as it will be consolidation of all the UTXOs -pending for import from the source chain.
-The chain to import the funds from. P_CHAIN_ALIAS | C_CHAIN_ALIAS
-The chain alias. X_CHAIN_ALIAS
-The import transaction instance.
-The unsigned transaction.
-The parameters for the avm.buildGenesis method.
The encoding of the genesis data. Only "hex" is supported.
-The genesis data.
-The denomination of the asset.
-The initial state of the asset.
-The fixed cap of the asset.
-The addresses that can mint the asset.
-The amount of the asset.
-The name of the asset.
-The symbol of the asset.
-The network ID.
-The return type for the avm.buildGenesis method.
The return type for the avm.getAllBalances method.
The return type for the avm.getAssetDescription method.
The return type for the avm.getBalance method.
The parameters for the avm.getBlockByHeight method.
The parameters for the avm.getBlock method.
The return type for the avm.getTxFee method.
Parameters for the avm.getTx method.
Return type for the avm.getTx method.
-Returns the transaction in the requested format.
XChainTransactionType for detailed structure
-The parameters for the avm.getTxStatus method.
The parameters for the avm.getUTXOs method.
The addresses to get UTXOs for.
-OptionalencodingThe encoding of the UTXOs to return.
-OptionallimitThe maximum number of UTXOs to return.
-OptionalsourceThe source chain of the UTXOs to return.
-OptionalstartThe starting index of the UTXOs to return.
-The return type for the avm.getUTXOs method.
The encoding of the UTXOs.
-The end index of the UTXOs.
-The address of the UTXO.
-The UTXO.
-The number of UTXOs fetched.
-OptionalsourceThe source chain of the UTXOs.
-The UTXOs.
-Parameters for the avm.issueTx method.
-This method sends a signed transaction to the network.
Represents an X-Chain block in either JSON or hex format. -The X-Chain is Avalanche's native platform for creating and trading assets.
-Height of the block in the chain
-ID of the block
-Merkle root of all transactions in the block
-ID of the parent block
-Unix timestamp when the block was created
-Array of transactions in the block
-Encoding format for the block data
-Block data in hex format
-Encoding format for the block data
-Represents the possible statuses of an X-Chain transaction.
-Represents an X-Chain transaction in either JSON or hex format. -Transactions on the X-Chain can transfer assets between addresses or export assets to other chains.
-Encoding format for the transaction data
-Array of credentials (signatures) for the transaction
-ID of the transaction
-ID of the blockchain
-ID of the destination chain for cross-chain transfers
-Array of outputs being exported to another chain
-Array of transaction inputs
-Optional memo field for the transaction
-Network ID of the blockchain
-Array of transaction outputs
-Encoding format for the transaction data
-Transaction data in hex format
-ConstCollection of block explorers
-Collection of contracts
-ID in number form
-Human-readable name
-Currency used by chain
-Collection of RPC endpoints
-ConstCollection of block explorers
-Collection of contracts
-ID in number form
-Human-readable name
-Currency used by chain
-Collection of RPC endpoints
-Flag for test networks
-ConstConstConstConstConstConstConstConstConstConstConst
Converts a HD key to an Avalanche account.
-Derives the C-chain and P-chain accounts from the HD key.
-