@broxus/js-core
Version:
MobX-based JavaScript Core library
64 lines (63 loc) • 4.05 kB
TypeScript
import { type Address, type ProviderRpcClient, type Subscriber } from 'everscale-inpage-provider';
import { SmartContractModel } from '../../core';
import { type BoostedAmountParams, type GaugeDetails, type GaugeRewardData, type GaugeRewardDetails, type GaugeSupplyAverage, type GaugeSyncData, type GaugeTokenDetails, GaugeUtils } from '../../models/gauge/GaugeUtils';
import { type Forceable, type Silentable, type Syncable, type Watchable } from '../../types';
export interface GaugeCtorOptions {
watchDebounceDelay?: number;
}
export interface GaugeCreateOptions extends GaugeCtorOptions, Syncable, Watchable {
watchCallback?: VoidFunction;
}
export interface GaugeData extends Partial<GaugeDetails>, Partial<GaugeRewardDetails>, Partial<GaugeTokenDetails> {
}
export declare class Gauge extends SmartContractModel<GaugeData> {
protected readonly _connection: ProviderRpcClient;
protected readonly options?: Readonly<GaugeCtorOptions> | undefined;
protected readonly _provider?: ProviderRpcClient | undefined;
static Utils: typeof GaugeUtils;
/**
* @param {ProviderRpcClient} _connection Standalone RPC client that doesn't require connection to the TVM wallet provider
* @param {Address | string} address Gauge root address
* @param {Readonly<GaugeCtorOptions>} [options] (optional) Gauge 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<GaugeCtorOptions> | undefined, _provider?: ProviderRpcClient | undefined);
/**
* @param {ProviderRpcClient} connection Standalone RPC client that doesn't require connection to the TVM wallet provider
* @param {Address | string} address Gauge root address
* @param {Readonly<GaugeCreateOptions>} [options] (optional) Gauge 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<GaugeCreateOptions>, provider?: ProviderRpcClient): Promise<Gauge>;
sync(options?: Forceable & Silentable): Promise<void>;
watch(callback?: VoidFunction): Promise<Subscriber>;
unwatch(): Promise<void>;
calcSyncData(): Promise<GaugeSyncData>;
calculateRewardData(): Promise<GaugeRewardData>;
calculateSupplyAverage(): Promise<GaugeSupplyAverage>;
calculateBoostedAmount(params: BoostedAmountParams): Promise<string>;
getGaugeAccountAddress(userAddress: Address | string): Promise<Address>;
getVoteEscrowAccountAddress(userAddress: Address | string): Promise<Address>;
get depositTokenData(): GaugeData['depositTokenData'];
get extraRewardEnded(): GaugeData['extraRewardEnded'];
get extraRewardRounds(): GaugeData['extraRewardRounds'];
get extraTokenData(): GaugeData['extraTokenData'];
get extraVestingPeriods(): GaugeData['extraVestingPeriods'];
get extraVestingRatios(): GaugeData['extraVestingRatios'];
get initialized(): GaugeData['initialized'];
get lastAverageUpdateTime(): GaugeData['lastAverageUpdateTime'];
get lastExtraRewardRoundIdx(): GaugeData['lastExtraRewardRoundIdx'];
get lastQubeRewardRoundIdx(): GaugeData['lastQubeRewardRoundIdx'];
get lastRewardTime(): GaugeData['lastRewardTime'];
get lockBoostedSupply(): GaugeData['lockBoostedSupply'];
get maxBoost(): GaugeData['maxBoost'];
get maxLockTime(): GaugeData['maxLockTime'];
get owner(): GaugeData['owner'];
get qubeRewardRounds(): GaugeData['qubeRewardRounds'];
get qubeTokenData(): GaugeData['qubeTokenData'];
get qubeVestingPeriod(): GaugeData['qubeVestingPeriod'];
get qubeVestingRatio(): GaugeData['qubeVestingRatio'];
get totalBoostedSupply(): GaugeData['totalBoostedSupply'];
get voteEscrow(): GaugeData['voteEscrow'];
get withdrawAllLockPeriod(): GaugeData['withdrawAllLockPeriod'];
}