Avalanche SDK Client
    Preparing search index...

    Type Alias PChainActions

    type PChainActions = {
        getBalance: (args: GetBalanceParameters) => Promise<GetBalanceReturnType>;
        getBlock: (args: GetBlockParameters) => Promise<GetBlockReturnType>;
        getBlockByHeight: (args: GetBlockByHeightParameters) => Promise<GetBlockByHeightReturnType>;
        getBlockchains: () => Promise<GetBlockchainsReturnType>;
        getBlockchainStatus: (args: GetBlockchainStatusParameters) => Promise<GetBlockchainStatusReturnType>;
        getCurrentSupply: (args: GetCurrentSupplyParameters) => Promise<GetCurrentSupplyReturnType>;
        getCurrentValidators: (args: GetCurrentValidatorsParameters) => Promise<GetCurrentValidatorsReturnType>;
        getFeeConfig: () => Promise<GetFeeConfigReturnType>;
        getFeeState: () => Promise<GetFeeStateReturnType>;
        getHeight: () => Promise<GetHeightReturnType>;
        getL1Validator: (args: GetL1ValidatorParameters) => Promise<GetL1ValidatorReturnType>;
        getMinStake: (args: GetMinStakeParameters) => Promise<GetMinStakeReturnType>;
        getProposedHeight: () => Promise<GetProposedHeightReturnType>;
        getRewardUTXOs: (args: GetRewardUTXOsParameters) => Promise<GetRewardUTXOsReturnType>;
        getStake: (args: GetStakeParameters) => Promise<GetStakeReturnType>;
        getStakingAssetID: (args: GetStakingAssetIDParameters) => Promise<GetStakingAssetIDReturnType>;
        getSubnet: (args: GetSubnetParameters) => Promise<GetSubnetReturnType>;
        getSubnets: (args: GetSubnetsParameters) => Promise<GetSubnetsReturnType>;
        getTimestamp: () => Promise<GetTimestampReturnType>;
        getTotalStake: (args: GetTotalStakeParameters) => Promise<GetTotalStakeReturnType>;
        getTx: (args: GetTxParameters) => Promise<GetTxReturnType>;
        getTxStatus: (args: GetTxStatusParameters) => Promise<GetTxStatusReturnType>;
        getUTXOs: (args: GetUTXOsParameters) => Promise<GetUTXOsReturnType>;
        getValidatorsAt: (args: GetValidatorsAtParameters) => Promise<GetValidatorsAtReturnType>;
        issueTx: (args: IssueTxParameters) => Promise<IssueTxReturnType>;
        sampleValidators: (args: SampleValidatorsParameters) => Promise<SampleValidatorsReturnType>;
        validatedBy: (args: ValidatedByParameters) => Promise<ValidatedByReturnType>;
        validates: (args: ValidatesParameters) => Promise<ValidatesReturnType>;
    }
    Index

    Properties

    getBalance: (args: GetBalanceParameters) => Promise<GetBalanceReturnType>

    Get the balance of AVAX controlled by a given address.

    Type declaration

    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"]
    })
    getBlock: (args: GetBlockParameters) => Promise<GetBlockReturnType>

    Type declaration

    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"
    })
    getBlockByHeight: (args: GetBlockByHeightParameters) => Promise<GetBlockByHeightReturnType>

    Type declaration

    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"
    })
    getBlockchains: () => Promise<GetBlockchainsReturnType>

    Get all the blockchains that exist (excluding the P-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 blockchains = await client.pChain.getBlockchains()
    getBlockchainStatus: (args: GetBlockchainStatusParameters) => Promise<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"
    })
    getCurrentSupply: (args: GetCurrentSupplyParameters) => Promise<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"
    })
    getCurrentValidators: (args: GetCurrentValidatorsParameters) => Promise<GetCurrentValidatorsReturnType>

    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"
    })
    getFeeConfig: () => Promise<GetFeeConfigReturnType>

    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.pChain.getFeeConfig()
    getFeeState: () => Promise<GetFeeStateReturnType>

    Type declaration

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

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

    const feeState = await client.pChain.getFeeState()
    getHeight: () => Promise<GetHeightReturnType>

    Get the height of the last accepted 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 height = await client.pChain.getHeight()
    getL1Validator: (args: GetL1ValidatorParameters) => Promise<GetL1ValidatorReturnType>

    Type declaration

    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"
    })
    getMinStake: (args: GetMinStakeParameters) => Promise<GetMinStakeReturnType>

    Type declaration

    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"
    })
    getProposedHeight: () => Promise<GetProposedHeightReturnType>

    Type declaration

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

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

    const proposedHeight = await client.pChain.getProposedHeight()
    getRewardUTXOs: (args: GetRewardUTXOsParameters) => Promise<GetRewardUTXOsReturnType>

    Type declaration

    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"
    })
    getStake: (args: GetStakeParameters) => Promise<GetStakeReturnType>

    Get the stake amount for a set of addresses.

    Type declaration

    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"
    })
    getStakingAssetID: (args: GetStakingAssetIDParameters) => Promise<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"
    })
    getSubnet: (args: GetSubnetParameters) => Promise<GetSubnetReturnType>

    Type declaration

    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"
    })
    getSubnets: (args: GetSubnetsParameters) => Promise<GetSubnetsReturnType>

    Type declaration

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

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

    const subnets = await client.pChain.getSubnets()
    getTimestamp: () => Promise<GetTimestampReturnType>

    Type declaration

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

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

    const timestamp = await client.pChain.getTimestamp()
    getTotalStake: (args: GetTotalStakeParameters) => Promise<GetTotalStakeReturnType>

    Type declaration

    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"
    })
    getTx: (args: GetTxParameters) => Promise<GetTxReturnType>

    Type declaration

    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"
    })
    getTxStatus: (args: GetTxStatusParameters) => Promise<GetTxStatusReturnType>

    Type declaration

    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"
    })
    getUTXOs: (args: GetUTXOsParameters) => Promise<GetUTXOsReturnType>

    Type declaration

    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"
    })
    getValidatorsAt: (args: GetValidatorsAtParameters) => Promise<GetValidatorsAtReturnType>

    Type declaration

    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"
    })
    issueTx: (args: IssueTxParameters) => Promise<IssueTxReturnType>

    Issue a transaction to the Platform 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 txID = await client.pChain.issueTx({
    tx: "0x00000009de31b4d8b22991d51aa6aa1fc733f23a851a8c9400000000000186a0000000005f041280000000005f9ca900000030390000000000000001fceda8f90fcb5d30614b99d79fc4baa29307762668f16eb0259a57c2d3b78c875c86ec2045792d4df2d926c40f829196e0bb97ee697af71f5b0a966dabff749634c8b729855e937715b0e44303fd1014daedc752006011b730",
    encoding: "hex"
    })
    sampleValidators: (args: SampleValidatorsParameters) => Promise<SampleValidatorsReturnType>

    Type declaration

    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"
    })
    validatedBy: (args: ValidatedByParameters) => Promise<ValidatedByReturnType>

    Get the Subnet that validates a given blockchain.

    Type declaration

    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"
    })
    validates: (args: ValidatesParameters) => Promise<ValidatesReturnType>

    Get the IDs of the blockchains a Subnet validates.

    Type declaration

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