import BigNumber from 'bignumber.js'; import { Models } from '@open-rights-exchange/chain-js'; import { BN, BNLike } from 'ethereumjs-util'; import { EthereumKeyPair } from './cryptoModels'; /** Category of chain functions - useful in error mapping */ export declare enum ChainFunctionCategory { Block = "Block", ChainState = "ChainState", Contract = "Contract", Transaction = "Transaction" } export declare enum EthereumBlockType { Earliest = "earliest", Genesis = "genesis", Latest = "latest", Pending = "pending" } /** Chain configuation for creating a new chain connection and sending transaction */ export type EthereumChainSettings = { chainForkType?: EthereumChainForkType; communicationSettings?: Models.ChainSettingsCommunicationSettings; defaultTransactionSettings: { executionPriority: Models.TxExecutionPriority; maxFeeIncreasePercentage?: number; }; ethereumTokenEquivalenceMapping?: any; }; export type EthereumChainForkType = { chainName: string; hardFork: string; }; export type EthereumChainInfo = { headBlockNumber: number; headBlockTime: Date; version: string; nativeInfo: EthereumNativeChainInfo; }; export type EthereumNativeChainInfo = { chainId: number; gasLimit: number; gasUsed: number; /** current chain gas price in Wei */ currentGasPrice: string; }; /** Chain urls and related details used to connect to chain */ export type EthereumChainEndpoint = { /** api endpoint url - including http(s):// prefix */ url: string; /** Options are same as defined in web3-core-helpers.HttpProviderOptions - https://github.com/ethereum/web3.js/tree/1.x/packages/web3-providers-http#usage * Except: Headers are provided here as {'headerName':'headerValue'} and mapped to EthereumHttpHeader format {name:string, value:string} */ options?: { keepAlive?: boolean; timeout?: number; /** Array of headers to be included in HTTP requests to chain endpoint * e.g. options.headers = [{"Authorization":"Bearer..."}] */ headers?: [{ [key: string]: string; }]; withCredentials?: boolean; /** Type HttpAgent - from web3-core-helpers */ agent?: any; }; /** between 0 and 1 - 0 is not responding, 1 is very fast */ health?: number; }; export type EthereumChainSettingsCommunicationSettings = { blocksToCheck?: number; checkInterval?: number; getBlockAttempts?: number; }; export type EthereumBlockNumber = string | number | BN | BigNumber | EthereumBlockType; export type EthereumDate = string & Models.ChainDateBrand; export type EthereumEntityName = string & Models.ChainEntityNameBrand; export type EthereumSymbol = string & Models.ChainSymbolBrand; export type EthereumGeneratedKeys = EthereumKeyPair; export type EthereumNewKeysOptions = { password: string; encryptionOptions?: Models.ModelsCryptoAes.AesEncryptionOptions; }; export type EthereumString = { string: string; }; export type EthereumMultiValue = BNLike; /** Ethereum value units */ export declare enum EthUnit { Noether = "noether", Wei = "wei", Kwei = "kwei", femtoether = "femtoether", Lovelace = "lovelace", Mwei = "mwei", Babbage = "babbage", Picoether = "picoether", Qwei = "gwei", Gwei = "Gwei", Shannon = "shannon", Nanoether = "nanoether", Nano = "nano", Szabo = "szabo", Microether = "microether", Micro = "micro", Finney = "finney", Milliether = "milliether", Milli = "milli", Ether = "ether", Kether = "kether", Grand = "grand", Mether = "mether", Gether = "gether", Thether = "tether" } /** a map between alternate formats of a unit string and supported unit string */ export declare const AlternateUnitMap: { from: string; to: string; }[]; export declare const EthereumJSCommonChains: { Mainnet: string; MainnetId: number; Ropsten: string; RopstenId: number; Rinkeby: string; RinkebyId: number; Kovan: string; KovanId: number; Goerli: string; GoerliId: number; Sepolia: string; SepoliaId: number; };