@broxus/js-core
Version:
MobX-based JavaScript Core library
102 lines (101 loc) • 7.31 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 VoteEscrowCastVoteParams, type VoteEscrowCastVoteWithReasonParams, type VoteEscrowDecodedEvent, type VoteEscrowDepositParams, type VoteEscrowEndVotingParams, type VoteEscrowUnlockCastedVotesParams, type VoteEscrowUnlockVoteTokensParams, type VoteEscrowVoteEpochParams, type VoteEscrowWithdrawParams } from '../../models/vote-escrow/types';
import { type VoteEscrowAverage, type VoteEscrowCalcVeMintAbiParams, type VoteEscrowCurrentEpochDetails, type VoteEscrowCurrentVotingVotes, type VoteEscrowDetails, type VoteEscrowEncodeDepositPayloadAbiParams, type VoteEscrowEncodeWhitelistPayloadAbiParams, type VoteEscrowGaugeDaoApproved, type VoteEscrowGaugeWhitelist, type VoteEscrowNormalizedVoting, type VoteEscrowVotingDetails, VoteEscrowUtils } from '../../models/vote-escrow/VoteEscrowUtils';
import { type Forceable, type Silentable, type Syncable, type Watchable } from '../../types';
export interface VoteEscrowCtorOptions {
watchDebounceDelay?: number;
}
export interface VoteEscrowCreateOptions extends Syncable, VoteEscrowCtorOptions, Watchable {
watchCallback?: VoidFunction;
}
export interface VoteEscrowData extends VoteEscrowAverage, VoteEscrowCurrentEpochDetails, VoteEscrowCurrentVotingVotes, VoteEscrowDetails, VoteEscrowNormalizedVoting, VoteEscrowVotingDetails {
distributionSchedule: string[];
distributionScheme: string[];
gaugeDaoApproved: VoteEscrowGaugeDaoApproved;
gaugeWhitelist: VoteEscrowGaugeWhitelist;
}
export declare class VoteEscrow extends SmartContractModel<VoteEscrowData> {
protected readonly _connection: ProviderRpcClient;
protected readonly options?: Readonly<VoteEscrowCtorOptions> | undefined;
protected readonly _provider?: ProviderRpcClient | undefined;
static Utils: typeof VoteEscrowUtils;
/**
* @param {ProviderRpcClient} _connection
* Standalone RPC client that doesn't require connection to the TVM wallet provider
* @param {Address | string} address
* VoteEscrow root address
* @param {Readonly<VoteEscrowCtorOptions>} [options]
* (optional) VoteEscrow 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<VoteEscrowCtorOptions> | undefined, _provider?: ProviderRpcClient | undefined);
/**
* @param {ProviderRpcClient} connection
* Standalone RPC client that doesn't require connection to the TVM wallet provider
* @param {Address | string} address
* VoteEscrow root address
* @param {Readonly<VoteEscrowCreateOptions>} [options]
* (optional) VoteEscrow 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<VoteEscrowCreateOptions>, provider?: ProviderRpcClient): Promise<VoteEscrow>;
sync(options?: Forceable & Silentable): Promise<void>;
watch(callback?: SmartContractWatchCallback<VoteEscrowData>): Promise<Subscriber>;
unwatch(): Promise<void>;
deposit(params: VoteEscrowDepositParams, args?: Partial<SendInternalParams>): Promise<Transaction>;
withdraw(params: VoteEscrowWithdrawParams, args?: Partial<SendInternalParams>): Promise<Transaction>;
voteEpoch(params: VoteEscrowVoteEpochParams, args?: Partial<SendInternalParams>): Promise<Transaction>;
endVoting(params: VoteEscrowEndVotingParams, args?: Partial<SendInternalParams>): Promise<Transaction>;
tryUnlockCastedVotes(params: VoteEscrowUnlockCastedVotesParams, args: Pick<SendInternalParams, 'from'> & Omit<Partial<SendInternalParams>, 'from'>): Promise<Transaction>;
tryUnlockVoteTokens(params: VoteEscrowUnlockVoteTokensParams, args: Pick<SendInternalParams, 'from'> & Omit<Partial<SendInternalParams>, 'from'>): Promise<Transaction>;
castVote(params: VoteEscrowCastVoteParams, args: Partial<SendInternalParams>): Promise<Transaction>;
castVoteWithReason(params: VoteEscrowCastVoteWithReasonParams, args: Partial<SendInternalParams>): Promise<Transaction>;
getVoteEscrowAccountAddress(ownerAddress: Address | string): Promise<Address>;
calculateVeMint(params: VoteEscrowCalcVeMintAbiParams): Promise<string>;
calculateGasForEndVoting(): Promise<string>;
get currentEpoch(): VoteEscrowData['currentEpoch'];
get currentEpochEndTime(): VoteEscrowData['currentEpochEndTime'];
get currentEpochStartTime(): VoteEscrowData['currentEpochStartTime'];
get currentVotingEndTime(): VoteEscrowData['currentVotingEndTime'];
get currentVotingStartTime(): VoteEscrowData['currentVotingStartTime'];
get currentVotingVotes(): VoteEscrowData['currentVotingVotes'];
get dao(): VoteEscrowData['dao'];
get distribution(): VoteEscrowData['distribution'];
get distributionSchedule(): VoteEscrowData['distributionSchedule'];
get distributionScheme(): VoteEscrowData['distributionScheme'];
get distributionSupply(): VoteEscrowData['distributionSupply'];
get emergency(): VoteEscrowData['emergency'];
get emissionDebt(): VoteEscrowData['emissionDebt'];
get epochTime(): VoteEscrowData['epochTime'];
get gaugeMaxVotesRatio(): VoteEscrowData['gaugeMaxVotesRatio'];
get gaugeMinVotesRatio(): VoteEscrowData['gaugeMinVotesRatio'];
get gaugeDaoApproved(): VoteEscrowData['gaugeDaoApproved'];
get gaugeWhitelist(): VoteEscrowData['gaugeWhitelist'];
get gaugeWhitelistPrice(): VoteEscrowData['gaugeWhitelistPrice'];
get maxGaugesPerVote(): VoteEscrowData['maxGaugesPerVote'];
get initialized(): VoteEscrowData['initialized'];
get lastUpdateTime(): VoteEscrowData['lastUpdateTime'];
get manager(): VoteEscrowData['manager'];
get normalizedVotes(): VoteEscrowData['normalizedVotes'];
get owner(): VoteEscrowData['owner'];
get paused(): VoteEscrowData['paused'];
get qube(): VoteEscrowData['qube'];
get qubeBalance(): VoteEscrowData['qubeBalance'];
get qubeMaxLockTime(): VoteEscrowData['qubeMaxLockTime'];
get qubeMinLockTime(): VoteEscrowData['qubeMinLockTime'];
get qubeWallet(): VoteEscrowData['qubeWallet'];
get teamTokens(): VoteEscrowData['teamTokens'];
get timeBeforeVoting(): VoteEscrowData['timeBeforeVoting'];
get treasuryTokens(): VoteEscrowData['treasuryTokens'];
get veQubeAverage(): VoteEscrowData['veQubeAverage'];
get veQubeAveragePeriod(): VoteEscrowData['veQubeAveragePeriod'];
get veQubeBalance(): VoteEscrowData['veQubeBalance'];
get whitelistPayments(): VoteEscrowData['whitelistPayments'];
decodeMethodInput(payload: string, method: string | string[]): Promise<any>;
decodeTransactionEvents(transaction: Transaction): Promise<VoteEscrowDecodedEvent[]>;
encodeDepositPayload(params: VoteEscrowEncodeDepositPayloadAbiParams): Promise<string>;
encodeWhitelistPayload(params: VoteEscrowEncodeWhitelistPayloadAbiParams): Promise<string>;
}