Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Anti d2ta specs #27

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 0 additions & 27 deletions espec.yml

This file was deleted.

190 changes: 190 additions & 0 deletions spec.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 whitout 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:
'200':
description: "Ok"
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:
'200':
description: "Ok"
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