From 53e214d299831b3b31d40c78bdeb7fe46034a0d1 Mon Sep 17 00:00:00 2001 From: Mauricio Perdomo Date: Tue, 26 Feb 2019 12:49:53 -0500 Subject: [PATCH] [balances] refs #9 - Add spec for [GET] /api/balances --- mauricio1802_specs.yml | 74 ++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 71 insertions(+), 3 deletions(-) diff --git a/mauricio1802_specs.yml b/mauricio1802_specs.yml index 4170e0f..aeb1cb0 100644 --- a/mauricio1802_specs.yml +++ b/mauricio1802_specs.yml @@ -30,8 +30,8 @@ components: paths: /api/transactions/single: #issue 8 post: - summary: Build single transaction - description: Build not signed single transaction if was't builded before + summary: Build not signed single transaction + description: Should build not signed transaction to transfer from the single source to the single destination. If the transaction with the specified operationId has already been built by one of the [POST] /api/transactions/* call, it should be ignored and regular response (as in the first request) should be returned. security: - CsrfTokenAuth: [] @@ -63,7 +63,11 @@ paths: amount: type: string description: Amount to transfer. Integer as string, aligned to the asset accuracy. Actual value can be calculated as x = amount / (10 ^ asset.Accuracy) - + + + + + responses: '200': # status code description: OK @@ -86,6 +90,70 @@ paths: default: $ref : '#/components/schemas/genericError' + + + /api/balances: #issue 9 + get: + summary: Return balance of the observed wallets + description: Should return balances of the observed wallets with non zero balances. Wallets balance observation is enabled by the [POST] /api/balances/{address}/observation and disabled by the [DELETE] /api/balances/{address}/observation. + parameters: + - name: take + in: query + required: true + schema: + type: integer + description: Limit amount of the returned values + - name: continuation + in: query + required: false + schema: + type: string + description: context of the previous request + + responses: + '200': # status code + description: OK + content: + application/json: + schema: + type: object + properties: + isValid: + description: Indicate if the address is valid + type: boolean + + continuation: + description: Continuation token + type: string + + items: + description: Current batch of items + type: array + items: + type: object + properties: + address: + description: Wallet address + type: string + assetId: + description: Asset ID + type: string + + balance: + description: Balance is integer as string, aligned to the asset accuracy. Actual value can be calculated as x = sourceBalance * (10 ^ asset.Accuracy)Balance is integer as string, aligned to the asset accuracy. Actual value can be calculated as x = sourceBalance * (10 ^ asset.Accuracy) + type: string + block: + description: Incremental ID of the moment, when balance is updated. It should be the same sequence as for block in the []GET] /api/transactions/broadcast/* responses + type: integer + + + + + default: + $ref : '#/components/schemas/genericError' + + + # To remember : # Every post method should use security schema.