AbstractThe options for collecting capacity.
The context for collecting capacity.
The options for completing the fee.
Creates an instance of FeePayer.
The client used to interact with the CKB network.
AbstractcollectCollects capacity for the transaction.
The transaction to collect capacity for.
OptionalcapacityTweak: NumLikeOptional additional capacity needed.
Optionaloptions: CollectCapacityOptionsOptional configuration for collecting capacity.
Optionalcontext: CollectCapacityContextOptional context for collecting capacity.
A promise that resolves to the result of collecting capacity, including the total capacity collected from added inputs.
This method should attempt to collect sufficient capacity to meet the requirement (outputs capacity plus capacityTweak).
If the requirement cannot be fully met, it should still add as many inputs as possible to minimize the deficit and MUST NOT throw an error.
This behavior enables multiple fee payers to collaborate in providing the necessary capacity.
AbstractcompleteCompletes the transaction fee by adding a change output to a recommended address.
The transaction to complete the fee for.
Optionaloptions: CompleteFeeOptionsOptional configuration for completing the fee.
A promise that resolves to the transaction with the fee paid, whether it was modified, and the operation context.
Prepares a transaction before signing. This method can be overridden by subclasses to perform any necessary steps, such as adding cell dependencies or witnesses, before the transaction is signed. The default implementation converts the TransactionLike object to a Transaction object without modification.
The transaction to prepare.
A promise that resolves to the prepared Transaction object.
Note that this default implementation does not add any cell dependencies or dummy witnesses.
This may lead to an underestimation of transaction size and fees if used with methods
like Transaction.completeFee. Subclasses for signers that are intended to sign
transactions should override this method to perform necessary preparations.
Gets the fee rate for the transaction.
Optionaloptions: FeePayerGetFeeRateOptionsLikeOptional configuration for getting the fee rate.
A promise that resolves to the fee rate.
Completes the transaction fee by applying a custom change function.
The transaction to complete the fee for.
A function that modifies the transaction to handle the change.
Optionaloptions: CompleteFeeOptionsA promise that resolves to the transaction with the fee paid, whether it was modified, and the operation context.
Completes the transaction fee by adding inputs and creating a change output with the specified lock script. This is a convenience method that automatically creates a change cell with the provided lock script when there's excess capacity after paying the transaction fee.
The transaction to complete the fee for.
The lock script for the change output cell.
Optionaloptions: CompleteFeeOptionsOptional configuration for completing the fee.
A promise that resolves to the transaction with the fee paid, whether it was modified, and the operation context.
Completes the transaction fee by adding excess capacity to an existing output. Instead of creating a new change output, this method adds any excess capacity to the specified existing output in the transaction.
The transaction to complete the fee for.
The index of the existing output to add excess capacity to.
Optionaloptions: CompleteFeeOptionsOptional configuration for completing the fee.
A promise that resolves to the transaction with the fee paid, whether it was modified, and the operation context.
An abstract class representing a fee payer. This class provides methods to complete transaction inputs and fees.