import BigNumber from 'bignumber.js' ; import { Block } from './block' ; import { Transaction } from './transaction' ; import { Address } from './address' ; import { EIP1559Fee } from './fees' ; export interface SendOptions { to : Address | string ; value : BigNumber ; data ? : string ; fee ? : EIP1559Fee | number ; } export interface ChainProvider { param { ! number } numberOfBlocks return { < Promise > } generateBlock ( numberOfBlocks ) : Promise < void > ; param { ! string } blockHash param { boolean } includeTx return { Promise < Block , TypeError | InvalidProviderResponseError > } getBlockByHash ( blockHash , includeTx ? ) : Promise < Block > ; param { ! number } blockNumber param { boolean } includeTx return { Promise < Block , TypeError | InvalidProviderResponseError > } getBlockByNumber ( blockNumber , includeTx ? ) : Promise < Block > ; return { Promise < number , InvalidProviderResponseError > } getBlockHeight ( ) : Promise < number > ; param { ! string } txHash return { Promise < Transaction , TypeError | InvalidProviderResponseError > } getTransactionByHash ( txHash ) : Promise < Transaction > ; param { ( string | Address ) [ ] } addresses return { Promise < BigNumber , InvalidProviderResponseError > } getBalance ( addresses ) : Promise < BigNumber > ; param { ! string } to param { ! number } value param { ! string } data param { ! Fee } fee return { Promise < Transaction > } sendTransaction ( options ) : Promise < Transaction > ; param { ! string } address param { Fee } fee return { Promise < Transaction > } sendSweepTransaction ( address , fee ? ) : Promise < Transaction > ; param { ( string | Transaction ) } tx param { ! Fee } newFee return { Promise < Transaction > } updateTransactionFee ( tx , newFee ) : Promise < Transaction > ; param { string [ ] } transactions return { Promise < Transaction > } sendBatchTransaction ( transactions ) : Promise < Transaction > ; param { ! string } rawTransaction return { Promise < string , InvalidProviderResponseError > } sendRawTransaction ( rawTransaction ) : Promise < string > ; }