@algorandfoundation/puya-ts 1.0.0-alpha.4

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 (241) hide show
  1. package/README.md +11 -0
  2. package/awst/index.d.ts +4 -0
  3. package/awst/intrinsic-factory.d.ts +35 -0
  4. package/awst/json-serialize-awst.d.ts +17 -0
  5. package/awst/models.d.ts +85 -0
  6. package/awst/node-factory.d.ts +90 -0
  7. package/awst/nodes.d.ts +841 -0
  8. package/awst/source-location.d.ts +21 -0
  9. package/awst/to-code-visitor.d.ts +87 -0
  10. package/awst/txn-fields.d.ts +84 -0
  11. package/awst/util.d.ts +2 -0
  12. package/awst/wtypes.d.ts +131 -0
  13. package/awst_build/base-visitor.d.ts +87 -0
  14. package/awst_build/constructor-visitor.d.ts +18 -0
  15. package/awst_build/context/awst-build-context.d.ts +72 -0
  16. package/awst_build/context/evaluation-context.d.ts +11 -0
  17. package/awst_build/context/switch-loop-context.d.ts +31 -0
  18. package/awst_build/context/unique-name-resolver.d.ts +14 -0
  19. package/awst_build/contract-data.d.ts +24 -0
  20. package/awst_build/contract-method-visitor.d.ts +20 -0
  21. package/awst_build/contract-visitor.d.ts +33 -0
  22. package/awst_build/decorator-visitor.d.ts +34 -0
  23. package/awst_build/eb/arc4/arrays.d.ts +31 -0
  24. package/awst_build/eb/arc4/uint-n-constructor-builder.d.ts +14 -0
  25. package/awst_build/eb/arc4-bare-method-decorator-builder.d.ts +19 -0
  26. package/awst_build/eb/assert-function-builder.d.ts +10 -0
  27. package/awst_build/eb/assert-match-function-builder.d.ts +8 -0
  28. package/awst_build/eb/biguint-expression-builder.d.ts +21 -0
  29. package/awst_build/eb/boolean-expression-builder.d.ts +15 -0
  30. package/awst_build/eb/bytes-expression-builder.d.ts +44 -0
  31. package/awst_build/eb/contract-builder.d.ts +19 -0
  32. package/awst_build/eb/ensure-budget.d.ts +8 -0
  33. package/awst_build/eb/folding.d.ts +5 -0
  34. package/awst_build/eb/free-subroutine-expression-builder.d.ts +22 -0
  35. package/awst_build/eb/index.d.ts +90 -0
  36. package/awst_build/eb/intrinsic-enum-builder.d.ts +9 -0
  37. package/awst_build/eb/iterable-iterator-expression-builder.d.ts +10 -0
  38. package/awst_build/eb/literal/array-literal-expression-builder.d.ts +19 -0
  39. package/awst_build/eb/literal/big-int-literal-expression-builder.d.ts +19 -0
  40. package/awst_build/eb/literal/conditional-expression-builder.d.ts +22 -0
  41. package/awst_build/eb/literal/object-expression-builder.d.ts +13 -0
  42. package/awst_build/eb/literal/object-literal-expression-builder.d.ts +28 -0
  43. package/awst_build/eb/literal-expression-builder.d.ts +27 -0
  44. package/awst_build/eb/log-function-builder.d.ts +7 -0
  45. package/awst_build/eb/namespace-builder.d.ts +9 -0
  46. package/awst_build/eb/native-array-expression-builder.d.ts +8 -0
  47. package/awst_build/eb/omitted-expression-builder.d.ts +9 -0
  48. package/awst_build/eb/op-module-builder.d.ts +25 -0
  49. package/awst_build/eb/reference/account.d.ts +15 -0
  50. package/awst_build/eb/reference/application.d.ts +12 -0
  51. package/awst_build/eb/reference/asset.d.ts +13 -0
  52. package/awst_build/eb/reference/base.d.ts +37 -0
  53. package/awst_build/eb/storage/box.d.ts +50 -0
  54. package/awst_build/eb/storage/global-state.d.ts +29 -0
  55. package/awst_build/eb/storage/local-state.d.ts +32 -0
  56. package/awst_build/eb/storage/util.d.ts +5 -0
  57. package/awst_build/eb/storage/value-proxy.d.ts +22 -0
  58. package/awst_build/eb/string-expression-builder.d.ts +27 -0
  59. package/awst_build/eb/transactions/group-transactions.d.ts +15 -0
  60. package/awst_build/eb/transactions/inner-transaction-params.d.ts +19 -0
  61. package/awst_build/eb/transactions/inner-transactions.d.ts +10 -0
  62. package/awst_build/eb/transactions/txn-fields.d.ts +1317 -0
  63. package/awst_build/eb/transactions/util.d.ts +5 -0
  64. package/awst_build/eb/tuple-expression-builder.d.ts +12 -0
  65. package/awst_build/eb/uint64-enum-type-builder.d.ts +13 -0
  66. package/awst_build/eb/uint64-expression-builder.d.ts +21 -0
  67. package/awst_build/eb/urange-function.d.ts +7 -0
  68. package/awst_build/eb/util/arg-parsing.d.ts +106 -0
  69. package/awst_build/eb/util/compare-bytes.d.ts +5 -0
  70. package/awst_build/eb/util/compare-uint64.d.ts +5 -0
  71. package/awst_build/eb/util/index.d.ts +19 -0
  72. package/awst_build/eb/util/require-constant-value.d.ts +4 -0
  73. package/awst_build/eb/void-expression-builder.d.ts +7 -0
  74. package/awst_build/function-visitor.d.ts +45 -0
  75. package/awst_build/index.d.ts +5 -0
  76. package/awst_build/lib/index.d.ts +2 -0
  77. package/awst_build/op-metadata.d.ts +27 -0
  78. package/awst_build/ptypes/arc4-types.d.ts +56 -0
  79. package/awst_build/ptypes/base.d.ts +31 -0
  80. package/awst_build/ptypes/index.d.ts +455 -0
  81. package/awst_build/ptypes/intrinsic-enum-type.d.ts +14 -0
  82. package/awst_build/ptypes/op-ptypes.d.ts +6 -0
  83. package/awst_build/ptypes/register.d.ts +2 -0
  84. package/awst_build/source-file-visitor.d.ts +21 -0
  85. package/awst_build/subroutine-visitor.d.ts +10 -0
  86. package/awst_build/symbol-name.d.ts +10 -0
  87. package/awst_build/text-visitor.d.ts +20 -0
  88. package/awst_build/type-registry.d.ts +61 -0
  89. package/awst_build/type-resolver.d.ts +18 -0
  90. package/bin/run-cli.d.ts +2 -0
  91. package/bin/run-cli.mjs +20 -0
  92. package/bin/run-cli.mjs.map +1 -0
  93. package/cli.d.ts +1 -0
  94. package/cli.mjs +146 -0
  95. package/cli.mjs.map +1 -0
  96. package/compile-options.d.ts +17 -0
  97. package/constants.d.ts +20 -0
  98. package/errors.d.ts +46 -0
  99. package/index-D6W2FUFQ.js +16297 -0
  100. package/index-D6W2FUFQ.js.map +1 -0
  101. package/index.d.ts +19 -0
  102. package/index.mjs +15 -0
  103. package/index.mjs.map +1 -0
  104. package/logger.d.ts +39 -0
  105. package/node_modules/typescript/LICENSE.txt +55 -0
  106. package/node_modules/typescript/README.md +50 -0
  107. package/node_modules/typescript/SECURITY.md +41 -0
  108. package/node_modules/typescript/ThirdPartyNoticeText.txt +193 -0
  109. package/node_modules/typescript/bin/tsc +2 -0
  110. package/node_modules/typescript/bin/tsserver +2 -0
  111. package/node_modules/typescript/lib/cancellationToken.js +90 -0
  112. package/node_modules/typescript/lib/cs/diagnosticMessages.generated.json +2087 -0
  113. package/node_modules/typescript/lib/de/diagnosticMessages.generated.json +2087 -0
  114. package/node_modules/typescript/lib/es/diagnosticMessages.generated.json +2087 -0
  115. package/node_modules/typescript/lib/fr/diagnosticMessages.generated.json +2087 -0
  116. package/node_modules/typescript/lib/it/diagnosticMessages.generated.json +2087 -0
  117. package/node_modules/typescript/lib/ja/diagnosticMessages.generated.json +2087 -0
  118. package/node_modules/typescript/lib/ko/diagnosticMessages.generated.json +2087 -0
  119. package/node_modules/typescript/lib/lib.d.ts +22 -0
  120. package/node_modules/typescript/lib/lib.decorators.d.ts +386 -0
  121. package/node_modules/typescript/lib/lib.decorators.legacy.d.ts +22 -0
  122. package/node_modules/typescript/lib/lib.dom.asynciterable.d.ts +41 -0
  123. package/node_modules/typescript/lib/lib.dom.d.ts +28087 -0
  124. package/node_modules/typescript/lib/lib.dom.iterable.d.ts +491 -0
  125. package/node_modules/typescript/lib/lib.es2015.collection.d.ts +147 -0
  126. package/node_modules/typescript/lib/lib.es2015.core.d.ts +597 -0
  127. package/node_modules/typescript/lib/lib.es2015.d.ts +28 -0
  128. package/node_modules/typescript/lib/lib.es2015.generator.d.ts +77 -0
  129. package/node_modules/typescript/lib/lib.es2015.iterable.d.ts +527 -0
  130. package/node_modules/typescript/lib/lib.es2015.promise.d.ts +81 -0
  131. package/node_modules/typescript/lib/lib.es2015.proxy.d.ts +128 -0
  132. package/node_modules/typescript/lib/lib.es2015.reflect.d.ts +144 -0
  133. package/node_modules/typescript/lib/lib.es2015.symbol.d.ts +46 -0
  134. package/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts +326 -0
  135. package/node_modules/typescript/lib/lib.es2016.array.include.d.ts +116 -0
  136. package/node_modules/typescript/lib/lib.es2016.d.ts +21 -0
  137. package/node_modules/typescript/lib/lib.es2016.full.d.ts +23 -0
  138. package/node_modules/typescript/lib/lib.es2016.intl.d.ts +31 -0
  139. package/node_modules/typescript/lib/lib.es2017.d.ts +25 -0
  140. package/node_modules/typescript/lib/lib.es2017.date.d.ts +31 -0
  141. package/node_modules/typescript/lib/lib.es2017.full.d.ts +23 -0
  142. package/node_modules/typescript/lib/lib.es2017.intl.d.ts +44 -0
  143. package/node_modules/typescript/lib/lib.es2017.object.d.ts +49 -0
  144. package/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts +135 -0
  145. package/node_modules/typescript/lib/lib.es2017.string.d.ts +45 -0
  146. package/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts +53 -0
  147. package/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts +77 -0
  148. package/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts +53 -0
  149. package/node_modules/typescript/lib/lib.es2018.d.ts +24 -0
  150. package/node_modules/typescript/lib/lib.es2018.full.d.ts +24 -0
  151. package/node_modules/typescript/lib/lib.es2018.intl.d.ts +83 -0
  152. package/node_modules/typescript/lib/lib.es2018.promise.d.ts +30 -0
  153. package/node_modules/typescript/lib/lib.es2018.regexp.d.ts +37 -0
  154. package/node_modules/typescript/lib/lib.es2019.array.d.ts +79 -0
  155. package/node_modules/typescript/lib/lib.es2019.d.ts +24 -0
  156. package/node_modules/typescript/lib/lib.es2019.full.d.ts +24 -0
  157. package/node_modules/typescript/lib/lib.es2019.intl.d.ts +23 -0
  158. package/node_modules/typescript/lib/lib.es2019.object.d.ts +33 -0
  159. package/node_modules/typescript/lib/lib.es2019.string.d.ts +37 -0
  160. package/node_modules/typescript/lib/lib.es2019.symbol.d.ts +24 -0
  161. package/node_modules/typescript/lib/lib.es2020.bigint.d.ts +727 -0
  162. package/node_modules/typescript/lib/lib.es2020.d.ts +27 -0
  163. package/node_modules/typescript/lib/lib.es2020.date.d.ts +42 -0
  164. package/node_modules/typescript/lib/lib.es2020.full.d.ts +24 -0
  165. package/node_modules/typescript/lib/lib.es2020.intl.d.ts +474 -0
  166. package/node_modules/typescript/lib/lib.es2020.number.d.ts +28 -0
  167. package/node_modules/typescript/lib/lib.es2020.promise.d.ts +47 -0
  168. package/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts +97 -0
  169. package/node_modules/typescript/lib/lib.es2020.string.d.ts +42 -0
  170. package/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts +41 -0
  171. package/node_modules/typescript/lib/lib.es2021.d.ts +23 -0
  172. package/node_modules/typescript/lib/lib.es2021.full.d.ts +24 -0
  173. package/node_modules/typescript/lib/lib.es2021.intl.d.ts +166 -0
  174. package/node_modules/typescript/lib/lib.es2021.promise.d.ts +48 -0
  175. package/node_modules/typescript/lib/lib.es2021.string.d.ts +33 -0
  176. package/node_modules/typescript/lib/lib.es2021.weakref.d.ts +76 -0
  177. package/node_modules/typescript/lib/lib.es2022.array.d.ts +121 -0
  178. package/node_modules/typescript/lib/lib.es2022.d.ts +26 -0
  179. package/node_modules/typescript/lib/lib.es2022.error.d.ts +73 -0
  180. package/node_modules/typescript/lib/lib.es2022.full.d.ts +24 -0
  181. package/node_modules/typescript/lib/lib.es2022.intl.d.ts +121 -0
  182. package/node_modules/typescript/lib/lib.es2022.object.d.ts +26 -0
  183. package/node_modules/typescript/lib/lib.es2022.regexp.d.ts +39 -0
  184. package/node_modules/typescript/lib/lib.es2022.sharedmemory.d.ts +39 -0
  185. package/node_modules/typescript/lib/lib.es2022.string.d.ts +25 -0
  186. package/node_modules/typescript/lib/lib.es2023.array.d.ts +924 -0
  187. package/node_modules/typescript/lib/lib.es2023.collection.d.ts +21 -0
  188. package/node_modules/typescript/lib/lib.es2023.d.ts +22 -0
  189. package/node_modules/typescript/lib/lib.es2023.full.d.ts +24 -0
  190. package/node_modules/typescript/lib/lib.es2023.intl.d.ts +56 -0
  191. package/node_modules/typescript/lib/lib.es5.d.ts +4585 -0
  192. package/node_modules/typescript/lib/lib.es6.d.ts +23 -0
  193. package/node_modules/typescript/lib/lib.esnext.array.d.ts +35 -0
  194. package/node_modules/typescript/lib/lib.esnext.collection.d.ts +106 -0
  195. package/node_modules/typescript/lib/lib.esnext.d.ts +29 -0
  196. package/node_modules/typescript/lib/lib.esnext.decorators.d.ts +28 -0
  197. package/node_modules/typescript/lib/lib.esnext.disposable.d.ts +193 -0
  198. package/node_modules/typescript/lib/lib.esnext.full.d.ts +24 -0
  199. package/node_modules/typescript/lib/lib.esnext.intl.d.ts +21 -0
  200. package/node_modules/typescript/lib/lib.esnext.iterator.d.ts +148 -0
  201. package/node_modules/typescript/lib/lib.esnext.object.d.ts +29 -0
  202. package/node_modules/typescript/lib/lib.esnext.promise.d.ts +35 -0
  203. package/node_modules/typescript/lib/lib.esnext.regexp.d.ts +25 -0
  204. package/node_modules/typescript/lib/lib.esnext.string.d.ts +29 -0
  205. package/node_modules/typescript/lib/lib.scripthost.d.ts +322 -0
  206. package/node_modules/typescript/lib/lib.webworker.asynciterable.d.ts +41 -0
  207. package/node_modules/typescript/lib/lib.webworker.d.ts +9410 -0
  208. package/node_modules/typescript/lib/lib.webworker.importscripts.d.ts +23 -0
  209. package/node_modules/typescript/lib/lib.webworker.iterable.d.ts +288 -0
  210. package/node_modules/typescript/lib/pl/diagnosticMessages.generated.json +2087 -0
  211. package/node_modules/typescript/lib/pt-br/diagnosticMessages.generated.json +2087 -0
  212. package/node_modules/typescript/lib/ru/diagnosticMessages.generated.json +2087 -0
  213. package/node_modules/typescript/lib/tr/diagnosticMessages.generated.json +2087 -0
  214. package/node_modules/typescript/lib/tsc.js +130771 -0
  215. package/node_modules/typescript/lib/tsserver.js +623 -0
  216. package/node_modules/typescript/lib/tsserverlibrary.d.ts +17 -0
  217. package/node_modules/typescript/lib/tsserverlibrary.js +21 -0
  218. package/node_modules/typescript/lib/typesMap.json +497 -0
  219. package/node_modules/typescript/lib/typescript.d.ts +11329 -0
  220. package/node_modules/typescript/lib/typescript.js +196077 -0
  221. package/node_modules/typescript/lib/typingsInstaller.js +236 -0
  222. package/node_modules/typescript/lib/watchGuard.js +53 -0
  223. package/node_modules/typescript/lib/zh-cn/diagnosticMessages.generated.json +2087 -0
  224. package/node_modules/typescript/lib/zh-tw/diagnosticMessages.generated.json +2087 -0
  225. package/node_modules/typescript/package.json +121 -0
  226. package/package.json +42 -0
  227. package/parser/index.d.ts +13 -0
  228. package/parser/json-serialize-source-files.d.ts +2 -0
  229. package/parser/resolve-module-name-literals.d.ts +2 -0
  230. package/puya/build-compilation-set-mapping.d.ts +10 -0
  231. package/puya/index.d.ts +13 -0
  232. package/puya/options.d.ts +29 -0
  233. package/puya/run-child-proc.d.ts +5 -0
  234. package/util/base-32.d.ts +2 -0
  235. package/util/base-85.d.ts +10 -0
  236. package/util/default-map.d.ts +1 -0
  237. package/util/generate-temp-file.d.ts +9 -0
  238. package/util/index.d.ts +43 -0
  239. package/visitor/syntax-names.d.ts +441 -0
  240. package/visitor/visitor.d.ts +26 -0
  241. package/write-artifact.d.ts +12 -0
package/README.md ADDED
@@ -0,0 +1,11 @@
1
+ # Algorand TypeScript
2
+
3
+ Algorand TypeScript is a partial implementation of the TypeScript programming language that runs on the Algorand Virtual Machine (AVM). It includes a statically typed framework for development of Algorand smart contracts and logic signatures, with TypeScript interfaces to underlying AVM functionality that works with standard TypeScript tooling.
4
+
5
+ It maintains the syntax and semantics of TypeScript such that a developer who knows TypeScript can make safe assumptions
6
+ about the behaviour of the compiled code when running on the AVM. Algorand TypeScript is also executable TypeScript that can be run
7
+ and debugged on a Node.js virtual machine with transpilation to EcmaScript and run from automated tests.
8
+
9
+ Algorand TypeScript is compiled for execution on the AVM by PuyaTs, a TypeScript frontend for the [Puya](https://github.com/algorandfoundation/puya) optimising compiler that ensures the resulting AVM bytecode execution semantics that match the given TypeScript code. PuyaTs produces output that is directly compatible with AlgoKit typed clients to make deployment and calling easy.
10
+
11
+ [Documentation](./docs/README.md)
@@ -0,0 +1,4 @@
1
+ export * as awst from './nodes';
2
+ export * as wtypes from './wtypes';
3
+ export * from './util';
4
+ export type ConstantValue = bigint | Uint8Array | boolean | string;
@@ -0,0 +1,35 @@
1
+ import type * as awst from './nodes';
2
+ import type { Expression } from './nodes';
3
+ import type { SourceLocation } from './source-location';
4
+ export declare const intrinsicFactory: {
5
+ bytesConcat({ left, right, sourceLocation, }: {
6
+ left: awst.Expression;
7
+ right: awst.Expression;
8
+ sourceLocation: SourceLocation;
9
+ }): awst.IntrinsicCall;
10
+ err({ sourceLocation, comment }: {
11
+ sourceLocation: SourceLocation;
12
+ comment: string | null;
13
+ }): awst.IntrinsicCall;
14
+ assert({ sourceLocation, comment, condition }: {
15
+ sourceLocation: SourceLocation;
16
+ comment: string | null;
17
+ condition: Expression;
18
+ }): awst.IntrinsicCall;
19
+ bytesLen({ value, sourceLocation }: {
20
+ value: awst.Expression;
21
+ sourceLocation: SourceLocation;
22
+ }): awst.IntrinsicCall;
23
+ bitLen({ value, sourceLocation }: {
24
+ value: awst.Expression;
25
+ sourceLocation: SourceLocation;
26
+ }): awst.IntrinsicCall;
27
+ itob({ value, sourceLocation }: {
28
+ value: awst.Expression;
29
+ sourceLocation: SourceLocation;
30
+ }): awst.IntrinsicCall;
31
+ btoi({ value, sourceLocation }: {
32
+ value: awst.Expression;
33
+ sourceLocation: SourceLocation;
34
+ }): awst.IntrinsicCall;
35
+ };
@@ -0,0 +1,17 @@
1
+ import type { RootNode } from './nodes';
2
+ export declare class SnakeCaseSerializer<T> {
3
+ private readonly spaces;
4
+ constructor(spaces?: number);
5
+ serialize(obj: T): string;
6
+ protected serializerFunction(key: string, value: unknown): unknown;
7
+ }
8
+ export declare class AwstSerializer extends SnakeCaseSerializer<RootNode[]> {
9
+ private options?;
10
+ constructor(options?: {
11
+ sourcePaths?: "absolute" | "relative";
12
+ programDirectory?: string;
13
+ } | undefined);
14
+ private b85;
15
+ protected serializerFunction(key: string, value: unknown): unknown;
16
+ }
17
+ export declare function jsonSerializeAwst(awst: RootNode[]): string;
@@ -0,0 +1,85 @@
1
+ import type { ContractClassPType } from '../awst_build/ptypes';
2
+ import type { Props } from '../typescript-helpers';
3
+ import type { SourceLocation } from './source-location';
4
+ export declare enum OnCompletionAction {
5
+ NoOp = 0,
6
+ OptIn = 1,
7
+ CloseOut = 2,
8
+ ClearState = 3,
9
+ UpdateApplication = 4,
10
+ DeleteApplication = 5
11
+ }
12
+ export declare enum ARC4CreateOption {
13
+ Allow = 1,
14
+ Require = 2,
15
+ Disallow = 3
16
+ }
17
+ declare class ModelBase {
18
+ #private;
19
+ }
20
+ export declare class ARC4BareMethodConfig extends ModelBase {
21
+ readonly sourceLocation: SourceLocation | undefined;
22
+ readonly allowedCompletionTypes: OnCompletionAction[];
23
+ readonly create: ARC4CreateOption;
24
+ readonly isBare: true;
25
+ constructor(props: Omit<Props<ARC4BareMethodConfig>, 'isBare'>);
26
+ }
27
+ export type DefaultArgumentSource = {
28
+ source: 'constant';
29
+ value: string | bigint | number | boolean | Uint8Array;
30
+ } | {
31
+ source: 'global-state';
32
+ memberName: string;
33
+ } | {
34
+ source: 'local-state';
35
+ memberName: string;
36
+ } | {
37
+ source: 'abi-method';
38
+ memberName: string;
39
+ };
40
+ export declare class ARC4ABIMethodConfig extends ModelBase {
41
+ readonly sourceLocation: SourceLocation | undefined;
42
+ readonly name: string;
43
+ readonly isBare: false;
44
+ readonly create: ARC4CreateOption;
45
+ readonly readonly: boolean;
46
+ readonly allowedCompletionTypes: OnCompletionAction[];
47
+ readonly defaultArgs: Record<string, DefaultArgumentSource>;
48
+ readonly structs: Record<string, ARC32StructDef>;
49
+ constructor(props: Omit<Props<ARC4ABIMethodConfig>, 'isBare'>);
50
+ }
51
+ export interface ARC32StructDef {
52
+ name: string;
53
+ elements: [...[string, string][]];
54
+ }
55
+ export declare class ContractReference extends ModelBase {
56
+ constructor({ className, moduleName }: {
57
+ className: string;
58
+ moduleName: string;
59
+ });
60
+ readonly className: string;
61
+ readonly moduleName: string;
62
+ get id(): string;
63
+ toString(): string;
64
+ static fromPType(contractPType: ContractClassPType): ContractReference;
65
+ }
66
+ export declare class LogicSigReference extends ModelBase {
67
+ constructor({ name, moduleName }: {
68
+ name: string;
69
+ moduleName: string;
70
+ });
71
+ readonly name: string;
72
+ readonly moduleName: string;
73
+ get id(): string;
74
+ toString(): string;
75
+ }
76
+ export type CompilationSet = ReadonlyArray<ContractReference | LogicSigReference>;
77
+ export declare enum TransactionKind {
78
+ pay = 1,
79
+ keyreg = 2,
80
+ acfg = 3,
81
+ axfer = 4,
82
+ afrz = 5,
83
+ appl = 6
84
+ }
85
+ export {};
@@ -0,0 +1,90 @@
1
+ import type { Props } from '../typescript-helpers';
2
+ import type { Expression, Statement } from './nodes';
3
+ import { AssignmentExpression, AssignmentStatement, BigUIntBinaryOperation, Block, BoolConstant, BooleanBinaryOperation, BytesComparisonExpression, BytesConstant, BytesEncoding, CheckedMaybe, concreteNodes, Copy, ExpressionStatement, IntegerConstant, IntrinsicCall, MethodDocumentation, Not, NumericComparisonExpression, SingleEvaluation, StringConstant, TupleExpression, TupleItemExpression, UInt64BinaryOperation, VoidConstant } from './nodes';
4
+ import type { SourceLocation } from './source-location';
5
+ import type { WType } from './wtypes';
6
+ type ConcreteNodes = typeof concreteNodes;
7
+ declare const explicitNodeFactory: {
8
+ voidConstant(props: {
9
+ sourceLocation: SourceLocation;
10
+ }): VoidConstant;
11
+ bytesConstant(props: {
12
+ value: Uint8Array;
13
+ encoding?: BytesEncoding;
14
+ sourceLocation: SourceLocation;
15
+ wtype?: WType;
16
+ }): BytesConstant;
17
+ stringConstant(props: {
18
+ value: string;
19
+ sourceLocation: SourceLocation;
20
+ }): StringConstant;
21
+ uInt64Constant(props: {
22
+ value: bigint;
23
+ tealAlias?: string;
24
+ sourceLocation: SourceLocation;
25
+ }): IntegerConstant;
26
+ bigUIntConstant(props: {
27
+ value: bigint;
28
+ sourceLocation: SourceLocation;
29
+ }): IntegerConstant;
30
+ not(props: {
31
+ expr: Expression;
32
+ sourceLocation: SourceLocation;
33
+ }): Not;
34
+ uInt64BinaryOperation(props: Omit<Props<UInt64BinaryOperation>, "wtype">): UInt64BinaryOperation;
35
+ bigUIntBinaryOperation(props: Omit<Props<BigUIntBinaryOperation>, "wtype">): BigUIntBinaryOperation;
36
+ numericComparisonExpression(props: Omit<Props<NumericComparisonExpression>, "wtype">): NumericComparisonExpression;
37
+ bytesComparisonExpression(props: Omit<Props<BytesComparisonExpression>, "wtype">): BytesComparisonExpression;
38
+ boolConstant(props: {
39
+ value: boolean;
40
+ sourceLocation: SourceLocation;
41
+ }): BoolConstant;
42
+ singleEvaluation({ source }: {
43
+ source: Expression;
44
+ }): SingleEvaluation;
45
+ expressionStatement({ expr }: {
46
+ expr: Expression;
47
+ }): ExpressionStatement;
48
+ block({ sourceLocation, comment, label }: {
49
+ sourceLocation: SourceLocation;
50
+ comment?: string;
51
+ label?: string;
52
+ }, ...statements: Array<Statement | Statement[]>): Block;
53
+ booleanBinaryOperation(props: Omit<Props<BooleanBinaryOperation>, "wtype">): BooleanBinaryOperation;
54
+ assignmentExpression({ target, value, sourceLocation, }: {
55
+ target: AssignmentExpression["target"];
56
+ value: Expression;
57
+ sourceLocation: SourceLocation;
58
+ }): AssignmentExpression;
59
+ assignmentStatement({ target, value, sourceLocation, }: {
60
+ target: AssignmentStatement["target"];
61
+ value: Expression;
62
+ sourceLocation: SourceLocation;
63
+ }): AssignmentStatement;
64
+ tupleExpression(props: Omit<Props<TupleExpression>, "wtype">): TupleExpression;
65
+ methodDocumentation(props?: {
66
+ description?: string | null;
67
+ args?: Map<string, string>;
68
+ returns?: string | null;
69
+ }): MethodDocumentation;
70
+ intrinsicCall(props: Omit<Props<IntrinsicCall>, "comment"> & {
71
+ comment?: string | null;
72
+ }): IntrinsicCall;
73
+ copy({ value, sourceLocation }: {
74
+ value: Expression;
75
+ sourceLocation: SourceLocation;
76
+ }): Copy;
77
+ checkedMaybe({ expr, comment }: {
78
+ expr: Expression;
79
+ comment: string;
80
+ }): CheckedMaybe;
81
+ tupleItemExpression(props: Omit<Props<TupleItemExpression>, "wtype">): TupleItemExpression;
82
+ };
83
+ type ExplicitNodeFactory = typeof explicitNodeFactory;
84
+ type DefaultNodeFactory<TKey extends keyof ConcreteNodes> = (...args: ConstructorParameters<ConcreteNodes[TKey]>) => InstanceType<ConcreteNodes[TKey]>;
85
+ export type NodeFactory = {
86
+ [key in keyof ConcreteNodes]: FactoryMethod<key>;
87
+ };
88
+ type FactoryMethod<TKey extends keyof ConcreteNodes> = TKey extends keyof ExplicitNodeFactory ? ExplicitNodeFactory[TKey] : DefaultNodeFactory<TKey>;
89
+ export declare const nodeFactory: NodeFactory;
90
+ export {};