UNPKG

@broxus/js-core

Version:

MobX-based JavaScript Core library

51 lines (50 loc) 2.87 kB
import { type Address, type ProviderRpcClient, type Subscriber } from 'everscale-inpage-provider'; import { type SmartContractWatchCallback, SmartContractModel } from '../../core'; import { type DexCtorOptions } from '../../models/dex'; import { type GetAccountDepositGasAbiParams, type GetAccountWithdrawGasAbiParams, type GetAddPoolGasAbiParams, type GetDeployPoolGasAbiParams, type GetPoolDirectNoFeeWithdrawGasAbiParams, DexGasValuesUtils } from '../../models/dex-gas-values/DexGasValuesUtils'; import { type Forceable, type Silentable, type Syncable, type Watchable } from '../../types'; export interface DexGasValuesCtorOptions { /** * Gas price * @default 1000 */ gasPrice?: string | number | (() => string | number | Promise<string | number>); watchDebounceDelay?: number; } export interface DexGasValuesCreateOptions extends DexCtorOptions, Syncable, Watchable { watchCallback?: VoidFunction; } export declare class DexGasValues extends SmartContractModel { protected readonly _connection: ProviderRpcClient; protected readonly options?: Readonly<DexGasValuesCtorOptions> | undefined; static Utils: typeof DexGasValuesUtils; /** * @param {ProviderRpcClient} _connection * Standalone RPC client that doesn't require connection to the TVM wallet provider * @param {Address | string} address * DexGasValues root address * @param {Readonly<DexCtorOptions>} [options] * (optional) DexGasValues Smart Contract Model options */ constructor(_connection: ProviderRpcClient, address: Address | string, options?: Readonly<DexGasValuesCtorOptions> | undefined); /** * @param {ProviderRpcClient} connection * Standalone RPC client that doesn't require connection to the TVM wallet provider * @param {Address | string} address * DexGasValues root address * @param {Readonly<DexGasValuesCreateOptions>} [options] * (optional) DexGasValues Smart Contract Model options */ static create(connection: ProviderRpcClient, address: Address | string, options?: Readonly<DexGasValuesCreateOptions>): Promise<DexGasValues>; sync(options?: Forceable & Silentable): Promise<void>; watch(callback?: SmartContractWatchCallback): Promise<Subscriber>; unwatch(): Promise<void>; getDeployAccountGas(): Promise<string>; getDepositToAccountGas(): Promise<string>; getAccountWithdrawGas(params: GetAccountWithdrawGasAbiParams): Promise<string>; getAccountDepositGas(params: GetAccountDepositGasAbiParams): Promise<string>; getAddPoolGas(params: GetAddPoolGasAbiParams): Promise<string>; getDeployPoolGas(params: GetDeployPoolGasAbiParams): Promise<string>; getPoolDirectNoFeeWithdrawGas(params: GetPoolDirectNoFeeWithdrawGasAbiParams): Promise<string>; protected getGasPrice(): Promise<string | number>; }