forked from AccumulateNetwork/accumulate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathopenrpc.yml
477 lines (475 loc) · 14 KB
/
openrpc.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
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
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
openrpc: 1.2.4
info:
title: Accumulate API
description: A public JSON RPC API of the Accumulate Node
version: 0.2.0
license:
name: MIT
methods:
- name: adi
summary: Get ADI (Accumulate Digital Identity) info
tags:
- name: ADI
params:
- name: url
summary: Accumulate ADI URL
required: true
schema:
$ref: '#/components/schemas/url'
result:
name: ADI
schema:
$ref: '#/components/schemas/adi'
errors:
- code: -32901
message: invalid adi url
- code: -32902
message: adi does not exist
- name: token-account
summary: Get Token Account info
tags:
- name: token
params:
- name: url
summary: Accumulate Token Account URL
required: true
schema:
$ref: '#/components/schemas/url'
result:
name: Token Account
schema:
$ref: '#/components/schemas/tokenAccount'
errors:
- code: -34001
message: invalid token account url
- code: -34002
message: token account does not exist
- name: token-tx
summary: Get Token Transaction info
tags:
- name: token
params:
- name: hash
summary: Transaction Hash
required: true
schema:
$ref: '#/components/schemas/hex'
result:
name: Token Transaction
schema:
$ref: '#/components/schemas/tokenTx'
errors:
- code: -34002
message: invalid transaction hash
- code: -34003
message: transaction does not exist
- name: sig-spec
summary: Get Key Page/Signature Specification info
tags:
- name: token
params:
- name: url
summary: Accumulate Key Page URL
required: true
schema:
$ref: '#/components/schemas/url'
result:
name: Key Page
schema:
$ref: '#/components/schemas/keyPage'
- name: sig-spec-group
summary: Get Key Book/Signature Specification Group info
tags:
- name: token
params:
- name: url
summary: Accumulate Key Group URL
required: true
schema:
$ref: '#/components/schemas/url'
result:
name: Key Group
schema:
$ref: '#/components/schemas/keyBook'
- name: adi-create
summary: Create ADI (Accumulate Digital Identity)
tags:
- name: ADI
params:
- name: wait
summary: Wait for the transaction to complete
schema:
type: boolean
- name: tx
summary: Transaction
required: true
schema:
properties:
sponsor: { $ref: '#/components/schemas/url' }
sig: { $ref: '#/components/schemas/hex' }
keyPage: { $ref: '#/components/schemas/txKeyPage' }
signer: { $ref: '#/components/schemas/txSigner' }
data:
type: object
properties:
url:
description: Requested ADI URL
$ref: '#/components/schemas/url'
publicKey:
description: Public key of the ADI (base64 encoded)
type: string
keyBookName:
description: Override the default key book name
type: string
keyPageName:
description: Override the default key page name
type: string
result:
name: ADI
schema:
$ref: '#/components/schemas/adi'
errors:
- code: -32901
message: invalid adi url
- code: -32801
message: invalid signer adi
- code: -32802
message: invalid signature
- code: -32803
message: invalid timestamp
- name: token-account-create
summary: Create Token Account
tags:
- name: token
params:
- name: tx
summary: Transaction
required: true
schema:
properties:
sponsor: { $ref: '#/components/schemas/url' }
sig: { $ref: '#/components/schemas/hex' }
keyPage: { $ref: '#/components/schemas/txKeyPage' }
signer: { $ref: '#/components/schemas/txSigner' }
data:
type: object
properties:
url:
description: Requested token account URL
$ref: '#/components/schemas/url'
tokenUrl:
description: Token issuer URL
$ref: '#/components/schemas/url'
keyBookUrl:
description: Override the default key book assignment
$ref: '#/components/schemas/url'
result:
name: Token Account
schema:
$ref: '#/components/schemas/tokenAccount'
errors:
- code: -34001
message: invalid token account url
- code: -33001
message: invalid token url
- code: -32801
message: invalid signer adi
- code: -32802
message: invalid signature
- code: -32803
message: invalid timestamp
- name: token-tx-create
summary: Create Token Transaction
tags:
- name: token
params:
- name: tx
summary: Transaction
required: true
schema:
properties:
sponsor: { $ref: '#/components/schemas/url' }
sig: { $ref: '#/components/schemas/hex' }
keyPage: { $ref: '#/components/schemas/txKeyPage' }
signer: { $ref: '#/components/schemas/txSigner' }
data:
$ref: '#/components/schemas/tokenTx'
result:
name: Token Tx
schema:
$ref: '#/components/schemas/tokenTx'
errors:
- code: -34001
message: invalid token address url
- code: -32801
message: invalid signer adi
- code: -32802
message: invalid signature
- code: -32803
message: invalid timestamp
- name: create-sig-spec-group
summary: Create Key Book (previously Signature Specification Group)
params:
- name: wait
summary: Wait for the transaction to complete
schema:
type: boolean
- name: tx
summary: Transaction
required: true
schema:
properties:
sponsor: { $ref: '#/components/schemas/url' }
sig: { $ref: '#/components/schemas/hex' }
keyPage: { $ref: '#/components/schemas/txKeyPage' }
signer: { $ref: '#/components/schemas/txSigner' }
data:
type: object
properties:
url:
description: Requested key book URL
$ref: '#/components/schemas/url'
sigSpecs:
title: Key page IDs
description: Chain IDs of unbound key pages to bind to the book
type: array
items:
$ref: '#/components/schemas/hex'
result:
name: Key Book
schema:
$ref: '#/components/schemas/keyBook'
- name: create-sig-spec
summary: Create Key Page (previously Signature Specification)
params:
- name: wait
summary: Wait for the transaction to complete
schema:
type: boolean
- name: tx
summary: Transaction
required: true
schema:
properties:
sponsor: { $ref: '#/components/schemas/url' }
sig: { $ref: '#/components/schemas/hex' }
keyPage: { $ref: '#/components/schemas/txKeyPage' }
signer: { $ref: '#/components/schemas/txSigner' }
data:
type: object
properties:
url:
description: Requested key page URL
$ref: '#/components/schemas/url'
keys:
title: Keys
description: Keys to add to the page
type: array
items:
title: Key specification
description: A public key or public key hash
type: object
properties:
publicKey:
title: Public key or hash
description: Base64 encoded public key or public key hash
type: string
result:
name: Key Page
schema:
$ref: '#/components/schemas/keyPage'
- name: add-credits
summary: Add credits to a lite account or key page
params:
- name: wait
summary: Wait for the transaction to complete
schema:
type: boolean
- name: tx
summary: Transaction
required: true
schema:
properties:
sponsor: { $ref: '#/components/schemas/url' }
sig: { $ref: '#/components/schemas/hex' }
keyPage: { $ref: '#/components/schemas/txKeyPage' }
signer: { $ref: '#/components/schemas/txSigner' }
data:
type: object
properties:
recipient:
description: Recipient of the credits
$ref: '#/components/schemas/url'
amount:
description: Amount of credits to add
type: integer
- name: update-key-page
summary: Update a key page's keys
params:
- name: wait
summary: Wait for the transaction to complete
schema:
type: boolean
- name: tx
summary: Transaction
required: true
schema:
properties:
sponsor: { $ref: '#/components/schemas/url' }
sig: { $ref: '#/components/schemas/hex' }
keyPage: { $ref: '#/components/schemas/txKeyPage' }
signer: { $ref: '#/components/schemas/txSigner' }
data:
type: object
properties:
operation:
description: Operation to execute
type: string
enum: [ update, add, remove ]
key:
description: Existing key, for update or remove, base64 encoded
type: string
newKey:
description: New key, for update or add, base64 encoded
type: string
components:
schemas:
hex:
type: string
pattern: ^[0-9a-f]+$
url:
type: string
pattern: ^(acc://)?[\w-]+(/[\w-.]+)*$
txKeyPage:
type: object
properties:
height:
type: integer
index:
type: integer
txSigner:
type: object
properties:
publicKey:
$ref: '#/components/schemas/hex'
nonce:
type: integer
adi:
title: ADI (Accumulate Digital Identity)
type: object
properties:
url:
title: ADI URL
description: Accumulate ADI URL
$ref: '#/components/schemas/adiURL'
publicKey:
title: ADI Public Key
description: ADI Public Key
$ref: '#/components/schemas/hex'
tokenAccount:
title: Token Account
type: object
properties:
url:
title: URL
description: Token Account URL
$ref: '#/components/schemas/url'
tokenURL:
title: Token URL
description: Token Issuer URL
type: string
$ref: '#/components/schemas/url'
balance:
title: Balance
description: Token Account balance
type: integer
nonce:
title: Nonce
description: Key nonce, for lite accounts
type: integer
creditBalance:
title: Credit balance
description: Credit balance, for lite accounts
type: integer
tokenTx:
title: Token Tx
type: object
properties:
hash:
title: Hash
description: Transaction Hash
$ref: '#/components/schemas/hex'
from:
title: Sender Token Account
description: Token Account URL
$ref: '#/components/schemas/url'
to:
title: Receiver(s) Token Account(s)
description: Token Account URL
type: array
items:
title: Receiver Token Account
description: Token Account URL and amount
type: object
properties:
url:
title: Token Account URL
description: Token Account URL
$ref: '#/components/schemas/url'
amount:
title: Amount
description: Number of tokens
type: integer
meta:
title: Metadata
description: Transaction Metadata
type: string
keyBook:
title: Key Book
description: Previously called Signature Specification Group
type: object
properties:
chainUrl:
title: URL
description: URL
$ref: '#/components/schemas/url'
sigSpecs:
title: Key page IDs
description: Chain IDs of pages in the book
type: array
items:
$ref: '#/components/schemas/hex'
keyPage:
title: Key Page
description: Previously called Signature Specification
type: object
properties:
chainUrl:
title: URL
description: URL
$ref: '#/components/schemas/url'
sigSpecId:
title: Key book ID
description: Chain ID of the book the page belongs to
$ref: '#/components/schemas/hex'
creditBalance:
title: Credit balance
description: Credit balance
type: integer
keys:
title: Keys
description: Keys specifications
type: array
items:
title: Key specification
description: A public key or public key hash
type: object
properties:
publicKey:
title: Public key or hash
description: Base64 encoded public key or public key hash
type: string
nonce:
title: Nonce
description: Key nonce
type: integer