Skip to main content

Core-specific methods

Beyond standard EVM RPC, Core implements two families of its own methods: avalanche_* for Avalanche Primary Network operations and account management, and the wallet_* standards for network and asset management.

Avalanche Primary Network

These methods work with the X, P, and C-Chains. Transactions are passed as hex-encoded bytes and identified by a chainAlias of 'X', 'P', or 'C'.

avalanche_sendTransaction

Signs a transaction, asks the user for approval, and broadcasts it.

const txHash = await provider.request({
method: 'avalanche_sendTransaction',
params: {
transactionHex: '0x00000000...',
chainAlias: 'P',
// Optional, for UTXO selection on X and P:
externalIndices: [0],
internalIndices: [0],
utxos: [],
},
});

Build transactionHex with AvalancheJS, which produces the unsigned transaction bytes for staking, cross-chain transfers, and other Primary Network operations. The X and P-Chain guide walks through a full example.

avalanche_signTransaction

Signs without broadcasting — use it when you submit through your own infrastructure. Takes transactionHex and chainAlias like avalanche_sendTransaction, plus optional utxos and an optional from address; it does not accept the index arrays. Returns the signed transaction hex.

avalanche_getAccountPubKey

Returns the extended public keys for the active account, so a dapp can derive the user's addresses on every chain:

const { evm, xp } = await provider.request({
method: 'avalanche_getAccountPubKey',
});
// evm — public key for C-Chain and other EVM networks
// xp — public key for the X and P-Chains

Account and wallet state

MethodReturns
avalanche_getAccountsThe accounts the user exposed to the dapp, with names, addresses, and the active flag
avalanche_selectAccountAsks the user to switch the active account
avalanche_getProviderStateConnection state: accounts, chain id, and whether the wallet is unlocked
avalanche_getIsDefaultExtensionStateWhether Core is set as the user's default wallet
avalanche_setDeveloperModeToggles testnet mode, switching every network to its test variant

Contacts

With the user's permission, a dapp can read and manage the wallet's address book: avalanche_getContacts, avalanche_createContact, avalanche_updateContact, and avalanche_removeContact. Each contact is an object with a name and per-chain addresses. Every mutation prompts the user.

Network management (wallet_*)

The standard EIP-3085 and EIP-3326 surface:

// Ask the user to add a network (EIP-3085).
await provider.request({
method: 'wallet_addEthereumChain',
params: [{
chainId: '0xa869',
chainName: 'Avalanche Fuji Testnet',
nativeCurrency: { name: 'AVAX', symbol: 'AVAX', decimals: 18 },
rpcUrls: ['https://api.avax-test.network/ext/bc/C/rpc'],
blockExplorerUrls: ['https://testnet.snowtrace.io/'],
}],
});

// Ask the user to switch to it (EIP-3326).
await provider.request({
method: 'wallet_switchEthereumChain',
params: [{ chainId: '0xa869' }],
});

wallet_watchAsset (EIP-747) asks the user to track a token — see the Watch an asset guide. wallet_requestPermissions (EIP-2255) requests account permissions explicitly; eth_requestAccounts calls it for you on first connection.

Every method above is also runnable against your own wallet in the playground.