UNPKG

@parity/light.js

Version:

A high-level reactive JS library optimized for light clients

79 lines (78 loc) 2.64 kB
import BigNumber from 'bignumber.js'; import { Address, RpcObservableOptions } from '../types'; /** * Observable containing the EIP155 chain ID used for transaction signing. * Calls `eth_chainId` * * @param options - Options to pass to {@link RpcObservableOptions}. * @return - An Observable containing the chain ID. */ export declare function chainId$( options?: RpcObservableOptions ): import('rxjs').Observable<symbol | BigNumber>; /** * Observable which contains the array of all addresses managed by the light * client. * * Calls eth_accounts. * * @param options - Options to pass to {@link RpcObservableOptions}. * @return - An Observable containing the list of public addresses. */ export declare function accounts$( options?: RpcObservableOptions ): import('rxjs').Observable<string[]>; /** * Get the balance of a given account. Calls `eth_getBalance`. * * @param address - The account address to query the balance. * @param options - Options to pass to {@link RpcObservableOptions}. * @return - An Observable containing the balance. */ export declare function balanceOf$( address: Address, options?: RpcObservableOptions ): import('rxjs').Observable<symbol | BigNumber>; /** * Get the transaction count of a given account. Calls `eth_getTransactionCount` * * @param address - Address of the account whose transaction count we want to query. * @param options - Options to pass to {@link RpcObservableOptions}. * @return - An Observable containing the transaction count. */ export declare function transactionCountOf$( address: Address, options?: RpcObservableOptions ): import('rxjs').Observable<symbol | BigNumber>; /** * Get the default account managed by the light client. * * @param options - Options to pass to {@link RpcObservableOptions}. * @return - An Observable containing the public address * of the default account. */ export declare function defaultAccount$( options?: RpcObservableOptions ): import('rxjs').Observable<string>; /** * Get the current block number. * * @return {Observable<Number>} - An Observable containing the block height. */ export declare function blockNumber$( options?: RpcObservableOptions ): import('rxjs').Observable<BigNumber>; /** * Shorthand for fetching the current account's balance. */ export declare function myBalance$( options?: RpcObservableOptions ): import('rxjs').Observable<symbol | BigNumber>; /** * Get the syncStatus state. * * @return - An Observable containing the syncing state object, or false. */ export declare function syncStatus$( options?: RpcObservableOptions ): import('rxjs').Observable<boolean | object>;