Propose a sweep, or a change to one
const url = 'https://api.sotirea.com/v1/sweeps';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"asset":"example","chain_id":"example","destination_vault_id":1,"fee_ceiling":"example","min_amount":"example","source_vault_ids":[1]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.sotirea.com/v1/sweeps \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "asset": "example", "chain_id": "example", "destination_vault_id": 1, "fee_ceiling": "example", "min_amount": "example", "source_vault_ids": [ 1 ] }'A sweep moves money, so it takes effect once a person who manages sweeps confirms it in the console; an API key never confirms. Nobody who has held this key’s secret may confirm it, and where nobody else could, the proposal is refused (403, fields.rule four_eyes). A proposal for a network and asset that already has a sweep is a change to it; one proposal waits at a time (409).
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
Native, the default, or a token’s contract.
The network, like eip155:1.
One of your own vaults on the network: sweeps go into it.
The most one sweep may cost in network fees, in the network coin’s smallest unit. GET /v1/sweeps/fee says what one costs now.
The least a vault must hold free before it is swept, in the asset’s smallest unit.
The vaults to sweep; leave it out for every vault opened with a reference, including those opened later.
Example generated
{ "asset": "example", "chain_id": "example", "destination_vault_id": 1, "fee_ceiling": "example", "min_amount": "example", "source_vault_ids": [ 1 ]}Responses
Section titled “Responses”Done.
object
object
Native, or a token’s contract.
The network’s coin, which pays the fees.
The asset’s decimals; absent for a token whose contract has not been read.
Whether it sweeps every vault opened with a reference: each customer’s deposit vault, including those opened later.
The most one sweep may cost in network fees, in the network coin’s smallest unit.
object
What happened, vault by vault, in words.
Swept; nothing (no vault held the minimum); skipped (every sweep worth making was held back: the fee above the ceiling, or the gas pool unable to pay); or failed.
When the current run of skips began. After a day, the people who manage sweeps are emailed once.
The least a vault must hold free before it is swept, in the asset’s smallest unit.
The person’s name, or the API key’s when a key proposed it.
Whether an API key proposed it. Nobody who has held that key’s secret may confirm it.
The rule a proposal changes or retires.
A proposal to stop the rule it replaces.
Confirmed by its proposer alone, because nobody else in your organisation manages sweeps.
The vaults it sweeps when it names them; empty when it sweeps every vault opened with a reference. Never the destination.
object
Active, proposed (waiting for a second person), declined or retired.
object
Quote it when asking about a request; it is in the X-Request-Id header too.
Example
{ "success": true}default
Section titled “default”Refused or failed, in words a person can act on.
object
object
object
object
Quote it when asking about a request.
Example
{ "success": false}