-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathapi-spec.yaml
203 lines (202 loc) · 5.2 KB
/
api-spec.yaml
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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
openapi: 3.0.0
info:
title: Tykn's Indy Rest Service
version: 1.0.0
description: Tykn alternative to ZeroMQ when communicating with Hyperledger INDY
contact:
email: [email protected]
license:
name: MIT
externalDocs:
description: Find out more about Swagger
url: 'http://swagger.io'
servers:
- url: 'http://rest-api.tykn.tech/'
- url: 'http://localhost:3000'
paths:
/{network}/tx:
post:
description: Post a transaction to the ledger
parameters:
- name: network
in: path
required: true
schema:
$ref: '#/components/schemas/Network'
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/Transaction'
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/WriteTransaction'
/{network}/tx/{ledger}/{starting-block}/{offset}/{is-forward}:
get:
description: Get transactions from the ledger
parameters:
- name: network
in: path
required: true
schema:
$ref: '#/components/schemas/Network'
- name: ledger
in: path
description: From which ledger should retrieve the transaction
required: true
schema:
type: string
example: domain
enum:
- CONFIG
- POOL
- DOMAIN
- name: starting-block
in: path
description: which block to get (or starting point inclusive)
required: true
schema:
type: number
example: 32
- name: offset
in: path
description:
OPTIONAL!!! How many blocks from/before the starting-block should be retrieved
required: true
schema:
type: number
default: 1
example: 3
- name: is-forward
in: path
description: >-
OPTIONAL!!! If true gets X tx from starting point. If false, gets X transactions until
starting point.
required: true
schema:
type: boolean
default: true
example: false
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/TxResponse'
/{network}/sizes:
get:
description: Get ledger sizes
parameters:
- name: network
in: path
required: true
schema:
$ref: '#/components/schemas/Network'
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/LedgerSizesResponse'
components:
schemas:
Network:
type: string
enum:
- sovmain
- sovstaging
- sovbuilder
- sovlocal
description: >
Network to execute the call: * `sovmain`: Main sovrin network * `sovstaging`: Staging sovrin
network * `sovbuilder`: Builders sovrin network * `sovlocal` : Local sovrin network (Only
available on-prem)
WriteTransaction:
type: object
properties:
operation:
type: object
properties:
type:
type: number
example: 4
version:
type: string
example: '1.0'
text:
type: string
example: 'some big agreement text'
identifier:
type: string
example: 'Th7MpTaRZVRYnPiabds81Y'
description: Verkey of the transaction owner
reqId:
type: number
example: 1575979116
description: Usually a EPOCH UNIX TIMESTAMP
protocolVersion:
type: number
example: 2
signatures:
type: array
items:
type: string
Transaction:
type: object
properties:
ledgerSize:
type: number
example: 254
txn:
type: object
properties:
metadata:
type: object
properties:
from:
type: string
example: 'JX29L7h6UpDNEThiaTYx9N'
type:
type: string
enum:
- '0'
- '1'
- '2'
data:
type: object
txnMetadata:
type: object
properties:
seqNo:
type: number
example: 15239
reqSignature:
type: object
rootHash:
type: string
example: '239dJiY4pNymcMBLq4U7wHqt778ZwJ57hQNXEoZJNYok'
ver:
type: number
auditPath:
type: array
items:
type: string
LedgerSizesResponse:
type: object
properties:
DOMAIN:
type: integer
CONFIG:
type: integer
POOL:
type: integer
TxResponse:
type: array
items:
$ref: '#/components/schemas/Transaction'