import LotusRpcEngine, { LotusRpcEngineConfig } from '@glif/filecoin-rpc-client'; import { FilecoinNumber } from '@glif/filecoin-number'; import { LotusMessage, Message, SignedLotusMessage } from '@glif/filecoin-message'; import { WalletSubProvider } from './wallet-sub-provider'; import { CID } from './types'; export declare class Filecoin { wallet: WalletSubProvider; jsonRpcEngine: LotusRpcEngine; constructor(provider: WalletSubProvider, config?: LotusRpcEngineConfig); getBalance: (address: string) => Promise; simulateMessage: (message: LotusMessage) => Promise; sendMessage: (signedLotusMessage: SignedLotusMessage) => Promise; getNonce: (address: string) => Promise; cloneMsgWOnChainFromAddr: (message: LotusMessage) => Promise; gasEstimateFeeCap: (message: LotusMessage) => Promise; gasEstimateGasLimit: (message: LotusMessage) => Promise; gasEstimateGasPremium: (message: LotusMessage, numBlocksIncluded?: number) => Promise; gasEstimateMessageGas: (message: LotusMessage, maxFee?: string) => Promise; gasEstimateMaxFee: (message: LotusMessage) => Promise<{ maxFee: FilecoinNumber; message: LotusMessage; }>; /** * formula (some of these variable names might not be the best...): * (GasUsed+GasToBurn)*min(BaseFee, FeeCap)+GasLimit*max(0, min(FeeCap-BaseFee, GasPremium))) * * minBaseFeeFeeCap = min(BaseFee, FeeCap) * totalGas = GasUsed+GasToBurn * leftSide = totalGas*minBaseFeeFeeCap * * minTip = min(FeeCap-BaseFee, GasPremium) * rightSide = gasLimit*max(0, minTip) * * paidByMessageSender = * leftSide + rightSide */ gasCalcTxFee: (gasFeeCap: string, gasPremium: string, gasLimit: number, baseFee: string, gasUsed: string) => Promise; getReplaceMessageGasParams: (message: LotusMessage, maxFee?: string) => Promise<{ gasFeeCap: string; gasPremium: string; gasLimit: number; }>; /** * Used for calculating the minimum boost in gas params to replace a message * (1.25x prev gasPremium, bump fee cap as needed) */ getReplaceMessageMinGasParams: (message: LotusMessage) => Promise<{ gasFeeCap: string; gasPremium: string; gasLimit: number; }>; } //# sourceMappingURL=filecoin.d.ts.map