@broxus/js-core
Version:
MobX-based JavaScript Core library
88 lines (87 loc) • 4.25 kB
TypeScript
import { type Address, type Contract, type ProviderRpcClient, type Subscriber } from 'everscale-inpage-provider';
import { type SmartContractWatchCallback, SmartContractModel } from '../../core';
import { CONFIG_ABI } from '../../models/network-config/constants';
import { type Forceable, type Silentable, type Syncable, type Watchable } from '../../types';
export interface MasterChainConfigCtorOptions {
ttl?: number;
watchDebounceDelay?: number;
}
export interface MasterChainCreateOptions extends MasterChainConfigCtorOptions, Syncable, Watchable {
watchCallback?: VoidFunction;
}
export interface MasterChainConfigData {
bitPrice: string;
blockGasLimit: string;
cellPrice: string;
deleteDueLimit: string;
electionsEndBefore: string;
electionsStartBefore: string;
firstFrac: string;
flatGasLimit: string;
flatGasPrice: string;
freezeDueLimit: string;
gasCredit: string;
gasLimit: string;
gasPrice: string;
ihrPriceFactor: string;
lumpPrice: string;
nextFrac: string;
specialGasLimit: string;
stakingDistributionSince: number;
stakingDistributionUntil: number;
stakingHeldFor: string;
validatorsElectedFor: string;
}
interface SyncOptions extends Forceable, Silentable {
ttl?: number;
}
export declare class MasterChainConfig extends SmartContractModel<MasterChainConfigData> {
protected readonly _connection: ProviderRpcClient;
protected readonly options?: Readonly<MasterChainConfigCtorOptions> | undefined;
protected readonly _contract: Contract<typeof CONFIG_ABI>;
/**
* @param {ProviderRpcClient} _connection
* Standalone RPC client that doesn't require connection to the TVM wallet provider
* @param {Address | string} address
* MasterChainConfig root address
* @param {Readonly<MasterChainConfigCtorOptions>} [options]
* (optional) MasterChainConfig Smart Contract Model options
*/
constructor(_connection: ProviderRpcClient, address: Address | string, options?: Readonly<MasterChainConfigCtorOptions> | undefined);
/**
* @param {ProviderRpcClient} connection
* Standalone RPC client that doesn't require connection to the TVM wallet provider
* @param {Address | string} address
* MasterChainConfig root address
* @param {Readonly<MasterChainCreateOptions>} [options]
* (optional) MasterChainConfig Smart Contract Model options
*/
static create(connection: ProviderRpcClient, address: Address | string, options?: Readonly<MasterChainCreateOptions>): Promise<MasterChainConfig>;
sync(options?: SyncOptions): Promise<void>;
watch(callback?: SmartContractWatchCallback<MasterChainConfigData>): Promise<Subscriber>;
unwatch(): Promise<void>;
protected syncParams(): Promise<void>;
get bitPrice(): MasterChainConfigData['bitPrice'];
get blockGasLimit(): MasterChainConfigData['blockGasLimit'];
get cellPrice(): MasterChainConfigData['cellPrice'];
get deleteDueLimit(): MasterChainConfigData['deleteDueLimit'];
get electionsEndBefore(): MasterChainConfigData['electionsEndBefore'];
get electionsStartBefore(): MasterChainConfigData['electionsStartBefore'];
get firstFrac(): MasterChainConfigData['firstFrac'];
get flatGasLimit(): MasterChainConfigData['flatGasLimit'];
get flatGasPrice(): MasterChainConfigData['flatGasPrice'];
get freezeDueLimit(): MasterChainConfigData['freezeDueLimit'];
get gasCredit(): MasterChainConfigData['gasCredit'];
get gasLimit(): MasterChainConfigData['gasLimit'];
get gasPrice(): MasterChainConfigData['gasPrice'];
get ihrPriceFactor(): MasterChainConfigData['ihrPriceFactor'];
get lumpPrice(): MasterChainConfigData['lumpPrice'];
get nextFrac(): MasterChainConfigData['nextFrac'];
get specialGasLimit(): MasterChainConfigData['specialGasLimit'];
get stakingDistributionSince(): MasterChainConfigData['stakingDistributionSince'];
get stakingDistributionUntil(): MasterChainConfigData['stakingDistributionUntil'];
get stakingHeldFor(): MasterChainConfigData['stakingHeldFor'];
get validatorsElectedFor(): MasterChainConfigData['validatorsElectedFor'];
get stakingRoundTime(): number;
}
export {};