Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…- Add spec for endpoints /api/addresses/{address}/validity /api/transactions/history/to/{address}/observation /api/transactions/history/from/{address}/observation /api/transactions/history/from/{address}?take=integer&[afterHash=string]
  • Loading branch information
Miguel committed Feb 27, 2019
1 parent 6e46da5 commit 3f3cdcf
Showing 1 changed file with 190 additions and 0 deletions.
190 changes: 190 additions & 0 deletions AntiD2ta_specs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,190 @@
openapi: 3.0.0
info:
title: Python to .Net
description: Still without description.
version: 0.25.1
servers:
- url: http://www.skycoin.net
description: Main Skycoin server
- url: http://staging.node.skycoin.net
description: Internal staging server for developer.
components:
securitySchemes:
CsrfTokenAuth: # arbitrary name for the security scheme
type: apiKey
in: header # can be "header", "query" or "cookie"
name: X-CSRF-TOKEN # name of the header, query parameter or cookie
schemas:
genericError:
description: This is a generic error that should be default response
type: object
properties:
code:
type: integer
format: int64
message:
type: string
paths:
/api/transactions/history/from/{address}:
get:
summary: Get history from address.
description: Should return completed transactions that transfer fund from the `address` and that were broadcasted after the transaction with the `hash` equal to the `afterHash`.<br>
If `afterHash` is empty, transactions should be read from the beginning. <br>
Should include all transactions broadcasted even if not going through `/transaction/broadcast/*` API endpoints. <br>
If there are no transactions to return, empty array should be returned. Amount of the returned transactions should not exceed `take` .
security:
- CsrfTokenAuth: []

parameters:
- name: address
in: path
description: Address for find blockchain explorer URLs
required: true
schema:
type: string
- name: take
in: query
required: true
schema:
type: integer
- name: afterHash
in: query
required: false
schema:
type: string

responses:
'200':
description: Operation ID. The transaction Id.
content:
application/json:
schema:
type: array
items:
properties:
operationId:
type: string
description: Can be empty. <br>
Should be not empty for transactions that broadcasted using this API.
timestamp:
type: string
format: date-time
description: 'Transaction moment as ISO 8601 in UTC'

fromAddress:
type: string
description: Source address.

toAddress:
type: string
description: Destination address.

assetId:
type: string
description: Asset ID e.g. SKY

amount:
type: string
description: 'Amount without fee. Is integer as string, aligned to the asset accuracy. Actual value can be calculated as `x = sourceAmount * (10 ^ asset.Accuracy)`'

hash:
type: string
description: Transaction hash as base64 string

default:
$ref : '#/components/schemas/genericError'

/api/transactions/history/from/{address}/observation:
delete:
summary: Stop observation from address

description: Should stop observation of the transactions that transfer fund from the address . Should affect result of the [GET] /api/transactions/history/from/{address}.

parameters:
- name: address
in: path
description: Address from stop being observed
required: true
schema:
type: string

responses:
'204': # status code
description: "No content : transactions from the address are not observed."
content:
application/json:
schema:
type: object
properties:
signedTransaction:
type: string

default:
$ref : '#/components/schemas/genericError'

/api/transactions/history/to/{address}/observation:
delete:
summary: Stop observation to address

description: Should stop observation of the transactions that transfer fund to the address . Should affect result of the '[GET] /api/transactions/history/to/{address}' .

parameters:
- name: address
in: path
description: Address to stop being observed
required: true
schema:
type: string

responses:
'204': # status code
description: "No content : transactions to the address are not observed"
content:
application/json:
schema:
type: object
properties:
signedTransaction:
type: string

default:
$ref : '#/components/schemas/genericError'

/api/addresses/{address}/validity:
get:
summary: Valid address API endpoint.
description: Should check and return address validity.<br>
Should check and return wallet address validity
security:
- CsrfTokenAuth: []

parameters:
- name: address
in: path
description: Address for find blockchain explorer URLs
required: true
schema:
type: string

responses:
'200':
description: Validation. The Validation value.
content:
application/json:
schema:
type: object
properties:
isValid:
type: boolean
description: Flag, which indicates that the address is valid

default:
$ref : '#/components/schemas/genericError'

# To remember :
# Every post method should use security schema.
# Feel free to use and reuse components
# I think, at some point, someone should use oneOf and anyOf, pls take a look



0 comments on commit 3f3cdcf

Please sign in to comment.