新品发布:Cobo Agentic Wallet (CAW)—让Agent 拥有自主权,让用户掌握确定性

了解更多
close

Crypto Wallet API for Exchange-Style Deposit Sweeping: Endpoints and Task Flow

October 31, 2026

Blog
Developer & API Guides

用 Cobo API 构建安全的钱包与资产流程

探索 Cobo 提供的 API 与开发工具,支持钱包创建、交易流程、策略控制和数字资产运营等核心场景。

开发者友好的 API · 支持安全测试流程 · 可提供技术支持

An API integration for exchange-style sweeping has three jobs: create a deposit address per user, decide when funds move to a sweep-to address, and confirm what each sweep did. For the documented wallet-side automatic sweeping flow, start with a Cobo Custodial Asset Wallet. The auto-sweep API initially returns a task ID; transaction IDs appear after TransactionCreated. Verify the applicable wallet types for sweep-to address management before integrating it. What follows is the call sequence, task lifecycle, configuration comparison and test plan.

Configure the wallet, deposit addresses, webhook endpoint and sweep policy before the first sweep. MPC key generation and callback signing are separate configuration paths, not prerequisites for the Custodial Asset Wallet guide. Cobo’s Portal manual also documents MPC Organization-Controlled Wallet auto-sweeping when configured with a server signer.

  1. Wallet. Set up a Custodial Asset Wallet using Cobo’s Asset Wallets integration guide.

  2. Deposit addresses. Call Create addresses in wallet for each user and chain. Associate each issued address with the intended user and network.

  3. Webhook endpoint. Register an endpoint and subscribe to wallets.transaction.updated, which Cobo’s webhook event reference says covers every status change of a deposit.

  4. Auto sweeping. Configure sweeping and its destination for the supported wallet type; the Portal manual says auto-sweep-enabled MPC/Web3 wallets receive system-assigned sweep-to addresses, which can subsequently be changed.

  5. Fees. Ensure native gas is available at the source address or through a supported Billing Center/Auto Fueling configuration; see the Asset Wallet guide.

  6. Signing rules. If using a separate supported MPC configuration, test the TSS Node callback policy and sweep compatibility before enabling unattended approvals.

Cobo’s API treats the sweep-to address as a setting you can rotate, which matters when a destination needs to change. The Create sweep-to address operation issues a new address for a wallet, and the previous sweep-to address for the same token becomes invalid once the new one exists. Cobo’s reference names the cases for using it: a changed setup, a switch of networks, or a current address that is compromised or tainted by suspicious funds.

Balances left on the old sweep-to address can then be withdrawn to the new one or to another destination. The operation applies to MPC Wallet and Custodial Web3 Wallet configurations with auto-sweep enabled; that scope is not the same as the Custodial Asset Wallet integration guide. The Portal manual confirms these configurations do support auto-sweeping. On EVM chains one address serves all EVM networks, so List sweep-to addresses returns a single entry under Ethereum. If your configuration uses a callback whitelist, update and test it when changing destinations.

An auto-sweep task comes back from the Cobo API immediately, with its details filled in later, so the integration has to poll. The Create auto-sweep task operation takes a wallet ID, a token ID and an optional min_balance_threshold, and sweeps the full balance of that token to the configured sweep-to address.

Task state or troubleshooting observation

What the API returns

What your code does

Submitted

task_id, status Submitted, empty transaction_ids

Store the task ID and poll Get auto-sweep task details

TransactionCreated

transaction_ids for each sweep transaction

Match each ID to the ledger and follow it through webhooks

No transaction created / failed reason reported

Inspect failed_reasons, such as “exist pending transaction” or insufficient gas; “Blocked” is not a documented task status

Check actual task and transaction state; address the cause before retrying

Reaching a threshold alone does not complete a sweep when no gas is available, and Cobo’s Asset Wallets integration guide adds that sweeping is poll-based, so a short delay after a deposit is normal. For a task that does not create a transaction, inspect failed_reasons and the actual transaction state before retrying.

The Cobo references describe different wallet configurations. Use this table to avoid treating them as one guaranteed end-to-end setup.

API

How a sweep starts

How results come back

Destination

Gas for sweeps

Cobo Custodial Asset Wallet

Automatic sweeping documented in the Asset Wallet integration guide

Check task status, transaction IDs after TransactionCreated, and transaction webhooks

Configured destination

Confirm fee funding for the network and wallet

Auto-sweep-enabled MPC Organization-Controlled or Custodial Web3 Wallet

Portal manual documents the auto-sweep feature; sweep-to address API documents rotation

Inspect task and transaction status

Sweep-to address as configured

Verify gas funding and signing requirements

  • Consider Custodial Asset Wallets for the documented automatic sweeping flow.

  • If you require MPC signing or sweep-to rotation, verify that your actual wallet type and configuration support both before deployment.

Cobo’s development environment is separate from production, so every sweep path can be exercised before production. The development Portal is portal.dev.cobo.com and the API host is api.dev.cobo.com/v2. If testing the documented MPC Organization-Controlled Wallet auto-sweep configuration, set up a server signer in that environment. The six cases below are this article’s test plan.

  1. Deposit below the token minimum. Expect no transaction record, since Cobo’s transaction status flow skips deposits under the minimum.

  2. Deposit below min_balance_threshold. Expect the address to be skipped by the sweep.

  3. Sweep with no gas. Inspect failed_reasons and verify the actual task and transaction states before retrying.

  4. Second task while a sweep is pending. Expect “exist pending transaction” rather than a duplicate sweep.

  5. Sweep-to rotation (auto-sweep-enabled MPC/Web3 wallet only). Create a new sweep-to address, update any callback whitelist, and verify the next eligible sweep goes to it. Do not apply this test to a Custodial Asset Wallet without confirming API applicability.

  6. Signer offline (only where applicable). Confirm deposit processing and inspect the task status after restoring the signer; do not assume automatic retry.

Engineering teams can use the documented Custodial Asset Wallet auto-sweeping flow and follow task status through transaction creation. MPC Organization-Controlled and Custodial Web3 Wallet auto-sweeping is documented separately; confirm your exact wallet configuration, callback approvals and fee funding before deployment. For choosing the infrastructure itself, see the exchange-style deposit sweeping guide.

Can I trigger a manual sweep while an auto-sweep policy is on?

A Create auto-sweep task call submits a request for one token to the configured sweep-to address; it is asynchronous, so do not treat the call as an immediately completed sweep. If a sweep is pending, check task details and failed_reasons, including any pending-transaction reason, before retrying; keep the policy thresholds as the default path.

Which SDK languages does the Cobo sweeping API support?

The WaaS 2.0 API reference shows the auto-sweep calls in Python, JavaScript, Java and Go, using the same SDK as the rest of the wallet API. Start with the language your back end already uses, and point the SDK host at the development environment until the test plan above passes.

Do I need deposit sweeping on UTXO chains such as Bitcoin?

Sweeping matters most on account-based chains such as Ethereum and TRON, where each deposit address holds its own balance. For UTXO chains, check the supported address type and transaction-input limits of the wallet configuration you deploy.


Cobo provides technology infrastructure. Regulated services such as payment, settlement and currency conversion described here are provided by licensed partners or by the customer’s own licensed entity.

Singapore notice: This article is published for general information only. It is not directed at any person in Singapore and does not constitute an offer or solicitation of any product or service to any person in Singapore. Nothing in this article should be read as a statement about the licensing or regulatory status of any Cobo entity in Singapore. Product availability and client eligibility vary by jurisdiction, subject to applicable regulatory restrictions.

查看更多

查看收件箱获得最新区块链洞察

Secure your digital assets for free