@broxus/js-core
Version:
MobX-based JavaScript Core library
69 lines (68 loc) • 4.96 kB
TypeScript
import { type Address, type ProviderRpcClient, type SendInternalParams, type Subscriber, type Transaction } from 'everscale-inpage-provider';
import { type SmartContractWatchCallback, SmartContractModel } from '../../core';
import { type VoteEscrowAccountCastVoteParams, type VoteEscrowAccountCastVoteWithReasonParams, type VoteEscrowAccountDecodedEvent, type VoteEscrowAccountUnlockCastedVotesParams, type VoteEscrowAccountUnlockVoteTokensParams } from '../../models/vote-escrow-account/types';
import { type VoteEscrowAccountAverage, type VoteEscrowAccountCastedVote, type VoteEscrowAccountCreatedProposal, type VoteEscrowAccountDetails, VoteEscrowAccountUtils } from '../../models/vote-escrow-account/VoteEscrowAccountUtils';
import { type Forceable, type Silentable, type Syncable, type Watchable } from '../../types';
export interface VoteEscrowAccountCtorOptions {
watchDebounceDelay?: number;
}
export interface VoteEscrowAccountCreateOptions extends Syncable, VoteEscrowAccountCtorOptions, Watchable {
watchCallback?: VoidFunction;
}
export interface VoteEscrowAccountData extends VoteEscrowAccountAverage, VoteEscrowAccountDetails {
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?: SmartContractWatchCallback<VoteEscrowAccountData>): 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>;
castVote(params: VoteEscrowAccountCastVoteParams, args: Pick<SendInternalParams, 'from'> & Omit<Partial<SendInternalParams>, 'from'>): Promise<Transaction>;
castVoteWithReason(params: VoteEscrowAccountCastVoteWithReasonParams, 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[]>;
}