-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathweb_api_en.txt
450 lines (408 loc) · 20.5 KB
/
web_api_en.txt
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
important! THE ARGUMENTS IN THE REQUESTS MUST BE SPECIFIED IN STRICT ORDER, IN ACCORDANCE WITH HOW DESCRIBED BELOW
(GET) "/api/balance/" - current token balance
Arguments:
1)address - account address
2)token - the short name of the token (its abbreviation)
Request example:
/api/balance/?address=57LkviK66Hfx8TmSc3CzwQ66omHcqTAa1dKNKC7eTsJK&token=ORBC
Returns:
"wallet" - the account address
"token" - the short name of the token (its abbreviation)
"balance" - the current balance of the token
(GET)"/api/create/cryptocontainer/" - creating a new cryptocontainer
Arguments:
1)pass - password (at least 6 characters)
Request example:
/api/create/cryptocontainer/?pass=123123
Returns:
"address" is the address of the created cryptographic
container "words" - 47 words for restoring the created cryptographic container. Save them and don't tell anyone!
(GET) "/api/create/transaction/" - Create transaction
Arguments:
1)address - wallet address
2)pass - password
3)to - address of the recipient account
4)symbol - the short name of the token (abbreviation)
5)amount - quantity
Request example:
/api/create/transaction/?address=8QjFv11MGJrZcmaxfp8RRER5aJEB3fLokZdYk78Fdqup&pass=123123&to=8QjFv11MGJrZcmaxfp8RRER5aJEB3fLokZdYk78Fdqup&token=ORBC&amount=12
Returns:
In case of successful creation of the transaction:
"success" = True - the success of the creation of the transaction
"owner_sign" - the hash of the transaction signed with the private key of the creator of the transaction
In case of an error:
"success" = False
"error" - description of the error (insufficient funds, non-existent token, etc.)
(GET) "/api/check/transaction/" - Checking the transaction status
Arguments:
1)owner_sign - transaction hash signed with the private key of the transaction creator
Request example:
/api/check/transaction/?owner_sign=2p3e8kpdTwRgbjVbfb9BCKGToQ3eizFkKYY2e3rvYDG9jAL8apT7PQKeP7Wnix87345Sb3riYKMA2rdnrDjYs7X
Returns:
If a transaction has been confirmed:
status = "confirmed"
"owner_sign" hash transactions signed by private key of the originator of the transaction
"unix_time" - the date and time of the transaction(in Unix format)
"from" address for the account of the sender
"to" address for the account of the recipient
"amount" - the amount of the transferred funds
"token" token(short name)
If a transaction with the specified hash does not exist or has not yet been confirmed:
"status" = "not confirmed or does not exist"
(GET) "/api/create/token/" - Token creation
Arguments:
1)address - wallet address
2)pass - password
3)name - the full name of the token(not more than 32 characters, spaces and signs not allowed)
4)symbol - the short name of the token(abbreviation from 2 to 4 Latin letters, spaces and signs not allowed)
5)emission is the maximum amount of output(a positive integer more than 1 second)
6)capacity is the capacity(the number of decimal places from 2 to 8, inclusive)
Request example:
/api/create/token/?address=8QjFv11MGJrZcmaxfp8RRER5aJEB3fLokZdYk78Fdqup&pass=123123name=ORBISCoin&symbol=ORBC&emission=21000000&capacity=5
Returns:
In case of successful token creation:
"success" = True - the success of the transaction creation
"name" - the full name of the created token
"symbol" - the short name of the created token
"emission" - the maximum volume of issue of the created token
"capacity" - the bit depth of the created token
In case of an error:
"success" = False
"error" - error description (such token already exists, etc.)
(GET) "/api/buy/OM/" - purchase OM
Attention! Before executing the command, make sure that you are no longer an OM holder and that there is enough ORBC in your account to purchase it (1 OM = 10000 ORBC)
Arguments:
1)address - wallet address
2)pass - password
Request example:
/api/buy/OM/?address=8QjFv11MGJrZcmaxfp8RRER5aJEB3fLokZdYk78Fdqup&pass=123123
Returns:
In case of a successful purchase of OM:
"success" = True - the success of the purchase of OM
In case of an error:
"success" = False
"error" - error description (failed to log in to the wallet, OM has already been purchased, not enough ORBC to purchase, etc.)
(GET) "/api/checkom/" - checking whether the specified account is an OM holder
Arguments:
1)address - account address
Request example:
/api/checkom/?address=8QjFv11MGJrZcmaxfp8RRER5aJEB3fLokZdYk78Fdqup
Returns:
"success" - the success of processing the request
"om_holder" - the Boolean value of OM ownership of the specified account
If success = false:
"error" - error description(a non-existent address is specified, etc.)
(GET)"/api/create/service/" - Creating a service
Arguments:
1)address - wallet address
2)pass - password
3)name - the unique name of the service (length from 1 to 32 characters. Only Latin letters and signs (excluding &). Must begin with a Latin letter. Case matters)
Request example:
/api/create/service/?address=37tBiV8btkNUHTk6Q9bnYZRVyW7XWSseWw4REtsznWgS&pass=123123&name=My$ervIce
Returns:
In case of successful creation of the service:
"result" = True - the success of the creation of the service
In case of an error:
"result" = False
"error" - error description (failed to log in to the wallet, a service with that name already exists, incorrect service name, etc.)
(GET)"/api/service/set_data/" - Writing data to the service
Arguments:
1)address - wallet address
2)pass - password
3)name - the name of the service
4)data - data in the form of a set of bytes (no more than 100 bytes, in Base64 encoding)
Request example:
/api/service/set_data/?address=37tBiV8btkNUHTk6Q9bnYZRVyW7XWSseWw4REtsznWgS&pass=123123&name=My$ervIce&data=0KXRg9C70Lgg0YLRg9GCINGC0LDQuiDQvNCw0LvQvj8g0K3RgtC+INC90LDRiNCwINGC0L7Rh9C60LAg0LHQu9GP0YLRjCEg0KLRiyDQvdCwINC/0LXQvdGR0Log0YHQtdC70L
Returns:
If the data is successfully written to the service:
"result" = True - success of data recording
In case of an error:
"result" = False
"error" - error description (a service with this name does not exist, an incorrect service name, etc.)
(GET)"/api/service/get_data/" - Reading data from the service
Arguments:
1)name - the name of the service
Request example:
/api/service/get_data/?name=My$ervIce
Returns:
In case of an error:
"result" = False
"error" - error description (a service with this name does not exist, etc.)
In case of successful reading of data from the service:
"result" = True - data read success
"data_array" is an array of data from the service, each element of which has the following fields:
"id" - ID of the account that created the record in the service
"unix_time" - date and time of creation of the record (in Unix format)
"data" - recorded data (in ANSI encoding)
(GET)"/api/service_info/" - Request for service data
Arguments:
1)name - the name of the service
Request example:
/api/create/service/?name=My$ervIce
Returns:
In case of a successful request:
"result" = True
"name" - name of the service
"owner_id" - ID of the account-creator of the service
"unix_time" - date and time of creation of the service (in Unix format)
In case of an error:
"result" = False
"error" - error description (a service with this name does not exist, etc.)
(GET) "/api/address_balances/" - Request data about account tokens with their current balance
Arguments:
1)address - account address
Request example:
/api/address_balances/?address=8QjFv11MGJrZcmaxfp8RRER5aJEB3fLokZdYk78Fdqup
Returns:
"balances" - an array of the following pairs:
"symbol" - the short name of the token (abbreviation)
"value" - the current balance of the token
(GET)"/api/restore/cryptocontainer/keys/" - Restore the cryptocontainer with 47 words
Arguments:
1)keys - a list of keys (enumeration with underscores)
2)pass - a new password to access the recoverable cryptographic container
Request example:
/api/restore/cryptocontainer/keys/?keys=GRASS_JOIN_FRUIT_VIRUS_COIL_KNOW_HINT_WILL_HOVER_TRULY_PIGEON_PHONE_BROOM_NOSE_BUBBLE_TICKET_INCREASE_INTO_WISDOM_MINUTE_OMIT_MERGE_DESIGN_KIWI_BICYCLE_PELICAN_RAW_FALSE_EXTEND_MISS_RAIN_FUEL_MOUSE_MUSIC_MIMIC_STYLE_DOOR_SPEED_SEMINAR_ELDER_SONG_MASTER_ELECTRIC_RETREAT_FESTIVAL_SPATIAL_WOMAN&pass=111111
Returns:
"success" - the success of the operation
"address" - the address of the recovered cryptographic container (in the case of "success" = "true")
(GET)"/api/address_info/" - Request data about a specific account with the number of transactions for the specified tokens
Arguments:
1)address - account address
2)tokens - a list of tokens (enumeration through underscores), or "all" to select all tokens.
Request example:
/api/address_info/?address=8QjFv11MGJrZcmaxfp8RRER5aJEB3fLokZdYk78Fdqup&tokens=TOROM_QUIPA_FOLEX
/api/address_info/?address=8QjFv11MGJrZcmaxfp8RRER5aJEB3fLokZdYk78Fdqup&tokens=all
Returns:
"address" - account address
"id" - account id
"trans_count" - the total number of transactions for the specified tokens
"tokens_count" - the total number of tokens in an account with a positive current balance
If one token is specified, then the server response is supplemented with 3 more fields:
"received" - total tokens received
"sent" - total tokens sent
"balance" - the balance of the token at the moment
"symbol" - the short name of the token (abbreviation)
(GET)"/api/address_info_details/" - Request for a list of transactions or account tokens for a specified period of time (with "pagination" of the server response)
Arguments:
1)tab - specifying the subject for the list of data ("transactions" or "tokens")
2)address - account address
3)tokens - a list of tokens (enumeration through underscores), or "all" to select all tokens
4)page - page
5)pagesize - the dimension of the list page (the amount of data on one page)
6)date_from - the start date of the period (in the format dd.mm.yyyy_h:mm:ss); default is 30.12.1899; for tab = "tokens" the value is ignored
7)date_to - date of the end of the period (in the format dd.mm.yyyy_h:mm:ss); by default is equal to this point in time; for tab = "tokens", the value is ignored
8)type - transaction type ("incoming","outgoing", "all"); default is "all"; for tab = "tokens" the value is ignored
3 variations of the request:
1st option: the arguments tab,address,tokens,page,pagesize are specified
Request example:
/api/address_info_details/?tab=tokens&address=8QjFv11MGJrZcmaxfp8RRER5aJEB3fLokZdYk78Fdqup&tokens=all&page=1&pagesize=10
Returns a list of the specified tokens that appear in the account's transaction history for the entire time
2nd option: the arguments tab,address,tokens,page,pagesize,type are specified
Request example:
/api/address_info_details/?tab=transactions&address=8QjFv11MGJrZcmaxfp8RRER5aJEB3fLokZdYk78Fdqup&tokens=all&page=1&pagesize=10&type=incoming
Returns a list of incoming account transactions for the selected tokens for the entire time
3rd option: the arguments tab,address,tokens,page,pagesize,date_from,date_to,type are specified
Request example:
/api/address_info_details/?tab=transactions&address=8QjFv11MGJrZcmaxfp8RRER5aJEB3fLokZdYk78Fdqup&tokens=all&page=1&pagesize=10&date_from=23.07.2020_5:06:26&date_to=05.03.2021_16:33:52&type=incoming
Returns a list of incoming account transactions for the selected tokens for the time period from 07/23/2020_5:06:26 to 03/05/2021_16:33:52 inclusive
For tab = "transactions", the query returns the following information:
"trans_count" - the number of transactions in the generated list.
The array "list" consisting of the elements with the following fields:
"unix_time" - the date and time of the transaction(in Unix format)
"block_number" room block
"from" address for the account of the sender
"to" address for the account of the recipient
"hash" is the hash of the transaction
"token" token(short name)
"sent" - sent
received received
"fee" - the fee(percentage, decimal)
If the "list" is not empty, then the answer is supplemented with information:
"earlier_trans_unix_date" - the date of the last transaction account in the specified time period on the selected tokens(in Unix format)
"latest_trans_unix_date" - the date of the first transaction account in the specified period of time according to the selected tokens(in Unix format)
"earlier_trans_unix_date_ever" - the date of the last transaction account on the selected tokens all the time(in Unix format)
"latest_trans_unix_date_ever" - the date of the first transaction account on the selected tokens all the time(in Unix format)
For tab = "tokens", the query returns the following ifnormation:
"tokens_count" - the number of tokens. If "tokens_count" > 1, then there will be elements with the following fields in the "list" array:
"token" - token (its short name)
"balance" - token balance at the moment
"sent" - sent
"received" - received
"trans_count" - number of transactions with this token
(GET)"/api/address_tokens/" - Request a list of user tokens appearing in his transaction history
Arguments:
1)address - account address
Request example:
/api/address_tokens/?address=8QjFv11MGJrZcmaxfp8RRER5aJEB3fLokZdYk78Fdqup
Returns:
"tokens" is an ordered array of 26 nested arrays (for each letter of the Latin alphabet) with data about tokens having the following fields:
"symbol" is the short name of the token (abbreviation)
"name" is the full name of the token
(GET)"/api/general_info/" - Request for general network information (with "pagination" of the response)
2 variations of the request:
1st option: include arguments:
1)name - specify a subject for the list data ("accounts","transactions","tokens","services", "mined" or "mining")
2)pagesize - dimension page list(the amount of data on one page)
3)page - page
Request example:
/api/general_info/?name=transactions&page=1&pagesize=10
2nd option: arguments are specified:
1)name - specifying the subject for the list of data ("accounts","transactions","tokens","services", "mined", "mining" or "main_info")
2)sortby - sorting field. Possible values: (default "blocknum" for "name" = "transactions", "address" for the "name" = "mining", "main_blocknum" for "name" = "main_info", or "datetime")
For name = 'accounts': datetime(date and time of account creation)
For name = transacions: datetime(date and time of creation of the transaction),
blocknum(block number),
token (short name of the token),
sent(number of tokens sent);
For name = tokens: datetime(date and time of token creation),
ownerid(id of the token creator),
name (full name of the token),
symbol (short name of the token),
decimals(number of decimal places),
volume(token issue volume);
For name = services: datetime(date and time of service creation),
ownerid(id of the service creator),
name(service name);
For name = mined: datetime(date and time of the mining that took place),
blocknum(the number of the block from which the calculation took place);
For name = mining: address(address of the owner of the OM);
For name = main_info: main_blocknum(main chain block id);
3)inverse - reverse sort order. Possible values: true or false(false by default)
4)page - page
5)pagesize - the dimension of the list page (the amount of data on one page)
Request example:
/api/general_info/?name=transactions&sortby=token&inverse=false&page=1&pagesize=100
Returns:
For "name" = "accounts":
"amount_list" - the total number of accounts in the network
Array "list" of elements with the following fields:
"address" - account address
"reg_unix_date" - date and time of account registration (in Unix format)
For "name" = "transactions":
"amount_list" - the total number of transactions in the network
The array "list" of elements with the following fields:
"unix_time" - the date and time of the transaction(in Unix format)
"block_number" room block
"from" address for the account of the sender
"to" address for the account of the recipient
"hash" is the hash of the transaction
"token" token
"sent" - sent
received received
"fee" - the fee(percentage, decimal)
For "name" = "tokens":
"amount_list" - the total number of tokens in the network
Array "list" of elements with the following fields:
"owner_id" - the id of the token owner account
"name" - the full name of the token
"symbol" - the short name of the token (its abbreviation)
"decimals" - the bit depth of the token (the number of zeros after the decimal point)
"volume" - the total volume of the token issue
"unix_time" - the date of creation of the token (in Unix format)
For "name" = "services":
"amount_list" - the total number of services in the network
Array "list" of elements with the following fields:
"name" - name of the service
"owner_id" - id of the account-creator of the service
"unix_time" - date of creation of the service (in Unix format)
For "name" = "mined":
"amount_list" - the total number of past mining
Array "list" of elements with the following fields:
"unix_time" - the date and time of mining (in Unix format)
"validator_address" - the address of the validator who confirmed the mining
"block_number" - the number of the block from which the calculation occurred
For "name" = "mining":
"amount_list" - the total number of past mining
Array "list" of elements with the following fields:
"address" - the address of the owner of the OM
For "name" = "main_info":
"amount_list" - the total number of blocks in the main chain
Array "list" of elements with the following fields:
"main_chain_block_id" - block number in the main chain
"witness_id" - validator id
"owner_sign" - validator signature
"unix_time" - block creation date (in Unix format)
"chain_id" - chain number
"block_id" - block number in the chain
"hash_block" - transaction hash
(GET)"/api/transaction_info/" - Request detailed information about the transaction by its hash
Arguments:
1)hash - hash of the transaction
Request example:
/api/transaction_info/?hash=3nipkywbdx6n3wrs2zq7lkifr7wg
Returns:
"unix_time" - date and time of the transaction(in Unix format)
"block_number" - block number
"from" - address of the sender account
"to" - recipient account address
"hash" - transaction hash
"token" - token(short name)
"sent" - sent
"received" - received
"fee" - commission (percentage, decimal)
(GET)"/api/token_info/" - Request for token information
Arguments:
1)symbol - the short name of the token (its abbreviation)
Request example:
/api/token_info/?symbol=ORBC
Returns:
"owner_id" - id of the account-owner of the token
"name" - the full name of the token
"symbol" - the short name of the token (its abbreviation)
"decimals" - the bit depth of the token (the number of zeros after the decimal point)
"volume" - the total volume of the token issue
"unix_time" - the date of creation of the token (in Unix format)
"trans_count" - the total number of transactions with this token
"owners_count" - the number of accounts with the current positive balance value of this token
(GET)"/api/token_info_details/" - Request for a list of transactions or accounts of holders of the specified token (with "pagination" of the response)
Arguments:
1)tab - specifying the subject for the list of data ("transactions" or "owners")
2)symbol - the short name of the token (its abbreviation)
3)page - page
4)pagesize - the dimension of the list page (the amount of data on one page)
Request example:
/api/token_info_details/?tab=transactions&name=ORBC&page=1&pagesize=10
Returns:
If "tab" = "transactions":
The array "list" of elements with the following fields:
"unix_time" - the date and time of the transaction(in Unix format)
"block_number" room block
"from" address for the account of the sender
"to" address for the account of the recipient
"hash" is the hash of the transaction
"token" token
"sent" - sent
received received
"fee" - the fee(percentage, decimal)
If "tab" = "owners":
Array "list" of elements with the following fields:
"id" - account id
"address" - account address
"reg_unix_date" - account registration date (in Unix format)
"balance" - current token balance
(GET)"/api/statistics/" - Request statistics for the specified time period
Arguments:
1)tab - specifying the subject for the list of data (currently only "validators")
2)date_from - the start date of the period (in the format dd.mm.yyyy_h:mm:ss); by default, it is equal to the current time minus 604800 seconds(7 days)
3)date_to - date of the end of the period (in the format dd.mm.yyyy_h:mm:ss); by default is equal to this moment in time
4)step - the "step" of the sample; by default it is 86400 seconds (1 day)
2 variations of the query:
1st option: the "tab" argument is specified
Request example:
/api/statistics/?tab=validators
2nd option: all arguments are specified
Request example:
/api/statistics/?tab=validators&date_from=12.07.2021_5:14:14&date_to=13.07.2021_6:14:14&step=3600
Returns:
Array "list" of elements (including boundary values) with the following fields:
"unix_time" - date
"count" - quantity
(GET)"/api/mining_info/" - Request for information about the last mining
Arguments: not expected
Request example:
/api/mining_info/
Returns:
"next_mining_date" - date and time of the next mining (in Unix format)
"OM_count" - number of OM in the network
"ORBC_in_circulation" - number of ORBC in circulation