@algorandfoundation/puya-ts 1.2.0-beta.35 → 1.2.0-beta.37
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.
- package/{analyser-service-B0DpIecU.js → analyser-service-Bk9GEtDA.js} +3 -3
- package/{analyser-service-B0DpIecU.js.map → analyser-service-Bk9GEtDA.js.map} +1 -1
- package/analyserService.mjs +3 -3
- package/{arc4-clientgen-Dd2qW-1d.js → arc4-clientgen-qBTlCOIm.js} +2 -2
- package/{arc4-clientgen-Dd2qW-1d.js.map → arc4-clientgen-qBTlCOIm.js.map} +1 -1
- package/awst_build/context/awst-build-context.d.ts +1 -1
- package/awst_build/ptypes/index.d.ts +64 -87
- package/bin/puyats-clientgen.mjs +5 -5
- package/bin/puyats-clientgen.mjs.map +1 -1
- package/bin/puyats-ls.mjs +13 -13
- package/bin/puyats-ls.mjs.map +1 -1
- package/bin/run-cli.mjs +12 -12
- package/{check-node-version-Df1hdewH.js → check-node-version-CLFFTDHN.js} +3 -3
- package/{check-node-version-Df1hdewH.js.map → check-node-version-CLFFTDHN.js.map} +1 -1
- package/cli-ls.d.ts +1 -1
- package/cli.d.ts +1 -1
- package/cli.mjs +15 -15
- package/cli.mjs.map +1 -1
- package/clientgen.d.ts +1 -1
- package/{compile-DGk1ftqu.js → compile-ycpMcgmJ.js} +6 -6
- package/{compile-DGk1ftqu.js.map → compile-ycpMcgmJ.js.map} +1 -1
- package/constants.d.ts +1 -1
- package/{contract-class-model-cK8F4WVM.js → contract-class-model-BZeEDGw0.js} +109 -243
- package/contract-class-model-BZeEDGw0.js.map +1 -0
- package/index.d.ts +0 -1
- package/index.mjs +8 -8
- package/index.mjs.map +1 -1
- package/language-server/analyser-service.d.ts +0 -1
- package/{options-sBHEIhey.js → options-DD9MApH4.js} +72 -78
- package/options-DD9MApH4.js.map +1 -0
- package/package.json +6 -3
- package/{resolve-puya-path-Bgh6DuRP.js → resolve-puya-path-Ba54kz9o.js} +4 -4
- package/{resolve-puya-path-Bgh6DuRP.js.map → resolve-puya-path-Ba54kz9o.js.map} +1 -1
- package/{semver-T4bO0VEo.js → semver-B0p_0XuH.js} +2 -2
- package/{semver-T4bO0VEo.js.map → semver-B0p_0XuH.js.map} +1 -1
- package/{util-CA3Q0W2C.js → util-Aa8RgOmt.js} +2 -2
- package/{util-CA3Q0W2C.js.map → util-Aa8RgOmt.js.map} +1 -1
- package/contract-class-model-cK8F4WVM.js.map +0 -1
- package/options-sBHEIhey.js.map +0 -1
- package/util/polyfills.d.ts +0 -1
package/index.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { base64ToUint8Array, hexToUint8Array, uint8ArrayToBase64, uint8ArrayToHex } from './util';
|
|
2
|
-
import './util/polyfills';
|
|
3
2
|
export { SourceLocation } from './awst/source-location';
|
|
4
3
|
export * as ptypes from './awst_build/ptypes/for-export';
|
|
5
4
|
export { registerPTypes } from './awst_build/ptypes/register';
|
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 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-
|
|
2
|
-
export { A as AbsolutePath, L as LogLevel, cg as LogSource, a as LoggingContext, ch as SourceLocation } from './contract-class-model-
|
|
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 compileArc4Function, L as convertBytesFunction, M as decodeArc4Function, N as encodeArc4Function, O as methodSelectorFunction, P as sizeOfFunction, Q as uint8ArrayToHex, R as hexToUint8Array } from './options-
|
|
4
|
-
export { V as CompileOptions, W as TypeResolver, X as processInputPaths, Y as registerPTypes, Z as typeRegistry } from './options-
|
|
5
|
-
export { c as compile } from './compile-
|
|
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-BZeEDGw0.js';
|
|
2
|
+
export { A as AbsolutePath, L as LogLevel, cg as LogSource, a as LoggingContext, ch as SourceLocation } from './contract-class-model-BZeEDGw0.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 compileArc4Function, L as convertBytesFunction, M as decodeArc4Function, N as encodeArc4Function, O as methodSelectorFunction, P as sizeOfFunction, Q as uint8ArrayToHex, R as hexToUint8Array } from './options-DD9MApH4.js';
|
|
4
|
+
export { V as CompileOptions, W as TypeResolver, X as processInputPaths, Y as registerPTypes, Z as typeRegistry } from './options-DD9MApH4.js';
|
|
5
|
+
export { c as compile } from './compile-ycpMcgmJ.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-
|
|
25
|
+
import './arc4-clientgen-qBTlCOIm.js';
|
|
26
26
|
import '@algorandfoundation/algokit-utils/abi';
|
|
27
27
|
import 'fs';
|
|
28
28
|
import 'fs/promises';
|
|
29
|
-
import './semver-
|
|
29
|
+
import './semver-B0p_0XuH.js';
|
|
30
30
|
import 'node:url';
|
|
31
|
-
import './resolve-puya-path-
|
|
31
|
+
import './resolve-puya-path-Ba54kz9o.js';
|
|
32
32
|
import 'signal-exit';
|
|
33
33
|
import 'tar';
|
|
34
34
|
import 'node:zlib';
|
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'\
|
|
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'\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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACwBO,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 { 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 StateGetEx, cN as StateGet, aU as TransientType, bU as numberPType, bn as bigIntPType, b6 as arc28EmitFunction, y as ArrayLiteralPType, H as BigIntLiteralPType, cO as hasFlags, cP as BinaryBooleanOperator, ay as NamespacePType, bm as baseContractType, b9 as arc4BaseContractType, cQ 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, cR as intersectsFlags, cS as extractModuleName, cT as toSubScript, A as AbsolutePath, cU as CompilationSet, cV as ARC4ABIMethodConfig, C as ContractReference, V as BytesPType, cW as EqualityComparison, aB as ObjectLiteralPType, bE as isObjectType$1, b_ as readonlyDecorator, b7 as arc4AbiMethodDecorator, b8 as arc4BareMethodDecorator, cX as ARC4CreateOption, cY as NewArray, O as OnCompletionAction, cZ as BytesEncoding, ce as bigIntToUint8Array, c_ as FixableCodeError, c$ as UInt64BinaryOperator, d0 as tryConvertEnum, d1 as NumericComparison, d2 as UInt64UnaryOperator, bG as itoaMethod, aZ as Uint64Function, d3 as UInt64PostfixUnaryOperator, a0 as FixedArrayPType, al as IterableIteratorType, ak as IterableIteratorGeneric, f as applicationPType, g as assetPType, bV as onCompleteActionType, d4 as wrapInCodeError, cd as base32ToUint8Array, c1 as transactionTypeType, d5 as TransactionKind, bt as compileFunctionType, bv as compiledLogicSigType, d6 as LogicSigReference, ab as InnerTransactionPType, aT as TransactionFunctionType, c0 as submitGroupItxnFunction, am as ItxnParamsPType, d7 as getInnerTransactionType, d8 as getItxnParamsType, d9 as CompiledContract, da as ARC4BareMethodConfig, db 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, dc as BigUIntBinaryOperator, K as BigUintFunction, dd as BigUIntPostfixUnaryOperator, cf as utf8ToUint8Array, de as BytesBinaryOperator, df as IntrinsicCall, cb as uint8ArrayToUtf8, T as BytesFunction, U as BytesGeneric, cc as base64ToUint8Array, dg as enumKeyFromValue, dh as BytesUnaryOperator, bs as cloneFunctionPType, bw as contractOptionsDecorator, bz as ensureBudgetFunction, di 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, dj as Expression, ai as IntrinsicFunctionType, aM as ReferenceArrayGeneric, aN as ReferenceArrayType, dk as AppStorageKind, a$ as UnsupportedType, dl as transientTypeErrors, a7 as GlobalStateGeneric, aR as TemplateVarFunction, dm 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, dn as Contract, dp as InstanceSuperMethodTarget, dq as ExpressionStatement, dr as AssertExpression, ds as VoidConstant, dt as ArrayConcat, du as ArrayPop, dv as ArrayReplace, dw as ArrayLength, dx as SizeOf, dy as UpdateInnerTransaction, dz as CheckedMaybe, dA as StageInnerTransactions, dB as SubmitInnerTransaction, dC as AssignmentExpression, dD as CommaExpression, dE as NumericComparisonExpression, dF as BytesComparisonExpression, dG as PuyaLibCall, dH as UInt64UnaryOperation, dI as UInt64PostfixUnaryOperation, dJ as BigUIntPostfixUnaryOperation, dK as BytesUnaryOperation, dL as UInt64BinaryOperation, dM as BigUIntBinaryOperation, dN as BooleanBinaryOperation, dO as Not, dP as Emit, dQ as Range, dR as Enumeration, dS as Reversed, dT as StateExists, dU as ARC4Router, dV as MethodSignatureString, dW as SubroutineID, dX as ContractMethodTarget, dY as InstanceMethodTarget, ca as uint8ArrayToBase32, ck as mkDirIfNotExists, dZ as patchErrorLocation, d_ as Goto, d$ as ReturnStatement, e0 as ContractMethod, e1 as sameSets, b as ContractClassModel, e2 as Subroutine, e3 as LogicSigClassModel, e4 as ptypeIn, e5 as expandMaybeArray, a as LoggingContext, P as PuyaError } from './contract-class-model-
|
|
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 StateGetEx, cN as StateGet, aU as TransientType, bU as numberPType, bn as bigIntPType, b6 as arc28EmitFunction, y as ArrayLiteralPType, H as BigIntLiteralPType, cO as hasFlags, cP as BinaryBooleanOperator, ay as NamespacePType, bm as baseContractType, b9 as arc4BaseContractType, cQ 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, cR as intersectsFlags, cS as extractModuleName, cT as toSubScript, A as AbsolutePath, cU as CompilationSet, cV as ARC4ABIMethodConfig, C as ContractReference, V as BytesPType, cW as EqualityComparison, aB as ObjectLiteralPType, bE as isObjectType$1, b_ as readonlyDecorator, b7 as arc4AbiMethodDecorator, b8 as arc4BareMethodDecorator, cX as ARC4CreateOption, cY as NewArray, O as OnCompletionAction, cZ as BytesEncoding, ce as bigIntToUint8Array, c_ as FixableCodeError, c$ as UInt64BinaryOperator, d0 as tryConvertEnum, d1 as NumericComparison, d2 as UInt64UnaryOperator, bG as itoaMethod, aZ as Uint64Function, d3 as UInt64PostfixUnaryOperator, a0 as FixedArrayPType, al as IterableIteratorType, ak as IterableIteratorGeneric, f as applicationPType, g as assetPType, bV as onCompleteActionType, d4 as wrapInCodeError, cd as base32ToUint8Array, c1 as transactionTypeType, d5 as TransactionKind, bt as compileFunctionType, bv as compiledLogicSigType, d6 as LogicSigReference, ab as InnerTransactionPType, aT as TransactionFunctionType, c0 as submitGroupItxnFunction, am as ItxnParamsPType, d7 as getInnerTransactionType, d8 as getItxnParamsType, d9 as CompiledContract, da as ARC4BareMethodConfig, db 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, dc as BigUIntBinaryOperator, K as BigUintFunction, dd as BigUIntPostfixUnaryOperator, cf as utf8ToUint8Array, de as BytesBinaryOperator, df as IntrinsicCall, cb as uint8ArrayToUtf8, T as BytesFunction, U as BytesGeneric, cc as base64ToUint8Array, dg as enumKeyFromValue, dh as BytesUnaryOperator, bs as cloneFunctionPType, bw as contractOptionsDecorator, bz as ensureBudgetFunction, di 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, dj as Expression, ai as IntrinsicFunctionType, aM as ReferenceArrayGeneric, aN as ReferenceArrayType, dk as AppStorageKind, a$ as UnsupportedType, dl as transientTypeErrors, a7 as GlobalStateGeneric, aR as TemplateVarFunction, dm 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, dn as Contract, dp as InstanceSuperMethodTarget, dq as ExpressionStatement, dr as AssertExpression, ds as VoidConstant, dt as ArrayConcat, du as ArrayPop, dv as ArrayReplace, dw as ArrayLength, dx as SizeOf, dy as UpdateInnerTransaction, dz as CheckedMaybe, dA as StageInnerTransactions, dB as SubmitInnerTransaction, dC as AssignmentExpression, dD as CommaExpression, dE as NumericComparisonExpression, dF as BytesComparisonExpression, dG as PuyaLibCall, dH as UInt64UnaryOperation, dI as UInt64PostfixUnaryOperation, dJ as BigUIntPostfixUnaryOperation, dK as BytesUnaryOperation, dL as UInt64BinaryOperation, dM as BigUIntBinaryOperation, dN as BooleanBinaryOperation, dO as Not, dP as Emit, dQ as Range, dR as Enumeration, dS as Reversed, dT as StateExists, dU as ARC4Router, dV as MethodSignatureString, dW as SubroutineID, dX as ContractMethodTarget, dY as InstanceMethodTarget, ca as uint8ArrayToBase32, ck as mkDirIfNotExists, dZ as patchErrorLocation, d_ as Goto, d$ as ReturnStatement, e0 as ContractMethod, e1 as sameSets, b as ContractClassModel, e2 as Subroutine, e3 as LogicSigClassModel, e4 as ptypeIn, e5 as expandMaybeArray, a as LoggingContext, P as PuyaError } from './contract-class-model-BZeEDGw0.js';
|
|
2
2
|
import * as fs from 'node:fs';
|
|
3
3
|
import 'node:util';
|
|
4
4
|
import pathe__default, { normalize } from 'pathe';
|
|
@@ -1282,16 +1282,16 @@ function isReferableExpression(expr) {
|
|
|
1282
1282
|
}
|
|
1283
1283
|
return false;
|
|
1284
1284
|
}
|
|
1285
|
+
const lValueNodes = [
|
|
1286
|
+
VarExpression,
|
|
1287
|
+
FieldExpression,
|
|
1288
|
+
IndexExpression,
|
|
1289
|
+
TupleExpression,
|
|
1290
|
+
AppStateExpression,
|
|
1291
|
+
AppAccountStateExpression,
|
|
1292
|
+
BoxValueExpression,
|
|
1293
|
+
];
|
|
1285
1294
|
function requireLValue(expr) {
|
|
1286
|
-
const lValueNodes = [
|
|
1287
|
-
VarExpression,
|
|
1288
|
-
FieldExpression,
|
|
1289
|
-
IndexExpression,
|
|
1290
|
-
TupleExpression,
|
|
1291
|
-
AppStateExpression,
|
|
1292
|
-
AppAccountStateExpression,
|
|
1293
|
-
BoxValueExpression,
|
|
1294
|
-
];
|
|
1295
1295
|
if (expr instanceof TupleItemExpression) {
|
|
1296
1296
|
if (expr.base.wtype.immutable) {
|
|
1297
1297
|
throw new CodeError('Expression is not a valid assignment target - object is immutable', { sourceLocation: expr.sourceLocation });
|
|
@@ -3130,6 +3130,7 @@ class AwstBuildContextImpl extends AwstBuildContext {
|
|
|
3130
3130
|
typeResolver;
|
|
3131
3131
|
typeChecker;
|
|
3132
3132
|
#compilationSet;
|
|
3133
|
+
programRoot;
|
|
3133
3134
|
constructor(program, options, constants, nameResolver, storageDeclarations, arc4MethodConfig, contractTypes, compilationSet) {
|
|
3134
3135
|
super();
|
|
3135
3136
|
this.program = program;
|
|
@@ -3139,8 +3140,9 @@ class AwstBuildContextImpl extends AwstBuildContext {
|
|
|
3139
3140
|
this.storageDeclarations = storageDeclarations;
|
|
3140
3141
|
this.arc4MethodConfig = arc4MethodConfig;
|
|
3141
3142
|
this.contractTypes = contractTypes;
|
|
3143
|
+
this.programRoot = AbsolutePath.resolve({ path: this.program.getCurrentDirectory() });
|
|
3142
3144
|
this.typeChecker = program.getTypeChecker();
|
|
3143
|
-
this.typeResolver = new TypeResolver(this.typeChecker,
|
|
3145
|
+
this.typeResolver = new TypeResolver(this.typeChecker, this.programRoot);
|
|
3144
3146
|
this.#compilationSet = compilationSet;
|
|
3145
3147
|
}
|
|
3146
3148
|
registerContractType(contractType) {
|
|
@@ -3156,33 +3158,40 @@ class AwstBuildContextImpl extends AwstBuildContext {
|
|
|
3156
3158
|
}
|
|
3157
3159
|
contractConfig.set(memberName, arc4MethodConfig);
|
|
3158
3160
|
}
|
|
3161
|
+
*iterateContractHierarchy(contractType) {
|
|
3162
|
+
const seen = new Set();
|
|
3163
|
+
for (const ct of [contractType, ...contractType.allBases()]) {
|
|
3164
|
+
if (seen.has(ct.fullName))
|
|
3165
|
+
continue;
|
|
3166
|
+
seen.add(ct.fullName);
|
|
3167
|
+
yield ct;
|
|
3168
|
+
}
|
|
3169
|
+
}
|
|
3170
|
+
*iterateMethodNameToConfigMap(contractType) {
|
|
3171
|
+
for (const ct of this.iterateContractHierarchy(contractType)) {
|
|
3172
|
+
if (ct.equals(baseContractType) || ct.equals(arc4BaseContractType) || ct instanceof ClusteredContractClassType)
|
|
3173
|
+
continue;
|
|
3174
|
+
const contractMethods = this.arc4MethodConfig.get(ct.fullName);
|
|
3175
|
+
if (contractMethods)
|
|
3176
|
+
yield contractMethods;
|
|
3177
|
+
}
|
|
3178
|
+
}
|
|
3159
3179
|
getArc4Config(contractType, memberName) {
|
|
3160
|
-
if (memberName) {
|
|
3161
|
-
for (const
|
|
3162
|
-
if (
|
|
3163
|
-
|
|
3164
|
-
const contractMethods = this.arc4MethodConfig.get(ct.fullName);
|
|
3165
|
-
if (!contractMethods)
|
|
3166
|
-
continue;
|
|
3167
|
-
if (contractMethods.has(memberName)) {
|
|
3168
|
-
return contractMethods.get(memberName);
|
|
3169
|
-
}
|
|
3180
|
+
if (memberName !== undefined) {
|
|
3181
|
+
for (const methods of this.iterateMethodNameToConfigMap(contractType)) {
|
|
3182
|
+
if (methods.has(memberName))
|
|
3183
|
+
return methods.get(memberName);
|
|
3170
3184
|
}
|
|
3171
3185
|
return undefined;
|
|
3172
3186
|
}
|
|
3173
|
-
|
|
3174
|
-
|
|
3175
|
-
|
|
3176
|
-
.
|
|
3177
|
-
|
|
3178
|
-
|
|
3179
|
-
const contractMethods = this.arc4MethodConfig.get(ct.fullName);
|
|
3180
|
-
if (!contractMethods)
|
|
3181
|
-
return acc;
|
|
3182
|
-
return new Map([...acc, ...contractMethods]);
|
|
3183
|
-
}, new Map())
|
|
3184
|
-
.values());
|
|
3187
|
+
const result = new Map();
|
|
3188
|
+
for (const methods of this.iterateMethodNameToConfigMap(contractType)) {
|
|
3189
|
+
for (const [name, cfg] of methods) {
|
|
3190
|
+
if (!result.has(name))
|
|
3191
|
+
result.set(name, cfg);
|
|
3192
|
+
}
|
|
3185
3193
|
}
|
|
3194
|
+
return Array.from(result.values());
|
|
3186
3195
|
}
|
|
3187
3196
|
static forProgram(program, options) {
|
|
3188
3197
|
return new AwstBuildContextImpl(program, options, new ConstantStore(program), new UniqueNameResolver(), new DefaultMap(), new DefaultMap(), {}, new CompilationSet());
|
|
@@ -3239,7 +3248,7 @@ class AwstBuildContextImpl extends AwstBuildContext {
|
|
|
3239
3248
|
}), ptype);
|
|
3240
3249
|
}
|
|
3241
3250
|
getSourceLocation(node) {
|
|
3242
|
-
return SourceLocation.fromNode(node,
|
|
3251
|
+
return SourceLocation.fromNode(node, this.programRoot);
|
|
3243
3252
|
}
|
|
3244
3253
|
addStorageDeclaration(declaration) {
|
|
3245
3254
|
const contractDeclarations = this.storageDeclarations.getOrDefault(declaration.definedIn.fullName, () => new Map());
|
|
@@ -3249,23 +3258,16 @@ class AwstBuildContextImpl extends AwstBuildContext {
|
|
|
3249
3258
|
contractDeclarations.set(declaration.memberName, declaration);
|
|
3250
3259
|
}
|
|
3251
3260
|
getStorageDeclaration(contractType, memberName) {
|
|
3252
|
-
const
|
|
3253
|
-
|
|
3254
|
-
|
|
3255
|
-
|
|
3256
|
-
const baseDeclaration = this.getStorageDeclaration(baseType, memberName);
|
|
3257
|
-
if (baseDeclaration)
|
|
3258
|
-
return baseDeclaration;
|
|
3261
|
+
for (const ct of this.iterateContractHierarchy(contractType)) {
|
|
3262
|
+
const declaration = this.storageDeclarations.get(ct.fullName)?.get(memberName);
|
|
3263
|
+
if (declaration)
|
|
3264
|
+
return declaration;
|
|
3259
3265
|
}
|
|
3260
3266
|
return undefined;
|
|
3261
3267
|
}
|
|
3262
3268
|
getStorageDefinitionsForContract(contractType) {
|
|
3263
3269
|
const result = new Map();
|
|
3264
|
-
const
|
|
3265
|
-
for (const ct of [contractType, ...contractType.allBases()]) {
|
|
3266
|
-
if (seenContracts.has(ct.fullName))
|
|
3267
|
-
continue;
|
|
3268
|
-
seenContracts.add(ct.fullName);
|
|
3270
|
+
for (const ct of this.iterateContractHierarchy(contractType)) {
|
|
3269
3271
|
for (const [memberName, declaration] of this.storageDeclarations.get(ct.fullName) ?? []) {
|
|
3270
3272
|
if (result.has(memberName)) {
|
|
3271
3273
|
logger.error(result.get(memberName)?.sourceLocation, `Redefinition of app storage member, original declared in ${declaration.sourceLocation}`);
|
|
@@ -6315,14 +6317,15 @@ function getImplicitFields({ applicationProxy, methodConfig, mappedFields, sourc
|
|
|
6315
6317
|
}
|
|
6316
6318
|
// Update or possible create
|
|
6317
6319
|
if (oca === OnCompletionAction.UpdateApplication || !hasAppId) {
|
|
6318
|
-
|
|
6319
|
-
implicitFields.set(TxnField.
|
|
6320
|
+
const proxyField = (name) => requireInstanceBuilder(applicationProxy.memberAccess(name, sourceLocation)).resolve();
|
|
6321
|
+
implicitFields.set(TxnField.ApprovalProgramPages, proxyField('approvalProgram'));
|
|
6322
|
+
implicitFields.set(TxnField.ClearStateProgramPages, proxyField('clearStateProgram'));
|
|
6320
6323
|
if (!hasAppId) {
|
|
6321
|
-
implicitFields.set(TxnField.GlobalNumUint,
|
|
6322
|
-
implicitFields.set(TxnField.GlobalNumByteSlice,
|
|
6323
|
-
implicitFields.set(TxnField.LocalNumByteSlice,
|
|
6324
|
-
implicitFields.set(TxnField.LocalNumUint,
|
|
6325
|
-
implicitFields.set(TxnField.ExtraProgramPages,
|
|
6324
|
+
implicitFields.set(TxnField.GlobalNumUint, proxyField('globalUints'));
|
|
6325
|
+
implicitFields.set(TxnField.GlobalNumByteSlice, proxyField('globalBytes'));
|
|
6326
|
+
implicitFields.set(TxnField.LocalNumByteSlice, proxyField('localBytes'));
|
|
6327
|
+
implicitFields.set(TxnField.LocalNumUint, proxyField('localUints'));
|
|
6328
|
+
implicitFields.set(TxnField.ExtraProgramPages, proxyField('extraProgramPages'));
|
|
6326
6329
|
}
|
|
6327
6330
|
}
|
|
6328
6331
|
return implicitFields;
|
|
@@ -7813,7 +7816,7 @@ class BytesFunctionBuilder extends FunctionBuilder {
|
|
|
7813
7816
|
],
|
|
7814
7817
|
});
|
|
7815
7818
|
const { strategy } = parsedArgs.at(-1);
|
|
7816
|
-
toFixedStrategy =
|
|
7819
|
+
toFixedStrategy = parseToFixedStrategy(strategy);
|
|
7817
7820
|
}
|
|
7818
7821
|
if (!initialValue) {
|
|
7819
7822
|
return empty;
|
|
@@ -7823,13 +7826,9 @@ class BytesFunctionBuilder extends FunctionBuilder {
|
|
|
7823
7826
|
logger.error(initialValue.sourceLocation, initialValue.ptype.expressionMessage);
|
|
7824
7827
|
bytesBuilder = empty;
|
|
7825
7828
|
}
|
|
7826
|
-
else if (initialValue.ptype.equals(uint64PType)
|
|
7827
|
-
|
|
7828
|
-
|
|
7829
|
-
else if (initialValue.ptype.equals(biguintPType)) {
|
|
7830
|
-
bytesBuilder = initialValue.toBytes(sourceLocation);
|
|
7831
|
-
}
|
|
7832
|
-
else if (initialValue.ptype.equals(stringPType)) {
|
|
7829
|
+
else if (initialValue.ptype.equals(uint64PType) ||
|
|
7830
|
+
initialValue.ptype.equals(biguintPType) ||
|
|
7831
|
+
initialValue.ptype.equals(stringPType)) {
|
|
7833
7832
|
bytesBuilder = initialValue.toBytes(sourceLocation);
|
|
7834
7833
|
}
|
|
7835
7834
|
else if (initialValue.ptype.equals(bytesPType)) {
|
|
@@ -7903,7 +7902,7 @@ class FromEncodingBuilder extends FunctionBuilder {
|
|
|
7903
7902
|
callLocation: sourceLocation,
|
|
7904
7903
|
argSpec: (a) => [a.passthrough(), a.obj({ length: a.required(NumericLiteralPType), strategy: a.optional(stringPType) })],
|
|
7905
7904
|
});
|
|
7906
|
-
const toFixedStrategy =
|
|
7905
|
+
const toFixedStrategy = parseToFixedStrategy(strategy);
|
|
7907
7906
|
if (toFixedStrategy !== 'assert-length') {
|
|
7908
7907
|
logger.error(sourceLocation, `Invalid strategy value of '${toFixedStrategy}'. Expected 'assert-length'`);
|
|
7909
7908
|
}
|
|
@@ -8036,7 +8035,7 @@ class ConcatFunctionBuilder extends FunctionBuilder {
|
|
|
8036
8035
|
}), bytesPType);
|
|
8037
8036
|
}
|
|
8038
8037
|
}
|
|
8039
|
-
function bytesToFixed(builder, fixedType, sourceLocation, strategy
|
|
8038
|
+
function bytesToFixed(builder, fixedType, sourceLocation, strategy) {
|
|
8040
8039
|
invariant(fixedType.length !== null, 'Should only be called for bytes with a fixed length', sourceLocation);
|
|
8041
8040
|
const expr = builder.resolve();
|
|
8042
8041
|
if (strategy === 'unsafe-cast') {
|
|
@@ -8084,6 +8083,9 @@ const fixedConversionStrategyMap = {
|
|
|
8084
8083
|
'assert-length': 'assert-length',
|
|
8085
8084
|
'unsafe-cast': 'unsafe-cast',
|
|
8086
8085
|
};
|
|
8086
|
+
function parseToFixedStrategy(strategy) {
|
|
8087
|
+
return strategy === undefined ? 'assert-length' : mapStringConstant(fixedConversionStrategyMap, strategy.resolve());
|
|
8088
|
+
}
|
|
8087
8089
|
class ToFixedLengthFunctionBuilder extends FunctionBuilder {
|
|
8088
8090
|
builder;
|
|
8089
8091
|
constructor(builder) {
|
|
@@ -8105,18 +8107,9 @@ class ToFixedLengthFunctionBuilder extends FunctionBuilder {
|
|
|
8105
8107
|
],
|
|
8106
8108
|
});
|
|
8107
8109
|
const sizeConst = requireIntegerConstant(length);
|
|
8108
|
-
const parsedStrategy =
|
|
8110
|
+
const parsedStrategy = parseToFixedStrategy(strategy);
|
|
8109
8111
|
const ptype = new BytesPType({ length: sizeConst.value });
|
|
8110
|
-
|
|
8111
|
-
return bytesToFixed(this.builder, ptype, sourceLocation);
|
|
8112
|
-
}
|
|
8113
|
-
else {
|
|
8114
|
-
return instanceEb(nodeFactory.reinterpretCast({
|
|
8115
|
-
expr: this.builder.resolve(),
|
|
8116
|
-
wtype: ptype.wtype,
|
|
8117
|
-
sourceLocation,
|
|
8118
|
-
}), ptype);
|
|
8119
|
-
}
|
|
8112
|
+
return bytesToFixed(this.builder, ptype, sourceLocation, parsedStrategy);
|
|
8120
8113
|
}
|
|
8121
8114
|
}
|
|
8122
8115
|
class BytesInvertBuilder extends FunctionBuilder {
|
|
@@ -17585,6 +17578,7 @@ class TextVisitor {
|
|
|
17585
17578
|
}
|
|
17586
17579
|
}
|
|
17587
17580
|
|
|
17581
|
+
const OPTIONAL_CHAINING_MESSAGE = 'The optional chaining (?.) operator is not supported';
|
|
17588
17582
|
class BaseVisitor {
|
|
17589
17583
|
baseAccept = (node) => accept(this, node);
|
|
17590
17584
|
textVisitor = new TextVisitor();
|
|
@@ -17743,7 +17737,7 @@ class BaseVisitor {
|
|
|
17743
17737
|
return new SpreadExpressionBuilder(base, this.sourceLocation(node));
|
|
17744
17738
|
}
|
|
17745
17739
|
visitPropertyAccessExpression(node) {
|
|
17746
|
-
this.logNotSupported(node.questionDotToken,
|
|
17740
|
+
this.logNotSupported(node.questionDotToken, OPTIONAL_CHAINING_MESSAGE);
|
|
17747
17741
|
const target = this.baseAccept(node.expression);
|
|
17748
17742
|
if (target instanceof NamespaceBuilder) {
|
|
17749
17743
|
codeInvariant(!ts.isPrivateIdentifier(node.name), 'Private identifiers are not supported here', this.sourceLocation(node.name));
|
|
@@ -17753,14 +17747,14 @@ class BaseVisitor {
|
|
|
17753
17747
|
return target.memberAccess(property, this.sourceLocation(node));
|
|
17754
17748
|
}
|
|
17755
17749
|
visitElementAccessExpression(node) {
|
|
17756
|
-
this.logNotSupported(node.questionDotToken,
|
|
17750
|
+
this.logNotSupported(node.questionDotToken, OPTIONAL_CHAINING_MESSAGE);
|
|
17757
17751
|
const sourceLocation = this.sourceLocation(node);
|
|
17758
17752
|
const target = this.baseAccept(node.expression);
|
|
17759
17753
|
const argument = this.baseAccept(node.argumentExpression);
|
|
17760
17754
|
return target.indexAccess(requireInstanceBuilder(argument), sourceLocation);
|
|
17761
17755
|
}
|
|
17762
17756
|
visitCallExpression(node) {
|
|
17763
|
-
this.logNotSupported(node.questionDotToken,
|
|
17757
|
+
this.logNotSupported(node.questionDotToken, OPTIONAL_CHAINING_MESSAGE);
|
|
17764
17758
|
const sourceLocation = this.sourceLocation(node);
|
|
17765
17759
|
const eb = this.baseAccept(node.expression);
|
|
17766
17760
|
const args = node.arguments
|
|
@@ -23513,4 +23507,4 @@ class PuyaOptions {
|
|
|
23513
23507
|
}
|
|
23514
23508
|
|
|
23515
23509
|
export { parseCliTemplateVar 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, compileArc4Function as K, convertBytesFunction as L, decodeArc4Function as M, encodeArc4Function as N, methodSelectorFunction as O, sizeOfFunction as P, uint8ArrayToHex as Q, hexToUint8Array as R, StaticArrayGeneric as S, TypedApplicationCallResponseGeneric as T, UFixedNxMGeneric as U, CompileOptions as V, TypeResolver as W, processInputPaths as X, registerPTypes as Y, typeRegistry as Z, defaultPuyaOptions as _, ARC4BoolClass as a, LocalsCoalescingStrategy as a0, PuyaService as a1, deserializeAndLog as a2, createTsProgram as a3, buildAwst as a4, validateAwst as a5, sleep as a6, DefaultMap as a7, relinquishThread as a8, 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 };
|
|
23516
|
-
//# sourceMappingURL=options-
|
|
23510
|
+
//# sourceMappingURL=options-DD9MApH4.js.map
|