UNPKG

@terminusbet/stake-vote-sdk

Version:

A simple SDK for interacting with terminusbet governance

32 lines 1.22 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.VoteRewardState = void 0; const borsh_1 = require("@coral-xyz/borsh"); const web3_js_1 = require("@solana/web3.js"); class VoteRewardState { discriminator; ballotBot; rewardMint; amount; isStart; constructor(discriminator, ballotBot, rewardMint, amount, isStart) { this.discriminator = discriminator; this.ballotBot = ballotBot; this.rewardMint = rewardMint; this.amount = amount; this.isStart = isStart; } static fromBuffer(buffer) { const structure = (0, borsh_1.struct)([ (0, borsh_1.u64)("discriminator"), (0, borsh_1.publicKey)("ballotBot"), (0, borsh_1.publicKey)("rewardMint"), (0, borsh_1.u64)("amount"), (0, borsh_1.bool)("isStart"), ]); let value = structure.decode(buffer); return new VoteRewardState(BigInt(value.discriminator), new web3_js_1.PublicKey(value.ballotBot), new web3_js_1.PublicKey(value.rewardMint), BigInt(value.amount), Boolean(value.isStart)); } } exports.VoteRewardState = VoteRewardState; //# sourceMappingURL=voteRewardState.js.map