@algorandfoundation/algorand-typescript-testing 1.0.1 → 1.0.2-beta.2
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/README.md +6 -6
- package/{arc4-CnO9K_rk.js → arc4-DS0Hi_EY.js} +4 -4
- package/{arc4-CnO9K_rk.js.map → arc4-DS0Hi_EY.js.map} +1 -1
- package/{asset-params-BwXtTjOo.js → asset-params-BpG3snO3.js} +15 -2
- package/asset-params-BpG3snO3.js.map +1 -0
- package/index.mjs +4 -4
- package/{inner-transactions-C0Hu7Qy7.js → inner-transactions-DD57S6z9.js} +3 -3
- package/{inner-transactions-C0Hu7Qy7.js.map → inner-transactions-DD57S6z9.js.map} +1 -1
- package/internal/arc4.mjs +4 -4
- package/internal/index.mjs +9 -9
- package/internal/op.mjs +3 -3
- package/{op-D8t8WdBG.js → op-Di9fqT2J.js} +3 -3
- package/{op-D8t8WdBG.js.map → op-Di9fqT2J.js.map} +1 -1
- package/package.json +1 -1
- package/{program-factory-1rqD0Wzy.js → program-factory-C9d-FSGp.js} +16 -4
- package/program-factory-C9d-FSGp.js.map +1 -0
- package/{pure-CDvQPyw_.js → pure-62NpCdjh.js} +2 -2
- package/{pure-CDvQPyw_.js.map → pure-62NpCdjh.js.map} +1 -1
- package/{runtime-helpers-DL8I16en.js → runtime-helpers-BfpGXQyk.js} +3 -3
- package/runtime-helpers-BfpGXQyk.js.map +1 -0
- package/runtime-helpers.mjs +1 -1
- package/test-transformer/jest-transformer.mjs +1 -1
- package/test-transformer/vitest-transformer.mjs +1 -1
- package/asset-params-BwXtTjOo.js.map +0 -1
- package/program-factory-1rqD0Wzy.js.map +0 -1
- package/runtime-helpers-DL8I16en.js.map +0 -1
package/README.md
CHANGED
|
@@ -299,9 +299,9 @@ To dig deeper into the capabilities of `algorand-typescript-testing`, continue w
|
|
|
299
299
|
|
|
300
300
|
#### Contents
|
|
301
301
|
|
|
302
|
-
- [Testing Guide](
|
|
303
|
-
- [Examples](
|
|
304
|
-
- [Coverage](
|
|
305
|
-
- [FAQ](
|
|
306
|
-
- [API Reference](
|
|
307
|
-
- [Algorand TypeScript](
|
|
302
|
+
- [Testing Guide](https://algorandfoundation.github.io/algorand-typescript-testing/documents/Algorand_TypeScript_Testing_Guide.html)
|
|
303
|
+
- [Examples](https://algorandfoundation.github.io/algorand-typescript-testing/documents/Examples.html)
|
|
304
|
+
- [Coverage](https://algorandfoundation.github.io/algorand-typescript-testing/documents/Coverage.html)
|
|
305
|
+
- [FAQ](https://algorandfoundation.github.io/algorand-typescript-testing/documents/FAQ.html)
|
|
306
|
+
- [API Reference](https://algorandfoundation.github.io/algorand-typescript-testing/documents/API_Reference.html)
|
|
307
|
+
- [Algorand TypeScript](https://algorandfoundation.github.io/algorand-typescript-testing/documents/Algorand_TypeScript.html)
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as arc4$1 from '@algorandfoundation/algorand-typescript/arc4';
|
|
2
2
|
import { OnCompleteAction } from '@algorandfoundation/algorand-typescript';
|
|
3
|
-
import { d as getContractByName, g as getContractMethodAbiMetadata, C as Contract, b as abimethod, c as baremethod, r as readonly } from './runtime-helpers-
|
|
3
|
+
import { d as getContractByName, g as getContractMethodAbiMetadata, C as Contract, b as abimethod, c as baremethod, r as readonly } from './runtime-helpers-BfpGXQyk.js';
|
|
4
4
|
import { v as lazyContext, a0 as sizeOf } from './utils-fy0_Fvxl.js';
|
|
5
5
|
import { I as InternalError } from './typescript-helpers-sobuICoc.js';
|
|
6
|
-
import { A as ApplicationCallInnerTxnContext, m as methodSelector } from './inner-transactions-
|
|
7
|
-
import { A as Address, B as Bool, c as Byte, d as DynamicArray, D as DynamicBytes, F as FixedArray, R as ReferenceArray, e as StaticArray, f as StaticBytes, S as Str, h as Struct, T as Tuple, i as UFixed, U as Uint, j as convertBytes, k as decodeArc4, l as encodeArc4 } from './asset-params-
|
|
6
|
+
import { A as ApplicationCallInnerTxnContext, m as methodSelector } from './inner-transactions-DD57S6z9.js';
|
|
7
|
+
import { A as Address, B as Bool, c as Byte, d as DynamicArray, D as DynamicBytes, F as FixedArray, R as ReferenceArray, e as StaticArray, f as StaticBytes, S as Str, h as Struct, T as Tuple, i as UFixed, U as Uint, j as convertBytes, k as decodeArc4, l as encodeArc4 } from './asset-params-BpG3snO3.js';
|
|
8
8
|
|
|
9
9
|
function _mergeNamespaces(n, m) {
|
|
10
10
|
m.forEach(function (e) {
|
|
@@ -140,4 +140,4 @@ var arc4 = /*#__PURE__*/_mergeNamespaces({
|
|
|
140
140
|
}, [arc4$1]);
|
|
141
141
|
|
|
142
142
|
export { arc4 as a, abiCall as b, compileArc4 as c, getApplicationCallInnerTxnContext as g };
|
|
143
|
-
//# sourceMappingURL=arc4-
|
|
143
|
+
//# sourceMappingURL=arc4-DS0Hi_EY.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"arc4-CnO9K_rk.js","sources":["../src/impl/c2c.ts","../src/internal/arc4.ts"],"sourcesContent":["import { type CompileContractOptions, type Contract, OnCompleteAction } from '@algorandfoundation/algorand-typescript'\nimport type {\n BareCreateApplicationCallFields,\n ContractProxy,\n TypedApplicationCallFields,\n} from '@algorandfoundation/algorand-typescript/arc4'\nimport { getContractByName, getContractMethodAbiMetadata } from '../abi-metadata'\nimport { lazyContext } from '../context-helpers/internal-context'\nimport { InternalError } from '../errors'\nimport type { ConstructorFor, DeliberateAny, InstanceMethod } from '../typescript-helpers'\nimport type { ApplicationCallInnerTxn } from './inner-transactions'\nimport { ApplicationCallInnerTxnContext } from './inner-transactions'\nimport { methodSelector } from './method-selector'\nimport type { ApplicationData } from './reference'\n\n/** @internal */\nexport function compileArc4<TContract extends Contract>(\n contract: ConstructorFor<TContract>,\n options?: CompileContractOptions,\n): ContractProxy<TContract> {\n let app: ApplicationData | undefined\n const compiledAppEntry = lazyContext.value.getCompiledAppEntry(contract)\n if (compiledAppEntry !== undefined) {\n app = lazyContext.ledger.applicationDataMap.get(compiledAppEntry.value)\n }\n\n if (options?.templateVars) {\n Object.entries(options.templateVars).forEach(([key, value]) => {\n lazyContext.value.setTemplateVar(key, value, options.templateVarsPrefix)\n })\n }\n\n return {\n call: new Proxy({} as unknown as TContract, {\n get: (_target, prop) => {\n return (methodArgs: TypedApplicationCallFields<DeliberateAny[]>) => {\n const selector = methodSelector(prop as string, contract)\n const abiMetadata = getContractMethodAbiMetadata(contract, prop as string)\n const onCompleteActions = abiMetadata?.allowActions?.map((action) => OnCompleteAction[action])\n const itxnContext = ApplicationCallInnerTxnContext.createFromTypedApplicationCallFields(\n {\n ...getCommonApplicationCallFields(app, options),\n onCompletion: onCompleteActions?.[0],\n ...methodArgs,\n },\n selector,\n abiMetadata?.resourceEncoding,\n )\n invokeAbiCall(itxnContext)\n return {\n itxn: itxnContext,\n returnValue: itxnContext.loggedReturnValue,\n }\n }\n },\n }),\n\n bareCreate: (methodArgs?: BareCreateApplicationCallFields) => {\n const itxnContext = ApplicationCallInnerTxnContext.createFromBareCreateApplicationCallFields({\n ...getCommonApplicationCallFields(app, options),\n ...methodArgs,\n })\n invokeAbiCall(itxnContext)\n return itxnContext\n },\n approvalProgram: app?.application.approvalProgram ?? [lazyContext.any.bytes(10), lazyContext.any.bytes(10)],\n clearStateProgram: app?.application.clearStateProgram ?? [lazyContext.any.bytes(10), lazyContext.any.bytes(10)],\n extraProgramPages: options?.extraProgramPages ?? app?.application.extraProgramPages ?? lazyContext.any.uint64(),\n globalUints: options?.globalUints ?? app?.application.globalNumUint ?? lazyContext.any.uint64(),\n globalBytes: options?.globalBytes ?? app?.application.globalNumBytes ?? lazyContext.any.uint64(),\n localUints: options?.localUints ?? app?.application.localNumUint ?? lazyContext.any.uint64(),\n localBytes: options?.localBytes ?? app?.application.localNumBytes ?? lazyContext.any.uint64(),\n } as unknown as ContractProxy<TContract>\n}\n\n/** @internal */\nexport const invokeAbiCall = (itxnContext: ApplicationCallInnerTxnContext) => {\n lazyContext.value.notifyApplicationSpies(itxnContext)\n lazyContext.txn.activeGroup.addInnerTransactionGroup(...(itxnContext.itxns ?? []), itxnContext)\n}\nconst getCommonApplicationCallFields = (app: ApplicationData | undefined, options: CompileContractOptions | undefined) => ({\n approvalProgram: app?.application.approvalProgram ?? [lazyContext.any.bytes(10), lazyContext.any.bytes(10)],\n clearStateProgram: app?.application.clearStateProgram ?? [lazyContext.any.bytes(10), lazyContext.any.bytes(10)],\n extraProgramPages: options?.extraProgramPages ?? app?.application.extraProgramPages ?? lazyContext.any.uint64(),\n globalNumUint: options?.globalUints ?? app?.application.globalNumUint ?? lazyContext.any.uint64(),\n globalNumBytes: options?.globalBytes ?? app?.application.globalNumBytes ?? lazyContext.any.uint64(),\n localNumUint: options?.localUints ?? app?.application.localNumUint ?? lazyContext.any.uint64(),\n localNumBytes: options?.localBytes ?? app?.application.localNumBytes ?? lazyContext.any.uint64(),\n})\n\n/** @internal */\nexport function getApplicationCallInnerTxnContext<TArgs extends DeliberateAny[], TReturn = void>(\n method: InstanceMethod<Contract, TArgs, TReturn>,\n methodArgs: TypedApplicationCallFields<TArgs>,\n contract?: Contract | { new (): Contract },\n) {\n const abiMetadata = contract ? getContractMethodAbiMetadata(contract, method.name) : undefined\n const selector = methodSelector(method, contract)\n return ApplicationCallInnerTxnContext.createFromTypedApplicationCallFields<TReturn>(\n {\n ...methodArgs,\n onCompletion: methodArgs.onCompletion ?? abiMetadata?.allowActions?.map((action) => OnCompleteAction[action])[0],\n },\n selector,\n abiMetadata?.resourceEncoding,\n )\n}\n/** @internal */\nexport function abiCall<TArgs extends DeliberateAny[], TReturn>(\n contractFullName: string,\n method: string,\n methodArgs: TypedApplicationCallFields<TArgs>,\n): { itxn: ApplicationCallInnerTxn; returnValue: TReturn | undefined } {\n const contract = getContractByName(contractFullName)\n if (contract === undefined || typeof contract !== 'function') throw new InternalError(`Unknown contract: ${contractFullName}`)\n if (!Object.hasOwn(contract.prototype, method)) throw new InternalError(`Unknown method: ${method} in contract: ${contractFullName}`)\n\n const itxnContext = getApplicationCallInnerTxnContext<TArgs, TReturn>(contract.prototype[method], methodArgs, contract)\n\n invokeAbiCall(itxnContext)\n\n return {\n itxn: itxnContext,\n returnValue: itxnContext.loggedReturnValue,\n }\n}\n","/** @internal */\nexport * from '@algorandfoundation/algorand-typescript/arc4'\n/** @internal */\nexport { abiCall, compileArc4 } from '../impl/c2c'\n/** @internal */\nexport { abimethod, baremethod, Contract, readonly } from '../impl/contract'\n/** @internal */\nexport {\n Address,\n Bool,\n Byte,\n convertBytes,\n decodeArc4,\n DynamicArray,\n DynamicBytes,\n encodeArc4,\n FixedArray,\n ReferenceArray,\n sizeOf,\n StaticArray,\n StaticBytes,\n Str,\n Struct,\n Tuple,\n UFixed,\n Uint,\n} from '../impl/encoded-types'\n/** @internal */\nexport { methodSelector } from '../impl/method-selector'\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAeA;AACM,SAAU,WAAW,CACzB,QAAmC,EACnC,OAAgC,EAAA;AAEhC,IAAA,IAAI,GAAgC;IACpC,MAAM,gBAAgB,GAAG,WAAW,CAAC,KAAK,CAAC,mBAAmB,CAAC,QAAQ,CAAC;AACxE,IAAA,IAAI,gBAAgB,KAAK,SAAS,EAAE;AAClC,QAAA,GAAG,GAAG,WAAW,CAAC,MAAM,CAAC,kBAAkB,CAAC,GAAG,CAAC,gBAAgB,CAAC,KAAK,CAAC;IACzE;AAEA,IAAA,IAAI,OAAO,EAAE,YAAY,EAAE;AACzB,QAAA,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,KAAI;AAC5D,YAAA,WAAW,CAAC,KAAK,CAAC,cAAc,CAAC,GAAG,EAAE,KAAK,EAAE,OAAO,CAAC,kBAAkB,CAAC;AAC1E,QAAA,CAAC,CAAC;IACJ;IAEA,OAAO;AACL,QAAA,IAAI,EAAE,IAAI,KAAK,CAAC,EAA0B,EAAE;AAC1C,YAAA,GAA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C,CAAC;AACjH,KAAA,EACD,QAAQ,EACR,WAAW,EAAE,gBAAgB,CAC9B;AACH;AACA;SACgB,OAAO,CACrB,gBAAwB,EACxB,MAAc,EACd,UAA6C,EAAA;AAE7C,IAAA,MAAM,QAAQ,GAAG,iBAAiB,CAAC,gBAAgB,CAAC;AACpD,IAAA,IAAI,QAAQ,KAAK,SAAS,IAAI,OAAO,QAAQ,KAAK,UAAU;AAAE,QAAA,MAAM,IAAI,aAAa,CAAC,qBAAqB,gBAAgB,CAAA,CAAE,CAAC;IAC9H,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;QAAE,MAAM,IAAI,aAAa,CAAC,CAAA,gBAAA,EAAmB,MAAM,CAAA,cAAA,EAAiB,gBAAgB,CAAA,CAAE,CAAC;AAErI,IAAA,MAAM,WAAW,GAAG,iCAAiC,CAAiB,QAAQ,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,UAAU,EAAE,QAAQ,CAAC;IAEvH,aAAa,CAAC,WAAW,CAAC;IAE1B,OAAO;AACL,QAAA,IAAI,EAAE,WAAW;QACjB,WAAW,EAAE,WAAW,CAAC,iBAAiB;KAC3C;AACH;;AC7HA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"arc4-DS0Hi_EY.js","sources":["../src/impl/c2c.ts","../src/internal/arc4.ts"],"sourcesContent":["import { type CompileContractOptions, type Contract, OnCompleteAction } from '@algorandfoundation/algorand-typescript'\nimport type {\n BareCreateApplicationCallFields,\n ContractProxy,\n TypedApplicationCallFields,\n} from '@algorandfoundation/algorand-typescript/arc4'\nimport { getContractByName, getContractMethodAbiMetadata } from '../abi-metadata'\nimport { lazyContext } from '../context-helpers/internal-context'\nimport { InternalError } from '../errors'\nimport type { ConstructorFor, DeliberateAny, InstanceMethod } from '../typescript-helpers'\nimport type { ApplicationCallInnerTxn } from './inner-transactions'\nimport { ApplicationCallInnerTxnContext } from './inner-transactions'\nimport { methodSelector } from './method-selector'\nimport type { ApplicationData } from './reference'\n\n/** @internal */\nexport function compileArc4<TContract extends Contract>(\n contract: ConstructorFor<TContract>,\n options?: CompileContractOptions,\n): ContractProxy<TContract> {\n let app: ApplicationData | undefined\n const compiledAppEntry = lazyContext.value.getCompiledAppEntry(contract)\n if (compiledAppEntry !== undefined) {\n app = lazyContext.ledger.applicationDataMap.get(compiledAppEntry.value)\n }\n\n if (options?.templateVars) {\n Object.entries(options.templateVars).forEach(([key, value]) => {\n lazyContext.value.setTemplateVar(key, value, options.templateVarsPrefix)\n })\n }\n\n return {\n call: new Proxy({} as unknown as TContract, {\n get: (_target, prop) => {\n return (methodArgs: TypedApplicationCallFields<DeliberateAny[]>) => {\n const selector = methodSelector(prop as string, contract)\n const abiMetadata = getContractMethodAbiMetadata(contract, prop as string)\n const onCompleteActions = abiMetadata?.allowActions?.map((action) => OnCompleteAction[action])\n const itxnContext = ApplicationCallInnerTxnContext.createFromTypedApplicationCallFields(\n {\n ...getCommonApplicationCallFields(app, options),\n onCompletion: onCompleteActions?.[0],\n ...methodArgs,\n },\n selector,\n abiMetadata?.resourceEncoding,\n )\n invokeAbiCall(itxnContext)\n return {\n itxn: itxnContext,\n returnValue: itxnContext.loggedReturnValue,\n }\n }\n },\n }),\n\n bareCreate: (methodArgs?: BareCreateApplicationCallFields) => {\n const itxnContext = ApplicationCallInnerTxnContext.createFromBareCreateApplicationCallFields({\n ...getCommonApplicationCallFields(app, options),\n ...methodArgs,\n })\n invokeAbiCall(itxnContext)\n return itxnContext\n },\n approvalProgram: app?.application.approvalProgram ?? [lazyContext.any.bytes(10), lazyContext.any.bytes(10)],\n clearStateProgram: app?.application.clearStateProgram ?? [lazyContext.any.bytes(10), lazyContext.any.bytes(10)],\n extraProgramPages: options?.extraProgramPages ?? app?.application.extraProgramPages ?? lazyContext.any.uint64(),\n globalUints: options?.globalUints ?? app?.application.globalNumUint ?? lazyContext.any.uint64(),\n globalBytes: options?.globalBytes ?? app?.application.globalNumBytes ?? lazyContext.any.uint64(),\n localUints: options?.localUints ?? app?.application.localNumUint ?? lazyContext.any.uint64(),\n localBytes: options?.localBytes ?? app?.application.localNumBytes ?? lazyContext.any.uint64(),\n } as unknown as ContractProxy<TContract>\n}\n\n/** @internal */\nexport const invokeAbiCall = (itxnContext: ApplicationCallInnerTxnContext) => {\n lazyContext.value.notifyApplicationSpies(itxnContext)\n lazyContext.txn.activeGroup.addInnerTransactionGroup(...(itxnContext.itxns ?? []), itxnContext)\n}\nconst getCommonApplicationCallFields = (app: ApplicationData | undefined, options: CompileContractOptions | undefined) => ({\n approvalProgram: app?.application.approvalProgram ?? [lazyContext.any.bytes(10), lazyContext.any.bytes(10)],\n clearStateProgram: app?.application.clearStateProgram ?? [lazyContext.any.bytes(10), lazyContext.any.bytes(10)],\n extraProgramPages: options?.extraProgramPages ?? app?.application.extraProgramPages ?? lazyContext.any.uint64(),\n globalNumUint: options?.globalUints ?? app?.application.globalNumUint ?? lazyContext.any.uint64(),\n globalNumBytes: options?.globalBytes ?? app?.application.globalNumBytes ?? lazyContext.any.uint64(),\n localNumUint: options?.localUints ?? app?.application.localNumUint ?? lazyContext.any.uint64(),\n localNumBytes: options?.localBytes ?? app?.application.localNumBytes ?? lazyContext.any.uint64(),\n})\n\n/** @internal */\nexport function getApplicationCallInnerTxnContext<TArgs extends DeliberateAny[], TReturn = void>(\n method: InstanceMethod<Contract, TArgs, TReturn>,\n methodArgs: TypedApplicationCallFields<TArgs>,\n contract?: Contract | { new (): Contract },\n) {\n const abiMetadata = contract ? getContractMethodAbiMetadata(contract, method.name) : undefined\n const selector = methodSelector(method, contract)\n return ApplicationCallInnerTxnContext.createFromTypedApplicationCallFields<TReturn>(\n {\n ...methodArgs,\n onCompletion: methodArgs.onCompletion ?? abiMetadata?.allowActions?.map((action) => OnCompleteAction[action])[0],\n },\n selector,\n abiMetadata?.resourceEncoding,\n )\n}\n/** @internal */\nexport function abiCall<TArgs extends DeliberateAny[], TReturn>(\n contractFullName: string,\n method: string,\n methodArgs: TypedApplicationCallFields<TArgs>,\n): { itxn: ApplicationCallInnerTxn; returnValue: TReturn | undefined } {\n const contract = getContractByName(contractFullName)\n if (contract === undefined || typeof contract !== 'function') throw new InternalError(`Unknown contract: ${contractFullName}`)\n if (!Object.hasOwn(contract.prototype, method)) throw new InternalError(`Unknown method: ${method} in contract: ${contractFullName}`)\n\n const itxnContext = getApplicationCallInnerTxnContext<TArgs, TReturn>(contract.prototype[method], methodArgs, contract)\n\n invokeAbiCall(itxnContext)\n\n return {\n itxn: itxnContext,\n returnValue: itxnContext.loggedReturnValue,\n }\n}\n","/** @internal */\nexport * from '@algorandfoundation/algorand-typescript/arc4'\n/** @internal */\nexport { abiCall, compileArc4 } from '../impl/c2c'\n/** @internal */\nexport { abimethod, baremethod, Contract, readonly } from '../impl/contract'\n/** @internal */\nexport {\n Address,\n Bool,\n Byte,\n convertBytes,\n decodeArc4,\n DynamicArray,\n DynamicBytes,\n encodeArc4,\n FixedArray,\n ReferenceArray,\n sizeOf,\n StaticArray,\n StaticBytes,\n Str,\n Struct,\n Tuple,\n UFixed,\n Uint,\n} from '../impl/encoded-types'\n/** @internal */\nexport { methodSelector } from '../impl/method-selector'\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAeA;AACM,SAAU,WAAW,CACzB,QAAmC,EACnC,OAAgC,EAAA;AAEhC,IAAA,IAAI,GAAgC;IACpC,MAAM,gBAAgB,GAAG,WAAW,CAAC,KAAK,CAAC,mBAAmB,CAAC,QAAQ,CAAC;AACxE,IAAA,IAAI,gBAAgB,KAAK,SAAS,EAAE;AAClC,QAAA,GAAG,GAAG,WAAW,CAAC,MAAM,CAAC,kBAAkB,CAAC,GAAG,CAAC,gBAAgB,CAAC,KAAK,CAAC;IACzE;AAEA,IAAA,IAAI,OAAO,EAAE,YAAY,EAAE;AACzB,QAAA,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,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AS;IAC9F,MAAM,QAAQ,GAAG,cAAc,CAAC,MAAM,EAAE,QAAQ,CAAC;IACjD,OAAO,8BAA8B,CAAC,oCAAoC,CACxE;AACE,QAAA,GAAG,UAAU;QACb,YAAY,EAAE,UAAU,CAAC,YAAY,IAAI,WAAW,EAAE,YAAY,EAAE,GAAG,CAAC,CAAC,MAAM,KAAK,gBAAgB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;AACjH,KAAA,EACD,QAAQ,EACR,WAAW,EAAE,gBAAgB,CAC9B;AACH;AACA;SACgB,OAAO,CACrB,gBAAwB,EACxB,MAAc,EACd,UAA6C,EAAA;AAE7C,IAAA,MAAM,QAAQ,GAAG,iBAAiB,CAAC,gBAAgB,CAAC;AACpD,IAAA,IAAI,QAAQ,KAAK,SAAS,IAAI,OAAO,QAAQ,KAAK,UAAU;AAAE,QAAA,MAAM,IAAI,aAAa,CAAC,qBAAqB,gBAAgB,CAAA,CAAE,CAAC;IAC9H,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;QAAE,MAAM,IAAI,aAAa,CAAC,CAAA,gBAAA,EAAmB,MAAM,CAAA,cAAA,EAAiB,gBAAgB,CAAA,CAAE,CAAC;AAErI,IAAA,MAAM,WAAW,GAAG,iCAAiC,CAAiB,QAAQ,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,UAAU,EAAE,QAAQ,CAAC;IAEvH,aAAa,CAAC,WAAW,CAAC;IAE1B,OAAO;AACL,QAAA,IAAI,EAAE,WAAW;QACjB,WAAW,EAAE,WAAW,CAAC,iBAAiB;KAC3C;AACH;;AC7HA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1064,7 +1064,20 @@ const getArc4Encoded = (value, sourceTypeInfoString) => {
|
|
|
1064
1064
|
name: `Struct<${value.constructor.name}>`,
|
|
1065
1065
|
genericArgs: Object.fromEntries(Object.keys(value).map((x, i) => [x, genericArgs[i]])),
|
|
1066
1066
|
};
|
|
1067
|
-
|
|
1067
|
+
let s = Object.fromEntries(Object.keys(typeInfo.genericArgs).map((x, i) => [x, result[i]]));
|
|
1068
|
+
if (propTypeInfos) {
|
|
1069
|
+
// if source type info is provided, reorder the struct properties to match the expected type schema
|
|
1070
|
+
s = Object.fromEntries(Object.keys(propTypeInfos).map((x) => [x, s[x]]));
|
|
1071
|
+
typeInfo.genericArgs = propTypeInfos;
|
|
1072
|
+
}
|
|
1073
|
+
else {
|
|
1074
|
+
// if not, reorder the struct properties alphabetically
|
|
1075
|
+
typeInfo.genericArgs = Object.fromEntries(Object.keys(typeInfo.genericArgs)
|
|
1076
|
+
.sort()
|
|
1077
|
+
.map((key) => [key, typeInfo.genericArgs[key]]));
|
|
1078
|
+
s = Object.fromEntries(Object.keys(typeInfo.genericArgs).map((key) => [key, s[key]]));
|
|
1079
|
+
}
|
|
1080
|
+
return new Struct(typeInfo, s);
|
|
1068
1081
|
}
|
|
1069
1082
|
throw new CodeError(`Unsupported type for encoding: ${typeof value}`);
|
|
1070
1083
|
};
|
|
@@ -1418,4 +1431,4 @@ const AssetParams = {
|
|
|
1418
1431
|
};
|
|
1419
1432
|
|
|
1420
1433
|
export { Address as A, Bool as B, sha256 as C, DynamicBytes as D, EllipticCurve as E, FixedArray as F, sha3_256 as G, vrfVerify as H, ReferenceArray as R, Str as S, Tuple as T, Uint as U, toBytes as a, getArc4Encoded as b, Byte as c, DynamicArray as d, StaticArray as e, StaticBytes as f, getEncoder as g, Struct as h, UFixed as i, convertBytes as j, decodeArc4 as k, encodeArc4 as l, getApp as m, getAsset as n, AppParams as o, AssetParams as p, ecdsaPkDecompress as q, ecdsaPkRecover as r, sha512_256 as s, toUint8Array as t, ecdsaVerify as u, ed25519verify as v, ed25519verifyBare as w, falconVerify as x, keccak256 as y, mimc as z };
|
|
1421
|
-
//# sourceMappingURL=asset-params-
|
|
1434
|
+
//# sourceMappingURL=asset-params-BpG3snO3.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"asset-params-BpG3snO3.js","sources":["../src/impl/encoded-types/array-proxy.ts","../src/impl/encoded-types/encoded-types.ts","../src/impl/crypto.ts","../src/impl/app-params.ts","../src/impl/asset-params.ts"],"sourcesContent":["import type { Uint64Compat } from '@algorandfoundation/algorand-typescript'\nimport { AvmError } from '../../errors'\nimport { arrayUtil } from '../primitives'\n\n/** @internal */\nexport const arrayProxyHandler = <TItem>() => ({\n get(target: { items: readonly TItem[] }, prop: PropertyKey) {\n const idx = prop ? parseInt(prop.toString(), 10) : NaN\n if (!isNaN(idx)) {\n if (idx >= 0 && idx < target.items.length) return target.items[idx]\n throw new AvmError('Index out of bounds')\n } else if (prop === Symbol.iterator) {\n return target.items[Symbol.iterator].bind(target.items)\n } else if (prop === 'entries') {\n return target.items.entries.bind(target.items)\n } else if (prop === 'keys') {\n return target.items.keys.bind(target.items)\n } else if (prop === 'at') {\n return (index: Uint64Compat): TItem => {\n return arrayUtil.arrayAt(target.items, index)\n }\n }\n return Reflect.get(target, prop)\n },\n set(target: { items: TItem[]; setItem: (index: number, value: TItem) => void }, prop: PropertyKey, value: TItem) {\n const idx = prop ? parseInt(prop.toString(), 10) : NaN\n if (!isNaN(idx)) {\n if (idx >= 0 && idx < target.items.length) {\n target.setItem(idx, value)\n return true\n }\n throw new AvmError('Index out of bounds')\n }\n\n return Reflect.set(target, prop, value)\n },\n})\n","import type { Account as AccountType, bytes, NTuple, StringCompat, uint64, Uint64Compat } from '@algorandfoundation/algorand-typescript'\nimport { FixedArray as _FixedArray, ReferenceArray as _ReferenceArray } from '@algorandfoundation/algorand-typescript'\nimport type { BitSize } from '@algorandfoundation/algorand-typescript/arc4'\nimport {\n Address as _Address,\n ARC4Encoded as _ARC4Encoded,\n Bool as _Bool,\n Byte as _Byte,\n DynamicArray as _DynamicArray,\n DynamicBytes as _DynamicBytes,\n StaticArray as _StaticArray,\n StaticBytes as _StaticBytes,\n Str as _Str,\n Struct as _Struct,\n Tuple as _Tuple,\n UFixed as _UFixed,\n Uint as _Uint,\n} from '@algorandfoundation/algorand-typescript/arc4'\nimport { encodingUtil } from '@algorandfoundation/puya-ts'\nimport assert from 'assert'\nimport {\n ABI_RETURN_VALUE_LOG_PREFIX,\n ALGORAND_ADDRESS_BYTE_LENGTH,\n ALGORAND_CHECKSUM_BYTE_LENGTH,\n MAX_UINT64,\n UINT64_SIZE,\n} from '../../constants'\nimport { AvmError, avmInvariant, CodeError, InternalError } from '../../errors'\nimport { nameOfType, type DeliberateAny } from '../../typescript-helpers'\nimport {\n asBigInt,\n asBigUint,\n asBigUintCls,\n asBytes,\n asBytesCls,\n asMaybeBigUintCls,\n asMaybeBytesCls,\n asMaybeUint64Cls,\n asNumber,\n asUint64,\n asUint64Cls,\n asUint8Array,\n concatUint8Arrays,\n uint8ArrayToNumber,\n} from '../../util'\nimport { BytesBackedCls, Uint64BackedCls } from '../base'\nimport type { StubBytesCompat } from '../primitives'\nimport { BigUintCls, Bytes, BytesCls, getUint8Array, isBytes, Uint64Cls } from '../primitives'\nimport { Account, AccountCls, ApplicationCls, AssetCls } from '../reference'\nimport { arrayProxyHandler } from './array-proxy'\nimport { ABI_LENGTH_SIZE, FALSE_BIGINT_VALUE, IS_INITIALISING_FROM_BYTES_SYMBOL, TRUE_BIGINT_VALUE } from './constants'\nimport {\n areAllARC4Encoded,\n bigUintFromBytes,\n booleanFromBytes,\n bytesFromBytes,\n checkItemTypeName,\n compressMultipleBool,\n encodeLength,\n findBool,\n findBoolTypes,\n getNativeValue,\n holdsDynamicLengthContent,\n maxBigIntValue,\n maxBytesLength,\n onCompletionFromBytes,\n readLength,\n regExpNxM,\n stringFromBytes,\n transactionTypeFromBytes,\n trimTrailingDecimalZeros,\n uint64FromBytes,\n validBitSizes,\n} from './helpers'\nimport type {\n CompatForArc4Int,\n DynamicArrayGenericArgs,\n fromBytes,\n StaticArrayGenericArgs,\n StructConstraint,\n TypeInfo,\n uFixedGenericArgs,\n} from './types'\nimport { getMaxLengthOfStaticContentType } from './utils'\n\ninterface _ARC4Encodedint8Array extends _ARC4Encoded {\n get uint8ArrayValue(): Uint8Array\n}\n/** @internal */\nexport class Uint<N extends BitSize> extends _Uint<N> implements _ARC4Encodedint8Array {\n private _value: Uint8Array\n private bitSize: N\n typeInfo: TypeInfo\n\n constructor(typeInfo: TypeInfo | string, v?: CompatForArc4Int<N>) {\n super()\n this.typeInfo = typeof typeInfo === 'string' ? JSON.parse(typeInfo) : typeInfo\n this.bitSize = Uint.getMaxBitsLength(this.typeInfo) as N\n\n assert(validBitSizes.includes(this.bitSize), `Invalid bit size ${this.bitSize}`)\n\n const bigIntValue = asBigUintCls(v ?? 0n).valueOf()\n const maxValue = maxBigIntValue(this.bitSize)\n assert(bigIntValue <= maxValue, `expected value <= ${maxValue}, got: ${bigIntValue}`)\n\n this._value = encodingUtil.bigIntToUint8Array(bigIntValue, maxBytesLength(this.bitSize))\n }\n\n get native() {\n const bigIntValue = encodingUtil.uint8ArrayToBigInt(this._value)\n return this.bitSize <= UINT64_SIZE ? asUint64(bigIntValue) : asBigUint(bigIntValue)\n }\n\n asUint64() {\n const bigIntValue = encodingUtil.uint8ArrayToBigInt(this._value)\n if (bigIntValue > MAX_UINT64) {\n throw new CodeError('value too large to fit in uint64')\n }\n return asUint64(bigIntValue)\n }\n\n asBigUint() {\n const bigIntValue = encodingUtil.uint8ArrayToBigInt(this._value)\n return asBigUint(bigIntValue)\n }\n\n get uint8ArrayValue(): Uint8Array {\n return this._value\n }\n\n get bytes(): bytes {\n return Bytes(this._value)\n }\n\n equals(other: this): boolean {\n if (!(other instanceof Uint) || JSON.stringify(this.typeInfo) !== JSON.stringify(other.typeInfo)) {\n throw new CodeError(`Expected expression of type ${this.typeInfo.name}, got ${other.typeInfo.name}`)\n }\n return this.bytes.equals(other.bytes)\n }\n\n static fromBytes(value: StubBytesCompat | Uint8Array, typeInfo: string | TypeInfo, prefix: 'none' | 'log' = 'none'): Uint<BitSize> {\n let bytesValue = asBytesCls(value)\n if (prefix === 'log') {\n assert(bytesValue.slice(0, 4).equals(ABI_RETURN_VALUE_LOG_PREFIX), 'ABI return prefix not found')\n bytesValue = bytesValue.slice(4)\n }\n const result = new Uint<BitSize>(typeInfo)\n result._value = asUint8Array(bytesValue)\n return result\n }\n\n static getMaxBitsLength(typeInfo: TypeInfo): BitSize {\n return parseInt((typeInfo.genericArgs as TypeInfo[])![0].name, 10) as BitSize\n }\n}\n\n/** @internal */\nexport class UFixed<N extends BitSize, M extends number> extends _UFixed<N, M> implements _ARC4Encodedint8Array {\n private _value: Uint8Array\n private bitSize: N\n private precision: M\n typeInfo: TypeInfo\n\n constructor(typeInfo: TypeInfo | string, v?: `${number}.${number}`) {\n super(v)\n this.typeInfo = typeof typeInfo === 'string' ? JSON.parse(typeInfo) : typeInfo\n const genericArgs = this.typeInfo.genericArgs as uFixedGenericArgs\n this.bitSize = UFixed.getMaxBitsLength(this.typeInfo) as N\n this.precision = parseInt(genericArgs.m.name, 10) as M\n\n const trimmedValue = trimTrailingDecimalZeros(v ?? '0.0')\n assert(regExpNxM(this.precision).test(trimmedValue), `expected positive decimal literal with max of ${this.precision} decimal places`)\n\n const bigIntValue = BigInt(trimmedValue.replace('.', ''))\n const maxValue = maxBigIntValue(this.bitSize)\n assert(bigIntValue <= maxValue, `expected value <= ${maxValue}, got: ${bigIntValue}`)\n\n this._value = encodingUtil.bigIntToUint8Array(bigIntValue, maxBytesLength(this.bitSize))\n }\n\n get native() {\n const bigIntValue = encodingUtil.uint8ArrayToBigInt(this._value)\n return this.bitSize <= UINT64_SIZE ? asUint64(bigIntValue) : asBigUint(bigIntValue)\n }\n\n get uint8ArrayValue(): Uint8Array {\n return this._value\n }\n\n get bytes(): bytes {\n return Bytes(this._value)\n }\n\n equals(other: this): boolean {\n if (!(other instanceof UFixed) || JSON.stringify(this.typeInfo) !== JSON.stringify(other.typeInfo)) {\n throw new CodeError(`Expected expression of type ${this.typeInfo.name}, got ${other.typeInfo.name}`)\n }\n return this.bytes.equals(other.bytes)\n }\n\n static fromBytes(\n value: StubBytesCompat | Uint8Array,\n typeInfo: string | TypeInfo,\n prefix: 'none' | 'log' = 'none',\n ): _UFixed<BitSize, number> {\n let bytesValue = asBytesCls(value)\n if (prefix === 'log') {\n assert(bytesValue.slice(0, 4).equals(ABI_RETURN_VALUE_LOG_PREFIX), 'ABI return prefix not found')\n bytesValue = bytesValue.slice(4)\n }\n const result = new UFixed<BitSize, number>(typeInfo, '0.0')\n result._value = asUint8Array(bytesValue)\n return result\n }\n\n static getMaxBitsLength(typeInfo: TypeInfo): BitSize {\n const genericArgs = typeInfo.genericArgs as uFixedGenericArgs\n return parseInt(genericArgs.n.name, 10) as BitSize\n }\n}\n\n/** @internal */\nexport class Byte extends _Byte implements _ARC4Encodedint8Array {\n typeInfo: TypeInfo\n private _value: Uint<8>\n\n constructor(typeInfo: TypeInfo | string, v?: CompatForArc4Int<8>) {\n super(v)\n this.typeInfo = typeof typeInfo === 'string' ? JSON.parse(typeInfo) : typeInfo\n this._value = new Uint<8>(typeInfo, v)\n }\n\n asUint64() {\n return this._value.asUint64()\n }\n\n asBigUint() {\n return this._value.asBigUint()\n }\n\n get uint8ArrayValue(): Uint8Array {\n return this._value.uint8ArrayValue\n }\n\n get bytes(): bytes {\n return this._value.bytes\n }\n\n equals(other: this): boolean {\n if (!(other instanceof Byte) || JSON.stringify(this._value.typeInfo) !== JSON.stringify(other._value.typeInfo)) {\n throw new CodeError(`Expected expression of type ${this._value.typeInfo.name}, got ${other._value.typeInfo.name}`)\n }\n return this.bytes.equals(other.bytes)\n }\n\n static fromBytes(value: StubBytesCompat | Uint8Array, typeInfo: string | TypeInfo, prefix: 'none' | 'log' = 'none'): Byte {\n const uintNValue = Uint.fromBytes(value, typeInfo, prefix) as Uint<8>\n const result = new Byte(typeInfo)\n result._value = uintNValue\n return result\n }\n\n static getMaxBitsLength(typeInfo: TypeInfo): BitSize {\n return Uint.getMaxBitsLength(typeInfo)\n }\n}\n\n/** @internal */\nexport class Str extends _Str implements _ARC4Encodedint8Array {\n typeInfo: TypeInfo\n private _value: Uint8Array\n\n constructor(typeInfo: TypeInfo | string, s?: StringCompat) {\n super()\n const bytesValue = asBytesCls(s ?? '')\n const bytesLength = encodeLength(bytesValue.length.asNumber())\n this.typeInfo = typeof typeInfo === 'string' ? JSON.parse(typeInfo) : typeInfo\n this._value = asUint8Array(bytesLength.concat(bytesValue))\n }\n get native(): string {\n return encodingUtil.uint8ArrayToUtf8(this._value.slice(ABI_LENGTH_SIZE))\n }\n\n get uint8ArrayValue(): Uint8Array {\n return this._value\n }\n\n get bytes(): bytes {\n return Bytes(this._value)\n }\n\n equals(other: this): boolean {\n if (!(other instanceof Str)) {\n throw new CodeError(`Expected expression of type Str, got ${(other as object).constructor.name}`)\n }\n return this.bytes.equals(other.bytes)\n }\n\n static fromBytes(value: StubBytesCompat | Uint8Array, typeInfo: string | TypeInfo, prefix: 'none' | 'log' = 'none'): Str {\n let bytesValue = asBytesCls(value)\n if (prefix === 'log') {\n assert(bytesValue.slice(0, 4).equals(ABI_RETURN_VALUE_LOG_PREFIX), 'ABI return prefix not found')\n bytesValue = bytesValue.slice(4)\n }\n const result = new Str(typeInfo)\n result._value = asUint8Array(bytesValue)\n return result\n }\n}\n\n/** @internal */\nexport class Bool extends _Bool implements _ARC4Encodedint8Array {\n private _value: Uint8Array\n typeInfo: TypeInfo\n\n constructor(typeInfo: TypeInfo | string, v?: boolean) {\n super(v)\n this.typeInfo = typeof typeInfo === 'string' ? JSON.parse(typeInfo) : typeInfo\n this._value = encodingUtil.bigIntToUint8Array(v ? TRUE_BIGINT_VALUE : FALSE_BIGINT_VALUE, 1)\n }\n\n get native(): boolean {\n return encodingUtil.uint8ArrayToBigInt(this._value) === TRUE_BIGINT_VALUE\n }\n\n equals(other: this): boolean {\n if (!(other instanceof Bool)) {\n throw new CodeError(`Expected expression of type Bool, got ${(other as object).constructor.name}`)\n }\n return this.bytes.equals(other.bytes)\n }\n\n get uint8ArrayValue(): Uint8Array {\n return this._value\n }\n\n get bytes(): bytes {\n return Bytes(this._value?.length ? this._value : new Uint8Array([0]))\n }\n\n static fromBytes(value: StubBytesCompat | Uint8Array, typeInfo: string | TypeInfo, prefix: 'none' | 'log' = 'none'): Bool {\n let bytesValue = asBytesCls(value)\n if (prefix === 'log') {\n assert(bytesValue.slice(0, 4).equals(ABI_RETURN_VALUE_LOG_PREFIX), 'ABI return prefix not found')\n bytesValue = bytesValue.slice(4)\n }\n const result = new Bool(typeInfo)\n result._value = asUint8Array(bytesValue)\n return result\n }\n}\n\n/** @internal */\nexport class StaticArray<TItem extends _ARC4Encoded, TLength extends number>\n extends _StaticArray<TItem, TLength>\n implements _ARC4Encodedint8Array\n{\n private _value?: NTuple<TItem, TLength>\n private _uint8ArrayValue?: Uint8Array\n private size: number\n typeInfo: TypeInfo\n genericArgs: StaticArrayGenericArgs\n\n constructor(typeInfo: TypeInfo | string, ...items: TItem[] & { length: TLength })\n constructor(typeInfo: TypeInfo | string, ...items: TItem[])\n constructor(typeInfo: TypeInfo | string, ...items: TItem[] & { length: TLength }) {\n // if first item is the symbol, we are initialising from bytes\n // so we don't need to pass the items to the super constructor\n const isInitialisingFromBytes = items.length === 1 && (items[0] as DeliberateAny) === IS_INITIALISING_FROM_BYTES_SYMBOL\n super()\n\n this.typeInfo = typeof typeInfo === 'string' ? JSON.parse(typeInfo) : typeInfo\n this.genericArgs = this.typeInfo.genericArgs as StaticArrayGenericArgs\n this.size = parseInt(this.genericArgs.size.name, 10)\n\n // if we are not initialising from bytes, we need to check and set the items\n if (!isInitialisingFromBytes) {\n if (items.length && items.length !== this.size) {\n throw new CodeError(`expected ${this.size} items, not ${items.length}`)\n }\n\n assert(areAllARC4Encoded(items), 'expected ARC4 type')\n\n items.forEach((item) => {\n checkItemTypeName(this.genericArgs.elementType, item)\n })\n\n if (items.length) {\n this._value = items as NTuple<TItem, TLength>\n } else {\n this._uint8ArrayValue = new Uint8Array(getMaxLengthOfStaticContentType(this.typeInfo))\n }\n }\n return new Proxy(this, arrayProxyHandler<TItem>()) as StaticArray<TItem, TLength>\n }\n\n get uint8ArrayValue(): Uint8Array {\n return this._uint8ArrayValue ?? encode(this.items, true)\n }\n\n get bytes(): bytes {\n return Bytes(this._uint8ArrayValue ?? encode(this.items, true))\n }\n\n equals(other: this): boolean {\n if (!(other instanceof StaticArray) || JSON.stringify(this.typeInfo) !== JSON.stringify(other.typeInfo)) {\n throw new CodeError(`Expected expression of type ${this.typeInfo.name}, got ${other.typeInfo.name}`)\n }\n return this.bytes.equals(other.bytes)\n }\n\n get length(): uint64 {\n return this.size\n }\n\n get items(): NTuple<TItem, TLength> {\n if (this._uint8ArrayValue) {\n const childTypes = Array(this.size).fill(this.genericArgs.elementType)\n this._value = decode(this._uint8ArrayValue, childTypes, true) as NTuple<TItem, TLength>\n this._uint8ArrayValue = undefined\n return this._value\n } else if (this._value) {\n this._uint8ArrayValue = undefined\n return this._value\n }\n throw new CodeError('value is not set')\n }\n\n setItem(index: number, value: TItem): void {\n this.items[index] = value\n }\n\n copy(): StaticArray<TItem, TLength> {\n return StaticArray.fromBytes(this.uint8ArrayValue, JSON.stringify(this.typeInfo)) as unknown as StaticArray<TItem, TLength>\n }\n\n concat(other: Parameters<InstanceType<typeof _StaticArray>['concat']>[0]): DynamicArray<TItem> {\n const items = this.items\n const otherEntries = other.entries()\n let next = otherEntries.next()\n while (!next.done) {\n items.push(next.value[1] as TItem)\n next = otherEntries.next()\n }\n return new DynamicArray<TItem>(\n { name: `DynamicArray<${this.genericArgs.elementType.name}>`, genericArgs: { elementType: this.genericArgs.elementType } },\n ...items,\n )\n }\n\n get native(): NTuple<TItem, TLength> {\n return this.items\n }\n\n static fromBytes(\n value: StubBytesCompat | Uint8Array,\n typeInfo: string | TypeInfo,\n prefix: 'none' | 'log' = 'none',\n ): StaticArray<_ARC4Encoded, number> {\n let bytesValue = value instanceof Uint8Array ? value : asUint8Array(value)\n if (prefix === 'log') {\n assert(Bytes(bytesValue.slice(0, 4)).equals(ABI_RETURN_VALUE_LOG_PREFIX), 'ABI return prefix not found')\n bytesValue = bytesValue.slice(4)\n }\n // pass the symbol to the constructor to let it know we are initialising from bytes\n const result = new StaticArray<_ARC4Encoded, number>(typeInfo, IS_INITIALISING_FROM_BYTES_SYMBOL as DeliberateAny)\n result._uint8ArrayValue = bytesValue\n return result\n }\n}\n\n/** @internal */\nexport class Address extends _Address implements _ARC4Encodedint8Array {\n typeInfo: TypeInfo\n private _value: StaticArray<Byte, 32>\n\n constructor(typeInfo: TypeInfo | string, value?: AccountType | string | bytes) {\n super(value)\n let uint8ArrayValue: Uint8Array\n if (value === undefined) {\n uint8ArrayValue = new Uint8Array(32)\n } else if (typeof value === 'string') {\n uint8ArrayValue = encodingUtil.base32ToUint8Array(value).slice(0, ALGORAND_ADDRESS_BYTE_LENGTH - ALGORAND_CHECKSUM_BYTE_LENGTH)\n } else if (isBytes(value)) {\n uint8ArrayValue = getUint8Array(value)\n } else {\n uint8ArrayValue = getUint8Array(value.bytes)\n }\n avmInvariant(uint8ArrayValue.length === 32, 'Addresses should be 32 bytes')\n\n this._value = StaticArray.fromBytes(uint8ArrayValue, typeInfo) as StaticArray<Byte, 32>\n this.typeInfo = typeof typeInfo === 'string' ? JSON.parse(typeInfo) : typeInfo\n return new Proxy(this, arrayProxyHandler<Byte>()) as Address\n }\n\n get uint8ArrayValue(): Uint8Array {\n return this._value.uint8ArrayValue\n }\n\n get bytes(): bytes {\n return this._value.bytes\n }\n\n equals(other: this): boolean {\n if (!(other instanceof Address) || JSON.stringify(this.typeInfo) !== JSON.stringify(other.typeInfo)) {\n throw new CodeError(`Expected expression of type ${this.typeInfo.name}, got ${other.typeInfo.name}`)\n }\n return this.bytes.equals(other.bytes)\n }\n\n get length(): uint64 {\n return 32\n }\n\n get native(): AccountType {\n return Account(this._value.bytes)\n }\n\n get items(): readonly Byte[] {\n return this._value.items\n }\n\n setItem(_index: number, _value: Byte): void {\n throw new CodeError('Address is immutable')\n }\n\n static fromBytes(value: StubBytesCompat | Uint8Array, typeInfo: string | TypeInfo, prefix: 'none' | 'log' = 'none'): Address {\n const staticArrayValue = StaticArray.fromBytes(value, typeInfo, prefix) as StaticArray<Byte, 32>\n const result = new Address(typeInfo)\n result._value = staticArrayValue\n return result\n }\n}\n\n/** @internal */\nexport class DynamicArray<TItem extends _ARC4Encoded> extends _DynamicArray<TItem> implements _ARC4Encodedint8Array {\n private _value?: TItem[]\n private _uint8ArrayValue?: Uint8Array\n typeInfo: TypeInfo\n genericArgs: DynamicArrayGenericArgs\n\n constructor(typeInfo: TypeInfo | string, ...items: TItem[]) {\n super()\n this.typeInfo = typeof typeInfo === 'string' ? JSON.parse(typeInfo) : typeInfo\n this.genericArgs = this.typeInfo.genericArgs as DynamicArrayGenericArgs\n\n assert(areAllARC4Encoded(items), 'expected ARC4 type')\n\n items.forEach((item) => {\n checkItemTypeName(this.genericArgs.elementType, item)\n })\n this._value = items\n\n return new Proxy(this, arrayProxyHandler<TItem>()) as DynamicArray<TItem>\n }\n\n get uint8ArrayValue(): Uint8Array {\n return this._uint8ArrayValue ?? this.encodeWithLength(this.items)\n }\n\n get bytes(): bytes {\n return Bytes(this._uint8ArrayValue ?? this.encodeWithLength(this.items))\n }\n\n equals(other: this): boolean {\n if (!(other instanceof DynamicArray) || JSON.stringify(this.typeInfo) !== JSON.stringify(other.typeInfo)) {\n throw new CodeError(`Expected expression of type ${this.typeInfo.name}, got ${other.typeInfo.name}`)\n }\n return this.bytes.equals(other.bytes)\n }\n\n get length(): uint64 {\n return this.items.length\n }\n\n get items(): TItem[] {\n if (this._uint8ArrayValue) {\n const [length, data] = readLength(this._uint8ArrayValue)\n const childTypes = Array(length).fill(this.genericArgs.elementType)\n this._value = decode(data, childTypes, true) as TItem[]\n this._uint8ArrayValue = undefined\n return this._value\n } else if (this._value) {\n this._uint8ArrayValue = undefined\n return this._value\n }\n throw new CodeError('value is not set')\n }\n\n setItem(index: number, value: TItem): void {\n this.items[index] = value\n }\n\n copy(): DynamicArray<TItem> {\n return DynamicArray.fromBytes(this.uint8ArrayValue, JSON.stringify(this.typeInfo)) as DynamicArray<TItem>\n }\n\n get native(): TItem[] {\n return this.items\n }\n\n push(...values: TItem[]) {\n const items = this.items\n items.push(...values)\n }\n\n pop(): TItem {\n const items = this.items\n const popped = items.pop()\n if (popped === undefined) throw new AvmError('The array is empty')\n return popped\n }\n\n concat(other: Parameters<InstanceType<typeof _DynamicArray>['concat']>[0]): DynamicArray<TItem> {\n const items = this.items\n const otherEntries = other.entries()\n let next = otherEntries.next()\n while (!next.done) {\n items.push(next.value[1] as TItem)\n next = otherEntries.next()\n }\n return new DynamicArray<TItem>(this.typeInfo, ...items)\n }\n\n static fromBytes(\n value: StubBytesCompat | Uint8Array,\n typeInfo: string | TypeInfo,\n prefix: 'none' | 'log' = 'none',\n ): DynamicArray<_ARC4Encoded> {\n let bytesValue = asBytesCls(value)\n if (prefix === 'log') {\n assert(bytesValue.slice(0, 4).equals(ABI_RETURN_VALUE_LOG_PREFIX), 'ABI return prefix not found')\n bytesValue = bytesValue.slice(4)\n }\n const result = new DynamicArray(typeInfo)\n result._uint8ArrayValue = asUint8Array(bytesValue)\n return result\n }\n\n private encodeWithLength(items: TItem[]) {\n return concatUint8Arrays(encodeLength(items.length).asUint8Array(), encode(items, true))\n }\n}\n\n/** @internal */\nexport class Tuple<TTuple extends [_ARC4Encoded, ..._ARC4Encoded[]]> extends _Tuple<TTuple> implements _ARC4Encodedint8Array {\n private _value?: TTuple\n private _uint8ArrayValue?: Uint8Array\n typeInfo: TypeInfo\n genericArgs: TypeInfo[]\n\n constructor(typeInfo: TypeInfo | string, ...items: TTuple) {\n // if first item is the symbol, we are initialising from bytes\n // so we don't need to pass the items to the super constructor\n const isInitialisingFromBytes = items.length === 1 && (items[0] as DeliberateAny) === IS_INITIALISING_FROM_BYTES_SYMBOL\n super(...(isInitialisingFromBytes ? ([] as DeliberateAny) : items))\n this.typeInfo = typeof typeInfo === 'string' ? JSON.parse(typeInfo) : typeInfo\n this.genericArgs = Object.values(this.typeInfo.genericArgs as Record<string, TypeInfo>)\n\n // if we are not initialising from bytes, we need to check and set the items\n if (!isInitialisingFromBytes) {\n assert(areAllARC4Encoded(items), 'expected ARC4 type')\n\n items.forEach((item, index) => {\n checkItemTypeName(this.genericArgs[index], item)\n })\n if (items.length) {\n this._value = items\n } else {\n this._uint8ArrayValue = new Uint8Array(getMaxLengthOfStaticContentType(this.typeInfo))\n }\n }\n }\n\n get uint8ArrayValue(): Uint8Array {\n return this._uint8ArrayValue ?? encode(this.items)\n }\n\n get bytes(): bytes {\n return Bytes(this._uint8ArrayValue ?? encode(this.items))\n }\n\n equals(other: this): boolean {\n if (!(other instanceof Tuple) || JSON.stringify(this.typeInfo) !== JSON.stringify(other.typeInfo)) {\n throw new CodeError(`Expected expression of type ${this.typeInfo.name}, got ${other.typeInfo.name}`)\n }\n return this.bytes.equals(other.bytes)\n }\n\n get length(): TTuple['length'] & uint64 {\n return this.items.length\n }\n\n get native(): TTuple {\n return this.items\n }\n\n at<TIndex extends keyof TTuple>(index: TIndex): TTuple[TIndex] {\n return this.items[index]\n }\n\n private get items(): TTuple {\n if (this._uint8ArrayValue) {\n this._value = decode(this._uint8ArrayValue, this.genericArgs) as TTuple\n this._uint8ArrayValue = undefined\n return this._value\n } else if (this._value) {\n this._uint8ArrayValue = undefined\n return this._value\n }\n throw new CodeError('value is not set')\n }\n\n static fromBytes(\n value: StubBytesCompat | Uint8Array,\n typeInfo: string | TypeInfo,\n prefix: 'none' | 'log' = 'none',\n ): Tuple<[_ARC4Encoded, ..._ARC4Encoded[]]> {\n let bytesValue = asBytesCls(value)\n if (prefix === 'log') {\n assert(bytesValue.slice(0, 4).equals(ABI_RETURN_VALUE_LOG_PREFIX), 'ABI return prefix not found')\n bytesValue = bytesValue.slice(4)\n }\n // pass the symbol to the constructor to let it know we are initialising from bytes\n const result = new Tuple(typeInfo, IS_INITIALISING_FROM_BYTES_SYMBOL as DeliberateAny)\n result._uint8ArrayValue = asUint8Array(bytesValue)\n return result\n }\n}\n\n/** @internal */\nexport class Struct<T extends StructConstraint> extends (_Struct<StructConstraint> as DeliberateAny) implements _ARC4Encodedint8Array {\n private _uint8ArrayValue?: Uint8Array\n genericArgs: Record<string, TypeInfo>\n\n constructor(typeInfo: TypeInfo | string, value: T = {} as T) {\n super(value)\n this.typeInfo = typeof typeInfo === 'string' ? JSON.parse(typeInfo) : typeInfo\n this.genericArgs = this.typeInfo.genericArgs as Record<string, TypeInfo>\n\n Object.keys(this.genericArgs).forEach((key) => {\n Object.defineProperty(this, key, {\n value: value[key],\n writable: true,\n enumerable: true,\n })\n })\n\n return new Proxy(this, {\n get(target, prop) {\n const originalValue = Reflect.get(target, prop)\n if (originalValue === undefined && target._uint8ArrayValue?.length && Object.keys(target.genericArgs).includes(prop.toString())) {\n return target.items[prop.toString()]\n }\n return originalValue\n },\n set(target, prop, value) {\n if (target._uint8ArrayValue && Object.keys(target.genericArgs).includes(prop.toString())) {\n target.decodeAsProperties()\n }\n return Reflect.set(target, prop, value)\n },\n })\n }\n\n get uint8ArrayValue(): Uint8Array {\n return this._uint8ArrayValue ?? encode(Object.values(this.items))\n }\n\n get bytes(): bytes {\n return Bytes(this._uint8ArrayValue ?? encode(Object.values(this.items)))\n }\n\n get items(): T {\n this.decodeAsProperties()\n const result = {} as StructConstraint\n Object.keys(this.genericArgs).forEach((key) => {\n result[key] = (this as unknown as StructConstraint)[key]\n })\n return result as T\n }\n\n get native(): T {\n return this.items\n }\n\n copy(): Struct<T> {\n return Struct.fromBytes(this.uint8ArrayValue, JSON.stringify(this.typeInfo)) as Struct<T>\n }\n\n private decodeAsProperties() {\n if (this._uint8ArrayValue) {\n const values = decode(this._uint8ArrayValue, Object.values(this.genericArgs))\n Object.keys(this.genericArgs).forEach((key, index) => {\n ;(this as unknown as StructConstraint)[key] = values[index]\n })\n this._uint8ArrayValue = undefined\n }\n }\n\n static fromBytes(\n value: StubBytesCompat | Uint8Array,\n typeInfo: string | TypeInfo,\n prefix: 'none' | 'log' = 'none',\n ): Struct<StructConstraint> {\n let bytesValue = asBytesCls(value)\n if (prefix === 'log') {\n assert(bytesValue.slice(0, 4).equals(ABI_RETURN_VALUE_LOG_PREFIX), 'ABI return prefix not found')\n bytesValue = bytesValue.slice(4)\n }\n const result = new Struct(typeInfo)\n result._uint8ArrayValue = asUint8Array(bytesValue)\n return result\n }\n}\n\n/** @internal */\nexport class DynamicBytes extends _DynamicBytes implements _ARC4Encodedint8Array {\n typeInfo: TypeInfo\n private _value: DynamicArray<Byte>\n\n constructor(typeInfo: TypeInfo | string, value?: bytes | string) {\n super(value)\n const uint8ArrayValue = concatUint8Arrays(encodeLength(value?.length ?? 0).asUint8Array(), asUint8Array(value ?? new Uint8Array()))\n this._value = DynamicArray.fromBytes(uint8ArrayValue, typeInfo) as DynamicArray<Byte>\n this.typeInfo = typeof typeInfo === 'string' ? JSON.parse(typeInfo) : typeInfo\n return new Proxy(this, arrayProxyHandler<Byte>()) as DynamicBytes\n }\n\n get uint8ArrayValue(): Uint8Array {\n return this._value.uint8ArrayValue\n }\n\n get bytes(): bytes {\n return this._value.bytes\n }\n\n equals(other: this): boolean {\n if (!(other instanceof DynamicBytes) || JSON.stringify(this.typeInfo) !== JSON.stringify(other.typeInfo)) {\n throw new CodeError(`Expected expression of type ${this.typeInfo.name}, got ${other.typeInfo.name}`)\n }\n return this.bytes.equals(other.bytes)\n }\n\n get length(): uint64 {\n return this._value.length\n }\n\n get native(): bytes {\n return this._value.bytes.slice(ABI_LENGTH_SIZE)\n }\n\n get items(): Byte[] {\n return this._value.items\n }\n\n setItem(_index: number, _value: Byte): void {\n throw new CodeError('DynamicBytes is immutable')\n }\n\n concat(other: Parameters<InstanceType<typeof _DynamicBytes>['concat']>[0]): DynamicBytes {\n const items = this.items\n const otherEntries = other.entries()\n let next = otherEntries.next()\n while (!next.done) {\n items.push(next.value[1] as Byte)\n next = otherEntries.next()\n }\n const concatenatedBytes = items\n .map((item) => item.uint8ArrayValue)\n .reduce((acc, curr) => concatUint8Arrays(acc, curr), new Uint8Array())\n return new DynamicBytes(this.typeInfo, asBytes(concatenatedBytes))\n }\n\n static fromBytes(value: StubBytesCompat | Uint8Array, typeInfo: string | TypeInfo, prefix: 'none' | 'log' = 'none'): DynamicBytes {\n const dynamicArrayValue = DynamicArray.fromBytes(value, typeInfo, prefix) as DynamicArray<Byte>\n const result = new DynamicBytes(typeInfo)\n result._value = dynamicArrayValue\n return result\n }\n}\n\n/** @internal */\nexport class StaticBytes<TLength extends uint64 = 0> extends _StaticBytes<TLength> implements _ARC4Encodedint8Array {\n private _value: StaticArray<Byte, TLength>\n typeInfo: TypeInfo\n\n constructor(typeInfo: TypeInfo | string, value?: bytes<TLength>) {\n super(value ?? (Bytes() as bytes<TLength>))\n this.typeInfo = typeof typeInfo === 'string' ? JSON.parse(typeInfo) : typeInfo\n const uint8ArrayValue = asUint8Array(value ?? new Uint8Array(getMaxLengthOfStaticContentType(this.typeInfo)))\n this._value = StaticArray.fromBytes(uint8ArrayValue, typeInfo) as unknown as StaticArray<Byte, TLength>\n return new Proxy(this, arrayProxyHandler<Byte>()) as StaticBytes<TLength>\n }\n\n get uint8ArrayValue(): Uint8Array {\n return this._value.uint8ArrayValue\n }\n\n get bytes(): bytes {\n return this._value.bytes\n }\n\n equals(other: this): boolean {\n if (!(other instanceof StaticBytes) || JSON.stringify(this.typeInfo) !== JSON.stringify(other.typeInfo)) {\n throw new CodeError(`Expected expression of type ${this.typeInfo.name}, got ${other.typeInfo.name}`)\n }\n return this.bytes.equals(other.bytes)\n }\n\n get length(): uint64 {\n return this._value.length\n }\n\n get native(): bytes<TLength> {\n return this._value.bytes as bytes<TLength>\n }\n\n get items(): Byte[] {\n return this._value.items\n }\n\n setItem(_index: number, _value: Byte): void {\n throw new CodeError('StaticBytes is immutable')\n }\n\n concat(other: Parameters<InstanceType<typeof _StaticBytes>['concat']>[0]): DynamicBytes {\n const items = this.items\n const otherEntries = other.entries()\n let next = otherEntries.next()\n while (!next.done) {\n items.push(next.value[1] as Byte)\n next = otherEntries.next()\n }\n const concatenatedBytes = items\n .map((item) => item.uint8ArrayValue)\n .reduce((acc, curr) => concatUint8Arrays(acc, curr), new Uint8Array())\n return new DynamicBytes(this.typeInfo, asBytes(concatenatedBytes))\n }\n\n static fromBytes(value: StubBytesCompat | Uint8Array, typeInfo: string | TypeInfo, prefix: 'none' | 'log' = 'none'): StaticBytes {\n const staticArrayValue = StaticArray.fromBytes(value, typeInfo, prefix) as StaticArray<Byte, number>\n const result = new StaticBytes(typeInfo)\n result._value = staticArrayValue as StaticArray<Byte, 0>\n return result\n }\n}\n\n/** @internal */\nexport class ReferenceArray<TItem> extends _ReferenceArray<TItem> {\n private _values: TItem[]\n typeInfo: TypeInfo\n\n constructor(typeInfo: TypeInfo | string, ...items: TItem[]) {\n super(...items)\n this.typeInfo = typeof typeInfo === 'string' ? JSON.parse(typeInfo) : typeInfo\n this._values = items\n\n return new Proxy(this, arrayProxyHandler<TItem>()) as ReferenceArray<TItem>\n }\n\n /**\n * Returns the current length of this array\n */\n get length(): uint64 {\n return this._values.length\n }\n\n get items(): TItem[] {\n return this._values\n }\n\n setItem(index: number, value: TItem): void {\n this.items[index] = value\n }\n\n slice(start?: Uint64Compat, end?: Uint64Compat): _ReferenceArray<TItem> {\n const startIndex = end === undefined ? 0 : asNumber(start ?? 0)\n const endIndex = end === undefined ? asNumber(start ?? this._values.length) : asNumber(end)\n return new ReferenceArray<TItem>(this.typeInfo, ...this._values.slice(startIndex, endIndex))\n }\n\n /**\n * Push a number of items into this array\n * @param items The items to be added to this array\n */\n push(...items: TItem[]): void {\n this._values.push(...items)\n }\n\n /**\n * Pop a single item from this array\n */\n pop(): TItem {\n return this._values.pop()!\n }\n\n copy(): _ReferenceArray<TItem> {\n const bytesValue = toBytes(this)\n return getEncoder<_ReferenceArray<TItem>>(this.typeInfo)(bytesValue, this.typeInfo)\n }\n}\n\n/** @internal */\nexport class FixedArray<TItem, TLength extends number> extends _FixedArray<TItem, TLength> {\n private _values: NTuple<TItem, TLength>\n private size: number\n typeInfo: TypeInfo\n private genericArgs: StaticArrayGenericArgs\n\n constructor(typeInfo: TypeInfo | string, ...items: TItem[] & { length: TLength }) {\n super()\n this.typeInfo = typeof typeInfo === 'string' ? JSON.parse(typeInfo) : typeInfo\n this.genericArgs = this.typeInfo.genericArgs as StaticArrayGenericArgs\n this.size = parseInt(this.genericArgs.size.name, 10)\n if (items.length) {\n this._values = items as NTuple<TItem, TLength>\n } else {\n const bytesValue = asBytes(new Uint8Array(getMaxLengthOfStaticContentType(this.typeInfo)))\n this._values = (getEncoder<_FixedArray<TItem, TLength>>(this.typeInfo)(bytesValue, this.typeInfo) as FixedArray<TItem, TLength>).items\n }\n return new Proxy(this, arrayProxyHandler<TItem>()) as FixedArray<TItem, TLength>\n }\n\n concat(...others: (TItem | ConcatArray<TItem>)[]): TItem[] {\n return this.items.concat(...others)\n }\n\n get length(): uint64 {\n return this.size\n }\n\n get items(): NTuple<TItem, TLength> {\n return this._values\n }\n\n setItem(index: number, value: TItem): void {\n this.items[index] = value\n }\n\n slice(start?: Uint64Compat, end?: Uint64Compat): Array<TItem> {\n const startIndex = end === undefined ? 0 : asNumber(start ?? 0)\n const endIndex = end === undefined ? asNumber(start ?? this._values.length) : asNumber(end)\n return this._values.slice(startIndex, endIndex)\n }\n\n copy(): _FixedArray<TItem, TLength> {\n const bytesValue = toBytes(this)\n return getEncoder<_FixedArray<TItem, TLength>>(this.typeInfo)(bytesValue, this.typeInfo)\n }\n}\n\nconst decode = (value: Uint8Array, childTypes: TypeInfo[], isHomogenous?: boolean) => {\n let i = 0\n let arrayIndex = 0\n const valuePartitions: Uint8Array[] = []\n const dynamicSegments: Array<Array<number>> = [] // Store the start and end of a dynamic element\n\n while (i < childTypes.length) {\n const childType = childTypes[i]\n if (holdsDynamicLengthContent(childType)) {\n // Decode the size of the dynamic element\n const dynamicIndex = uint8ArrayToNumber(value.slice(arrayIndex, arrayIndex + ABI_LENGTH_SIZE))\n if (dynamicSegments.length) {\n dynamicSegments.at(-1)![1] = dynamicIndex\n }\n // Since we do not know where the current dynamic element ends,\n // put a placeholder and update later\n dynamicSegments.push([dynamicIndex, -1])\n valuePartitions.push(new Uint8Array())\n arrayIndex += ABI_LENGTH_SIZE\n } else if (['Bool', 'boolean'].includes(childType.name)) {\n const before = findBoolTypes(childTypes, i, -1, isHomogenous)\n let after = findBoolTypes(childTypes, i, 1, isHomogenous)\n\n if (before % 8 != 0) {\n throw new CodeError('\"expected before index should have number of bool mod 8 equal 0\"')\n }\n after = Math.min(7, after)\n const bits = uint8ArrayToNumber(value.slice(arrayIndex, arrayIndex + 1))\n Array(after + 1)\n .fill(0)\n .forEach((_, j) => {\n const mask = 128 >> j\n valuePartitions.push(\n mask & bits ? encodingUtil.bigIntToUint8Array(TRUE_BIGINT_VALUE) : encodingUtil.bigIntToUint8Array(FALSE_BIGINT_VALUE),\n )\n })\n i += after\n arrayIndex += 1\n } else {\n const currLen = getMaxLengthOfStaticContentType(childType)\n valuePartitions.push(value.slice(arrayIndex, arrayIndex + currLen))\n arrayIndex += currLen\n }\n\n if (arrayIndex >= value.length && i != childTypes.length - 1) {\n throw new CodeError('input string is not long enough to be decoded')\n }\n i += 1\n }\n\n if (dynamicSegments.length > 0) {\n dynamicSegments.at(-1)![1] = value.length\n arrayIndex = value.length\n }\n if (arrayIndex < value.length) {\n throw new CodeError('input string was not fully consumed')\n }\n\n // Check dynamic element partitions\n let segmentIndex = 0\n childTypes.forEach((childType, index) => {\n if (holdsDynamicLengthContent(childType)) {\n const [segmentStart, segmentEnd] = dynamicSegments[segmentIndex]\n valuePartitions[index] = value.slice(segmentStart, segmentEnd)\n segmentIndex += 1\n }\n })\n\n const values: _ARC4Encoded[] = []\n childTypes.forEach((childType, index) => {\n values.push(\n getEncoder<_ARC4Encoded>(childType)(\n ['bytes', 'string'].includes(childType.name) ? valuePartitions[index].slice(2) : valuePartitions[index],\n childType,\n ),\n )\n })\n return values\n}\n\nconst encode = (values: (_ARC4Encoded & { uint8ArrayValue?: Uint8Array })[], isHomogenous?: boolean) => {\n const length = values.length\n const heads = []\n const tails = []\n const dynamicLengthTypeIndex = []\n let i = 0\n const valuesLengthBytes = values instanceof _DynamicArray ? encodeLength(length).asUint8Array() : new Uint8Array()\n while (i < length) {\n const value = values[i]\n assert(value instanceof _ARC4Encoded, `expected ARC4 type ${value.constructor.name}`)\n dynamicLengthTypeIndex.push(isDynamicLengthType(value))\n if (dynamicLengthTypeIndex.at(-1)) {\n heads.push(asUint8Array(Bytes.fromHex('0000')))\n tails.push((value as _ARC4Encodedint8Array).uint8ArrayValue ?? asUint8Array(value.bytes))\n } else {\n if (value instanceof _Bool) {\n const before = findBool(values, i, -1, isHomogenous)\n let after = findBool(values, i, 1, isHomogenous)\n if (before % 8 != 0) {\n throw new CodeError('\"expected before index should have number of bool mod 8 equal 0\"')\n }\n after = Math.min(7, after)\n const consecutiveBools = values.slice(i, i + after + 1) as _Bool[]\n const compressedNumber = compressMultipleBool(consecutiveBools)\n heads.push(new Uint8Array([compressedNumber]))\n i += after\n } else {\n heads.push((value as _ARC4Encodedint8Array).uint8ArrayValue ?? asUint8Array(value.bytes))\n }\n tails.push(new Uint8Array())\n }\n i += 1\n }\n\n // Adjust heads for dynamic types\n let headLength = 0\n heads.forEach((head) => {\n // If the element is not a placeholder, append the length of the element\n headLength += head.length\n })\n\n // Correctly encode dynamic types and replace placeholder\n let tailCurrLength = 0\n for (let i = 0; i < heads.length; i++) {\n if (dynamicLengthTypeIndex[i]) {\n const headValue = headLength + tailCurrLength\n heads[i] = asUint8Array(encodeLength(headValue))\n }\n tailCurrLength += tails[i].length\n }\n\n return concatUint8Arrays(valuesLengthBytes, ...heads, ...tails)\n}\n\nconst isDynamicLengthType = (value: _ARC4Encoded) => {\n return (\n value instanceof Str ||\n (value instanceof StaticArray && holdsDynamicLengthContent(value.typeInfo)) ||\n (value instanceof Tuple && value.genericArgs.some(holdsDynamicLengthContent)) ||\n (value instanceof Struct && Object.values(value.genericArgs).some(holdsDynamicLengthContent)) ||\n value instanceof DynamicArray ||\n value instanceof DynamicBytes\n )\n}\n\n/** @internal */\nexport function encodeArc4<T>(sourceTypeInfoString: string | undefined, source: T): bytes {\n const arc4Encoded = getArc4Encoded(source, sourceTypeInfoString)\n return arc4Encoded.bytes\n}\n\n/** @internal */\nexport function decodeArc4<T>(\n sourceTypeInfoString: string,\n targetTypeInfoString: string,\n bytes: StubBytesCompat,\n prefix: 'none' | 'log' = 'none',\n): T {\n const sourceTypeInfo = JSON.parse(sourceTypeInfoString)\n const targetTypeInfo = JSON.parse(targetTypeInfoString)\n const encoder = getEncoder(sourceTypeInfo)\n const source = encoder(bytes, sourceTypeInfo, prefix) as { typeInfo: TypeInfo }\n return getNativeValue(source, targetTypeInfo) as T\n}\n\n/** @internal */\nexport function convertBytes<T extends _ARC4Encoded>(\n typeInfoString: string,\n bytes: StubBytesCompat,\n options: { prefix?: 'none' | 'log'; strategy: 'unsafe-cast' | 'validate' },\n): T {\n const typeInfo = JSON.parse(typeInfoString)\n return getEncoder<T>(typeInfo)(bytes, typeInfo, options.prefix)\n}\n\n/** @internal */\nexport const getArc4Encoded = (value: DeliberateAny, sourceTypeInfoString?: string): _ARC4Encoded => {\n if (value instanceof _ARC4Encoded) {\n return value\n }\n if (value instanceof AccountCls) {\n return getArc4Encoded(value.bytes)\n }\n if (value instanceof AssetCls) {\n return getArc4Encoded(value.id)\n }\n if (value instanceof ApplicationCls) {\n return getArc4Encoded(value.id)\n }\n if (typeof value === 'boolean') {\n return new Bool({ name: 'Bool' }, value)\n }\n if (value instanceof Uint64Cls || typeof value === 'number') {\n return new Uint({ name: 'Uint<64>', genericArgs: [{ name: '64' }] }, asBigInt(value))\n }\n if (value instanceof BigUintCls) {\n return new Uint({ name: 'Uint<512>', genericArgs: [{ name: '512' }] }, value.asBigInt())\n }\n if (typeof value === 'bigint') {\n return new Uint({ name: 'Uint<512>', genericArgs: [{ name: '512' }] }, value)\n }\n if (value instanceof BytesCls) {\n if (value.fixedLength !== undefined) {\n return new StaticBytes(\n {\n name: 'StaticBytes',\n genericArgs: { elementType: { name: 'Byte', genericArgs: [{ name: '8' }] }, size: { name: value.fixedLength.toString() } },\n },\n value.asAlgoTs(),\n )\n }\n return new DynamicBytes(\n { name: 'DynamicBytes', genericArgs: { elementType: { name: 'Byte', genericArgs: [{ name: '8' }] } } },\n value.asAlgoTs(),\n )\n }\n if (typeof value === 'string') {\n return new Str({ name: 'Str' }, value)\n }\n if (Array.isArray(value) || value instanceof ReferenceArray || value instanceof FixedArray) {\n const sourceTypeInfo = sourceTypeInfoString ? JSON.parse(sourceTypeInfoString) : undefined\n const sourceGenericArgs = ((value as DeliberateAny).typeInfo || sourceTypeInfo || {})?.genericArgs\n const result: _ARC4Encoded[] = (value instanceof ReferenceArray || value instanceof FixedArray ? value.items : value).reduce(\n (acc: _ARC4Encoded[], cur: DeliberateAny, currentIndex: number) => {\n const elementTypeInfo = sourceGenericArgs?.elementType || sourceGenericArgs?.[currentIndex]\n const elementTypeInfoString = elementTypeInfo ? JSON.stringify(elementTypeInfo) : undefined\n return acc.concat(getArc4Encoded(cur, elementTypeInfoString))\n },\n [],\n )\n\n const genericArgs: TypeInfo[] = result.map((x) => (x as DeliberateAny).typeInfo)\n if (value instanceof FixedArray) {\n const typeInfo = {\n name: `StaticArray<${genericArgs[0].name},${genericArgs.length}>`,\n genericArgs: { elementType: genericArgs[0], size: { name: genericArgs.length.toString() } },\n }\n return new StaticArray(typeInfo, ...(result as [_ARC4Encoded, ..._ARC4Encoded[]]))\n } else if (\n sourceTypeInfo?.name?.startsWith('Array') ||\n sourceTypeInfo?.name?.startsWith('ReadonlyArray') ||\n value instanceof ReferenceArray\n ) {\n const elementType = genericArgs[0] ?? sourceTypeInfo.genericArgs?.elementType\n const typeInfo = { name: `DynamicArray<${elementType.name}>`, genericArgs: { elementType } }\n return new DynamicArray(typeInfo, ...(result as [_ARC4Encoded, ..._ARC4Encoded[]]))\n } else {\n const typeInfo = { name: `Tuple<[${genericArgs.map((x) => x.name).join(',')}]>`, genericArgs }\n return new Tuple(typeInfo, ...(result as [_ARC4Encoded, ..._ARC4Encoded[]]))\n }\n }\n if (typeof value === 'object') {\n const sourceTypeInfo = sourceTypeInfoString ? JSON.parse(sourceTypeInfoString) : undefined\n const propTypeInfos = (value.typeInfo || sourceTypeInfo || {}).genericArgs\n const result = Object.entries(value).reduce((acc: _ARC4Encoded[], [key, cur]: DeliberateAny) => {\n const propTypeInfoString = propTypeInfos?.[key] ? JSON.stringify(propTypeInfos[key]) : undefined\n return acc.concat(getArc4Encoded(cur, propTypeInfoString))\n }, [])\n const genericArgs: TypeInfo[] = result.map((x) => (x as DeliberateAny).typeInfo)\n const typeInfo = {\n name: `Struct<${value.constructor.name}>`,\n genericArgs: Object.fromEntries(Object.keys(value).map((x, i) => [x, genericArgs[i]])),\n }\n let s = Object.fromEntries(Object.keys(typeInfo.genericArgs).map((x, i) => [x, result[i]]))\n if (propTypeInfos) {\n // if source type info is provided, reorder the struct properties to match the expected type schema\n s = Object.fromEntries(Object.keys(propTypeInfos).map((x) => [x, s[x]]))\n typeInfo.genericArgs = propTypeInfos\n } else {\n // if not, reorder the struct properties alphabetically\n typeInfo.genericArgs = Object.fromEntries(\n Object.keys(typeInfo.genericArgs)\n .sort()\n .map((key) => [key, typeInfo.genericArgs[key]]),\n )\n s = Object.fromEntries(Object.keys(typeInfo.genericArgs).map((key) => [key, s[key]]))\n }\n return new Struct(typeInfo, s)\n }\n\n throw new CodeError(`Unsupported type for encoding: ${typeof value}`)\n}\n\n/** @internal */\nexport const toBytes = (val: unknown, sourceTypeInfoString?: string): bytes => {\n return asBytes(toUint8Array(val, sourceTypeInfoString))\n}\n\n/** @internal */\nexport const toUint8Array = (val: unknown, sourceTypeInfoString?: string): Uint8Array => {\n const uint64Val = asMaybeUint64Cls(val, false)\n if (uint64Val !== undefined) {\n return uint64Val.toBytes().asUint8Array()\n }\n const bytesVal = asMaybeBytesCls(val)\n if (bytesVal !== undefined) {\n return bytesVal.asUint8Array()\n }\n const bigUintVal = asMaybeBigUintCls(val)\n if (bigUintVal !== undefined) {\n return bigUintVal.toBytes().asUint8Array()\n }\n if (val instanceof BytesBackedCls) {\n return asUint8Array(val.bytes)\n }\n if (val instanceof Uint64BackedCls) {\n return asUint64Cls(val.uint64).toBytes().asUint8Array()\n }\n if (Array.isArray(val) || typeof val === 'object') {\n const arc4Encoded = getArc4Encoded(val, sourceTypeInfoString)\n return (arc4Encoded as _ARC4Encodedint8Array).uint8ArrayValue ?? asUint8Array(arc4Encoded.bytes)\n }\n throw new InternalError(`Invalid type for bytes: ${nameOfType(val)}`)\n}\n\n/** @internal */\nexport const getEncoder = <T>(typeInfo: TypeInfo): fromBytes<T> => {\n const mutableTupleFromBytes = (value: StubBytesCompat | Uint8Array, typeInfo: string | TypeInfo, prefix: 'none' | 'log' = 'none') => {\n const tuple = Tuple.fromBytes(value, typeInfo, prefix)\n return asNumber(tuple.bytes.length) ? tuple.native : ([] as unknown as typeof tuple.native)\n }\n const readonlyMutableTupleFromBytes = (\n value: StubBytesCompat | Uint8Array,\n typeInfo: string | TypeInfo,\n prefix: 'none' | 'log' = 'none',\n ) => {\n const result = mutableTupleFromBytes(value, typeInfo, prefix)\n return result as Readonly<typeof result>\n }\n const mutableObjectFromBytes = (value: StubBytesCompat | Uint8Array, typeInfo: string | TypeInfo, prefix: 'none' | 'log' = 'none') => {\n const struct = Struct.fromBytes(value, typeInfo, prefix)\n return asNumber(struct.bytes.length) ? struct.native : ({} as unknown as typeof struct.native)\n }\n const readonlyObjectFromBytes = (value: StubBytesCompat | Uint8Array, typeInfo: string | TypeInfo, prefix: 'none' | 'log' = 'none') => {\n const result = mutableObjectFromBytes(value, typeInfo, prefix)\n return result as Readonly<typeof result>\n }\n const arrayFromBytes = (value: StubBytesCompat | Uint8Array, typeInfo: string | TypeInfo, prefix: 'none' | 'log' = 'none') => {\n const dynamicArray = DynamicArray.fromBytes(value, typeInfo, prefix)\n return asNumber(dynamicArray.bytes.length) ? dynamicArray.native : ([] as unknown as typeof dynamicArray.native)\n }\n const readonlyArrayFromBytes = (value: StubBytesCompat | Uint8Array, typeInfo: string | TypeInfo, prefix: 'none' | 'log' = 'none') => {\n const result = arrayFromBytes(value, typeInfo, prefix)\n return result as Readonly<typeof result>\n }\n const referenceArrayFromBytes = (value: StubBytesCompat | Uint8Array, typeInfo: string | TypeInfo, prefix: 'none' | 'log' = 'none') => {\n const dynamicArray = DynamicArray.fromBytes(value, typeInfo, prefix)\n return new ReferenceArray(\n typeInfo,\n ...(asNumber(dynamicArray.bytes.length) ? dynamicArray.native : ([] as unknown as typeof dynamicArray.native)),\n )\n }\n const fixedArrayFromBytes = (value: StubBytesCompat | Uint8Array, typeInfo: string | TypeInfo, prefix: 'none' | 'log' = 'none') => {\n const staticArray = StaticArray.fromBytes(value, typeInfo, prefix)\n return new FixedArray(\n typeInfo,\n ...(asNumber(staticArray.uint8ArrayValue.length) ? staticArray.native : ([] as unknown as typeof staticArray.native)),\n )\n }\n const encoders: Record<string, fromBytes<DeliberateAny>> = {\n account: AccountCls.fromBytes,\n application: ApplicationCls.fromBytes,\n asset: AssetCls.fromBytes,\n boolean: booleanFromBytes,\n biguint: bigUintFromBytes,\n 'bytes(<.*>)?': bytesFromBytes,\n string: stringFromBytes,\n uint64: uint64FromBytes,\n OnCompleteAction: onCompletionFromBytes,\n TransactionType: transactionTypeFromBytes,\n Address: Address.fromBytes,\n Bool: Bool.fromBytes,\n Byte: Byte.fromBytes,\n Str: Str.fromBytes,\n 'Uint<.*>': Uint.fromBytes,\n 'UFixed<.*>': UFixed.fromBytes,\n 'StaticArray<.*>': StaticArray.fromBytes,\n 'DynamicArray<.*>': DynamicArray.fromBytes,\n 'Tuple(<.*>)?': Tuple.fromBytes,\n 'ReadonlyTuple(<.*>)?': readonlyMutableTupleFromBytes,\n 'MutableTuple(<.*>)?': mutableTupleFromBytes,\n 'Struct(<.*>)?': Struct.fromBytes,\n DynamicBytes: DynamicBytes.fromBytes,\n 'StaticBytes<.*>': StaticBytes.fromBytes,\n object: Struct.fromBytes,\n 'Object<.*>': mutableObjectFromBytes,\n 'ReadonlyObject<.*>': readonlyObjectFromBytes,\n 'ReferenceArray<.*>': referenceArrayFromBytes,\n 'FixedArray<.*>': fixedArrayFromBytes,\n 'Array<.*>': arrayFromBytes,\n 'ReadonlyArray<.*>': readonlyArrayFromBytes,\n }\n\n const encoder = Object.entries(encoders).find(([k, _]) => new RegExp(`^${k}$`, 'i').test(typeInfo.name))?.[1]\n if (!encoder) {\n throw new Error(`No encoder found for type ${typeInfo.name}`)\n }\n return encoder as fromBytes<T>\n}\n","import type { bytes, gtxn, MimcConfigurations, op, VrfVerify } from '@algorandfoundation/algorand-typescript'\nimport { Ecdsa, OnCompleteAction } from '@algorandfoundation/algorand-typescript'\nimport elliptic from 'elliptic'\nimport js_sha256 from 'js-sha256'\nimport js_sha3 from 'js-sha3'\nimport js_sha512 from 'js-sha512'\nimport nacl from 'tweetnacl'\nimport { LOGIC_DATA_PREFIX, PROGRAM_TAG } from '../constants'\nimport { lazyContext } from '../context-helpers/internal-context'\nimport { InternalError, NotImplementedError } from '../errors'\nimport { asBytes, asBytesCls, asUint8Array, concatUint8Arrays } from '../util'\nimport type { StubBytesCompat, StubUint64Compat } from './primitives'\nimport { Bytes, BytesCls, Uint64Cls } from './primitives'\n\n/** @internal */\nexport const sha256 = (a: StubBytesCompat): bytes<32> => {\n const bytesA = BytesCls.fromCompat(a)\n const hashArray = js_sha256.sha256.create().update(bytesA.asUint8Array()).digest()\n const hashBytes = Bytes(new Uint8Array(hashArray), { length: 32 })\n return hashBytes\n}\n\n/** @internal */\nexport const sha3_256 = (a: StubBytesCompat): bytes<32> => {\n const bytesA = BytesCls.fromCompat(a)\n const hashArray = js_sha3.sha3_256.create().update(bytesA.asUint8Array()).digest()\n const hashBytes = Bytes(new Uint8Array(hashArray), { length: 32 })\n return hashBytes\n}\n\n/** @internal */\nexport const keccak256 = (a: StubBytesCompat): bytes<32> => {\n const bytesA = BytesCls.fromCompat(a)\n const hashArray = js_sha3.keccak256.create().update(bytesA.asUint8Array()).digest()\n const hashBytes = Bytes(new Uint8Array(hashArray), { length: 32 })\n return hashBytes\n}\n\n/** @internal */\nexport const sha512_256 = (a: StubBytesCompat): bytes<32> => {\n const bytesA = BytesCls.fromCompat(a)\n const hashArray = js_sha512.sha512_256.create().update(bytesA.asUint8Array()).digest()\n const hashBytes = Bytes(new Uint8Array(hashArray), { length: 32 })\n return hashBytes\n}\n\n/** @internal */\nexport const ed25519verifyBare = (a: StubBytesCompat, b: StubBytesCompat, c: StubBytesCompat): boolean => {\n const bytesA = BytesCls.fromCompat(a)\n const bytesB = BytesCls.fromCompat(b)\n const bytesC = BytesCls.fromCompat(c)\n return nacl.sign.detached.verify(bytesA.asUint8Array(), bytesB.asUint8Array(), bytesC.asUint8Array())\n}\n\n/** @internal */\nexport const ed25519verify = (a: StubBytesCompat, b: StubBytesCompat, c: StubBytesCompat): boolean => {\n const txn = lazyContext.activeGroup.activeTransaction as gtxn.ApplicationCallTxn\n const programBytes = asBytesCls(txn.onCompletion == OnCompleteAction.ClearState ? txn.clearStateProgram : txn.approvalProgram)\n\n const logicSig = concatUint8Arrays(asUint8Array(PROGRAM_TAG), programBytes.asUint8Array())\n const logicSigAddress = js_sha512.sha512_256.array(logicSig)\n\n const addressBytes = Bytes(logicSigAddress)\n const data = LOGIC_DATA_PREFIX.concat(addressBytes).concat(asBytes(a))\n return ed25519verifyBare(data, b, c)\n}\n\n/** @internal */\nexport const ecdsaVerify = (\n v: Ecdsa,\n a: StubBytesCompat,\n b: StubBytesCompat,\n c: StubBytesCompat,\n d: StubBytesCompat,\n e: StubBytesCompat,\n): boolean => {\n const dataBytes = BytesCls.fromCompat(a)\n const sigRBytes = BytesCls.fromCompat(b)\n const sigSBytes = BytesCls.fromCompat(c)\n const pubkeyXBytes = BytesCls.fromCompat(d)\n const pubkeyYBytes = BytesCls.fromCompat(e)\n\n const publicKey = BytesCls.fromCompat(new Uint8Array([0x04]))\n .concat(pubkeyXBytes)\n .concat(pubkeyYBytes)\n\n const ecdsa = new elliptic.ec(curveMap[v])\n const keyPair = ecdsa.keyFromPublic(publicKey.asUint8Array())\n return keyPair.verify(dataBytes.asUint8Array(), { r: sigRBytes.asUint8Array(), s: sigSBytes.asUint8Array() })\n}\n\n/** @internal */\nexport const ecdsaPkRecover = (\n v: Ecdsa,\n a: StubBytesCompat,\n b: StubUint64Compat,\n c: StubBytesCompat,\n d: StubBytesCompat,\n): readonly [bytes<32>, bytes<32>] => {\n if (v !== Ecdsa.Secp256k1) {\n throw new InternalError(`Unsupported ECDSA curve: ${v}`)\n }\n const dataBytes = BytesCls.fromCompat(a)\n const rBytes = BytesCls.fromCompat(c)\n const sBytes = BytesCls.fromCompat(d)\n const recoveryId = Uint64Cls.fromCompat(b)\n\n const ecdsa = new elliptic.ec(curveMap[v])\n const pubKey = ecdsa.recoverPubKey(\n dataBytes.asUint8Array(),\n { r: rBytes.asUint8Array(), s: sBytes.asUint8Array() },\n recoveryId.asNumber(),\n )\n\n const x = pubKey.getX().toArray('be')\n const y = pubKey.getY().toArray('be')\n return [Bytes(x, { length: 32 }), Bytes(y, { length: 32 })]\n}\n\n/** @internal */\nexport const ecdsaPkDecompress = (v: Ecdsa, a: StubBytesCompat): readonly [bytes<32>, bytes<32>] => {\n const bytesA = BytesCls.fromCompat(a)\n\n const ecdsa = new elliptic.ec(curveMap[v])\n const keyPair = ecdsa.keyFromPublic(bytesA.asUint8Array())\n const pubKey = keyPair.getPublic()\n\n const x = pubKey.getX().toArray('be')\n const y = pubKey.getY().toArray('be')\n return [Bytes(x, { length: 32 }), Bytes(y, { length: 32 })]\n}\n\n/** @internal */\nexport const vrfVerify = (_s: VrfVerify, _a: StubBytesCompat, _b: StubBytesCompat, _c: StubBytesCompat): readonly [bytes<64>, boolean] => {\n throw new NotImplementedError('vrfVerify')\n}\n\n/** @internal */\nexport const EllipticCurve = new Proxy({} as typeof op.EllipticCurve, {\n get: (_target, prop) => {\n throw new NotImplementedError(`EllipticCurve.${prop.toString()}`)\n },\n})\n\n/** @internal */\nexport const mimc = (_c: MimcConfigurations, _a: StubBytesCompat): bytes => {\n throw new NotImplementedError('mimc')\n}\n\n/** @internal */\nexport const falconVerify = (_a: StubBytesCompat, _b: StubBytesCompat, _c: StubBytesCompat): boolean => {\n throw new NotImplementedError('falconVerify')\n}\n\nconst curveMap = {\n [Ecdsa.Secp256k1]: 'secp256k1',\n [Ecdsa.Secp256r1]: 'p256',\n}\n","import type {\n Account as AccountType,\n Application as ApplicationType,\n bytes,\n gtxn,\n op,\n uint64,\n} from '@algorandfoundation/algorand-typescript'\nimport { lazyContext } from '../context-helpers/internal-context'\nimport { asMaybeUint64Cls, asUint64 } from '../util'\nimport { Bytes, Uint64, type StubUint64Compat } from './primitives'\nimport { Account } from './reference'\n\nconst resolveAppIndex = (appIdOrIndex: StubUint64Compat): uint64 => {\n const input = asUint64(appIdOrIndex)\n if (input >= 1001) {\n return input\n }\n const txn = lazyContext.activeGroup.activeTransaction as gtxn.ApplicationCallTxn\n return txn.apps(input).id\n}\n\n/** @internal */\nexport const getApp = (app: ApplicationType | StubUint64Compat): ApplicationType | undefined => {\n try {\n const appId = asMaybeUint64Cls(app)\n if (appId !== undefined) {\n return lazyContext.ledger.getApplication(resolveAppIndex(appId))\n }\n return app as ApplicationType\n } catch {\n return undefined\n }\n}\n\n/** @internal */\nexport const AppParams: typeof op.AppParams = {\n appApprovalProgram(a: ApplicationType | StubUint64Compat): readonly [bytes, boolean] {\n const app = getApp(a)\n return app === undefined ? [Bytes(), false] : [app.approvalProgram, true]\n },\n appClearStateProgram(a: ApplicationType | StubUint64Compat): readonly [bytes, boolean] {\n const app = getApp(a)\n return app === undefined ? [Bytes(), false] : [app.clearStateProgram, true]\n },\n appGlobalNumUint(a: ApplicationType | StubUint64Compat): readonly [uint64, boolean] {\n const app = getApp(a)\n return app === undefined ? [Uint64(0), false] : [app.globalNumUint, true]\n },\n appGlobalNumByteSlice(a: ApplicationType | StubUint64Compat): readonly [uint64, boolean] {\n const app = getApp(a)\n return app === undefined ? [Uint64(0), false] : [app.globalNumBytes, true]\n },\n appLocalNumUint(a: ApplicationType | StubUint64Compat): readonly [uint64, boolean] {\n const app = getApp(a)\n return app === undefined ? [Uint64(0), false] : [app.localNumUint, true]\n },\n appLocalNumByteSlice(a: ApplicationType | StubUint64Compat): readonly [uint64, boolean] {\n const app = getApp(a)\n return app === undefined ? [Uint64(0), false] : [app.localNumBytes, true]\n },\n appExtraProgramPages(a: ApplicationType | StubUint64Compat): readonly [uint64, boolean] {\n const app = getApp(a)\n return app === undefined ? [Uint64(0), false] : [app.extraProgramPages, true]\n },\n appCreator(a: ApplicationType | StubUint64Compat): readonly [AccountType, boolean] {\n const app = getApp(a)\n return app === undefined ? [Account(), false] : [app.creator, true]\n },\n appAddress(a: ApplicationType | StubUint64Compat): readonly [AccountType, boolean] {\n const app = getApp(a)\n return app === undefined ? [Account(), false] : [app.address, true]\n },\n appVersion: function (a: ApplicationType | uint64): readonly [uint64, boolean] {\n const app = getApp(a)\n return app === undefined ? [Uint64(0), false] : [app.version, true]\n },\n}\n","import type { Account as AccountType, Asset as AssetType, bytes, gtxn, op, uint64 } from '@algorandfoundation/algorand-typescript'\nimport { lazyContext } from '../context-helpers/internal-context'\nimport { asMaybeUint64Cls, asUint64 } from '../util'\nimport { Bytes, Uint64, type StubUint64Compat } from './primitives'\nimport { Account } from './reference'\n\nconst resolveAssetIndex = (assetIdOrIndex: StubUint64Compat): uint64 => {\n const input = asUint64(assetIdOrIndex)\n if (input >= 1001) {\n return input\n }\n const txn = lazyContext.activeGroup.activeTransaction as gtxn.ApplicationCallTxn\n return txn.assets(input).id\n}\n\n/** @internal */\nexport const getAsset = (asset: AssetType | StubUint64Compat): AssetType | undefined => {\n try {\n const assetId = asMaybeUint64Cls(asset)\n if (assetId !== undefined) {\n return lazyContext.ledger.getAsset(resolveAssetIndex(assetId))\n }\n return asset as AssetType\n } catch {\n return undefined\n }\n}\n\n/** @internal */\nexport const AssetParams: typeof op.AssetParams = {\n assetTotal(a: AssetType | StubUint64Compat): readonly [uint64, boolean] {\n const asset = getAsset(a)\n return asset === undefined ? [Uint64(0), false] : [asset.total, true]\n },\n assetDecimals(a: AssetType | StubUint64Compat): readonly [uint64, boolean] {\n const asset = getAsset(a)\n return asset === undefined ? [Uint64(0), false] : [asset.decimals, true]\n },\n assetDefaultFrozen(a: AssetType | StubUint64Compat): readonly [boolean, boolean] {\n const asset = getAsset(a)\n return asset === undefined ? [false, false] : [asset.defaultFrozen, true]\n },\n assetUnitName(a: AssetType | StubUint64Compat): readonly [bytes, boolean] {\n const asset = getAsset(a)\n return asset === undefined ? [Bytes(), false] : [asset.unitName, true]\n },\n assetName(a: AssetType | StubUint64Compat): readonly [bytes, boolean] {\n const asset = getAsset(a)\n return asset === undefined ? [Bytes(), false] : [asset.name, true]\n },\n assetUrl(a: AssetType | StubUint64Compat): readonly [bytes, boolean] {\n const asset = getAsset(a)\n return asset === undefined ? [Bytes(), false] : [asset.url, true]\n },\n assetMetadataHash(a: AssetType | StubUint64Compat): readonly [bytes<32>, boolean] {\n const asset = getAsset(a)\n return asset === undefined ? [Bytes() as bytes<32>, false] : [asset.metadataHash, true]\n },\n assetManager(a: AssetType | StubUint64Compat): readonly [AccountType, boolean] {\n const asset = getAsset(a)\n return asset === undefined ? [Account(), false] : [asset.manager, true]\n },\n assetReserve(a: AssetType | StubUint64Compat): readonly [AccountType, boolean] {\n const asset = getAsset(a)\n return asset === undefined ? [Account(), false] : [asset.reserve, true]\n },\n assetFreeze(a: AssetType | StubUint64Compat): readonly [AccountType, boolean] {\n const asset = getAsset(a)\n return asset === undefined ? [Account(), false] : [asset.freeze, true]\n },\n assetClawback(a: AssetType | StubUint64Compat): readonly [AccountType, boolean] {\n const asset = getAsset(a)\n return asset === undefined ? [Account(), false] : [asset.clawback, true]\n },\n assetCreator(a: AssetType | StubUint64Compat): readonly [AccountType, boolean] {\n const asset = getAsset(a)\n return asset === undefined ? [Account(), false] : [asset.creator, true]\n },\n}\n"],"names":["_Uint","_UFixed","_Byte","_Str","_Bool","_StaticArray","_Address","_DynamicArray","_Tuple","_Struct","_DynamicBytes","_StaticBytes","_ReferenceArray","_FixedArray","_ARC4Encoded"],"mappings":";;;;;;;;;;;;AAIA;AACO,MAAM,iBAAiB,GAAG,OAAc;IAC7C,GAAG,CAAC,MAAmC,EAAE,IAAiB,EAAA;AACxD,QAAA,MAAM,GAAG,GAAG,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAC,QAAQ,EAAE,EAAE,EAAE,CAAC,GAAG,GAAG;AACtD,QAAA,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE;YACf,IAAI,GAAG,IAAI,CAAC,IAAI,GAAG,GAAG,MAAM,CAAC,KAAK,CAAC,MAAM;AAAE,gBAAA,OAAO,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC;AACnE,YAAA,MAAM,IAAI,QAAQ,CAAC,qBAAqB,CAAC;QAC3C;AAAO,aAAA,IAAI,IAAI,KAAK,MAAM,CAAC,QAAQ,EAAE;AACnC,YAAA,OAAO,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC;QACzD;AAAO,aAAA,IAAI,IAAI,KAAK,SAAS,EAAE;AAC7B,YAAA,OAAO,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC;QAChD;AAAO,aAAA,IAAI,IAAI,KAAK,MAAM,EAAE;AAC1B,YAAA,OAAO,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC;QAC7C;AAAO,aAAA,IAAI,IAAI,KAAK,IAAI,EAAE;YACxB,OAAO,CAAC,KAAmB,KAAW;gBACpC,OAAO,SAAS,CAAC,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AS,GAAG,CAAC,OAAO,EAAE,EAAE,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC;IACzE,CAAC;AACD,IAAA,WAAW,CAAC,CAA+B,EAAA;AACzC,QAAA,MAAM,KAAK,GAAG,QAAQ,CAAC,CAAC,CAAC;QACzB,OAAO,KAAK,KAAK,SAAS,GAAG,CAAC,OAAO,EAAE,EAAE,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC;IACxE,CAAC;AACD,IAAA,aAAa,CAAC,CAA+B,EAAA;AAC3C,QAAA,MAAM,KAAK,GAAG,QAAQ,CAAC,CAAC,CAAC;QACzB,OAAO,KAAK,KAAK,SAAS,GAAG,CAAC,OAAO,EAAE,EAAE,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,QAAQ,EAAE,IAAI,CAAC;IAC1E,CAAC;AACD,IAAA,YAAY,CAAC,CAA+B,EAAA;AAC1C,QAAA,MAAM,KAAK,GAAG,QAAQ,CAAC,CAAC,CAAC;QACzB,OAAO,KAAK,KAAK,SAAS,GAAG,CAAC,OAAO,EAAE,EAAE,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC;IACzE,CAAC;;;;;"}
|
package/index.mjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { OnCompleteAction, TransactionType } from '@algorandfoundation/algorand-typescript';
|
|
2
|
-
import { g as getContractMethodAbiMetadata, a as getContractAbiMetadata } from './runtime-helpers-
|
|
3
|
-
import { m as methodSelector, G as GlobalStateCls, L as LocalStateCls, C as ContractContext, c as checkRoutingConditions, a as createInnerTxn, A as ApplicationCallInnerTxnContext, I as ItxnParams, b as ApplicationCallTransaction, P as PaymentTransaction, K as KeyRegistrationTransaction, d as AssetConfigTransaction, e as AssetTransferTransaction, f as AssetFreezeTransaction } from './inner-transactions-
|
|
2
|
+
import { g as getContractMethodAbiMetadata, a as getContractAbiMetadata } from './runtime-helpers-BfpGXQyk.js';
|
|
3
|
+
import { m as methodSelector, G as GlobalStateCls, L as LocalStateCls, C as ContractContext, c as checkRoutingConditions, a as createInnerTxn, A as ApplicationCallInnerTxnContext, I as ItxnParams, b as ApplicationCallTransaction, P as PaymentTransaction, K as KeyRegistrationTransaction, d as AssetConfigTransaction, e as AssetTransferTransaction, f as AssetFreezeTransaction } from './inner-transactions-DD57S6z9.js';
|
|
4
4
|
import { a as asNumber, U as Uint64Cls, B as BigUintCls, b as BytesCls, A as AccountCls, c as AlgoTsPrimitiveCls, i as iterBigInt, d as Uint64Map, e as AccountMap, f as asBytes, g as Asset, h as asUint64, j as Application, k as asMaybeUint64Cls, l as asUint64Cls, m as AssetHolding, n as AccountData, o as ApplicationData, p as getDefaultAssetData, q as asBigInt, r as asMaybeBytesCls, s as asUint8Array, t as ApplicationCls, M as MAX_UINT64, u as ABI_RETURN_VALUE_LOG_PREFIX, v as lazyContext, T as TRANSACTION_GROUP_MAX_SIZE, w as Uint64, x as getRandomBigInt, y as asBigUintCls, z as BigUint, C as MAX_BYTES_SIZE, D as Bytes, E as Account, F as getRandomBytes, G as AssetCls, H as MAX_UINT512, I as MAX_UINT8, J as MAX_UINT16, K as MAX_UINT32, L as MAX_UINT128, N as MAX_UINT256, O as BITS_IN_BYTE, P as BaseContract, Q as ContextManager, R as DEFAULT_TEMPLATE_VAR_PREFIX } from './utils-fy0_Fvxl.js';
|
|
5
5
|
export { S as toExternalValue } from './utils-fy0_Fvxl.js';
|
|
6
6
|
import { I as InternalError, i as invariant } from './typescript-helpers-sobuICoc.js';
|
|
7
7
|
export { A as AssertError, a as AvmError, C as CodeError, N as NotImplementedError } from './typescript-helpers-sobuICoc.js';
|
|
8
8
|
import { Address as Address$1 } from '@algorandfoundation/algorand-typescript/arc4';
|
|
9
9
|
import { encodingUtil } from '@algorandfoundation/puya-ts';
|
|
10
|
-
import { G as GlobalData, V as VoterData, B as BlockData, b as btoi } from './pure-
|
|
11
|
-
import { t as toUint8Array, A as Address, U as Uint, D as DynamicBytes, S as Str } from './asset-params-
|
|
10
|
+
import { G as GlobalData, V as VoterData, B as BlockData, b as btoi } from './pure-62NpCdjh.js';
|
|
11
|
+
import { t as toUint8Array, A as Address, U as Uint, D as DynamicBytes, S as Str } from './asset-params-BpG3snO3.js';
|
|
12
12
|
import { randomBytes } from 'crypto';
|
|
13
13
|
import 'js-sha512';
|
|
14
14
|
import 'assert';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { encodingUtil } from '@algorandfoundation/puya-ts';
|
|
2
|
-
import { g as getContractMethodAbiMetadata, e as getArc4Selector, f as getGenericTypeInfo, a as getContractAbiMetadata } from './runtime-helpers-
|
|
3
|
-
import { s as sha512_256, a as toBytes, g as getEncoder, U as Uint, b as getArc4Encoded, m as getApp, l as encodeArc4, n as getAsset } from './asset-params-
|
|
2
|
+
import { g as getContractMethodAbiMetadata, e as getArc4Selector, f as getGenericTypeInfo, a as getContractAbiMetadata } from './runtime-helpers-BfpGXQyk.js';
|
|
3
|
+
import { s as sha512_256, a as toBytes, g as getEncoder, U as Uint, b as getArc4Encoded, m as getApp, l as encodeArc4, n as getAsset } from './asset-params-BpG3snO3.js';
|
|
4
4
|
import { D as Bytes, j as Application, w as Uint64, a as asNumber, v as lazyContext, a1 as combineIntoMaxBytePages, l as asUint64Cls, a2 as MAX_ITEMS_IN_LOG, f as asBytes, u as ABI_RETURN_VALUE_LOG_PREFIX, E as Account, g as Asset, F as getRandomBytes, r as asMaybeBytesCls, k as asMaybeUint64Cls, a3 as minLengthForType, a4 as MAX_BOX_SIZE, s as asUint8Array, a5 as asBytesCls, a6 as concatUint8Arrays, U as Uint64Cls, e as AccountMap, A as AccountCls, t as ApplicationCls, G as AssetCls, a7 as BytesMap, a8 as ContractOptionsSymbol, h as asUint64, a9 as asApplication, aa as asAsset, ab as asAccount } from './utils-fy0_Fvxl.js';
|
|
5
5
|
import { OnCompleteAction, TransactionType } from '@algorandfoundation/algorand-typescript';
|
|
6
6
|
import { I as InternalError, A as AssertError, C as CodeError, i as invariant } from './typescript-helpers-sobuICoc.js';
|
|
@@ -1205,4 +1205,4 @@ class ApplicationCallInnerTxnContext extends ApplicationCallInnerTxn {
|
|
|
1205
1205
|
}
|
|
1206
1206
|
|
|
1207
1207
|
export { ApplicationCallInnerTxnContext as A, Box as B, ContractContext as C, GlobalStateCls as G, ItxnParams as I, KeyRegistrationTransaction as K, LocalStateCls as L, PaymentTransaction as P, createInnerTxn as a, ApplicationCallTransaction as b, checkRoutingConditions as c, AssetConfigTransaction as d, AssetTransferTransaction as e, AssetFreezeTransaction as f, applicationCall as g, assetFreeze as h, assetTransfer as i, assetConfig as j, keyRegistration as k, BoxMap as l, methodSelector as m, GlobalState as n, LocalState as o, payment as p, submitGroup as s };
|
|
1208
|
-
//# sourceMappingURL=inner-transactions-
|
|
1208
|
+
//# sourceMappingURL=inner-transactions-DD57S6z9.js.map
|