@algorandfoundation/algokit-client-generator 4.0.0-beta.1 → 4.0.0-beta.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/cli.d.ts +6 -0
  2. package/cli.js +47 -16
  3. package/cli.js.map +1 -1
  4. package/cli.mjs +47 -17
  5. package/cli.mjs.map +1 -1
  6. package/client/app-client.js +115 -49
  7. package/client/app-client.js.map +1 -1
  8. package/client/app-client.mjs +115 -49
  9. package/client/app-client.mjs.map +1 -1
  10. package/client/app-factory.js +49 -35
  11. package/client/app-factory.js.map +1 -1
  12. package/client/app-factory.mjs +49 -35
  13. package/client/app-factory.mjs.map +1 -1
  14. package/client/app-types.js +98 -102
  15. package/client/app-types.js.map +1 -1
  16. package/client/app-types.mjs +100 -104
  17. package/client/app-types.mjs.map +1 -1
  18. package/client/call-composer-types.js +9 -9
  19. package/client/call-composer-types.js.map +1 -1
  20. package/client/call-composer-types.mjs +9 -9
  21. package/client/call-composer-types.mjs.map +1 -1
  22. package/client/call-composer.js +25 -23
  23. package/client/call-composer.js.map +1 -1
  24. package/client/call-composer.mjs +25 -23
  25. package/client/call-composer.mjs.map +1 -1
  26. package/client/deploy-types.js +9 -9
  27. package/client/deploy-types.js.map +1 -1
  28. package/client/deploy-types.mjs +9 -9
  29. package/client/deploy-types.mjs.map +1 -1
  30. package/client/generate.js +6 -7
  31. package/client/generate.js.map +1 -1
  32. package/client/generate.mjs +6 -7
  33. package/client/generate.mjs.map +1 -1
  34. package/client/helpers/get-equivalent-type.js +9 -3
  35. package/client/helpers/get-equivalent-type.js.map +1 -1
  36. package/client/helpers/get-equivalent-type.mjs +9 -3
  37. package/client/helpers/get-equivalent-type.mjs.map +1 -1
  38. package/client/imports.js +8 -5
  39. package/client/imports.js.map +1 -1
  40. package/client/imports.mjs +8 -5
  41. package/client/imports.mjs.map +1 -1
  42. package/client/params-factory.js +12 -12
  43. package/client/params-factory.js.map +1 -1
  44. package/client/params-factory.mjs +12 -12
  45. package/client/params-factory.mjs.map +1 -1
  46. package/output/writer.d.ts +5 -5
  47. package/output/writer.js +9 -3
  48. package/output/writer.js.map +1 -1
  49. package/output/writer.mjs +9 -3
  50. package/output/writer.mjs.map +1 -1
  51. package/package.json +9 -5
  52. package/schema/arc56.schema.json.js +465 -501
  53. package/schema/arc56.schema.json.js.map +1 -1
  54. package/schema/arc56.schema.json.mjs +462 -501
  55. package/schema/arc56.schema.json.mjs.map +1 -1
  56. package/schema/load.js +7 -1
  57. package/schema/load.js.map +1 -1
  58. package/schema/load.mjs +7 -1
  59. package/schema/load.mjs.map +1 -1
  60. package/util/sanitization.js +13 -8
  61. package/util/sanitization.js.map +1 -1
  62. package/util/sanitization.mjs +13 -8
  63. package/util/sanitization.mjs.map +1 -1
@@ -1,411 +1,10 @@
1
- var $ref = "#/definitions/Arc56Contract";
2
1
  var $schema = "http://json-schema.org/draft-07/schema#";
3
2
  var definitions = {
4
- ABIType: {
5
- description: "An ABI-encoded type",
6
- type: "string"
7
- },
8
- AVMBytes: {
9
- "const": "bytes",
10
- description: "Raw byteslice without the length prefixed that is specified in ARC-4",
11
- type: "string"
12
- },
13
- Arc56Contract: {
14
- additionalProperties: false,
15
- description: "Describes the entire contract. This interface is an extension of the interface described in ARC-4",
16
- properties: {
17
- arcs: {
18
- description: "The ARCs used and/or supported by this contract. All contracts implicity support ARC4 and ARC56",
19
- items: {
20
- type: "number"
21
- },
22
- type: "array"
23
- },
24
- bareActions: {
25
- additionalProperties: false,
26
- description: "Supported bare actions for the contract. An action is a combination of call/create and an OnComplete",
27
- properties: {
28
- call: {
29
- description: "OnCompletes this method allows when appID !== 0",
30
- items: {
31
- "enum": [
32
- "NoOp",
33
- "OptIn",
34
- "CloseOut",
35
- "ClearState",
36
- "UpdateApplication",
37
- "DeleteApplication"
38
- ],
39
- type: "string"
40
- },
41
- type: "array"
42
- },
43
- create: {
44
- description: "OnCompletes this method allows when appID === 0",
45
- items: {
46
- "enum": [
47
- "NoOp",
48
- "OptIn",
49
- "DeleteApplication"
50
- ],
51
- type: "string"
52
- },
53
- type: "array"
54
- }
55
- },
56
- required: [
57
- "create",
58
- "call"
59
- ],
60
- type: "object"
61
- },
62
- byteCode: {
63
- additionalProperties: false,
64
- description: "The compiled bytecode for the application. MUST be omitted if included as part of ARC23",
65
- properties: {
66
- approval: {
67
- description: "The approval program",
68
- type: "string"
69
- },
70
- clear: {
71
- description: "The clear program",
72
- type: "string"
73
- }
74
- },
75
- required: [
76
- "approval",
77
- "clear"
78
- ],
79
- type: "object"
80
- },
81
- compilerInfo: {
82
- additionalProperties: false,
83
- description: "Information used to get the given byteCode and/or PC values in sourceInfo. MUST be given if byteCode or PC values are present",
84
- properties: {
85
- compiler: {
86
- description: "The name of the compiler",
87
- "enum": [
88
- "algod",
89
- "puya"
90
- ],
91
- type: "string"
92
- },
93
- compilerVersion: {
94
- additionalProperties: false,
95
- description: "Compiler version information",
96
- properties: {
97
- commit: {
98
- type: "string"
99
- },
100
- major: {
101
- type: "number"
102
- },
103
- minor: {
104
- type: "number"
105
- },
106
- patch: {
107
- type: "number"
108
- }
109
- },
110
- required: [
111
- "major",
112
- "minor",
113
- "patch"
114
- ],
115
- type: "object"
116
- }
117
- },
118
- required: [
119
- "compiler",
120
- "compilerVersion"
121
- ],
122
- type: "object"
123
- },
124
- desc: {
125
- description: "Optional, user-friendly description for the interface",
126
- type: "string"
127
- },
128
- events: {
129
- description: "ARC-28 events that MAY be emitted by this contract",
130
- items: {
131
- $ref: "#/definitions/Event"
132
- },
133
- type: "array"
134
- },
135
- methods: {
136
- description: "All of the methods that the contract implements",
137
- items: {
138
- $ref: "#/definitions/Method"
139
- },
140
- type: "array"
141
- },
142
- name: {
143
- description: "A user-friendly name for the contract",
144
- type: "string"
145
- },
146
- networks: {
147
- additionalProperties: {
148
- additionalProperties: false,
149
- description: "The key is the base64 genesis hash of the network, and the value contains information about the deployed contract in the network indicated by the key. A key containing the human-readable name of the network MAY be included, but the corresponding genesis hash key MUST also be defined",
150
- properties: {
151
- appID: {
152
- description: "The app ID of the deployed contract in this network",
153
- type: "number"
154
- }
155
- },
156
- required: [
157
- "appID"
158
- ],
159
- type: "object"
160
- },
161
- description: "Optional object listing the contract instances across different networks",
162
- type: "object"
163
- },
164
- scratchVariables: {
165
- additionalProperties: {
166
- additionalProperties: false,
167
- properties: {
168
- slot: {
169
- type: "number"
170
- },
171
- type: {
172
- anyOf: [
173
- {
174
- $ref: "#/definitions/ABIType"
175
- },
176
- {
177
- $ref: "#/definitions/AVMBytes"
178
- },
179
- {
180
- $ref: "#/definitions/StructName"
181
- }
182
- ]
183
- }
184
- },
185
- required: [
186
- "slot",
187
- "type"
188
- ],
189
- type: "object"
190
- },
191
- description: "The scratch variables used during runtime",
192
- type: "object"
193
- },
194
- source: {
195
- additionalProperties: false,
196
- description: "The pre-compiled TEAL that may contain template variables. MUST be omitted if included as part of ARC23",
197
- properties: {
198
- approval: {
199
- description: "The approval program",
200
- type: "string"
201
- },
202
- clear: {
203
- description: "The clear program",
204
- type: "string"
205
- }
206
- },
207
- required: [
208
- "approval",
209
- "clear"
210
- ],
211
- type: "object"
212
- },
213
- sourceInfo: {
214
- additionalProperties: false,
215
- description: "Information about the TEAL programs",
216
- properties: {
217
- approval: {
218
- description: "Approval program information",
219
- items: {
220
- $ref: "#/definitions/SourceInfo"
221
- },
222
- type: "array"
223
- },
224
- clear: {
225
- description: "Clear program information",
226
- items: {
227
- $ref: "#/definitions/SourceInfo"
228
- },
229
- type: "array"
230
- }
231
- },
232
- required: [
233
- "approval",
234
- "clear"
235
- ],
236
- type: "object"
237
- },
238
- state: {
239
- additionalProperties: false,
240
- properties: {
241
- keys: {
242
- additionalProperties: false,
243
- description: "Mapping of human-readable names to StorageKey objects",
244
- properties: {
245
- box: {
246
- additionalProperties: {
247
- $ref: "#/definitions/StorageKey"
248
- },
249
- type: "object"
250
- },
251
- global: {
252
- additionalProperties: {
253
- $ref: "#/definitions/StorageKey"
254
- },
255
- type: "object"
256
- },
257
- local: {
258
- additionalProperties: {
259
- $ref: "#/definitions/StorageKey"
260
- },
261
- type: "object"
262
- }
263
- },
264
- required: [
265
- "global",
266
- "local",
267
- "box"
268
- ],
269
- type: "object"
270
- },
271
- maps: {
272
- additionalProperties: false,
273
- description: "Mapping of human-readable names to StorageMap objects",
274
- properties: {
275
- box: {
276
- additionalProperties: {
277
- $ref: "#/definitions/StorageMap"
278
- },
279
- type: "object"
280
- },
281
- global: {
282
- additionalProperties: {
283
- $ref: "#/definitions/StorageMap"
284
- },
285
- type: "object"
286
- },
287
- local: {
288
- additionalProperties: {
289
- $ref: "#/definitions/StorageMap"
290
- },
291
- type: "object"
292
- }
293
- },
294
- required: [
295
- "global",
296
- "local",
297
- "box"
298
- ],
299
- type: "object"
300
- },
301
- schema: {
302
- additionalProperties: false,
303
- description: "Defines the values that should be used for GlobalNumUint, GlobalNumByteSlice, LocalNumUint, and LocalNumByteSlice when creating the application",
304
- properties: {
305
- global: {
306
- additionalProperties: false,
307
- properties: {
308
- bytes: {
309
- type: "number"
310
- },
311
- ints: {
312
- type: "number"
313
- }
314
- },
315
- required: [
316
- "ints",
317
- "bytes"
318
- ],
319
- type: "object"
320
- },
321
- local: {
322
- additionalProperties: false,
323
- properties: {
324
- bytes: {
325
- type: "number"
326
- },
327
- ints: {
328
- type: "number"
329
- }
330
- },
331
- required: [
332
- "ints",
333
- "bytes"
334
- ],
335
- type: "object"
336
- }
337
- },
338
- required: [
339
- "global",
340
- "local"
341
- ],
342
- type: "object"
343
- }
344
- },
345
- required: [
346
- "schema",
347
- "keys",
348
- "maps"
349
- ],
350
- type: "object"
351
- },
352
- structs: {
353
- additionalProperties: {
354
- $ref: "#/definitions/StructFields"
355
- },
356
- description: "Named structs use by the application",
357
- type: "object"
358
- },
359
- templateVariables: {
360
- additionalProperties: {
361
- additionalProperties: false,
362
- properties: {
363
- type: {
364
- anyOf: [
365
- {
366
- $ref: "#/definitions/ABIType"
367
- },
368
- {
369
- $ref: "#/definitions/AVMBytes"
370
- },
371
- {
372
- $ref: "#/definitions/StructName"
373
- }
374
- ],
375
- description: "The type of the template variable"
376
- },
377
- value: {
378
- description: "If given, the the base64 encoded value used for the given app/program",
379
- type: "string"
380
- }
381
- },
382
- required: [
383
- "type"
384
- ],
385
- type: "object"
386
- },
387
- description: "A mapping of template variable names as they appear in the teal (not including TMPL_ prefix) to their respecive types and values (if applicable)",
388
- type: "object"
389
- }
390
- },
391
- required: [
392
- "arcs",
393
- "name",
394
- "structs",
395
- "methods",
396
- "state",
397
- "bareActions"
398
- ],
399
- type: "object"
400
- },
401
3
  Event: {
402
- additionalProperties: false,
403
- description: "ARC-28 event",
404
4
  properties: {
405
5
  args: {
406
6
  description: "The arguments of the event, in order",
407
7
  items: {
408
- additionalProperties: false,
409
8
  properties: {
410
9
  desc: {
411
10
  description: "Optional, user-friendly description for the argument",
@@ -416,12 +15,12 @@ var definitions = {
416
15
  type: "string"
417
16
  },
418
17
  struct: {
419
- $ref: "#/definitions/StructName",
420
- description: "If the type is a struct, the name of the struct"
18
+ description: "If the type is a struct, the name of the struct",
19
+ type: "string"
421
20
  },
422
21
  type: {
423
- $ref: "#/definitions/ABIType",
424
- description: "The type of the argument"
22
+ description: "The type of the argument. The `struct` field should also be checked to determine if this arg is a struct.",
23
+ type: "string"
425
24
  }
426
25
  },
427
26
  required: [
@@ -447,23 +46,21 @@ var definitions = {
447
46
  type: "object"
448
47
  },
449
48
  Method: {
450
- additionalProperties: false,
451
49
  description: "Describes a method in the contract. This interface is an extension of the interface described in ARC-4",
452
50
  properties: {
453
51
  actions: {
454
- additionalProperties: false,
455
52
  description: "an action is a combination of call/create and an OnComplete",
456
53
  properties: {
457
54
  call: {
458
55
  description: "OnCompletes this method allows when appID !== 0",
459
56
  items: {
460
57
  "enum": [
58
+ "ClearState",
59
+ "CloseOut",
60
+ "DeleteApplication",
461
61
  "NoOp",
462
62
  "OptIn",
463
- "CloseOut",
464
- "ClearState",
465
- "UpdateApplication",
466
- "DeleteApplication"
63
+ "UpdateApplication"
467
64
  ],
468
65
  type: "string"
469
66
  },
@@ -473,29 +70,58 @@ var definitions = {
473
70
  description: "OnCompletes this method allows when appID === 0",
474
71
  items: {
475
72
  "enum": [
73
+ "DeleteApplication",
476
74
  "NoOp",
477
- "OptIn",
478
- "DeleteApplication"
75
+ "OptIn"
479
76
  ],
480
77
  type: "string"
481
78
  },
482
79
  type: "array"
483
80
  }
484
81
  },
485
- required: [
486
- "create",
487
- "call"
488
- ],
489
82
  type: "object"
490
83
  },
491
84
  args: {
492
85
  description: "The arguments of the method, in order",
493
86
  items: {
494
- additionalProperties: false,
495
87
  properties: {
496
88
  defaultValue: {
497
- description: "The default value that clients should use. MUST be base64 encoded bytes",
498
- type: "string"
89
+ description: "The default value that clients should use.",
90
+ properties: {
91
+ data: {
92
+ anyOf: [
93
+ {
94
+ additionalProperties: false,
95
+ properties: {
96
+ },
97
+ type: "number"
98
+ },
99
+ {
100
+ type: "string"
101
+ }
102
+ ],
103
+ description: "Base64 encoded bytes or uint64"
104
+ },
105
+ source: {
106
+ description: "Where the default value is coming from\n- box: The data key signifies the box key to read the value from\n- global: The data key signifies the global state key to read the value from\n- local: The data key signifies the local state key to read the value from (for the sender)\n- literal: the value is a literal and should be passed directly as the argument",
107
+ "enum": [
108
+ "box",
109
+ "global",
110
+ "literal",
111
+ "local"
112
+ ],
113
+ type: "string"
114
+ },
115
+ type: {
116
+ description: "How the data is encoded. This is the encoding for the data provided here, not the arg type",
117
+ type: "string"
118
+ }
119
+ },
120
+ required: [
121
+ "source",
122
+ "data"
123
+ ],
124
+ type: "object"
499
125
  },
500
126
  desc: {
501
127
  description: "Optional, user-friendly description for the argument",
@@ -506,12 +132,12 @@ var definitions = {
506
132
  type: "string"
507
133
  },
508
134
  struct: {
509
- $ref: "#/definitions/StructName",
510
- description: "If the type is a struct, the name of the struct"
135
+ description: "If the type is a struct, the name of the struct",
136
+ type: "string"
511
137
  },
512
138
  type: {
513
- $ref: "#/definitions/ABIType",
514
- description: "The type of the argument"
139
+ description: "The type of the argument. The `struct` field should also be checked to determine if this arg is a struct.",
140
+ type: "string"
515
141
  }
516
142
  },
517
143
  required: [
@@ -541,7 +167,6 @@ var definitions = {
541
167
  type: "boolean"
542
168
  },
543
169
  recommendations: {
544
- additionalProperties: false,
545
170
  description: "Information that clients can use when calling the method",
546
171
  properties: {
547
172
  accounts: {
@@ -566,7 +191,6 @@ var definitions = {
566
191
  type: "array"
567
192
  },
568
193
  boxes: {
569
- additionalProperties: false,
570
194
  description: "Recommended box references to include",
571
195
  properties: {
572
196
  app: {
@@ -601,7 +225,6 @@ var definitions = {
601
225
  type: "object"
602
226
  },
603
227
  returns: {
604
- additionalProperties: false,
605
228
  description: "Information about the method's return value",
606
229
  properties: {
607
230
  desc: {
@@ -609,12 +232,12 @@ var definitions = {
609
232
  type: "string"
610
233
  },
611
234
  struct: {
612
- $ref: "#/definitions/StructName",
613
- description: "If the type is a struct, the name of the struct"
235
+ description: "If the type is a struct, the name of the struct",
236
+ type: "string"
614
237
  },
615
238
  type: {
616
- $ref: "#/definitions/ABIType",
617
- description: "The type of the return value, or \"void\" to indicate no return value."
239
+ description: "The type of the return value, or \"void\" to indicate no return value. The `struct` field should also be checked to determine if this return value is a struct.",
240
+ type: "string"
618
241
  }
619
242
  },
620
243
  required: [
@@ -631,33 +254,58 @@ var definitions = {
631
254
  ],
632
255
  type: "object"
633
256
  },
634
- SourceInfo: {
635
- additionalProperties: true,
257
+ ProgramSourceInfo: {
636
258
  properties: {
637
- disassembledTeal: {
638
- description: "The line of the dissasembled TEAL this line of pre-compiled TEAL corresponds to",
639
- type: "number"
259
+ pcOffsetMethod: {
260
+ description: "How the program counter offset is calculated\n- none: The pc values in sourceInfo are not offset\n- cblocks: The pc values in sourceInfo are offset by the PC of the first op following the last cblock at the top of the program",
261
+ "enum": [
262
+ "cblocks",
263
+ "none"
264
+ ],
265
+ type: "string"
640
266
  },
267
+ sourceInfo: {
268
+ description: "The source information for the program",
269
+ items: {
270
+ $ref: "#/definitions/SourceInfo"
271
+ },
272
+ type: "array"
273
+ }
274
+ },
275
+ required: [
276
+ "pcOffsetMethod",
277
+ "sourceInfo"
278
+ ],
279
+ type: "object"
280
+ },
281
+ SourceInfo: {
282
+ properties: {
641
283
  errorMessage: {
642
- description: "A human-readable string that describes the error when the program fails at this given line of TEAL",
284
+ description: "A human-readable string that describes the error when the program fails at the given PC",
643
285
  type: "string"
644
286
  },
645
287
  pc: {
646
- description: "The program counter offset(s) that correspond to this line of TEAL",
288
+ description: "The program counter value(s). Could be offset if pcOffsetMethod is not \"none\"",
647
289
  items: {
648
290
  type: "number"
649
291
  },
650
292
  type: "array"
651
293
  },
294
+ source: {
295
+ description: "The original source file and line number that corresponds to the given PC. RECOMMENDED to be used for development purposes, but not required for clients",
296
+ type: "string"
297
+ },
652
298
  teal: {
653
- description: "The line of pre-compiled TEAL",
299
+ description: "The TEAL line number that corresponds to the given PC. RECOMMENDED to be used for development purposes, but not required for clients",
654
300
  type: "number"
655
301
  }
656
302
  },
303
+ required: [
304
+ "pc"
305
+ ],
657
306
  type: "object"
658
307
  },
659
308
  StorageKey: {
660
- additionalProperties: false,
661
309
  description: "Describes a single key in app storage",
662
310
  properties: {
663
311
  desc: {
@@ -669,43 +317,22 @@ var definitions = {
669
317
  type: "string"
670
318
  },
671
319
  keyType: {
672
- anyOf: [
673
- {
674
- $ref: "#/definitions/ABIType"
675
- },
676
- {
677
- $ref: "#/definitions/AVMBytes"
678
- },
679
- {
680
- $ref: "#/definitions/StructName"
681
- }
682
- ],
683
- description: "The type of the key"
320
+ description: "The type of the key",
321
+ type: "string"
684
322
  },
685
323
  valueType: {
686
- anyOf: [
687
- {
688
- $ref: "#/definitions/ABIType"
689
- },
690
- {
691
- $ref: "#/definitions/AVMBytes"
692
- },
693
- {
694
- $ref: "#/definitions/StructName"
695
- }
696
- ],
697
- description: "The type of the value"
324
+ description: "The type of the value",
325
+ type: "string"
698
326
  }
699
327
  },
700
328
  required: [
329
+ "key",
701
330
  "keyType",
702
- "valueType",
703
- "key"
331
+ "valueType"
704
332
  ],
705
333
  type: "object"
706
334
  },
707
335
  StorageMap: {
708
- additionalProperties: false,
709
336
  description: "Describes a mapping of key-value pairs in storage",
710
337
  properties: {
711
338
  desc: {
@@ -713,68 +340,402 @@ var definitions = {
713
340
  type: "string"
714
341
  },
715
342
  keyType: {
716
- anyOf: [
717
- {
718
- $ref: "#/definitions/ABIType"
719
- },
720
- {
721
- $ref: "#/definitions/AVMBytes"
722
- },
723
- {
724
- $ref: "#/definitions/StructName"
725
- }
726
- ],
727
- description: "The type of the keys in the map"
343
+ description: "The type of the keys in the map",
344
+ type: "string"
728
345
  },
729
346
  prefix: {
730
347
  description: "The base64-encoded prefix of the map keys",
731
348
  type: "string"
732
349
  },
733
350
  valueType: {
351
+ description: "The type of the values in the map",
352
+ type: "string"
353
+ }
354
+ },
355
+ required: [
356
+ "keyType",
357
+ "valueType"
358
+ ],
359
+ type: "object"
360
+ },
361
+ StructField: {
362
+ description: "Information about a single field in a struct",
363
+ properties: {
364
+ name: {
365
+ description: "The name of the struct field",
366
+ type: "string"
367
+ },
368
+ type: {
734
369
  anyOf: [
735
370
  {
736
- $ref: "#/definitions/ABIType"
737
- },
738
- {
739
- $ref: "#/definitions/AVMBytes"
371
+ items: {
372
+ $ref: "#/definitions/StructField"
373
+ },
374
+ type: "array"
740
375
  },
741
376
  {
742
- $ref: "#/definitions/StructName"
377
+ type: "string"
743
378
  }
744
379
  ],
745
- description: "The type of the values in the map"
380
+ description: "The type of the struct field's value"
746
381
  }
747
382
  },
748
383
  required: [
749
- "keyType",
750
- "valueType"
384
+ "name",
385
+ "type"
386
+ ],
387
+ type: "object"
388
+ }
389
+ };
390
+ var description = "Describes the entire contract. This interface is an extension of the interface described in ARC-4";
391
+ var properties = {
392
+ arcs: {
393
+ description: "The ARCs used and/or supported by this contract. All contracts implicitly support ARC4 and ARC56",
394
+ items: {
395
+ type: "number"
396
+ },
397
+ type: "array"
398
+ },
399
+ bareActions: {
400
+ description: "Supported bare actions for the contract. An action is a combination of call/create and an OnComplete",
401
+ properties: {
402
+ call: {
403
+ description: "OnCompletes this method allows when appID !== 0",
404
+ items: {
405
+ "enum": [
406
+ "ClearState",
407
+ "CloseOut",
408
+ "DeleteApplication",
409
+ "NoOp",
410
+ "OptIn",
411
+ "UpdateApplication"
412
+ ],
413
+ type: "string"
414
+ },
415
+ type: "array"
416
+ },
417
+ create: {
418
+ description: "OnCompletes this method allows when appID === 0",
419
+ items: {
420
+ "enum": [
421
+ "DeleteApplication",
422
+ "NoOp",
423
+ "OptIn"
424
+ ],
425
+ type: "string"
426
+ },
427
+ type: "array"
428
+ }
429
+ },
430
+ required: [
431
+ "create",
432
+ "call"
433
+ ],
434
+ type: "object"
435
+ },
436
+ byteCode: {
437
+ description: "The compiled bytecode for the application. MUST be omitted if included as part of ARC23",
438
+ properties: {
439
+ approval: {
440
+ description: "The approval program",
441
+ type: "string"
442
+ },
443
+ clear: {
444
+ description: "The clear program",
445
+ type: "string"
446
+ }
447
+ },
448
+ required: [
449
+ "approval",
450
+ "clear"
451
+ ],
452
+ type: "object"
453
+ },
454
+ compilerInfo: {
455
+ description: "Information used to get the given byteCode and/or PC values in sourceInfo. MUST be given if byteCode or PC values are present",
456
+ properties: {
457
+ compiler: {
458
+ description: "The name of the compiler",
459
+ "enum": [
460
+ "algod",
461
+ "puya"
462
+ ],
463
+ type: "string"
464
+ },
465
+ compilerVersion: {
466
+ description: "Compiler version information",
467
+ properties: {
468
+ commitHash: {
469
+ type: "string"
470
+ },
471
+ major: {
472
+ type: "number"
473
+ },
474
+ minor: {
475
+ type: "number"
476
+ },
477
+ patch: {
478
+ type: "number"
479
+ }
480
+ },
481
+ type: "object"
482
+ }
483
+ },
484
+ required: [
485
+ "compiler",
486
+ "compilerVersion"
751
487
  ],
752
488
  type: "object"
753
489
  },
754
- StructFields: {
490
+ desc: {
491
+ description: "Optional, user-friendly description for the interface",
492
+ type: "string"
493
+ },
494
+ events: {
495
+ description: "ARC-28 events that MAY be emitted by this contract",
496
+ items: {
497
+ $ref: "#/definitions/Event"
498
+ },
499
+ type: "array"
500
+ },
501
+ methods: {
502
+ description: "All of the methods that the contract implements",
503
+ items: {
504
+ $ref: "#/definitions/Method"
505
+ },
506
+ type: "array"
507
+ },
508
+ name: {
509
+ description: "A user-friendly name for the contract",
510
+ type: "string"
511
+ },
512
+ networks: {
755
513
  additionalProperties: {
756
- anyOf: [
757
- {
758
- $ref: "#/definitions/ABIType"
514
+ properties: {
515
+ appID: {
516
+ description: "The app ID of the deployed contract in this network",
517
+ type: "number"
518
+ }
519
+ },
520
+ required: [
521
+ "appID"
522
+ ],
523
+ type: "object"
524
+ },
525
+ description: "Optional object listing the contract instances across different networks.\nThe key is the base64 genesis hash of the network, and the value contains\ninformation about the deployed contract in the network indicated by the\nkey. A key containing the human-readable name of the network MAY be\nincluded, but the corresponding genesis hash key MUST also be defined",
526
+ type: "object"
527
+ },
528
+ scratchVariables: {
529
+ additionalProperties: {
530
+ properties: {
531
+ slot: {
532
+ type: "number"
759
533
  },
760
- {
761
- $ref: "#/definitions/StructFields"
534
+ type: {
535
+ type: "string"
762
536
  }
763
- ]
537
+ },
538
+ required: [
539
+ "slot",
540
+ "type"
541
+ ],
542
+ type: "object"
764
543
  },
765
- description: "Mapping of named structs to the ABI type of their fields",
544
+ description: "The scratch variables used during runtime",
766
545
  type: "object"
767
546
  },
768
- StructName: {
769
- description: "The name of a defined struct",
770
- type: "string"
547
+ source: {
548
+ description: "The pre-compiled TEAL that may contain template variables. MUST be omitted if included as part of ARC23",
549
+ properties: {
550
+ approval: {
551
+ description: "The approval program",
552
+ type: "string"
553
+ },
554
+ clear: {
555
+ description: "The clear program",
556
+ type: "string"
557
+ }
558
+ },
559
+ required: [
560
+ "approval",
561
+ "clear"
562
+ ],
563
+ type: "object"
564
+ },
565
+ sourceInfo: {
566
+ description: "Information about the TEAL programs",
567
+ properties: {
568
+ approval: {
569
+ $ref: "#/definitions/ProgramSourceInfo",
570
+ description: "Approval program information"
571
+ },
572
+ clear: {
573
+ $ref: "#/definitions/ProgramSourceInfo",
574
+ description: "Clear program information"
575
+ }
576
+ },
577
+ required: [
578
+ "approval",
579
+ "clear"
580
+ ],
581
+ type: "object"
582
+ },
583
+ state: {
584
+ properties: {
585
+ keys: {
586
+ description: "Mapping of human-readable names to StorageKey objects",
587
+ properties: {
588
+ box: {
589
+ additionalProperties: {
590
+ $ref: "#/definitions/StorageKey"
591
+ },
592
+ type: "object"
593
+ },
594
+ global: {
595
+ additionalProperties: {
596
+ $ref: "#/definitions/StorageKey"
597
+ },
598
+ type: "object"
599
+ },
600
+ local: {
601
+ additionalProperties: {
602
+ $ref: "#/definitions/StorageKey"
603
+ },
604
+ type: "object"
605
+ }
606
+ },
607
+ required: [
608
+ "box",
609
+ "global",
610
+ "local"
611
+ ],
612
+ type: "object"
613
+ },
614
+ maps: {
615
+ description: "Mapping of human-readable names to StorageMap objects",
616
+ properties: {
617
+ box: {
618
+ additionalProperties: {
619
+ $ref: "#/definitions/StorageMap"
620
+ },
621
+ type: "object"
622
+ },
623
+ global: {
624
+ additionalProperties: {
625
+ $ref: "#/definitions/StorageMap"
626
+ },
627
+ type: "object"
628
+ },
629
+ local: {
630
+ additionalProperties: {
631
+ $ref: "#/definitions/StorageMap"
632
+ },
633
+ type: "object"
634
+ }
635
+ },
636
+ required: [
637
+ "box",
638
+ "global",
639
+ "local"
640
+ ],
641
+ type: "object"
642
+ },
643
+ schema: {
644
+ description: "Defines the values that should be used for GlobalNumUint, GlobalNumByteSlice, LocalNumUint, and LocalNumByteSlice when creating the application",
645
+ properties: {
646
+ global: {
647
+ properties: {
648
+ bytes: {
649
+ type: "number"
650
+ },
651
+ ints: {
652
+ type: "number"
653
+ }
654
+ },
655
+ required: [
656
+ "bytes",
657
+ "ints"
658
+ ],
659
+ type: "object"
660
+ },
661
+ local: {
662
+ properties: {
663
+ bytes: {
664
+ type: "number"
665
+ },
666
+ ints: {
667
+ type: "number"
668
+ }
669
+ },
670
+ required: [
671
+ "bytes",
672
+ "ints"
673
+ ],
674
+ type: "object"
675
+ }
676
+ },
677
+ required: [
678
+ "global",
679
+ "local"
680
+ ],
681
+ type: "object"
682
+ }
683
+ },
684
+ required: [
685
+ "keys",
686
+ "maps",
687
+ "schema"
688
+ ],
689
+ type: "object"
690
+ },
691
+ structs: {
692
+ additionalProperties: {
693
+ items: {
694
+ $ref: "#/definitions/StructField"
695
+ },
696
+ type: "array"
697
+ },
698
+ description: "Named structs used by the application. Each struct field appears in the same order as ABI encoding.",
699
+ type: "object"
700
+ },
701
+ templateVariables: {
702
+ additionalProperties: {
703
+ properties: {
704
+ type: {
705
+ description: "The type of the template variable",
706
+ type: "string"
707
+ },
708
+ value: {
709
+ description: "If given, the base64 encoded value used for the given app/program",
710
+ type: "string"
711
+ }
712
+ },
713
+ required: [
714
+ "type"
715
+ ],
716
+ type: "object"
717
+ },
718
+ description: "A mapping of template variable names as they appear in the TEAL (not including TMPL_ prefix) to their respecive types and values (if applicable)",
719
+ type: "object"
771
720
  }
772
721
  };
722
+ var required = [
723
+ "arcs",
724
+ "name",
725
+ "structs",
726
+ "methods",
727
+ "state",
728
+ "bareActions"
729
+ ];
730
+ var type = "object";
773
731
  var arc56Schema = {
774
- $ref: $ref,
775
732
  $schema: $schema,
776
- definitions: definitions
733
+ definitions: definitions,
734
+ description: description,
735
+ properties: properties,
736
+ required: required,
737
+ type: type
777
738
  };
778
739
 
779
- export { $ref, $schema, arc56Schema as default, definitions };
740
+ export { $schema, arc56Schema as default, definitions, description, properties, required, type };
780
741
  //# sourceMappingURL=arc56.schema.json.mjs.map