@algorandfoundation/puya-ts 1.2.0-beta.24 → 1.2.0-beta.26

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 (36) hide show
  1. package/{analyser-service-B84GATtQ.js → analyser-service-DPB64W_I.js} +3 -3
  2. package/{analyser-service-B84GATtQ.js.map → analyser-service-DPB64W_I.js.map} +1 -1
  3. package/analyserService.mjs +3 -3
  4. package/{arc4-clientgen-Umq6mCn8.js → arc4-clientgen-wsi8el9O.js} +2 -2
  5. package/{arc4-clientgen-Umq6mCn8.js.map → arc4-clientgen-wsi8el9O.js.map} +1 -1
  6. package/awst/nodes.d.ts +9 -2
  7. package/awst/to-code-visitor.d.ts +1 -0
  8. package/awst/validation/awst-traverser.d.ts +2 -1
  9. package/awst_build/eb/storage/global-map.d.ts +21 -0
  10. package/awst_build/eb/storage/local-map.d.ts +21 -0
  11. package/awst_build/ptypes/index.d.ts +27 -1
  12. package/awst_build/ptypes/visitor.d.ts +3 -1
  13. package/awst_build/ptypes/visitors/default-visitor.d.ts +3 -1
  14. package/bin/puyats-clientgen.mjs +5 -5
  15. package/bin/puyats-ls.mjs +6 -6
  16. package/bin/run-cli.mjs +8 -8
  17. package/{check-node-version-HR1SqoVK.js → check-node-version-FCNk0unc.js} +3 -3
  18. package/{check-node-version-HR1SqoVK.js.map → check-node-version-FCNk0unc.js.map} +1 -1
  19. package/cli.mjs +8 -8
  20. package/{compile-BvWnPSet.js → compile-C8QvmjEM.js} +6 -6
  21. package/{compile-BvWnPSet.js.map → compile-C8QvmjEM.js.map} +1 -1
  22. package/{contract-class-model-Dvfr2oDn.js → contract-class-model-QzlhxT7N.js} +72 -3
  23. package/contract-class-model-QzlhxT7N.js.map +1 -0
  24. package/index.mjs +12 -8
  25. package/index.mjs.map +1 -1
  26. package/{options-Bq5xN07C.js → options-JF2uHXg3.js} +190 -15
  27. package/options-JF2uHXg3.js.map +1 -0
  28. package/package.json +3 -3
  29. package/{resolve-puya-path-CH8YhrrD.js → resolve-puya-path-Xb15ffnK.js} +4 -4
  30. package/{resolve-puya-path-CH8YhrrD.js.map → resolve-puya-path-Xb15ffnK.js.map} +1 -1
  31. package/{semver-Cl2GNl-D.js → semver-BEcHIBxM.js} +2 -2
  32. package/{semver-Cl2GNl-D.js.map → semver-BEcHIBxM.js.map} +1 -1
  33. package/{util-D6_ufaax.js → util-C6eWLSUe.js} +2 -2
  34. package/{util-D6_ufaax.js.map → util-C6eWLSUe.js.map} +1 -1
  35. package/contract-class-model-Dvfr2oDn.js.map +0 -1
  36. package/options-Bq5xN07C.js.map +0 -1
package/index.mjs CHANGED
@@ -1,8 +1,8 @@
1
- import { o as ABICompatibleInstanceType, q as ALL_OP_ENUMS, r as AccountFunction, s as AnyPType, t as ApplicationFunctionType, u as ApplicationTxnFunction, w as ApprovalProgram, x as ArrayGeneric, y as ArrayLiteralPType, z as ArrayPType, B as AssetConfigTxnFunction, D as AssetFreezeTxnFunction, E as AssetFunction, F as AssetTransferTxnFunction, G as BaseContractClassType, H as BigIntLiteralPType, J as BigIntPType, K as BigUintFunction, M as BooleanFunction, N as BoxGeneric, Q as BoxMapGeneric, R as BoxMapPType, S as BoxPType, T as BytesFunction, U as BytesGeneric, V as BytesPType, W as ClassMethodDecoratorContext, X as ClearStateProgram, Y as ClusteredContractClassType, Z as ClusteredPrototype, _ as ContractClassPType, $ as FixedArrayGeneric, a0 as FixedArrayPType, a1 as FunctionPType, a2 as GeneratorGeneric, a3 as GeneratorType, a4 as GenericPType, a5 as GlobalStateGeneric, a6 as GlobalStateType, a7 as GroupTransactionPType, a8 as ImmutableObjectPType, a9 as InnerTransactionPType, aa as InstanceType, ab as InternalType, ac as IntersectionPType, ad as IntrinsicEnumType, ae as IntrinsicFunctionGroupType, af as IntrinsicFunctionGroupTypeType, ag as IntrinsicFunctionType, ah as IntrinsicFunctionTypeType, ai as IterableIteratorGeneric, aj as IterableIteratorType, ak as ItxnParamsPType, al as KeyRegistrationTxnFunction, am as LibClassType, an as LibFunctionType, ao as LibObjType, ap as LocalStateGeneric, aq as LocalStateType, ar as LogicSigPType, as as MutableObjectPType, at as MutableTuplePType, au as NamespacePType, av as NumberPType, aw as NumericLiteralPType, ax as ObjectLiteralPType, ay as ObjectWithOptionalFieldsType, az as PType, aA as PaymentTxnFunction, aB as PolytypeClassMethodHelper, aC as PromiseGeneric, aD as PromiseType, aE as ReadonlyArrayGeneric, aF as ReadonlyArrayPType, aG as ReadonlyGeneric, aH as ReadonlyTuplePType, aI as ReferenceArrayGeneric, aJ as ReferenceArrayType, aK as StringFunction, aL as SuperPrototypeSelector, aM as SuperPrototypeSelectorGeneric, aN as TemplateVarFunction, aO as TransactionFunction, aP as TransactionFunctionType, aQ as TransientType, aR as TypeParameterType, aS as Uint64EnumMemberLiteralType, aT as Uint64EnumMemberType, aU as Uint64EnumType, aV as Uint64Function, aW as UnionPType, aX as UnsupportedType, e as accountPType, h as anyGtxnType, aY as anyItxnParamsType, aZ as anyItxnType, a_ as anyPType, n as applicationCallGtxnType, a$ as applicationCallItxnFn, b0 as applicationCallItxnParamsType, b1 as applicationItxnType, f as applicationPType, b2 as arc28EmitFunction, b3 as arc4AbiMethodDecorator, b4 as arc4BareMethodDecorator, b5 as arc4BaseContractType, b6 as assertFunction, b7 as assertMatchFunction, i as assetConfigGtxnType, b8 as assetConfigItxnFn, b9 as assetConfigItxnParamsType, ba as assetConfigItxnType, m as assetFreezeGtxnType, bb as assetFreezeItxnFn, bc as assetFreezeItxnParamsType, bd as assetFreezeItxnType, g as assetPType, j as assetTransferGtxnType, be as assetTransferItxnFn, bf as assetTransferItxnParamsType, bg as assetTransferItxnType, bh as base64PType, bi as baseContractType, bj as bigIntPType, bk as biguintPType, bl as boolPType, bm as bytesPType, bn as bzeroFunction, bo as cloneFunctionPType, bp as compileFunctionType, bq as compiledContractType, br as compiledLogicSigType, bs as contractOptionsDecorator, bt as ecPType, bu as ecdsaPType, bv as ensureBudgetFunction, bw as errFunction, bx as esSymbol, by as inputOnlyObjects, bz as isArrayType, bA as isObjectType, bB as isTupleLike, bC as itoaMethod, bD as itxnComposePType, k as keyRegistrationGtxnType, bE as keyRegistrationItxnFn, bF as keyRegistrationItxnParamsType, bG as keyRegistrationItxnType, bH as logFunction, bI as loggedAssertFunction, bJ as loggedErrFunction, bK as logicSigBaseType, bL as logicSigOptionsDecorator, bM as matchFunction, bN as mimcConfigurationsPType, bO as neverPType, bP as nullPType, bQ as numberPType, bR as onCompleteActionType, bS as opUpFeeSourceType, p as paymentGtxnType, bT as paymentItxnFn, bU as paymentItxnParamsType, bV as paymentItxnType, bW as readonlyDecorator, bX as stringPType, bY as submitGroupItxnFunction, bZ as transactionTypeType, b_ as uint64PType, b$ as undefinedPType, c0 as unknownPType, c1 as urangeFunction, c2 as validateEncodingFunctionPType, v as voidPType, c3 as vrfVerifyPType, c4 as uint8ArrayToBigInt, c5 as uint8ArrayToBase64, c6 as uint8ArrayToBase32, c7 as uint8ArrayToUtf8, c8 as base64ToUint8Array, c9 as base32ToUint8Array, ca as bigIntToUint8Array, cb as utf8ToUint8Array } from './contract-class-model-Dvfr2oDn.js';
2
- export { A as AbsolutePath, L as LogLevel, cc as LogSource, a as LoggingContext, cd as SourceLocation } from './contract-class-model-Dvfr2oDn.js';
3
- import { A as ARC4ArrayType, a as ARC4BoolClass, b as ARC4EncodedType, c as ARC4InstanceType, d as ARC4StrClass, e as ARC4StructClass, f as ARC4StructType, g as ARC4TupleType, h as AddressClass, i as Arc4TupleGeneric, B as ByteClass, C as ContractProxyGeneric, j as ContractProxyType, D as DynamicArrayGeneric, k as DynamicArrayType, l as DynamicBytesConstructor, m as DynamicBytesType, S as StaticArrayGeneric, n as StaticArrayType, o as StaticBytesGeneric, p as StaticBytesType, T as TypedApplicationCallResponseGeneric, q as TypedApplicationCallResponseType, U as UFixedNxMGeneric, r as UFixedNxMType, s as UintN128Class, t as UintN16Class, u as UintN256Class, v as UintN32Class, w as UintN64Class, x as UintN8Class, y as UintNGeneric, z as UintNType, E as abiCallFunction, F as arc4AddressAlias, G as arc4BooleanType, H as arc4ByteAlias, I as arc4StringType, J as arc4StructBaseType, K as arc4Uint64, L as compileArc4Function, M as convertBytesFunction, N as decodeArc4Function, O as encodeArc4Function, P as methodSelectorFunction, Q as sizeOfFunction, R as uint8ArrayToHex, V as hexToUint8Array } from './options-Bq5xN07C.js';
4
- export { W as CompileOptions, X as TypeResolver, Y as processInputPaths, Z as registerPTypes, _ as typeRegistry } from './options-Bq5xN07C.js';
5
- export { c as compile } from './compile-BvWnPSet.js';
1
+ import { o as ABICompatibleInstanceType, q as ALL_OP_ENUMS, r as AccountFunction, s as AnyPType, t as ApplicationFunctionType, u as ApplicationTxnFunction, w as ApprovalProgram, x as ArrayGeneric, y as ArrayLiteralPType, z as ArrayPType, B as AssetConfigTxnFunction, D as AssetFreezeTxnFunction, E as AssetFunction, F as AssetTransferTxnFunction, G as BaseContractClassType, H as BigIntLiteralPType, J as BigIntPType, K as BigUintFunction, M as BooleanFunction, N as BoxGeneric, Q as BoxMapGeneric, R as BoxMapPType, S as BoxPType, T as BytesFunction, U as BytesGeneric, V as BytesPType, W as ClassMethodDecoratorContext, X as ClearStateProgram, Y as ClusteredContractClassType, Z as ClusteredPrototype, _ as ContractClassPType, $ as FixedArrayGeneric, a0 as FixedArrayPType, a1 as FunctionPType, a2 as GeneratorGeneric, a3 as GeneratorType, a4 as GenericPType, a5 as GlobalMapGeneric, a6 as GlobalMapType, a7 as GlobalStateGeneric, a8 as GlobalStateType, a9 as GroupTransactionPType, aa as ImmutableObjectPType, ab as InnerTransactionPType, ac as InstanceType, ad as InternalType, ae as IntersectionPType, af as IntrinsicEnumType, ag as IntrinsicFunctionGroupType, ah as IntrinsicFunctionGroupTypeType, ai as IntrinsicFunctionType, aj as IntrinsicFunctionTypeType, ak as IterableIteratorGeneric, al as IterableIteratorType, am as ItxnParamsPType, an as KeyRegistrationTxnFunction, ao as LibClassType, ap as LibFunctionType, aq as LibObjType, ar as LocalMapGeneric, as as LocalMapType, at as LocalStateGeneric, au as LocalStateType, av as LogicSigPType, aw as MutableObjectPType, ax as MutableTuplePType, ay as NamespacePType, az as NumberPType, aA as NumericLiteralPType, aB as ObjectLiteralPType, aC as ObjectWithOptionalFieldsType, aD as PType, aE as PaymentTxnFunction, aF as PolytypeClassMethodHelper, aG as PromiseGeneric, aH as PromiseType, aI as ReadonlyArrayGeneric, aJ as ReadonlyArrayPType, aK as ReadonlyGeneric, aL as ReadonlyTuplePType, aM as ReferenceArrayGeneric, aN as ReferenceArrayType, aO as StringFunction, aP as SuperPrototypeSelector, aQ as SuperPrototypeSelectorGeneric, aR as TemplateVarFunction, aS as TransactionFunction, aT as TransactionFunctionType, aU as TransientType, aV as TypeParameterType, aW as Uint64EnumMemberLiteralType, aX as Uint64EnumMemberType, aY as Uint64EnumType, aZ as Uint64Function, a_ as UnionPType, a$ as UnsupportedType, e as accountPType, h as anyGtxnType, b0 as anyItxnParamsType, b1 as anyItxnType, b2 as anyPType, n as applicationCallGtxnType, b3 as applicationCallItxnFn, b4 as applicationCallItxnParamsType, b5 as applicationItxnType, f as applicationPType, b6 as arc28EmitFunction, b7 as arc4AbiMethodDecorator, b8 as arc4BareMethodDecorator, b9 as arc4BaseContractType, ba as assertFunction, bb as assertMatchFunction, i as assetConfigGtxnType, bc as assetConfigItxnFn, bd as assetConfigItxnParamsType, be as assetConfigItxnType, m as assetFreezeGtxnType, bf as assetFreezeItxnFn, bg as assetFreezeItxnParamsType, bh as assetFreezeItxnType, g as assetPType, j as assetTransferGtxnType, bi as assetTransferItxnFn, bj as assetTransferItxnParamsType, bk as assetTransferItxnType, bl as base64PType, bm as baseContractType, bn as bigIntPType, bo as biguintPType, bp as boolPType, bq as bytesPType, br as bzeroFunction, bs as cloneFunctionPType, bt as compileFunctionType, bu as compiledContractType, bv as compiledLogicSigType, bw as contractOptionsDecorator, bx as ecPType, by as ecdsaPType, bz as ensureBudgetFunction, bA as errFunction, bB as esSymbol, bC as inputOnlyObjects, bD as isArrayType, bE as isObjectType, bF as isTupleLike, bG as itoaMethod, bH as itxnComposePType, k as keyRegistrationGtxnType, bI as keyRegistrationItxnFn, bJ as keyRegistrationItxnParamsType, bK as keyRegistrationItxnType, bL as logFunction, bM as loggedAssertFunction, bN as loggedErrFunction, bO as logicSigBaseType, bP as logicSigOptionsDecorator, bQ as matchFunction, bR as mimcConfigurationsPType, bS as neverPType, bT as nullPType, bU as numberPType, bV as onCompleteActionType, bW as opUpFeeSourceType, p as paymentGtxnType, bX as paymentItxnFn, bY as paymentItxnParamsType, bZ as paymentItxnType, b_ as readonlyDecorator, b$ as stringPType, c0 as submitGroupItxnFunction, c1 as transactionTypeType, c2 as uint64PType, c3 as undefinedPType, c4 as unknownPType, c5 as urangeFunction, c6 as validateEncodingFunctionPType, v as voidPType, c7 as vrfVerifyPType, c8 as uint8ArrayToBigInt, c9 as uint8ArrayToBase64, ca as uint8ArrayToBase32, cb as uint8ArrayToUtf8, cc as base64ToUint8Array, cd as base32ToUint8Array, ce as bigIntToUint8Array, cf as utf8ToUint8Array } from './contract-class-model-QzlhxT7N.js';
2
+ export { A as AbsolutePath, L as LogLevel, cg as LogSource, a as LoggingContext, ch as SourceLocation } from './contract-class-model-QzlhxT7N.js';
3
+ import { A as ARC4ArrayType, a as ARC4BoolClass, b as ARC4EncodedType, c as ARC4InstanceType, d as ARC4StrClass, e as ARC4StructClass, f as ARC4StructType, g as ARC4TupleType, h as AddressClass, i as Arc4TupleGeneric, B as ByteClass, C as ContractProxyGeneric, j as ContractProxyType, D as DynamicArrayGeneric, k as DynamicArrayType, l as DynamicBytesConstructor, m as DynamicBytesType, S as StaticArrayGeneric, n as StaticArrayType, o as StaticBytesGeneric, p as StaticBytesType, T as TypedApplicationCallResponseGeneric, q as TypedApplicationCallResponseType, U as UFixedNxMGeneric, r as UFixedNxMType, s as UintN128Class, t as UintN16Class, u as UintN256Class, v as UintN32Class, w as UintN64Class, x as UintN8Class, y as UintNGeneric, z as UintNType, E as abiCallFunction, F as arc4AddressAlias, G as arc4BooleanType, H as arc4ByteAlias, I as arc4StringType, J as arc4StructBaseType, K as arc4Uint64, L as compileArc4Function, M as convertBytesFunction, N as decodeArc4Function, O as encodeArc4Function, P as methodSelectorFunction, Q as sizeOfFunction, R as uint8ArrayToHex, V as hexToUint8Array } from './options-JF2uHXg3.js';
4
+ export { W as CompileOptions, X as TypeResolver, Y as processInputPaths, Z as registerPTypes, _ as typeRegistry } from './options-JF2uHXg3.js';
5
+ export { c as compile } from './compile-C8QvmjEM.js';
6
6
  import 'typescript';
7
7
  import 'node:fs';
8
8
  import 'node:util';
@@ -22,13 +22,13 @@ import 'net';
22
22
  import 'change-case';
23
23
  import 'glob';
24
24
  import 'minimatch';
25
- import './arc4-clientgen-Umq6mCn8.js';
25
+ import './arc4-clientgen-wsi8el9O.js';
26
26
  import '@algorandfoundation/algokit-utils/abi';
27
27
  import 'fs';
28
28
  import 'fs/promises';
29
- import './semver-Cl2GNl-D.js';
29
+ import './semver-BEcHIBxM.js';
30
30
  import 'node:url';
31
- import './resolve-puya-path-CH8YhrrD.js';
31
+ import './resolve-puya-path-Xb15ffnK.js';
32
32
  import 'signal-exit';
33
33
  import 'tar';
34
34
  import 'node:zlib';
@@ -91,6 +91,8 @@ var forExport = /*#__PURE__*/Object.freeze({
91
91
  GeneratorGeneric: GeneratorGeneric,
92
92
  GeneratorType: GeneratorType,
93
93
  GenericPType: GenericPType,
94
+ GlobalMapGeneric: GlobalMapGeneric,
95
+ GlobalMapType: GlobalMapType,
94
96
  GlobalStateGeneric: GlobalStateGeneric,
95
97
  GlobalStateType: GlobalStateType,
96
98
  GroupTransactionPType: GroupTransactionPType,
@@ -111,6 +113,8 @@ var forExport = /*#__PURE__*/Object.freeze({
111
113
  LibClassType: LibClassType,
112
114
  LibFunctionType: LibFunctionType,
113
115
  LibObjType: LibObjType,
116
+ LocalMapGeneric: LocalMapGeneric,
117
+ LocalMapType: LocalMapType,
114
118
  LocalStateGeneric: LocalStateGeneric,
115
119
  LocalStateType: LocalStateType,
116
120
  LogicSigPType: LogicSigPType,
package/index.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../src/awst_build/ptypes/for-export.ts","../src/index.ts"],"sourcesContent":["/* This file aggregates all ptypes into a single export for external consumption of the compiler api */\nexport * from './arc4-types'\nexport * from './index'\n","import {\n base32ToUint8Array,\n base64ToUint8Array,\n bigIntToUint8Array,\n hexToUint8Array,\n uint8ArrayToBase32,\n uint8ArrayToBase64,\n uint8ArrayToBigInt,\n uint8ArrayToHex,\n uint8ArrayToUtf8,\n utf8ToUint8Array,\n} from './util'\nimport './util/polyfills'\n\nexport { SourceLocation } from './awst/source-location'\nexport * as ptypes from './awst_build/ptypes/for-export'\nexport { registerPTypes } from './awst_build/ptypes/register'\nexport { typeRegistry } from './awst_build/type-registry'\nexport { TypeResolver } from './awst_build/type-resolver'\nexport { compile } from './compile'\nexport { processInputPaths } from './input-paths/process-input-paths'\nexport { LoggingContext, LogLevel, LogSource, LogEvent } from './logger'\nexport { CompileOptions } from './options'\nexport { AbsolutePath } from './util/absolute-path'\n\nexport const encodingUtil = {\n utf8ToUint8Array,\n bigIntToUint8Array,\n hexToUint8Array,\n base32ToUint8Array,\n base64ToUint8Array,\n uint8ArrayToUtf8,\n uint8ArrayToHex,\n uint8ArrayToBase32,\n uint8ArrayToBase64,\n uint8ArrayToBigInt,\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACyBO,MAAM,YAAY,GAAG;IAC1B,gBAAgB;IAChB,kBAAkB;IAClB,eAAe;IACf,kBAAkB;IAClB,kBAAkB;IAClB,gBAAgB;IAChB,eAAe;IACf,kBAAkB;IAClB,kBAAkB;IAClB,kBAAkB;;;;;"}
1
+ {"version":3,"file":"index.mjs","sources":["../src/awst_build/ptypes/for-export.ts","../src/index.ts"],"sourcesContent":["/* This file aggregates all ptypes into a single export for external consumption of the compiler api */\nexport * from './arc4-types'\nexport * from './index'\n","import {\n base32ToUint8Array,\n base64ToUint8Array,\n bigIntToUint8Array,\n hexToUint8Array,\n uint8ArrayToBase32,\n uint8ArrayToBase64,\n uint8ArrayToBigInt,\n uint8ArrayToHex,\n uint8ArrayToUtf8,\n utf8ToUint8Array,\n} from './util'\nimport './util/polyfills'\n\nexport { SourceLocation } from './awst/source-location'\nexport * as ptypes from './awst_build/ptypes/for-export'\nexport { registerPTypes } from './awst_build/ptypes/register'\nexport { typeRegistry } from './awst_build/type-registry'\nexport { TypeResolver } from './awst_build/type-resolver'\nexport { compile } from './compile'\nexport { processInputPaths } from './input-paths/process-input-paths'\nexport { LoggingContext, LogLevel, LogSource, LogEvent } from './logger'\nexport { CompileOptions } from './options'\nexport { AbsolutePath } from './util/absolute-path'\n\nexport const encodingUtil = {\n utf8ToUint8Array,\n bigIntToUint8Array,\n hexToUint8Array,\n base32ToUint8Array,\n base64ToUint8Array,\n uint8ArrayToUtf8,\n uint8ArrayToHex,\n uint8ArrayToBase32,\n uint8ArrayToBase64,\n uint8ArrayToBigInt,\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACyBO,MAAM,YAAY,GAAG;IAC1B,gBAAgB;IAChB,kBAAkB;IAClB,eAAe;IACf,kBAAkB;IAClB,kBAAkB;IAClB,gBAAgB;IAChB,eAAe;IACf,kBAAkB;IAClB,kBAAkB;IAClB,kBAAkB;;;;;"}
@@ -1,4 +1,4 @@
1
- import { am as LibClassType, d as Constants, bl as boolPType, ck as wtypes, bX as stringPType, a4 as GenericPType, cl as codeInvariant, aH as ReadonlyTuplePType, at as MutableTuplePType, az as PType, aw as NumericLiteralPType, b_ as uint64PType, bk as biguintPType, z as ArrayPType, aF as ReadonlyArrayPType, e as accountPType, bm as bytesPType, an as LibFunctionType, cm as invariant, _ as ContractClassPType, bq as compiledContractType, a8 as ImmutableObjectPType, b1 as applicationItxnType, v as voidPType, as as MutableObjectPType, I as InternalError, c as CodeError, cn as throwError, co as StringConstant, cp as BytesConstant, cq as IntegerConstant, cr as BoolConstant, cs as AddressConstant, ct as MethodConstant, cu as DecimalConstant, cv as TemplateVar, cc as LogSource, L as LogLevel, cw as instanceOfAny, cx as SingleEvaluation, cy as VarExpression, cz as nodeFactory, cA as NotSupported, l as logger, cB as TupleItemExpression, cC as FieldExpression, cD as IndexExpression, cE as TupleExpression, cF as AppStateExpression, cG as AppAccountStateExpression, cH as BoxValueExpression, cI as ReinterpretCast, cJ as StateGetEx, cK as StateGet, aQ as TransientType, bQ as numberPType, bj as bigIntPType, b2 as arc28EmitFunction, y as ArrayLiteralPType, H as BigIntLiteralPType, cL as hasFlags, cM as BinaryBooleanOperator, au as NamespacePType, bi as baseContractType, b5 as arc4BaseContractType, cN as SymbolName, aW as UnionPType, a7 as GroupTransactionPType, h as anyGtxnType, aT as Uint64EnumMemberType, aR as TypeParameterType, bx as esSymbol, c0 as unknownPType, bO as neverPType, a_ as anyPType, bP as nullPType, b$ as undefinedPType, Z as ClusteredPrototype, ac as IntersectionPType, bK as logicSigBaseType, ar as LogicSigPType, aU as Uint64EnumType, a1 as FunctionPType, w as ApprovalProgram, X as ClearStateProgram, cj as isIn, R as BoxMapPType, S as BoxPType, aq as LocalStateType, a6 as GlobalStateType, aL as SuperPrototypeSelector, Y as ClusteredContractClassType, cd as SourceLocation, cO as intersectsFlags, cP as extractModuleName, cQ as toSubScript, A as AbsolutePath, cR as CompilationSet, cS as ARC4ABIMethodConfig, C as ContractReference, V as BytesPType, cT as EqualityComparison, ax as ObjectLiteralPType, bA as isObjectType$1, bW as readonlyDecorator, b3 as arc4AbiMethodDecorator, b4 as arc4BareMethodDecorator, cU as ARC4CreateOption, cV as NewArray, O as OnCompletionAction, cW as BytesEncoding, ca as bigIntToUint8Array, cX as FixableCodeError, cY as UInt64BinaryOperator, cZ as tryConvertEnum, c_ as NumericComparison, c$ as UInt64UnaryOperator, bC as itoaMethod, aV as Uint64Function, d0 as UInt64PostfixUnaryOperator, a0 as FixedArrayPType, aj as IterableIteratorType, ai as IterableIteratorGeneric, f as applicationPType, g as assetPType, bR as onCompleteActionType, d1 as wrapInCodeError, c9 as base32ToUint8Array, bZ as transactionTypeType, d2 as TransactionKind, bp as compileFunctionType, br as compiledLogicSigType, d3 as LogicSigReference, a9 as InnerTransactionPType, aP as TransactionFunctionType, bY as submitGroupItxnFunction, ak as ItxnParamsPType, d4 as getInnerTransactionType, d5 as getItxnParamsType, d6 as CompiledContract, d7 as ARC4BareMethodConfig, d8 as MethodSignature, cf as enumFromValue, x as ArrayGeneric, $ as FixedArrayGeneric, ci as zipStrict, bz as isArrayType, bB as isTupleLike, bM as matchFunction, b7 as assertMatchFunction, d9 as BigUIntBinaryOperator, K as BigUintFunction, da as BigUIntPostfixUnaryOperator, cb as utf8ToUint8Array, db as BytesBinaryOperator, dc as IntrinsicCall, c7 as uint8ArrayToUtf8, T as BytesFunction, U as BytesGeneric, c8 as base64ToUint8Array, dd as enumKeyFromValue, de as BytesUnaryOperator, bo as cloneFunctionPType, bs as contractOptionsDecorator, bv as ensureBudgetFunction, df as PuyaLibFunction, bS as opUpFeeSourceType, ad as IntrinsicEnumType, bL as logicSigOptionsDecorator, aa as InstanceType, ay as ObjectWithOptionalFieldsType, c3 as vrfVerifyPType, bN as mimcConfigurationsPType, bu as ecdsaPType, bt as ecPType, bh as base64PType, ae as IntrinsicFunctionGroupType, dg as Expression, ag as IntrinsicFunctionType, aI as ReferenceArrayGeneric, aJ as ReferenceArrayType, dh as AppStorageKind, aX as UnsupportedType, di as transientTypeErrors, a5 as GlobalStateGeneric, aN as TemplateVarFunction, dj as getGroupTransactionType, bD as itxnComposePType, aS as Uint64EnumMemberLiteralType, aY as anyItxnParamsType, c2 as validateEncodingFunctionPType, M as BooleanFunction, aK as StringFunction, aE as ReadonlyArrayGeneric, aG as ReadonlyGeneric, a2 as GeneratorGeneric, a3 as GeneratorType, aC as PromiseGeneric, aD as PromiseType, W as ClassMethodDecoratorContext, aM as SuperPrototypeSelectorGeneric, aB as PolytypeClassMethodHelper, bH as logFunction, b6 as assertFunction, bw as errFunction, bI as loggedAssertFunction, bJ as loggedErrFunction, c1 as urangeFunction, bn as bzeroFunction, ah as IntrinsicFunctionTypeType, q as ALL_OP_ENUMS, af as IntrinsicFunctionGroupTypeType, ap as LocalStateGeneric, N as BoxGeneric, Q as BoxMapGeneric, t as ApplicationFunctionType, r as AccountFunction, E as AssetFunction, p as paymentGtxnType, aA as PaymentTxnFunction, k as keyRegistrationGtxnType, al as KeyRegistrationTxnFunction, i as assetConfigGtxnType, B as AssetConfigTxnFunction, j as assetTransferGtxnType, F as AssetTransferTxnFunction, m as assetFreezeGtxnType, D as AssetFreezeTxnFunction, n as applicationCallGtxnType, u as ApplicationTxnFunction, aO as TransactionFunction, bT as paymentItxnFn, bE as keyRegistrationItxnFn, b8 as assetConfigItxnFn, be as assetTransferItxnFn, bb as assetFreezeItxnFn, a$ as applicationCallItxnFn, bV as paymentItxnType, bG as keyRegistrationItxnType, ba as assetConfigItxnType, bg as assetTransferItxnType, bd as assetFreezeItxnType, bU as paymentItxnParamsType, bF as keyRegistrationItxnParamsType, b9 as assetConfigItxnParamsType, bf as assetTransferItxnParamsType, bc as assetFreezeItxnParamsType, b0 as applicationCallItxnParamsType, by as inputOnlyObjects, dk as Contract, dl as InstanceSuperMethodTarget, dm as ExpressionStatement, dn as AssertExpression, dp as VoidConstant, dq as ArrayConcat, dr as ArrayPop, ds as ArrayReplace, dt as ArrayLength, du as SizeOf, dv as UpdateInnerTransaction, dw as CheckedMaybe, dx as SetInnerTransactionFields, dy as StageInnerTransactions, dz as SubmitInnerTransaction, dA as BoxPrefixedKeyExpression, dB as AssignmentExpression, dC as CommaExpression, dD as NumericComparisonExpression, dE as BytesComparisonExpression, dF as PuyaLibCall, dG as UInt64UnaryOperation, dH as UInt64PostfixUnaryOperation, dI as BigUIntPostfixUnaryOperation, dJ as BytesUnaryOperation, dK as UInt64BinaryOperation, dL as BigUIntBinaryOperation, dM as BooleanBinaryOperation, dN as Not, dO as Emit, dP as Range, dQ as Enumeration, dR as Reversed, dS as StateExists, dT as ARC4Router, dU as MethodSignatureString, dV as SubroutineID, dW as ContractMethodTarget, dX as InstanceMethodTarget, c6 as uint8ArrayToBase32, cg as mkDirIfNotExists, dY as patchErrorLocation, dZ as Goto, d_ as ReturnStatement, d$ as ContractMethod, e0 as sameSets, b as ContractClassModel, e1 as Subroutine, e2 as LogicSigClassModel, e3 as ptypeIn, e4 as expandMaybeArray, a as LoggingContext, P as PuyaError } from './contract-class-model-Dvfr2oDn.js';
1
+ import { ao as LibClassType, d as Constants, bp as boolPType, co as wtypes, b$ as stringPType, a4 as GenericPType, cp as codeInvariant, aL as ReadonlyTuplePType, ax as MutableTuplePType, aD as PType, aA as NumericLiteralPType, c2 as uint64PType, bo as biguintPType, z as ArrayPType, aJ as ReadonlyArrayPType, e as accountPType, bq as bytesPType, ap as LibFunctionType, cq as invariant, _ as ContractClassPType, bu as compiledContractType, aa as ImmutableObjectPType, b5 as applicationItxnType, v as voidPType, aw as MutableObjectPType, I as InternalError, c as CodeError, cr as throwError, cs as StringConstant, ct as BytesConstant, cu as IntegerConstant, cv as BoolConstant, cw as AddressConstant, cx as MethodConstant, cy as DecimalConstant, cz as TemplateVar, cg as LogSource, L as LogLevel, cA as instanceOfAny, cB as SingleEvaluation, cC as VarExpression, cD as nodeFactory, cE as NotSupported, l as logger, cF as TupleItemExpression, cG as FieldExpression, cH as IndexExpression, cI as TupleExpression, cJ as AppStateExpression, cK as AppAccountStateExpression, cL as BoxValueExpression, cM as ReinterpretCast, cN as StateGetEx, cO as StateGet, aU as TransientType, bU as numberPType, bn as bigIntPType, b6 as arc28EmitFunction, y as ArrayLiteralPType, H as BigIntLiteralPType, cP as hasFlags, cQ as BinaryBooleanOperator, ay as NamespacePType, bm as baseContractType, b9 as arc4BaseContractType, cR as SymbolName, a_ as UnionPType, a9 as GroupTransactionPType, h as anyGtxnType, aX as Uint64EnumMemberType, aV as TypeParameterType, bB as esSymbol, c4 as unknownPType, bS as neverPType, b2 as anyPType, bT as nullPType, c3 as undefinedPType, Z as ClusteredPrototype, ae as IntersectionPType, bO as logicSigBaseType, av as LogicSigPType, aY as Uint64EnumType, a1 as FunctionPType, w as ApprovalProgram, X as ClearStateProgram, cn as isIn, R as BoxMapPType, S as BoxPType, as as LocalMapType, au as LocalStateType, a6 as GlobalMapType, a8 as GlobalStateType, aP as SuperPrototypeSelector, Y as ClusteredContractClassType, ch as SourceLocation, cS as intersectsFlags, cT as extractModuleName, cU as toSubScript, A as AbsolutePath, cV as CompilationSet, cW as ARC4ABIMethodConfig, C as ContractReference, V as BytesPType, cX as EqualityComparison, aB as ObjectLiteralPType, bE as isObjectType$1, b_ as readonlyDecorator, b7 as arc4AbiMethodDecorator, b8 as arc4BareMethodDecorator, cY as ARC4CreateOption, cZ as NewArray, O as OnCompletionAction, c_ as BytesEncoding, ce as bigIntToUint8Array, c$ as FixableCodeError, d0 as UInt64BinaryOperator, d1 as tryConvertEnum, d2 as NumericComparison, d3 as UInt64UnaryOperator, bG as itoaMethod, aZ as Uint64Function, d4 as UInt64PostfixUnaryOperator, a0 as FixedArrayPType, al as IterableIteratorType, ak as IterableIteratorGeneric, f as applicationPType, g as assetPType, bV as onCompleteActionType, d5 as wrapInCodeError, cd as base32ToUint8Array, c1 as transactionTypeType, d6 as TransactionKind, bt as compileFunctionType, bv as compiledLogicSigType, d7 as LogicSigReference, ab as InnerTransactionPType, aT as TransactionFunctionType, c0 as submitGroupItxnFunction, am as ItxnParamsPType, d8 as getInnerTransactionType, d9 as getItxnParamsType, da as CompiledContract, db as ARC4BareMethodConfig, dc as MethodSignature, cj as enumFromValue, x as ArrayGeneric, $ as FixedArrayGeneric, cm as zipStrict, bD as isArrayType, bF as isTupleLike, bQ as matchFunction, bb as assertMatchFunction, dd as BigUIntBinaryOperator, K as BigUintFunction, de as BigUIntPostfixUnaryOperator, cf as utf8ToUint8Array, df as BytesBinaryOperator, dg as IntrinsicCall, cb as uint8ArrayToUtf8, T as BytesFunction, U as BytesGeneric, cc as base64ToUint8Array, dh as enumKeyFromValue, di as BytesUnaryOperator, bs as cloneFunctionPType, bw as contractOptionsDecorator, bz as ensureBudgetFunction, dj as PuyaLibFunction, bW as opUpFeeSourceType, af as IntrinsicEnumType, bP as logicSigOptionsDecorator, ac as InstanceType, aC as ObjectWithOptionalFieldsType, c7 as vrfVerifyPType, bR as mimcConfigurationsPType, by as ecdsaPType, bx as ecPType, bl as base64PType, ag as IntrinsicFunctionGroupType, dk as Expression, ai as IntrinsicFunctionType, aM as ReferenceArrayGeneric, aN as ReferenceArrayType, dl as AppStorageKind, a$ as UnsupportedType, dm as transientTypeErrors, a7 as GlobalStateGeneric, aR as TemplateVarFunction, dn as getGroupTransactionType, bH as itxnComposePType, aW as Uint64EnumMemberLiteralType, b0 as anyItxnParamsType, c6 as validateEncodingFunctionPType, M as BooleanFunction, aO as StringFunction, aI as ReadonlyArrayGeneric, aK as ReadonlyGeneric, a2 as GeneratorGeneric, a3 as GeneratorType, aG as PromiseGeneric, aH as PromiseType, W as ClassMethodDecoratorContext, aQ as SuperPrototypeSelectorGeneric, aF as PolytypeClassMethodHelper, bL as logFunction, ba as assertFunction, bA as errFunction, bM as loggedAssertFunction, bN as loggedErrFunction, c5 as urangeFunction, br as bzeroFunction, aj as IntrinsicFunctionTypeType, q as ALL_OP_ENUMS, ah as IntrinsicFunctionGroupTypeType, a5 as GlobalMapGeneric, at as LocalStateGeneric, ar as LocalMapGeneric, N as BoxGeneric, Q as BoxMapGeneric, t as ApplicationFunctionType, r as AccountFunction, E as AssetFunction, p as paymentGtxnType, aE as PaymentTxnFunction, k as keyRegistrationGtxnType, an as KeyRegistrationTxnFunction, i as assetConfigGtxnType, B as AssetConfigTxnFunction, j as assetTransferGtxnType, F as AssetTransferTxnFunction, m as assetFreezeGtxnType, D as AssetFreezeTxnFunction, n as applicationCallGtxnType, u as ApplicationTxnFunction, aS as TransactionFunction, bX as paymentItxnFn, bI as keyRegistrationItxnFn, bc as assetConfigItxnFn, bi as assetTransferItxnFn, bf as assetFreezeItxnFn, b3 as applicationCallItxnFn, bZ as paymentItxnType, bK as keyRegistrationItxnType, be as assetConfigItxnType, bk as assetTransferItxnType, bh as assetFreezeItxnType, bY as paymentItxnParamsType, bJ as keyRegistrationItxnParamsType, bd as assetConfigItxnParamsType, bj as assetTransferItxnParamsType, bg as assetFreezeItxnParamsType, b4 as applicationCallItxnParamsType, bC as inputOnlyObjects, dp as Contract, dq as InstanceSuperMethodTarget, dr as ExpressionStatement, ds as AssertExpression, dt as VoidConstant, du as ArrayConcat, dv as ArrayPop, dw as ArrayReplace, dx as ArrayLength, dy as SizeOf, dz as UpdateInnerTransaction, dA as CheckedMaybe, dB as SetInnerTransactionFields, dC as StageInnerTransactions, dD as SubmitInnerTransaction, dE as BoxPrefixedKeyExpression, dF as AssignmentExpression, dG as CommaExpression, dH as NumericComparisonExpression, dI as BytesComparisonExpression, dJ as PuyaLibCall, dK as UInt64UnaryOperation, dL as UInt64PostfixUnaryOperation, dM as BigUIntPostfixUnaryOperation, dN as BytesUnaryOperation, dO as UInt64BinaryOperation, dP as BigUIntBinaryOperation, dQ as BooleanBinaryOperation, dR as Not, dS as Emit, dT as Range, dU as Enumeration, dV as Reversed, dW as StateExists, dX as ARC4Router, dY as MethodSignatureString, dZ as SubroutineID, d_ as ContractMethodTarget, d$ as InstanceMethodTarget, ca as uint8ArrayToBase32, ck as mkDirIfNotExists, e0 as patchErrorLocation, e1 as Goto, e2 as ReturnStatement, e3 as ContractMethod, e4 as sameSets, b as ContractClassModel, e5 as Subroutine, e6 as LogicSigClassModel, e7 as ptypeIn, e8 as expandMaybeArray, a as LoggingContext, P as PuyaError } from './contract-class-model-QzlhxT7N.js';
2
2
  import * as fs from 'node:fs';
3
3
  import 'node:util';
4
4
  import pathe__default, { normalize } from 'pathe';
@@ -921,9 +921,15 @@ class DefaultVisitor {
921
921
  visitGlobalStateType(ptype) {
922
922
  return this.defaultReturn(ptype);
923
923
  }
924
+ visitGlobalMapType(ptype) {
925
+ return this.defaultReturn(ptype);
926
+ }
924
927
  visitLocalStateType(ptype) {
925
928
  return this.defaultReturn(ptype);
926
929
  }
930
+ visitLocalMapType(ptype) {
931
+ return this.defaultReturn(ptype);
932
+ }
927
933
  visitBoxPType(ptype) {
928
934
  return this.defaultReturn(ptype);
929
935
  }
@@ -2765,7 +2771,7 @@ let TypeResolver = (() => {
2765
2771
  for (const prop of tsType.getProperties()) {
2766
2772
  const type = this.checker.getTypeOfSymbol(prop);
2767
2773
  const ptype = this.resolveType(type, this.getLocationOfSymbol(prop) ?? sourceLocation);
2768
- if (instanceOfAny(ptype, GlobalStateType, LocalStateType, BoxPType, BoxMapPType)) {
2774
+ if (instanceOfAny(ptype, GlobalStateType, GlobalMapType, LocalStateType, LocalMapType, BoxPType, BoxMapPType)) {
2769
2775
  properties[prop.name] = ptype;
2770
2776
  }
2771
2777
  else if (ptype instanceof FunctionPType) {
@@ -8340,7 +8346,7 @@ class ContractThisBuilder extends InstanceBuilder {
8340
8346
  const property = this.ptype.properties[name];
8341
8347
  if (property) {
8342
8348
  const storageDeclaration = AwstBuildContext.current.getStorageDeclaration(this.ptype, name);
8343
- if (instanceOfAny(property, GlobalStateType, LocalStateType, BoxPType, BoxMapPType)) {
8349
+ if (instanceOfAny(property, GlobalStateType, GlobalMapType, LocalStateType, LocalMapType, BoxPType, BoxMapPType)) {
8344
8350
  codeInvariant(storageDeclaration, `No declaration exists for property ${property}.`, sourceLocation);
8345
8351
  return instanceEb(storageDeclaration.key, property);
8346
8352
  }
@@ -14506,13 +14512,13 @@ class AppStorageDeclaration {
14506
14512
  this.description = props.description;
14507
14513
  }
14508
14514
  get kind() {
14509
- if (this.ptype instanceof GlobalStateType) {
14515
+ if (instanceOfAny(this.ptype, GlobalStateType, GlobalMapType)) {
14510
14516
  return AppStorageKind.appGlobal;
14511
14517
  }
14512
- if (this.ptype instanceof LocalStateType) {
14518
+ if (instanceOfAny(this.ptype, LocalStateType, LocalMapType)) {
14513
14519
  return AppStorageKind.accountLocal;
14514
14520
  }
14515
- invariant(this.ptype instanceof BoxPType || this.ptype instanceof BoxMapPType, 'Must be exhaustive check on ptype');
14521
+ invariant(instanceOfAny(this.ptype, BoxPType, BoxMapPType), 'Must be exhaustive check on ptype');
14516
14522
  return AppStorageKind.box;
14517
14523
  }
14518
14524
  get key() {
@@ -14537,7 +14543,7 @@ class AppStorageDeclaration {
14537
14543
  ...this,
14538
14544
  kind: this.kind,
14539
14545
  key: this.key,
14540
- keyWtype: this.ptype instanceof BoxMapPType ? this.ptype.keyType.wtypeOrThrow : null,
14546
+ keyWtype: instanceOfAny(this.ptype, BoxMapPType, GlobalMapType, LocalMapType) ? this.ptype.keyType.wtypeOrThrow : null,
14541
14547
  storageWtype: this.ptype.contentType.wtypeOrThrow,
14542
14548
  });
14543
14549
  }
@@ -14973,7 +14979,7 @@ class BoxMapExpressionBuilder extends BoxProxyExpressionBuilder {
14973
14979
  argSpec: (a) => [a.required(this.ptype.keyType)],
14974
14980
  funcName: 'BoxMap',
14975
14981
  });
14976
- return new BoxExpressionBuilder(nodeFactory.boxPrefixedKeyExpression({
14982
+ return new BoxExpressionBuilder(nodeFactory.mapPrefixedKeyExpression({
14977
14983
  key: key.resolve(),
14978
14984
  prefix: this._expr,
14979
14985
  sourceLocation: this.sourceLocation,
@@ -15132,6 +15138,75 @@ class GlobalStateFunctionResultBuilder extends GlobalStateExpressionBuilder {
15132
15138
  }
15133
15139
  }
15134
15140
 
15141
+ class GlobalMapFunctionBuilder extends FunctionBuilder {
15142
+ call(args, typeArgs, sourceLocation) {
15143
+ const { ptypes: [keySuffixType, contentPType], args: [{ keyPrefix }], } = parseFunctionArgs({
15144
+ args,
15145
+ typeArgs,
15146
+ funcName: 'GlobalMap',
15147
+ callLocation: sourceLocation,
15148
+ genericTypeArgs: 2,
15149
+ argSpec: (a) => [a.obj({ keyPrefix: a.optional(bytesPType, stringPType) })],
15150
+ });
15151
+ const ptype = new GlobalMapType({ content: contentPType, keyType: keySuffixType });
15152
+ return new GlobalMapFunctionResultBuilder(extractKey(keyPrefix, wtypes.stateKeyWType, sourceLocation), ptype, sourceLocation);
15153
+ }
15154
+ }
15155
+ class GlobalMapExpressionBuilder extends InstanceExpressionBuilder {
15156
+ constructor(expr, ptype) {
15157
+ invariant(ptype instanceof GlobalMapType, 'ptype must be instance of GlobalMapType');
15158
+ super(expr, ptype);
15159
+ }
15160
+ call(args, typeArgs, sourceLocation) {
15161
+ const { args: [key], } = parseFunctionArgs({
15162
+ args,
15163
+ typeArgs,
15164
+ genericTypeArgs: 0,
15165
+ callLocation: sourceLocation,
15166
+ argSpec: (a) => [a.required(this.ptype.keyType)],
15167
+ funcName: 'GlobalMap',
15168
+ });
15169
+ return new GlobalStateExpressionBuilder(nodeFactory.mapPrefixedKeyExpression({
15170
+ key: key.resolve(),
15171
+ prefix: this._expr,
15172
+ sourceLocation: this.sourceLocation,
15173
+ wtype: wtypes.stateKeyWType,
15174
+ }), new GlobalStateType({
15175
+ content: this.ptype.contentType,
15176
+ }));
15177
+ }
15178
+ memberAccess(name, sourceLocation) {
15179
+ switch (name) {
15180
+ case 'keyPrefix':
15181
+ return instanceEb(nodeFactory.reinterpretCast({ expr: this.resolve(), wtype: wtypes.bytesWType, sourceLocation }), bytesPType);
15182
+ }
15183
+ return super.memberAccess(name, sourceLocation);
15184
+ }
15185
+ }
15186
+ class GlobalMapFunctionResultBuilder extends GlobalMapExpressionBuilder {
15187
+ _keyPrefixExpr;
15188
+ constructor(expr, ptype, sourceLocation) {
15189
+ super(expr ?? nodeFactory.voidConstant({ sourceLocation }), ptype);
15190
+ this._keyPrefixExpr = expr;
15191
+ }
15192
+ resolve() {
15193
+ codeInvariant(this._keyPrefixExpr, 'Global map must have explicit key prefix provided if not being assigned to a contract property', this.sourceLocation);
15194
+ return this._keyPrefixExpr;
15195
+ }
15196
+ buildStorageDeclaration(memberName, memberLocation, memberDescription, contractType) {
15197
+ if (this._keyPrefixExpr)
15198
+ codeInvariant(this._keyPrefixExpr instanceof BytesConstant, `key prefix must be a compile time constant value if ${this.typeDescription} is assigned to a contract member`);
15199
+ return new AppStorageDeclaration({
15200
+ sourceLocation: memberLocation,
15201
+ ptype: this.ptype,
15202
+ memberName: memberName,
15203
+ keyOverride: this._keyPrefixExpr ?? null,
15204
+ description: memberDescription,
15205
+ definedIn: contractType,
15206
+ });
15207
+ }
15208
+ }
15209
+
15135
15210
  class LocalStateFunctionBuilder extends FunctionBuilder {
15136
15211
  constructor(sourceLocation) {
15137
15212
  super(sourceLocation);
@@ -15271,6 +15346,86 @@ class LocalStateFunctionResultBuilder extends InstanceBuilder {
15271
15346
  }
15272
15347
  }
15273
15348
 
15349
+ class LocalMapFunctionBuilder extends FunctionBuilder {
15350
+ call(args, typeArgs, sourceLocation) {
15351
+ const { ptypes: [keySuffixType, contentPType], args: [{ keyPrefix }], } = parseFunctionArgs({
15352
+ args,
15353
+ typeArgs,
15354
+ funcName: 'LocalMap',
15355
+ callLocation: sourceLocation,
15356
+ genericTypeArgs: 2,
15357
+ argSpec: (a) => [a.obj({ keyPrefix: a.optional(bytesPType, stringPType) })],
15358
+ });
15359
+ const ptype = new LocalMapType({ content: contentPType, keyType: keySuffixType });
15360
+ return new LocalMapFunctionResultBuilder(extractKey(keyPrefix, wtypes.stateKeyWType, sourceLocation), ptype, sourceLocation);
15361
+ }
15362
+ }
15363
+ class LocalMapExpressionBuilder extends InstanceExpressionBuilder {
15364
+ constructor(expr, ptype) {
15365
+ invariant(ptype instanceof LocalMapType, 'ptype must be instance of LocalMapType');
15366
+ super(expr, ptype);
15367
+ }
15368
+ call(args, typeArgs, sourceLocation) {
15369
+ const { args: callArgs } = parseFunctionArgs({
15370
+ args,
15371
+ typeArgs,
15372
+ genericTypeArgs: 0,
15373
+ callLocation: sourceLocation,
15374
+ argSpec: (a) => [a.required(this.ptype.keyType), a.optional(accountPType)],
15375
+ funcName: 'LocalMap',
15376
+ });
15377
+ const [key, account] = callArgs;
15378
+ const prefixedKey = nodeFactory.mapPrefixedKeyExpression({
15379
+ key: key.resolve(),
15380
+ prefix: this._expr,
15381
+ sourceLocation: this.sourceLocation,
15382
+ wtype: wtypes.stateKeyWType,
15383
+ });
15384
+ if (account) {
15385
+ return new LocalStateForAccountExpressionBuilder(nodeFactory.appAccountStateExpression({
15386
+ key: prefixedKey,
15387
+ account: account.resolve(),
15388
+ wtype: this.ptype.contentType.wtypeOrThrow,
15389
+ existsAssertionMessage: 'check LocalState exists',
15390
+ sourceLocation,
15391
+ }), this.ptype.contentType);
15392
+ }
15393
+ return new LocalStateExpressionBuilder(prefixedKey, new LocalStateType({
15394
+ content: this.ptype.contentType,
15395
+ }));
15396
+ }
15397
+ memberAccess(name, sourceLocation) {
15398
+ switch (name) {
15399
+ case 'keyPrefix':
15400
+ return instanceEb(nodeFactory.reinterpretCast({ expr: this.resolve(), wtype: wtypes.bytesWType, sourceLocation }), bytesPType);
15401
+ }
15402
+ return super.memberAccess(name, sourceLocation);
15403
+ }
15404
+ }
15405
+ class LocalMapFunctionResultBuilder extends LocalMapExpressionBuilder {
15406
+ _keyPrefixExpr;
15407
+ constructor(expr, ptype, sourceLocation) {
15408
+ super(expr ?? nodeFactory.voidConstant({ sourceLocation }), ptype);
15409
+ this._keyPrefixExpr = expr;
15410
+ }
15411
+ resolve() {
15412
+ codeInvariant(this._keyPrefixExpr, 'Local map must have explicit key prefix provided if not being assigned to a contract property', this.sourceLocation);
15413
+ return this._keyPrefixExpr;
15414
+ }
15415
+ buildStorageDeclaration(memberName, memberLocation, memberDescription, contractType) {
15416
+ if (this._keyPrefixExpr)
15417
+ codeInvariant(this._keyPrefixExpr instanceof BytesConstant, `key prefix must be a compile time constant value if ${this.typeDescription} is assigned to a contract member`);
15418
+ return new AppStorageDeclaration({
15419
+ sourceLocation: memberLocation,
15420
+ ptype: this.ptype,
15421
+ memberName: memberName,
15422
+ keyOverride: this._keyPrefixExpr ?? null,
15423
+ description: memberDescription,
15424
+ definedIn: contractType,
15425
+ });
15426
+ }
15427
+ }
15428
+
15274
15429
  const TemplateVarNameRegex = /^[A-Z\d_]+/;
15275
15430
  const templateVarName = A.regex(TemplateVarNameRegex);
15276
15431
  const hexBytes = A.sequenceOf([A.str('0x'), A.regex(/^([A-F0-9]{2})*/)]).map(([prefix, chars]) => hexToUint8Array(chars));
@@ -15818,12 +15973,24 @@ function registerPTypes(typeRegistry) {
15818
15973
  instanceEb: GlobalStateExpressionBuilder,
15819
15974
  singletonEb: GlobalStateFunctionBuilder,
15820
15975
  });
15976
+ typeRegistry.registerGeneric({
15977
+ generic: GlobalMapGeneric,
15978
+ ptype: GlobalMapType,
15979
+ instanceEb: GlobalMapExpressionBuilder,
15980
+ singletonEb: GlobalMapFunctionBuilder,
15981
+ });
15821
15982
  typeRegistry.registerGeneric({
15822
15983
  generic: LocalStateGeneric,
15823
15984
  ptype: LocalStateType,
15824
15985
  instanceEb: LocalStateExpressionBuilder,
15825
15986
  singletonEb: LocalStateFunctionBuilder,
15826
15987
  });
15988
+ typeRegistry.registerGeneric({
15989
+ generic: LocalMapGeneric,
15990
+ ptype: LocalMapType,
15991
+ instanceEb: LocalMapExpressionBuilder,
15992
+ singletonEb: LocalMapFunctionBuilder,
15993
+ });
15827
15994
  typeRegistry.registerGeneric({ generic: BoxGeneric, ptype: BoxPType, instanceEb: BoxExpressionBuilder, singletonEb: BoxFunctionBuilder });
15828
15995
  typeRegistry.registerGeneric({
15829
15996
  generic: BoxMapGeneric,
@@ -16142,6 +16309,10 @@ class FunctionTraverser {
16142
16309
  expression.key.accept(this);
16143
16310
  expression.account.accept(this);
16144
16311
  }
16312
+ visitMapPrefixedKeyExpression(expression) {
16313
+ expression.key.accept(this);
16314
+ expression.prefix.accept(this);
16315
+ }
16145
16316
  visitBoxPrefixedKeyExpression(expression) {
16146
16317
  expression.key.accept(this);
16147
16318
  expression.prefix.accept(this);
@@ -16634,6 +16805,9 @@ class ToCodeVisitor {
16634
16805
  .join(', ');
16635
16806
  return `${expression.base.accept(this)}.slice(${args})`;
16636
16807
  }
16808
+ visitMapPrefixedKeyExpression(expression) {
16809
+ return `MapKey(prefix=${expression.prefix.accept(this)}, key=${expression.key.accept(this)})`;
16810
+ }
16637
16811
  visitBoxPrefixedKeyExpression(expression) {
16638
16812
  return `BoxMapKey(prefix=${expression.prefix.accept(this)}, key=${expression.key.accept(this)})`;
16639
16813
  }
@@ -18952,10 +19126,14 @@ class ContractVisitor extends ClassDefinitionVisitor {
18952
19126
  logger.info(sourceLocation, 'Type annotations are not required on initialized properties');
18953
19127
  }
18954
19128
  const initializer = this.accept(node.initializer);
18955
- if (initializer instanceof GlobalStateFunctionResultBuilder) {
19129
+ if (initializer instanceof BoxProxyExpressionBuilder ||
19130
+ initializer instanceof LocalStateFunctionResultBuilder ||
19131
+ initializer instanceof LocalMapFunctionResultBuilder ||
19132
+ initializer instanceof GlobalStateFunctionResultBuilder ||
19133
+ initializer instanceof GlobalMapFunctionResultBuilder) {
18956
19134
  const storageDeclaration = initializer.buildStorageDeclaration(propertyName, this.sourceLocation(node.name), this.getNodeDescription(node), this._contractPType);
18957
19135
  this.context.addStorageDeclaration(storageDeclaration);
18958
- if (initializer.initialValue) {
19136
+ if (initializer instanceof GlobalStateFunctionResultBuilder && initializer.initialValue) {
18959
19137
  this._propertyInitialization.push(nodeFactory.assignmentStatement({
18960
19138
  target: nodeFactory.appStateExpression({
18961
19139
  key: storageDeclaration.key,
@@ -18968,11 +19146,8 @@ class ContractVisitor extends ClassDefinitionVisitor {
18968
19146
  }));
18969
19147
  }
18970
19148
  }
18971
- else if (initializer instanceof BoxProxyExpressionBuilder || initializer instanceof LocalStateFunctionResultBuilder) {
18972
- this.context.addStorageDeclaration(initializer.buildStorageDeclaration(propertyName, this.sourceLocation(node.name), this.getNodeDescription(node), this._contractPType));
18973
- }
18974
19149
  else {
18975
- logger.error(initializer.sourceLocation, `Unsupported property type ${initializer.typeDescription}. Only GlobalState, LocalState, and Box proxies can be stored on a contract.`);
19150
+ logger.error(initializer.sourceLocation, `Unsupported property type ${initializer.typeDescription}. Only GlobalState, GlobalMap, LocalState, LocalMap, and Box proxies can be stored on a contract.`);
18976
19151
  }
18977
19152
  }
18978
19153
  static buildContract(classDec, ptype) {
@@ -23351,4 +23526,4 @@ class PuyaOptions {
23351
23526
  }
23352
23527
 
23353
23528
  export { defaultPuyaOptions as $, ARC4ArrayType as A, ByteClass as B, ContractProxyGeneric as C, DynamicArrayGeneric as D, abiCallFunction as E, arc4AddressAlias as F, arc4BooleanType as G, arc4ByteAlias as H, arc4StringType as I, arc4StructBaseType as J, arc4Uint64 as K, compileArc4Function as L, convertBytesFunction as M, decodeArc4Function as N, encodeArc4Function as O, methodSelectorFunction as P, sizeOfFunction as Q, uint8ArrayToHex as R, StaticArrayGeneric as S, TypedApplicationCallResponseGeneric as T, UFixedNxMGeneric as U, hexToUint8Array as V, CompileOptions as W, TypeResolver as X, processInputPaths as Y, registerPTypes as Z, typeRegistry as _, ARC4BoolClass as a, parseCliTemplateVar as a0, LocalsCoalescingStrategy as a1, PuyaService as a2, deserializeAndLog as a3, createTsProgram as a4, buildAwst as a5, validateAwst as a6, sleep as a7, DefaultMap as a8, relinquishThread as a9, ARC4EncodedType as b, ARC4InstanceType as c, ARC4StrClass as d, ARC4StructClass as e, ARC4StructType as f, ARC4TupleType as g, AddressClass as h, Arc4TupleGeneric as i, ContractProxyType as j, DynamicArrayType as k, DynamicBytesConstructor as l, DynamicBytesType as m, StaticArrayType as n, StaticBytesGeneric as o, StaticBytesType as p, TypedApplicationCallResponseType as q, UFixedNxMType as r, UintN128Class as s, UintN16Class as t, UintN256Class as u, UintN32Class as v, UintN64Class as w, UintN8Class as x, UintNGeneric as y, UintNType as z };
23354
- //# sourceMappingURL=options-Bq5xN07C.js.map
23529
+ //# sourceMappingURL=options-JF2uHXg3.js.map