Coda by Ian Macalinao
    Preparing search index...

    Module @macalinao/clients-tribeca

    @macalinao/clients-tribeca

    npm version

    TypeScript client for Tribeca governance programs (Govern and Locked Voter), generated using Coda CLI with full ESM support.

    bun add @macalinao/clients-tribeca
    

    Tribeca is a governance protocol on Solana that provides decentralized autonomous organization (DAO) functionality through two main programs:

    • Govern: Core governance program for creating governors, proposals, and voting
    • Locked Voter: Vote escrow system for token-weighted governance with time-locked voting power
    • Governor: Manages proposals and voting parameters
    • Proposal: Individual governance proposals with metadata
    • Vote: Records individual voter decisions on proposals
    • ProposalMeta: Additional metadata for proposals
    • Locker: Manages vote escrows for a governance token
    • Escrow: Individual user's locked tokens and voting power
    • Whitelist: Programs authorized to interact with the locker

    This client is generated from the Tribeca IDLs using Coda CLI:

    # Generate the client from idls/
    bun run codegen

    # Build the TypeScript
    bun run build

    The coda.config.mjs file includes custom PDAs for both programs and links accounts to their corresponding PDA helpers.

    import {
    getCastVoteInstruction,
    fetchGovernor,
    fetchProposal,
    getCreateEscrowInstruction,
    fetchLocker,
    } from "@macalinao/clients-tribeca";

    // Governance example
    const governor = await fetchGovernor(rpc, governorAddress);
    const proposal = await fetchProposal(rpc, proposalAddress);

    const voteInstruction = getCastVoteInstruction({
    governor: governorAddress,
    proposal: proposalAddress,
    vote: voteAddress, // PDA automatically calculated
    voter: voterPublicKey,
    // ... other parameters
    });

    // Locked voter example
    const locker = await fetchLocker(rpc, lockerAddress);

    const escrowInstruction = getCreateEscrowInstruction({
    locker: lockerAddress,
    escrow: escrowAddress, // PDA automatically calculated
    authority: authorityPublicKey,
    // ... other parameters
    });

    Copyright © 2025 Ian Macalinao

    Licensed under the Apache License, Version 2.0

    Enumerations

    GovernAccount
    GovernInstruction
    LockedVoterAccount
    LockedVoterInstruction
    ProposalState
    VoteSide

    Interfaces

    ActivateProposalInput
    ActivateProposalInstructionData
    ActivateProposalInstructionDataArgs
    ApproveProgramLockPrivilegeInput
    ApproveProgramLockPrivilegeInstructionData
    ApproveProgramLockPrivilegeInstructionDataArgs
    CancelProposalInput
    CancelProposalInstructionData
    CancelProposalInstructionDataArgs
    CastVoteInput
    CastVoteInstructionData
    CastVoteInstructionDataArgs
    CreateGovernorInput
    CreateGovernorInstructionData
    CreateGovernorInstructionDataArgs
    CreateProposalInput
    CreateProposalInstructionData
    CreateProposalInstructionDataArgs
    CreateProposalMetaInput
    CreateProposalMetaInstructionData
    CreateProposalMetaInstructionDataArgs
    Escrow
    EscrowArgs
    EscrowSeeds
    ExitInput
    ExitInstructionData
    ExitInstructionDataArgs
    GovernanceParameters
    GovernanceParametersArgs
    Governor
    GovernorArgs
    GovernorSeeds
    Locker
    LockerArgs
    LockerParams
    LockerParamsArgs
    LockerSeeds
    LockerWhitelistEntry
    LockerWhitelistEntryArgs
    LockInput
    LockInstructionData
    LockInstructionDataArgs
    LockPermissionlessInput
    LockPermissionlessInstructionData
    LockPermissionlessInstructionDataArgs
    LockWithWhitelistEntryInput
    LockWithWhitelistEntryInstructionData
    LockWithWhitelistEntryInstructionDataArgs
    LockWithWhitelistInput
    LockWithWhitelistInstructionData
    LockWithWhitelistInstructionDataArgs
    NewEscrowInput
    NewEscrowInstructionData
    NewEscrowInstructionDataArgs
    NewLockerInput
    NewLockerInstructionData
    NewLockerInstructionDataArgs
    NewVoteInput
    NewVoteInstructionData
    NewVoteInstructionDataArgs
    ParsedActivateProposalInstruction
    ParsedApproveProgramLockPrivilegeInstruction
    ParsedCancelProposalInstruction
    ParsedCastVoteInstruction
    ParsedCreateGovernorInstruction
    ParsedCreateProposalInstruction
    ParsedCreateProposalMetaInstruction
    ParsedExitInstruction
    ParsedLockInstruction
    ParsedLockPermissionlessInstruction
    ParsedLockWithWhitelistEntryInstruction
    ParsedLockWithWhitelistInstruction
    ParsedNewEscrowInstruction
    ParsedNewLockerInstruction
    ParsedNewVoteInstruction
    ParsedQueueProposalInstruction
    ParsedRevokeProgramLockPrivilegeInstruction
    ParsedSetElectorateInstruction
    ParsedSetGovernanceParamsInstruction
    ParsedSetLockerParamsInstruction
    ParsedSetVoteDelegateInstruction
    ParsedSetVoteInstruction
    Proposal
    ProposalAccountMeta
    ProposalArgs
    ProposalInstruction
    ProposalInstructionArgs
    ProposalMeta
    ProposalMetaArgs
    ProposalMetaSeeds
    ProposalSeeds
    QueueProposalInput
    QueueProposalInstructionData
    QueueProposalInstructionDataArgs
    RevokeProgramLockPrivilegeInput
    RevokeProgramLockPrivilegeInstructionData
    RevokeProgramLockPrivilegeInstructionDataArgs
    SetElectorateInput
    SetElectorateInstructionData
    SetElectorateInstructionDataArgs
    SetGovernanceParamsInput
    SetGovernanceParamsInstructionData
    SetGovernanceParamsInstructionDataArgs
    SetLockerParamsInput
    SetLockerParamsInstructionData
    SetLockerParamsInstructionDataArgs
    SetVoteDelegateInput
    SetVoteDelegateInstructionData
    SetVoteDelegateInstructionDataArgs
    SetVoteInput
    SetVoteInstructionData
    SetVoteInstructionDataArgs
    Vote
    VoteArgs
    VoteSeeds
    WhitelistSeeds

    Type Aliases

    ActivateProposalInstruction
    ApproveProgramLockPrivilegeInstruction
    CancelProposalInstruction
    CastVoteInstruction
    CreateGovernorInstruction
    CreateProposalInstruction
    CreateProposalMetaInstruction
    ExitInstruction
    GovernError
    LockedVoterError
    LockInstruction
    LockPermissionlessInstruction
    LockWithWhitelistEntryInstruction
    LockWithWhitelistInstruction
    NewEscrowInstruction
    NewLockerInstruction
    NewVoteInstruction
    ParsedGovernInstruction
    ParsedLockedVoterInstruction
    ProposalAccountMetaArgs
    ProposalStateArgs
    QueueProposalInstruction
    RevokeProgramLockPrivilegeInstruction
    SetElectorateInstruction
    SetGovernanceParamsInstruction
    SetLockerParamsInstruction
    SetVoteDelegateInstruction
    SetVoteInstruction
    VoteSideArgs

    Variables

    ACTIVATE_PROPOSAL_DISCRIMINATOR
    APPROVE_PROGRAM_LOCK_PRIVILEGE_DISCRIMINATOR
    CANCEL_PROPOSAL_DISCRIMINATOR
    CAST_VOTE_DISCRIMINATOR
    CREATE_GOVERNOR_DISCRIMINATOR
    CREATE_PROPOSAL_DISCRIMINATOR
    CREATE_PROPOSAL_META_DISCRIMINATOR
    ESCROW_DISCRIMINATOR
    EXIT_DISCRIMINATOR
    GOVERN_ERROR__GOVERNOR_NOT_FOUND
    GOVERN_ERROR__INVALID_VOTE_SIDE
    GOVERN_ERROR__PROPOSAL_NOT_ACTIVE
    GOVERN_ERROR__PROPOSAL_NOT_DRAFT
    GOVERN_ERROR__VOTING_DELAY_NOT_MET
    GOVERN_PROGRAM_ADDRESS
    GOVERNOR_DISCRIMINATOR
    LOCK_DISCRIMINATOR
    LOCK_PERMISSIONLESS_DISCRIMINATOR
    LOCK_WITH_WHITELIST_DISCRIMINATOR
    LOCK_WITH_WHITELIST_ENTRY_DISCRIMINATOR
    LOCKED_VOTER_ERROR__ESCROW_NOT_ENDED
    LOCKED_VOTER_ERROR__ESCROW_OWNER_NOT_WHITELISTED
    LOCKED_VOTER_ERROR__LOCKUP_DURATION_TOO_LONG
    LOCKED_VOTER_ERROR__LOCKUP_DURATION_TOO_SHORT
    LOCKED_VOTER_ERROR__MUST_CALL_LOCK_PERMISSIONLESS
    LOCKED_VOTER_ERROR__MUST_CALL_LOCK_WITH_WHITELIST_ENTRY
    LOCKED_VOTER_ERROR__MUST_PROVIDE_WHITELIST
    LOCKED_VOTER_ERROR__PROGRAM_NOT_WHITELISTED
    LOCKED_VOTER_ERROR__REFRESH_CANNOT_SHORTEN
    LOCKED_VOTER_PROGRAM_ADDRESS
    LOCKER_DISCRIMINATOR
    LOCKER_WHITELIST_ENTRY_DISCRIMINATOR
    NEW_ESCROW_DISCRIMINATOR
    NEW_LOCKER_DISCRIMINATOR
    NEW_VOTE_DISCRIMINATOR
    PROPOSAL_DISCRIMINATOR
    PROPOSAL_META_DISCRIMINATOR
    QUEUE_PROPOSAL_DISCRIMINATOR
    REVOKE_PROGRAM_LOCK_PRIVILEGE_DISCRIMINATOR
    SET_ELECTORATE_DISCRIMINATOR
    SET_GOVERNANCE_PARAMS_DISCRIMINATOR
    SET_LOCKER_PARAMS_DISCRIMINATOR
    SET_VOTE_DELEGATE_DISCRIMINATOR
    SET_VOTE_DISCRIMINATOR
    VOTE_DISCRIMINATOR

    Functions

    decodeEscrow
    decodeGovernor
    decodeLocker
    decodeLockerWhitelistEntry
    decodeProposal
    decodeProposalMeta
    decodeVote
    fetchAllEscrow
    fetchAllGovernor
    fetchAllLocker
    fetchAllLockerWhitelistEntry
    fetchAllMaybeEscrow
    fetchAllMaybeGovernor
    fetchAllMaybeLocker
    fetchAllMaybeLockerWhitelistEntry
    fetchAllMaybeProposal
    fetchAllMaybeProposalMeta
    fetchAllMaybeVote
    fetchAllProposal
    fetchAllProposalMeta
    fetchAllVote
    fetchEscrow
    fetchEscrowFromSeeds
    fetchGovernor
    fetchGovernorFromSeeds
    fetchLocker
    fetchLockerFromSeeds
    fetchLockerWhitelistEntry
    fetchLockerWhitelistEntryFromSeeds
    fetchMaybeEscrow
    fetchMaybeEscrowFromSeeds
    fetchMaybeGovernor
    fetchMaybeGovernorFromSeeds
    fetchMaybeLocker
    fetchMaybeLockerFromSeeds
    fetchMaybeLockerWhitelistEntry
    fetchMaybeLockerWhitelistEntryFromSeeds
    fetchMaybeProposal
    fetchMaybeProposalFromSeeds
    fetchMaybeProposalMeta
    fetchMaybeProposalMetaFromSeeds
    fetchMaybeVote
    fetchMaybeVoteFromSeeds
    fetchProposal
    fetchProposalFromSeeds
    fetchProposalMeta
    fetchProposalMetaFromSeeds
    fetchVote
    fetchVoteFromSeeds
    findEscrowPda
    findGovernorPda
    findLockerPda
    findProposalMetaPda
    findProposalPda
    findVotePda
    findWhitelistPda
    getActivateProposalDiscriminatorBytes
    getActivateProposalInstruction
    getActivateProposalInstructionDataCodec
    getActivateProposalInstructionDataDecoder
    getActivateProposalInstructionDataEncoder
    getApproveProgramLockPrivilegeDiscriminatorBytes
    getApproveProgramLockPrivilegeInstruction
    getApproveProgramLockPrivilegeInstructionDataCodec
    getApproveProgramLockPrivilegeInstructionDataDecoder
    getApproveProgramLockPrivilegeInstructionDataEncoder
    getCancelProposalDiscriminatorBytes
    getCancelProposalInstruction
    getCancelProposalInstructionDataCodec
    getCancelProposalInstructionDataDecoder
    getCancelProposalInstructionDataEncoder
    getCastVoteDiscriminatorBytes
    getCastVoteInstruction
    getCastVoteInstructionDataCodec
    getCastVoteInstructionDataDecoder
    getCastVoteInstructionDataEncoder
    getCreateGovernorDiscriminatorBytes
    getCreateGovernorInstruction
    getCreateGovernorInstructionDataCodec
    getCreateGovernorInstructionDataDecoder
    getCreateGovernorInstructionDataEncoder
    getCreateProposalDiscriminatorBytes
    getCreateProposalInstruction
    getCreateProposalInstructionDataCodec
    getCreateProposalInstructionDataDecoder
    getCreateProposalInstructionDataEncoder
    getCreateProposalMetaDiscriminatorBytes
    getCreateProposalMetaInstruction
    getCreateProposalMetaInstructionDataCodec
    getCreateProposalMetaInstructionDataDecoder
    getCreateProposalMetaInstructionDataEncoder
    getEscrowCodec
    getEscrowDecoder
    getEscrowDiscriminatorBytes
    getEscrowEncoder
    getExitDiscriminatorBytes
    getExitInstruction
    getExitInstructionDataCodec
    getExitInstructionDataDecoder
    getExitInstructionDataEncoder
    getGovernanceParametersCodec
    getGovernanceParametersDecoder
    getGovernanceParametersEncoder
    getGovernErrorMessage
    getGovernorCodec
    getGovernorDecoder
    getGovernorDiscriminatorBytes
    getGovernorEncoder
    getLockDiscriminatorBytes
    getLockedVoterErrorMessage
    getLockerCodec
    getLockerDecoder
    getLockerDiscriminatorBytes
    getLockerEncoder
    getLockerParamsCodec
    getLockerParamsDecoder
    getLockerParamsEncoder
    getLockerWhitelistEntryCodec
    getLockerWhitelistEntryDecoder
    getLockerWhitelistEntryDiscriminatorBytes
    getLockerWhitelistEntryEncoder
    getLockInstruction
    getLockInstructionDataCodec
    getLockInstructionDataDecoder
    getLockInstructionDataEncoder
    getLockPermissionlessDiscriminatorBytes
    getLockPermissionlessInstruction
    getLockPermissionlessInstructionDataCodec
    getLockPermissionlessInstructionDataDecoder
    getLockPermissionlessInstructionDataEncoder
    getLockWithWhitelistDiscriminatorBytes
    getLockWithWhitelistEntryDiscriminatorBytes
    getLockWithWhitelistEntryInstruction
    getLockWithWhitelistEntryInstructionDataCodec
    getLockWithWhitelistEntryInstructionDataDecoder
    getLockWithWhitelistEntryInstructionDataEncoder
    getLockWithWhitelistInstruction
    getLockWithWhitelistInstructionDataCodec
    getLockWithWhitelistInstructionDataDecoder
    getLockWithWhitelistInstructionDataEncoder
    getNewEscrowDiscriminatorBytes
    getNewEscrowInstruction
    getNewEscrowInstructionDataCodec
    getNewEscrowInstructionDataDecoder
    getNewEscrowInstructionDataEncoder
    getNewLockerDiscriminatorBytes
    getNewLockerInstruction
    getNewLockerInstructionDataCodec
    getNewLockerInstructionDataDecoder
    getNewLockerInstructionDataEncoder
    getNewVoteDiscriminatorBytes
    getNewVoteInstruction
    getNewVoteInstructionDataCodec
    getNewVoteInstructionDataDecoder
    getNewVoteInstructionDataEncoder
    getProposalAccountMetaCodec
    getProposalAccountMetaDecoder
    getProposalAccountMetaEncoder
    getProposalCodec
    getProposalDecoder
    getProposalDiscriminatorBytes
    getProposalEncoder
    getProposalInstructionCodec
    getProposalInstructionDecoder
    getProposalInstructionEncoder
    getProposalMetaCodec
    getProposalMetaDecoder
    getProposalMetaDiscriminatorBytes
    getProposalMetaEncoder
    getProposalStateCodec
    getProposalStateDecoder
    getProposalStateEncoder
    getQueueProposalDiscriminatorBytes
    getQueueProposalInstruction
    getQueueProposalInstructionDataCodec
    getQueueProposalInstructionDataDecoder
    getQueueProposalInstructionDataEncoder
    getRevokeProgramLockPrivilegeDiscriminatorBytes
    getRevokeProgramLockPrivilegeInstruction
    getRevokeProgramLockPrivilegeInstructionDataCodec
    getRevokeProgramLockPrivilegeInstructionDataDecoder
    getRevokeProgramLockPrivilegeInstructionDataEncoder
    getSetElectorateDiscriminatorBytes
    getSetElectorateInstruction
    getSetElectorateInstructionDataCodec
    getSetElectorateInstructionDataDecoder
    getSetElectorateInstructionDataEncoder
    getSetGovernanceParamsDiscriminatorBytes
    getSetGovernanceParamsInstruction
    getSetGovernanceParamsInstructionDataCodec
    getSetGovernanceParamsInstructionDataDecoder
    getSetGovernanceParamsInstructionDataEncoder
    getSetLockerParamsDiscriminatorBytes
    getSetLockerParamsInstruction
    getSetLockerParamsInstructionDataCodec
    getSetLockerParamsInstructionDataDecoder
    getSetLockerParamsInstructionDataEncoder
    getSetVoteDelegateDiscriminatorBytes
    getSetVoteDelegateInstruction
    getSetVoteDelegateInstructionDataCodec
    getSetVoteDelegateInstructionDataDecoder
    getSetVoteDelegateInstructionDataEncoder
    getSetVoteDiscriminatorBytes
    getSetVoteInstruction
    getSetVoteInstructionDataCodec
    getSetVoteInstructionDataDecoder
    getSetVoteInstructionDataEncoder
    getVoteCodec
    getVoteDecoder
    getVoteDiscriminatorBytes
    getVoteEncoder
    getVoteSideCodec
    getVoteSideDecoder
    getVoteSideEncoder
    identifyGovernAccount
    identifyGovernInstruction
    identifyLockedVoterAccount
    identifyLockedVoterInstruction
    isGovernError
    isLockedVoterError
    parseActivateProposalInstruction
    parseApproveProgramLockPrivilegeInstruction
    parseCancelProposalInstruction
    parseCastVoteInstruction
    parseCreateGovernorInstruction
    parseCreateProposalInstruction
    parseCreateProposalMetaInstruction
    parseExitInstruction
    parseLockInstruction
    parseLockPermissionlessInstruction
    parseLockWithWhitelistEntryInstruction
    parseLockWithWhitelistInstruction
    parseNewEscrowInstruction
    parseNewLockerInstruction
    parseNewVoteInstruction
    parseQueueProposalInstruction
    parseRevokeProgramLockPrivilegeInstruction
    parseSetElectorateInstruction
    parseSetGovernanceParamsInstruction
    parseSetLockerParamsInstruction
    parseSetVoteDelegateInstruction
    parseSetVoteInstruction