Skip to content

Propose a sweep, or a change to one

POST
/v1/sweeps
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).

Media typeapplication/json
object
asset

Native, the default, or a token’s contract.

string
chain_id
required

The network, like eip155:1.

string
destination_vault_id
required

One of your own vaults on the network: sweeps go into it.

integer
fee_ceiling
required

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.

string
min_amount
required

The least a vault must hold free before it is swept, in the asset’s smallest unit.

string
source_vault_ids

The vaults to sweep; leave it out for every vault opened with a reference, including those opened later.

Array<integer>

Example generated

{
"asset": "example",
"chain_id": "example",
"destination_vault_id": 1,
"fee_ceiling": "example",
"min_amount": "example",
"source_vault_ids": [
1
]
}

Done.

Media typeapplication/json
object
data
required
object
asset
required

Native, or a token’s contract.

string
chain_id
required
string
chain_name
required
string
coin_decimals
required
integer
coin_symbol
required

The network’s coin, which pays the fees.

string
decided_at
required
Any of:
string format: date-time
decided_by
string
decimals

The asset’s decimals; absent for a token whose contract has not been read.

integer
destination_vault_id
required
integer
destination_vault_name
required
string
every_referenced_vault
required

Whether it sweeps every vault opened with a reference: each customer’s deposit vault, including those opened later.

boolean
fee_ceiling
required

The most one sweep may cost in network fees, in the network coin’s smallest unit.

string
id
required
integer
last_run
required
Any of:
object
at
required
string format: date-time
detail

What happened, vault by vault, in words.

string
outcome
required

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.

string
skipped_since

When the current run of skips began. After a day, the people who manage sweeps are emailed once.

string format: date-time
min_amount
required

The least a vault must hold free before it is swept, in the asset’s smallest unit.

string
proposed_at
required
string format: date-time
proposed_by
required

The person’s name, or the API key’s when a key proposed it.

string
proposed_by_api_key
required

Whether an API key proposed it. Nobody who has held that key’s secret may confirm it.

boolean
replaces_id

The rule a proposal changes or retires.

integer
retire
required

A proposal to stop the rule it replaces.

boolean
sole_manager
required

Confirmed by its proposer alone, because nobody else in your organisation manages sweeps.

boolean
source_vaults
required

The vaults it sweeps when it names them; empty when it sweeps every vault opened with a reference. Never the destination.

Array<object>
object
id
required
integer
name
required
string
state
required

Active, proposed (waiting for a second person), declined or retired.

string
symbol
required
string
meta
object
request_id

Quote it when asking about a request; it is in the X-Request-Id header too.

string
success
required

Example

{
"success": true
}

Refused or failed, in words a person can act on.

Media typeapplication/json
object
error
required
object
code
required
string
fields
object
key
additional properties
string
message
required
string
meta
object
request_id

Quote it when asking about a request.

string
success
required

Example

{
"success": false
}