@macalinao/clients-voter-stake-registry
v0.3.2
Published
TypeScript client for the SPL Governance Voter Stake Registry program
Maintainers
Readme
@macalinao/clients-voter-stake-registry
TypeScript client for the Realms Voter Stake Registry program by Grape, generated using Coda with full ESM support.
Installation
bun add @macalinao/clients-voter-stake-registryDevelopment
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 buildConfiguration
The coda.config.ts 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
Usage
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,
});License
Copyright © 2025 Ian Macalinao
Licensed under the Apache License, Version 2.0
