@broxus/js-core
Version:
MobX-based JavaScript Core library
81 lines (80 loc) • 5.46 kB
TypeScript
import { type Address, type DecodeEventParams, type DecodeTransactionParams, type ProviderRpcClient, type SendInternalParams, type Subscriber, type Transaction } from 'everscale-inpage-provider';
import { type SmartContractWatchCallback, SmartContractModel } from '../../core';
import { type StakingVaultAbi } from '../../models/staking-vault/abi';
import { type StakingVaultDetails, StakingVaultUtils } from '../../models/staking-vault/StakingVaultUtils';
import { type StakingVaultDecodedEvent, type StakingVaultDecodedTransaction, type StakingVaultDepositParams, type StakingVaultRemovePenfingWithdrawParams } from '../../models/staking-vault/types';
import { type Forceable, type Silentable, type Syncable, type Watchable } from '../../types';
export interface StakingVaultCtorOptions {
watchDebounceDelay?: number;
}
export interface StakingVaultCreateOptions extends StakingVaultCtorOptions, Syncable, Watchable {
watchCallback?: VoidFunction;
}
export interface StakingVaultData extends StakingVaultDetails {
}
export declare class StakingVault extends SmartContractModel<StakingVaultData> {
protected readonly _connection: ProviderRpcClient;
protected readonly options?: Readonly<StakingVaultCtorOptions> | undefined;
protected readonly _provider?: ProviderRpcClient | undefined;
static Utils: typeof StakingVaultUtils;
/**
* @param {ProviderRpcClient} _connection
* Standalone RPC client that doesn't require connection to the TVM wallet provider
* @param {Address | string} address
* StakingVault root address
* @param {Readonly<StakingVaultCtorOptions>} [options]
* (optional) StakingVault 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<StakingVaultCtorOptions> | undefined, _provider?: ProviderRpcClient | undefined);
/**
* @param {ProviderRpcClient} connection
* Standalone RPC client that doesn't require connection to the TVM wallet provider
* @param {Address | string} address
* StakingVault root address
* @param {Readonly<StakingVaultCreateOptions>} [options]
* (optional) StakingVault 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<StakingVaultCreateOptions>, provider?: ProviderRpcClient): Promise<StakingVault>;
sync(options?: Forceable & Silentable): Promise<void>;
watch(callback?: SmartContractWatchCallback<StakingVaultData>): Promise<Subscriber>;
unwatch(): Promise<void>;
deposit(params: StakingVaultDepositParams, args: Pick<SendInternalParams, 'from'> & Omit<Partial<SendInternalParams>, 'from'>): Promise<Transaction | undefined>;
removePendingWithdraw(params: StakingVaultRemovePenfingWithdrawParams, args: Pick<SendInternalParams, 'from'> & Omit<Partial<SendInternalParams>, 'from'>): Promise<Transaction | undefined>;
encodeDepositPayload(nonce: string | number): Promise<string>;
getAccountAddress(userAddress: Address | string): Promise<Address>;
getDepositExpectedAmount(amount: string | number): Promise<string>;
getWithdrawExpectedAmount(amount: string | number): Promise<string>;
get nonce(): StakingVaultData['nonce'];
get governance(): StakingVaultData['governance'];
get stEverSupply(): StakingVaultData['stEverSupply'];
get totalAssets(): StakingVaultData['totalAssets'];
get availableAssets(): StakingVaultData['availableAssets'];
get totalStEverFee(): StakingVaultData['totalStEverFee'];
get effectiveEverAssets(): StakingVaultData['effectiveEverAssets'];
get remainingLockedAssets(): StakingVaultData['remainingLockedAssets'];
get unlockPerSecond(): StakingVaultData['unlockPerSecond'];
get stEverWallet(): StakingVaultData['stEverWallet'];
get stTokenRoot(): StakingVaultData['stTokenRoot'];
get lastUnlockTime(): StakingVaultData['lastUnlockTime'];
get fullUnlockSeconds(): StakingVaultData['fullUnlockSeconds'];
get remainingSeconds(): StakingVaultData['remainingSeconds'];
get gainFee(): StakingVaultData['gainFee'];
get stEverFeePercent(): StakingVaultData['stEverFeePercent'];
get minStrategyDepositValue(): StakingVaultData['minStrategyDepositValue'];
get minStrategyWithdrawValue(): StakingVaultData['minStrategyWithdrawValue'];
get isPaused(): StakingVaultData['isPaused'];
get strategyFactory(): StakingVaultData['strategyFactory'];
get withdrawHoldTime(): StakingVaultData['withdrawHoldTime'];
get owner(): StakingVaultData['owner'];
get accountVersion(): StakingVaultData['accountVersion'];
get stEverVaultVersion(): StakingVaultData['stEverVaultVersion'];
get clusterVersion(): StakingVaultData['clusterVersion'];
get timeAfterEmergencyCanBeActivated(): StakingVaultData['timeAfterEmergencyCanBeActivated'];
decodeEvent(args: DecodeEventParams<typeof StakingVaultAbi>): Promise<StakingVaultDecodedEvent | undefined>;
decodeTransaction(args: DecodeTransactionParams<typeof StakingVaultAbi>): Promise<StakingVaultDecodedTransaction | undefined>;
decodeTransactionEvents(transaction: Transaction): Promise<StakingVaultDecodedEvent[]>;
}