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:
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