npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@terminusbet/stake-vote-auth-sdk

v1.2.5

Published

For interacting with stake and vote admin on Solana.

Downloads

71

Readme

StakeVoteAuthSDK README

Installation

npm i @terminusbet/stake-vote-auth-sdk

StakeVoteAuthSDK transaction

Get StakeVoteAuthSDK transaction-related methods.

getStakeInitTransactions

async getStakeInitTransactions(
    platformMint: PublicKey,
    voucherMint?: Keypair
):  Promise<{
    transaction: Transaction;
    signers: Keypair; // `statePool`: A Keypair to create a voucherMint. This keypair needs to be used as a signer to sign the transaction.
}>
  • Set stake mint
  • Parameters:
    • platformMint: The publick key of the mint for staking.
  • Returns: A promise that resolves to a Transaction .

getStakeInitTransactions

async getStakeSetPlatformMintTransactions(platformMint: PublicKey): Promise<Transaction>
  • Stake to get voting rights
  • Parameters:
    • voucherMint: The Keypair of the mint for staking.
  • Returns: A promise that resolves to a Transaction and signers.

getCreateStakeTransactions

async getCreateStakeTransactions(
    stakePeriod: BN,
    rewardGrowBy: BN,
    rewardGrowMinBy: BN,
    statePool?: Keypair,  // Signature statePool
): Promise<{
    transaction: Transaction;
    signers: Keypair; // `statePool`: A Keypair to create a state pool. This keypair needs to be used as a signer to sign the transaction.
}>
  • Increase the stake to get more voting rights
  • Parameters:
    • stakePeriod: The stake period of the mint for staking.
    • rewardGrowBy: The ratio of pledged voting rights, with precision.
    • rewardGrowMinBy: When the staking time is increased, the voting rights acquisition ratio is reduced to the minimum value according to the remaining time. For example, the value should be this in the last second.
    • statePool: The public key for staking.
  • Returns: A promise that resolves to a Transaction and signers.

getCreateBallotBoxTransactions

async getCreateBallotBoxTransactions(
    xid: BN,
    timeStartAt: BN | null,
    timeEndAt: BN,
    uri: string,
    ballotBoxState?: Keypair // Signature ballotBoxState
): Promise<{
    transaction: Transaction;
    signers: Keypair; // `ballotBoxKeyPair`: A Keypair to create a ballot box. This keypair needs to be used as a signer to sign the transaction.
}>
  • Create a ballot box
  • Parameters:
    • xid: The id of ballot box.
    • timeStartAt: The start time for create ballot box.
    • timeEndAt: The end time for create ballot box.
    • uri: The ipfs uri of proposal.
    • ballotBoxState: The Keypair of ballot box.
  • Returns: A promise that resolves to a Transaction and signers.

getBatchCreateBallotBoxTransactions

async getBatchCreateBallotBoxTransactions(
    xid: BN,
    timeStartAt: BN | null,
    timeEndAt: BN,
    uris: string[]
): Promise<{
    transaction: Transaction;
    signers: Keypair[]; // `ballotBoxKeyPair`: A Keypair to create a ballot box. This keypair needs to be used as a signer to sign the transaction.
}>
  • Create ballot boxes in batches
  • Parameters:
    • rewardUseBallotBox: The rewards of ballot box.
    • timeStartAt: The start time for create ballot box.
    • timeEndAt: The end time for create ballot box.
    • uris: The ipfs uri array of proposal.
  • Returns: A promise that resolves to a Transaction and signers.

getCreateRewardPoolTransactions

async getCreateRewardPoolTransactions(
    mint: PublicKey, // Reward mint
    rewardUseBallotBox: PublicKey
): Promise<Transaction>
  • Create a reward pool
  • Parameters:
    • mint: The public key of mint.
    • rewardUseBallotBox: The keypair of ballot box.
  • Returns: A promise that resolves to a Transaction and signers.

getRewardDepositTransactions

async getRewardDepositTransactions(
    user: PublicKey,
    rewardUseBallotBox: PublicKey,
    amount: BN
): Promise<{
    transaction: Transaction;
    signers: Keypair[]; // `ballotBoxKeyPair`: A Keypair to create a ballot box. This keypair needs to be used as a signer to sign the transaction.
}>
  • Deposit rewards into the reward pool
  • Parameters:
    • user: The public key of ballot box.
    • rewardUseBallotBox: The keypair of ballot box.
    • amount: Amount of SOL to be deposited.
  • Returns: A promise that resolves to a Transaction.

getStartRewardTransactions

async getStartRewardTransactions(
    rewardUseBallotBox: PublicKey
): Promise<Transaction>
  • Start receiving rewards
  • Parameters:
    • rewardUseBallotBox: The keypair of ballot box.
  • Returns: A promise that resolves to a Transaction.

StakeVoteAuthSDK Class

The StakeVoteAuthSDK class provides methods for interacting with the Bet protocol. Below are the method signatures and descriptions.

stakeInit

async stakeInit(
  admin: Keypair,
  voucherMint?: Keypair,
  priorityFees?: PriorityFee,
  commitment: Commitment = DEFAULT_COMMITMENT,
  finality: Finality = DEFAULT_FINALITY
): Promise<TransactionResult>
  • Parameters:
    • admin: The Keypair of the admin.
    • voucherMint: The public key of the mint for staking.
    • priorityFees: Priority fees (optional).
    • commitment: Commitment level (default: DEFAULT_COMMITMENT).
    • finality: Finality level (default: DEFAULT_FINALITY).
  • Returns: A promise that resolves to a TransactionResult.

createStake

async createStake(
  stakeOperator: Keypair,
  stakePeriod: BN,
  rewardGrowBy: BN,
  rewardGrowMinBy: BN,
  statePoolPair?: Keypair,
  priorityFees?: PriorityFee,
  commitment: Commitment = DEFAULT_COMMITMENT,
  finality: Finality = DEFAULT_FINALITY
): Promise<TransactionResult>
  • Parameters:
    • stakeOperator: The Keypair of the stake operator.
    • stakePeriod: The stake period of the mint for staking.
    • rewardGrowBy: The ratio of pledged voting rights, with precision.
    • rewardGrowMinBy: When the staking time is increased, the voting rights acquisition ratio is reduced to the minimum value according to the remaining time. For example, the value should be this in the last second.
    • statePoolPair: Stake pool state.
    • priorityFees: Priority fees (optional).
    • commitment: Commitment level (default: DEFAULT_COMMITMENT).
    • finality: Finality level (default: DEFAULT_FINALITY).
  • Returns: A promise that resolves to a TransactionResult.

createBallotBox

async createBallotBox(
  stakeOperator: Keypair,
  xid: BN,
  timeStartAt: BN | null,
  timeEndAt: BN,
  uri: string,
  ballotBoxStatePair?: Keypair,
  priorityFees?: PriorityFee,
  commitment: Commitment = DEFAULT_COMMITMENT,
  finality: Finality = DEFAULT_FINALITY
): Promise<TransactionResult>
  • Parameters:
    • stakeOperator: The Keypair of the stake operator.
    • xid: The id of ballot box.
    • timeStartAt: The start time for create ballot box.
    • timeEndAt: The end time for create ballot box.
    • uri: The ipfs uri of proposal.
    • ballotBoxStatePair: The Keypair of ballot box.
    • priorityFees: Priority fees (optional).
    • commitment: Commitment level (default: DEFAULT_COMMITMENT).
    • finality: Finality level (default: DEFAULT_FINALITY).
  • Returns: A promise that resolves to a TransactionResult.

batchCreateBallotBox

async batchCreateBallotBox(
  stakeOperator: Keypair,
  xid: BN,
  timeStartAt: BN | null,
  timeEndAt: BN,
  uris: string[],
  priorityFees?: PriorityFee,
  commitment: Commitment = DEFAULT_COMMITMENT,
  finality: Finality = DEFAULT_FINALITY
): Promise<TransactionResult>
  • Parameters:
    • stakeOperator: The Keypair of the user.
    • xid: The id of ballot box.
    • timeStartAt: The start time for create ballot box.
    • timeEndAt: The end time for create ballot box.
    • uris: The ipfs uris of proposal.
    • priorityFees: Priority fees (optional).
    • commitment: Commitment level (default: DEFAULT_COMMITMENT).
    • finality: Finality level (default: DEFAULT_FINALITY).
  • Returns: A promise that resolves to a TransactionResult.

createRewardPool

async createRewardPool(
  stakeOperator: Keypair,
  mint: PublicKey,
  rewardUseBallotBox: PublicKey,
  priorityFees?: PriorityFee,
  commitment: Commitment = DEFAULT_COMMITMENT,
  finality: Finality = DEFAULT_FINALITY
): Promise<TransactionResult>
  • Parameters:
    • stakeOperator: The Keypair of the user.
    • mint: The public key of the mint.
    • rewardUseBallotBox: The ballot box.
    • priorityFees: Priority fees (optional).
    • commitment: Commitment level (default: DEFAULT_COMMITMENT).
    • finality: Finality level (default: DEFAULT_FINALITY).
  • Returns: A promise that resolves to a TransactionResult.

rewardDeposit

async rewardDeposit(
  user: Keypair,
  rewardUseBallotBox: PublicKey,
  amount: BN,
  priorityFees?: PriorityFee,
  commitment: Commitment = DEFAULT_COMMITMENT,
  finality: Finality = DEFAULT_FINALITY
): Promise<TransactionResult> 
  • Parameters:
    • user: The Keypair of the user.
    • rewardUseBallotBox: The ballot box.
    • amount: Amount of SOL to be deposited.
    • priorityFees: Priority fees (optional).
    • commitment: Commitment level (default: DEFAULT_COMMITMENT).
    • finality: Finality level (default: DEFAULT_FINALITY).
  • Returns: A promise that resolves to a TransactionResult.

startReward

async startReward(
  stakeOperator: Keypair,
  rewardUseBallotBox: PublicKey,
  priorityFees?: PriorityFee,
  commitment: Commitment = DEFAULT_COMMITMENT,
  finality: Finality = DEFAULT_FINALITY
): Promise<TransactionResult> 
  • Parameters:
    • stakeOperator: The Keypair of the operator.
    • rewardUseBallotBox: The ballot box.
    • priorityFees: Priority fees (optional).
    • commitment: Commitment level (default: DEFAULT_COMMITMENT).
    • finality: Finality level (default: DEFAULT_FINALITY).
  • Returns: A promise that resolves to a TransactionResult.