-
Notifications
You must be signed in to change notification settings - Fork 4
/
thor.yaml
2488 lines (2323 loc) · 100 KB
/
thor.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
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
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
openapi: 3.0.3
info:
title: Thorest API
description: |
RESTful API to access VechainThor Network
[Project Home](https://github.com/vechain/thor)
license:
name: LGPL 3.0
url: https://www.gnu.org/licenses/lgpl-3.0.en.html
version: 2.1.0
servers:
- url: https://mainnet.vechain.org/
description: Main
- url: https://testnet.vechain.org/
description: Test
tags:
- name: Accounts
description: |
Provides access to on-chain account information. This includes details about account balances, contract states, and related functionalities.
- name: Transactions
description: |
Manages blockchain transactions, enabling the creation, retrieval, and verification of transactions on the blockchain.
- name: Blocks
description: |
Retrieves information about on-chain blocks.
- name: Logs
description: |
Query on-chain logs stemming from transaction outputs. This feature empowers users to delve into the intricacies of transaction history, providing a comprehensive view of on-chain activities.
- name: Node
description: |
Provides information about the node's status.
- name: Subscriptions
description: |
Facilitates WebSocket-based interactions with the blockchain, allowing users to subscribe to real-time events, updates, or notifications related to specific blockchain activities.
- name: Debug
description: |
Offers a set of debugging utilities.
paths:
/accounts/{address}:
get:
parameters:
- $ref: '#/components/parameters/GetAddressInPath'
- $ref: '#/components/parameters/RevisionInQuery'
tags:
- Accounts
summary: Retrieve account details
description: |
Retrieve information about an account or a contract identified by its `address`.
To access historical details, you can specify a `revision` as a query parameter.
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/GetAccountResponse'
'400':
description: Bad Request
content:
text/plain:
schema:
type: string
example: 'Invalid address'
/accounts/*:
post:
parameters:
- $ref: '#/components/parameters/RevisionInQuery'
tags:
- Accounts
summary: Inspect clauses
description: |
This endpoint can be used for various purposes:
- Read contract state.
- Simulate the execution of a transaction. This can be useful to determine if your transaction may revert before submitting it.
- Inspect the outputs of a transaction before executing it.
- Estimate the gas consumption of a transaction. <b>Note:</b> The `caller` field should be provided for higher accuracy.
The fields `gasPrice`, `gasPayer`, `provedWork`, `blockRef` and `expiration` are for exposing themselves in EVM. Transaction meta features won't be reflected in the result, for example, no error is returned if the transaction is technically expired. For more information, please refer to the vechain documentation.
To access historical details, you can specify a `revision` as a query parameter.
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/ExecuteCodesRequest'
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/ExecuteCodesResponse'
'400':
description: Bad Request
content:
text/plain:
schema:
type: string
example: 'Invalid address'
/accounts/{address}/code:
parameters:
- $ref: '#/components/parameters/GetAddressInPath'
- $ref: '#/components/parameters/RevisionInQuery'
get:
tags:
- Accounts
summary: Retrieve a contract's bytecode
description: |
If the provided address is not a contract, empty bytecode is returned.
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/GetAccountCodeResponse'
'400':
description: Bad Request
content:
text/plain:
schema:
type: string
example: 'Invalid address'
/accounts/{address}/storage/{key}:
parameters:
- $ref: '#/components/parameters/GetStorageAddressInPath'
- $ref: '#/components/parameters/StorageKeyInPath'
- $ref: '#/components/parameters/RevisionInQuery'
get:
tags:
- Accounts
summary: Retrieve the value for a storage position
description: |
This endpoint allows you to retrieve the value stored at a specific storage position (`{key}`) of a Vechain smart contract associated with the provided address (`{address}`). The response will contain information about the stored value for the given key.
To access historical details, you can specify a `revision` as a query parameter.
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/GetStorageResponse'
'400':
description: Bad Request
content:
text/plain:
schema:
type: string
example: 'Invalid address'
/transactions/{id}:
get:
parameters:
- $ref: '#/components/parameters/TxIDInPath'
- $ref: '#/components/parameters/RawTxInQuery'
- $ref: '#/components/parameters/HeadInQuery'
- $ref: '#/components/parameters/PendingInQuery'
tags:
- Transactions
summary: Retrieve a transaction by ID
description: |
This endpoint allows you to retrieve a transaction identified by its ID. If the `pending` parameter is set to true, the response may include a pending transaction with a null `meta` field. Use this option when you want to retrieve pending transactions, providing flexibility in accessing real-time transaction data.
If no transaction is found, the response will be be a `200` with a `null` body.
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/GetTxResponse'
'400':
description: Bad Request
content:
text/plain:
schema:
type: string
example: 'Invalid transaction ID'
/transactions/{id}/receipt:
get:
parameters:
- $ref: '#/components/parameters/TxIDInPath'
- $ref: '#/components/parameters/HeadInQuery'
tags:
- Transactions
summary: Retrieve transaction receipt
description: |
This endpoint allows you to retrieve the receipt of a transaction identified by its ID. If the transaction is not found, the response will be `null`.
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/GetTxReceiptResponse'
'400':
description: Bad Request
content:
text/plain:
schema:
type: string
example: 'Invalid transaction ID'
/transactions:
post:
tags:
- Transactions
summary: Send a transaction
description: |
This endpoint allows you to send a transaction to the blockchain. The transaction must be signed and RLP encoded.
The below is a TypeScript example of how to sign and RLP encode a transaction using the `thor-devkit` library:
```typescript
import { Transaction, secp256k1 } from 'thor-devkit'
const clauses = [{
to: '0x7567d83b7b8d80addcb281a71d54fc7b3364ffed',
value: 10000,
data: '0x'
}]
let body: Transaction.Body = {
chainTag: '0x4a',
blockRef: '0x0000000000000000',
expiration: 32,
clauses: clauses,
gasPriceCoef: 128,
gas: Transaction.intrinsicGas(clauses),
dependsOn: null,
nonce: 12345678
}
const tx = new Transaction(body)
const signingHash = tx.signingHash()
tx.signature = secp256k1.sign(signingHash, Buffer.from("99f0500549792796c14fed62011a51081dc5b5e68fe8bd8a13b86be829c4fd36", "hex"))
const raw = tx.encode()
const decoded = Transaction.decode(raw)
axios.post('http://localhost:8669/transactions', {
raw: '0x' + raw.toString('hex')
})
```
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/RawTx'
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/TXID'
'400':
description: Bad Request
content:
text/plain:
schema:
type: string
example: 'Invalid transaction'
'403':
description: Forbidden
content:
text/plain:
schema:
type: string
example: 'Insufficient energy'
/blocks/{revision}:
get:
parameters:
- $ref: '#/components/parameters/RevisionInPath'
- $ref: '#/components/parameters/ExpandedInQuery'
tags:
- Blocks
summary: Retrieve a block
description: |
Retrieve information about a block identified by its `revision`.
If the provided `revision` is not found, the response will be `null`
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/GetBlockResponse'
'400':
description: Bad Request
content:
text/plain:
schema:
type: string
example: 'Invalid revision'
/logs/event:
post:
tags:
- Logs
summary: Query smart contract events
description: |
Query event logs generated by vechain smart contracts. Events are created using the `LOG` opcode in the Ethereum Virtual Machine (EVM).
Event logs provide a way to track specific occurrences and state changes within a smart contract. By querying these logs, you can gain insights into the history of events emitted by a particular contract.
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/EventLogFilterRequest'
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/EventLogsResponse'
'400':
description: Bad Request
content:
text/plain:
schema:
type: string
example: 'Invalid request body'
/logs/transfer:
post:
tags:
- Logs
summary: Query VET transfer events
description: |
Query VET transfers with a given criteria.
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/TransferLogFilterRequest'
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/TransferLogsResponse'
'400':
description: Bad Request
content:
text/plain:
schema:
type: string
example: 'Invalid request body'
/node/network/peers:
get:
tags:
- Node
summary: Retrieve connected peers
description: |
Retrieve information about the peers connected to the node.
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/GetPeersResponse'
/subscriptions/block:
get:
tags:
- Subscriptions
summary: '(Websocket) Blocks'
description: |
Establish a websocket connection to the node to receive real-time updates on new blocks.
This endpoint can also be used to resume a subscription from a specific point in time.
Example:
```javascript
const ws = new WebSocket('ws://localhost:8669/subscriptions/block')
ws.onmessage = (event) => {
console.log(event.data)
}
```
parameters:
- $ref: '#/components/parameters/PositionInQuery'
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/SubscriptionBlockResponse'
'400':
description: Bad Request
content:
text/plain:
schema:
type: string
example: 'Invalid position'
'403':
description: Forbidden
content:
text/plain:
schema:
type: string
example: '"pos" is out of range'
/subscriptions/event:
get:
tags:
- Subscriptions
summary: (Websocket) Events
description: |
Subscribe to events generated by vechain smart contracts. Events are created using the `LOG` opcode in the Ethereum Virtual Machine (EVM).
Example:
```javascript
// Filter the events by 'Transfer(address,address,uint256)'
const ws = new WebSocket('ws://localhost:8669/subscriptions/event?t0=0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef')
ws.onmessage = (event) => {
console.log(event.data)
}
```
parameters:
- $ref: '#/components/parameters/PositionInQuery'
- $ref: '#/components/parameters/AddrInQuery'
- $ref: '#/components/parameters/Topic0InQuery'
- $ref: '#/components/parameters/Topic1InQuery'
- $ref: '#/components/parameters/Topic2InQuery'
- $ref: '#/components/parameters/Topic3InQuery'
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/SubscriptionEventResponse'
'400':
description: Bad Request
content:
text/plain:
schema:
type: string
example: 'Invalid position'
'403':
description: Forbidden
content:
text/plain:
schema:
type: string
example: '"pos" is out of range'
/subscriptions/transfer:
get:
tags:
- Subscriptions
summary: (Websocket) Transfers
description: |
Subscribe to VET transfers with a given criteria.
Example:
```javascript
const ws = new WebSocket('ws://localhost:8669/subscriptions/transfer?sender=0x6d95e6dca01d109882fe1726a2fb9865fa41e7aa')
ws.onmessage = (event) => {
console.log(event.data)
}
```
parameters:
- $ref: '#/components/parameters/PositionInQuery'
- $ref: '#/components/parameters/TxOriginInQuery'
- $ref: '#/components/parameters/TransferRecipientInQuery'
- $ref: '#/components/parameters/TransferSenderInQuery'
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/SubscriptionEventResponse'
'400':
description: Bad Request
content:
text/plain:
schema:
type: string
example: 'Invalid position'
'403':
description: Forbidden
content:
text/plain:
schema:
type: string
example: '"pos" is out of range'
/subscriptions/beat2:
get:
tags:
- Subscriptions
summary: '(Websocket) Beats'
description: |
Establish a websocket connection to receive blockchain beats, which contain a summary of new blocks and bloom filters composited with affected addresses.
Example:
```javascript
const ws = new WebSocket('ws://localhost:8669/subscriptions/beat2')
ws.onmessage = (event) => {
console.log(event.data)
}
```
parameters:
- $ref: '#/components/parameters/PositionInQuery'
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/SubscriptionBeat2Response'
'400':
description: Bad Request
content:
text/plain:
schema:
type: string
example: 'Invalid position'
'403':
description: Forbidden
content:
text/plain:
schema:
type: string
example: '"pos" is out of range'
/subscriptions/txpool:
get:
tags:
- Subscriptions
summary: (Websocket) Subscribe to new transactions
description: |
Establish a websocket connection to receive real-time updates on transactions that are pending inclusion in a future block.
Example:
```javascript
const ws = new WebSocket('ws://localhost:8669/subscriptions/txpool')
ws.onmessage = (event) => {
console.log(event.data)
}
```
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/TXID'
'400':
description: Bad Request
content:
text/plain:
schema:
type: string
example: 'Invalid position'
'403':
description: Forbidden
content:
text/plain:
schema:
type: string
example: '"pos" is out of range'
/subscriptions/beat:
get:
deprecated: true
tags:
- Subscriptions
summary: '(Websocket) Subscribe to Blockchain Beats'
description: |
Establish a websocket connection to receive blockchain beats, which contain a summary of new blocks and bloom filters composited with affected addresses.
Example:
```javascript
const ws = new WebSocket('ws://localhost:8669/subscriptions/beat')
ws.onmessage = (event) => {
console.log(event.data)
}
```
parameters:
- $ref: '#/components/parameters/PositionInQuery'
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/SubscriptionBeatResponse'
'400':
description: Bad Request
content:
text/plain:
schema:
type: string
example: 'Invalid position'
'403':
description: Forbidden
content:
text/plain:
schema:
type: string
example: '"pos" is out of range'
/debug/tracers:
post:
tags:
- Debug
summary: Trace a transaction clause
description:
This endpoint allows you to create a tracer for a specific clause. Tracers are instrumental in monitoring and analyzing the execution flow within the EVM.
You can customize the tracer using various options to tailor it to your specific debugging needs.
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/PostDebugTracerRequest'
responses:
'200':
description: OK
content:
application/json:
schema:
description: |
The response will depend on the type of tracer you have created.
type: object
'400':
description: Bad Request
content:
text/plain:
schema:
type: string
example: 'Invalid target'
/debug/tracers/call:
post:
tags:
- Debug
summary: Trace a contract call
description: |
This endpoint enables clients to create a tracer for a specific vechain function call.
You can customize the tracer using various options to suit your debugging requirements.
parameters:
- $ref: '#/components/parameters/HeadInQuery'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/PostDebugTracerCallRequest'
responses:
'200':
description: OK
content:
application/json:
schema:
description: |
The response will depend on the type of tracer you have created.
type: object
'400':
description: Bad Request
content:
text/plain:
schema:
type: string
example: 'Invalid request body'
/debug/storage-range:
post:
tags:
- Debug
summary: Retrieve storage range
description: |
of the account with given address
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/StorageRangeOption'
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/StorageRange'
'400':
description: Bad Request
content:
text/plain:
schema:
type: string
example: 'Invalid address'
components:
schemas:
GetAccountResponse:
type: object
properties:
balance:
type: string
description: VET balance in wei, presented as a hexadecimal string.
example: '0x47ff1f90327aa0f8e'
required: true
nullable: false
energy:
type: string
description: Energy (VTHO) in wei, presented as a hexadecimal string.
example: '0xcf624158d591398'
required: true
nullable: false
hasCode:
type: boolean
description: Indicates whether the account is a contract (true) or not (false).
example: false
required: true
nullable: false
example:
balance: '0x47ff1f90327aa0f8e'
energy: '0xcf624158d591398'
hasCode: false
ExecuteCodesRequest:
type: object
allOf:
- $ref: '#/components/schemas/ExtendedCallData'
- $ref: '#/components/schemas/BatchCallData'
example:
gas: 50000
gasPrice: '1000000000000000'
caller: '0x6d95e6dca01d109882fe1726a2fb9865fa41e7aa'
provedWork: '1000'
gasPayer: '0xd3ae78222beadb038203be21ed5ce7c9b1bff602'
expiration: 1000
blockRef: '0x00000000851caf3c'
clauses:
# Contract Call (VTHO Transfer)
- to: '0x0000000000000000000000000000456E65726779'
value: '0x0'
data: '0xa9059cbb0000000000000000000000000f872421dc479f3c11edd89512731814d0598db50000000000000000000000000000000000000000000000013f306a2409fc0000'
# VET Transfer
- to: '0xf077b491b355E64048cE21E3A6Fc4751eEeA77fa'
value: '0x6124fee993bc00000'
data: '0x'
# Contract Deployment
- to: null
value: '0x0'
data: '0x6080604052348015600f57600080fd5b50609f8061001e6000396000f300608060405260043610603f576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680631820cabb146044575b600080fd5b348015604f57600080fd5b506056606c565b6040518082815260200191505060405180910390f35b62015180815600a165627a7a723058200ac7475da248e2fc26c057319e296e90c24d5f8b9bf956fb3b77545642cad3b10029'
ExecuteCodesResponse:
type: array
items:
$ref: '#/components/schemas/CallResult'
example:
# Contract Call (VTHO Transfer)
- data: '0x0000000000000000000000000000000000000000000000000000000000000001'
events:
- address: '0x0000000000000000000000000000456e65726779'
topics:
- '0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef'
- '0x000000000000000000000000435933c8064b4ae76be665428e0307ef2ccfbd68'
- '0x0000000000000000000000000f872421dc479f3c11edd89512731814d0598db5'
data: '0x0000000000000000000000000000000000000000000000013f306a2409fc0000'
transfers: []
gasUsed: 13326
reverted: false
vmError: ''
# VET Transfer
- data: '0x'
events: []
transfers:
- sender: '0x435933c8064b4ae76be665428e0307ef2ccfbd68'
recipient: '0xf077b491b355e64048ce21e3a6fc4751eeea77fa'
amount: '0x6124fee993bc00000'
gasUsed: 0
reverted: false
vmError: ''
# Contract Deployment
- data: '0x608060405260043610603f576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680631820cabb146044575b600080fd5b348015604f57600080fd5b506056606c565b6040518082815260200191505060405180910390f35b62015180815600a165627a7a723058200ac7475da248e2fc26c057319e296e90c24d5f8b9bf956fb3b77545642cad3b10029'
events:
- address: '0xecadd5492c1fa085e40e2c17e79f1a03f38f86ca'
topics:
- '0xb35bf4274d4295009f1ec66ed3f579db287889444366c03d3a695539372e8951'
data: '0x000000000000000000000000435933c8064b4ae76be665428e0307ef2ccfbd68'
transfers: []
gasUsed: 31881
reverted: false
vmError: ''
GetAccountCodeResponse:
type: object
properties:
code:
type: string
description: Contract bytecode, presented as a hexadecimal string.
example: '0x6060604052600080fd00a165627a7a72305820c23d3ae2dc86ad130561a2829d87c7cb8435365492bd1548eb7e7fc0f3632be90029'
nullable: false
required: true
pattern: '^0x[0-9a-f]*$'
example:
code: '0x6060604052600080fd00a165627a7a72305820c23d3ae2dc86ad130561a2829d87c7cb8435365492bd1548eb7e7fc0f3632be90029'
GetStorageResponse:
type: object
properties:
value:
type: string
description: The value stored at the given storage position.
example: '0x0000000000000000000000000000000000000000000000000000000000000001'
nullable: false
required: true
pattern: '^0x[0-9a-f]*$'
example:
value: '0x0000000000000000000000000000000000000000000000000000000000000001'
GetTxResponse:
type: object
oneOf:
- allOf:
- $ref: '#/components/schemas/Tx'
- properties:
meta:
$ref: '#/components/schemas/TxMeta'
- allOf:
- $ref: '#/components/schemas/RawTx'
- properties:
meta:
$ref: '#/components/schemas/TxMeta'
example:
id: '0x4de71f2d588aa8a1ea00fe8312d92966da424d9939a511fc0be81e65fad52af8'
chainTag: 1
blockRef: '0x00000001511fc0be'
expiration: 30
clauses: []
gasPriceCoef: 128
gas: 21000
origin: '0x7567d83b7b8d80addcb281a71d54fc7b3364ffed'
delegator: null
nonce: '0xd92966da424d9939'
dependsOn: null
size: 180
meta:
blockID: '0x00000001c458949985a6d86b7139690b8811dd3b4647c02d4f41cdefb7d32327'
blockNumber: 1
blockTimestamp: 1523156271
GetTxReceiptResponse:
type: object
allOf:
- $ref: '#/components/schemas/Receipt'
- properties:
meta:
$ref: '#/components/schemas/ReceiptMeta'
GetBlockResponse:
type: object
allOf:
- $ref: '#/components/schemas/Block'
- $ref: '#/components/schemas/IsTrunk'
- $ref: '#/components/schemas/IsFinalized'
- oneOf:
- properties:
transactions:
description: An array of transaction IDs
type: array
required: true
nullable: false
minItems: 0
items:
type: string
example: '0x284bba50ef777889ff1a367ed0b38d5e5626714477c40de38d71cedd6f9fa477'
- properties:
transactions:
description: All included transactions, expanded, to include their receipts
type: array
required: true
nullable: false
minItems: 0
items:
allOf:
- $ref: '#/components/schemas/Tx'
- $ref: '#/components/schemas/Receipt'
example:
number: 325324
id: '0x0004f6cc88bb4626a92907718e82f255b8fa511453a78e8797eb8cea3393b215'
size: 373
parentID: '0x0004f6cb730dbd90fed09d165bfdf33cc0eed47ec068938f6ee7b7c12a4ea98d'
timestamp: 1533267900
gasLimit: 11253579
beneficiary: '0xb4094c25f86d628fdd571afc4077f0d0196afb48'
gasUsed: 21000
totalScore: 1029988
txsRoot: '0x89dfd9fcd10c9e53d68592cf8b540b280b72d381b868523223992f3e09a806bb'
txsFeatures: 0
stateRoot: '0x86bcc6d214bc9d8d0dedba1012a63c8317d19ce97f60c8a2ef5c59bbd40d4261'
receiptsRoot: '0x15787e2533c470e8a688e6cd17a1ee12d8457778d5f82d2c109e2d6226d8e54e'
com: true
signer: '0xab7b27fc9e7d29f9f2e5bd361747a5515d0cc2d1'
isTrunk: true
isFinalized: false
transactions:
- '0x284bba50ef777889ff1a367ed0b38d5e5626714477c40de38d71cedd6f9fa477'
EventLogFilterRequest:
type: object
properties:
range:
$ref: '#/components/schemas/FilterRange'
options:
$ref: '#/components/schemas/FilterOptions'
criteriaSet:
type: array
required: false
nullable: true
minItems: 0
items:
$ref: '#/components/schemas/EventCriteria'
order:
description: |
Specifies the order of the results. Use `asc` for ascending order, and `desc` for descending order.
Default value: `asc`
type: string
required: false
nullable: true
enum:
- asc
- desc
EventLogsResponse:
type: array
minItems: 0
nullable: false
required: true
items:
allOf:
- $ref: '#/components/schemas/Event'
- properties:
meta:
$ref: '#/components/schemas/LogMeta'
TransferLogFilterRequest:
type: object
properties:
range:
$ref: '#/components/schemas/FilterRange'
options:
$ref: '#/components/schemas/FilterOptions'
criteriaSet:
type: array
nullable: true
required: false
minItems: 0
items:
$ref: '#/components/schemas/TransferCriteria'