UNPKG

@pgchain/blockchain-libs

Version:
43 lines (42 loc) 1.76 kB
import BigNumber from 'bignumber.js'; import { JsonRPCRequest } from '../../../basic/request/json-rpc'; import { CoinInfo } from '../../../types/chain'; import { AddressInfo, ClientInfo, FeePricePerUnit, PartialTokenInfo, TransactionStatus } from '../../../types/provider'; import { BaseClient } from '../../abc'; import { MmFee } from './mm-fee'; declare type EIP1559Price = { maxPriorityFeePerGas: BigNumber; maxFeePerGas: BigNumber; waitingBlock?: number; }; declare type EIP1559Fee = { baseFee: BigNumber; normal: EIP1559Price; others?: Array<EIP1559Price>; }; declare class Geth extends BaseClient { static readonly __LAST_BLOCK__ = "latest"; private _mmFee; readonly rpc: JsonRPCRequest; constructor(url: string); get mmFee(): MmFee; getInfo(): Promise<ClientInfo>; getAddresses(addresses: Array<string>): Promise<Array<AddressInfo | undefined>>; getBalances(requests: Array<{ address: string; coin: Partial<CoinInfo>; }>): Promise<Array<BigNumber | undefined>>; getTransactionStatuses(txids: Array<string>): Promise<Array<TransactionStatus | undefined>>; getTokenInfos(tokenAddresses: Array<string>): Promise<Array<PartialTokenInfo | undefined>>; getFeePricePerUnit(): Promise<FeePricePerUnit>; estimateEIP1559FeeStrategy(): Promise<EIP1559Fee>; estimateEIP1559Fee(): Promise<EIP1559Fee>; broadcastTransaction(rawTx: string): Promise<string>; estimateGasLimit(fromAddress: string, toAddress: string, value: string, data?: string): Promise<string>; isContract(address: string): Promise<boolean>; batchEthCall(calls: Array<{ to: string; data: string; }>): Promise<Array<string>>; } export { Geth, EIP1559Price, EIP1559Fee };