import BigNumber from '@airgap/coinlib-core/dependencies/src/bignumber.js-9.0.0/bignumber'; import { Cache } from '@airgap/coinlib-core/utils/cache'; import { TypedSubstrateAddress } from '../data/account/address/SubstrateAddressFactory'; import { SubstrateAccountInfo } from '../data/account/SubstrateAccountInfo'; import { SubstrateCall } from '../data/metadata/decorator/call/SubstrateCall'; import { MetadataDecorator } from '../data/metadata/decorator/MetadataDecorator'; import { SCALEType } from '../data/scale/type/SCALEType'; import { SubstrateRuntimeVersion } from '../data/state/SubstrateRuntimeVersion'; import { SubstrateTransactionType } from '../data/transaction/SubstrateTransaction'; import { SubstrateProtocolConfiguration, SubstrateRpcConfiguration } from '../types/configuration'; import { SubstrateNodeClient } from './SubstrateNodeClient'; interface ConnectionConfig { allowCache: boolean; } export declare class SubstrateCommonNodeClient implements SubstrateNodeClient { protected readonly configuration: C; protected readonly url: string; protected metadata: MetadataDecorator | undefined; protected runtimeVersion: number | undefined; protected readonly lastFees: Map, BigNumber>; protected initApiPromise: Promise | null; protected readonly storageEntries: Record; protected readonly calls: Record; protected readonly constants: Record; protected readonly callEndpoints: SubstrateCallEndpoints; protected readonly cache: Cache; constructor(configuration: C, url: string); getAccountInfo(address: TypedSubstrateAddress): Promise; getExistentialDeposit(): Promise; getBlockTime(): Promise; getFirstBlockHash(): Promise; getLastBlockHash(): Promise; protected getBlockHash(blockNumber?: number): Promise; getCurrentHeight(): Promise; getRuntimeVersion(): Promise; getTransferFeeEstimate(transaction: string | Uint8Array): Promise; saveLastFee(type: SubstrateTransactionType, fee: BigNumber): void; getSavedLastFee(type: SubstrateTransactionType, defaultValue: 'undefined' | 'largest'): BigNumber | undefined; getTransactionMetadata(type: SubstrateTransactionType): Promise; submitTransaction(encoded: string): Promise; protected fromStorage, Entry extends SubstrateStorageEntryName>(moduleName: Module, entryName: Entry, ...args: SCALEType[]): Promise; protected getCall, Call extends SubstrateCallName>(moduleName: Module, callName: Call): Promise; protected getConstant, Constant extends SubstrateConstantName>(moduleName: Module, constantName: Constant): Promise; protected initApi(): Promise; protected initCache(): Promise; protected send, S extends SubstrateRpcMethodName>(module: T, method: S, params?: string[], config?: ConnectionConfig): Promise; private sendRepeat; protected registerCallEntrypointEntries(entries: [SubstrateTransactionType, [SubstrateCallModuleName, SubstrateCallName]][]): void; protected createCallEndpointEntry, Call extends SubstrateCallName>(transactionType: SubstrateTransactionType, moduleName: Module, callName: Call): [SubstrateTransactionType, [SubstrateCallModuleName, SubstrateCallName]]; protected mergeSupportedCalls(configured: Record>, common: Record>): Record; } declare const commonRpcMethods: { author: readonly ["submitExtrinsic"]; chain: readonly ["getBlock", "getBlockHash"]; state: readonly ["getMetadata", "getStorage", "getRuntimeVersion"]; payment: readonly ["queryInfo"]; }; export declare type SubstrateRpcModuleName = ModuleName; export declare type SubstrateRpcMethodName> = ModuleEntry; declare const commonStorageEntries: { System: readonly ["Account"]; }; declare type SubstrateStorageModuleName = ModuleName; declare type SubstrateStorageEntryName> = ModuleEntry; declare const commonCalls: { Balances: readonly ["transfer_allow_death"]; }; declare type SubstrateCallModuleName = ModuleName; declare type SubstrateCallName> = ModuleEntry; declare const commonConstants: { Balances: readonly ["ExistentialDeposit"]; }; declare type SubstrateConstantModuleName = ModuleName; declare type SubstrateConstantName> = ModuleEntry; declare type SubstrateCallEndpoints = Map, [ SubstrateCallModuleName, SubstrateCallName ]>; declare type ModuleName = keyof Defaults | (C['rpc'] extends Object ? (keyof C['rpc'][Type] extends string ? keyof C['rpc'][Type] : never) : never); declare type ModuleEntry>, T extends ModuleName> = ReadonlyEntries | (C['rpc'] extends Object ? ReadonlyEntries : never); declare type ReadonlyEntries = T extends keyof C ? { [S in T]: C[S] extends Readonly ? C[S][number] : never; }[T] : never; export {};