From ba7c8e7139d03f847c74fa73218ad9a1a91fbded Mon Sep 17 00:00:00 2001 From: Geoffrey Ragot Date: Thu, 3 Oct 2024 17:36:12 +0200 Subject: [PATCH] fix: openapi markdown --- Earthfile | 2 +- docs/api/README.md | 4441 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 4442 insertions(+), 1 deletion(-) create mode 100644 docs/api/README.md diff --git a/Earthfile b/Earthfile index de0d9a021..25b01d874 100644 --- a/Earthfile +++ b/Earthfile @@ -167,7 +167,7 @@ openapi: openapi-markdown: FROM node:20-alpine RUN npm install -g widdershins - COPY (+openapi/openapi.yaml) . + COPY openapi/v2.yaml openapi.yaml RUN widdershins openapi.yaml -o README.md --search false --language_tabs 'http:HTTP' SAVE ARTIFACT README.md AS LOCAL docs/api/README.md diff --git a/docs/api/README.md b/docs/api/README.md new file mode 100644 index 000000000..7c7f8d143 --- /dev/null +++ b/docs/api/README.md @@ -0,0 +1,4441 @@ +--- +title: Ledger API vLEDGER_VERSION +language_tabs: + - http: HTTP +language_clients: + - http: "" +toc_footers: [] +includes: [] +search: false +highlight_theme: darkula +headingLevel: 2 + +--- + + + +

Ledger API vLEDGER_VERSION

+ +> Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu. + +Base URLs: + +* http://localhost:8080/ + +# Authentication + +- oAuth2 authentication. + + - Flow: clientCredentials + + - Token URL = [/api/auth/oauth/token](/api/auth/oauth/token) + +|Scope|Scope Description| +|---|---| + +

ledger.v2

+ +## v2GetInfo + + + +> Code samples + +```http +GET http://localhost:8080/v2/_info HTTP/1.1 +Host: localhost:8080 +Accept: application/json + +``` + +`GET /v2/_info` + +*Show server information* + +> Example responses + +> 200 Response + +```json +{ + "server": "string", + "version": "string" +} +``` + +

Responses

+ +|Status|Meaning|Description|Schema| +|---|---|---|---| +|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|OK|[V2ConfigInfo](#schemav2configinfo)| +|default|Default|Error|[V2ErrorResponse](#schemav2errorresponse)| +|5XX|Unknown|Error|[V2ErrorResponse](#schemav2errorresponse)| + + + +## v2ListLedgers + + + +> Code samples + +```http +GET http://localhost:8080/v2 HTTP/1.1 +Host: localhost:8080 +Accept: application/json + +``` + +`GET /v2` + +*List ledgers* + +

Parameters

+ +|Name|In|Type|Required|Description| +|---|---|---|---|---| +|pageSize|query|integer(int64)|false|The maximum number of results to return per page.| +|cursor|query|string|false|Parameter used in pagination requests. Maximum page size is set to 15.| + +#### Detailed descriptions + +**pageSize**: The maximum number of results to return per page. + +**cursor**: Parameter used in pagination requests. Maximum page size is set to 15. +Set to the value of next for the next page of results. +Set to the value of previous for the previous page of results. +No other parameters can be set when this parameter is set. + +> Example responses + +> 200 Response + +```json +{ + "cursor": { + "pageSize": 15, + "hasMore": false, + "previous": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol=", + "next": "", + "data": [ + { + "name": "string", + "addedAt": "2019-08-24T14:15:22Z", + "bucket": "string", + "metadata": { + "admin": "true" + } + } + ] + } +} +``` + +

Responses

+ +|Status|Meaning|Description|Schema| +|---|---|---|---| +|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|OK|[V2LedgerListResponse](#schemav2ledgerlistresponse)| +|default|Default|Error|[V2ErrorResponse](#schemav2errorresponse)| + + + +## v2GetLedger + + + +> Code samples + +```http +GET http://localhost:8080/v2/{ledger} HTTP/1.1 +Host: localhost:8080 +Accept: application/json + +``` + +`GET /v2/{ledger}` + +*Get a ledger* + +

Parameters

+ +|Name|In|Type|Required|Description| +|---|---|---|---|---| +|ledger|path|string|true|Name of the ledger.| + +> Example responses + +> 200 Response + +```json +{ + "data": { + "name": "string", + "addedAt": "2019-08-24T14:15:22Z", + "bucket": "string", + "metadata": { + "admin": "true" + } + } +} +``` + +

Responses

+ +|Status|Meaning|Description|Schema| +|---|---|---|---| +|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|OK|[V2GetLedgerResponse](#schemav2getledgerresponse)| +|default|Default|Error|[V2ErrorResponse](#schemav2errorresponse)| + + + +## v2CreateLedger + + + +> Code samples + +```http +POST http://localhost:8080/v2/{ledger} HTTP/1.1 +Host: localhost:8080 +Content-Type: application/json +Accept: application/json + +``` + +`POST /v2/{ledger}` + +*Create a ledger* + +> Body parameter + +```json +{ + "bucket": "string", + "metadata": { + "admin": "true" + }, + "features": { + "property1": "string", + "property2": "string" + } +} +``` + +

Parameters

+ +|Name|In|Type|Required|Description| +|---|---|---|---|---| +|body|body|[V2CreateLedgerRequest](#schemav2createledgerrequest)|false|none| +|ledger|path|string|true|Name of the ledger.| + +> Example responses + +> default Response + +```json +{ + "errorCode": "VALIDATION", + "errorMessage": "[VALIDATION] invalid 'cursor' query param", + "details": "https://play.numscript.org/?payload=eyJlcnJvciI6ImFjY291bnQgaGFkIGluc3VmZmljaWVudCBmdW5kcyJ9" +} +``` + +

Responses

+ +|Status|Meaning|Description|Schema| +|---|---|---|---| +|204|[No Content](https://tools.ietf.org/html/rfc7231#section-6.3.5)|OK|None| +|default|Default|Error|[V2ErrorResponse](#schemav2errorresponse)| + + + +## v2UpdateLedgerMetadata + + + +> Code samples + +```http +PUT http://localhost:8080/v2/{ledger}/metadata HTTP/1.1 +Host: localhost:8080 +Content-Type: application/json +Accept: application/json + +``` + +`PUT /v2/{ledger}/metadata` + +*Update ledger metadata* + +> Body parameter + +```json +{ + "admin": "true" +} +``` + +

Parameters

+ +|Name|In|Type|Required|Description| +|---|---|---|---|---| +|body|body|[V2Metadata](#schemav2metadata)|false|none| +|ledger|path|string|true|Name of the ledger.| + +> Example responses + +> default Response + +```json +{ + "errorCode": "VALIDATION", + "errorMessage": "[VALIDATION] invalid 'cursor' query param", + "details": "https://play.numscript.org/?payload=eyJlcnJvciI6ImFjY291bnQgaGFkIGluc3VmZmljaWVudCBmdW5kcyJ9" +} +``` + +

Responses

+ +|Status|Meaning|Description|Schema| +|---|---|---|---| +|204|[No Content](https://tools.ietf.org/html/rfc7231#section-6.3.5)|OK|None| +|default|Default|Error|[V2ErrorResponse](#schemav2errorresponse)| +|5XX|Unknown|Error|[V2ErrorResponse](#schemav2errorresponse)| + + + +## v2DeleteLedgerMetadata + + + +> Code samples + +```http +DELETE http://localhost:8080/v2/{ledger}/metadata/{key} HTTP/1.1 +Host: localhost:8080 +Accept: application/json + +``` + +`DELETE /v2/{ledger}/metadata/{key}` + +*Delete ledger metadata by key* + +

Parameters

+ +|Name|In|Type|Required|Description| +|---|---|---|---|---| +|ledger|path|string|true|Name of the ledger.| +|key|path|string|true|Key to remove.| + +> Example responses + +> default Response + +```json +{ + "errorCode": "VALIDATION", + "errorMessage": "[VALIDATION] invalid 'cursor' query param", + "details": "https://play.numscript.org/?payload=eyJlcnJvciI6ImFjY291bnQgaGFkIGluc3VmZmljaWVudCBmdW5kcyJ9" +} +``` + +

Responses

+ +|Status|Meaning|Description|Schema| +|---|---|---|---| +|204|[No Content](https://tools.ietf.org/html/rfc7231#section-6.3.5)|OK|None| +|default|Default|Error|[V2ErrorResponse](#schemav2errorresponse)| + + + +## v2GetLedgerInfo + + + +> Code samples + +```http +GET http://localhost:8080/v2/{ledger}/_info HTTP/1.1 +Host: localhost:8080 +Accept: application/json + +``` + +`GET /v2/{ledger}/_info` + +*Get information about a ledger* + +

Parameters

+ +|Name|In|Type|Required|Description| +|---|---|---|---|---| +|ledger|path|string|true|Name of the ledger.| + +> Example responses + +> 200 Response + +```json +{ + "data": { + "name": "ledger001", + "storage": { + "migrations": [ + { + "version": 11, + "name": "migrations:001", + "date": "2019-08-24T14:15:22Z", + "state": "TO DO" + } + ] + } + } +} +``` + +

Responses

+ +|Status|Meaning|Description|Schema| +|---|---|---|---| +|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|OK|[V2LedgerInfoResponse](#schemav2ledgerinforesponse)| +|default|Default|Error|[V2ErrorResponse](#schemav2errorresponse)| + + + +## v2CreateBulk + + + +> Code samples + +```http +POST http://localhost:8080/v2/{ledger}/_bulk HTTP/1.1 +Host: localhost:8080 +Content-Type: application/json +Accept: application/json + +``` + +`POST /v2/{ledger}/_bulk` + +*Bulk request* + +> Body parameter + +```json +[ + { + "action": "string", + "ik": "string", + "data": { + "timestamp": "2019-08-24T14:15:22Z", + "postings": [ + { + "amount": 100, + "asset": "COIN", + "destination": "users:002", + "source": "users:001" + } + ], + "script": { + "plain": "vars {\naccount $user\n}\nsend [COIN 10] (\n\tsource = @world\n\tdestination = $user\n)\n", + "vars": { + "user": "users:042" + } + }, + "reference": "ref:001", + "metadata": { + "admin": "true" + } + } + } +] +``` + +

Parameters

+ +|Name|In|Type|Required|Description| +|---|---|---|---|---| +|ledger|path|string|true|Name of the ledger.| +|body|body|[V2Bulk](#schemav2bulk)|false|none| + +> Example responses + +> 200 Response + +```json +{ + "data": [ + { + "responseType": "string", + "data": { + "insertedAt": "2019-08-24T14:15:22Z", + "timestamp": "2019-08-24T14:15:22Z", + "postings": [ + { + "amount": 100, + "asset": "COIN", + "destination": "users:002", + "source": "users:001" + } + ], + "reference": "ref:001", + "metadata": { + "admin": "true" + }, + "id": 0, + "reverted": true, + "revertedAt": "2019-08-24T14:15:22Z", + "preCommitVolumes": { + "orders:1": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + }, + "orders:2": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + } + }, + "postCommitVolumes": { + "orders:1": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + }, + "orders:2": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + } + }, + "preCommitEffectiveVolumes": { + "orders:1": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + }, + "orders:2": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + } + }, + "postCommitEffectiveVolumes": { + "orders:1": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + }, + "orders:2": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + } + } + } + } + ] +} +``` + +

Responses

+ +|Status|Meaning|Description|Schema| +|---|---|---|---| +|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|OK|[V2BulkResponse](#schemav2bulkresponse)| +|400|[Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1)|OK|[V2BulkResponse](#schemav2bulkresponse)| +|default|Default|Error|[V2ErrorResponse](#schemav2errorresponse)| + + + +## v2CountAccounts + + + +> Code samples + +```http +HEAD http://localhost:8080/v2/{ledger}/accounts HTTP/1.1 +Host: localhost:8080 +Content-Type: application/json +Accept: application/json + +``` + +`HEAD /v2/{ledger}/accounts` + +*Count the accounts from a ledger* + +> Body parameter + +```json +{} +``` + +

Parameters

+ +|Name|In|Type|Required|Description| +|---|---|---|---|---| +|ledger|path|string|true|Name of the ledger.| +|pit|query|string(date-time)|false|none| +|body|body|object|false|none| + +> Example responses + +> default Response + +```json +{ + "errorCode": "VALIDATION", + "errorMessage": "[VALIDATION] invalid 'cursor' query param", + "details": "https://play.numscript.org/?payload=eyJlcnJvciI6ImFjY291bnQgaGFkIGluc3VmZmljaWVudCBmdW5kcyJ9" +} +``` + +

Responses

+ +|Status|Meaning|Description|Schema| +|---|---|---|---| +|204|[No Content](https://tools.ietf.org/html/rfc7231#section-6.3.5)|OK|None| +|default|Default|Error|[V2ErrorResponse](#schemav2errorresponse)| + +### Response Headers + +|Status|Header|Type|Format|Description| +|---|---|---|---|---| +|204|Count|integer|bigint|none| + + + +## v2ListAccounts + + + +> Code samples + +```http +GET http://localhost:8080/v2/{ledger}/accounts HTTP/1.1 +Host: localhost:8080 +Content-Type: application/json +Accept: application/json + +``` + +`GET /v2/{ledger}/accounts` + +*List accounts from a ledger* + +List accounts from a ledger, sorted by address in descending order. + +> Body parameter + +```json +{} +``` + +

Parameters

+ +|Name|In|Type|Required|Description| +|---|---|---|---|---| +|ledger|path|string|true|Name of the ledger.| +|pageSize|query|integer(int64)|false|The maximum number of results to return per page.| +|cursor|query|string|false|Parameter used in pagination requests. Maximum page size is set to 15.| +|expand|query|string|false|none| +|pit|query|string(date-time)|false|none| +|body|body|object|false|none| + +#### Detailed descriptions + +**pageSize**: The maximum number of results to return per page. + +**cursor**: Parameter used in pagination requests. Maximum page size is set to 15. +Set to the value of next for the next page of results. +Set to the value of previous for the previous page of results. +No other parameters can be set when this parameter is set. + +> Example responses + +> 200 Response + +```json +{ + "cursor": { + "pageSize": 15, + "hasMore": false, + "previous": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol=", + "next": "", + "data": [ + { + "address": "users:001", + "metadata": { + "admin": "true" + }, + "volumes": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + }, + "EUR": { + "input": 100, + "output": 10, + "balance": 90 + } + }, + "effectiveVolumes": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + }, + "EUR": { + "input": 100, + "output": 10, + "balance": 90 + } + } + } + ] + } +} +``` + +

Responses

+ +|Status|Meaning|Description|Schema| +|---|---|---|---| +|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|OK|[V2AccountsCursorResponse](#schemav2accountscursorresponse)| +|default|Default|Error|[V2ErrorResponse](#schemav2errorresponse)| + + + +## v2GetAccount + + + +> Code samples + +```http +GET http://localhost:8080/v2/{ledger}/accounts/{address} HTTP/1.1 +Host: localhost:8080 +Accept: application/json + +``` + +`GET /v2/{ledger}/accounts/{address}` + +*Get account by its address* + +

Parameters

+ +|Name|In|Type|Required|Description| +|---|---|---|---|---| +|ledger|path|string|true|Name of the ledger.| +|address|path|string|true|Exact address of the account. It must match the following regular expressions pattern:| +|expand|query|string|false|none| +|pit|query|string(date-time)|false|none| + +#### Detailed descriptions + +**address**: Exact address of the account. It must match the following regular expressions pattern: +``` +^\w+(:\w+)*$ +``` + +> Example responses + +> 200 Response + +```json +{ + "data": { + "address": "users:001", + "metadata": { + "admin": "true" + }, + "volumes": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + }, + "EUR": { + "input": 100, + "output": 10, + "balance": 90 + } + }, + "effectiveVolumes": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + }, + "EUR": { + "input": 100, + "output": 10, + "balance": 90 + } + } + } +} +``` + +

Responses

+ +|Status|Meaning|Description|Schema| +|---|---|---|---| +|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|OK|[V2AccountResponse](#schemav2accountresponse)| +|default|Default|Error|[V2ErrorResponse](#schemav2errorresponse)| + + + +## v2AddMetadataToAccount + + + +> Code samples + +```http +POST http://localhost:8080/v2/{ledger}/accounts/{address}/metadata HTTP/1.1 +Host: localhost:8080 +Content-Type: application/json +Accept: application/json +Idempotency-Key: string + +``` + +`POST /v2/{ledger}/accounts/{address}/metadata` + +*Add metadata to an account* + +> Body parameter + +```json +{ + "admin": "true" +} +``` + +

Parameters

+ +|Name|In|Type|Required|Description| +|---|---|---|---|---| +|ledger|path|string|true|Name of the ledger.| +|address|path|string|true|Exact address of the account. It must match the following regular expressions pattern:| +|dryRun|query|boolean|false|Set the dry run mode. Dry run mode doesn't add the logs to the database or publish a message to the message broker.| +|Idempotency-Key|header|string|false|Use an idempotency key| +|body|body|[V2Metadata](#schemav2metadata)|true|metadata| + +#### Detailed descriptions + +**address**: Exact address of the account. It must match the following regular expressions pattern: +``` +^\w+(:\w+)*$ +``` + +> Example responses + +> default Response + +```json +{ + "errorCode": "VALIDATION", + "errorMessage": "[VALIDATION] invalid 'cursor' query param", + "details": "https://play.numscript.org/?payload=eyJlcnJvciI6ImFjY291bnQgaGFkIGluc3VmZmljaWVudCBmdW5kcyJ9" +} +``` + +

Responses

+ +|Status|Meaning|Description|Schema| +|---|---|---|---| +|204|[No Content](https://tools.ietf.org/html/rfc7231#section-6.3.5)|No Content|None| +|default|Default|Error|[V2ErrorResponse](#schemav2errorresponse)| + +

Response Schema

+ + + +## v2DeleteAccountMetadata + + + +> Code samples + +```http +DELETE http://localhost:8080/v2/{ledger}/accounts/{address}/metadata/{key} HTTP/1.1 +Host: localhost:8080 +Accept: application/json + +``` + +`DELETE /v2/{ledger}/accounts/{address}/metadata/{key}` + +*Delete metadata by key* + +Delete metadata by key + +

Parameters

+ +|Name|In|Type|Required|Description| +|---|---|---|---|---| +|ledger|path|string|true|Name of the ledger.| +|address|path|string|true|Account address| +|key|path|string|true|The key to remove.| + +> Example responses + +> default Response + +```json +{ + "errorCode": "VALIDATION", + "errorMessage": "[VALIDATION] invalid 'cursor' query param", + "details": "https://play.numscript.org/?payload=eyJlcnJvciI6ImFjY291bnQgaGFkIGluc3VmZmljaWVudCBmdW5kcyJ9" +} +``` + +

Responses

+ +|Status|Meaning|Description|Schema| +|---|---|---|---| +|2XX|Unknown|Key deleted|None| +|default|Default|Error|[V2ErrorResponse](#schemav2errorresponse)| + +

Response Schema

+ + + +## v2ReadStats + + + +> Code samples + +```http +GET http://localhost:8080/v2/{ledger}/stats HTTP/1.1 +Host: localhost:8080 +Accept: application/json + +``` + +`GET /v2/{ledger}/stats` + +*Get statistics from a ledger* + +Get statistics from a ledger. (aggregate metrics on accounts and transactions) + +

Parameters

+ +|Name|In|Type|Required|Description| +|---|---|---|---|---| +|ledger|path|string|true|name of the ledger| + +> Example responses + +> 200 Response + +```json +{ + "data": { + "accounts": 0, + "transactions": 0 + } +} +``` + +

Responses

+ +|Status|Meaning|Description|Schema| +|---|---|---|---| +|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|OK|[V2StatsResponse](#schemav2statsresponse)| +|default|Default|Error|[V2ErrorResponse](#schemav2errorresponse)| + + + +## v2CountTransactions + + + +> Code samples + +```http +HEAD http://localhost:8080/v2/{ledger}/transactions HTTP/1.1 +Host: localhost:8080 +Content-Type: application/json +Accept: application/json + +``` + +`HEAD /v2/{ledger}/transactions` + +*Count the transactions from a ledger* + +> Body parameter + +```json +{} +``` + +

Parameters

+ +|Name|In|Type|Required|Description| +|---|---|---|---|---| +|ledger|path|string|true|Name of the ledger.| +|pit|query|string(date-time)|false|none| +|body|body|object|false|none| + +> Example responses + +> default Response + +```json +{ + "errorCode": "VALIDATION", + "errorMessage": "[VALIDATION] invalid 'cursor' query param", + "details": "https://play.numscript.org/?payload=eyJlcnJvciI6ImFjY291bnQgaGFkIGluc3VmZmljaWVudCBmdW5kcyJ9" +} +``` + +

Responses

+ +|Status|Meaning|Description|Schema| +|---|---|---|---| +|204|[No Content](https://tools.ietf.org/html/rfc7231#section-6.3.5)|OK|None| +|default|Default|Error|[V2ErrorResponse](#schemav2errorresponse)| + +### Response Headers + +|Status|Header|Type|Format|Description| +|---|---|---|---|---| +|204|Count|integer|int64|none| + + + +## v2ListTransactions + + + +> Code samples + +```http +GET http://localhost:8080/v2/{ledger}/transactions HTTP/1.1 +Host: localhost:8080 +Content-Type: application/json +Accept: application/json + +``` + +`GET /v2/{ledger}/transactions` + +*List transactions from a ledger* + +List transactions from a ledger, sorted by id in descending order. + +> Body parameter + +```json +{} +``` + +

Parameters

+ +|Name|In|Type|Required|Description| +|---|---|---|---|---| +|ledger|path|string|true|Name of the ledger.| +|pageSize|query|integer(int64)|false|The maximum number of results to return per page.| +|cursor|query|string|false|Parameter used in pagination requests. Maximum page size is set to 15.| +|expand|query|string|false|none| +|pit|query|string(date-time)|false|none| +|order|query|string|false|none| +|reverse|query|boolean|false|none| +|body|body|object|false|none| + +#### Detailed descriptions + +**pageSize**: The maximum number of results to return per page. + +**cursor**: Parameter used in pagination requests. Maximum page size is set to 15. +Set to the value of next for the next page of results. +Set to the value of previous for the previous page of results. +No other parameters can be set when this parameter is set. + +#### Enumerated Values + +|Parameter|Value| +|---|---| +|order|effective| + +> Example responses + +> 200 Response + +```json +{ + "cursor": { + "pageSize": 15, + "hasMore": false, + "previous": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol=", + "next": "", + "data": [ + { + "insertedAt": "2019-08-24T14:15:22Z", + "timestamp": "2019-08-24T14:15:22Z", + "postings": [ + { + "amount": 100, + "asset": "COIN", + "destination": "users:002", + "source": "users:001" + } + ], + "reference": "ref:001", + "metadata": { + "admin": "true" + }, + "id": 0, + "reverted": true, + "revertedAt": "2019-08-24T14:15:22Z", + "preCommitVolumes": { + "orders:1": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + }, + "orders:2": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + } + }, + "postCommitVolumes": { + "orders:1": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + }, + "orders:2": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + } + }, + "preCommitEffectiveVolumes": { + "orders:1": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + }, + "orders:2": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + } + }, + "postCommitEffectiveVolumes": { + "orders:1": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + }, + "orders:2": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + } + } + } + ] + } +} +``` + +

Responses

+ +|Status|Meaning|Description|Schema| +|---|---|---|---| +|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|OK|[V2TransactionsCursorResponse](#schemav2transactionscursorresponse)| +|default|Default|Error|[V2ErrorResponse](#schemav2errorresponse)| + + + +## v2CreateTransaction + + + +> Code samples + +```http +POST http://localhost:8080/v2/{ledger}/transactions HTTP/1.1 +Host: localhost:8080 +Content-Type: application/json +Accept: application/json +Idempotency-Key: string + +``` + +`POST /v2/{ledger}/transactions` + +*Create a new transaction to a ledger* + +> Body parameter + +```json +{ + "timestamp": "2019-08-24T14:15:22Z", + "postings": [ + { + "amount": 100, + "asset": "COIN", + "destination": "users:002", + "source": "users:001" + } + ], + "script": { + "plain": "vars {\naccount $user\n}\nsend [COIN 10] (\n\tsource = @world\n\tdestination = $user\n)\n", + "vars": { + "user": "users:042" + } + }, + "reference": "ref:001", + "metadata": { + "admin": "true" + } +} +``` + +

Parameters

+ +|Name|In|Type|Required|Description| +|---|---|---|---|---| +|ledger|path|string|true|Name of the ledger.| +|dryRun|query|boolean|false|Set the dryRun mode. dry run mode doesn't add the logs to the database or publish a message to the message broker.| +|Idempotency-Key|header|string|false|Use an idempotency key| +|force|query|boolean|false|Disable balance checks when passing postings| +|body|body|[V2PostTransaction](#schemav2posttransaction)|true|The request body must contain at least one of the following objects:| + +#### Detailed descriptions + +**body**: The request body must contain at least one of the following objects: + - `postings`: suitable for simple transactions + - `script`: enabling more complex transactions with Numscript + +> Example responses + +> 200 Response + +```json +{ + "data": { + "insertedAt": "2019-08-24T14:15:22Z", + "timestamp": "2019-08-24T14:15:22Z", + "postings": [ + { + "amount": 100, + "asset": "COIN", + "destination": "users:002", + "source": "users:001" + } + ], + "reference": "ref:001", + "metadata": { + "admin": "true" + }, + "id": 0, + "reverted": true, + "revertedAt": "2019-08-24T14:15:22Z", + "preCommitVolumes": { + "orders:1": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + }, + "orders:2": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + } + }, + "postCommitVolumes": { + "orders:1": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + }, + "orders:2": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + } + }, + "preCommitEffectiveVolumes": { + "orders:1": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + }, + "orders:2": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + } + }, + "postCommitEffectiveVolumes": { + "orders:1": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + }, + "orders:2": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + } + } + } +} +``` + +

Responses

+ +|Status|Meaning|Description|Schema| +|---|---|---|---| +|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|OK|[V2CreateTransactionResponse](#schemav2createtransactionresponse)| +|default|Default|Error|[V2ErrorResponse](#schemav2errorresponse)| + + + +## v2GetTransaction + + + +> Code samples + +```http +GET http://localhost:8080/v2/{ledger}/transactions/{id} HTTP/1.1 +Host: localhost:8080 +Accept: application/json + +``` + +`GET /v2/{ledger}/transactions/{id}` + +*Get transaction from a ledger by its ID* + +

Parameters

+ +|Name|In|Type|Required|Description| +|---|---|---|---|---| +|ledger|path|string|true|Name of the ledger.| +|id|path|integer(bigint)|true|Transaction ID.| +|expand|query|string|false|none| +|pit|query|string(date-time)|false|none| + +> Example responses + +> 200 Response + +```json +{ + "data": { + "insertedAt": "2019-08-24T14:15:22Z", + "timestamp": "2019-08-24T14:15:22Z", + "postings": [ + { + "amount": 100, + "asset": "COIN", + "destination": "users:002", + "source": "users:001" + } + ], + "reference": "ref:001", + "metadata": { + "admin": "true" + }, + "id": 0, + "reverted": true, + "revertedAt": "2019-08-24T14:15:22Z", + "preCommitVolumes": { + "orders:1": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + }, + "orders:2": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + } + }, + "postCommitVolumes": { + "orders:1": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + }, + "orders:2": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + } + }, + "preCommitEffectiveVolumes": { + "orders:1": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + }, + "orders:2": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + } + }, + "postCommitEffectiveVolumes": { + "orders:1": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + }, + "orders:2": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + } + } + } +} +``` + +

Responses

+ +|Status|Meaning|Description|Schema| +|---|---|---|---| +|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|OK|[V2GetTransactionResponse](#schemav2gettransactionresponse)| +|default|Default|Error|[V2ErrorResponse](#schemav2errorresponse)| + + + +## v2AddMetadataOnTransaction + + + +> Code samples + +```http +POST http://localhost:8080/v2/{ledger}/transactions/{id}/metadata HTTP/1.1 +Host: localhost:8080 +Content-Type: application/json +Accept: application/json +Idempotency-Key: string + +``` + +`POST /v2/{ledger}/transactions/{id}/metadata` + +*Set the metadata of a transaction by its ID* + +> Body parameter + +```json +{ + "admin": "true" +} +``` + +

Parameters

+ +|Name|In|Type|Required|Description| +|---|---|---|---|---| +|ledger|path|string|true|Name of the ledger.| +|id|path|integer(bigint)|true|Transaction ID.| +|dryRun|query|boolean|false|Set the dryRun mode. Dry run mode doesn't add the logs to the database or publish a message to the message broker.| +|Idempotency-Key|header|string|false|Use an idempotency key| +|body|body|[V2Metadata](#schemav2metadata)|false|metadata| + +> Example responses + +> default Response + +```json +{ + "errorCode": "VALIDATION", + "errorMessage": "[VALIDATION] invalid 'cursor' query param", + "details": "https://play.numscript.org/?payload=eyJlcnJvciI6ImFjY291bnQgaGFkIGluc3VmZmljaWVudCBmdW5kcyJ9" +} +``` + +

Responses

+ +|Status|Meaning|Description|Schema| +|---|---|---|---| +|204|[No Content](https://tools.ietf.org/html/rfc7231#section-6.3.5)|No Content|None| +|default|Default|Error|[V2ErrorResponse](#schemav2errorresponse)| + +

Response Schema

+ + + +## v2DeleteTransactionMetadata + + + +> Code samples + +```http +DELETE http://localhost:8080/v2/{ledger}/transactions/{id}/metadata/{key} HTTP/1.1 +Host: localhost:8080 +Accept: application/json + +``` + +`DELETE /v2/{ledger}/transactions/{id}/metadata/{key}` + +*Delete metadata by key* + +Delete metadata by key + +

Parameters

+ +|Name|In|Type|Required|Description| +|---|---|---|---|---| +|ledger|path|string|true|Name of the ledger.| +|id|path|integer(bigint)|true|Transaction ID.| +|key|path|string|true|The key to remove.| + +> Example responses + +> default Response + +```json +{ + "errorCode": "VALIDATION", + "errorMessage": "[VALIDATION] invalid 'cursor' query param", + "details": "https://play.numscript.org/?payload=eyJlcnJvciI6ImFjY291bnQgaGFkIGluc3VmZmljaWVudCBmdW5kcyJ9" +} +``` + +

Responses

+ +|Status|Meaning|Description|Schema| +|---|---|---|---| +|2XX|Unknown|Key deleted|None| +|default|Default|Error|[V2ErrorResponse](#schemav2errorresponse)| + +

Response Schema

+ + + +## v2RevertTransaction + + + +> Code samples + +```http +POST http://localhost:8080/v2/{ledger}/transactions/{id}/revert HTTP/1.1 +Host: localhost:8080 +Accept: application/json + +``` + +`POST /v2/{ledger}/transactions/{id}/revert` + +*Revert a ledger transaction by its ID* + +

Parameters

+ +|Name|In|Type|Required|Description| +|---|---|---|---|---| +|ledger|path|string|true|Name of the ledger.| +|id|path|integer(bigint)|true|Transaction ID.| +|force|query|boolean|false|Force revert| +|atEffectiveDate|query|boolean|false|Revert transaction at effective date of the original tx| +|dryRun|query|boolean|false|Set the dryRun mode. dry run mode doesn't add the logs to the database or publish a message to the message broker.| + +> Example responses + +> 201 Response + +```json +{ + "data": { + "insertedAt": "2019-08-24T14:15:22Z", + "timestamp": "2019-08-24T14:15:22Z", + "postings": [ + { + "amount": 100, + "asset": "COIN", + "destination": "users:002", + "source": "users:001" + } + ], + "reference": "ref:001", + "metadata": { + "admin": "true" + }, + "id": 0, + "reverted": true, + "revertedAt": "2019-08-24T14:15:22Z", + "preCommitVolumes": { + "orders:1": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + }, + "orders:2": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + } + }, + "postCommitVolumes": { + "orders:1": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + }, + "orders:2": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + } + }, + "preCommitEffectiveVolumes": { + "orders:1": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + }, + "orders:2": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + } + }, + "postCommitEffectiveVolumes": { + "orders:1": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + }, + "orders:2": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + } + } + } +} +``` + +

Responses

+ +|Status|Meaning|Description|Schema| +|---|---|---|---| +|201|[Created](https://tools.ietf.org/html/rfc7231#section-6.3.2)|OK|[V2CreateTransactionResponse](#schemav2createtransactionresponse)| +|default|Default|Error|[V2ErrorResponse](#schemav2errorresponse)| + + + +## v2GetBalancesAggregated + + + +> Code samples + +```http +GET http://localhost:8080/v2/{ledger}/aggregate/balances HTTP/1.1 +Host: localhost:8080 +Content-Type: application/json +Accept: application/json + +``` + +`GET /v2/{ledger}/aggregate/balances` + +*Get the aggregated balances from selected accounts* + +> Body parameter + +```json +{} +``` + +

Parameters

+ +|Name|In|Type|Required|Description| +|---|---|---|---|---| +|ledger|path|string|true|Name of the ledger.| +|pit|query|string(date-time)|false|none| +|useInsertionDate|query|boolean|false|Use insertion date instead of effective date| +|body|body|object|false|none| + +> Example responses + +> 200 Response + +```json +{ + "data": { + "USD": 100, + "EUR": 12 + } +} +``` + +

Responses

+ +|Status|Meaning|Description|Schema| +|---|---|---|---| +|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|OK|[V2AggregateBalancesResponse](#schemav2aggregatebalancesresponse)| +|default|Default|Error|[V2ErrorResponse](#schemav2errorresponse)| + + + +## v2GetVolumesWithBalances + + + +> Code samples + +```http +GET http://localhost:8080/v2/{ledger}/volumes HTTP/1.1 +Host: localhost:8080 +Content-Type: application/json +Accept: application/json + +``` + +`GET /v2/{ledger}/volumes` + +*Get list of volumes with balances for (account/asset)* + +> Body parameter + +```json +{} +``` + +

Parameters

+ +|Name|In|Type|Required|Description| +|---|---|---|---|---| +|pageSize|query|integer(int64)|false|The maximum number of results to return per page.| +|cursor|query|string|false|Parameter used in pagination requests. Maximum page size is set to 15.| +|ledger|path|string|true|Name of the ledger.| +|endTime|query|string(date-time)|false|none| +|startTime|query|string(date-time)|false|none| +|insertionDate|query|boolean|false|Use insertion date instead of effective date| +|groupBy|query|integer(int64)|false|Group volumes and balance by the level of the segment of the address| +|body|body|object|false|none| + +#### Detailed descriptions + +**pageSize**: The maximum number of results to return per page. + +**cursor**: Parameter used in pagination requests. Maximum page size is set to 15. +Set to the value of next for the next page of results. +Set to the value of previous for the previous page of results. +No other parameters can be set when this parameter is set. + +> Example responses + +> 200 Response + +```json +{ + "cursor": { + "pageSize": 15, + "hasMore": false, + "previous": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol=", + "next": "", + "data": [ + { + "account": "string", + "asset": "string", + "input": 0, + "output": 0, + "balance": 0 + } + ] + } +} +``` + +

Responses

+ +|Status|Meaning|Description|Schema| +|---|---|---|---| +|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|OK|[V2VolumesWithBalanceCursorResponse](#schemav2volumeswithbalancecursorresponse)| +|default|Default|Error|[V2ErrorResponse](#schemav2errorresponse)| + + + +## v2ListLogs + + + +> Code samples + +```http +GET http://localhost:8080/v2/{ledger}/logs HTTP/1.1 +Host: localhost:8080 +Content-Type: application/json +Accept: application/json + +``` + +`GET /v2/{ledger}/logs` + +*List the logs from a ledger* + +List the logs from a ledger, sorted by ID in descending order. + +> Body parameter + +```json +{} +``` + +

Parameters

+ +|Name|In|Type|Required|Description| +|---|---|---|---|---| +|ledger|path|string|true|Name of the ledger.| +|pageSize|query|integer(int64)|false|The maximum number of results to return per page.| +|cursor|query|string|false|Parameter used in pagination requests. Maximum page size is set to 15.| +|pit|query|string(date-time)|false|none| +|body|body|object|false|none| + +#### Detailed descriptions + +**pageSize**: The maximum number of results to return per page. + +**cursor**: Parameter used in pagination requests. Maximum page size is set to 15. +Set to the value of next for the next page of results. +Set to the value of previous for the previous page of results. +No other parameters can be set when this parameter is set. + +> Example responses + +> 200 Response + +```json +{ + "cursor": { + "pageSize": 15, + "hasMore": false, + "previous": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol=", + "next": "", + "data": [ + { + "id": 1234, + "type": "NEW_TRANSACTION", + "data": {}, + "hash": "9ee060170400f556b7e1575cb13f9db004f150a08355c7431c62bc639166431e", + "date": "2019-08-24T14:15:22Z" + } + ] + } +} +``` + +

Responses

+ +|Status|Meaning|Description|Schema| +|---|---|---|---| +|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|OK|[V2LogsCursorResponse](#schemav2logscursorresponse)| +|default|Default|Error|[V2ErrorResponse](#schemav2errorresponse)| + + + +## v2ImportLogs + + + +> Code samples + +```http +POST http://localhost:8080/v2/{ledger}/logs/import HTTP/1.1 +Host: localhost:8080 +Content-Type: application/octet-stream +Accept: application/json + +``` + +`POST /v2/{ledger}/logs/import` + +> Body parameter + +```yaml +string + +``` + +

Parameters

+ +|Name|In|Type|Required|Description| +|---|---|---|---|---| +|ledger|path|string|true|Name of the ledger.| +|body|body|string|false|none| + +> Example responses + +> default Response + +```json +{ + "errorCode": "VALIDATION", + "errorMessage": "[VALIDATION] invalid 'cursor' query param", + "details": "https://play.numscript.org/?payload=eyJlcnJvciI6ImFjY291bnQgaGFkIGluc3VmZmljaWVudCBmdW5kcyJ9" +} +``` + +

Responses

+ +|Status|Meaning|Description|Schema| +|---|---|---|---| +|204|[No Content](https://tools.ietf.org/html/rfc7231#section-6.3.5)|Import OK|None| +|default|Default|Error|[V2ErrorResponse](#schemav2errorresponse)| + + + +## v2ExportLogs + + + +> Code samples + +```http +POST http://localhost:8080/v2/{ledger}/logs/export HTTP/1.1 +Host: localhost:8080 +Accept: application/octet-stream + +``` + +`POST /v2/{ledger}/logs/export` + +*Export logs* + +

Parameters

+ +|Name|In|Type|Required|Description| +|---|---|---|---|---| +|ledger|path|string|true|Name of the ledger.| + +> Example responses + +> default Response + +

Responses

+ +|Status|Meaning|Description|Schema| +|---|---|---|---| +|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|Import OK|None| +|default|Default|Error|string| + + + +# Schemas + +

V2AccountsCursorResponse

+ + + + + + +```json +{ + "cursor": { + "pageSize": 15, + "hasMore": false, + "previous": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol=", + "next": "", + "data": [ + { + "address": "users:001", + "metadata": { + "admin": "true" + }, + "volumes": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + }, + "EUR": { + "input": 100, + "output": 10, + "balance": 90 + } + }, + "effectiveVolumes": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + }, + "EUR": { + "input": 100, + "output": 10, + "balance": 90 + } + } + } + ] + } +} + +``` + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|cursor|object|true|none|none| +|» pageSize|integer(int64)|true|none|none| +|» hasMore|boolean|true|none|none| +|» previous|string|false|none|none| +|» next|string|false|none|none| +|» data|[[V2Account](#schemav2account)]|true|none|none| + +

V2TransactionsCursorResponse

+ + + + + + +```json +{ + "cursor": { + "pageSize": 15, + "hasMore": false, + "previous": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol=", + "next": "", + "data": [ + { + "insertedAt": "2019-08-24T14:15:22Z", + "timestamp": "2019-08-24T14:15:22Z", + "postings": [ + { + "amount": 100, + "asset": "COIN", + "destination": "users:002", + "source": "users:001" + } + ], + "reference": "ref:001", + "metadata": { + "admin": "true" + }, + "id": 0, + "reverted": true, + "revertedAt": "2019-08-24T14:15:22Z", + "preCommitVolumes": { + "orders:1": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + }, + "orders:2": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + } + }, + "postCommitVolumes": { + "orders:1": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + }, + "orders:2": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + } + }, + "preCommitEffectiveVolumes": { + "orders:1": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + }, + "orders:2": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + } + }, + "postCommitEffectiveVolumes": { + "orders:1": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + }, + "orders:2": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + } + } + } + ] + } +} + +``` + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|cursor|object|true|none|none| +|» pageSize|integer(int64)|true|none|none| +|» hasMore|boolean|true|none|none| +|» previous|string|false|none|none| +|» next|string|false|none|none| +|» data|[[V2Transaction](#schemav2transaction)]|true|none|none| + +

V2LogsCursorResponse

+ + + + + + +```json +{ + "cursor": { + "pageSize": 15, + "hasMore": false, + "previous": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol=", + "next": "", + "data": [ + { + "id": 1234, + "type": "NEW_TRANSACTION", + "data": {}, + "hash": "9ee060170400f556b7e1575cb13f9db004f150a08355c7431c62bc639166431e", + "date": "2019-08-24T14:15:22Z" + } + ] + } +} + +``` + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|cursor|object|true|none|none| +|» pageSize|integer(int64)|true|none|none| +|» hasMore|boolean|true|none|none| +|» previous|string|false|none|none| +|» next|string|false|none|none| +|» data|[[V2Log](#schemav2log)]|true|none|none| + +

V2AccountResponse

+ + + + + + +```json +{ + "data": { + "address": "users:001", + "metadata": { + "admin": "true" + }, + "volumes": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + }, + "EUR": { + "input": 100, + "output": 10, + "balance": 90 + } + }, + "effectiveVolumes": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + }, + "EUR": { + "input": 100, + "output": 10, + "balance": 90 + } + } + } +} + +``` + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|data|[V2Account](#schemav2account)|true|none|none| + +

V2AggregateBalancesResponse

+ + + + + + +```json +{ + "data": { + "USD": 100, + "EUR": 12 + } +} + +``` + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|data|[V2AssetsBalances](#schemav2assetsbalances)|true|none|none| + +

V2VolumesWithBalanceCursorResponse

+ + + + + + +```json +{ + "cursor": { + "pageSize": 15, + "hasMore": false, + "previous": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol=", + "next": "", + "data": [ + { + "account": "string", + "asset": "string", + "input": 0, + "output": 0, + "balance": 0 + } + ] + } +} + +``` + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|cursor|object|true|none|none| +|» pageSize|integer(int64)|true|none|none| +|» hasMore|boolean|true|none|none| +|» previous|string|false|none|none| +|» next|string|false|none|none| +|» data|[[V2VolumesWithBalance](#schemav2volumeswithbalance)]|true|none|none| + +

V2VolumesWithBalance

+ + + + + + +```json +{ + "account": "string", + "asset": "string", + "input": 0, + "output": 0, + "balance": 0 +} + +``` + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|account|string|true|none|none| +|asset|string|true|none|none| +|input|integer(bigint)|true|none|none| +|output|integer(bigint)|true|none|none| +|balance|integer(bigint)|true|none|none| + +

V2Metadata

+ + + + + + +```json +{ + "admin": "true" +} + +``` + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|**additionalProperties**|string|false|none|none| + +

V2ConfigInfo

+ + + + + + +```json +{ + "server": "string", + "version": "string" +} + +``` + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|server|string|true|none|none| +|version|string|true|none|none| + +

V2Account

+ + + + + + +```json +{ + "address": "users:001", + "metadata": { + "admin": "true" + }, + "volumes": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + }, + "EUR": { + "input": 100, + "output": 10, + "balance": 90 + } + }, + "effectiveVolumes": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + }, + "EUR": { + "input": 100, + "output": 10, + "balance": 90 + } + } +} + +``` + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|address|string|true|none|none| +|metadata|object|true|none|none| +|» **additionalProperties**|string|false|none|none| +|volumes|[V2Volumes](#schemav2volumes)|false|none|none| +|effectiveVolumes|[V2Volumes](#schemav2volumes)|false|none|none| + +

V2AssetsBalances

+ + + + + + +```json +{ + "USD": 100, + "EUR": 12 +} + +``` + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|**additionalProperties**|integer(bigint)|false|none|none| + +

V2Posting

+ + + + + + +```json +{ + "amount": 100, + "asset": "COIN", + "destination": "users:002", + "source": "users:001" +} + +``` + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|amount|integer(bigint)|true|none|none| +|asset|string|true|none|none| +|destination|string|true|none|none| +|source|string|true|none|none| + +

V2Transaction

+ + + + + + +```json +{ + "insertedAt": "2019-08-24T14:15:22Z", + "timestamp": "2019-08-24T14:15:22Z", + "postings": [ + { + "amount": 100, + "asset": "COIN", + "destination": "users:002", + "source": "users:001" + } + ], + "reference": "ref:001", + "metadata": { + "admin": "true" + }, + "id": 0, + "reverted": true, + "revertedAt": "2019-08-24T14:15:22Z", + "preCommitVolumes": { + "orders:1": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + }, + "orders:2": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + } + }, + "postCommitVolumes": { + "orders:1": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + }, + "orders:2": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + } + }, + "preCommitEffectiveVolumes": { + "orders:1": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + }, + "orders:2": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + } + }, + "postCommitEffectiveVolumes": { + "orders:1": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + }, + "orders:2": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + } + } +} + +``` + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|insertedAt|string(date-time)|true|none|none| +|timestamp|string(date-time)|true|none|none| +|postings|[[V2Posting](#schemav2posting)]|true|none|none| +|reference|string|false|none|none| +|metadata|[V2Metadata](#schemav2metadata)|true|none|none| +|id|integer(bigint)|true|none|none| +|reverted|boolean|true|none|none| +|revertedAt|string(date-time)|false|none|none| +|preCommitVolumes|[V2AggregatedVolumes](#schemav2aggregatedvolumes)|false|none|none| +|postCommitVolumes|[V2AggregatedVolumes](#schemav2aggregatedvolumes)|false|none|none| +|preCommitEffectiveVolumes|[V2AggregatedVolumes](#schemav2aggregatedvolumes)|false|none|none| +|postCommitEffectiveVolumes|[V2AggregatedVolumes](#schemav2aggregatedvolumes)|false|none|none| + +

V2PostTransaction

+ + + + + + +```json +{ + "timestamp": "2019-08-24T14:15:22Z", + "postings": [ + { + "amount": 100, + "asset": "COIN", + "destination": "users:002", + "source": "users:001" + } + ], + "script": { + "plain": "vars {\naccount $user\n}\nsend [COIN 10] (\n\tsource = @world\n\tdestination = $user\n)\n", + "vars": { + "user": "users:042" + } + }, + "reference": "ref:001", + "metadata": { + "admin": "true" + } +} + +``` + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|timestamp|string(date-time)|false|none|none| +|postings|[[V2Posting](#schemav2posting)]|false|none|none| +|script|object|false|none|none| +|» plain|string|true|none|none| +|» vars|object|false|none|none| +|reference|string|false|none|none| +|metadata|[V2Metadata](#schemav2metadata)|true|none|none| + +

V2Stats

+ + + + + + +```json +{ + "accounts": 0, + "transactions": 0 +} + +``` + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|accounts|integer(int64)|true|none|none| +|transactions|integer(bigint)|true|none|none| + +

V2Log

+ + + + + + +```json +{ + "id": 1234, + "type": "NEW_TRANSACTION", + "data": {}, + "hash": "9ee060170400f556b7e1575cb13f9db004f150a08355c7431c62bc639166431e", + "date": "2019-08-24T14:15:22Z" +} + +``` + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|id|integer(bigint)|true|none|none| +|type|string|true|none|none| +|data|object|true|none|none| +|hash|string|true|none|none| +|date|string(date-time)|true|none|none| + +#### Enumerated Values + +|Property|Value| +|---|---| +|type|NEW_TRANSACTION| +|type|SET_METADATA| +|type|REVERTED_TRANSACTION| + +

V2CreateTransactionResponse

+ + + + + + +```json +{ + "data": { + "insertedAt": "2019-08-24T14:15:22Z", + "timestamp": "2019-08-24T14:15:22Z", + "postings": [ + { + "amount": 100, + "asset": "COIN", + "destination": "users:002", + "source": "users:001" + } + ], + "reference": "ref:001", + "metadata": { + "admin": "true" + }, + "id": 0, + "reverted": true, + "revertedAt": "2019-08-24T14:15:22Z", + "preCommitVolumes": { + "orders:1": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + }, + "orders:2": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + } + }, + "postCommitVolumes": { + "orders:1": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + }, + "orders:2": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + } + }, + "preCommitEffectiveVolumes": { + "orders:1": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + }, + "orders:2": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + } + }, + "postCommitEffectiveVolumes": { + "orders:1": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + }, + "orders:2": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + } + } + } +} + +``` + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|data|[V2Transaction](#schemav2transaction)|true|none|none| + +

V2RevertTransactionResponse

+ + + + + + +```json +{ + "data": { + "insertedAt": "2019-08-24T14:15:22Z", + "timestamp": "2019-08-24T14:15:22Z", + "postings": [ + { + "amount": 100, + "asset": "COIN", + "destination": "users:002", + "source": "users:001" + } + ], + "reference": "ref:001", + "metadata": { + "admin": "true" + }, + "id": 0, + "reverted": true, + "revertedAt": "2019-08-24T14:15:22Z", + "preCommitVolumes": { + "orders:1": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + }, + "orders:2": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + } + }, + "postCommitVolumes": { + "orders:1": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + }, + "orders:2": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + } + }, + "preCommitEffectiveVolumes": { + "orders:1": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + }, + "orders:2": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + } + }, + "postCommitEffectiveVolumes": { + "orders:1": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + }, + "orders:2": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + } + } + } +} + +``` + +### Properties + +*None* + +

V2GetTransactionResponse

+ + + + + + +```json +{ + "data": { + "insertedAt": "2019-08-24T14:15:22Z", + "timestamp": "2019-08-24T14:15:22Z", + "postings": [ + { + "amount": 100, + "asset": "COIN", + "destination": "users:002", + "source": "users:001" + } + ], + "reference": "ref:001", + "metadata": { + "admin": "true" + }, + "id": 0, + "reverted": true, + "revertedAt": "2019-08-24T14:15:22Z", + "preCommitVolumes": { + "orders:1": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + }, + "orders:2": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + } + }, + "postCommitVolumes": { + "orders:1": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + }, + "orders:2": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + } + }, + "preCommitEffectiveVolumes": { + "orders:1": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + }, + "orders:2": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + } + }, + "postCommitEffectiveVolumes": { + "orders:1": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + }, + "orders:2": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + } + } + } +} + +``` + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|data|[V2Transaction](#schemav2transaction)|true|none|none| + +

V2StatsResponse

+ + + + + + +```json +{ + "data": { + "accounts": 0, + "transactions": 0 + } +} + +``` + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|data|[V2Stats](#schemav2stats)|true|none|none| + +

V2ConfigInfoResponse

+ + + + + + +```json +{ + "server": "string", + "version": "string" +} + +``` + +### Properties + +*None* + +

V2Volume

+ + + + + + +```json +{ + "input": 100, + "output": 20, + "balance": 80 +} + +``` + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|input|integer(bigint)|true|none|none| +|output|integer(bigint)|true|none|none| +|balance|integer(bigint)|false|none|none| + +

V2Volumes

+ + + + + + +```json +{ + "USD": { + "input": 100, + "output": 10, + "balance": 90 + }, + "EUR": { + "input": 100, + "output": 10, + "balance": 90 + } +} + +``` + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|**additionalProperties**|[V2Volume](#schemav2volume)|false|none|none| + +

V2AggregatedVolumes

+ + + + + + +```json +{ + "orders:1": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + }, + "orders:2": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + } +} + +``` + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|**additionalProperties**|[V2Volumes](#schemav2volumes)|false|none|none| + +

V2ErrorResponse

+ + + + + + +```json +{ + "errorCode": "VALIDATION", + "errorMessage": "[VALIDATION] invalid 'cursor' query param", + "details": "https://play.numscript.org/?payload=eyJlcnJvciI6ImFjY291bnQgaGFkIGluc3VmZmljaWVudCBmdW5kcyJ9" +} + +``` + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|errorCode|[V2ErrorsEnum](#schemav2errorsenum)|true|none|none| +|errorMessage|string|true|none|none| +|details|string|false|none|none| + +

V2ErrorsEnum

+ + + + + + +```json +"VALIDATION" + +``` + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|*anonymous*|string|false|none|none| + +#### Enumerated Values + +|Property|Value| +|---|---| +|*anonymous*|INTERNAL| +|*anonymous*|INSUFFICIENT_FUND| +|*anonymous*|VALIDATION| +|*anonymous*|CONFLICT| +|*anonymous*|COMPILATION_FAILED| +|*anonymous*|METADATA_OVERRIDE| +|*anonymous*|NOT_FOUND| +|*anonymous*|REVERT_OCCURRING| +|*anonymous*|ALREADY_REVERT| +|*anonymous*|NO_POSTINGS| +|*anonymous*|LEDGER_NOT_FOUND| +|*anonymous*|IMPORT| + +

V2LedgerInfoResponse

+ + + + + + +```json +{ + "data": { + "name": "ledger001", + "storage": { + "migrations": [ + { + "version": 11, + "name": "migrations:001", + "date": "2019-08-24T14:15:22Z", + "state": "TO DO" + } + ] + } + } +} + +``` + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|data|[V2LedgerInfo](#schemav2ledgerinfo)|false|none|none| + +

V2LedgerInfo

+ + + + + + +```json +{ + "name": "ledger001", + "storage": { + "migrations": [ + { + "version": 11, + "name": "migrations:001", + "date": "2019-08-24T14:15:22Z", + "state": "TO DO" + } + ] + } +} + +``` + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|name|string|false|none|none| +|storage|object|false|none|none| +|» migrations|[[V2MigrationInfo](#schemav2migrationinfo)]|false|none|none| + +

V2MigrationInfo

+ + + + + + +```json +{ + "version": 11, + "name": "migrations:001", + "date": "2019-08-24T14:15:22Z", + "state": "TO DO" +} + +``` + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|version|integer(int64)|false|none|none| +|name|string|false|none|none| +|date|string(date-time)|false|none|none| +|state|string|false|none|none| + +#### Enumerated Values + +|Property|Value| +|---|---| +|state|TO DO| +|state|DONE| + +

V2Bulk

+ + + + + + +```json +[ + { + "action": "string", + "ik": "string", + "data": { + "timestamp": "2019-08-24T14:15:22Z", + "postings": [ + { + "amount": 100, + "asset": "COIN", + "destination": "users:002", + "source": "users:001" + } + ], + "script": { + "plain": "vars {\naccount $user\n}\nsend [COIN 10] (\n\tsource = @world\n\tdestination = $user\n)\n", + "vars": { + "user": "users:042" + } + }, + "reference": "ref:001", + "metadata": { + "admin": "true" + } + } + } +] + +``` + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|*anonymous*|[[V2BulkElement](#schemav2bulkelement)]|false|none|none| + +

V2BaseBulkElement

+ + + + + + +```json +{ + "action": "string", + "ik": "string" +} + +``` + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|action|string|true|none|none| +|ik|string|false|none|none| + +

V2BulkElement

+ + + + + + +```json +{ + "action": "string", + "ik": "string", + "data": { + "timestamp": "2019-08-24T14:15:22Z", + "postings": [ + { + "amount": 100, + "asset": "COIN", + "destination": "users:002", + "source": "users:001" + } + ], + "script": { + "plain": "vars {\naccount $user\n}\nsend [COIN 10] (\n\tsource = @world\n\tdestination = $user\n)\n", + "vars": { + "user": "users:042" + } + }, + "reference": "ref:001", + "metadata": { + "admin": "true" + } + } +} + +``` + +### Properties + +oneOf + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|*anonymous*|[V2BulkElementCreateTransaction](#schemav2bulkelementcreatetransaction)|false|none|none| + +xor + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|*anonymous*|[V2BulkElementAddMetadata](#schemav2bulkelementaddmetadata)|false|none|none| + +xor + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|*anonymous*|[V2BulkElementRevertTransaction](#schemav2bulkelementreverttransaction)|false|none|none| + +xor + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|*anonymous*|[V2BulkElementDeleteMetadata](#schemav2bulkelementdeletemetadata)|false|none|none| + +

V2BulkElementCreateTransaction

+ + + + + + +```json +{ + "action": "string", + "ik": "string", + "data": { + "timestamp": "2019-08-24T14:15:22Z", + "postings": [ + { + "amount": 100, + "asset": "COIN", + "destination": "users:002", + "source": "users:001" + } + ], + "script": { + "plain": "vars {\naccount $user\n}\nsend [COIN 10] (\n\tsource = @world\n\tdestination = $user\n)\n", + "vars": { + "user": "users:042" + } + }, + "reference": "ref:001", + "metadata": { + "admin": "true" + } + } +} + +``` + +### Properties + +allOf + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|*anonymous*|[V2BaseBulkElement](#schemav2basebulkelement)|false|none|none| + +and + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|*anonymous*|object|false|none|none| +|» data|[V2PostTransaction](#schemav2posttransaction)|false|none|none| + +

V2TargetId

+ + + + + + +```json +"string" + +``` + +### Properties + +oneOf + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|*anonymous*|string|false|none|none| + +xor + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|*anonymous*|integer(bigint)|false|none|none| + +

V2TargetType

+ + + + + + +```json +"TRANSACTION" + +``` + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|*anonymous*|string|false|none|none| + +#### Enumerated Values + +|Property|Value| +|---|---| +|*anonymous*|TRANSACTION| +|*anonymous*|ACCOUNT| + +

V2BulkElementAddMetadata

+ + + + + + +```json +{ + "action": "string", + "ik": "string", + "data": { + "targetId": "string", + "targetType": "TRANSACTION", + "metadata": { + "property1": "string", + "property2": "string" + } + } +} + +``` + +### Properties + +allOf + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|*anonymous*|[V2BaseBulkElement](#schemav2basebulkelement)|false|none|none| + +and + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|*anonymous*|object|false|none|none| +|» data|object|false|none|none| +|»» targetId|[V2TargetId](#schemav2targetid)|true|none|none| +|»» targetType|[V2TargetType](#schemav2targettype)|true|none|none| +|»» metadata|object|true|none|none| +|»»» **additionalProperties**|string|false|none|none| + +

V2BulkElementRevertTransaction

+ + + + + + +```json +{ + "action": "string", + "ik": "string", + "data": { + "id": 0, + "force": true, + "atEffectiveDate": true + } +} + +``` + +### Properties + +allOf + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|*anonymous*|[V2BaseBulkElement](#schemav2basebulkelement)|false|none|none| + +and + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|*anonymous*|object|false|none|none| +|» data|object|false|none|none| +|»» id|integer(bigint)|true|none|none| +|»» force|boolean|false|none|none| +|»» atEffectiveDate|boolean|false|none|none| + +

V2BulkElementDeleteMetadata

+ + + + + + +```json +{ + "action": "string", + "ik": "string", + "data": { + "targetId": "string", + "targetType": "TRANSACTION", + "key": "string" + } +} + +``` + +### Properties + +allOf + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|*anonymous*|[V2BaseBulkElement](#schemav2basebulkelement)|false|none|none| + +and + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|*anonymous*|object|false|none|none| +|» data|object|false|none|none| +|»» targetId|[V2TargetId](#schemav2targetid)|true|none|none| +|»» targetType|[V2TargetType](#schemav2targettype)|true|none|none| +|»» key|string|true|none|none| + +

V2BulkResponse

+ + + + + + +```json +{ + "data": [ + { + "responseType": "string", + "data": { + "insertedAt": "2019-08-24T14:15:22Z", + "timestamp": "2019-08-24T14:15:22Z", + "postings": [ + { + "amount": 100, + "asset": "COIN", + "destination": "users:002", + "source": "users:001" + } + ], + "reference": "ref:001", + "metadata": { + "admin": "true" + }, + "id": 0, + "reverted": true, + "revertedAt": "2019-08-24T14:15:22Z", + "preCommitVolumes": { + "orders:1": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + }, + "orders:2": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + } + }, + "postCommitVolumes": { + "orders:1": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + }, + "orders:2": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + } + }, + "preCommitEffectiveVolumes": { + "orders:1": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + }, + "orders:2": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + } + }, + "postCommitEffectiveVolumes": { + "orders:1": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + }, + "orders:2": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + } + } + } + } + ] +} + +``` + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|data|[[V2BulkElementResult](#schemav2bulkelementresult)]|true|none|none| + +

V2BulkElementResult

+ + + + + + +```json +{ + "responseType": "string", + "data": { + "insertedAt": "2019-08-24T14:15:22Z", + "timestamp": "2019-08-24T14:15:22Z", + "postings": [ + { + "amount": 100, + "asset": "COIN", + "destination": "users:002", + "source": "users:001" + } + ], + "reference": "ref:001", + "metadata": { + "admin": "true" + }, + "id": 0, + "reverted": true, + "revertedAt": "2019-08-24T14:15:22Z", + "preCommitVolumes": { + "orders:1": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + }, + "orders:2": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + } + }, + "postCommitVolumes": { + "orders:1": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + }, + "orders:2": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + } + }, + "preCommitEffectiveVolumes": { + "orders:1": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + }, + "orders:2": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + } + }, + "postCommitEffectiveVolumes": { + "orders:1": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + }, + "orders:2": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + } + } + } +} + +``` + +### Properties + +oneOf + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|*anonymous*|[V2BulkElementResultCreateTransaction](#schemav2bulkelementresultcreatetransaction)|false|none|none| + +xor + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|*anonymous*|[V2BulkElementResultAddMetadata](#schemav2bulkelementresultaddmetadata)|false|none|none| + +xor + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|*anonymous*|[V2BulkElementResultRevertTransaction](#schemav2bulkelementresultreverttransaction)|false|none|none| + +xor + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|*anonymous*|[V2BulkElementResultDeleteMetadata](#schemav2bulkelementresultdeletemetadata)|false|none|none| + +xor + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|*anonymous*|[V2BulkElementResultError](#schemav2bulkelementresulterror)|false|none|none| + +

V2BaseBulkElementResult

+ + + + + + +```json +{ + "responseType": "string" +} + +``` + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|responseType|string|true|none|none| + +

V2BulkElementResultCreateTransaction

+ + + + + + +```json +{ + "responseType": "string", + "data": { + "insertedAt": "2019-08-24T14:15:22Z", + "timestamp": "2019-08-24T14:15:22Z", + "postings": [ + { + "amount": 100, + "asset": "COIN", + "destination": "users:002", + "source": "users:001" + } + ], + "reference": "ref:001", + "metadata": { + "admin": "true" + }, + "id": 0, + "reverted": true, + "revertedAt": "2019-08-24T14:15:22Z", + "preCommitVolumes": { + "orders:1": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + }, + "orders:2": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + } + }, + "postCommitVolumes": { + "orders:1": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + }, + "orders:2": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + } + }, + "preCommitEffectiveVolumes": { + "orders:1": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + }, + "orders:2": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + } + }, + "postCommitEffectiveVolumes": { + "orders:1": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + }, + "orders:2": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + } + } + } +} + +``` + +### Properties + +allOf + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|*anonymous*|[V2BaseBulkElementResult](#schemav2basebulkelementresult)|false|none|none| + +and + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|*anonymous*|object|false|none|none| +|» data|[V2Transaction](#schemav2transaction)|true|none|none| + +

V2BulkElementResultAddMetadata

+ + + + + + +```json +{ + "responseType": "string" +} + +``` + +### Properties + +*None* + +

V2BulkElementResultRevertTransaction

+ + + + + + +```json +{ + "responseType": "string", + "data": { + "insertedAt": "2019-08-24T14:15:22Z", + "timestamp": "2019-08-24T14:15:22Z", + "postings": [ + { + "amount": 100, + "asset": "COIN", + "destination": "users:002", + "source": "users:001" + } + ], + "reference": "ref:001", + "metadata": { + "admin": "true" + }, + "id": 0, + "reverted": true, + "revertedAt": "2019-08-24T14:15:22Z", + "preCommitVolumes": { + "orders:1": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + }, + "orders:2": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + } + }, + "postCommitVolumes": { + "orders:1": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + }, + "orders:2": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + } + }, + "preCommitEffectiveVolumes": { + "orders:1": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + }, + "orders:2": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + } + }, + "postCommitEffectiveVolumes": { + "orders:1": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + }, + "orders:2": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + } + } + } +} + +``` + +### Properties + +allOf + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|*anonymous*|[V2BaseBulkElementResult](#schemav2basebulkelementresult)|false|none|none| + +and + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|*anonymous*|object|false|none|none| +|» data|[V2Transaction](#schemav2transaction)|true|none|none| + +

V2BulkElementResultDeleteMetadata

+ + + + + + +```json +{ + "responseType": "string" +} + +``` + +### Properties + +*None* + +

V2BulkElementResultError

+ + + + + + +```json +{ + "responseType": "string", + "errorCode": "string", + "errorDescription": "string", + "errorDetails": "string" +} + +``` + +### Properties + +allOf + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|*anonymous*|[V2BaseBulkElementResult](#schemav2basebulkelementresult)|false|none|none| + +and + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|*anonymous*|object|false|none|none| +|» errorCode|string|true|none|none| +|» errorDescription|string|true|none|none| +|» errorDetails|string|false|none|none| + +

V2CreateLedgerRequest

+ + + + + + +```json +{ + "bucket": "string", + "metadata": { + "admin": "true" + }, + "features": { + "property1": "string", + "property2": "string" + } +} + +``` + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|bucket|string|false|none|none| +|metadata|[V2Metadata](#schemav2metadata)|false|none|none| +|features|object|false|none|none| +|» **additionalProperties**|string|false|none|none| + +

V2Ledger

+ + + + + + +```json +{ + "name": "string", + "addedAt": "2019-08-24T14:15:22Z", + "bucket": "string", + "metadata": { + "admin": "true" + } +} + +``` + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|name|string|true|none|none| +|addedAt|string(date-time)|true|none|none| +|bucket|string|true|none|none| +|metadata|[V2Metadata](#schemav2metadata)|false|none|none| + +

V2LedgerListResponse

+ + + + + + +```json +{ + "cursor": { + "pageSize": 15, + "hasMore": false, + "previous": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol=", + "next": "", + "data": [ + { + "name": "string", + "addedAt": "2019-08-24T14:15:22Z", + "bucket": "string", + "metadata": { + "admin": "true" + } + } + ] + } +} + +``` + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|cursor|object|true|none|none| +|» pageSize|integer(int64)|true|none|none| +|» hasMore|boolean|true|none|none| +|» previous|string|false|none|none| +|» next|string|false|none|none| +|» data|[[V2Ledger](#schemav2ledger)]|true|none|none| + +

V2UpdateLedgerMetadataRequest

+ + + + + + +```json +{ + "admin": "true" +} + +``` + +### Properties + +*None* + +

V2GetLedgerResponse

+ + + + + + +```json +{ + "data": { + "name": "string", + "addedAt": "2019-08-24T14:15:22Z", + "bucket": "string", + "metadata": { + "admin": "true" + } + } +} + +``` + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|data|[V2Ledger](#schemav2ledger)|true|none|none| +