UNPKG

@broxus/js-core

Version:

MobX-based JavaScript Core library

38 lines (37 loc) 2.75 kB
import { type Address, type DecodeEventParams, type DecodeTransactionParams, type FullContractState, type ProviderRpcClient, type Transaction } from 'everscale-inpage-provider'; import { type VoteEscrowAccountAbi } from '../../models/vote-escrow-account/abi'; import { type VoteEscrowAccountDecodedEvent, type VoteEscrowAccountDecodedTransaction } from '../../models/vote-escrow-account/types'; 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 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[]>; }