Avalanche SDK Client
    Preparing search index...

    Type Alias AvalancheWalletActions

    type AvalancheWalletActions = {
        getAccountPubKey: () => Promise<GetAccountPubKeyReturnType>;
        send: (args: SendParameters) => Promise<SendReturnType>;
        sendXPTransaction: (args: SendXPTransactionParameters) => Promise<SendXPTransactionReturnType>;
        signXPMessage: (args: SignXPMessageParameters) => Promise<SignXPMessageReturnType>;
        signXPTransaction: (args: SignXPTransactionParameters) => Promise<SignXPTransactionReturnType>;
        waitForTxn: (args: WaitForTxnParameters) => Promise<void>;
    }
    Index

    Properties

    getAccountPubKey: () => Promise<GetAccountPubKeyReturnType>

    Gets the public key associated with the wallet account.

    Type declaration

    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()
    send: (args: SendParameters) => Promise<SendReturnType>

    Sends tokens from the source chain to the destination chain.

    Type declaration

    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",
    sendXPTransaction: (args: SendXPTransactionParameters) => Promise<SendXPTransactionReturnType>

    Sends an XP transaction to the network.

    Type declaration

    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"
    })
    signXPMessage: (args: SignXPMessageParameters) => Promise<SignXPMessageReturnType>

    Signs a message using the wallet's private key.

    Type declaration

    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..."
    })
    signXPTransaction: (args: SignXPTransactionParameters) => Promise<SignXPTransactionReturnType>

    Signs an XP transaction using the wallet's private key.

    Type declaration

    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..."
    })
    waitForTxn: (args: WaitForTxnParameters) => Promise<void>

    Waits for a transaction to be confirmed on the network.

    Type declaration

    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"
    })