@broxus/js-core
Version:
MobX-based JavaScript Core library
49 lines (48 loc) • 2.8 kB
TypeScript
import { type Address, type ProviderRpcClient, type Subscriber } from 'everscale-inpage-provider';
import { type SmartContractWatchCallback, SmartContractModel } from '../../core';
import { StakingAccountUtils } from '../../models/staking-account/StakingAccountUtils';
import { type StakingAccountDetails, type StakingWithdrawRequest } from '../../models/staking-account/types';
import { type Forceable, type Silentable, type Syncable, type Watchable } from '../../types';
export interface StakingAccountCtorOptions {
watchDebounceDelay?: number;
}
export interface StakingAccountCreateOptions extends StakingAccountCtorOptions, Syncable, Watchable {
watchCallback?: VoidFunction;
}
export interface StakingAccountData extends StakingAccountDetails {
withdrawRequests: StakingWithdrawRequest[];
}
export declare class StakingAccount extends SmartContractModel<StakingAccountData> {
protected readonly _connection: ProviderRpcClient;
protected readonly options?: Readonly<StakingAccountCtorOptions> | undefined;
protected readonly _provider?: ProviderRpcClient | undefined;
static Utils: typeof StakingAccountUtils;
/**
* @param {ProviderRpcClient} _connection
* Standalone RPC client that doesn't require connection to the TVM wallet provider
* @param {Address | string} address
* StakingAccount root address
* @param {Readonly<StakingAccountCtorOptions>} [options]
* (optional) StakingAccount 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<StakingAccountCtorOptions> | undefined, _provider?: ProviderRpcClient | undefined);
/**
* @param {ProviderRpcClient} connection
* Standalone RPC client that doesn't require connection to the TVM wallet provider
* @param {Address | string} address
* StakingAccount root address
* @param {Readonly<StakingAccountCreateOptions>} [options]
* (optional) StakingAccount 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<StakingAccountCreateOptions>, provider?: ProviderRpcClient): Promise<StakingAccount>;
sync(options?: Forceable & Silentable): Promise<void>;
watch(callback?: SmartContractWatchCallback<StakingAccountData>): Promise<Subscriber>;
unwatch(): Promise<void>;
get user(): StakingAccountData['user'];
get vault(): StakingAccountData['vault'];
get withdrawRequests(): StakingAccountData['withdrawRequests'];
}