Skip to content

Commit

Permalink
[balances] refs fibercrypto#9 - Add spec for [GET] /api/balances
Browse files Browse the repository at this point in the history
  • Loading branch information
mauricio1802 committed Feb 26, 2019
1 parent dcc9232 commit 53e214d
Showing 1 changed file with 71 additions and 3 deletions.
74 changes: 71 additions & 3 deletions mauricio1802_specs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: []
Expand Down Expand Up @@ -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
Expand All @@ -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.
Expand Down

0 comments on commit 53e214d

Please sign in to comment.