Consolidate wallet assets

The Consolidate Transaction feature enables you to sweep or consolidate funds from all input addresses into a designated destination wallet.

You can customize the consolidation process by setting up the consolidation rule. For more information, refer to Set up a Smart Consolidation Rule. If you don't set up the Smart Consolidation Rule, this API will default to the standard rule parameters established by Liminal.

You can consolidate native coins and tokens from addresses. The API supports both UTXO and non-UTXO chains. The following table lists all UTXO chains and non-UTXO chains supported by the API.

UTXO chainsNon-UTXO chains
Bitcoin (BTC)Ethereum
Bitcoin CashPolygon (Matic)
LitecoinSolana
DogecoinCardano
BSVBinance Smart Chain
BEP2
KLAYTN
Tron
COSMOSHUB-4 (Cosmos)
XINFIN
Ripple (XRP)
Tezos (XTZ)

Prerequisites

  • Ensure that the target address is whitelisted. To whitelist an address, see Whitelist a wallet address.
  • Ensure that you have configured your Gas Station. For more information, refer to Gas Station.

API use cases

You can perform the following operations with the API.

Consolidate addresses with native coins from a UTXO wallet

  • Consolidate all addresses from a UTXO-chain wallet: Consolidate native coins from multiple input addresses of a UTXO-chain wallet into the destination wallet. Make sure to add the sequenceId parameter in the API request body. This parameter is the unique identifier (ID) of the transaction, essential for transaction execution and tracking.
  • Consolidate a single address from a UTXO-chain wallet: You can consolidate native coins from a single address of a UTXO-chain wallet into the destination wallet. Make sure to add the fromAddress parameter in the API request body. This parameter specifies the exact customer deposit address from which the funds will be consolidated.

Consolidate addresses with native coins from a non-UTXO wallet

  • Consolidate all addresses from a non-UTXO chain wallet: You can consolidate native coins from a bulk of customer deposit wallet addresses of a non-UTXO chain wallet into the destination wallet.
  • Consolidate a single address from a non-UTXO chain wallet: You can consolidate native coins from a single address of a non-UTXO chain wallet into the destination wallet. Make sure to add the fromAddress parameter in the API request body. This parameter specifies the exact customer deposit address from which the funds will be consolidated.

Consolidate addresses with tokens

  • Consolidate all addresses from a non-UTXO chain wallet: You can consolidate tokens from a bulk of customer deposit wallet addresses of a non-UTXO chain wallet into the destination wallet. Make sure to add the following parameters within the wallet object.
ParameterDescriptionExample value
allTokenThis indicates whether the request body should have data for all subtokens (i.e. ERC20 Tokens, TRC20 Tokens, BEP20 Tokens etc.) or not. This field is only applicable to the protocols that have token support. Set this value to "true" to include all tokens. (Optional)true
tokenNameEnter the abbreviated form of the token name.eth
tokenAddressEnter the address associated with the token.0xdc31Ee1784292379Fbb2964b3B9C4124D8F89C60

The API request body including the above parameters will look like the following:

{
    "wallet":{
        "coin": "eth",
        "walletId":1,
        "allToken":true,
        "tokenOptions":{
                "tokenName":"dai",
                "tokenAddress":"0xdc31Ee1784292379Fbb2964b3B9C4124D8F89C60"
            }
    },
    "transactions":{
       "consolidateOptions":{
                "targetAddress":"0x7f17be241f88530da74f035e8b74125ffedea98d",
                "fromAddress":"0x92BFFd4DC976c7781DE152DcE439a7C57740CE04"
            }
    }
}

  • Consolidate all addresses with different tokens: You can consolidate all types of tokens from a bulk of customer deposit wallet addresses of a non-UTXO chain wallet into the destination wallet. Make sure to add the allAssets parameter in the API request body, which allows you to consolidate all assets in a wallet simultaneously.

API error responses

The following tables describe the types of error responses returned by this API.

Payload validation errors

Error TypeHTTP Status codeExample ResponseProperty
address not whitelisted500{
""success"": false,
""data"": {},
""message"": ""address is not whitelisted"",
""code"": """"
}
transactions.consolidateOptions.targetAddress
Null or empty400{
""success"": false,
""data"": {
""errors"": [
{
""msg"": ""wallet id is required"",
""param"": ""wallet.walletId"",
""location"": ""body""
},
{
""msg"": ""wallet id should be positive number"",
""param"": ""wallet.walletId"",
""location"": ""body""
}
]
},
""message"": null
}
wallet.walletId
invalid404{
""success"": false,
""data"": {},
""message"": ""Wallet not found"",
""code"": """"
}
wallet.walletId
Null or empty500{
""success"": false,
""data"": {
""errors"": [
{
""msg"": ""coin is required"",
""param"": ""wallet.coin"",
""location"": ""body""
}
]
},
""message"": null
}
wallet.coin
invalid500{
""success"": false,
""data"": {},
""message"": ""Invalid Coin"",
""code"": """"
}
wallet.coin
Null or empty500{
""success"": false,
""data"": {},
""message"": ""Target address is required for consolidation"",
""code"": """"
}
transactions.consolidateOptions.targetAddress
unsupported chains500{
""success"": false,
""data"": {},
""message"": ""{""chain"":""Supported to UTXO,EVM,DOT,SOL,CARDANO, NEAR, ALGORAND and TRON chains Only.""}"",
""code"": """"
}
unsupported chains (xrp etc)

Payload authorization errors

Error TypeHTTP Status CodeExample ResponseProperty
Null / empty / Invalid401{
""success"": false,
""data"": {},
""message"": ""UnAuthorized Access"",
""code"": """"
}
Invalid auth Credentials
Null / empty / Invalid401{
""success"": false,
""data"": {},
""message"": ""UnAuthorized Access"",
""code"": """"
}
client_id
Null / empty / Invalid401{
""success"": false,
""data"": {},
""message"": ""UnAuthorized Access"",
""code"": """"
}
client_secret
Language
Authorization
Basic
base64
:
Click Try It! to start a request and see the response here!