forked from aptos-labs/aptos-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
openapi.yaml
1711 lines (1654 loc) · 51.6 KB
/
openapi.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: Aptos Dev API Specification
description: >
The Aptos Node API is a RESTful API for client applications to interact with the Aptos blockchain.
license:
name: Apache 2.0
url: https://www.apache.org/licenses/LICENSE-2.0.html
version: 0.1.1
contact:
name: Aptos
url: https://github.com/aptos-labs/aptos-core
tags:
- name: general
description: General information
- name: transactions
description: Access to transactions
- name: accounts
description: Access to account resources and modules
- name: events
description: Access to events
paths:
/:
get:
summary: Ledger information
operationId: get_ledger_info
tags:
- general
responses:
"200":
description: Returns the latest ledger information.
content:
application/json:
schema:
$ref: '#/components/schemas/LedgerInfo'
"400":
$ref: '#/components/responses/400'
"500":
$ref: '#/components/responses/500'
/spec.html:
get:
summary: API document
operationId: get_spec_html
tags:
- general
responses:
"200":
description: Returns OpenAPI specification html document.
"400":
description: Bad Request
/openapi.yaml:
get:
summary: OpenAPI specification
operationId: get_spec_yaml
tags:
- general
responses:
"200":
description: Returns OpenAPI specification YAML document.
"400":
description: Bad Request
/accounts/{address}:
get:
summary: Get account
operationId: get_account
tags:
- accounts
- state
parameters:
- $ref: '#/components/parameters/AccountAddress'
responses:
"200":
description: Returns the latest account core data resource.
content:
application/json:
schema:
$ref: '#/components/schemas/Account'
"400":
$ref: '#/components/responses/400'
"404":
$ref: '#/components/responses/404'
"500":
$ref: '#/components/responses/500'
/accounts/{address}/resources:
get:
summary: Get account resources
operationId: get_account_resources
tags:
- accounts
- state
parameters:
- $ref: '#/components/parameters/AccountAddress'
- $ref: '#/components/parameters/LedgerVersion'
responses:
"200":
description: |
This API returns account resources for a specific ledger version (AKA transaction version).
If not present, the latest version is used.
The Aptos nodes prune account state history, via a configurable time window (link).
If the requested data has been pruned, the server responds with a 404
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/AccountResource'
"400":
$ref: '#/components/responses/400'
"404":
$ref: '#/components/responses/404'
"500":
$ref: '#/components/responses/500'
/accounts/{address}/resource/{resource_type}:
get:
summary: Get resource by account address and resource type.
operationId: get_account_resource # TODO: make it query_resource if query path is supported
description: |
This API renders a resource identified by the owner account
`address` and the `resource_type`, at a ledger version (AKA
transaction version) specified as a query param, otherwise the
latest version is used.
tags:
- accounts
- state
parameters:
- $ref: '#/components/parameters/AccountAddress'
- name: resource_type
in: path
required: true
schema:
$ref: '#/components/schemas/MoveStructTagId'
example: "0x1::AptosAccount::AptosAccount"
- $ref: '#/components/parameters/LedgerVersion'
responses:
"200":
description: Returns a resource.
content:
application/json:
schema:
$ref: '#/components/schemas/AccountResource'
"400":
$ref: '#/components/responses/400'
"404":
$ref: '#/components/responses/404'
"500":
$ref: '#/components/responses/500'
/accounts/{address}/modules:
get:
summary: Get account modules
operationId: get_account_modules
tags:
- accounts
- state
parameters:
- $ref: '#/components/parameters/AccountAddress'
- $ref: '#/components/parameters/LedgerVersion'
responses:
"200":
description: |
This API returns account modules for a specific ledger version (AKA transaction version).
If not present, the latest version is used.
The Aptos nodes prune account state history, via a configurable time window (link).
If the requested data has been pruned, the server responds with a 404
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/MoveModule'
"400":
$ref: '#/components/responses/400'
"404":
$ref: '#/components/responses/404'
"500":
$ref: '#/components/responses/500'
/accounts/{address}/module/{module_name}:
get:
summary: Get module by module id.
operationId: get_account_module
description: |
This API renders a Move module identified by the module id. A
module id consists of the module owner `address` and the
`module_name`. The module is rendered at a ledger version (AKA
transaction version) specified as a query param, otherwise the
latest version is used.
tags:
- accounts
- state
parameters:
- $ref: '#/components/parameters/AccountAddress'
- name: module_name
in: path
required: true
description: The name of the module.
schema:
type: string
example: "GUID"
- $ref: '#/components/parameters/LedgerVersion'
responses:
"200":
description: Returns a move module.
content:
application/json:
schema:
$ref: '#/components/schemas/MoveModule'
"400":
$ref: '#/components/responses/400'
"404":
$ref: '#/components/responses/404'
"500":
$ref: '#/components/responses/500'
/transactions:
get:
summary: Get transactions
operationId: get_transactions
tags:
- transactions
parameters:
- $ref: '#/components/parameters/StartVersion'
- $ref: '#/components/parameters/Limit'
responses:
"200":
description: Returns on-chain transactions, paginated.
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/OnChainTransaction'
"400":
$ref: '#/components/responses/400'
"404":
$ref: '#/components/responses/404'
"500":
$ref: '#/components/responses/500'
post:
summary: Submit transaction
operationId: submit_transaction
description: |
**Submit transaction using JSON without additional tools**
* Send [POST /transactions/signing_message](#operation/create-signing-message) to create transaction signing message.
* Sign the transaction signing message and create transaction signature.
* Submit the user transaction request with the transaction siganture. The request header "Content-Type" must set to "application/json".
tags:
- transactions
requestBody:
description: |
User transaction request with transaction sender's signature.
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/SubmitTransactionRequest'
responses:
"202":
description: Transaction is accepted and submitted to mempool.
content:
application/json:
schema:
$ref: '#/components/schemas/PendingTransaction'
"400":
$ref: '#/components/responses/400'
"413":
$ref: '#/components/responses/413'
"415":
$ref: '#/components/responses/415'
"500":
$ref: '#/components/responses/500'
/accounts/{address}/transactions:
get:
summary: Get account transactions
operationId: get_account_transactions
tags:
- transactions
parameters:
- $ref: '#/components/parameters/AccountAddress'
- $ref: '#/components/parameters/StartVersion'
- $ref: '#/components/parameters/Limit'
responses:
"200":
description: Returns on-chain transactions, paginated.
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/OnChainTransaction'
"400":
$ref: '#/components/responses/400'
"500":
$ref: '#/components/responses/500'
/transactions/{txn_hash_or_version}:
get:
summary: Get transaction
description: |
There are two types of transaction identifiers:
1. Transaction hash: included in any transaction JSON respond from server.
2. Transaction version: included in on-chain transaction JSON respond from server.
When given transaction hash, server first looks up on-chain transaction by hash;
if no on-chain transaction found, then look up transaction by hash in the mempool
(pending) transactions.
When given a transaction version, server looks up the transaction on-chain by version.
To create a transaction hash:
1. Create hash message bytes: "Aptos::Transaction" bytes + BCS bytes of [Transaction](https://aptos-labs.github.io/aptos-core/aptos_types/transaction/enum.Transaction.html).
2. Apply hash algorithm `SHA3-256` to the hash message bytes.
3. Hex-encode the hash bytes with `0x` prefix.
operationId: get_transaction
tags:
- transactions
parameters:
- name: txn_hash_or_version
in: path
required: true
description: |
* Transaction hash should be hex-encoded bytes string with `0x` prefix.
* Transaction version is an `uint64` number.
schema:
type: string
responses:
"200":
description: |
Returns a pending / on-chain transaction.
content:
application/json:
schema:
$ref: '#/components/schemas/Transaction'
"400":
$ref: '#/components/responses/400'
"404":
$ref: '#/components/responses/404'
"500":
$ref: '#/components/responses/500'
/transactions/signing_message:
post:
summary: Create transaction signing message
description: |
This API creates transaction signing message for client to create
transaction signature.
The success response contains hex-encoded signing message bytes.
**To sign the message**
1. Client first needs to HEX decode the `message` into bytes.
2. Then sign the bytes to create signature.
operationId: create_signing_message
tags:
- transactions
requestBody:
description: User transaction request
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/UserTransactionRequest'
responses:
"200":
description: |
Returns hex-encoded transaction signing message bytes.
content:
application/json:
schema:
type: object
required:
- message
properties:
message:
$ref: '#/components/schemas/HexEncodedBytes'
"400":
$ref: '#/components/responses/400'
"404":
$ref: '#/components/responses/404'
"413":
$ref: '#/components/responses/413'
"415":
$ref: '#/components/responses/415'
"500":
$ref: '#/components/responses/500'
/events/{event_key}:
get:
summary: Get events by event key
operationId: get_events_by_event_key
tags:
- events
parameters:
- name: event_key
in: path
required: true
description: |
Event key for an event stream.
It is BCS serialized bytes of `guid` field in the Move struct `EventHandle`.
schema:
$ref: '#/components/schemas/HexEncodedBytes'
responses:
"200":
description: |
Returns events
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Event'
"400":
$ref: '#/components/responses/400'
"404":
$ref: '#/components/responses/404'
"500":
$ref: '#/components/responses/500'
/accounts/{address}/events/{event_handle_struct}/{field_name}:
get:
summary: Get events by event handle
operationId: get_events_by_event_handle
description: |
This API extracts event key from the account resource identified
by the `event_handle_struct` and `field_name`, then returns
events identified by the event key.
tags:
- events
parameters:
- $ref: '#/components/parameters/AccountAddress'
- name: event_handle_struct
in: path
required: true
schema:
$ref: '#/components/schemas/MoveStructTagId'
example: "0x1::AptosAccount::AptosAccount"
- name: field_name
in: path
required: true
description: |
The field name of the `EventHandle` in the struct.
schema:
type: string
example: "sent_events"
- $ref: '#/components/parameters/EventStart'
- $ref: '#/components/parameters/EventLimit'
responses:
"200":
description: |
Returns events
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Event'
"400":
$ref: '#/components/responses/400'
"404":
$ref: '#/components/responses/404'
"500":
$ref: '#/components/responses/500'
/tables/{table_handle}/item:
post:
summary: Get table item by handle and key.
description: |
Gets a table item for a table identified by the handle and the key for the item.
Key and value types need to be passed in to help with key serialization and value deserialization.
operationId: get_table_item
tags:
- state
- table
parameters:
- name: table_handle
in: path
required: true
schema:
title: Table Handle
type: string
format: uint128
description: the table handle
example: "1283023094380"
requestBody:
description: Table item request
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/TableItemRequest'
responses:
"200":
description: Returns the table item value rendered in JSON.
content:
application/json:
schema:
type: object
"400":
$ref: '#/components/responses/400'
"404":
$ref: '#/components/responses/404'
"413":
$ref: '#/components/responses/413'
"415":
$ref: '#/components/responses/415'
"500":
$ref: '#/components/responses/500'
components:
parameters:
AccountAddress:
name: address
in: path
required: true
schema:
$ref: '#/components/schemas/Address'
LedgerVersion:
name: version
in: query
required: false
schema:
$ref: '#/components/schemas/LedgerVersion'
StartVersion:
name: start
in: query
required: false
description: The start transaction version of the page. Default is the latest ledger version.
example: 1
schema:
type: integer
Limit:
name: limit
in: query
required: false
description: The max number of transactions should be returned for the page. Default is 25.
example: 25
schema:
type: integer
EventStart:
name: start
in: query
required: false
description: |
The start sequence number in the EVENT STREAM, defaulting to the latest event.
The events are returned in the reverse order of sequence numbers.
schema:
type: integer
EventLimit:
name: limit
in: query
required: false
description: The number of events to be returned for the page default is 5
example: 25
schema:
type: integer
responses:
"400":
description: |
Bad request due to a client error: invalid request headers, parameters or body.
Client should not retry the request without modification.
content:
application/json:
schema:
allOf:
- $ref: "#/components/schemas/AptosError"
example:
code: 400
message: "invalid parameter"
"404":
description: |
Resource or data not found.
Client may retry the request if it is waiting for transaction execution or ledger synchronization.
content:
application/json:
schema:
allOf:
- $ref: "#/components/schemas/AptosError"
example:
code: 404
message: "resource not found"
aptos_ledger_version: "37829327"
"413":
description: |
The request payload is too large.
content:
application/json:
schema:
allOf:
- $ref: "#/components/schemas/AptosError"
example:
code: 413
message: "The request payload is too large"
"415":
description: |
The request's content-type is not supported.
content:
application/json:
schema:
allOf:
- $ref: "#/components/schemas/AptosError"
example:
code: 415
message: "The request's content-type is not supported"
"500":
description: |
Server internal error, caused by unexpected issues.
content:
application/json:
schema:
allOf:
- $ref: "#/components/schemas/AptosError"
example:
code: 500
message: "unexpected internal error"
schemas:
AptosError:
title: Response Error
type: object
required:
- code
- message
properties:
code:
type: integer
message:
type: string
aptos_ledger_version:
$ref: '#/components/schemas/LedgerVersion'
Uint64:
title: uint64
type: string
format: uint64
description: Unsigned int64 type value
example: "32425224034"
Address:
title: Account Address
type: string
format: address
description: |
Hex-encoded 16 bytes Aptos account address.
Prefixed with `0x` and leading zeros are trimmed.
See [doc](https://diem.github.io/move/address.html) for more details.
example: "0xdd"
HexEncodedBytes:
title: Hex-encoded Bytes
type: string
format: hex
description: |
All bytes data are represented as hex-encoded string prefixed with `0x` and fulfilled with
two hex digits per byte.
Different with `Address` type, hex-encoded bytes should not trim any zeros.
example: "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1"
TimestampSec:
title: Timestamp in Seconds
type: string
format: uint64
description: |
Timestamp in seconds, e.g. transaction expiration timestamp.
example: "1635447454"
TimestampUsec:
title: Timestamp in Microseconds
type: string
format: uint64
description: |
Timestamp in microseconds, e.g. ledger / block creation timestamp.
example: "1632507671675208"
LedgerVersion:
title: Ledger Version
type: string
format: uint64
description: |
The version of the latest transaction in the ledger.
example: "52635485"
EventKey:
title: Event Key
type: string
format: hex
description: |
Event key is a global index for an event stream.
It is hex-encoded BCS bytes of `EventHandle` `guid` field value, which is
a combination of a `uint64` creation number and account address
(without trimming leading zeros).
For example, event key `0x00000000000000000000000000000000000000000a550c18`
is combined by the following 2 parts:
1. `0000000000000000`: `uint64` representation of `0`.
2. `0000000000000000000000000a550c18`: 16 bytes of account address.
example: "0x00000000000000000000000000000000000000000a550c18"
EventSequenceNumber:
title: Event Sequence Number
type: string
format: uint64
description: |
Event `sequence_number` is unique id of an event in an event stream.
Event `sequence_number` starts from 0 for each event key.
example: "23"
LedgerInfo:
title: Ledger Information
type: object
required:
- chain_id
- ledger_version
- ledger_timestamp
properties:
chain_id:
type: integer
example: 4
description: |
The blockchain chain id.
ledger_version:
$ref: '#/components/schemas/LedgerVersion'
ledger_timestamp:
$ref: '#/components/schemas/TimestampUsec'
Account:
title: Account
description: Core account resource, used for identifying account and transaction execution.
type: object
required:
- sequence_number
- authentication_key
properties:
sequence_number:
$ref: '#/components/schemas/Uint64'
authentication_key:
$ref: '#/components/schemas/HexEncodedBytes'
example:
sequence_number: "1"
authentication_key: "0x5307b5f4bc67829097a8ba9b43dba3b88261eeccd1f709d9bde240fc100fbb69"
AccountResource:
title: Account Resource
description: Account resource is a Move struct value belongs to an account.
type: object
required:
- type
- data
properties:
type:
$ref: '#/components/schemas/MoveStructTagId'
data:
type: "object"
description: |
Account resource data is JSON representation of the Move struct `type`.
Move struct field name and value are serialized as object property name and value.
example:
type: "0x1::AptosAccount::Balance<0x1::XDX::XDX>"
data:
coin:
value: "8000000000"
MoveTypeTagId:
title: Move Type Tag ID
type: string
pattern: '^(bool|u8|u64|u128|address|signer|vector<.+>|0x[0-9a-zA-Z:_<, >]+)$'
description: |
String representation of an on-chain Move type tag that is exposed in transaction payload.
Values:
- bool
- u8
- u64
- u128
- address
- signer
- vector: `vector<{non-reference MoveTypeId}>`
- struct: `{address}::{module_name}::{struct_name}::<{generic types}>`
Vector type value examples:
* `vector<u8>`
* `vector<vector<u64>>`
* `vector<0x1::AptosAccount::Balance<0x1::XDX::XDX>>`
Struct type value examples:
* `0x1::Aptos::Aptos<0x1::XDX::XDX>`
* `0x1::Abc::Abc<vector<u8>, vector<u64>>`
* `0x1::AptosAccount::AccountOperationsCapability`
Note:
1. Empty chars should be ignored when comparing 2 struct tag ids.
2. When used in an URL path, should be encoded by url-encoding (AKA percent-encoding).
example: "0x1::XUS::XUS"
MoveTypeId:
title: Move Type ID
type: string
pattern: '^(bool|u8|u64|u128|address|signer|vector<.+>|0x[0-9a-zA-Z:_<, >]+|^&(mut )?.+$|T\d+)$'
description: |
String representation of an on-chain Move type identifier defined by the Move language.
Values:
- bool
- u8
- u64
- u128
- address
- signer
- vector: `vector<{non-reference MoveTypeId}>`
- struct: `{address}::{module_name}::{struct_name}::<{generic types}>`
- reference: immutable `&` and mutable `&mut` references.
- generic_type_parameter: it is always start with `T` and following an index number,
which is the position of the generic type parameter in the `struct` or
`function` generic type parameters definition.
Vector type value examples:
* `vector<u8>`
* `vector<vector<u64>>`
* `vector<0x1::AptosAccount::Balance<0x1::XDX::XDX>>`
Struct type value examples:
* `0x1::Aptos::Aptos<0x1::XDX::XDX>`
* `0x1::Abc::Abc<vector<u8>, vector<u64>>`
* `0x1::AptosAccount::AccountOperationsCapability`
Reference type value examples:
* `&signer`
* `&mut address`
* `&mut vector<u8>`
Generic type parameter value example, the following is `0x1::TransactionFee::TransactionFee` JSON representation:
{
"name": "TransactionFee",
"is_native": false,
"abilities": ["key"],
"generic_type_params": [
{"constraints": [], "is_phantom": true}
],
"fields": [
{ "name": "balance", "type": "0x1::Aptos::Aptos<T0>" },
{ "name": "preburn", "type": "0x1::Aptos::Preburn<T0>" }
]
}
It's Move source code:
module AptosFramework::TransactionFee {
struct TransactionFee<phantom CoinType> has key {
balance: Aptos<CoinType>,
preburn: Preburn<CoinType>,
}
}
The `T0` in the above JSON representation is the generic type place holder for
the `CoinType` in the Move source code.
Note:
1. Empty chars should be ignored when comparing 2 struct tag ids.
2. When used in an URL path, should be encoded by url-encoding (AKA percent-encoding).
example: "0x1::AptosAccount::Balance<0x1::XUS::XUS>"
MoveStructTagId:
title: Move Struct Tag ID
type: string
format: move_type
pattern: '^0x[0-9a-zA-Z:_<>]+$'
description: |
String representation of an on-chain Move struct type.
It is a combination of:
1. `Move module address`, `module name` and `struct name` joined by `::`.
2. `struct generic type parameters` joined by `, `.
Examples:
* `0x1::Aptos::Aptos<0x1::XDX::XDX>`
* `0x1::Abc::Abc<vector<u8>, vector<u64>>`
* `0x1::AptosAccount::AccountOperationsCapability`
Note:
1. Empty chars should be ignored when comparing 2 struct tag ids.
2. When used in an URL path, should be encoded by url-encoding (AKA percent-encoding).
See [doc](https://diem.github.io/move/structs-and-resources.html) for more details.
example: "0x1::AptosAccount::Balance<0x1::XUS::XUS>"
MoveModule:
title: Move Module
type: object
required:
- bytecode
properties:
bytecode:
$ref: '#/components/schemas/HexEncodedBytes'
abi:
$ref: '#/components/schemas/MoveModuleABI'
MoveModuleABI:
title: Move Module ABI
type: object
description: |
Move Module ABI is JSON representation of Move module binary interface.
required:
- address
- name
- friends
- exposed_functions
- structs
properties:
address:
$ref: '#/components/schemas/Address'
name:
type: string
example: "Aptos"
friends:
type: array
items:
$ref: '#/components/schemas/MoveModuleId'
exposed_functions:
type: array
items:
$ref: '#/components/schemas/MoveFunction'
structs:
type: array
items:
$ref: '#/components/schemas/MoveStruct'
MoveStruct:
title: Move Struct
type: object
required:
- name
- is_native
- abilities
- generic_type_params
- fields
properties:
name:
type: string
is_native:
type: boolean
abilities:
type: array
items:
$ref: '#/components/schemas/MoveAbility'
generic_type_params:
type: array
items:
type: object
required:
- constraints
- is_phantom
properties:
constraints:
type: array
items:
$ref: '#/components/schemas/MoveAbility'
is_phantom:
type: boolean
fields:
type: array
items:
$ref: '#/components/schemas/MoveStructField'
example:
name: "Balance"
is_native: false
abilities:
- "key"
generic_type_params:
- constraints: [ ]
is_phantom: true
fields:
- name: "coin"
type: "0x1::Aptos::Aptos<T0>"
MoveStructField:
title: Move Struct Field
type: object
required:
- name
- type
properties:
name:
type: string
type:
$ref: '#/components/schemas/MoveTypeId'
example:
name: "value"
type: "u64"
MoveFunction:
title: Move Function
type: object
required:
- name
- visibility
- generic_type_params
- params
- return
properties:
name:
type: string
description: Move function name
visibility:
type: string
enum:
- public
- script
- friend
generic_type_params:
type: array
items:
type: "object"
required:
- constraints
properties:
constraints:
type: array