Coda by Ian Macalinao
    Preparing search index...

    Module @macalinao/clients-voter-stake-registry

    @macalinao/clients-voter-stake-registry

    npm version

    TypeScript client for the Realms Voter Stake Registry program by Grape, generated using Coda with full ESM support.

    bun add @macalinao/clients-voter-stake-registry
    

    This client is generated from the Voter Stake Registry IDL using Coda CLI:

    # Generate the client from idls/voter_stake_registry.json
    bun run codegen

    # Build the TypeScript
    bun run build

    The coda.config.mjs file defines custom PDAs for the Voter Stake Registry program, including:

    • Registrar: The voting registrar account - one per governance realm and governing mint
    • Voter: Individual voter accounts tied to a registrar and voter authority
    • Voter Weight Record: The account shown to spl-governance to prove vote weight
    import {
    findRegistrarPda,
    findVoterPda,
    findVoterWeightRecordPda,
    } from "@macalinao/clients-voter-stake-registry";

    // Get the registrar PDA
    const registrarPda = await findRegistrarPda({
    realm: realmPublicKey,
    realmGoverningTokenMint: mintPublicKey,
    });

    // Get a voter PDA
    const voterPda = await findVoterPda({
    registrar: registrarPublicKey,
    voterAuthority: authorityPublicKey,
    });

    // Get a voter weight record PDA
    const voterWeightRecordPda = await findVoterWeightRecordPda({
    registrar: registrarPublicKey,
    voterAuthority: authorityPublicKey,
    });

    Copyright © 2025 Ian Macalinao

    Licensed under the Apache License, Version 2.0

    Enumerations

    LockupKind
    VoterStakeRegistryAccount
    VoterStakeRegistryInstruction

    Interfaces

    ClawbackInput
    ClawbackInstructionData
    ClawbackInstructionDataArgs
    CloseDepositEntryInput
    CloseDepositEntryInstructionData
    CloseDepositEntryInstructionDataArgs
    CloseVoterInput
    CloseVoterInstructionData
    CloseVoterInstructionDataArgs
    ConfigureVotingMintInput
    ConfigureVotingMintInstructionData
    ConfigureVotingMintInstructionDataArgs
    CreateDepositEntryInput
    CreateDepositEntryInstructionData
    CreateDepositEntryInstructionDataArgs
    CreateRegistrarInput
    CreateRegistrarInstructionData
    CreateRegistrarInstructionDataArgs
    CreateVoterAsyncInput
    CreateVoterInput
    CreateVoterInstructionData
    CreateVoterInstructionDataArgs
    DepositEntry
    DepositEntryArgs
    DepositEntryInfo
    DepositEntryInfoArgs
    DepositInput
    DepositInstructionData
    DepositInstructionDataArgs
    GrantInput
    GrantInstructionData
    GrantInstructionDataArgs
    InternalTransferLockedInput
    InternalTransferLockedInstructionData
    InternalTransferLockedInstructionDataArgs
    InternalTransferUnlockedInput
    InternalTransferUnlockedInstructionData
    InternalTransferUnlockedInstructionDataArgs
    LockingInfo
    LockingInfoArgs
    Lockup
    LockupArgs
    LogVoterInfoInput
    LogVoterInfoInstructionData
    LogVoterInfoInstructionDataArgs
    ParsedClawbackInstruction
    ParsedCloseDepositEntryInstruction
    ParsedCloseVoterInstruction
    ParsedConfigureVotingMintInstruction
    ParsedCreateDepositEntryInstruction
    ParsedCreateRegistrarInstruction
    ParsedCreateVoterInstruction
    ParsedDepositInstruction
    ParsedGrantInstruction
    ParsedInternalTransferLockedInstruction
    ParsedInternalTransferUnlockedInstruction
    ParsedLogVoterInfoInstruction
    ParsedResetLockupInstruction
    ParsedSetTimeOffsetInstruction
    ParsedUpdateMaxVoteWeightInstruction
    ParsedUpdateVoterWeightRecordInstruction
    ParsedWithdrawInstruction
    Registrar
    RegistrarArgs
    RegistrarSeeds
    ResetLockupInput
    ResetLockupInstructionData
    ResetLockupInstructionDataArgs
    SetTimeOffsetInput
    SetTimeOffsetInstructionData
    SetTimeOffsetInstructionDataArgs
    UpdateMaxVoteWeightInput
    UpdateMaxVoteWeightInstructionData
    UpdateMaxVoteWeightInstructionDataArgs
    UpdateVoterWeightRecordInput
    UpdateVoterWeightRecordInstructionData
    UpdateVoterWeightRecordInstructionDataArgs
    VestingInfo
    VestingInfoArgs
    Voter
    VoterArgs
    VoterInfo
    VoterInfoArgs
    VoterSeeds
    VoterWeightRecord
    VoterWeightRecordArgs
    VoterWeightRecordSeeds
    VotingMintConfig
    VotingMintConfigArgs
    WithdrawInput
    WithdrawInstructionData
    WithdrawInstructionDataArgs

    Type Aliases

    ClawbackInstruction
    CloseDepositEntryInstruction
    CloseVoterInstruction
    ConfigureVotingMintInstruction
    CreateDepositEntryInstruction
    CreateRegistrarInstruction
    CreateVoterInstruction
    DepositInstruction
    GrantInstruction
    InternalTransferLockedInstruction
    InternalTransferUnlockedInstruction
    LockupKindArgs
    LogVoterInfoInstruction
    ParsedVoterStakeRegistryInstruction
    ResetLockupInstruction
    SetTimeOffsetInstruction
    UpdateMaxVoteWeightInstruction
    UpdateVoterWeightRecordInstruction
    VoterStakeRegistryError
    WithdrawInstruction

    Variables

    CLAWBACK_DISCRIMINATOR
    CLOSE_DEPOSIT_ENTRY_DISCRIMINATOR
    CLOSE_VOTER_DISCRIMINATOR
    CONFIGURE_VOTING_MINT_DISCRIMINATOR
    CREATE_DEPOSIT_ENTRY_DISCRIMINATOR
    CREATE_REGISTRAR_DISCRIMINATOR
    CREATE_VOTER_DISCRIMINATOR
    DEPOSIT_DISCRIMINATOR
    GRANT_DISCRIMINATOR
    INTERNAL_TRANSFER_LOCKED_DISCRIMINATOR
    INTERNAL_TRANSFER_UNLOCKED_DISCRIMINATOR
    LOG_VOTER_INFO_DISCRIMINATOR
    REGISTRAR_DISCRIMINATOR
    RESET_LOCKUP_DISCRIMINATOR
    SET_TIME_OFFSET_DISCRIMINATOR
    UPDATE_MAX_VOTE_WEIGHT_DISCRIMINATOR
    UPDATE_VOTER_WEIGHT_RECORD_DISCRIMINATOR
    VOTER_DISCRIMINATOR
    VOTER_STAKE_REGISTRY_ERROR__CLAWBACK_NOT_ALLOWED_ON_DEPOSIT
    VOTER_STAKE_REGISTRY_ERROR__DEBUG_INSTRUCTION
    VOTER_STAKE_REGISTRY_ERROR__DEPOSIT_ENTRY_FULL
    VOTER_STAKE_REGISTRY_ERROR__DEPOSIT_ENTRY_NOT_FOUND
    VOTER_STAKE_REGISTRY_ERROR__DEPOSIT_START_TOO_FAR_IN_FUTURE
    VOTER_STAKE_REGISTRY_ERROR__DEPOSIT_STILL_LOCKED
    VOTER_STAKE_REGISTRY_ERROR__FORBIDDEN_CPI
    VOTER_STAKE_REGISTRY_ERROR__INSUFFICIENT_LOCKED_TOKENS
    VOTER_STAKE_REGISTRY_ERROR__INSUFFICIENT_UNLOCKED_TOKENS
    VOTER_STAKE_REGISTRY_ERROR__INTERNAL_ERROR_BAD_LOCKUP_VOTE_WEIGHT
    VOTER_STAKE_REGISTRY_ERROR__INTERNAL_PROGRAM_ERROR
    VOTER_STAKE_REGISTRY_ERROR__INVALID_AUTHORITY
    VOTER_STAKE_REGISTRY_ERROR__INVALID_CHANGE_TO_CLAWBACK_DEPOSIT_ENTRY
    VOTER_STAKE_REGISTRY_ERROR__INVALID_DAYS
    VOTER_STAKE_REGISTRY_ERROR__INVALID_DECIMALS
    VOTER_STAKE_REGISTRY_ERROR__INVALID_END_TS
    VOTER_STAKE_REGISTRY_ERROR__INVALID_LOCKUP_KIND
    VOTER_STAKE_REGISTRY_ERROR__INVALID_LOCKUP_PERIOD
    VOTER_STAKE_REGISTRY_ERROR__INVALID_MINT
    VOTER_STAKE_REGISTRY_ERROR__INVALID_RATE
    VOTER_STAKE_REGISTRY_ERROR__INVALID_REALM_AUTHORITY
    VOTER_STAKE_REGISTRY_ERROR__INVALID_TIMESTAMP_ARGUMENTS
    VOTER_STAKE_REGISTRY_ERROR__INVALID_TO_DEPOSIT_AND_WITHDRAW_IN_ONE_SLOT
    VOTER_STAKE_REGISTRY_ERROR__INVALID_TOKEN_OWNER_RECORD
    VOTER_STAKE_REGISTRY_ERROR__LOCKUP_SATURATION_MUST_BE_POSITIVE
    VOTER_STAKE_REGISTRY_ERROR__MUST_KEEP_TOKENS_LOCKED
    VOTER_STAKE_REGISTRY_ERROR__OUT_OF_BOUNDS_DEPOSIT_ENTRY_INDEX
    VOTER_STAKE_REGISTRY_ERROR__OUT_OF_BOUNDS_VOTING_MINT_CONFIG_INDEX
    VOTER_STAKE_REGISTRY_ERROR__RATES_FULL
    VOTER_STAKE_REGISTRY_ERROR__SHOULD_BE_THE_FIRST_IX_IN_A_TX
    VOTER_STAKE_REGISTRY_ERROR__UNABLE_TO_CONVERT
    VOTER_STAKE_REGISTRY_ERROR__UNUSED_DEPOSIT_ENTRY_INDEX
    VOTER_STAKE_REGISTRY_ERROR__VAULT_TOKEN_NON_ZERO
    VOTER_STAKE_REGISTRY_ERROR__VOTER_WEIGHT_OVERFLOW
    VOTER_STAKE_REGISTRY_ERROR__VOTING_MINT_CONFIG_INDEX_ALREADY_IN_USE
    VOTER_STAKE_REGISTRY_ERROR__VOTING_MINT_CONFIGURED_WITH_DIFFERENT_INDEX
    VOTER_STAKE_REGISTRY_ERROR__VOTING_MINT_NOT_FOUND
    VOTER_STAKE_REGISTRY_ERROR__VOTING_TOKEN_NON_ZERO
    VOTER_STAKE_REGISTRY_PROGRAM_ADDRESS
    VOTER_WEIGHT_RECORD_DISCRIMINATOR
    WITHDRAW_DISCRIMINATOR

    Functions

    decodeRegistrar
    decodeVoter
    decodeVoterWeightRecord
    fetchAllMaybeRegistrar
    fetchAllMaybeVoter
    fetchAllMaybeVoterWeightRecord
    fetchAllRegistrar
    fetchAllVoter
    fetchAllVoterWeightRecord
    fetchMaybeRegistrar
    fetchMaybeRegistrarFromSeeds
    fetchMaybeVoter
    fetchMaybeVoterFromSeeds
    fetchMaybeVoterWeightRecord
    fetchMaybeVoterWeightRecordFromSeeds
    fetchRegistrar
    fetchRegistrarFromSeeds
    fetchVoter
    fetchVoterFromSeeds
    fetchVoterWeightRecord
    fetchVoterWeightRecordFromSeeds
    findRegistrarPda
    findVoterPda
    findVoterWeightRecordPda
    getClawbackDiscriminatorBytes
    getClawbackInstruction
    getClawbackInstructionDataCodec
    getClawbackInstructionDataDecoder
    getClawbackInstructionDataEncoder
    getCloseDepositEntryDiscriminatorBytes
    getCloseDepositEntryInstruction
    getCloseDepositEntryInstructionDataCodec
    getCloseDepositEntryInstructionDataDecoder
    getCloseDepositEntryInstructionDataEncoder
    getCloseVoterDiscriminatorBytes
    getCloseVoterInstruction
    getCloseVoterInstructionDataCodec
    getCloseVoterInstructionDataDecoder
    getCloseVoterInstructionDataEncoder
    getConfigureVotingMintDiscriminatorBytes
    getConfigureVotingMintInstruction
    getConfigureVotingMintInstructionDataCodec
    getConfigureVotingMintInstructionDataDecoder
    getConfigureVotingMintInstructionDataEncoder
    getCreateDepositEntryDiscriminatorBytes
    getCreateDepositEntryInstruction
    getCreateDepositEntryInstructionDataCodec
    getCreateDepositEntryInstructionDataDecoder
    getCreateDepositEntryInstructionDataEncoder
    getCreateRegistrarDiscriminatorBytes
    getCreateRegistrarInstruction
    getCreateRegistrarInstructionDataCodec
    getCreateRegistrarInstructionDataDecoder
    getCreateRegistrarInstructionDataEncoder
    getCreateVoterDiscriminatorBytes
    getCreateVoterInstruction
    getCreateVoterInstructionAsync
    getCreateVoterInstructionDataCodec
    getCreateVoterInstructionDataDecoder
    getCreateVoterInstructionDataEncoder
    getDepositDiscriminatorBytes
    getDepositEntryCodec
    getDepositEntryDecoder
    getDepositEntryEncoder
    getDepositEntryInfoCodec
    getDepositEntryInfoDecoder
    getDepositEntryInfoEncoder
    getDepositInstruction
    getDepositInstructionDataCodec
    getDepositInstructionDataDecoder
    getDepositInstructionDataEncoder
    getGrantDiscriminatorBytes
    getGrantInstruction
    getGrantInstructionDataCodec
    getGrantInstructionDataDecoder
    getGrantInstructionDataEncoder
    getInternalTransferLockedDiscriminatorBytes
    getInternalTransferLockedInstruction
    getInternalTransferLockedInstructionDataCodec
    getInternalTransferLockedInstructionDataDecoder
    getInternalTransferLockedInstructionDataEncoder
    getInternalTransferUnlockedDiscriminatorBytes
    getInternalTransferUnlockedInstruction
    getInternalTransferUnlockedInstructionDataCodec
    getInternalTransferUnlockedInstructionDataDecoder
    getInternalTransferUnlockedInstructionDataEncoder
    getLockingInfoCodec
    getLockingInfoDecoder
    getLockingInfoEncoder
    getLockupCodec
    getLockupDecoder
    getLockupEncoder
    getLockupKindCodec
    getLockupKindDecoder
    getLockupKindEncoder
    getLogVoterInfoDiscriminatorBytes
    getLogVoterInfoInstruction
    getLogVoterInfoInstructionDataCodec
    getLogVoterInfoInstructionDataDecoder
    getLogVoterInfoInstructionDataEncoder
    getRegistrarCodec
    getRegistrarDecoder
    getRegistrarDiscriminatorBytes
    getRegistrarEncoder
    getResetLockupDiscriminatorBytes
    getResetLockupInstruction
    getResetLockupInstructionDataCodec
    getResetLockupInstructionDataDecoder
    getResetLockupInstructionDataEncoder
    getSetTimeOffsetDiscriminatorBytes
    getSetTimeOffsetInstruction
    getSetTimeOffsetInstructionDataCodec
    getSetTimeOffsetInstructionDataDecoder
    getSetTimeOffsetInstructionDataEncoder
    getUpdateMaxVoteWeightDiscriminatorBytes
    getUpdateMaxVoteWeightInstruction
    getUpdateMaxVoteWeightInstructionDataCodec
    getUpdateMaxVoteWeightInstructionDataDecoder
    getUpdateMaxVoteWeightInstructionDataEncoder
    getUpdateVoterWeightRecordDiscriminatorBytes
    getUpdateVoterWeightRecordInstruction
    getUpdateVoterWeightRecordInstructionDataCodec
    getUpdateVoterWeightRecordInstructionDataDecoder
    getUpdateVoterWeightRecordInstructionDataEncoder
    getVestingInfoCodec
    getVestingInfoDecoder
    getVestingInfoEncoder
    getVoterCodec
    getVoterDecoder
    getVoterDiscriminatorBytes
    getVoterEncoder
    getVoterInfoCodec
    getVoterInfoDecoder
    getVoterInfoEncoder
    getVoterStakeRegistryErrorMessage
    getVoterWeightRecordCodec
    getVoterWeightRecordDecoder
    getVoterWeightRecordDiscriminatorBytes
    getVoterWeightRecordEncoder
    getVotingMintConfigCodec
    getVotingMintConfigDecoder
    getVotingMintConfigEncoder
    getWithdrawDiscriminatorBytes
    getWithdrawInstruction
    getWithdrawInstructionDataCodec
    getWithdrawInstructionDataDecoder
    getWithdrawInstructionDataEncoder
    identifyVoterStakeRegistryAccount
    identifyVoterStakeRegistryInstruction
    isVoterStakeRegistryError
    parseClawbackInstruction
    parseCloseDepositEntryInstruction
    parseCloseVoterInstruction
    parseConfigureVotingMintInstruction
    parseCreateDepositEntryInstruction
    parseCreateRegistrarInstruction
    parseCreateVoterInstruction
    parseDepositInstruction
    parseGrantInstruction
    parseInternalTransferLockedInstruction
    parseInternalTransferUnlockedInstruction
    parseLogVoterInfoInstruction
    parseResetLockupInstruction
    parseSetTimeOffsetInstruction
    parseUpdateMaxVoteWeightInstruction
    parseUpdateVoterWeightRecordInstruction
    parseWithdrawInstruction