@broxus/js-core
Version:
MobX-based JavaScript Core library
41 lines (40 loc) • 3.09 kB
TypeScript
import { type AbiFunctionName, type Address, type DecodeEventParams, type DecodeTransactionParams, type DecodedTransaction, type FullContractState, type ProviderRpcClient, type Transaction } from 'everscale-inpage-provider';
import { type DecodedEvent } from 'everscale-inpage-provider/dist/contract';
import { type AbiEventName } from 'everscale-inpage-provider/dist/models';
import { type VoteEscrowAccountAbi } from '../../models/vote-escrow-account/abi';
export interface VoteEscrowAccountDetails {
activeDeposits: number;
currentVersion: number;
lastEpochVoted: number;
lastUpdateTime: number;
qubeBalance: string;
unlockedQubes: string;
user: Address;
veQubeAverage: string;
veQubeAveragePeriod: number;
veQubeBalance: string;
voteEscrow: Address;
}
export interface VoteEscrowAccountAverage {
expiredVeQubes: string;
qubeBalance: string;
unlockedQubes: string;
veQubeAverage: string;
veQubeAveragePeriod: number;
veQubeBalance: string;
}
export type VoteEscrowAccountCastedVote = readonly [string, boolean];
export type VoteEscrowAccountCreatedProposal = readonly [string, string];
export type VoteEscrowAccountDecodedEvent = DecodedEvent<typeof VoteEscrowAccountAbi, AbiEventName<typeof VoteEscrowAccountAbi>>;
export type VoteEscrowAccountDecodedTransaction = DecodedTransaction<typeof VoteEscrowAccountAbi, AbiFunctionName<typeof VoteEscrowAccountAbi>>;
export declare abstract class VoteEscrowAccountUtils {
static getDetails(connection: ProviderRpcClient, voteEscrowAccountAddress: Address | string, cachedState?: FullContractState): Promise<VoteEscrowAccountDetails>;
static calculateVeAverage(connection: ProviderRpcClient, voteEscrowAccountAddress: Address | string, cachedState?: FullContractState): Promise<VoteEscrowAccountAverage>;
static calculateMinGas(connection: ProviderRpcClient, voteEscrowAccountAddress: Address | string, cachedState?: FullContractState): Promise<string>;
static castedVotes(connection: ProviderRpcClient, voteEscrowAccountAddress: Address | string, cachedState?: FullContractState): Promise<VoteEscrowAccountCastedVote[]>;
static createdProposals(connection: ProviderRpcClient, voteEscrowAccountAddress: Address | string, cachedState?: FullContractState): Promise<VoteEscrowAccountCreatedProposal[]>;
static lockedTokens(connection: ProviderRpcClient, voteEscrowAccountAddress: Address | string, cachedState?: FullContractState): Promise<string>;
static decodeEvent(connection: ProviderRpcClient, voteEscrowAccountAddress: Address | string, args: DecodeEventParams<typeof VoteEscrowAccountAbi>): Promise<VoteEscrowAccountDecodedEvent | undefined>;
static decodeTransaction(connection: ProviderRpcClient, voteEscrowAccountAddress: Address | string, args: DecodeTransactionParams<typeof VoteEscrowAccountAbi>): Promise<VoteEscrowAccountDecodedTransaction | undefined>;
static decodeTransactionEvents(connection: ProviderRpcClient, voteEscrowAccountAddress: Address | string, transaction: Transaction): Promise<VoteEscrowAccountDecodedEvent[]>;
}