Avalanche SDK Client
    Preparing search index...

    Type Alias AvalanchePublicActions

    Index

    Properties

    baseFee: () => Promise<BaseFeeReturnType>

    Type declaration

    import { createAvalancheClient} from '@avalanche-sdk/client'
    import { avalanche } from '@avalanche-sdk/client/chains'

    const client = createAvalancheClient({
    chain: avalanche,
    transport: { type: "http" },
    })

    const baseFee = await client.baseFee()
    feeConfig: (args: FeeConfigParameters) => Promise<FeeConfigReturnType>

    Get the fee config for a specific block.

    Type declaration

    import { createAvalancheClient} from '@avalanche-sdk/client'
    import { avalanche } from '@avalanche-sdk/client/chains'

    const client = createAvalancheClient({
    chain: avalanche,
    transport: { type: "http" },
    })

    const feeConfig = await client.feeConfig({ blk: "0x1" })
    getActiveRulesAt: (args: GetActiveRulesAtParameters) => Promise<GetActiveRulesAtReturnType>

    Get the active rules at a specific timestamp.

    Type declaration

    import { createAvalancheClient} from '@avalanche-sdk/client'
    import { avalanche } from '@avalanche-sdk/client/chains'

    const client = createAvalancheClient({
    chain: avalanche,
    transport: { type: "http" },
    })

    const activeRules = await client.getActiveRulesAt({ timestamp: "0x1" })
    getChainConfig: () => Promise<GetChainConfigReturnType>

    Get the chain configuration for the C-Chain.

    Type declaration

    import { createAvalancheClient} from '@avalanche-sdk/client'
    import { avalanche } from '@avalanche-sdk/client/chains'

    const client = createAvalancheClient({
    chain: avalanche,
    transport: {
    type: "http",
    },
    })

    const chainConfig = await client.getChainConfig()
    getRegistrationJustification: (args: GetRegistrationJustificationParams) => Promise<GetRegistrationJustificationReturnType>

    Retrieves the registration justification for the given validation ID Hex and subnet ID.

    If the validation ID corresponds to a bootstrap validator, the justification bytes produced by ConvertSubnetToL1Tx are returned.

    Otherwise, the function searches the Warp logs on the chain where the validator manager is deployed to locate the RegisterL1ValidatorMessage for the specified validation ID.

    Type declaration

    import { createAvalancheClient } from "@avalanche-sdk/client";
    import { getRegistrationJustification } from "@avalanche-sdk/client/methods/public";
    import { defineChain } from "@avalanche-sdk/client/chains";
    import { utils } from "@avalanche-sdk/client/utils";

    const chainConfig = defineChain({
    id: 28098,
    name: "Rough Complexity Chain",
    rpcUrls: {
    default: {
    http: [
    "https://base-url-to-your-rpc/ext/bc/28zXo5erueBemgxPjLom6Vhsm6oVyftLtfQSt61fd62SghoXrz/rpc",
    ],
    },
    },
    });

    const publicClient = createAvalancheClient({
    chain: chainConfig,
    transport: {
    type: "http",
    },
    });

    const validationIDHex = utils.bufferToHex(
    utils.base58check.decode(
    "TEwxg8JzAUsqFibtYkaiiYH9G1h5ZfX56zYURXpyaPRCSppC4"
    )
    );

    const justification = await publicClient.getRegistrationJustification({
    validationIDHex,
    subnetIDStr: "2DN6PTi2uXNCzzNz1p2ckGcW2eqTfpt2kv2a1h7EV36hYV3XRJ",
    maxBootstrapValidators: 200,
    chunkSize: 200,
    maxChunks: 100,
    });

    console.log("justification", JSON.stringify(justification, null, 2));
    maxPriorityFeePerGas: () => Promise<MaxPriorityFeePerGasReturnType>

    Get the priority fee needed to be included in a block.

    Type declaration

    import { createAvalancheClient} from '@avalanche-sdk/client'
    import { avalanche } from '@avalanche-sdk/client/chains'

    const client = createAvalancheClient({
    chain: avalanche,
    transport: {
    type: "http",
    },
    })

    const maxPriorityFee = await client.maxPriorityFeePerGas()