Consolidate unspents (advanced)
Build a transaction to consolidate unspents in a wallet. Once built, you must sign and sent the transaction. Consolidating unspents is only for UTXO-based assets.
Path Params
-
coinstring requiredA cryptocurrency or token ticker symbol. -
walletIdstring requiredThe wallet ID.
Body Params
object
-
feeRatestring or integerCustom fee rate (in base units) per kilobyte (or virtual kilobyte). For example, satoshis per kvByte.
If the
feeRateis less than the minimum required network fee, then the minimum fee applies. For example, 1000 sat/kvByte, a flat 1000 microAlgos, or a flat 10 drops of xrp. For XRP, the actual fee is usually 4.5 times the open ledger fee.Note: The
feeRateoverrides themaxFeeRateandminFeeRate. -
maxFeeRatestring or integer(BTC only) The maximum fee rate (in base units) per kilobyte (or virtual kilobyte). For example, satoshis per kvByte. The
maxFeeRatelimits the fee rate generated by bothfeeMultiplierandnumBlocks.Note: The
feeRateoverrides themaxFeeRate. -
maxFeePercentageintegerMaximum relative portion that can be spent towards fees -
feeTxConfirmTargetintegerBlock target for fee estimation -
bulkbooleanBuild multiple transactions at the same time. This enables you to increase the maximum number of unspents on thelimitparameter up to 2,000. If true, you must pass thetxFormataspsbtand you can't pass thetargetAddressornumUnspentsToMakeparameters. -
minValuestring or integerMinimum value of unspents to use in base units (e.g. satoshis). Can be used to skip very small unspents when consolidating at higher fee rates. For doge, only string is allowed. -
maxValuestring or integerMaximum value of unspents to use in base units (e.g. satoshis). Should be used to prevent larger unspents from being consolidated needlessly, and that some funds remain available for spending while the consolidation transactions are in flight. For doge, only string is allowed. -
minHeightintegerMinimum height of unspents on the block chain to use -
minConfirmsintegerMinimum confirmation threshold for external inputs -
enforceMinConfirmsForChangebooleanFlag for enforcing minConfirms for change inputs -
limitintegerMaximum number of unspents to use in the transaction -
numUnspentsToMakeintegerNumber of new unspents to make -
targetAddressstringaddress to use for generated outputs. Must be wallet address. -
txFormatstring enum[UTXO only] Format of the returned transaction hex serialization.legacyfor serialized transaction in custom bitcoinjs-lib format.psbtfor BIP174 serialized transactionlegacypsbtpsbt-lite
Responses
200
OK
Response Body
object
-
txHexstring -
txInfoobjecttxInfo (UTXO)txInfo object
-
changeAddressesarray of strings -
nOutputsintegerNumber of outputs -
nP2SHInputsinteger -
nSegwitInputsinteger -
unspentsarray of objectsunspents object
-
idstringThe id of the unspent in the form:<tx_index> -
addressstringThe address of this unspent -
valueinteger -
valueStringstring -
blockHeightintegerThe block this Unspent was created in -
datestring date-timeThe date this unspent was created -
coinbasebooleanTrue if this unspent came from the coinbase transaction -
walletstring -
fromWalletstring -
chainintegerThe type of this unspent's address (P2SH, P2WSH, etc...) -
indexintegerA monotonic counter used when creating new addresses -
redeemScriptstringThe Script program used to cryptographically verify spending this unspent -
witnessScriptstringThe segwit Script program used to cryptographically verify spending this unspent -
isSegwitboolean
-
-
walletAddressDetailsobjectwalletAddressDetails object
-
idstringplatform public id for an address -
addressstring -
chaininteger enum011011202130314041 -
indexinteger -
coinstring -
lastNonceinteger -
walletstringThe wallet which contains this address -
coinSpecificobjectProperties which are specific to certain coin typescoinSpecific object
-
xlmobjectxlm object
-
memoIdstringLatest memo id generated for the wallet -
rootAddressstringRoot address of the wallet
-
-
txlmobjecttxlm object
- Same shape as
AddressCoinSpecificXlm.
- Same shape as
-
-
balanceobjectBalance of the address. In case of Eth and Celo, if returnBalancesForToken is passed with includeBalances, then it will return token balance in the address object. This field will be present only whenincludeBalancesquery param is passed as true.balance object
-
updatedstring date-timeThe last time a transaction affected the balance of this address -
balanceintegerThe cleared balance of the address -
balanceStringstringString representation ofbalance. Guaranteed to not lose precision. -
totalReceivedintegerThe total amount received on this address (in the chain's base unit) -
totalSentintegerThe total amount send from this address (in the chain's base unit) -
confirmedBalanceStringstringThe total balance of confirmed transactions for the address (in the chain's base unit). Guaranteed to not lose precision. -
spendableBalanceStringstringThe total balance of the address (in the chain's base unit) which may be used as inputs for creating new transactions in string representation. Guaranteed to not lose precision.
-
-
labelstring nullableA human-readable label for the address. -
addressTypestring enump2shp2shP2wshp2wshp2trp2trMusig2
-
-
-
feeInfoobjectfeeInfo (UTXO)feeInfo object
-
sizeintegerEstimated size of the transaction in bytes -
feeintegerEstimated fee in base unit for the transaction -
feeRatestring or integerCustom minimum fee rate in a coin's base unit per kilobyte (or virtual kilobyte)--for example, satoshis per kvByte or microAlgos per kByte. If the appliedfeeRatedoes not meet a coin's required minimum transaction fee amount, the minimum is still applied (for example, 1000 sat/kvByte or a flat 1000 microAlgos). -
payGoFeeintegerBitGo fee of the transaction (in base units) -
payGoFeeStringintegerBitGo fee of the transaction (in base units) represented as a String
-
400
Bad Request
Response Body
ONE OF
-
errorstring requiredHuman-readable error message -
requestIdstring requiredClient request id -
contextobjectProperties that apply to a specific error name -
namestring requiredError code
-
errorstring requiredHuman-readable error message -
requestIdstring requiredClient request id -
contextobject requiredcontext object
-
idstring
-
-
namestring enum requiredError codeInvalidWalletId