@algorandfoundation/puya-ts 1.2.0-beta.34 → 1.2.0-beta.36
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-DjrWRS0-.js → analyser-service-C1sYEdlC.js} +3 -3
- package/{analyser-service-DjrWRS0-.js.map → analyser-service-C1sYEdlC.js.map} +1 -1
- package/analyserService.mjs +3 -3
- package/{arc4-clientgen-CZtNN1eT.js → arc4-clientgen-BBdFxRUs.js} +2 -2
- package/{arc4-clientgen-CZtNN1eT.js.map → arc4-clientgen-BBdFxRUs.js.map} +1 -1
- package/awst/wtypes.d.ts +2 -5
- package/awst_build/ast-visitors/base-visitor.d.ts +0 -1
- package/awst_build/ast-visitors/contract-method-visitor.d.ts +3 -3
- package/awst_build/context/awst-build-context.d.ts +1 -1
- package/awst_build/eb/index.d.ts +0 -1
- package/awst_build/ptypes/arc4-types.d.ts +1 -1
- package/awst_build/ptypes/index.d.ts +65 -90
- package/awst_build/type-resolver.d.ts +1 -1
- package/bin/puyats-clientgen.mjs +5 -5
- package/bin/puyats-ls.mjs +6 -6
- package/bin/run-cli.mjs +8 -8
- package/{check-node-version-BYGc-qxw.js → check-node-version-jdAtH-rx.js} +3 -3
- package/{check-node-version-BYGc-qxw.js.map → check-node-version-jdAtH-rx.js.map} +1 -1
- package/cli.mjs +8 -8
- package/{compile-BKk4hPli.js → compile-DbGGbErI.js} +6 -6
- package/{compile-BKk4hPli.js.map → compile-DbGGbErI.js.map} +1 -1
- package/{contract-class-model-Dpn9A-pJ.js → contract-class-model-CkfUf4wT.js} +112 -181
- package/contract-class-model-CkfUf4wT.js.map +1 -0
- package/index.mjs +8 -8
- package/{options-BCW57sPn.js → options-BMqysQHP.js} +106 -130
- package/options-BMqysQHP.js.map +1 -0
- package/package.json +2 -2
- package/{resolve-puya-path-CdZID0Yd.js → resolve-puya-path-C4sw8aVH.js} +4 -4
- package/{resolve-puya-path-CdZID0Yd.js.map → resolve-puya-path-C4sw8aVH.js.map} +1 -1
- package/{semver-a7hIj_hk.js → semver-BcvZGdLN.js} +2 -2
- package/{semver-a7hIj_hk.js.map → semver-BcvZGdLN.js.map} +1 -1
- package/{util-nZLj7LWS.js → util-DgN3iON1.js} +2 -2
- package/{util-nZLj7LWS.js.map → util-DgN3iON1.js.map} +1 -1
- package/contract-class-model-Dpn9A-pJ.js.map +0 -1
- package/options-BCW57sPn.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 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-CkfUf4wT.js';
|
|
2
|
+
export { A as AbsolutePath, L as LogLevel, cg as LogSource, a as LoggingContext, ch as SourceLocation } from './contract-class-model-CkfUf4wT.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-BMqysQHP.js';
|
|
4
|
+
export { V as CompileOptions, W as TypeResolver, X as processInputPaths, Y as registerPTypes, Z as typeRegistry } from './options-BMqysQHP.js';
|
|
5
|
+
export { c as compile } from './compile-DbGGbErI.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-BBdFxRUs.js';
|
|
26
26
|
import '@algorandfoundation/algokit-utils/abi';
|
|
27
27
|
import 'fs';
|
|
28
28
|
import 'fs/promises';
|
|
29
|
-
import './semver-
|
|
29
|
+
import './semver-BcvZGdLN.js';
|
|
30
30
|
import 'node:url';
|
|
31
|
-
import './resolve-puya-path-
|
|
31
|
+
import './resolve-puya-path-C4sw8aVH.js';
|
|
32
32
|
import 'signal-exit';
|
|
33
33
|
import 'tar';
|
|
34
34
|
import 'node:zlib';
|
|
@@ -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
|
|
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-CkfUf4wT.js';
|
|
2
2
|
import * as fs from 'node:fs';
|
|
3
3
|
import 'node:util';
|
|
4
4
|
import pathe__default, { normalize } from 'pathe';
|
|
@@ -1239,9 +1239,6 @@ class ClassBuilder extends NodeBuilder {
|
|
|
1239
1239
|
}
|
|
1240
1240
|
class FunctionBuilder extends NodeBuilder {
|
|
1241
1241
|
ptype = undefined;
|
|
1242
|
-
constructor(location) {
|
|
1243
|
-
super(location);
|
|
1244
|
-
}
|
|
1245
1242
|
}
|
|
1246
1243
|
class InstanceExpressionBuilder extends InstanceBuilder {
|
|
1247
1244
|
_expr;
|
|
@@ -1285,16 +1282,16 @@ function isReferableExpression(expr) {
|
|
|
1285
1282
|
}
|
|
1286
1283
|
return false;
|
|
1287
1284
|
}
|
|
1285
|
+
const lValueNodes = [
|
|
1286
|
+
VarExpression,
|
|
1287
|
+
FieldExpression,
|
|
1288
|
+
IndexExpression,
|
|
1289
|
+
TupleExpression,
|
|
1290
|
+
AppStateExpression,
|
|
1291
|
+
AppAccountStateExpression,
|
|
1292
|
+
BoxValueExpression,
|
|
1293
|
+
];
|
|
1288
1294
|
function requireLValue(expr) {
|
|
1289
|
-
const lValueNodes = [
|
|
1290
|
-
VarExpression,
|
|
1291
|
-
FieldExpression,
|
|
1292
|
-
IndexExpression,
|
|
1293
|
-
TupleExpression,
|
|
1294
|
-
AppStateExpression,
|
|
1295
|
-
AppAccountStateExpression,
|
|
1296
|
-
BoxValueExpression,
|
|
1297
|
-
];
|
|
1298
1295
|
if (expr instanceof TupleItemExpression) {
|
|
1299
1296
|
if (expr.base.wtype.immutable) {
|
|
1300
1297
|
throw new CodeError('Expression is not a valid assignment target - object is immutable', { sourceLocation: expr.sourceLocation });
|
|
@@ -1317,9 +1314,6 @@ function requireLValue(expr) {
|
|
|
1317
1314
|
});
|
|
1318
1315
|
}
|
|
1319
1316
|
}
|
|
1320
|
-
if (expr instanceof ReinterpretCast) {
|
|
1321
|
-
requireLValue(expr.expr);
|
|
1322
|
-
}
|
|
1323
1317
|
if (expr instanceof TupleExpression) {
|
|
1324
1318
|
for (const item of expr.items) {
|
|
1325
1319
|
requireLValue(item);
|
|
@@ -2410,13 +2404,12 @@ let TypeResolver = (() => {
|
|
|
2410
2404
|
}
|
|
2411
2405
|
getUnaliasedSymbolForNode(node) {
|
|
2412
2406
|
const symbol = this.checker.getSymbolAtLocation(node);
|
|
2413
|
-
if (symbol)
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
-
|
|
2417
|
-
return symbol;
|
|
2407
|
+
if (!symbol)
|
|
2408
|
+
return undefined;
|
|
2409
|
+
if (hasFlags(symbol.flags, ts.SymbolFlags.Alias)) {
|
|
2410
|
+
return this.checker.getAliasedSymbol(symbol);
|
|
2418
2411
|
}
|
|
2419
|
-
return
|
|
2412
|
+
return symbol;
|
|
2420
2413
|
}
|
|
2421
2414
|
resolveTypeParameters(node, sourceLocation) {
|
|
2422
2415
|
if (node.typeArguments) {
|
|
@@ -2431,7 +2424,7 @@ let TypeResolver = (() => {
|
|
|
2431
2424
|
resolve(node, sourceLocation) {
|
|
2432
2425
|
const symbol = this.getUnaliasedSymbolForNode(node);
|
|
2433
2426
|
if (symbol !== undefined && symbol.declarations?.length) {
|
|
2434
|
-
const symbolName =
|
|
2427
|
+
const symbolName = this.getSymbolFullName(symbol);
|
|
2435
2428
|
invariant(symbolName, 'Symbol should have name as we pre-checked it has a declaration', sourceLocation);
|
|
2436
2429
|
if (symbolName.name === '*') {
|
|
2437
2430
|
return new NamespacePType(symbolName);
|
|
@@ -2461,7 +2454,7 @@ let TypeResolver = (() => {
|
|
|
2461
2454
|
if (ts.isConstructorDeclaration(node)) {
|
|
2462
2455
|
const signature = this.checker.getSignatureFromDeclaration(node);
|
|
2463
2456
|
invariant(signature, 'Constructor node must have call signature', sourceLocation);
|
|
2464
|
-
const parentType = this.getTypeName(this.checker.getTypeAtLocation(node.parent)
|
|
2457
|
+
const parentType = this.getTypeName(this.checker.getTypeAtLocation(node.parent));
|
|
2465
2458
|
invariant(parentType, 'Parent type must have name', sourceLocation);
|
|
2466
2459
|
return this.reflectFunctionType(new SymbolName({
|
|
2467
2460
|
name: Constants.symbolNames.constructorMethodName,
|
|
@@ -2475,7 +2468,7 @@ let TypeResolver = (() => {
|
|
|
2475
2468
|
return this.resolveType(type, sourceLocation);
|
|
2476
2469
|
}
|
|
2477
2470
|
resolveType(tsType, sourceLocation) {
|
|
2478
|
-
const typeName = this.getTypeName(tsType
|
|
2471
|
+
const typeName = this.getTypeName(tsType);
|
|
2479
2472
|
if (isUnionType(tsType)) {
|
|
2480
2473
|
const ut = UnionPType.fromTypes(tsType.types.map((t) => this.resolveType(t, sourceLocation)));
|
|
2481
2474
|
if (ut instanceof UnionPType) {
|
|
@@ -2674,7 +2667,7 @@ let TypeResolver = (() => {
|
|
|
2674
2667
|
}
|
|
2675
2668
|
}
|
|
2676
2669
|
reflectObjectType(tsType, sourceLocation) {
|
|
2677
|
-
const typeAlias = tsType.aliasSymbol ? this.getSymbolFullName(tsType.aliasSymbol
|
|
2670
|
+
const typeAlias = tsType.aliasSymbol ? this.getSymbolFullName(tsType.aliasSymbol) : undefined;
|
|
2678
2671
|
const properties = [];
|
|
2679
2672
|
let expectReadonly = undefined;
|
|
2680
2673
|
for (const prop of tsType.getProperties()) {
|
|
@@ -2739,7 +2732,7 @@ let TypeResolver = (() => {
|
|
|
2739
2732
|
const declaredInNode = sig.declaration?.parent;
|
|
2740
2733
|
if (declaredInNode && ts.isClassDeclaration(declaredInNode)) {
|
|
2741
2734
|
const declaredInType = this.checker.getTypeAtLocation(declaredInNode);
|
|
2742
|
-
declaredIn = this.getTypeName(declaredInType
|
|
2735
|
+
declaredIn = this.getTypeName(declaredInType);
|
|
2743
2736
|
}
|
|
2744
2737
|
const returnType = this.resolveType(sig.getReturnType(), sourceLocation);
|
|
2745
2738
|
const parameters = sig.getParameters().map((p) => {
|
|
@@ -2817,9 +2810,9 @@ let TypeResolver = (() => {
|
|
|
2817
2810
|
sourceLocation,
|
|
2818
2811
|
});
|
|
2819
2812
|
}
|
|
2820
|
-
getTypeName(type
|
|
2821
|
-
const typeName = type.symbol ? this.getSymbolFullName(type.symbol
|
|
2822
|
-
const aliasName = type.aliasSymbol ? this.getSymbolFullName(type.aliasSymbol
|
|
2813
|
+
getTypeName(type) {
|
|
2814
|
+
const typeName = type.symbol ? this.getSymbolFullName(type.symbol) : undefined;
|
|
2815
|
+
const aliasName = type.aliasSymbol ? this.getSymbolFullName(type.aliasSymbol) : undefined;
|
|
2823
2816
|
// If the alias was defined in algo-ts, polytype, or typescript, respect the alias
|
|
2824
2817
|
if (aliasName?.module.startsWith(Constants.algoTsPackage) ||
|
|
2825
2818
|
aliasName?.module === Constants.moduleNames.polytype ||
|
|
@@ -2833,7 +2826,7 @@ let TypeResolver = (() => {
|
|
|
2833
2826
|
if (parentDeclaration && ts.isTypeAliasDeclaration(parentDeclaration)) {
|
|
2834
2827
|
const name = this.getUnaliasedSymbolForNode(parentDeclaration.name);
|
|
2835
2828
|
if (name) {
|
|
2836
|
-
return this.getSymbolFullName(name
|
|
2829
|
+
return this.getSymbolFullName(name);
|
|
2837
2830
|
}
|
|
2838
2831
|
}
|
|
2839
2832
|
}
|
|
@@ -2848,7 +2841,7 @@ let TypeResolver = (() => {
|
|
|
2848
2841
|
const dec = symbol.getDeclarations()?.[0];
|
|
2849
2842
|
return dec?.localSymbol?.name;
|
|
2850
2843
|
}
|
|
2851
|
-
getSymbolFullName(symbol
|
|
2844
|
+
getSymbolFullName(symbol) {
|
|
2852
2845
|
const symbolName = symbol.name === 'default' ? (this.tryGetLocalSymbolName(symbol) ?? symbol.name) : symbol.name;
|
|
2853
2846
|
const declaration = symbol?.declarations?.[0];
|
|
2854
2847
|
if (declaration) {
|
|
@@ -3137,6 +3130,7 @@ class AwstBuildContextImpl extends AwstBuildContext {
|
|
|
3137
3130
|
typeResolver;
|
|
3138
3131
|
typeChecker;
|
|
3139
3132
|
#compilationSet;
|
|
3133
|
+
programRoot;
|
|
3140
3134
|
constructor(program, options, constants, nameResolver, storageDeclarations, arc4MethodConfig, contractTypes, compilationSet) {
|
|
3141
3135
|
super();
|
|
3142
3136
|
this.program = program;
|
|
@@ -3146,8 +3140,9 @@ class AwstBuildContextImpl extends AwstBuildContext {
|
|
|
3146
3140
|
this.storageDeclarations = storageDeclarations;
|
|
3147
3141
|
this.arc4MethodConfig = arc4MethodConfig;
|
|
3148
3142
|
this.contractTypes = contractTypes;
|
|
3143
|
+
this.programRoot = AbsolutePath.resolve({ path: this.program.getCurrentDirectory() });
|
|
3149
3144
|
this.typeChecker = program.getTypeChecker();
|
|
3150
|
-
this.typeResolver = new TypeResolver(this.typeChecker,
|
|
3145
|
+
this.typeResolver = new TypeResolver(this.typeChecker, this.programRoot);
|
|
3151
3146
|
this.#compilationSet = compilationSet;
|
|
3152
3147
|
}
|
|
3153
3148
|
registerContractType(contractType) {
|
|
@@ -3163,33 +3158,40 @@ class AwstBuildContextImpl extends AwstBuildContext {
|
|
|
3163
3158
|
}
|
|
3164
3159
|
contractConfig.set(memberName, arc4MethodConfig);
|
|
3165
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
|
+
}
|
|
3166
3179
|
getArc4Config(contractType, memberName) {
|
|
3167
|
-
if (memberName) {
|
|
3168
|
-
for (const
|
|
3169
|
-
if (
|
|
3170
|
-
|
|
3171
|
-
const contractMethods = this.arc4MethodConfig.get(ct.fullName);
|
|
3172
|
-
if (!contractMethods)
|
|
3173
|
-
continue;
|
|
3174
|
-
if (contractMethods.has(memberName)) {
|
|
3175
|
-
return contractMethods.get(memberName);
|
|
3176
|
-
}
|
|
3180
|
+
if (memberName !== undefined) {
|
|
3181
|
+
for (const methods of this.iterateMethodNameToConfigMap(contractType)) {
|
|
3182
|
+
if (methods.has(memberName))
|
|
3183
|
+
return methods.get(memberName);
|
|
3177
3184
|
}
|
|
3178
3185
|
return undefined;
|
|
3179
3186
|
}
|
|
3180
|
-
|
|
3181
|
-
|
|
3182
|
-
|
|
3183
|
-
.
|
|
3184
|
-
|
|
3185
|
-
|
|
3186
|
-
const contractMethods = this.arc4MethodConfig.get(ct.fullName);
|
|
3187
|
-
if (!contractMethods)
|
|
3188
|
-
return acc;
|
|
3189
|
-
return new Map([...acc, ...contractMethods]);
|
|
3190
|
-
}, new Map())
|
|
3191
|
-
.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
|
+
}
|
|
3192
3193
|
}
|
|
3194
|
+
return Array.from(result.values());
|
|
3193
3195
|
}
|
|
3194
3196
|
static forProgram(program, options) {
|
|
3195
3197
|
return new AwstBuildContextImpl(program, options, new ConstantStore(program), new UniqueNameResolver(), new DefaultMap(), new DefaultMap(), {}, new CompilationSet());
|
|
@@ -3246,7 +3248,7 @@ class AwstBuildContextImpl extends AwstBuildContext {
|
|
|
3246
3248
|
}), ptype);
|
|
3247
3249
|
}
|
|
3248
3250
|
getSourceLocation(node) {
|
|
3249
|
-
return SourceLocation.fromNode(node,
|
|
3251
|
+
return SourceLocation.fromNode(node, this.programRoot);
|
|
3250
3252
|
}
|
|
3251
3253
|
addStorageDeclaration(declaration) {
|
|
3252
3254
|
const contractDeclarations = this.storageDeclarations.getOrDefault(declaration.definedIn.fullName, () => new Map());
|
|
@@ -3256,23 +3258,16 @@ class AwstBuildContextImpl extends AwstBuildContext {
|
|
|
3256
3258
|
contractDeclarations.set(declaration.memberName, declaration);
|
|
3257
3259
|
}
|
|
3258
3260
|
getStorageDeclaration(contractType, memberName) {
|
|
3259
|
-
const
|
|
3260
|
-
|
|
3261
|
-
|
|
3262
|
-
|
|
3263
|
-
const baseDeclaration = this.getStorageDeclaration(baseType, memberName);
|
|
3264
|
-
if (baseDeclaration)
|
|
3265
|
-
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;
|
|
3266
3265
|
}
|
|
3267
3266
|
return undefined;
|
|
3268
3267
|
}
|
|
3269
3268
|
getStorageDefinitionsForContract(contractType) {
|
|
3270
3269
|
const result = new Map();
|
|
3271
|
-
const
|
|
3272
|
-
for (const ct of [contractType, ...contractType.allBases()]) {
|
|
3273
|
-
if (seenContracts.has(ct.fullName))
|
|
3274
|
-
continue;
|
|
3275
|
-
seenContracts.add(ct.fullName);
|
|
3270
|
+
for (const ct of this.iterateContractHierarchy(contractType)) {
|
|
3276
3271
|
for (const [memberName, declaration] of this.storageDeclarations.get(ct.fullName) ?? []) {
|
|
3277
3272
|
if (result.has(memberName)) {
|
|
3278
3273
|
logger.error(result.get(memberName)?.sourceLocation, `Redefinition of app storage member, original declared in ${declaration.sourceLocation}`);
|
|
@@ -5030,8 +5025,6 @@ class Arc4EncodedBaseExpressionBuilder extends InstanceExpressionBuilder {
|
|
|
5030
5025
|
case 'equals':
|
|
5031
5026
|
return new Arc4EqualsFunctionBuilder(this, sourceLocation);
|
|
5032
5027
|
case 'native':
|
|
5033
|
-
if (this.ptype.nativeType === undefined)
|
|
5034
|
-
break;
|
|
5035
5028
|
return instanceEb(nodeFactory.aRC4Decode({
|
|
5036
5029
|
value: this.resolve(),
|
|
5037
5030
|
sourceLocation,
|
|
@@ -6205,7 +6198,7 @@ class ContractProxyCallFunctionBuilder extends FunctionBuilder {
|
|
|
6205
6198
|
});
|
|
6206
6199
|
const arc4Config = AwstBuildContext.current.getArc4Config(this.proxy.ptype.contractType, this.functionType.name);
|
|
6207
6200
|
codeInvariant(arc4Config instanceof ARC4ABIMethodConfig, `${this.functionType.name} is not an ABI method, or the containing contract has not been visited (possibly due to a circular reference)`, sourceLocation);
|
|
6208
|
-
const methodSelector =
|
|
6201
|
+
const methodSelector = buildArc4MethodConstant(this.functionType, arc4Config, sourceLocation);
|
|
6209
6202
|
return formatApplicationCallResponse({
|
|
6210
6203
|
itxnResult: makeApplicationCall({
|
|
6211
6204
|
applicationProxy: this.proxy,
|
|
@@ -6234,7 +6227,6 @@ function buildApplicationCallTxnFields({ sourceLocation, fields, arc4Config, app
|
|
|
6234
6227
|
}
|
|
6235
6228
|
// Add implicit fields
|
|
6236
6229
|
if (applicationProxy) {
|
|
6237
|
-
// Create a copy of the fields
|
|
6238
6230
|
const implicitFields = getImplicitFields({ applicationProxy: applicationProxy, mappedFields, sourceLocation, methodConfig: arc4Config });
|
|
6239
6231
|
// Only add fields that aren't explicitly provided
|
|
6240
6232
|
for (const [key, expr] of implicitFields) {
|
|
@@ -6261,8 +6253,8 @@ function buildApplicationCallTxnFields({ sourceLocation, fields, arc4Config, app
|
|
|
6261
6253
|
}
|
|
6262
6254
|
// Build itxn and submit
|
|
6263
6255
|
itxnGroup.push(nodeFactory.aBICall({
|
|
6264
|
-
target
|
|
6265
|
-
args
|
|
6256
|
+
target,
|
|
6257
|
+
args,
|
|
6266
6258
|
fields: mappedFields,
|
|
6267
6259
|
sourceLocation,
|
|
6268
6260
|
wtype: new wtypes.WABICallInnerTransactionFields({
|
|
@@ -6325,14 +6317,15 @@ function getImplicitFields({ applicationProxy, methodConfig, mappedFields, sourc
|
|
|
6325
6317
|
}
|
|
6326
6318
|
// Update or possible create
|
|
6327
6319
|
if (oca === OnCompletionAction.UpdateApplication || !hasAppId) {
|
|
6328
|
-
|
|
6329
|
-
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'));
|
|
6330
6323
|
if (!hasAppId) {
|
|
6331
|
-
implicitFields.set(TxnField.GlobalNumUint,
|
|
6332
|
-
implicitFields.set(TxnField.GlobalNumByteSlice,
|
|
6333
|
-
implicitFields.set(TxnField.LocalNumByteSlice,
|
|
6334
|
-
implicitFields.set(TxnField.LocalNumUint,
|
|
6335
|
-
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'));
|
|
6336
6329
|
}
|
|
6337
6330
|
}
|
|
6338
6331
|
return implicitFields;
|
|
@@ -7823,7 +7816,7 @@ class BytesFunctionBuilder extends FunctionBuilder {
|
|
|
7823
7816
|
],
|
|
7824
7817
|
});
|
|
7825
7818
|
const { strategy } = parsedArgs.at(-1);
|
|
7826
|
-
toFixedStrategy =
|
|
7819
|
+
toFixedStrategy = parseToFixedStrategy(strategy);
|
|
7827
7820
|
}
|
|
7828
7821
|
if (!initialValue) {
|
|
7829
7822
|
return empty;
|
|
@@ -7833,13 +7826,9 @@ class BytesFunctionBuilder extends FunctionBuilder {
|
|
|
7833
7826
|
logger.error(initialValue.sourceLocation, initialValue.ptype.expressionMessage);
|
|
7834
7827
|
bytesBuilder = empty;
|
|
7835
7828
|
}
|
|
7836
|
-
else if (initialValue.ptype.equals(uint64PType)
|
|
7837
|
-
|
|
7838
|
-
|
|
7839
|
-
else if (initialValue.ptype.equals(biguintPType)) {
|
|
7840
|
-
bytesBuilder = initialValue.toBytes(sourceLocation);
|
|
7841
|
-
}
|
|
7842
|
-
else if (initialValue.ptype.equals(stringPType)) {
|
|
7829
|
+
else if (initialValue.ptype.equals(uint64PType) ||
|
|
7830
|
+
initialValue.ptype.equals(biguintPType) ||
|
|
7831
|
+
initialValue.ptype.equals(stringPType)) {
|
|
7843
7832
|
bytesBuilder = initialValue.toBytes(sourceLocation);
|
|
7844
7833
|
}
|
|
7845
7834
|
else if (initialValue.ptype.equals(bytesPType)) {
|
|
@@ -7913,7 +7902,7 @@ class FromEncodingBuilder extends FunctionBuilder {
|
|
|
7913
7902
|
callLocation: sourceLocation,
|
|
7914
7903
|
argSpec: (a) => [a.passthrough(), a.obj({ length: a.required(NumericLiteralPType), strategy: a.optional(stringPType) })],
|
|
7915
7904
|
});
|
|
7916
|
-
const toFixedStrategy =
|
|
7905
|
+
const toFixedStrategy = parseToFixedStrategy(strategy);
|
|
7917
7906
|
if (toFixedStrategy !== 'assert-length') {
|
|
7918
7907
|
logger.error(sourceLocation, `Invalid strategy value of '${toFixedStrategy}'. Expected 'assert-length'`);
|
|
7919
7908
|
}
|
|
@@ -8046,7 +8035,7 @@ class ConcatFunctionBuilder extends FunctionBuilder {
|
|
|
8046
8035
|
}), bytesPType);
|
|
8047
8036
|
}
|
|
8048
8037
|
}
|
|
8049
|
-
function bytesToFixed(builder, fixedType, sourceLocation, strategy
|
|
8038
|
+
function bytesToFixed(builder, fixedType, sourceLocation, strategy) {
|
|
8050
8039
|
invariant(fixedType.length !== null, 'Should only be called for bytes with a fixed length', sourceLocation);
|
|
8051
8040
|
const expr = builder.resolve();
|
|
8052
8041
|
if (strategy === 'unsafe-cast') {
|
|
@@ -8094,6 +8083,9 @@ const fixedConversionStrategyMap = {
|
|
|
8094
8083
|
'assert-length': 'assert-length',
|
|
8095
8084
|
'unsafe-cast': 'unsafe-cast',
|
|
8096
8085
|
};
|
|
8086
|
+
function parseToFixedStrategy(strategy) {
|
|
8087
|
+
return strategy === undefined ? 'assert-length' : mapStringConstant(fixedConversionStrategyMap, strategy.resolve());
|
|
8088
|
+
}
|
|
8097
8089
|
class ToFixedLengthFunctionBuilder extends FunctionBuilder {
|
|
8098
8090
|
builder;
|
|
8099
8091
|
constructor(builder) {
|
|
@@ -8115,18 +8107,9 @@ class ToFixedLengthFunctionBuilder extends FunctionBuilder {
|
|
|
8115
8107
|
],
|
|
8116
8108
|
});
|
|
8117
8109
|
const sizeConst = requireIntegerConstant(length);
|
|
8118
|
-
const parsedStrategy =
|
|
8110
|
+
const parsedStrategy = parseToFixedStrategy(strategy);
|
|
8119
8111
|
const ptype = new BytesPType({ length: sizeConst.value });
|
|
8120
|
-
|
|
8121
|
-
return bytesToFixed(this.builder, ptype, sourceLocation);
|
|
8122
|
-
}
|
|
8123
|
-
else {
|
|
8124
|
-
return instanceEb(nodeFactory.reinterpretCast({
|
|
8125
|
-
expr: this.builder.resolve(),
|
|
8126
|
-
wtype: ptype.wtype,
|
|
8127
|
-
sourceLocation,
|
|
8128
|
-
}), ptype);
|
|
8129
|
-
}
|
|
8112
|
+
return bytesToFixed(this.builder, ptype, sourceLocation, parsedStrategy);
|
|
8130
8113
|
}
|
|
8131
8114
|
}
|
|
8132
8115
|
class BytesInvertBuilder extends FunctionBuilder {
|
|
@@ -17595,15 +17578,13 @@ class TextVisitor {
|
|
|
17595
17578
|
}
|
|
17596
17579
|
}
|
|
17597
17580
|
|
|
17581
|
+
const OPTIONAL_CHAINING_MESSAGE = 'The optional chaining (?.) operator is not supported';
|
|
17598
17582
|
class BaseVisitor {
|
|
17599
17583
|
baseAccept = (node) => accept(this, node);
|
|
17600
|
-
textVisitor;
|
|
17584
|
+
textVisitor = new TextVisitor();
|
|
17601
17585
|
get context() {
|
|
17602
17586
|
return AwstBuildContext.current;
|
|
17603
17587
|
}
|
|
17604
|
-
constructor() {
|
|
17605
|
-
this.textVisitor = new TextVisitor();
|
|
17606
|
-
}
|
|
17607
17588
|
logNotSupported(node, message) {
|
|
17608
17589
|
if (!node)
|
|
17609
17590
|
return;
|
|
@@ -17645,7 +17626,7 @@ class BaseVisitor {
|
|
|
17645
17626
|
}
|
|
17646
17627
|
const ptype = this.context.getPTypeForNode(node);
|
|
17647
17628
|
invariant(ptype instanceof NumericLiteralPType, 'ptype should be NumericLiteralPType');
|
|
17648
|
-
return new NumericLiteralExpressionBuilder(literalValue, ptype,
|
|
17629
|
+
return new NumericLiteralExpressionBuilder(literalValue, ptype, sourceLocation);
|
|
17649
17630
|
}
|
|
17650
17631
|
visitIdentifier(node) {
|
|
17651
17632
|
return this.context.getBuilderForNode(node);
|
|
@@ -17732,14 +17713,12 @@ class BaseVisitor {
|
|
|
17732
17713
|
if (isMutableType(spreadExpr.ptype) && !containsMutableType(spreadExpr.ptype)) {
|
|
17733
17714
|
toConcat.push(CloneFunctionBuilder.clone(spreadExpr, this.sourceLocation(element)));
|
|
17734
17715
|
}
|
|
17716
|
+
else if (spreadExpr.checkForUnclonedMutables('being spread into an array literal')) {
|
|
17717
|
+
// Add a clone if one is required so we don't get cascading errors
|
|
17718
|
+
toConcat.push(CloneFunctionBuilder.clone(spreadExpr, this.sourceLocation(element)));
|
|
17719
|
+
}
|
|
17735
17720
|
else {
|
|
17736
|
-
|
|
17737
|
-
// Add a clone if one is required so we don't get cascading errors
|
|
17738
|
-
toConcat.push(CloneFunctionBuilder.clone(spreadExpr, this.sourceLocation(element)));
|
|
17739
|
-
}
|
|
17740
|
-
else {
|
|
17741
|
-
toConcat.push(spreadExpr);
|
|
17742
|
-
}
|
|
17721
|
+
toConcat.push(spreadExpr);
|
|
17743
17722
|
}
|
|
17744
17723
|
}
|
|
17745
17724
|
else {
|
|
@@ -17758,7 +17737,7 @@ class BaseVisitor {
|
|
|
17758
17737
|
return new SpreadExpressionBuilder(base, this.sourceLocation(node));
|
|
17759
17738
|
}
|
|
17760
17739
|
visitPropertyAccessExpression(node) {
|
|
17761
|
-
this.logNotSupported(node.questionDotToken,
|
|
17740
|
+
this.logNotSupported(node.questionDotToken, OPTIONAL_CHAINING_MESSAGE);
|
|
17762
17741
|
const target = this.baseAccept(node.expression);
|
|
17763
17742
|
if (target instanceof NamespaceBuilder) {
|
|
17764
17743
|
codeInvariant(!ts.isPrivateIdentifier(node.name), 'Private identifiers are not supported here', this.sourceLocation(node.name));
|
|
@@ -17768,14 +17747,14 @@ class BaseVisitor {
|
|
|
17768
17747
|
return target.memberAccess(property, this.sourceLocation(node));
|
|
17769
17748
|
}
|
|
17770
17749
|
visitElementAccessExpression(node) {
|
|
17771
|
-
this.logNotSupported(node.questionDotToken,
|
|
17750
|
+
this.logNotSupported(node.questionDotToken, OPTIONAL_CHAINING_MESSAGE);
|
|
17772
17751
|
const sourceLocation = this.sourceLocation(node);
|
|
17773
17752
|
const target = this.baseAccept(node.expression);
|
|
17774
17753
|
const argument = this.baseAccept(node.argumentExpression);
|
|
17775
17754
|
return target.indexAccess(requireInstanceBuilder(argument), sourceLocation);
|
|
17776
17755
|
}
|
|
17777
17756
|
visitCallExpression(node) {
|
|
17778
|
-
this.logNotSupported(node.questionDotToken,
|
|
17757
|
+
this.logNotSupported(node.questionDotToken, OPTIONAL_CHAINING_MESSAGE);
|
|
17779
17758
|
const sourceLocation = this.sourceLocation(node);
|
|
17780
17759
|
const eb = this.baseAccept(node.expression);
|
|
17781
17760
|
const args = node.arguments
|
|
@@ -18111,13 +18090,8 @@ class BaseVisitor {
|
|
|
18111
18090
|
};
|
|
18112
18091
|
}
|
|
18113
18092
|
getNodeDescription(node) {
|
|
18114
|
-
const
|
|
18115
|
-
|
|
18116
|
-
if (ts.isJSDoc(doc)) {
|
|
18117
|
-
return ts.getTextOfJSDocComment(doc.comment) ?? null;
|
|
18118
|
-
}
|
|
18119
|
-
}
|
|
18120
|
-
return null;
|
|
18093
|
+
const jsdoc = ts.getJSDocCommentsAndTags(node).find(ts.isJSDoc);
|
|
18094
|
+
return jsdoc ? (ts.getTextOfJSDocComment(jsdoc.comment) ?? null) : null;
|
|
18121
18095
|
}
|
|
18122
18096
|
getMethodDocumentation(node) {
|
|
18123
18097
|
const docs = Array.from(ts.getJSDocCommentsAndTags(node));
|
|
@@ -18359,7 +18333,7 @@ class FunctionVisitor extends BaseVisitor {
|
|
|
18359
18333
|
case ts.SyntaxKind.ArrayBindingPattern: {
|
|
18360
18334
|
const items = [];
|
|
18361
18335
|
for (const element of bindingName.elements) {
|
|
18362
|
-
const sourceLocation = this.
|
|
18336
|
+
const sourceLocation = this.sourceLocation(element);
|
|
18363
18337
|
if (ts.isOmittedExpression(element)) {
|
|
18364
18338
|
items.push(new OmittedExpressionBuilder(sourceLocation));
|
|
18365
18339
|
}
|
|
@@ -18555,11 +18529,13 @@ class FunctionVisitor extends BaseVisitor {
|
|
|
18555
18529
|
const sourceLocation = this.sourceLocation(node);
|
|
18556
18530
|
const condition = this.evaluateCondition(node.expression);
|
|
18557
18531
|
const ifBranch = nodeFactory.block({ sourceLocation: this.sourceLocation(node.thenStatement) }, this.accept(node.thenStatement));
|
|
18558
|
-
const elseBranch = node.elseStatement
|
|
18532
|
+
const elseBranch = node.elseStatement
|
|
18533
|
+
? nodeFactory.block({ sourceLocation: this.sourceLocation(node.elseStatement) }, this.accept(node.elseStatement))
|
|
18534
|
+
: null;
|
|
18559
18535
|
return nodeFactory.ifElse({
|
|
18560
18536
|
condition,
|
|
18561
18537
|
ifBranch,
|
|
18562
|
-
elseBranch: elseBranch
|
|
18538
|
+
elseBranch: elseBranch,
|
|
18563
18539
|
sourceLocation,
|
|
18564
18540
|
});
|
|
18565
18541
|
}
|
|
@@ -18856,7 +18832,7 @@ class ContractMethodVisitor extends ContractMethodBaseVisitor {
|
|
|
18856
18832
|
])),
|
|
18857
18833
|
});
|
|
18858
18834
|
}
|
|
18859
|
-
else if (
|
|
18835
|
+
else if (this._contractType.isARC4) {
|
|
18860
18836
|
return new ARC4ABIMethodConfig({
|
|
18861
18837
|
allowedCompletionTypes: conventionalDefaults?.allowedCompletionTypes ?? unspecifiedDefaults.allowedCompletionTypes,
|
|
18862
18838
|
create: conventionalDefaults?.create ?? unspecifiedDefaults.create,
|
|
@@ -18922,7 +18898,7 @@ class ContractMethodVisitor extends ContractMethodBaseVisitor {
|
|
|
18922
18898
|
codeInvariant(functionType.returnType.equals(voidPType), 'Bare method return type must be void', sourceLocation);
|
|
18923
18899
|
}
|
|
18924
18900
|
buildDefaultArgument({ methodName, parameterName, config, decoratorLocation, }) {
|
|
18925
|
-
const
|
|
18901
|
+
const paramType = this._contractType.methods[methodName].parameters.find(([p]) => p === parameterName)?.[1];
|
|
18926
18902
|
codeInvariant(paramType, `Default argument specification '${parameterName}' does not match any parameters on the target method`, decoratorLocation);
|
|
18927
18903
|
if (config.type === 'constant') {
|
|
18928
18904
|
return nodeFactory.aBIMethodArgConstantDefault({
|
|
@@ -23531,4 +23507,4 @@ class PuyaOptions {
|
|
|
23531
23507
|
}
|
|
23532
23508
|
|
|
23533
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 };
|
|
23534
|
-
//# sourceMappingURL=options-
|
|
23510
|
+
//# sourceMappingURL=options-BMqysQHP.js.map
|