Consolidate account (simple)

post/api/v2/{coin}/wallet/{walletId}/consolidateAccount

Build, sign, and send a consolidation transaction for an account-based asset all in 1 call. For account-based assets, consolidating the balances in the receive addresses to the base address maximizes the spendable balance of a wallet.

Path Parameters

  • coinstringRequired
    A cryptocurrency or token ticker symbol.
    Example: "btc"
  • walletIdstringRequired
    Example: "59cd72485007a239fb00282ed480da1f"
    Pattern: ^[0-9a-f]{32}$

Request Body

consolidateAddresses array[string]
Optional: restrict the consolidation to the specified receive addresses. If not provided, will consolidate the funds from all receive addresses up to 500 addresses.
walletPassphrase string
Passphrase to decrypt the user key on the wallet. Required if External Signer is not used to sign the transactions.
prv string
The un-encrypted user private key in string form. If the key is a JSON object it must be stringified. Required if "walletPassphrase" is not available or encrypted private key is not stored by BitGo.
apiVersion string
The Trasaction Request API version to use for MPC EdDSA Hot Wallets. Defaults based on the wallet type and asset curve.
Allowed values: full lite
javascript
1 2 3 4 5 6 7 8 9 10 let params = { consolidateAddresses: [ 'BVMEUTF37WNEQ6GYCZISRFHGLEMOKT5OCPPTTJXVED6JBSXKF6YJJRZRI4', '7ITFVRNTLUHLD4F2PIIYXXIQOAJAPRGMA7JHSN3SFH2BACLK7WM6CHT524', ], }; wallet.consolidateAccount(params).then(function (transactions) { // print generated transactions for signing console.dir(transaction); });

200 Response

successrequired
txRequestId string required
A unique ID for the TxRequest document across all wallets. The combination of the txRequestId and version will always be unique.
version number required
The version of the document. Data changes are done only with inserts and incrementing the version.
latest boolean required
A boolean flag that indicates whether the document is the latest version of the TxRequest.
walletId string required
The id of the Wallet the TxRequest is for.
walletType string
The type describes who owns the keys to the wallet associated to the TxRequest.
Allowed values: cold custodial custodialPaired hot trading distributedCustody
enterpriseId string
If the wallet that owns the TxRequest is owned by an enterprise then this is the Id of said enterprise.
state string required
Allowed values: initialized pendingApproval pendingUserCommitment pendingUserRShare pendingUserGShare readyToSend pendingUserSignature pendingDelivery signed delivered canceled rejected failed
date string <date-time>required
The date and time this version of the TxRequest document was created.
Example: {}
createdDate string <date-time>required
The date and time the version 1 TxRequest document was created.
Example: {}
userId string required
The Id of the User that produced this version of the TxRequest document. Could have created a new document or updated an existing document.
initiatedBy string
The Id of the User that originally created the TxRequest document (initiated the TxRequest).
updatedBy string required
The Id of the User that last updated the TxRequest document. This is an alias for the userId field.
intentAny ofrequired
intentsrequired
pendingApprovalId string
The id of the Pending Approval that was created for the TxRequest if one was required.
isCanceled boolean
True, if the transaction request is canceled.
unsignedTxs array[object]
Holds all unsigned transactions that will be used to fulfill the TxRequest for TSS wallets.
signatureShares array[object]
Only used for TSS coins. This is used to collect signature shares from and exchange them with the user.
commitmentShares array[object]
Only used for TSS coins on EdDSA curve. This is used to collect commitment shares from and exchange them with the user.
txHashes array[string]
The hashes of all transactions from the TxRequest that have been signed and are pending broadcast.
failure array[string] required
An Array of Error messages.

400 Response

One of
error string required
Human-readable error message
requestId string required
Client request id
context object
Properties that apply to a specific error name
name string required
Error code