참고: 이 페이지는 아직 한국어로 번역되지 않았습니다. 아래는 영어 원문입니다.The FewestCoinSelector class provides a coin selection algorithm that selects the fewest UTXOs required to meet the target amount. This algorithm is useful for minimizing the size of the transaction and the fees associated with it. This class is a sub-class of AbstractCoinSelector | AbstractCoinSelector and implements the AbstractCoinSelector.performSelection | performSelection method to provide the actual coin selection logic.
Extends
AbstractCoinSelector
Constructors
new FewestCoinSelector()
Parameters
Parameter | Type | Default value |
---|---|---|
availableUTXOs | UTXO [] | [] |
Returns
FewestCoinSelector
Inherited from
AbstractCoinSelector.constructor
Source
transaction/abstract-coinselector.ts:61Methods
decreaseFee()
Parameters
Parameter | Type | Description |
---|---|---|
feeReduction | bigint | The amount by which the fee has decreased. |
Returns
SelectedCoinsResult
Source
transaction/coinselector-fewest.ts:280increaseFee()
Parameters
Parameter | Type | Description |
---|---|---|
additionalFeeNeeded | bigint | The additional fee needed. |
Returns
SelectedCoinsResult
Returns true if successful, false if insufficient funds.
Source
transaction/coinselector-fewest.ts:226performSelection()
Parameters
Parameter | Type |
---|---|
config | CoinSelectionConfig |
Returns
SelectedCoinsResult
The selected UTXOs and outputs.
Overrides
AbstractCoinSelector.performSelection