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