Avalanche SDK Client
    Preparing search index...

    Type Alias CChainWalletActions

    type CChainWalletActions = {
        prepareExportTxn: (args: PrepareExportTxnParameters) => Promise<PrepareExportTxnReturnType>;
        prepareImportTxn: (args: PrepareImportTxnParameters) => Promise<PrepareImportTxnReturnType>;
    }
    Index

    Properties

    prepareExportTxn: (args: PrepareExportTxnParameters) => Promise<PrepareExportTxnReturnType>

    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.

    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"
    })
    prepareImportTxn: (args: PrepareImportTxnParameters) => Promise<PrepareImportTxnReturnType>

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