@terminusbet/stake-vote-sdk
Version:
A simple SDK for interacting with terminusbet governance
30 lines • 985 B
JavaScript
import { struct, u64, str, bool } from "@coral-xyz/borsh";
export class BallotBotState {
discriminator;
startAt;
endAt;
totaVote;
isCompleted;
uri;
constructor(discriminator, startAt, endAt, totaVote, isCompleted, uri) {
this.discriminator = discriminator;
this.startAt = startAt;
this.endAt = endAt;
this.totaVote = totaVote;
this.isCompleted = isCompleted;
this.uri = uri;
}
static fromBuffer(buffer) {
const structure = struct([
u64("discriminator"),
u64("startAt"),
u64("endAt"),
u64("totaVote"),
bool("isCompleted"),
str("uri"),
]);
let value = structure.decode(buffer);
return new BallotBotState(BigInt(value.discriminator), BigInt(value.startAt), BigInt(value.endAt), BigInt(value.totaVote), Boolean(value.isCompleted), String(value.uri));
}
}
//# sourceMappingURL=ballotBoxState.js.map