-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathspec.yml
154 lines (145 loc) · 5.67 KB
/
spec.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
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/broadcast:
post:
summary: Broadcast the signed transaction.
description: Should broadcast the signed transaction. Result code can be evaluated synchronously or returned asynchronously in the `[GET] /api/transactions/broadcast/*` response with error code.
security:
- CsrfTokenAuth: []
requestBody:
description: 'A JSON object containing: Operation ID. The signed transaction returned by the [POST] /api/sign'
required: true
content:
application/json:
schema:
type: object
properties:
operationId:
type: string
description: Operation ID.
signedTransaction:
type: string
description: The signed transaction returned by the [POST] /api/sign.
responses:
'200': # status code
description: Error code.
content:
application/json:
schema:
type: object
properties:
errorCode:
type: string
enum:
- amountIsTooSmall
- notEnoughBalance
description: Error code. Can be empty. Should be non empty if an error that match one of the listed code is occured. For other errors use HTTP status codes.
default:
$ref : '#/components/schemas/genericError'
/api/addresses/{address}/explorer-url:
get:
summary: Return one or many blockchain explorer URLs.
description: Should return one or many blockchain explorer URLs for the given address.
security:
- CsrfTokenAuth: []
parameters:
- name: address
in: path
description: Address for find blockchain explorer URLs.
required: true
schema:
type: string
responses:
'200':
description: Blockchain explorer URLs for the given address.
content:
application/json:
schema:
type: array
items:
type: string
default:
$ref : '#/components/schemas/genericError'
/api/transactions/many-outputs:
post:
summary: Build not signed transaction with many outputs.
description: Should build not signed transaction with many outputs. 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. Fee should be added to the specified amount.
security:
- CsrfTokenAuth: []
requestBody:
description: 'A JSON object containing: Operation ID. Source address. Destinations. Asset ID to transfer, defaults to SKY'
required: true
content:
application/json:
schema:
type: object
properties:
operationId:
type: string
description: Operation ID.
fromAddress:
type: string
description: Source address.
outputs:
type: array
items:
type: object
properties:
toAddress:
type: string
description: Destination address.
amount:
type: string
description: Amount to transfer to the toAddress. Integer as string, aligned to the asset accuracy. Actual value can be calculated as x = amount / (10 ^ asset.Accuracy).
description: Destinations.
assetId:
type: string
description: Asset ID to transfer, defaults to SKY.
responses:
'200': # status code
description: Error code. The transaction context
content:
application/json:
schema:
type: object
properties:
errorCode:
type: string
enum:
- amountIsTooSmall
- notEnoughBalance
description: Error code. Can be empty. Should be non empty if an error that match one of the listed code is occured. For other errors use HTTP status codes.
transactionContext:
type: string
description: The transaction context in the blockchain specific format, which will be passed to the [POST] /api/sign. Should be not empty when result is successful.
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