HTTP API

Treasury

GET/api/v1/treasury/{domain}/analytics/flows
GET
/api/v1/treasury/{domain}/analytics/flows

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

domain*string

Query Parameters

currency_id*string

Currency to report on

window_seconds?integer

Window in seconds to aggregate over (e.g. 604800 for 7d)

Formatint64

Response Body

application/json

curl -X GET "https://example.com/api/v1/treasury/string/analytics/flows?currency_id=string"
{  "currency_id": "string",  "faucets": [    {      "tag": "string",      "total": 0    }  ],  "net_flow": 0,  "sinks": [    {      "tag": "string",      "total": 0    }  ],  "window_seconds": 0}
GET/api/v1/treasury/{domain}/analytics/supply
GET
/api/v1/treasury/{domain}/analytics/supply

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

domain*string

Query Parameters

currency_id*string

Currency to report on

Response Body

application/json

curl -X GET "https://example.com/api/v1/treasury/string/analytics/supply?currency_id=string"
{  "burned": 0,  "circulating": 0,  "minted": 0,  "currency_id": "string"}
GET/api/v1/treasury/{domain}/analytics/top-holders
GET
/api/v1/treasury/{domain}/analytics/top-holders

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

domain*string

Query Parameters

currency_id*string

Currency to rank holders for

limit?integer

Maximum number of holders to return

Formatint64
Range0 <= value

Response Body

application/json

curl -X GET "https://example.com/api/v1/treasury/string/analytics/top-holders?currency_id=string"
{  "concentration": 0.1,  "currency_id": "string",  "holders": [    {      "balance": 0,      "principal": {        "id": "string",        "kind": "auth_user"      },      "rank": 0,      "wallet_id": "string"    }  ]}
GET/api/v1/treasury/{domain}/currencies
GET
/api/v1/treasury/{domain}/currencies

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

domain*string

Response Body

application/json

curl -X GET "https://example.com/api/v1/treasury/string/currencies"
{  "currencies": [    {      "created_at": "2019-08-24T14:15:22Z",      "created_by": "string",      "decimal_places": 0,      "domain": "string",      "id": "string",      "name": "string",      "overdraft_policy": {        "limit": 0,        "mode": "DENY"      },      "supply_controls": {        "faucets_require_tag": true,        "max_supply": 0      },      "symbol": "string"    }  ]}
POST/api/v1/treasury/{domain}/currencies
POST
/api/v1/treasury/{domain}/currencies

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

domain*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Define a new currency in a domain.

Response Body

application/json

curl -X POST "https://example.com/api/v1/treasury/string/currencies" \  -H "Content-Type: application/json" \  -d '{    "decimal_places": 0,    "id": "string",    "name": "string",    "symbol": "string"  }'
{  "created_at": "2019-08-24T14:15:22Z",  "created_by": "string",  "decimal_places": 0,  "domain": "string",  "id": "string",  "name": "string",  "overdraft_policy": {    "limit": 0,    "mode": "DENY"  },  "supply_controls": {    "faucets_require_tag": true,    "max_supply": 0  },  "symbol": "string"}
POST/api/v1/treasury/{domain}/holds
POST
/api/v1/treasury/{domain}/holds

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

domain*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Place a hold against a wallet's available balance.

Response Body

application/json

application/json

curl -X POST "https://example.com/api/v1/treasury/string/holds" \  -H "Content-Type: application/json" \  -d '{    "amount": 0,    "wallet_id": "string"  }'
{  "amount": 0,  "created_at": "2019-08-24T14:15:22Z",  "created_by": "string",  "domain": "string",  "expires_at": "2019-08-24T14:15:22Z",  "id": "string",  "reference": null,  "status": "ACTIVE",  "wallet_id": "string"}
POST/api/v1/treasury/{domain}/holds/{hold_id}/capture
POST
/api/v1/treasury/{domain}/holds/{hold_id}/capture

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

domain*string
hold_id*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Capture an active hold, optionally for less than the held amount.

Response Body

application/json

curl -X POST "https://example.com/api/v1/treasury/string/holds/string/capture" \  -H "Content-Type: application/json" \  -d '{}'
{  "amount": 0,  "created_at": "2019-08-24T14:15:22Z",  "created_by": "string",  "domain": "string",  "expires_at": "2019-08-24T14:15:22Z",  "id": "string",  "reference": null,  "status": "ACTIVE",  "wallet_id": "string"}
POST/api/v1/treasury/{domain}/holds/{hold_id}/release
POST
/api/v1/treasury/{domain}/holds/{hold_id}/release

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

domain*string
hold_id*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Release an active hold, freeing the reserved funds.

Response Body

application/json

curl -X POST "https://example.com/api/v1/treasury/string/holds/string/release" \  -H "Content-Type: application/json" \  -d '{}'
{  "amount": 0,  "created_at": "2019-08-24T14:15:22Z",  "created_by": "string",  "domain": "string",  "expires_at": "2019-08-24T14:15:22Z",  "id": "string",  "reference": null,  "status": "ACTIVE",  "wallet_id": "string"}
POST/api/v1/treasury/{domain}/settle
POST
/api/v1/treasury/{domain}/settle

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

domain*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Atomically capture a set of holds and apply extra balanced legs as one transfer.

Response Body

application/json

application/json

curl -X POST "https://example.com/api/v1/treasury/string/settle" \  -H "Content-Type: application/json" \  -d '{    "hold_ids": [      "string"    ],    "idempotency_key": "string"  }'
{  "created_at": "2019-08-24T14:15:22Z",  "created_by": "string",  "domain": "string",  "id": "string",  "idempotency_key": "string",  "legs": [    {      "amount": 0,      "direction": "DEBIT",      "wallet_id": "string"    }  ],  "reference": null,  "status": "COMMITTED",  "tags": [    "string"  ],  "captured_holds": [    "string"  ],  "idempotent_replay": true}
POST/api/v1/treasury/{domain}/transfers
POST
/api/v1/treasury/{domain}/transfers

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

domain*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Submit a multi-leg transfer.

Response Body

application/json

curl -X POST "https://example.com/api/v1/treasury/string/transfers" \  -H "Content-Type: application/json" \  -d '{    "idempotency_key": "string",    "legs": [      {        "amount": 0,        "direction": "DEBIT",        "wallet_id": "string"      }    ]  }'
{  "created_at": "2019-08-24T14:15:22Z",  "created_by": "string",  "domain": "string",  "id": "string",  "idempotency_key": "string",  "legs": [    {      "amount": 0,      "direction": "DEBIT",      "wallet_id": "string"    }  ],  "reference": null,  "status": "COMMITTED",  "tags": [    "string"  ],  "idempotent_replay": true}
GET/api/v1/treasury/{domain}/wallets
GET
/api/v1/treasury/{domain}/wallets

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

domain*string

Query Parameters

principal?string

Principal selector in the form kind:id (e.g. auth_user:usr_01J9ABCD)

Response Body

application/json

curl -X GET "https://example.com/api/v1/treasury/string/wallets"
{  "count": 0,  "wallets": [    {      "available": 0,      "balance": 0,      "created_at": "2019-08-24T14:15:22Z",      "created_by": "string",      "currency_id": "string",      "domain": "string",      "frozen": true,      "held": 0,      "id": "string",      "kind": "STANDARD",      "principal": {        "id": "string",        "kind": "auth_user"      },      "updated_at": "2019-08-24T14:15:22Z"    }  ]}
POST/api/v1/treasury/{domain}/wallets
POST
/api/v1/treasury/{domain}/wallets

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

domain*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Create a wallet for a principal in a currency.

Response Body

application/json

curl -X POST "https://example.com/api/v1/treasury/string/wallets" \  -H "Content-Type: application/json" \  -d '{    "currency_id": "string",    "principal": {      "id": "string",      "kind": "auth_user"    }  }'
{  "available": 0,  "balance": 0,  "created_at": "2019-08-24T14:15:22Z",  "created_by": "string",  "currency_id": "string",  "domain": "string",  "frozen": true,  "held": 0,  "id": "string",  "kind": "STANDARD",  "principal": {    "id": "string",    "kind": "auth_user"  },  "updated_at": "2019-08-24T14:15:22Z"}
GET/api/v1/treasury/{domain}/wallets/{wallet_id}
GET
/api/v1/treasury/{domain}/wallets/{wallet_id}

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

domain*string
wallet_id*string

Response Body

application/json

curl -X GET "https://example.com/api/v1/treasury/string/wallets/string"
{  "available": 0,  "balance": 0,  "created_at": "2019-08-24T14:15:22Z",  "created_by": "string",  "currency_id": "string",  "domain": "string",  "frozen": true,  "held": 0,  "id": "string",  "kind": "STANDARD",  "principal": {    "id": "string",    "kind": "auth_user"  },  "updated_at": "2019-08-24T14:15:22Z"}
PATCH/api/v1/treasury/{domain}/wallets/{wallet_id}/freeze
PATCH
/api/v1/treasury/{domain}/wallets/{wallet_id}/freeze

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

domain*string
wallet_id*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Freeze or unfreeze a wallet (admin only).

Response Body

application/json

curl -X PATCH "https://example.com/api/v1/treasury/string/wallets/string/freeze" \  -H "Content-Type: application/json" \  -d '{    "frozen": true  }'
{  "available": 0,  "balance": 0,  "created_at": "2019-08-24T14:15:22Z",  "created_by": "string",  "currency_id": "string",  "domain": "string",  "frozen": true,  "held": 0,  "id": "string",  "kind": "STANDARD",  "principal": {    "id": "string",    "kind": "auth_user"  },  "updated_at": "2019-08-24T14:15:22Z"}
GET/api/v1/treasury/{domain}/wallets/{wallet_id}/history
GET
/api/v1/treasury/{domain}/wallets/{wallet_id}/history

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

domain*string
wallet_id*string

Query Parameters

limit?integer

Maximum number of entries to return

Formatint64
Range0 <= value
cursor?string

Opaque cursor (stream id) to page from

Response Body

application/json

curl -X GET "https://example.com/api/v1/treasury/string/wallets/string/history"
{  "entries": [    {      "amount": 0,      "balance_after": 0,      "created_at": "2019-08-24T14:15:22Z",      "direction": "DEBIT",      "entry_id": "string",      "reference": null,      "tags": [        "string"      ],      "transfer_id": "string",      "wallet_id": "string"    }  ],  "next_cursor": "string",  "wallet_id": "string"}

On this page