Skip to content
PortunaPortunaPortunaDocsTestnet

Sweeps

A sweep moves a token or the native coin from a deposit address to a hot wallet. Sweeps of one hot wallet go on chain in batches.

GET/v1/sweeps

Your sweeps, newest first. The filters combine.

NameInTypeDescription
limitqueryintegerHow many rows a page holds. From 1 to 200. Default: 50.
cursorquerystringThe next_cursor of the previous page; none for the first page.
statusquerystringOnly sweeps with this status. One of: queued, processing, swept, failed, rejected.
chain_idqueryChainIDOnly this chain.
accountqueryAddressOnly sweeps from this deposit address.
hot_walletqueryAddressOnly sweeps to this hot wallet.
StatusDescription
200A page of sweeps. Returns the fields below.
400invalid_query: a query parameter is not valid; message says which.
401unauthorized: no API key, an unknown one or a revoked one.
403partner_disabled: your account is disabled.
FieldTypeDescription
items requiredarray of Sweep
next_cursor requiredNextCursorThe cursor of the next page; null on the last page.
Terminal window
curl "https://api-testnet.portuna.io/v1/sweeps?chain_id=11155111&status=swept&limit=1" \
-H "Authorization: Bearer $PORTUNA_API_KEY"
200 OK
{
"items": [
{
"id": "8a6e2f31-0c4b-4d7a-b1e5-92f3c6d8a047",
"external_id": "dep-80c2d4",
"chain_id": 11155111,
"hot_wallet": "0x2Cd50979a8A33e8CA37DA85F8517fb148a67b769",
"account": "0x2c7536E3605D9C16a7a3D7b1898e529396a65c23",
"token": "USDT",
"token_address": "0x5B74f75040584b133Ff1EB67eEe646B0da26e39C",
"status": "swept",
"attempts": 1,
"swept_amount": "250000000",
"tx_hash": "0xe2a3d8ffdcd7c4ed8a2389a59ce91622863c495d052a7571206bb494919dc35b",
"kind": "repeat",
"gas": 18078,
"gas_cost": "21693600000000",
"fee": "23358000000000",
"classic_gas": 53633,
"rate_bps": 7000,
"created_at": "2026-10-11T07:02:15Z",
"updated_at": "2026-10-11T07:03:02Z"
}
],
"next_cursor": "eyJ0IjoiMjAyNi0xMC0xMVQwNzowMjoxNVoiLCJpZCI6IjhhNmUyZjMxIn0"
}

POST/v1/sweeps

Sweeps a token or the native coin from a deposit address to a hot wallet. Sweeps of one hot wallet that have arrived by the time a batch is sent go in that one batch. Until the deposit address is delegated, the request carries its authorization. The outcome comes in a sweep.swept, sweep.failed or sweep.rejected webhook event and shows in GET /v1/sweeps/{id}.

FieldTypeDescription
external_idstringYour id for the sweep, unique in your account: a request with an external_id that is already taken returns that sweep instead of creating another, so retries are safe. Up to 128 characters.
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.
hot_wallet requiredAddressYour hot wallet on this chain; its delegate must be active.
account requiredAddressThe deposit address.
token requiredstringA token’s ticker listed on the chain (in any case), the contract address of a listed token, or native (or the native coin’s ticker) for the native coin.
amountAmountHow much to sweep, above zero; without it, the whole balance.
keep_one_unitbooleanLeave 1 smallest unit of the token on the deposit address; defaults to your settings. Ignored for the native coin.
authorizationAuthorizationNeeded until the deposit address is delegated to this hot wallet’s delegate. After that it is not used, though one that is sent must still be valid.
authorization.chain_id requiredinteger (int64)The chain of the request; 0 (any chain) is refused.
authorization.address requiredAddressThe hot wallet’s delegate from POST /v1/hot-wallets; the zero address for a revocation.
authorization.nonce requiredinteger (int64)The deposit address’s current nonce.
authorization.y_parity requiredintegerThe signature’s y parity. One of: 0, 1.
authorization.r requiredstringThe signature’s r, 0x-hex of up to 32 bytes. Format: ^0x[0-9a-fA-F]{1,64}$.
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 sweep with this external_id already exists. It is returned as it is now, and no other sweep is created. Returns Sweep.
202The sweep is queued. Returns Sweep.
400invalid_json: the body is not JSON, is over 64 KiB or has unknown fields.
401unauthorized: no API key, an unknown one or a revoked one.
403partner_disabled: your account is disabled.
409hot_wallet_not_active: the hot wallet’s delegate is still being deployed, or its deployment failed.
422unknown_chain, invalid_external_id, invalid_address, unknown_token, invalid_amount, unknown_hot_wallet (the hot wallet is not registered on this chain) or invalid_authorization; message says what is wrong.
Terminal window
curl -X POST "https://api-testnet.portuna.io/v1/sweeps" \
-H "Authorization: Bearer $PORTUNA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"external_id": "dep-7f3a91",
"chain_id": 11155111,
"hot_wallet": "0x2Cd50979a8A33e8CA37DA85F8517fb148a67b769",
"account": "0x2c7536E3605D9C16a7a3D7b1898e529396a65c23",
"token": "USDT",
"authorization": {
"chain_id": 11155111,
"address": "0xE60fdf70a794C76094f86b990a821D55e3096AA5",
"nonce": 0,
"y_parity": 0,
"r": "0x15fc7bd79ea3d30b5c40814f1c7ce35274d35ad96f9654d1379680d15cbba039",
"s": "0x7e9e601a6b0c3e554c8befe6ae019c344b115cf061994e9388787bd39e76bb83"
}
}'
202 Accepted
{
"id": "3d0c5d0e-6b7f-4a5e-9a51-3c8f0b2e7d14",
"external_id": "dep-7f3a91",
"chain_id": 11155111,
"hot_wallet": "0x2Cd50979a8A33e8CA37DA85F8517fb148a67b769",
"account": "0x2c7536E3605D9C16a7a3D7b1898e529396a65c23",
"token": "USDT",
"token_address": "0x5B74f75040584b133Ff1EB67eEe646B0da26e39C",
"status": "queued",
"attempts": 0,
"created_at": "2026-10-10T09:20:41Z",
"updated_at": "2026-10-10T09:20:41Z"
}

GET/v1/sweeps/{id}

NameInTypeDescription
id requiredpathstring (uuid)The sweep’s id.
StatusDescription
200The sweep. Returns Sweep.
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/sweeps/8a6e2f31-0c4b-4d7a-b1e5-92f3c6d8a047" \
-H "Authorization: Bearer $PORTUNA_API_KEY"
200 OK
{
"id": "8a6e2f31-0c4b-4d7a-b1e5-92f3c6d8a047",
"external_id": "dep-80c2d4",
"chain_id": 11155111,
"hot_wallet": "0x2Cd50979a8A33e8CA37DA85F8517fb148a67b769",
"account": "0x2c7536E3605D9C16a7a3D7b1898e529396a65c23",
"token": "USDT",
"token_address": "0x5B74f75040584b133Ff1EB67eEe646B0da26e39C",
"status": "swept",
"attempts": 1,
"swept_amount": "250000000",
"tx_hash": "0xe2a3d8ffdcd7c4ed8a2389a59ce91622863c495d052a7571206bb494919dc35b",
"kind": "repeat",
"gas": 18078,
"gas_cost": "21693600000000",
"fee": "23358000000000",
"classic_gas": 53633,
"rate_bps": 7000,
"created_at": "2026-10-11T07:02:15Z",
"updated_at": "2026-10-11T07:03:02Z"
}