Skip to content

Request access

Tell us about your processing, and we'll reply by email.

API reference

Sweep lists

POST/v1/sweep-lists

Sweeps in one transaction of their own: up to the chain’s batch size (50 on Ethereum, 200 on BSC), tokens and hot wallets mixed. No other sweep joins the list’s transaction, and none of its items goes in another. Every item needs an external_id. When your gas wallet on the chain is free and nothing of yours is due before the list, the request sends the transaction itself and answers with it, within wait seconds, 10 unless you say otherwise; set your HTTP client’s timeout to 60 seconds. Otherwise the list waits its turn: after the sweeps you requested before it and before those you request after it. Its transaction comes in transaction.sent, whose transaction has the list’s list_id, and its outcome in transaction.mined.

Before sending, each item is checked as a sweep is. One that fails is rejected at once, with its own sweep.rejected, and is not checked again: to try it again, ask with a new external_id. The others go together. A list whose transaction reverts or is dropped goes back to the queue whole and goes again in a transaction of its own. Each list is a transaction of its own, and your gas wallet has one in flight per chain at a time: many small lists go slower than the same sweeps requested one by one, which share batches.

FieldTypeDescription
chain_id requiredChainIDThe chain’s id (EIP-155): 11155111 Sepolia and 97 BSC testnet with a test key, 1 Ethereum and 56 BSC with a live key.
waitintegerHow many seconds the request may wait for the list to be sent, to answer with its transaction; 0 answers at once. Portuna may wait less on a chain. The answer comes within wait of the checks of the request. From 0 to 55. Default: 10.
items requiredarray of SweepListItemRequestThe sweeps, up to the chain’s batch size, in the order of the list.
items[].external_id requiredstringYour id for the sweep, unique in your account. A request with the same set of external_id on the same chain returns that list. An item rejected burns its external_id: to try it again, use a new one. Up to 128 characters.
items[].hot_wallet requiredAddressYour hot wallet on this chain, where the funds go. A delegate that holds it must be active.
items[].account requiredAddressThe deposit address.
items[].token requiredstringA token’s ticker listed on the chain (in any case), the contract address of a listed token or of a token you enabled (POST /v1/tokens), or native (or the native coin’s ticker) for the native coin. The token must be active in GET /v1/tokens.
items[].amountAmountHow much to sweep, above zero; without it, the whole balance.
items[].keep_one_unitbooleanLeave 1 smallest unit of the token on the deposit address; defaults to your settings. Ignored for the native coin.
items[].authorizationAuthorizationNeeded until the deposit address is delegated to a deployed delegate that holds hot_wallet. After that it is not used, though one that is sent must still be valid. One for another delegate of yours that holds the hot wallet moves the deposit address to that delegate.
items[].authorization.chain_id requiredinteger (int64)The chain of the request; 0 (any chain) is refused.
items[].authorization.address requiredAddressA deployed delegate that holds the sweep’s hot wallet: the hot wallet’s own from POST /v1/hot-wallets, or one of a set from POST /v1/delegates. The zero address for a revocation.
items[].authorization.nonce requiredinteger (int64)The deposit address’s current nonce.
items[].authorization.y_parity requiredintegerThe signature’s y parity. One of: 0, 1.
items[].authorization.r requiredstringThe signature’s r, 0x-hex of up to 32 bytes. Format: ^0x[0-9a-fA-F]{1,64}$.
items[].authorization.s requiredstringThe signature’s s, 0x-hex of up to 32 bytes, in the lower half of the curve order (EIP-2). Format: ^0x[0-9a-fA-F]{1,64}$.
StatusDescription
200A list with the same chain_id and the same set of external_id, in any order, already exists. It is returned as it is now; this request sends nothing. A repeat is answered before the other checks of the request: it gets its list even if lists were turned off on the chain since, or its wait is not valid. The rate limit counts repeats too, and the body must still be valid JSON. Returns SweepList.
202The list is created. Its status says how far it went within wait: sent, with its transaction; done when every item was rejected; queued or processing, without a transaction yet, which then comes in transaction.sent. Returns SweepList.
400invalid_json: the body is not JSON, is over 256 KiB or has unknown fields.
401unauthorized: no API key, an unknown one or a revoked one.
403partner_disabled: your account is disabled.
404not_found: sweep lists are not available on this chain yet.
409external_id_conflict: some external_id of the list belong to other sweeps: sweeps requested alone, another list’s items, or a list on another chain or with other items. details.items has each of them: its index in the request, external_id, the sweep_id and list_id that have it, and its status. Nothing is created. Leave out the items that are already your sweeps of the same deposits and send the rest as a new list; to try again an item that ended rejected or failed, give it a new external_id. invalid_items when the problem of every invalid item is hot_wallet_not_active, as for a sweep.
422unknown_chain; invalid_wait; invalid_items_count: none, or more than the chain’s batch size, details.max; invalid_items: details.items has each invalid item’s index, code and message, with the codes of POST /v1/sweeps and duplicate_external_id; nothing is created. gas_limit_exceeded: the list needs more gas than one transaction may use, by an estimate made without asking the chain; details.max_items is how many of its first items fit, with estimated_gas and max_gas: split the list there.
429rate_limited: too many requests for lists on your account; too_many_lists: 10 of your lists are open on the chain, queued or on their way. Try again after the seconds of Retry-After.
Terminal window
curl -X POST "https://api-testnet.portuna.io/v1/sweep-lists" \
-H "Authorization: Bearer $PORTUNA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"chain_id": 97,
"wait": 10,
"items": [
{
"external_id": "dep-91a2",
"hot_wallet": "0x2Cd50979a8A33e8CA37DA85F8517fb148a67b769",
"account": "0x2c7536E3605D9C16a7a3D7b1898e529396a65c23",
"token": "USDT"
},
{
"external_id": "dep-91a3",
"hot_wallet": "0x589AdAfeCeb2CDD89fEFC9c37818511239Ed01ce",
"account": "0x7f1D2c3B4a5E6d7C8b9A0f1e2D3c4B5a6978e0F1",
"token": "native"
}
]
}'
202 Accepted
{
"id": "4f0c2a7e-1b3d-4e5f-8a6b-9c0d1e2f3a4b",
"chain_id": 97,
"status": "sent",
"transaction": {
"id": 48517,
"chain_id": 97,
"kind": "sweep",
"status": "pending",
"hash": "0x5d2e8b0f6a4f1e9d3c7b2a1908f7e6d5c4b3a291807f6e5d4c3b2a1908f7e6d5",
"block_number": null,
"hot_wallets": [
"0x2Cd50979a8A33e8CA37DA85F8517fb148a67b769"
],
"sweeps": {
"total": 1,
"processing": 1,
"swept": 0,
"failed": 0,
"requeued": 0
},
"revocations": null,
"gas_used": null,
"gas_cost": null,
"fees": null,
"created_at": "2026-10-27T09:14:02Z",
"mined_at": null,
"list_id": "4f0c2a7e-1b3d-4e5f-8a6b-9c0d1e2f3a4b"
},
"items": [
{
"id": "9a1e5c3b-2d4f-4a60-8b17-6c5d4e3f2a10",
"external_id": "dep-91a2",
"status": "processing"
},
{
"id": "77b0d2e4-6f81-4c3a-9d25-1e0f2a3b4c5d",
"external_id": "dep-91a3",
"status": "rejected",
"reason": "nothing_to_sweep"
}
],
"created_at": "2026-10-27T09:14:01Z"
}

GET/v1/sweep-lists/{id}

NameInTypeDescription
id requiredpathstring (uuid)The list’s id.
StatusDescription
200The list. Returns SweepList.
401unauthorized: no API key, an unknown one or a revoked one.
403partner_disabled: your account is disabled.
404not_found: there is no such object in your account.
Terminal window
curl "https://api-testnet.portuna.io/v1/sweep-lists/4f0c2a7e-1b3d-4e5f-8a6b-9c0d1e2f3a4b" \
-H "Authorization: Bearer $PORTUNA_API_KEY"
200 OK
{
"id": "4f0c2a7e-1b3d-4e5f-8a6b-9c0d1e2f3a4b",
"chain_id": 97,
"status": "done",
"transaction": {
"id": 48517,
"chain_id": 97,
"kind": "sweep",
"status": "mined",
"hash": "0x5d2e8b0f6a4f1e9d3c7b2a1908f7e6d5c4b3a291807f6e5d4c3b2a1908f7e6d5",
"block_number": 63021877,
"hot_wallets": [
"0x2Cd50979a8A33e8CA37DA85F8517fb148a67b769"
],
"sweeps": {
"total": 1,
"processing": 0,
"swept": 1,
"failed": 0,
"requeued": 0
},
"revocations": null,
"gas_used": 61847,
"gas_cost": "6184700000000",
"fees": "0",
"created_at": "2026-10-27T09:14:02Z",
"mined_at": "2026-10-27T09:14:10Z",
"list_id": "4f0c2a7e-1b3d-4e5f-8a6b-9c0d1e2f3a4b"
},
"items": [
{
"id": "9a1e5c3b-2d4f-4a60-8b17-6c5d4e3f2a10",
"external_id": "dep-91a2",
"status": "swept"
},
{
"id": "77b0d2e4-6f81-4c3a-9d25-1e0f2a3b4c5d",
"external_id": "dep-91a3",
"status": "rejected",
"reason": "nothing_to_sweep"
}
],
"created_at": "2026-10-27T09:14:01Z"
}