import { Account, AccountJSON, AddressString, Asset, Block, BlockJSON, ConfirmedTransaction, Contract, GetOptions, Hash256String, Input, InputOutput, InvocationTransactionModel, IterOptions, NetworkSettings, NetworkType, Output, Peer, RawAction, RawCallReceipt, RawInvocationData, RelayTransactionResult, ScriptBuilderParam, StorageItem, Transaction, TransactionBaseModel, TransactionJSON, TransactionReceipt } from '@neo-one/client-common'; import BigNumber from 'bignumber.js'; import { JSONRPCClient } from './JSONRPCClient'; import { JSONRPCProvider, JSONRPCProviderManager } from './JSONRPCProvider'; export interface DataProviderOptions { readonly network: NetworkType; readonly rpcURL: string | JSONRPCProvider | JSONRPCProviderManager; readonly iterBlocksFetchTimeoutMS?: number; readonly iterBlocksBatchSize?: number; } export interface DataProvider { readonly setRPCURL: (rpcURL: string) => void; readonly getUnclaimed: (address: AddressString) => Promise<{ readonly unclaimed: readonly Input[]; readonly amount: BigNumber; }>; readonly getClaimAmount: (input: Input) => Promise; readonly getUnspentOutputs: (address: AddressString) => Promise; readonly relayTransaction: (transaction: TransactionBaseModel, networkFee?: BigNumber) => Promise; readonly getTransactionReceipt: (hash: Hash256String, options?: GetOptions) => Promise; readonly getInvocationData: (hash: Hash256String) => Promise; readonly testInvoke: (transaction: InvocationTransactionModel) => Promise; readonly getAccount: (address: AddressString) => Promise; readonly getAsset: (hash: Hash256String) => Promise; readonly getBlock: (hashOrIndex: Hash256String | number, options?: GetOptions) => Promise; readonly iterBlocks: (options: IterOptions) => AsyncIterable; readonly getBestBlockHash: () => Promise; readonly getBlockCount: () => Promise; readonly getContract: (address: AddressString) => Promise; readonly getMemPool: () => Promise; readonly getTransaction: (hash: Hash256String) => Promise; readonly getOutput: (input: Input) => Promise; readonly getConnectedPeers: () => Promise; readonly getNetworkSettings: () => Promise; readonly iterActionsRaw: (options: IterOptions) => AsyncIterable; readonly call: (contract: AddressString, method: string, params: ReadonlyArray) => Promise; readonly iterStorage: (address: AddressString) => AsyncIterable; } export declare abstract class DataProviderBase implements DataProvider { readonly network: NetworkType; protected mutableClient: JSONRPCClient; protected readonly iterBlocksFetchTimeoutMS: number | undefined; protected readonly iterBlocksBatchSize: number | undefined; constructor({ network, rpcURL, iterBlocksFetchTimeoutMS, iterBlocksBatchSize }: DataProviderOptions); setRPCURL(rpcURL: string): void; getUnclaimed(address: AddressString): Promise<{ readonly unclaimed: readonly Input[]; readonly amount: BigNumber; }>; getClaimAmount(_input: Input): Promise; getUnspentOutputs(address: AddressString): Promise; relayTransaction(transaction: TransactionBaseModel, networkFee?: BigNumber): Promise; relayStrippedTransaction(verificationTransaction: InvocationTransactionModel, relayTransaction: InvocationTransactionModel, networkFee?: BigNumber): Promise; getTransactionReceipt(hash: Hash256String, options?: GetOptions): Promise; getInvocationData(_hash: Hash256String): Promise; testInvoke(transaction: InvocationTransactionModel): Promise; getAccount(address: AddressString): Promise; getAsset(hash: Hash256String): Promise; getBlock(hashOrIndex: Hash256String | number, options?: GetOptions): Promise; iterBlocks(options?: IterOptions): AsyncIterable; getBestBlockHash(): Promise; getBlockCount(): Promise; getContract(address: AddressString): Promise; getMemPool(): Promise; getTransaction(hash: Hash256String): Promise; getOutput(input: Input): Promise; getConnectedPeers(): Promise; getNetworkSettings(): Promise; iterActionsRaw(_options?: IterOptions): AsyncIterable; call(contract: AddressString, method: string, params: ReadonlyArray): Promise; iterStorage(_address: AddressString): AsyncIterable; protected getAccountInternal(address: AddressString): Promise; protected abstract executeGetUnclaimed(address: AddressString): Promise<{ readonly unclaimed: readonly Input[]; readonly amount: BigNumber; }>; protected abstract executeGetUnspentOutputs(address: AddressString): Promise; protected abstract executeRelayTransaction(transaction: TransactionBaseModel, networkFee?: BigNumber): Promise; protected abstract executeRelayStrippedTransaction(verificationTransaction: InvocationTransactionModel, relayTransaction: InvocationTransactionModel, networkFee?: BigNumber): Promise; protected abstract executeGetTransactionReceipt(hash: Hash256String, options?: GetOptions): Promise; protected abstract executeTestInvoke(transaction: InvocationTransactionModel): Promise; protected abstract executeGetOutput(input: Input): Promise; protected abstract executeGetAccountInternal(address: AddressString): Promise; protected abstract convertConfirmedTransaction(transaction: TransactionJSON, block: BlockJSON): ConfirmedTransaction; protected capture(func: () => Promise, title: string): Promise; }