import { FromInfo } from '@ckb-lumos/common-scripts'; import { Address, Transaction } from '@ckb-lumos/base'; import { BI, helpers, RPC } from '@ckb-lumos/lumos'; import { BIish } from '@ckb-lumos/bi'; import { SporeConfig } from '../config'; import { createCapacitySnapshot } from './capacity'; /** * Get minimal acceptable fee rate from RPC. */ export declare function getMinFeeRate(rpc: RPC | string): Promise; /** * Calculate transaction fee by transaction size and feeRate. */ export declare function calculateFee(size: number, feeRate: BIish): BI; /** * Calculate transaction fee by Transaction and a specific feeRate. */ export declare function calculateFeeByTransaction(tx: Transaction, feeRate: BIish): BI; /** * Calculate transaction fee by TransactionSkeleton and a specific feeRate. */ export declare function calculateFeeByTransactionSkeleton(txSkeleton: helpers.TransactionSkeletonType, feeRate: BIish): BI; /** * Pay fee by minimal acceptable fee rate from the RPC, * of pay fee by a manual fee rate. */ export declare function payFee(props: { txSkeleton: helpers.TransactionSkeletonType; fromInfos: FromInfo[]; config?: SporeConfig; feeRate?: BIish; enableDeductCapacity?: boolean; useLocktimeCellsFirst?: boolean; }): Promise; /** * Specify an output to pay transaction fee. */ export declare function payFeeByOutput(props: { txSkeleton: helpers.TransactionSkeletonType; outputIndex: number; feeRate?: BIish; config?: SporeConfig; }): Promise; /** * Inject needed amount of capacity, * and then pay fee by minimal acceptable fee rate or by a manual fee rate. */ export declare function injectCapacityAndPayFee(props: { txSkeleton: helpers.TransactionSkeletonType; fromInfos: FromInfo[]; config?: SporeConfig; feeRate?: BIish; fee?: BIish; changeAddress?: Address; enableDeductCapacity?: boolean; }): Promise<{ txSkeleton: helpers.TransactionSkeletonType; before: ReturnType; after: ReturnType; }>;