@broxus/js-core
Version:
MobX-based JavaScript Core library
71 lines (70 loc) • 5.29 kB
TypeScript
import { type Address, type ProviderRpcClient, type SendInternalParams, type Subscriber, type Transaction } from 'everscale-inpage-provider';
import { SmartContractModel } from '../../core';
import { type VoteEscrowUnlockCastedVotesAbiParams, type VoteEscrowUnlockVoteTokensAbiParams } from '../../models/vote-escrow';
import { type VoteEscrowAccountAverage, type VoteEscrowAccountCastedVote, type VoteEscrowAccountCreatedProposal, type VoteEscrowAccountDecodedEvent, type VoteEscrowAccountDetails, VoteEscrowAccountUtils } from '../../models/vote-escrow-account/VoteEscrowAccountUtils';
import { type CallId, type Forceable, type SendMessageCallback, type Silentable, type Syncable, type TransactionCallbacks, type TransactionFailureReason, type TransactionSentDetails, type TransactionSuccessResult, type Watchable } from '../../types';
export interface VoteEscrowAccountUnlockCastedVotesCallbacks extends SendMessageCallback, TransactionCallbacks<TransactionSuccessResult, TransactionFailureReason, TransactionSentDetails> {
}
export interface VoteEscrowAccountUnlockCastedVotesParams extends Partial<CallId>, VoteEscrowUnlockCastedVotesAbiParams, VoteEscrowAccountUnlockCastedVotesCallbacks {
}
export interface VoteEscrowAccountUnlockVoteTokensCallbacks extends SendMessageCallback, TransactionCallbacks<TransactionSuccessResult, TransactionFailureReason, TransactionSentDetails> {
}
export interface VoteEscrowAccountUnlockVoteTokensParams extends Partial<CallId>, VoteEscrowUnlockVoteTokensAbiParams, VoteEscrowAccountUnlockVoteTokensCallbacks {
}
export interface VoteEscrowAccountCtorOptions {
watchDebounceDelay?: number;
}
export interface VoteEscrowAccountCreateOptions extends VoteEscrowAccountCtorOptions, Syncable, Watchable {
watchCallback?: VoidFunction;
}
export interface VoteEscrowAccountData extends VoteEscrowAccountDetails, VoteEscrowAccountAverage {
castedVotes: VoteEscrowAccountCastedVote[];
createdProposals: VoteEscrowAccountCreatedProposal[];
lockedTokens: string;
}
export declare class VoteEscrowAccount extends SmartContractModel<VoteEscrowAccountData> {
protected readonly _connection: ProviderRpcClient;
protected readonly options?: Readonly<VoteEscrowAccountCtorOptions> | undefined;
protected readonly _provider?: ProviderRpcClient | undefined;
static Utils: typeof VoteEscrowAccountUtils;
/**
* @param {ProviderRpcClient} _connection Standalone RPC client that doesn't require connection to the TVM wallet
* provider
* @param {Address | string} address VoteEscrowAccount root address
* @param {Readonly<VoteEscrowAccountCtorOptions>} [options] (optional) VoteEscrowAccount Smart Contract Model
* options
* @param {ProviderRpcClient} [_provider] (optional) RPC provider that require connection to the TVM wallet
*/
constructor(_connection: ProviderRpcClient, address: Address | string, options?: Readonly<VoteEscrowAccountCtorOptions> | undefined, _provider?: ProviderRpcClient | undefined);
/**
* @param {ProviderRpcClient} connection Standalone RPC client that doesn't require connection to the TVM wallet
* provider
* @param {Address | string} address VoteEscrowAccount root address
* @param {Readonly<VoteEscrowAccountCreateOptions>} [options] (optional) VoteEscrowAccount Smart Contract Model
* options
* @param {ProviderRpcClient} [provider] (optional) RPC provider that require connection to the TVM wallet
*/
static create(connection: ProviderRpcClient, address: Address | string, options?: Readonly<VoteEscrowAccountCreateOptions>, provider?: ProviderRpcClient): Promise<VoteEscrowAccount>;
sync(options?: Forceable & Silentable): Promise<void>;
watch(callback?: VoidFunction): Promise<Subscriber>;
unwatch(): Promise<void>;
tryUnlockCastedVotes(params: VoteEscrowAccountUnlockCastedVotesParams, args?: Pick<SendInternalParams, 'from'> & Omit<Partial<SendInternalParams>, 'from'>): Promise<Transaction>;
tryUnlockVoteTokens(params: VoteEscrowAccountUnlockVoteTokensParams, args: Pick<SendInternalParams, 'from'> & Omit<Partial<SendInternalParams>, 'from'>): Promise<Transaction>;
calculateMinGas(): Promise<string>;
calculateVeAverage(): Promise<VoteEscrowAccountAverage>;
get activeDeposits(): VoteEscrowAccountData['activeDeposits'];
get castedVotes(): VoteEscrowAccountData['castedVotes'];
get createdProposals(): VoteEscrowAccountData['createdProposals'];
get currentVersion(): VoteEscrowAccountData['currentVersion'];
get lastEpochVoted(): VoteEscrowAccountData['lastEpochVoted'];
get lastUpdateTime(): VoteEscrowAccountData['lastUpdateTime'];
get lockedTokens(): VoteEscrowAccountData['lockedTokens'];
get qubeBalance(): VoteEscrowAccountData['qubeBalance'];
get unlockedQubes(): VoteEscrowAccountData['unlockedQubes'];
get user(): VoteEscrowAccountData['user'];
get veQubeAverage(): VoteEscrowAccountData['veQubeAverage'];
get veQubeAveragePeriod(): VoteEscrowAccountData['veQubeAveragePeriod'];
get veQubeBalance(): VoteEscrowAccountData['veQubeBalance'];
get voteEscrow(): VoteEscrowAccountData['voteEscrow'];
decodeTransactionEvents(transaction: Transaction): Promise<VoteEscrowAccountDecodedEvent[]>;
}