@algorandfoundation/algorand-typescript-testing 1.0.0-beta.17 → 1.0.0-beta.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/README.md +79 -2
  2. package/{abi-metadata-CRbKDwP2.js → abi-metadata-BA4rupKi.js} +2 -2
  3. package/{abi-metadata-CRbKDwP2.js.map → abi-metadata-BA4rupKi.js.map} +1 -1
  4. package/{internal-arc4-DDw3e9T3.js → arc4-NIP5xu6D.js} +6 -6
  5. package/arc4-NIP5xu6D.js.map +1 -0
  6. package/{asset-params-BfwgiVLK.js → asset-params-C7s8ZU5u.js} +2 -2
  7. package/{asset-params-BfwgiVLK.js.map → asset-params-C7s8ZU5u.js.map} +1 -1
  8. package/context-helpers/context-manager.d.ts +1 -1
  9. package/{contract-B0nKfmx-.js → contract-G60Xb_gx.js} +3 -3
  10. package/{contract-B0nKfmx-.js.map → contract-G60Xb_gx.js.map} +1 -1
  11. package/{crypto-DmkHXzw6.js → crypto-BV_GljWM.js} +7 -10
  12. package/crypto-BV_GljWM.js.map +1 -0
  13. package/index.mjs +7 -8
  14. package/index.mjs.map +1 -1
  15. package/{inner-transactions-BoH3ye09.js → inner-transactions-BAfZjF8Z.js} +4 -4
  16. package/{inner-transactions-BoH3ye09.js.map → inner-transactions-BAfZjF8Z.js.map} +1 -1
  17. package/internal/arc4.d.ts +2 -0
  18. package/internal/arc4.mjs +3 -4
  19. package/internal/arc4.mjs.map +1 -1
  20. package/internal/index.d.ts +36 -0
  21. package/{internal.mjs → internal/index.mjs} +13 -14
  22. package/internal/index.mjs.map +1 -0
  23. package/internal/op.d.ts +19 -0
  24. package/internal/op.mjs +3 -4
  25. package/internal/op.mjs.map +1 -1
  26. package/{internal-op-CABGy0tk.js → op-D2giGNOW.js} +7 -7
  27. package/op-D2giGNOW.js.map +1 -0
  28. package/package.json +14 -10
  29. package/{test-transformer/index.mjs → program-factory-DcJH2vdq.js} +11 -54
  30. package/program-factory-DcJH2vdq.js.map +1 -0
  31. package/{runtime-helpers-KXJavAF1.js → runtime-helpers-Clcv2xyQ.js} +3 -3
  32. package/{runtime-helpers-KXJavAF1.js.map → runtime-helpers-Clcv2xyQ.js.map} +1 -1
  33. package/runtime-helpers.mjs +3 -4
  34. package/runtime-helpers.mjs.map +1 -1
  35. package/test-transformer/jest-transformer.d.ts +37 -0
  36. package/test-transformer/jest-transformer.mjs +52 -0
  37. package/test-transformer/jest-transformer.mjs.map +1 -0
  38. package/test-transformer/program-factory.d.ts +7 -0
  39. package/test-transformer/visitors.d.ts +1 -1
  40. package/test-transformer/{index.d.ts → vitest-transformer.d.ts} +5 -6
  41. package/test-transformer/vitest-transformer.mjs +56 -0
  42. package/test-transformer/vitest-transformer.mjs.map +1 -0
  43. package/crypto-DmkHXzw6.js.map +0 -1
  44. package/internal-arc4-DDw3e9T3.js.map +0 -1
  45. package/internal-arc4.d.ts +0 -2
  46. package/internal-op-CABGy0tk.js.map +0 -1
  47. package/internal-op.d.ts +0 -19
  48. package/internal.d.ts +0 -36
  49. package/internal.mjs.map +0 -1
  50. package/test-transformer/index.mjs.map +0 -1
package/README.md CHANGED
@@ -42,12 +42,14 @@ npm i @algorandfoundation/algorand-typescript-testing
42
42
 
43
43
  Let's write a simple contract and test it using the `algorand-typescript-testing` framework.
44
44
 
45
+ #### Configuring vitest
46
+
45
47
  If you are using [vitest](https://vitest.dev/) with [@rollup/plugin-typescript](https://www.npmjs.com/package/@rollup/plugin-typescript) plugin, configure `puyaTsTransformer` as a `before` stage transformer of `typescript` plugin in `vitest.config.mts` file.
46
48
 
47
49
  ```typescript
48
50
  import typescript from '@rollup/plugin-typescript'
49
51
  import { defineConfig } from 'vitest/config'
50
- import { puyaTsTransformer } from '@algorandfoundation/algorand-typescript-testing/test-transformer'
52
+ import { puyaTsTransformer } from '@algorandfoundation/algorand-typescript-testing/vitest-transformer'
51
53
 
52
54
  export default defineConfig({
53
55
  esbuild: {},
@@ -56,7 +58,6 @@ export default defineConfig({
56
58
  },
57
59
  plugins: [
58
60
  typescript({
59
- tsconfig: './tsconfig.json',
60
61
  transformers: {
61
62
  before: [puyaTsTransformer],
62
63
  },
@@ -76,6 +77,82 @@ beforeAll(() => {
76
77
  })
77
78
  ```
78
79
 
80
+ #### Configuring jest
81
+
82
+ If you are using [jest](https://jestjs.io/) with [ts-jest](https://www.npmjs.com/package/ts-jest), [@jest/globals](https://www.npmjs.com/package/@jest/globals) and [ts-node](https://www.npmjs.com/package/ts-node) plugins, configure `puyaTsTransformer` as a `before` stage transformer of `typescript` plugin in `jest.config.ts` file.
83
+
84
+ ```typescript
85
+ import { createDefaultEsmPreset, type JestConfigWithTsJest } from 'ts-jest'
86
+
87
+ const presetConfig = createDefaultEsmPreset({})
88
+ const jestConfig: JestConfigWithTsJest = {
89
+ ...presetConfig,
90
+ testMatch: ['**/*.test.ts'],
91
+ setupFilesAfterEnv: ['<rootDir>/jest.setup.ts'],
92
+ transform: {
93
+ '^.+\\.tsx?$': [
94
+ 'ts-jest',
95
+ {
96
+ useESM: true,
97
+ astTransformers: {
98
+ before: ['node_modules/@algorandfoundation/algorand-typescript-testing/test-transformer/jest-transformer.mjs'],
99
+ },
100
+ },
101
+ ],
102
+ },
103
+ extensionsToTreatAsEsm: ['.ts'],
104
+ }
105
+ export default jestConfig
106
+ ```
107
+
108
+ `algorand-typescript-testing` package also exposes additional equality testers which enables the smart contract developers to write terser test by avoiding type casting in assertions. It can setup in `beforeAll` hook point in the setup file, `jest.setup.ts`.
109
+
110
+ ```typescript
111
+ import { beforeAll, expect } from '@jest/globals'
112
+ import { addEqualityTesters } from '@algorandfoundation/algorand-typescript-testing'
113
+
114
+ beforeAll(() => {
115
+ addEqualityTesters({ expect })
116
+ })
117
+ ```
118
+
119
+ It is also handy to add in a script to run `jest` with `--experimental-vm-modules` flag in `package.json`.
120
+
121
+ ```json
122
+ {
123
+ "name": "puya-ts-demo",
124
+ "scripts": {
125
+ "test:jest": "tsc && node --experimental-vm-modules node_modules/jest/bin/jest"
126
+ }
127
+ }
128
+ ```
129
+
130
+ There is also a patch file `ts-jest+29.2.5.patch` that needs to be applied to `ts-jest` package to for the `puyaTsTransformer` to work with the test files.
131
+
132
+ 1. Place the file in `<rootDir>\patches` folder.
133
+ 1. Install [patch-package](https://www.npmjs.com/package/patch-package) package as a dev dependency.
134
+ 1. Add `"postinstall": "patch-package",` script in `package.json` file.
135
+ The patch will then be applied with every `npm install` call.
136
+
137
+ ```patch
138
+ diff --git a/node_modules/ts-jest/dist/legacy/compiler/ts-compiler.js b/node_modules/ts-jest/dist/legacy/compiler/ts-compiler.js
139
+ index 5198f8f..addb47c 100644
140
+ --- a/node_modules/ts-jest/dist/legacy/compiler/ts-compiler.js
141
+ +++ b/node_modules/ts-jest/dist/legacy/compiler/ts-compiler.js
142
+ @@ -234,7 +234,7 @@ var TsCompiler = /** @class */ (function () {
143
+ var _a;
144
+ // Initialize memory cache for typescript compiler
145
+ this._parsedTsConfig.fileNames
146
+ - .filter(function (fileName) { return constants_1.TS_TSX_REGEX.test(fileName) && !_this.configSet.isTestFile(fileName); })
147
+ + .filter(function (fileName) { return constants_1.TS_TSX_REGEX.test(fileName); })
148
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
149
+ .forEach(function (fileName) { return _this._fileVersionCache.set(fileName, 0); });
150
+ /* istanbul ignore next */
151
+
152
+ ```
153
+
154
+ After the setup, the examples provided using `vitest` can be converted to work with `jest` by simply swapping the `import {...} from 'vitest'` with `import {...} from '@jest/globals'`.
155
+
79
156
  #### Contract Definition
80
157
 
81
158
  ```typescript
@@ -1,5 +1,5 @@
1
1
  import js_sha512 from 'js-sha512';
2
- import { al as getArc4TypeName$1 } from './crypto-DmkHXzw6.js';
2
+ import { al as getArc4TypeName$1 } from './crypto-BV_GljWM.js';
3
3
 
4
4
  const AbiMetaSymbol = Symbol('AbiMetadata');
5
5
  const isContractProxy = Symbol('isContractProxy');
@@ -87,4 +87,4 @@ const getArc4TypeName = (t) => {
87
87
  };
88
88
 
89
89
  export { getContractMethodAbiMetadata as a, getContractAbiMetadata as b, copyAbiMetadatas as c, attachAbiMetadata as d, captureMethodConfig as e, getArc4Selector as g, isContractProxy as i };
90
- //# sourceMappingURL=abi-metadata-CRbKDwP2.js.map
90
+ //# sourceMappingURL=abi-metadata-BA4rupKi.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"abi-metadata-CRbKDwP2.js","sources":["../src/abi-metadata.ts"],"sourcesContent":["import type { BaseContract, Contract } from '@algorandfoundation/algorand-typescript'\nimport type { AbiMethodConfig, BareMethodConfig, CreateOptions, OnCompleteActionStr } from '@algorandfoundation/algorand-typescript/arc4'\nimport js_sha512 from 'js-sha512'\nimport type { TypeInfo } from './encoders'\nimport { getArc4TypeName as getArc4TypeNameForARC4Encoded } from './impl/encoded-types'\nimport type { DeliberateAny } from './typescript-helpers'\n\nexport interface AbiMetadata {\n methodName: string\n methodSignature: string | undefined\n argTypes: string[]\n returnType: string\n onCreate?: CreateOptions\n allowActions?: OnCompleteActionStr[]\n}\nconst AbiMetaSymbol = Symbol('AbiMetadata')\nexport const isContractProxy = Symbol('isContractProxy')\nexport const attachAbiMetadata = (contract: { new (): Contract }, methodName: string, metadata: AbiMetadata): void => {\n const metadatas: Record<string, AbiMetadata> = (AbiMetaSymbol in contract ? contract[AbiMetaSymbol] : {}) as Record<string, AbiMetadata>\n metadatas[methodName] = metadata\n if (!(AbiMetaSymbol in contract)) {\n Object.defineProperty(contract, AbiMetaSymbol, {\n value: metadatas,\n writable: true,\n enumerable: false,\n })\n }\n}\n\nexport const copyAbiMetadatas = <T extends BaseContract>(sourceContract: T, targetContract: T): void => {\n const metadatas = getContractAbiMetadata(sourceContract)\n Object.defineProperty(targetContract, AbiMetaSymbol, {\n value: metadatas,\n writable: true,\n enumerable: false,\n })\n}\n\nexport const captureMethodConfig = <T extends Contract>(\n contract: T,\n methodName: string,\n config?: AbiMethodConfig<T> | BareMethodConfig,\n): void => {\n const metadata = getContractMethodAbiMetadata(contract, methodName)\n metadata.onCreate = config?.onCreate ?? 'disallow'\n metadata.allowActions = ([] as OnCompleteActionStr[]).concat(config?.allowActions ?? 'NoOp')\n}\n\nexport const hasAbiMetadata = <T extends Contract>(contract: T): boolean => {\n const contractClass = contract.constructor as { new (): T }\n return (\n Object.getOwnPropertySymbols(contractClass).some((s) => s.toString() === AbiMetaSymbol.toString()) || AbiMetaSymbol in contractClass\n )\n}\nexport const getContractAbiMetadata = <T extends BaseContract>(contract: T): Record<string, AbiMetadata> => {\n if ((contract as DeliberateAny)[isContractProxy]) {\n return (contract as DeliberateAny)[AbiMetaSymbol] as Record<string, AbiMetadata>\n }\n const contractClass = contract.constructor as { new (): T }\n const s = Object.getOwnPropertySymbols(contractClass).find((s) => s.toString() === AbiMetaSymbol.toString())\n const metadatas: Record<string, AbiMetadata> = (\n s ? (contractClass as DeliberateAny)[s] : AbiMetaSymbol in contractClass ? contractClass[AbiMetaSymbol] : {}\n ) as Record<string, AbiMetadata>\n return metadatas\n}\n\nexport const getContractMethodAbiMetadata = <T extends BaseContract>(contract: T, methodName: string): AbiMetadata => {\n const metadatas = getContractAbiMetadata(contract)\n return metadatas[methodName]\n}\n\nexport const getArc4Signature = (metadata: AbiMetadata): string => {\n if (metadata.methodSignature === undefined) {\n const argTypes = metadata.argTypes.map((t) => JSON.parse(t) as TypeInfo).map(getArc4TypeName)\n const returnType = getArc4TypeName(JSON.parse(metadata.returnType) as TypeInfo)\n metadata.methodSignature = `${metadata.methodName}(${argTypes.join(',')})${returnType}`\n }\n return metadata.methodSignature\n}\n\nexport const getArc4Selector = (metadata: AbiMetadata): Uint8Array => {\n const hash = js_sha512.sha512_256.array(getArc4Signature(metadata))\n return new Uint8Array(hash.slice(0, 4))\n}\n\nconst getArc4TypeName = (t: TypeInfo): string => {\n const map: Record<string, string | ((t: TypeInfo) => string)> = {\n void: 'void',\n account: 'account',\n application: 'application',\n asset: 'asset',\n boolean: 'bool',\n biguint: 'uint512',\n bytes: 'byte[]',\n string: 'string',\n uint64: 'uint64',\n OnCompleteAction: 'uint64',\n TransactionType: 'uint64',\n Transaction: 'txn',\n PaymentTxn: 'pay',\n KeyRegistrationTxn: 'keyreg',\n AssetConfigTxn: 'acfg',\n AssetTransferTxn: 'axfer',\n AssetFreezeTxn: 'afrz',\n ApplicationTxn: 'appl',\n 'Tuple(<.*>)?': (t) =>\n `(${Object.values(t.genericArgs as Record<string, TypeInfo>)\n .map(getArc4TypeName)\n .join(',')})`,\n }\n const entry = Object.entries(map).find(([k, _]) => new RegExp(`^${k}$`, 'i').test(t.name))?.[1]\n if (entry === undefined) {\n return getArc4TypeNameForARC4Encoded(t) ?? t.name\n }\n if (entry instanceof Function) {\n return entry(t)\n }\n return entry\n}\n"],"names":["getArc4TypeNameForARC4Encoded"],"mappings":";;;AAeA,MAAM,aAAa,GAAG,MAAM,CAAC,aAAa,CAAC;MAC9B,eAAe,GAAG,MAAM,CAAC,iBAAiB;AAC1C,MAAA,iBAAiB,GAAG,CAAC,QAA8B,EAAE,UAAkB,EAAE,QAAqB,KAAU;AACnH,IAAA,MAAM,SAAS,IAAiC,aAAa,IAAI,QAAQ,GAAG,QAAQ,CAAC,aAAa,CAAC,GAAG,EAAE,CAAgC;AACxI,IAAA,SAAS,CAAC,UAAU,CAAC,GAAG,QAAQ;AAChC,IAAA,IAAI,EAAE,aAAa,IAAI,QAAQ,CAAC,EAAE;AAChC,QAAA,MAAM,CAAC,cAAc,CAAC,QAAQ,EAAE,aAAa,EAAE;AAC7C,YAAA,KAAK,EAAE,SAAS;AAChB,YAAA,QAAQ,EAAE,IAAI;AACd,YAAA,UAAU,EAAE,KAAK;AAClB,SAAA,CAAC;;AAEN;MAEa,gBAAgB,GAAG,CAAyB,cAAiB,EAAE,cAAiB,KAAU;AACrG,IAAA,MAAM,SAAS,GAAG,sBAAsB,CAAC,cAAc,CAAC;AACxD,IAAA,MAAM,CAAC,cAAc,CAAC,cAAc,EAAE,aAAa,EAAE;AACnD,QA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;AACzB,QAAA,cAAc,EAAE,MAAM;AACtB,QAAA,cAAc,EAAE,MAAM;AACtB,QAAA,cAAc,EAAE,CAAC,CAAC,KAChB,CAAA,CAAA,EAAI,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,WAAuC;aACxD,GAAG,CAAC,eAAe;aACnB,IAAI,CAAC,GAAG,CAAC,CAAG,CAAA,CAAA;KAClB;AACD,IAAA,MAAM,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,IAAI,MAAM,CAAC,CAAI,CAAA,EAAA,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;AAC/F,IAAA,IAAI,KAAK,KAAK,SAAS,EAAE;QACvB,OAAOA,iBAA6B,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI;;AAEnD,IAAA,IAAI,KAAK,YAAY,QAAQ,EAAE;AAC7B,QAAA,OAAO,KAAK,CAAC,CAAC,CAAC;;AAEjB,IAAA,OAAO,KAAK;AACd,CAAC;;;;"}
1
+ {"version":3,"file":"abi-metadata-BA4rupKi.js","sources":["../src/abi-metadata.ts"],"sourcesContent":["import type { BaseContract, Contract } from '@algorandfoundation/algorand-typescript'\nimport type { AbiMethodConfig, BareMethodConfig, CreateOptions, OnCompleteActionStr } from '@algorandfoundation/algorand-typescript/arc4'\nimport js_sha512 from 'js-sha512'\nimport type { TypeInfo } from './encoders'\nimport { getArc4TypeName as getArc4TypeNameForARC4Encoded } from './impl/encoded-types'\nimport type { DeliberateAny } from './typescript-helpers'\n\nexport interface AbiMetadata {\n methodName: string\n methodSignature: string | undefined\n argTypes: string[]\n returnType: string\n onCreate?: CreateOptions\n allowActions?: OnCompleteActionStr[]\n}\nconst AbiMetaSymbol = Symbol('AbiMetadata')\nexport const isContractProxy = Symbol('isContractProxy')\nexport const attachAbiMetadata = (contract: { new (): Contract }, methodName: string, metadata: AbiMetadata): void => {\n const metadatas: Record<string, AbiMetadata> = (AbiMetaSymbol in contract ? contract[AbiMetaSymbol] : {}) as Record<string, AbiMetadata>\n metadatas[methodName] = metadata\n if (!(AbiMetaSymbol in contract)) {\n Object.defineProperty(contract, AbiMetaSymbol, {\n value: metadatas,\n writable: true,\n enumerable: false,\n })\n }\n}\n\nexport const copyAbiMetadatas = <T extends BaseContract>(sourceContract: T, targetContract: T): void => {\n const metadatas = getContractAbiMetadata(sourceContract)\n Object.defineProperty(targetContract, AbiMetaSymbol, {\n value: metadatas,\n writable: true,\n enumerable: false,\n })\n}\n\nexport const captureMethodConfig = <T extends Contract>(\n contract: T,\n methodName: string,\n config?: AbiMethodConfig<T> | BareMethodConfig,\n): void => {\n const metadata = getContractMethodAbiMetadata(contract, methodName)\n metadata.onCreate = config?.onCreate ?? 'disallow'\n metadata.allowActions = ([] as OnCompleteActionStr[]).concat(config?.allowActions ?? 'NoOp')\n}\n\nexport const hasAbiMetadata = <T extends Contract>(contract: T): boolean => {\n const contractClass = contract.constructor as { new (): T }\n return (\n Object.getOwnPropertySymbols(contractClass).some((s) => s.toString() === AbiMetaSymbol.toString()) || AbiMetaSymbol in contractClass\n )\n}\nexport const getContractAbiMetadata = <T extends BaseContract>(contract: T): Record<string, AbiMetadata> => {\n if ((contract as DeliberateAny)[isContractProxy]) {\n return (contract as DeliberateAny)[AbiMetaSymbol] as Record<string, AbiMetadata>\n }\n const contractClass = contract.constructor as { new (): T }\n const s = Object.getOwnPropertySymbols(contractClass).find((s) => s.toString() === AbiMetaSymbol.toString())\n const metadatas: Record<string, AbiMetadata> = (\n s ? (contractClass as DeliberateAny)[s] : AbiMetaSymbol in contractClass ? contractClass[AbiMetaSymbol] : {}\n ) as Record<string, AbiMetadata>\n return metadatas\n}\n\nexport const getContractMethodAbiMetadata = <T extends BaseContract>(contract: T, methodName: string): AbiMetadata => {\n const metadatas = getContractAbiMetadata(contract)\n return metadatas[methodName]\n}\n\nexport const getArc4Signature = (metadata: AbiMetadata): string => {\n if (metadata.methodSignature === undefined) {\n const argTypes = metadata.argTypes.map((t) => JSON.parse(t) as TypeInfo).map(getArc4TypeName)\n const returnType = getArc4TypeName(JSON.parse(metadata.returnType) as TypeInfo)\n metadata.methodSignature = `${metadata.methodName}(${argTypes.join(',')})${returnType}`\n }\n return metadata.methodSignature\n}\n\nexport const getArc4Selector = (metadata: AbiMetadata): Uint8Array => {\n const hash = js_sha512.sha512_256.array(getArc4Signature(metadata))\n return new Uint8Array(hash.slice(0, 4))\n}\n\nconst getArc4TypeName = (t: TypeInfo): string => {\n const map: Record<string, string | ((t: TypeInfo) => string)> = {\n void: 'void',\n account: 'account',\n application: 'application',\n asset: 'asset',\n boolean: 'bool',\n biguint: 'uint512',\n bytes: 'byte[]',\n string: 'string',\n uint64: 'uint64',\n OnCompleteAction: 'uint64',\n TransactionType: 'uint64',\n Transaction: 'txn',\n PaymentTxn: 'pay',\n KeyRegistrationTxn: 'keyreg',\n AssetConfigTxn: 'acfg',\n AssetTransferTxn: 'axfer',\n AssetFreezeTxn: 'afrz',\n ApplicationTxn: 'appl',\n 'Tuple(<.*>)?': (t) =>\n `(${Object.values(t.genericArgs as Record<string, TypeInfo>)\n .map(getArc4TypeName)\n .join(',')})`,\n }\n const entry = Object.entries(map).find(([k, _]) => new RegExp(`^${k}$`, 'i').test(t.name))?.[1]\n if (entry === undefined) {\n return getArc4TypeNameForARC4Encoded(t) ?? t.name\n }\n if (entry instanceof Function) {\n return entry(t)\n }\n return entry\n}\n"],"names":["getArc4TypeNameForARC4Encoded"],"mappings":";;;AAeA,MAAM,aAAa,GAAG,MAAM,CAAC,aAAa,CAAC;MAC9B,eAAe,GAAG,MAAM,CAAC,iBAAiB;AAC1C,MAAA,iBAAiB,GAAG,CAAC,QAA8B,EAAE,UAAkB,EAAE,QAAqB,KAAU;AACnH,IAAA,MAAM,SAAS,IAAiC,aAAa,IAAI,QAAQ,GAA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AACd,CAAC;;;;"}
@@ -1,5 +1,5 @@
1
- import * as arc4 from '@algorandfoundation/algorand-typescript/arc4';
2
- import { C as Contract, a as abimethod, m as methodSelector } from './contract-B0nKfmx-.js';
1
+ import * as arc4$1 from '@algorandfoundation/algorand-typescript/arc4';
2
+ import { C as Contract, a as abimethod, m as methodSelector } from './contract-G60Xb_gx.js';
3
3
 
4
4
  function _mergeNamespaces(n, m) {
5
5
  m.forEach(function (e) {
@@ -16,12 +16,12 @@ function _mergeNamespaces(n, m) {
16
16
  return Object.freeze(n);
17
17
  }
18
18
 
19
- var internalArc4 = /*#__PURE__*/_mergeNamespaces({
19
+ var arc4 = /*#__PURE__*/_mergeNamespaces({
20
20
  __proto__: null,
21
21
  Contract: Contract,
22
22
  abimethod: abimethod,
23
23
  methodSelector: methodSelector
24
- }, [arc4]);
24
+ }, [arc4$1]);
25
25
 
26
- export { internalArc4 as i };
27
- //# sourceMappingURL=internal-arc4-DDw3e9T3.js.map
26
+ export { arc4 as a };
27
+ //# sourceMappingURL=arc4-NIP5xu6D.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"arc4-NIP5xu6D.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,6 +1,6 @@
1
1
  import { ARC4Encoded } from '@algorandfoundation/algorand-typescript/arc4';
2
2
  import { encodingUtil } from '@algorandfoundation/puya-ts';
3
- import { q as asMaybeUint64Cls, y as asMaybeBytesCls, a8 as asMaybeBigUintCls, a5 as BytesBackedCls, a6 as Uint64BackedCls, r as asUint64Cls, aq as encodeArc4Impl, I as InternalError, aj as nameOfType, aB as getArc4Encoder, A as AccountCls, f as ApplicationCls, g as AssetCls, aA as arc4Encoders, z as asUint8Array, K as BigUint, x as asBytes, G as Uint64, l as lazyContext, O as getRandomBytes, o as asUint64, N as Account, aN as getObjectReference, h as Bytes, aK as sha256, aO as getApplicationAddress, aP as MIN_TXN_FEE, aQ as DEFAULT_ACCOUNT_MIN_BALANCE, aR as DEFAULT_MAX_TXN_LIFE, aS as ZERO_ADDRESS, aT as DEFAULT_ASSET_CREATE_MIN_BALANCE, aU as DEFAULT_ASSET_OPT_IN_MIN_BALANCE, aV as DEFAULT_GLOBAL_GENESIS_HASH, U as Uint64Cls, a as BytesCls, a2 as AvmError, B as BigUintCls, an as checkBigUint, aW as asBigUint, _ as BITS_IN_BYTE, L as MAX_BYTES_SIZE, C as CodeError, aX as isUint64, ad as asBytesCls, F as testInvariant, S as MAX_UINT8, aY as binaryStringToBytes, aZ as UINT64_SIZE, a3 as NotImplementedError, M as MAX_UINT64 } from './crypto-DmkHXzw6.js';
3
+ import { q as asMaybeUint64Cls, y as asMaybeBytesCls, a8 as asMaybeBigUintCls, a5 as BytesBackedCls, a6 as Uint64BackedCls, r as asUint64Cls, aq as encodeArc4Impl, I as InternalError, aj as nameOfType, aB as getArc4Encoder, A as AccountCls, f as ApplicationCls, g as AssetCls, aA as arc4Encoders, z as asUint8Array, K as BigUint, x as asBytes, G as Uint64, l as lazyContext, O as getRandomBytes, o as asUint64, N as Account, aN as getObjectReference, h as Bytes, aK as sha256, aO as getApplicationAddress, aP as MIN_TXN_FEE, aQ as DEFAULT_ACCOUNT_MIN_BALANCE, aR as DEFAULT_MAX_TXN_LIFE, aS as ZERO_ADDRESS, aT as DEFAULT_ASSET_CREATE_MIN_BALANCE, aU as DEFAULT_ASSET_OPT_IN_MIN_BALANCE, aV as DEFAULT_GLOBAL_GENESIS_HASH, U as Uint64Cls, a as BytesCls, a2 as AvmError, B as BigUintCls, an as checkBigUint, aW as asBigUint, _ as BITS_IN_BYTE, L as MAX_BYTES_SIZE, C as CodeError, aX as isUint64, ad as asBytesCls, F as testInvariant, S as MAX_UINT8, aY as binaryStringToBytes, aZ as UINT64_SIZE, a3 as NotImplementedError, M as MAX_UINT64 } from './crypto-BV_GljWM.js';
4
4
  import { Base64 } from '@algorandfoundation/algorand-typescript';
5
5
 
6
6
  const booleanFromBytes = (val) => {
@@ -842,4 +842,4 @@ const AssetParams = {
842
842
  };
843
843
 
844
844
  export { AcctParams as A, BlockData as B, extractUint64 as C, getBit as D, getByte as E, itob as F, GlobalData as G, len as H, minBalance as I, JsonRef as J, mulw as K, replace as L, select as M, setBit as N, setByte as O, shl as P, shr as Q, sqrt as R, substring as S, VoterData as V, Global as a, btoi as b, getAsset as c, getApp as d, getAccount as e, AppParams as f, getEncoder as g, AssetParams as h, Block as i, VoterParams as j, addw as k, appOptedIn as l, balance as m, base64Decode as n, bitLength as o, bsqrt as p, bzero as q, concat as r, divmodw as s, toBytes as t, divw as u, exp as v, expw as w, extract as x, extractUint16 as y, extractUint32 as z };
845
- //# sourceMappingURL=asset-params-BfwgiVLK.js.map
845
+ //# sourceMappingURL=asset-params-C7s8ZU5u.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"asset-params-BfwgiVLK.js","sources":["../src/encoders.ts","../src/impl/block.ts","../src/impl/global.ts","../src/impl/app-params.ts","../src/impl/acct-params.ts","../src/impl/voter-params.ts","../src/impl/pure.ts","../src/impl/asset-params.ts"],"sourcesContent":["import type { biguint, bytes, TransactionType, uint64 } from '@algorandfoundation/algorand-typescript'\nimport type { OnCompleteAction } from '@algorandfoundation/algorand-typescript/arc4'\nimport { ARC4Encoded } from '@algorandfoundation/algorand-typescript/arc4'\nimport { encodingUtil } from '@algorandfoundation/puya-ts'\nimport { InternalError } from './errors'\nimport { BytesBackedCls, Uint64BackedCls } from './impl/base'\nimport { arc4Encoders, encodeArc4Impl, getArc4Encoder } from './impl/encoded-types'\nimport { BigUint, Uint64, type StubBytesCompat } from './impl/primitives'\nimport { AccountCls, ApplicationCls, AssetCls } from './impl/reference'\nimport type { DeliberateAny } from './typescript-helpers'\nimport { asBytes, asMaybeBigUintCls, asMaybeBytesCls, asMaybeUint64Cls, asUint64Cls, asUint8Array, nameOfType } from './util'\n\nexport type TypeInfo = {\n name: string\n genericArgs?: TypeInfo[] | Record<string, TypeInfo>\n}\n\nexport type fromBytes<T> = (val: Uint8Array | StubBytesCompat, typeInfo: TypeInfo, prefix?: 'none' | 'log') => T\n\nconst booleanFromBytes: fromBytes<boolean> = (val) => {\n return encodingUtil.uint8ArrayToBigInt(asUint8Array(val)) > 0n\n}\n\nconst bigUintFromBytes: fromBytes<biguint> = (val) => {\n return BigUint(encodingUtil.uint8ArrayToBigInt(asUint8Array(val)))\n}\n\nconst bytesFromBytes: fromBytes<bytes> = (val) => {\n return asBytes(val)\n}\n\nconst stringFromBytes: fromBytes<string> = (val) => {\n return asBytes(val).toString()\n}\n\nconst uint64FromBytes: fromBytes<uint64> = (val) => {\n return Uint64(encodingUtil.uint8ArrayToBigInt(asUint8Array(val)))\n}\n\nconst onCompletionFromBytes: fromBytes<OnCompleteAction> = (val) => {\n return Uint64(encodingUtil.uint8ArrayToBigInt(asUint8Array(val))) as OnCompleteAction\n}\n\nconst transactionTypeFromBytes: fromBytes<TransactionType> = (val) => {\n return Uint64(encodingUtil.uint8ArrayToBigInt(asUint8Array(val))) as TransactionType\n}\n\nexport 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 ...arc4Encoders,\n}\n\nexport const getEncoder = <T>(typeInfo: TypeInfo): fromBytes<T> => {\n return getArc4Encoder<T>(typeInfo, encoders)\n}\n\nexport const toBytes = (val: unknown): bytes => {\n const uint64Val = asMaybeUint64Cls(val)\n if (uint64Val !== undefined) {\n return uint64Val.toBytes().asAlgoTs()\n }\n const bytesVal = asMaybeBytesCls(val)\n if (bytesVal !== undefined) {\n return bytesVal.asAlgoTs()\n }\n const bigUintVal = asMaybeBigUintCls(val)\n if (bigUintVal !== undefined) {\n return bigUintVal.toBytes().asAlgoTs()\n }\n if (val instanceof BytesBackedCls) {\n return val.bytes\n }\n if (val instanceof Uint64BackedCls) {\n return asUint64Cls(val.uint64).toBytes().asAlgoTs()\n }\n if (val instanceof ARC4Encoded) {\n return val.bytes\n }\n if (Array.isArray(val) || typeof val === 'object') {\n return encodeArc4Impl('', val)\n }\n throw new InternalError(`Invalid type for bytes: ${nameOfType(val)}`)\n}\n","import type { Account as AccountType, bytes, op, uint64 } from '@algorandfoundation/algorand-typescript'\nimport { lazyContext } from '../context-helpers/internal-context'\nimport { asUint64, getRandomBytes } from '../util'\nimport { Uint64, type StubUint64Compat } from './primitives'\nimport { Account } from './reference'\n\nexport class BlockData {\n seed: bytes\n timestamp: uint64\n proposer: AccountType\n feesCollected: uint64\n bonus: uint64\n branch: bytes\n feeSink: AccountType\n protocol: bytes\n txnCounter: uint64\n proposerPayout: uint64\n\n constructor() {\n this.seed = getRandomBytes(32).asAlgoTs()\n this.timestamp = asUint64(Date.now())\n this.proposer = Account()\n this.feesCollected = Uint64(0)\n this.bonus = Uint64(0)\n this.branch = getRandomBytes(32).asAlgoTs()\n this.feeSink = Account()\n this.protocol = getRandomBytes(32).asAlgoTs()\n this.txnCounter = Uint64(0)\n this.proposerPayout = Uint64(0)\n }\n}\n\nexport const Block: typeof op.Block = {\n blkSeed: function (a: StubUint64Compat): bytes {\n return lazyContext.ledger.getBlockData(a).seed\n },\n blkTimestamp: function (a: StubUint64Compat): uint64 {\n return lazyContext.ledger.getBlockData(a).timestamp\n },\n blkProposer: function (a: uint64): AccountType {\n return lazyContext.ledger.getBlockData(a).proposer\n },\n blkFeesCollected: function (a: uint64): uint64 {\n return lazyContext.ledger.getBlockData(a).feesCollected\n },\n blkBonus: function (a: uint64): uint64 {\n return lazyContext.ledger.getBlockData(a).bonus\n },\n blkBranch: function (a: uint64): bytes {\n return lazyContext.ledger.getBlockData(a).branch\n },\n blkFeeSink: function (a: uint64): AccountType {\n return lazyContext.ledger.getBlockData(a).feeSink\n },\n blkProtocol: function (a: uint64): bytes {\n return lazyContext.ledger.getBlockData(a).protocol\n },\n blkTxnCounter: function (a: uint64): uint64 {\n return lazyContext.ledger.getBlockData(a).txnCounter\n },\n blkProposerPayout: function (a: uint64): uint64 {\n return lazyContext.ledger.getBlockData(a).proposerPayout\n },\n}\n","import type { Account as AccountType, Application as ApplicationType, bytes, op, uint64 } from '@algorandfoundation/algorand-typescript'\nimport { encodingUtil } from '@algorandfoundation/puya-ts'\nimport {\n DEFAULT_ACCOUNT_MIN_BALANCE,\n DEFAULT_ASSET_CREATE_MIN_BALANCE,\n DEFAULT_ASSET_OPT_IN_MIN_BALANCE,\n DEFAULT_GLOBAL_GENESIS_HASH,\n DEFAULT_MAX_TXN_LIFE,\n MIN_TXN_FEE,\n ZERO_ADDRESS,\n} from '../constants'\nimport { lazyContext } from '../context-helpers/internal-context'\nimport { InternalError } from '../errors'\nimport { getObjectReference } from '../util'\nimport { sha256 } from './crypto'\nimport { Bytes, Uint64 } from './primitives'\nimport { Account, getApplicationAddress } from './reference'\n\nexport class GlobalData {\n minTxnFee: uint64\n minBalance: uint64\n maxTxnLife: uint64\n zeroAddress: AccountType\n logicSigVersion?: uint64\n round?: uint64\n latestTimestamp?: uint64\n groupId?: bytes\n callerApplicationId: uint64\n assetCreateMinBalance: uint64\n assetOptInMinBalance: uint64\n genesisHash: bytes\n opcodeBudget?: uint64\n payoutsEnabled: boolean\n payoutsGoOnlineFee: uint64\n payoutsPercent: uint64\n payoutsMinBalance: uint64\n\n constructor() {\n this.minTxnFee = Uint64(MIN_TXN_FEE)\n this.minBalance = Uint64(DEFAULT_ACCOUNT_MIN_BALANCE)\n this.maxTxnLife = Uint64(DEFAULT_MAX_TXN_LIFE)\n this.zeroAddress = Account(ZERO_ADDRESS)\n this.callerApplicationId = Uint64(0)\n this.assetCreateMinBalance = Uint64(DEFAULT_ASSET_CREATE_MIN_BALANCE)\n this.assetOptInMinBalance = Uint64(DEFAULT_ASSET_OPT_IN_MIN_BALANCE)\n this.genesisHash = DEFAULT_GLOBAL_GENESIS_HASH\n this.payoutsEnabled = false\n this.payoutsGoOnlineFee = Uint64(0)\n this.payoutsPercent = Uint64(0)\n this.payoutsMinBalance = Uint64(0)\n }\n}\nconst getGlobalData = (): GlobalData => {\n return lazyContext.ledger.globalData\n}\n\nconst getMissingValueErrorMessage = (name: keyof GlobalData) =>\n `'Global' object has no value set for attribute named '${name}'. Use \\`context.ledger.patchGlobalData({${name}: your_value})\\` to set the value in your test setup.\"`\n\nexport const Global: typeof op.Global = {\n /**\n * microalgos\n */\n get minTxnFee(): uint64 {\n return getGlobalData().minTxnFee\n },\n\n /**\n * microalgos\n */\n get minBalance(): uint64 {\n return getGlobalData().minBalance\n },\n\n /**\n * rounds\n */\n get maxTxnLife(): uint64 {\n return getGlobalData().maxTxnLife\n },\n\n /**\n * 32 byte address of all zero bytes\n */\n get zeroAddress(): AccountType {\n return getGlobalData().zeroAddress\n },\n\n /**\n * Number of transactions in this atomic transaction group. At least 1\n */\n get groupSize(): uint64 {\n const currentTransactionGroup = lazyContext.activeGroup.transactions\n return Uint64(currentTransactionGroup.length)\n },\n\n /**\n * Maximum supported version\n */\n get logicSigVersion(): uint64 {\n const data = getGlobalData()\n if (data.logicSigVersion !== undefined) return data.logicSigVersion\n throw new InternalError(getMissingValueErrorMessage('logicSigVersion'))\n },\n\n /**\n * Current round number. ApplicationType mode only.\n */\n get round(): uint64 {\n const data = getGlobalData()\n if (data.round !== undefined) return data.round\n return Uint64(lazyContext.txn.groups.length + 1)\n },\n\n /**\n * Last confirmed block UNIX timestamp. Fails if negative. ApplicationType mode only.\n */\n get latestTimestamp(): uint64 {\n const data = getGlobalData()\n if (data.latestTimestamp !== undefined) return data.latestTimestamp\n return Uint64(lazyContext.activeGroup.latestTimestamp)\n },\n\n /**\n * ID of current application executing. ApplicationType mode only.\n */\n get currentApplicationId(): ApplicationType {\n return lazyContext.activeApplication\n },\n\n /**\n * Address of the creator of the current application. ApplicationType mode only.\n */\n get creatorAddress(): AccountType {\n const app = lazyContext.activeApplication\n return app.creator\n },\n\n /**\n * Address that the current application controls. ApplicationType mode only.\n */\n get currentApplicationAddress(): AccountType {\n return this.currentApplicationId.address\n },\n\n /**\n * ID of the transaction group. 32 zero bytes if the transaction is not part of a group.\n */\n get groupId(): bytes {\n const data = getGlobalData()\n if (data.groupId !== undefined) return data.groupId\n const reference = getObjectReference(lazyContext.activeGroup)\n const referenceBytes = Bytes(encodingUtil.bigIntToUint8Array(reference))\n return sha256(referenceBytes)\n },\n\n /**\n * The remaining cost that can be spent by opcodes in this program.\n */\n get opcodeBudget(): uint64 {\n const data = getGlobalData()\n if (data.opcodeBudget !== undefined) return data.opcodeBudget\n throw new InternalError(getMissingValueErrorMessage('opcodeBudget'))\n },\n\n /**\n * The application ID of the application that called this application. 0 if this application is at the top-level. ApplicationType mode only.\n */\n get callerApplicationId(): uint64 {\n return getGlobalData().callerApplicationId\n },\n\n /**\n * The application address of the application that called this application. ZeroAddress if this application is at the top-level. ApplicationType mode only.\n */\n get callerApplicationAddress(): AccountType {\n return getApplicationAddress(this.callerApplicationId)\n },\n\n /**\n * The additional minimum balance required to create (and opt-in to) an asset.\n */\n get assetCreateMinBalance(): uint64 {\n return getGlobalData().assetCreateMinBalance\n },\n\n /**\n * The additional minimum balance required to opt-in to an asset.\n */\n get assetOptInMinBalance(): uint64 {\n return getGlobalData().assetOptInMinBalance\n },\n\n /**\n * The Genesis Hash for the network.\n */\n get genesisHash(): bytes {\n return getGlobalData().genesisHash\n },\n\n /**\n * Whether block proposal payouts are enabled.\n * Min AVM version: 11\n */\n get payoutsEnabled(): boolean {\n return getGlobalData().payoutsEnabled\n },\n\n /**\n * The fee required in a keyreg transaction to make an account incentive eligible.\n * Min AVM version: 11\n */\n get payoutsGoOnlineFee(): uint64 {\n return getGlobalData().payoutsGoOnlineFee\n },\n\n /**\n * The percentage of transaction fees in a block that can be paid to the block proposer.\n * Min AVM version: 11\n */\n get payoutsPercent(): uint64 {\n return getGlobalData().payoutsPercent\n },\n\n /**\n * The minimum algo balance an account must have in the agreement round to receive block payouts in the proposal round.\n * Min AVM version: 11\n */\n get payoutsMinBalance(): uint64 {\n return getGlobalData().payoutsMinBalance\n },\n\n /**\n * The maximum algo balance an account can have in the agreement round to receive block payouts in the proposal round.\n * Min AVM version: 11\n */\n get payoutsMaxBalance(): uint64 {\n return getGlobalData().payoutsMinBalance\n },\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.ApplicationTxn\n return txn.apps(input).id\n}\n\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\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}\n","import type { Account, Application, gtxn, op, uint64 } from '@algorandfoundation/algorand-typescript'\nimport { lazyContext } from '../context-helpers/internal-context'\nimport { asMaybeUint64Cls } from '../util'\nimport { getApp } from './app-params'\nimport { Global } from './global'\nimport type { StubUint64Compat } from './primitives'\n\nexport const getAccount = (acct: Account | StubUint64Compat): Account => {\n const acctId = asMaybeUint64Cls(acct)\n if (acctId !== undefined) {\n const activeTxn = lazyContext.activeGroup.activeTransaction\n return (activeTxn as gtxn.ApplicationTxn).accounts(acctId.asAlgoTs())\n }\n return acct as Account\n}\n\nexport const balance = (a: Account | StubUint64Compat): uint64 => {\n const acct = getAccount(a)\n return acct.balance\n}\n\nexport const minBalance = (a: Account | StubUint64Compat): uint64 => {\n const acct = getAccount(a)\n return acct.minBalance\n}\n\nexport const appOptedIn = (a: Account | StubUint64Compat, b: Application | StubUint64Compat): boolean => {\n const account = getAccount(a)\n const app = getApp(b)\n\n if (account === undefined || app === undefined) {\n return false\n }\n return account.isOptedIn(app)\n}\n\nexport const AcctParams: typeof op.AcctParams = {\n acctBalance(a: Account | StubUint64Compat): readonly [uint64, boolean] {\n const acct = getAccount(a)\n return [acct.balance, acct.balance !== 0]\n },\n acctMinBalance(a: Account | StubUint64Compat): readonly [uint64, boolean] {\n const acct = getAccount(a)\n return [acct.minBalance, acct.balance !== 0]\n },\n acctAuthAddr(a: Account | StubUint64Compat): readonly [Account, boolean] {\n const acct = getAccount(a)\n return [acct.authAddress, acct.balance !== 0]\n },\n acctTotalNumUint(a: Account | StubUint64Compat): readonly [uint64, boolean] {\n const acct = getAccount(a)\n return [acct.totalNumUint, acct.balance !== 0]\n },\n acctTotalNumByteSlice(a: Account | StubUint64Compat): readonly [uint64, boolean] {\n const acct = getAccount(a)\n return [acct.totalNumByteSlice, acct.balance !== 0]\n },\n acctTotalExtraAppPages(a: Account | StubUint64Compat): readonly [uint64, boolean] {\n const acct = getAccount(a)\n return [acct.totalExtraAppPages, acct.balance !== 0]\n },\n acctTotalAppsCreated(a: Account | StubUint64Compat): readonly [uint64, boolean] {\n const acct = getAccount(a)\n return [acct.totalAppsCreated, acct.balance !== 0]\n },\n acctTotalAppsOptedIn(a: Account | StubUint64Compat): readonly [uint64, boolean] {\n const acct = getAccount(a)\n return [acct.totalAppsOptedIn, acct.balance !== 0]\n },\n acctTotalAssetsCreated(a: Account | StubUint64Compat): readonly [uint64, boolean] {\n const acct = getAccount(a)\n return [acct.totalAssetsCreated, acct.balance !== 0]\n },\n acctTotalAssets(a: Account | StubUint64Compat): readonly [uint64, boolean] {\n const acct = getAccount(a)\n return [acct.totalAssets, acct.balance !== 0]\n },\n acctTotalBoxes(a: Account | StubUint64Compat): readonly [uint64, boolean] {\n const acct = getAccount(a)\n return [acct.totalBoxes, acct.balance !== 0]\n },\n acctTotalBoxBytes(a: Account | StubUint64Compat): readonly [uint64, boolean] {\n const acct = getAccount(a)\n return [acct.totalBoxBytes, acct.balance !== 0]\n },\n acctIncentiveEligible: function (a: Account | StubUint64Compat): readonly [boolean, boolean] {\n const acct = getAccount(a)\n const accountData = lazyContext.ledger.accountDataMap.get(acct)\n return [accountData?.incentiveEligible ?? false, acct.balance !== 0]\n },\n acctLastProposed: function (a: Account | StubUint64Compat): readonly [uint64, boolean] {\n const acct = getAccount(a)\n const accountData = lazyContext.ledger.accountDataMap.get(acct)\n return [accountData?.lastProposed ?? Global.round, acct.balance !== 0]\n },\n acctLastHeartbeat: function (a: Account | StubUint64Compat): readonly [uint64, boolean] {\n const acct = getAccount(a)\n const accountData = lazyContext.ledger.accountDataMap.get(acct)\n return [accountData?.lastHeartbeat ?? Global.round, acct.balance !== 0]\n },\n}\n","import type { Account, op, uint64 } from '@algorandfoundation/algorand-typescript'\nimport { lazyContext } from '../context-helpers/internal-context'\nimport { getAccount } from './acct-params'\nimport type { StubUint64Compat } from './primitives'\n\nexport class VoterData {\n balance: uint64\n incentiveEligible: boolean\n\n constructor() {\n this.balance = 0\n this.incentiveEligible = false\n }\n}\n\nconst getVoterData = (a: Account | StubUint64Compat): VoterData => {\n const acct = getAccount(a)\n return lazyContext.getVoterData(acct)\n}\n\nexport const VoterParams: typeof op.VoterParams = {\n voterBalance: function (a: Account | StubUint64Compat): readonly [uint64, boolean] {\n const data = getVoterData(a)\n return [data.balance, data.balance !== 0]\n },\n voterIncentiveEligible: function (a: Account | StubUint64Compat): readonly [boolean, boolean] {\n const data = getVoterData(a)\n return [data.incentiveEligible, data.balance !== 0]\n },\n}\n","import type { biguint, bytes, op, uint64 } from '@algorandfoundation/algorand-typescript'\nimport { Base64 } from '@algorandfoundation/algorand-typescript'\nimport { BITS_IN_BYTE, MAX_BYTES_SIZE, MAX_UINT64, MAX_UINT8, UINT64_SIZE } from '../constants'\nimport { AvmError, CodeError, NotImplementedError, testInvariant } from '../errors'\nimport { asBigUint, asBytes, asBytesCls, asMaybeBytesCls, asMaybeUint64Cls, asUint64Cls, binaryStringToBytes } from '../util'\nimport type { StubBigUintCompat, StubBytesCompat, StubUint64Compat } from './primitives'\nimport { BigUintCls, Bytes, BytesCls, checkBigUint, isUint64, Uint64, Uint64Cls } from './primitives'\n\nexport const addw = (a: StubUint64Compat, b: StubUint64Compat): readonly [uint64, uint64] => {\n const uint64A = Uint64Cls.fromCompat(a)\n const uint64B = Uint64Cls.fromCompat(b)\n const sum = uint64A.asBigInt() + uint64B.asBigInt()\n return toUint128(sum)\n}\n\nexport const base64Decode = (e: Base64, a: StubBytesCompat): bytes => {\n const encoding = e === Base64.StdEncoding ? 'base64' : 'base64url'\n const bytesValue = BytesCls.fromCompat(a)\n const stringValue = bytesValue.toString()\n\n const bufferResult = Buffer.from(stringValue, encoding)\n if (bufferResult.toString(encoding) !== stringValue) {\n throw new AvmError('illegal base64 data')\n }\n\n const uint8ArrayResult = new Uint8Array(bufferResult)\n return Bytes(uint8ArrayResult)\n}\n\nexport const bitLength = (a: StubUint64Compat | StubBytesCompat): uint64 => {\n const uint64Cls = asMaybeUint64Cls(a)\n const bigUintCls = asMaybeBytesCls(a)?.toBigUint()\n const bigIntValue = (uint64Cls?.asBigInt() ?? bigUintCls?.asBigInt())!\n const binaryValue = bigIntValue === 0n ? '' : bigIntValue.toString(2)\n return Uint64(binaryValue.length)\n}\n\nexport const bsqrt = (a: StubBigUintCompat): biguint => {\n const bigUintClsValue = BigUintCls.fromCompat(a)\n const bigintValue = checkBigUint(bigUintClsValue.asBigInt())\n const sqrtValue = squareroot(bigintValue)\n return asBigUint(sqrtValue)\n}\n\nexport const btoi = (a: StubBytesCompat): uint64 => {\n const bytesValue = BytesCls.fromCompat(a)\n if (bytesValue.length.asAlgoTs() > BITS_IN_BYTE) {\n throw new AvmError(`btoi arg too long, got [${bytesValue.length.valueOf()}]bytes`)\n }\n return bytesValue.toUint64().asAlgoTs()\n}\n\nexport const bzero = (a: StubUint64Compat): bytes => {\n const size = Uint64Cls.fromCompat(a).asBigInt()\n if (size > MAX_BYTES_SIZE) {\n throw new AvmError('bzero attempted to create a too large string')\n }\n return Bytes(new Uint8Array(Number(size)))\n}\n\nexport const concat = (a: StubBytesCompat, b: StubBytesCompat): bytes => {\n const bytesA = BytesCls.fromCompat(a)\n const bytesB = BytesCls.fromCompat(b)\n return bytesA.concat(bytesB).asAlgoTs()\n}\n\nexport const divmodw = (\n a: StubUint64Compat,\n b: StubUint64Compat,\n c: StubUint64Compat,\n d: StubUint64Compat,\n): readonly [uint64, uint64, uint64, uint64] => {\n const i = uint128ToBigInt(a, b)\n const j = uint128ToBigInt(c, d)\n\n const div = i / j\n const mod = i % j\n return [...toUint128(div), ...toUint128(mod)]\n}\n\nexport const divw = (a: StubUint64Compat, b: StubUint64Compat, c: StubUint64Compat): uint64 => {\n const i = uint128ToBigInt(a, b)\n const j = Uint64Cls.fromCompat(c).asBigInt()\n return Uint64(i / j)\n}\n\nexport const exp = (a: StubUint64Compat, b: StubUint64Compat): uint64 => {\n const base = Uint64Cls.fromCompat(a).asBigInt()\n const exponent = Uint64Cls.fromCompat(b).asBigInt()\n if (base === 0n && exponent === 0n) {\n throw new CodeError('0 ** 0 is undefined')\n }\n return Uint64(base ** exponent)\n}\n\nexport const expw = (a: StubUint64Compat, b: StubUint64Compat): readonly [uint64, uint64] => {\n const base = Uint64Cls.fromCompat(a).asBigInt()\n const exponent = Uint64Cls.fromCompat(b).asBigInt()\n if (base === 0n && exponent === 0n) {\n throw new CodeError('0 ** 0 is undefined')\n }\n return toUint128(base ** exponent)\n}\n\ntype ExtractType = ((a: StubBytesCompat, b: StubUint64Compat) => bytes) &\n ((a: StubBytesCompat, b: StubUint64Compat, c: StubUint64Compat) => bytes)\nexport const extract = ((a: StubBytesCompat, b: StubUint64Compat, c?: StubUint64Compat): bytes => {\n const bytesValue = BytesCls.fromCompat(a)\n const bytesLength = bytesValue.length.asBigInt()\n\n const start = Uint64Cls.fromCompat(b).asBigInt()\n const length = c !== undefined ? Uint64Cls.fromCompat(c).asBigInt() : undefined\n const end = length !== undefined ? start + length : undefined\n\n if (start > bytesLength) {\n throw new CodeError(`extraction start ${start} is beyond length`)\n }\n if (end !== undefined && end > bytesLength) {\n throw new CodeError(`extraction end ${end} is beyond length`)\n }\n\n return bytesValue.slice(start, end).asAlgoTs()\n}) as ExtractType\n\nexport const extractUint16 = (a: StubBytesCompat, b: StubUint64Compat): uint64 => {\n const result = extract(a, b, 2)\n const bytesResult = BytesCls.fromCompat(result)\n return bytesResult.toUint64().asAlgoTs()\n}\n\nexport const extractUint32 = (a: StubBytesCompat, b: StubUint64Compat): uint64 => {\n const result = extract(a, b, 4)\n const bytesResult = BytesCls.fromCompat(result)\n return bytesResult.toUint64().asAlgoTs()\n}\n\nexport const extractUint64 = (a: StubBytesCompat, b: StubUint64Compat): uint64 => {\n const result = extract(a, b, 8)\n const bytesResult = BytesCls.fromCompat(result)\n return bytesResult.toUint64().asAlgoTs()\n}\n\nexport const getBit = (a: StubUint64Compat | StubBytesCompat, b: StubUint64Compat): uint64 => {\n const binaryString = toBinaryString(isUint64(a) ? asUint64Cls(a).toBytes().asAlgoTs() : asBytes(a))\n const index = Uint64Cls.fromCompat(b).asNumber()\n const adjustedIndex = asMaybeUint64Cls(a) ? binaryString.length - index - 1 : index\n if (adjustedIndex < 0 || adjustedIndex >= binaryString.length) {\n throw new CodeError(`getBit index ${index} is beyond length`)\n }\n return binaryString[adjustedIndex] === '1' ? 1 : 0\n}\n\nexport const getByte = (a: StubBytesCompat, b: StubUint64Compat): uint64 => {\n const bytesValue = BytesCls.fromCompat(a)\n const index = Uint64Cls.fromCompat(b).asNumber()\n if (index >= bytesValue.length.asNumber()) {\n throw new CodeError(`getBytes index ${index} is beyond length`)\n }\n return bytesValue.at(index).toUint64().asAlgoTs()\n}\n\nexport const itob = (a: StubUint64Compat): bytes => {\n return asUint64Cls(a).toBytes().asAlgoTs()\n}\n\nexport const len = (a: StubBytesCompat): uint64 => {\n return asBytesCls(a).length.asAlgoTs()\n}\n\nexport const mulw = (a: StubUint64Compat, b: StubUint64Compat): readonly [uint64, uint64] => {\n const uint64A = Uint64Cls.fromCompat(a)\n const uint64B = Uint64Cls.fromCompat(b)\n const product = uint64A.asBigInt() * uint64B.asBigInt()\n return toUint128(product)\n}\n\nexport const replace = (a: StubBytesCompat, b: StubUint64Compat, c: StubBytesCompat): bytes => {\n const bytesValue = BytesCls.fromCompat(a)\n const index = Uint64Cls.fromCompat(b).asNumber()\n const replacement = BytesCls.fromCompat(c)\n\n const valueLength = bytesValue.length.asNumber()\n const replacementLength = replacement.length.asNumber()\n\n if (index + replacementLength > valueLength) {\n throw new CodeError(`expected value <= ${valueLength}, got: ${index + replacementLength}`)\n }\n return bytesValue\n .slice(0, index)\n .concat(replacement)\n .concat(bytesValue.slice(index + replacementLength, valueLength))\n .asAlgoTs()\n}\n\ntype selectType = ((a: StubBytesCompat, b: StubBytesCompat, c: StubUint64Compat) => bytes) &\n ((a: StubUint64Compat, b: StubUint64Compat, c: StubUint64Compat) => uint64)\nexport const select = ((\n a: StubUint64Compat | StubBytesCompat,\n b: StubUint64Compat | StubBytesCompat,\n c: StubUint64Compat,\n): uint64 | bytes => {\n const uint64A = asMaybeUint64Cls(a)\n const uint64B = asMaybeUint64Cls(b)\n const bytesA = asMaybeBytesCls(a)\n const bytesB = asMaybeBytesCls(b)\n const bigIntC = Uint64Cls.fromCompat(c).asBigInt()\n\n return (bigIntC !== 0n ? (uint64B ?? bytesB)! : (uint64A ?? bytesA)!).asAlgoTs()\n}) as selectType\n\ntype SetBitType = ((target: StubBytesCompat, n: StubUint64Compat, c: StubUint64Compat) => bytes) &\n ((target: StubUint64Compat, n: StubUint64Compat, c: StubUint64Compat) => uint64)\n\nexport const setBit = ((a: StubUint64Compat | StubBytesCompat, b: StubUint64Compat, c: StubUint64Compat) => {\n const uint64Cls = asMaybeUint64Cls(a)\n const indexParam = Uint64Cls.fromCompat(b).asNumber()\n const bit = Uint64Cls.fromCompat(c).asNumber()\n if (uint64Cls) {\n const binaryString = toBinaryString(uint64Cls?.toBytes().asAlgoTs())\n const index = binaryString.length - indexParam - 1\n const newBytes = doSetBit(binaryString, index, bit)\n return newBytes.toUint64().asAlgoTs()\n } else {\n const bytesCls = asMaybeBytesCls(a)\n testInvariant(bytesCls, 'a must be uint64 or bytes')\n const binaryString = toBinaryString(bytesCls.asAlgoTs())\n const newBytes = doSetBit(binaryString, indexParam, bit)\n return newBytes.asAlgoTs()\n }\n}) as SetBitType\n\nexport const setByte = (a: StubBytesCompat, b: StubUint64Compat, c: StubUint64Compat): bytes => {\n const binaryString = toBinaryString(BytesCls.fromCompat(a).asAlgoTs())\n\n const byteIndex = Uint64Cls.fromCompat(b).asNumber()\n const bitIndex = byteIndex * BITS_IN_BYTE\n\n const replacementNumber = Uint64Cls.fromCompat(c)\n const replacement = toBinaryString(replacementNumber.toBytes().at(-1).asAlgoTs())\n\n if (bitIndex >= binaryString.length) {\n throw new CodeError(`setByte index ${byteIndex} is beyond length`)\n }\n if (replacementNumber.valueOf() > MAX_UINT8) {\n throw new CodeError(`setByte value ${replacementNumber.asNumber()} > ${MAX_UINT8}`)\n }\n const updatedString = binaryString.slice(0, bitIndex) + replacement + binaryString.slice(bitIndex + replacement.length)\n const updatedBytes = binaryStringToBytes(updatedString)\n return updatedBytes.asAlgoTs()\n}\n\nexport const shl = (a: StubUint64Compat, b: StubUint64Compat): uint64 => {\n const uint64A = Uint64Cls.fromCompat(a)\n const uint64B = Uint64Cls.fromCompat(b)\n const bigIntA = uint64A.asBigInt()\n const bigIntB = uint64B.asBigInt()\n if (bigIntB >= UINT64_SIZE) {\n throw new CodeError(`shl value ${bigIntB} >= ${UINT64_SIZE}`)\n }\n const shifted = (bigIntA * 2n ** bigIntB) % 2n ** BigInt(UINT64_SIZE)\n return Uint64(shifted)\n}\n\nexport const shr = (a: StubUint64Compat, b: StubUint64Compat): uint64 => {\n const uint64A = Uint64Cls.fromCompat(a)\n const uint64B = Uint64Cls.fromCompat(b)\n const bigIntA = uint64A.asBigInt()\n const bigIntB = uint64B.asBigInt()\n if (bigIntB >= UINT64_SIZE) {\n throw new CodeError(`shr value ${bigIntB} >= ${UINT64_SIZE}`)\n }\n const shifted = bigIntA / 2n ** bigIntB\n return Uint64(shifted)\n}\n\nexport const sqrt = (a: StubUint64Compat): uint64 => {\n const bigIntValue = Uint64Cls.fromCompat(a).asBigInt()\n const sqrtValue = squareroot(bigIntValue)\n return Uint64(sqrtValue)\n}\n\nexport const substring = (a: StubBytesCompat, b: StubUint64Compat, c: StubUint64Compat): bytes => {\n const bytesValue = BytesCls.fromCompat(a)\n const start = Uint64Cls.fromCompat(b).asBigInt()\n const end = Uint64Cls.fromCompat(c).asBigInt()\n if (start > end) {\n throw new CodeError('substring end before start')\n }\n if (end > bytesValue.length.asNumber()) {\n throw new CodeError('substring range beyond length of string')\n }\n return bytesValue.slice(start, end).asAlgoTs()\n}\n\nexport const JsonRef = new Proxy({} as typeof op.JsonRef, {\n get: (_target, prop) => {\n throw new NotImplementedError(`JsonRef.${prop.toString()}`)\n },\n})\n\nconst squareroot = (x: bigint): bigint => {\n let lo = 0n,\n hi = x\n while (lo <= hi) {\n const mid = (lo + hi) / 2n\n if (mid * mid > x) hi = mid - 1n\n else lo = mid + 1n\n }\n return hi\n}\n\nconst toUint128 = (value: bigint): [uint64, uint64] => {\n const cf = value >> 64n\n const rest = value & MAX_UINT64\n return [Uint64(cf), Uint64(rest)]\n}\n\nconst uint128ToBigInt = (a: StubUint64Compat, b: StubUint64Compat): bigint => {\n const bigIntA = Uint64Cls.fromCompat(a).asBigInt()\n const bigIntB = Uint64Cls.fromCompat(b).asBigInt()\n return (bigIntA << 64n) + bigIntB\n}\n\nconst toBinaryString = (a: bytes): string => {\n return [...BytesCls.fromCompat(a).asUint8Array()].map((x) => x.toString(2).padStart(BITS_IN_BYTE, '0')).join('')\n}\n\nconst doSetBit = (binaryString: string, index: number, bit: number): BytesCls => {\n if (index < 0 || index >= binaryString.length) {\n throw new CodeError(`setBit index ${index < 0 ? binaryString.length - index : index} is beyond length`)\n }\n if (bit !== 0 && bit !== 1) {\n throw new CodeError(`setBit value > 1`)\n }\n const updatedString = binaryString.slice(0, index) + bit.toString() + binaryString.slice(index + 1)\n return binaryStringToBytes(updatedString)\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.ApplicationTxn\n return txn.assets(input).id\n}\n\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\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, boolean] {\n const asset = getAsset(a)\n return asset === undefined ? [Bytes(), 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":[],"mappings":";;;;;AAmBA,MAAM,gBAAgB,GAAuB,CAAC,GAAG,KAAI;IACnD,OAAO,YAAY,CAAC,kBAAkB,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE;AAChE,CAAC;AAED,MAAM,gBAAgB,GAAuB,CAAC,GAAG,KAAI;AACnD,IAAA,OAAO,OAAO,CAAC,YAAY,CAAC,kBAAkB,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC;AACpE,CAAC;AAED,MAAM,cAAc,GAAqB,CAAC,GAAG,KAAI;AAC/C,IAAA,OAAO,OAAO,CAAC,GAAG,CAAC;AACrB,CAAC;AAED,MAAM,eAAe,GAAsB,CAAC,GAAG,KAAI;AACjD,IAAA,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE;AAChC,CAAC;AAED,MAAM,eAAe,GAAsB,CAAC,GAAG,KAAI;AACjD,IAAA,OAAO,MAAM,CAAC,YAAY,CAAC,kBAAkB,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC;AACnE,CAAC;AAED,MAAM,qBAAqB,GAAgC,CAAC,GAAG,KAAI;AACjE,IAAA,OA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,OAAO,EAAE,IAAI,CAAC;KACxE;;;;;"}
1
+ {"version":3,"file":"asset-params-C7s8ZU5u.js","sources":["../src/encoders.ts","../src/impl/block.ts","../src/impl/global.ts","../src/impl/app-params.ts","../src/impl/acct-params.ts","../src/impl/voter-params.ts","../src/impl/pure.ts","../src/impl/asset-params.ts"],"sourcesContent":["import type { biguint, bytes, TransactionType, uint64 } from '@algorandfoundation/algorand-typescript'\nimport type { OnCompleteAction } from '@algorandfoundation/algorand-typescript/arc4'\nimport { ARC4Encoded } from '@algorandfoundation/algorand-typescript/arc4'\nimport { encodingUtil } from '@algorandfoundation/puya-ts'\nimport { InternalError } from './errors'\nimport { BytesBackedCls, Uint64BackedCls } from './impl/base'\nimport { arc4Encoders, encodeArc4Impl, getArc4Encoder } from './impl/encoded-types'\nimport { BigUint, Uint64, type StubBytesCompat } from './impl/primitives'\nimport { AccountCls, ApplicationCls, AssetCls } from './impl/reference'\nimport type { DeliberateAny } from './typescript-helpers'\nimport { asBytes, asMaybeBigUintCls, asMaybeBytesCls, asMaybeUint64Cls, asUint64Cls, asUint8Array, nameOfType } from './util'\n\nexport type TypeInfo = {\n name: string\n genericArgs?: TypeInfo[] | Record<string, TypeInfo>\n}\n\nexport type fromBytes<T> = (val: Uint8Array | StubBytesCompat, typeInfo: TypeInfo, prefix?: 'none' | 'log') => T\n\nconst booleanFromBytes: fromBytes<boolean> = (val) => {\n return encodingUtil.uint8ArrayToBigInt(asUint8Array(val)) > 0n\n}\n\nconst bigUintFromBytes: fromBytes<biguint> = (val) => {\n return BigUint(encodingUtil.uint8ArrayToBigInt(asUint8Array(val)))\n}\n\nconst bytesFromBytes: fromBytes<bytes> = (val) => {\n return asBytes(val)\n}\n\nconst stringFromBytes: fromBytes<string> = (val) => {\n return asBytes(val).toString()\n}\n\nconst uint64FromBytes: fromBytes<uint64> = (val) => {\n return Uint64(encodingUtil.uint8ArrayToBigInt(asUint8Array(val)))\n}\n\nconst onCompletionFromBytes: fromBytes<OnCompleteAction> = (val) => {\n return Uint64(encodingUtil.uint8ArrayToBigInt(asUint8Array(val))) as OnCompleteAction\n}\n\nconst transactionTypeFromBytes: fromBytes<TransactionType> = (val) => {\n return Uint64(encodingUtil.uint8ArrayToBigInt(asUint8Array(val))) as TransactionType\n}\n\nexport 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 ...arc4Encoders,\n}\n\nexport const getEncoder = <T>(typeInfo: TypeInfo): fromBytes<T> => {\n return getArc4Encoder<T>(typeInfo, encoders)\n}\n\nexport const toBytes = (val: unknown): bytes => {\n const uint64Val = asMaybeUint64Cls(val)\n if (uint64Val !== undefined) {\n return uint64Val.toBytes().asAlgoTs()\n }\n const bytesVal = asMaybeBytesCls(val)\n if (bytesVal !== undefined) {\n return bytesVal.asAlgoTs()\n }\n const bigUintVal = asMaybeBigUintCls(val)\n if (bigUintVal !== undefined) {\n return bigUintVal.toBytes().asAlgoTs()\n }\n if (val instanceof BytesBackedCls) {\n return val.bytes\n }\n if (val instanceof Uint64BackedCls) {\n return asUint64Cls(val.uint64).toBytes().asAlgoTs()\n }\n if (val instanceof ARC4Encoded) {\n return val.bytes\n }\n if (Array.isArray(val) || typeof val === 'object') {\n return encodeArc4Impl('', val)\n }\n throw new InternalError(`Invalid type for bytes: ${nameOfType(val)}`)\n}\n","import type { Account as AccountType, bytes, op, uint64 } from '@algorandfoundation/algorand-typescript'\nimport { lazyContext } from '../context-helpers/internal-context'\nimport { asUint64, getRandomBytes } from '../util'\nimport { Uint64, type StubUint64Compat } from './primitives'\nimport { Account } from './reference'\n\nexport class BlockData {\n seed: bytes\n timestamp: uint64\n proposer: AccountType\n feesCollected: uint64\n bonus: uint64\n branch: bytes\n feeSink: AccountType\n protocol: bytes\n txnCounter: uint64\n proposerPayout: uint64\n\n constructor() {\n this.seed = getRandomBytes(32).asAlgoTs()\n this.timestamp = asUint64(Date.now())\n this.proposer = Account()\n this.feesCollected = Uint64(0)\n this.bonus = Uint64(0)\n this.branch = getRandomBytes(32).asAlgoTs()\n this.feeSink = Account()\n this.protocol = getRandomBytes(32).asAlgoTs()\n this.txnCounter = Uint64(0)\n this.proposerPayout = Uint64(0)\n }\n}\n\nexport const Block: typeof op.Block = {\n blkSeed: function (a: StubUint64Compat): bytes {\n return lazyContext.ledger.getBlockData(a).seed\n },\n blkTimestamp: function (a: StubUint64Compat): uint64 {\n return lazyContext.ledger.getBlockData(a).timestamp\n },\n blkProposer: function (a: uint64): AccountType {\n return lazyContext.ledger.getBlockData(a).proposer\n },\n blkFeesCollected: function (a: uint64): uint64 {\n return lazyContext.ledger.getBlockData(a).feesCollected\n },\n blkBonus: function (a: uint64): uint64 {\n return lazyContext.ledger.getBlockData(a).bonus\n },\n blkBranch: function (a: uint64): bytes {\n return lazyContext.ledger.getBlockData(a).branch\n },\n blkFeeSink: function (a: uint64): AccountType {\n return lazyContext.ledger.getBlockData(a).feeSink\n },\n blkProtocol: function (a: uint64): bytes {\n return lazyContext.ledger.getBlockData(a).protocol\n },\n blkTxnCounter: function (a: uint64): uint64 {\n return lazyContext.ledger.getBlockData(a).txnCounter\n },\n blkProposerPayout: function (a: uint64): uint64 {\n return lazyContext.ledger.getBlockData(a).proposerPayout\n },\n}\n","import type { Account as AccountType, Application as ApplicationType, bytes, op, uint64 } from '@algorandfoundation/algorand-typescript'\nimport { encodingUtil } from '@algorandfoundation/puya-ts'\nimport {\n DEFAULT_ACCOUNT_MIN_BALANCE,\n DEFAULT_ASSET_CREATE_MIN_BALANCE,\n DEFAULT_ASSET_OPT_IN_MIN_BALANCE,\n DEFAULT_GLOBAL_GENESIS_HASH,\n DEFAULT_MAX_TXN_LIFE,\n MIN_TXN_FEE,\n ZERO_ADDRESS,\n} from '../constants'\nimport { lazyContext } from '../context-helpers/internal-context'\nimport { InternalError } from '../errors'\nimport { getObjectReference } from '../util'\nimport { sha256 } from './crypto'\nimport { Bytes, Uint64 } from './primitives'\nimport { Account, getApplicationAddress } from './reference'\n\nexport class GlobalData {\n minTxnFee: uint64\n minBalance: uint64\n maxTxnLife: uint64\n zeroAddress: AccountType\n logicSigVersion?: uint64\n round?: uint64\n latestTimestamp?: uint64\n groupId?: bytes\n callerApplicationId: uint64\n assetCreateMinBalance: uint64\n assetOptInMinBalance: uint64\n genesisHash: bytes\n opcodeBudget?: uint64\n payoutsEnabled: boolean\n payoutsGoOnlineFee: uint64\n payoutsPercent: uint64\n payoutsMinBalance: uint64\n\n constructor() {\n this.minTxnFee = Uint64(MIN_TXN_FEE)\n this.minBalance = Uint64(DEFAULT_ACCOUNT_MIN_BALANCE)\n this.maxTxnLife = Uint64(DEFAULT_MAX_TXN_LIFE)\n this.zeroAddress = Account(ZERO_ADDRESS)\n this.callerApplicationId = Uint64(0)\n this.assetCreateMinBalance = Uint64(DEFAULT_ASSET_CREATE_MIN_BALANCE)\n this.assetOptInMinBalance = Uint64(DEFAULT_ASSET_OPT_IN_MIN_BALANCE)\n this.genesisHash = DEFAULT_GLOBAL_GENESIS_HASH\n this.payoutsEnabled = false\n this.payoutsGoOnlineFee = Uint64(0)\n this.payoutsPercent = Uint64(0)\n this.payoutsMinBalance = Uint64(0)\n }\n}\nconst getGlobalData = (): GlobalData => {\n return lazyContext.ledger.globalData\n}\n\nconst getMissingValueErrorMessage = (name: keyof GlobalData) =>\n `'Global' object has no value set for attribute named '${name}'. Use \\`context.ledger.patchGlobalData({${name}: your_value})\\` to set the value in your test setup.\"`\n\nexport const Global: typeof op.Global = {\n /**\n * microalgos\n */\n get minTxnFee(): uint64 {\n return getGlobalData().minTxnFee\n },\n\n /**\n * microalgos\n */\n get minBalance(): uint64 {\n return getGlobalData().minBalance\n },\n\n /**\n * rounds\n */\n get maxTxnLife(): uint64 {\n return getGlobalData().maxTxnLife\n },\n\n /**\n * 32 byte address of all zero bytes\n */\n get zeroAddress(): AccountType {\n return getGlobalData().zeroAddress\n },\n\n /**\n * Number of transactions in this atomic transaction group. At least 1\n */\n get groupSize(): uint64 {\n const currentTransactionGroup = lazyContext.activeGroup.transactions\n return Uint64(currentTransactionGroup.length)\n },\n\n /**\n * Maximum supported version\n */\n get logicSigVersion(): uint64 {\n const data = getGlobalData()\n if (data.logicSigVersion !== undefined) return data.logicSigVersion\n throw new InternalError(getMissingValueErrorMessage('logicSigVersion'))\n },\n\n /**\n * Current round number. ApplicationType mode only.\n */\n get round(): uint64 {\n const data = getGlobalData()\n if (data.round !== undefined) return data.round\n return Uint64(lazyContext.txn.groups.length + 1)\n },\n\n /**\n * Last confirmed block UNIX timestamp. Fails if negative. ApplicationType mode only.\n */\n get latestTimestamp(): uint64 {\n const data = getGlobalData()\n if (data.latestTimestamp !== undefined) return data.latestTimestamp\n return Uint64(lazyContext.activeGroup.latestTimestamp)\n },\n\n /**\n * ID of current application executing. ApplicationType mode only.\n */\n get currentApplicationId(): ApplicationType {\n return lazyContext.activeApplication\n },\n\n /**\n * Address of the creator of the current application. ApplicationType mode only.\n */\n get creatorAddress(): AccountType {\n const app = lazyContext.activeApplication\n return app.creator\n },\n\n /**\n * Address that the current application controls. ApplicationType mode only.\n */\n get currentApplicationAddress(): AccountType {\n return this.currentApplicationId.address\n },\n\n /**\n * ID of the transaction group. 32 zero bytes if the transaction is not part of a group.\n */\n get groupId(): bytes {\n const data = getGlobalData()\n if (data.groupId !== undefined) return data.groupId\n const reference = getObjectReference(lazyContext.activeGroup)\n const referenceBytes = Bytes(encodingUtil.bigIntToUint8Array(reference))\n return sha256(referenceBytes)\n },\n\n /**\n * The remaining cost that can be spent by opcodes in this program.\n */\n get opcodeBudget(): uint64 {\n const data = getGlobalData()\n if (data.opcodeBudget !== undefined) return data.opcodeBudget\n throw new InternalError(getMissingValueErrorMessage('opcodeBudget'))\n },\n\n /**\n * The application ID of the application that called this application. 0 if this application is at the top-level. ApplicationType mode only.\n */\n get callerApplicationId(): uint64 {\n return getGlobalData().callerApplicationId\n },\n\n /**\n * The application address of the application that called this application. ZeroAddress if this application is at the top-level. ApplicationType mode only.\n */\n get callerApplicationAddress(): AccountType {\n return getApplicationAddress(this.callerApplicationId)\n },\n\n /**\n * The additional minimum balance required to create (and opt-in to) an asset.\n */\n get assetCreateMinBalance(): uint64 {\n return getGlobalData().assetCreateMinBalance\n },\n\n /**\n * The additional minimum balance required to opt-in to an asset.\n */\n get assetOptInMinBalance(): uint64 {\n return getGlobalData().assetOptInMinBalance\n },\n\n /**\n * The Genesis Hash for the network.\n */\n get genesisHash(): bytes {\n return getGlobalData().genesisHash\n },\n\n /**\n * Whether block proposal payouts are enabled.\n * Min AVM version: 11\n */\n get payoutsEnabled(): boolean {\n return getGlobalData().payoutsEnabled\n },\n\n /**\n * The fee required in a keyreg transaction to make an account incentive eligible.\n * Min AVM version: 11\n */\n get payoutsGoOnlineFee(): uint64 {\n return getGlobalData().payoutsGoOnlineFee\n },\n\n /**\n * The percentage of transaction fees in a block that can be paid to the block proposer.\n * Min AVM version: 11\n */\n get payoutsPercent(): uint64 {\n return getGlobalData().payoutsPercent\n },\n\n /**\n * The minimum algo balance an account must have in the agreement round to receive block payouts in the proposal round.\n * Min AVM version: 11\n */\n get payoutsMinBalance(): uint64 {\n return getGlobalData().payoutsMinBalance\n },\n\n /**\n * The maximum algo balance an account can have in the agreement round to receive block payouts in the proposal round.\n * Min AVM version: 11\n */\n get payoutsMaxBalance(): uint64 {\n return getGlobalData().payoutsMinBalance\n },\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.ApplicationTxn\n return txn.apps(input).id\n}\n\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\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}\n","import type { Account, Application, gtxn, op, uint64 } from '@algorandfoundation/algorand-typescript'\nimport { lazyContext } from '../context-helpers/internal-context'\nimport { asMaybeUint64Cls } from '../util'\nimport { getApp } from './app-params'\nimport { Global } from './global'\nimport type { StubUint64Compat } from './primitives'\n\nexport const getAccount = (acct: Account | StubUint64Compat): Account => {\n const acctId = asMaybeUint64Cls(acct)\n if (acctId !== undefined) {\n const activeTxn = lazyContext.activeGroup.activeTransaction\n return (activeTxn as gtxn.ApplicationTxn).accounts(acctId.asAlgoTs())\n }\n return acct as Account\n}\n\nexport const balance = (a: Account | StubUint64Compat): uint64 => {\n const acct = getAccount(a)\n return acct.balance\n}\n\nexport const minBalance = (a: Account | StubUint64Compat): uint64 => {\n const acct = getAccount(a)\n return acct.minBalance\n}\n\nexport const appOptedIn = (a: Account | StubUint64Compat, b: Application | StubUint64Compat): boolean => {\n const account = getAccount(a)\n const app = getApp(b)\n\n if (account === undefined || app === undefined) {\n return false\n }\n return account.isOptedIn(app)\n}\n\nexport const AcctParams: typeof op.AcctParams = {\n acctBalance(a: Account | StubUint64Compat): readonly [uint64, boolean] {\n const acct = getAccount(a)\n return [acct.balance, acct.balance !== 0]\n },\n acctMinBalance(a: Account | StubUint64Compat): readonly [uint64, boolean] {\n const acct = getAccount(a)\n return [acct.minBalance, acct.balance !== 0]\n },\n acctAuthAddr(a: Account | StubUint64Compat): readonly [Account, boolean] {\n const acct = getAccount(a)\n return [acct.authAddress, acct.balance !== 0]\n },\n acctTotalNumUint(a: Account | StubUint64Compat): readonly [uint64, boolean] {\n const acct = getAccount(a)\n return [acct.totalNumUint, acct.balance !== 0]\n },\n acctTotalNumByteSlice(a: Account | StubUint64Compat): readonly [uint64, boolean] {\n const acct = getAccount(a)\n return [acct.totalNumByteSlice, acct.balance !== 0]\n },\n acctTotalExtraAppPages(a: Account | StubUint64Compat): readonly [uint64, boolean] {\n const acct = getAccount(a)\n return [acct.totalExtraAppPages, acct.balance !== 0]\n },\n acctTotalAppsCreated(a: Account | StubUint64Compat): readonly [uint64, boolean] {\n const acct = getAccount(a)\n return [acct.totalAppsCreated, acct.balance !== 0]\n },\n acctTotalAppsOptedIn(a: Account | StubUint64Compat): readonly [uint64, boolean] {\n const acct = getAccount(a)\n return [acct.totalAppsOptedIn, acct.balance !== 0]\n },\n acctTotalAssetsCreated(a: Account | StubUint64Compat): readonly [uint64, boolean] {\n const acct = getAccount(a)\n return [acct.totalAssetsCreated, acct.balance !== 0]\n },\n acctTotalAssets(a: Account | StubUint64Compat): readonly [uint64, boolean] {\n const acct = getAccount(a)\n return [acct.totalAssets, acct.balance !== 0]\n },\n acctTotalBoxes(a: Account | StubUint64Compat): readonly [uint64, boolean] {\n const acct = getAccount(a)\n return [acct.totalBoxes, acct.balance !== 0]\n },\n acctTotalBoxBytes(a: Account | StubUint64Compat): readonly [uint64, boolean] {\n const acct = getAccount(a)\n return [acct.totalBoxBytes, acct.balance !== 0]\n },\n acctIncentiveEligible: function (a: Account | StubUint64Compat): readonly [boolean, boolean] {\n const acct = getAccount(a)\n const accountData = lazyContext.ledger.accountDataMap.get(acct)\n return [accountData?.incentiveEligible ?? false, acct.balance !== 0]\n },\n acctLastProposed: function (a: Account | StubUint64Compat): readonly [uint64, boolean] {\n const acct = getAccount(a)\n const accountData = lazyContext.ledger.accountDataMap.get(acct)\n return [accountData?.lastProposed ?? Global.round, acct.balance !== 0]\n },\n acctLastHeartbeat: function (a: Account | StubUint64Compat): readonly [uint64, boolean] {\n const acct = getAccount(a)\n const accountData = lazyContext.ledger.accountDataMap.get(acct)\n return [accountData?.lastHeartbeat ?? Global.round, acct.balance !== 0]\n },\n}\n","import type { Account, op, uint64 } from '@algorandfoundation/algorand-typescript'\nimport { lazyContext } from '../context-helpers/internal-context'\nimport { getAccount } from './acct-params'\nimport type { StubUint64Compat } from './primitives'\n\nexport class VoterData {\n balance: uint64\n incentiveEligible: boolean\n\n constructor() {\n this.balance = 0\n this.incentiveEligible = false\n }\n}\n\nconst getVoterData = (a: Account | StubUint64Compat): VoterData => {\n const acct = getAccount(a)\n return lazyContext.getVoterData(acct)\n}\n\nexport const VoterParams: typeof op.VoterParams = {\n voterBalance: function (a: Account | StubUint64Compat): readonly [uint64, boolean] {\n const data = getVoterData(a)\n return [data.balance, data.balance !== 0]\n },\n voterIncentiveEligible: function (a: Account | StubUint64Compat): readonly [boolean, boolean] {\n const data = getVoterData(a)\n return [data.incentiveEligible, data.balance !== 0]\n },\n}\n","import type { biguint, bytes, op, uint64 } from '@algorandfoundation/algorand-typescript'\nimport { Base64 } from '@algorandfoundation/algorand-typescript'\nimport { BITS_IN_BYTE, MAX_BYTES_SIZE, MAX_UINT64, MAX_UINT8, UINT64_SIZE } from '../constants'\nimport { AvmError, CodeError, NotImplementedError, testInvariant } from '../errors'\nimport { asBigUint, asBytes, asBytesCls, asMaybeBytesCls, asMaybeUint64Cls, asUint64Cls, binaryStringToBytes } from '../util'\nimport type { StubBigUintCompat, StubBytesCompat, StubUint64Compat } from './primitives'\nimport { BigUintCls, Bytes, BytesCls, checkBigUint, isUint64, Uint64, Uint64Cls } from './primitives'\n\nexport const addw = (a: StubUint64Compat, b: StubUint64Compat): readonly [uint64, uint64] => {\n const uint64A = Uint64Cls.fromCompat(a)\n const uint64B = Uint64Cls.fromCompat(b)\n const sum = uint64A.asBigInt() + uint64B.asBigInt()\n return toUint128(sum)\n}\n\nexport const base64Decode = (e: Base64, a: StubBytesCompat): bytes => {\n const encoding = e === Base64.StdEncoding ? 'base64' : 'base64url'\n const bytesValue = BytesCls.fromCompat(a)\n const stringValue = bytesValue.toString()\n\n const bufferResult = Buffer.from(stringValue, encoding)\n if (bufferResult.toString(encoding) !== stringValue) {\n throw new AvmError('illegal base64 data')\n }\n\n const uint8ArrayResult = new Uint8Array(bufferResult)\n return Bytes(uint8ArrayResult)\n}\n\nexport const bitLength = (a: StubUint64Compat | StubBytesCompat): uint64 => {\n const uint64Cls = asMaybeUint64Cls(a)\n const bigUintCls = asMaybeBytesCls(a)?.toBigUint()\n const bigIntValue = (uint64Cls?.asBigInt() ?? bigUintCls?.asBigInt())!\n const binaryValue = bigIntValue === 0n ? '' : bigIntValue.toString(2)\n return Uint64(binaryValue.length)\n}\n\nexport const bsqrt = (a: StubBigUintCompat): biguint => {\n const bigUintClsValue = BigUintCls.fromCompat(a)\n const bigintValue = checkBigUint(bigUintClsValue.asBigInt())\n const sqrtValue = squareroot(bigintValue)\n return asBigUint(sqrtValue)\n}\n\nexport const btoi = (a: StubBytesCompat): uint64 => {\n const bytesValue = BytesCls.fromCompat(a)\n if (bytesValue.length.asAlgoTs() > BITS_IN_BYTE) {\n throw new AvmError(`btoi arg too long, got [${bytesValue.length.valueOf()}]bytes`)\n }\n return bytesValue.toUint64().asAlgoTs()\n}\n\nexport const bzero = (a: StubUint64Compat): bytes => {\n const size = Uint64Cls.fromCompat(a).asBigInt()\n if (size > MAX_BYTES_SIZE) {\n throw new AvmError('bzero attempted to create a too large string')\n }\n return Bytes(new Uint8Array(Number(size)))\n}\n\nexport const concat = (a: StubBytesCompat, b: StubBytesCompat): bytes => {\n const bytesA = BytesCls.fromCompat(a)\n const bytesB = BytesCls.fromCompat(b)\n return bytesA.concat(bytesB).asAlgoTs()\n}\n\nexport const divmodw = (\n a: StubUint64Compat,\n b: StubUint64Compat,\n c: StubUint64Compat,\n d: StubUint64Compat,\n): readonly [uint64, uint64, uint64, uint64] => {\n const i = uint128ToBigInt(a, b)\n const j = uint128ToBigInt(c, d)\n\n const div = i / j\n const mod = i % j\n return [...toUint128(div), ...toUint128(mod)]\n}\n\nexport const divw = (a: StubUint64Compat, b: StubUint64Compat, c: StubUint64Compat): uint64 => {\n const i = uint128ToBigInt(a, b)\n const j = Uint64Cls.fromCompat(c).asBigInt()\n return Uint64(i / j)\n}\n\nexport const exp = (a: StubUint64Compat, b: StubUint64Compat): uint64 => {\n const base = Uint64Cls.fromCompat(a).asBigInt()\n const exponent = Uint64Cls.fromCompat(b).asBigInt()\n if (base === 0n && exponent === 0n) {\n throw new CodeError('0 ** 0 is undefined')\n }\n return Uint64(base ** exponent)\n}\n\nexport const expw = (a: StubUint64Compat, b: StubUint64Compat): readonly [uint64, uint64] => {\n const base = Uint64Cls.fromCompat(a).asBigInt()\n const exponent = Uint64Cls.fromCompat(b).asBigInt()\n if (base === 0n && exponent === 0n) {\n throw new CodeError('0 ** 0 is undefined')\n }\n return toUint128(base ** exponent)\n}\n\ntype ExtractType = ((a: StubBytesCompat, b: StubUint64Compat) => bytes) &\n ((a: StubBytesCompat, b: StubUint64Compat, c: StubUint64Compat) => bytes)\nexport const extract = ((a: StubBytesCompat, b: StubUint64Compat, c?: StubUint64Compat): bytes => {\n const bytesValue = BytesCls.fromCompat(a)\n const bytesLength = bytesValue.length.asBigInt()\n\n const start = Uint64Cls.fromCompat(b).asBigInt()\n const length = c !== undefined ? Uint64Cls.fromCompat(c).asBigInt() : undefined\n const end = length !== undefined ? start + length : undefined\n\n if (start > bytesLength) {\n throw new CodeError(`extraction start ${start} is beyond length`)\n }\n if (end !== undefined && end > bytesLength) {\n throw new CodeError(`extraction end ${end} is beyond length`)\n }\n\n return bytesValue.slice(start, end).asAlgoTs()\n}) as ExtractType\n\nexport const extractUint16 = (a: StubBytesCompat, b: StubUint64Compat): uint64 => {\n const result = extract(a, b, 2)\n const bytesResult = BytesCls.fromCompat(result)\n return bytesResult.toUint64().asAlgoTs()\n}\n\nexport const extractUint32 = (a: StubBytesCompat, b: StubUint64Compat): uint64 => {\n const result = extract(a, b, 4)\n const bytesResult = BytesCls.fromCompat(result)\n return bytesResult.toUint64().asAlgoTs()\n}\n\nexport const extractUint64 = (a: StubBytesCompat, b: StubUint64Compat): uint64 => {\n const result = extract(a, b, 8)\n const bytesResult = BytesCls.fromCompat(result)\n return bytesResult.toUint64().asAlgoTs()\n}\n\nexport const getBit = (a: StubUint64Compat | StubBytesCompat, b: StubUint64Compat): uint64 => {\n const binaryString = toBinaryString(isUint64(a) ? asUint64Cls(a).toBytes().asAlgoTs() : asBytes(a))\n const index = Uint64Cls.fromCompat(b).asNumber()\n const adjustedIndex = asMaybeUint64Cls(a) ? binaryString.length - index - 1 : index\n if (adjustedIndex < 0 || adjustedIndex >= binaryString.length) {\n throw new CodeError(`getBit index ${index} is beyond length`)\n }\n return binaryString[adjustedIndex] === '1' ? 1 : 0\n}\n\nexport const getByte = (a: StubBytesCompat, b: StubUint64Compat): uint64 => {\n const bytesValue = BytesCls.fromCompat(a)\n const index = Uint64Cls.fromCompat(b).asNumber()\n if (index >= bytesValue.length.asNumber()) {\n throw new CodeError(`getBytes index ${index} is beyond length`)\n }\n return bytesValue.at(index).toUint64().asAlgoTs()\n}\n\nexport const itob = (a: StubUint64Compat): bytes => {\n return asUint64Cls(a).toBytes().asAlgoTs()\n}\n\nexport const len = (a: StubBytesCompat): uint64 => {\n return asBytesCls(a).length.asAlgoTs()\n}\n\nexport const mulw = (a: StubUint64Compat, b: StubUint64Compat): readonly [uint64, uint64] => {\n const uint64A = Uint64Cls.fromCompat(a)\n const uint64B = Uint64Cls.fromCompat(b)\n const product = uint64A.asBigInt() * uint64B.asBigInt()\n return toUint128(product)\n}\n\nexport const replace = (a: StubBytesCompat, b: StubUint64Compat, c: StubBytesCompat): bytes => {\n const bytesValue = BytesCls.fromCompat(a)\n const index = Uint64Cls.fromCompat(b).asNumber()\n const replacement = BytesCls.fromCompat(c)\n\n const valueLength = bytesValue.length.asNumber()\n const replacementLength = replacement.length.asNumber()\n\n if (index + replacementLength > valueLength) {\n throw new CodeError(`expected value <= ${valueLength}, got: ${index + replacementLength}`)\n }\n return bytesValue\n .slice(0, index)\n .concat(replacement)\n .concat(bytesValue.slice(index + replacementLength, valueLength))\n .asAlgoTs()\n}\n\ntype selectType = ((a: StubBytesCompat, b: StubBytesCompat, c: StubUint64Compat) => bytes) &\n ((a: StubUint64Compat, b: StubUint64Compat, c: StubUint64Compat) => uint64)\nexport const select = ((\n a: StubUint64Compat | StubBytesCompat,\n b: StubUint64Compat | StubBytesCompat,\n c: StubUint64Compat,\n): uint64 | bytes => {\n const uint64A = asMaybeUint64Cls(a)\n const uint64B = asMaybeUint64Cls(b)\n const bytesA = asMaybeBytesCls(a)\n const bytesB = asMaybeBytesCls(b)\n const bigIntC = Uint64Cls.fromCompat(c).asBigInt()\n\n return (bigIntC !== 0n ? (uint64B ?? bytesB)! : (uint64A ?? bytesA)!).asAlgoTs()\n}) as selectType\n\ntype SetBitType = ((target: StubBytesCompat, n: StubUint64Compat, c: StubUint64Compat) => bytes) &\n ((target: StubUint64Compat, n: StubUint64Compat, c: StubUint64Compat) => uint64)\n\nexport const setBit = ((a: StubUint64Compat | StubBytesCompat, b: StubUint64Compat, c: StubUint64Compat) => {\n const uint64Cls = asMaybeUint64Cls(a)\n const indexParam = Uint64Cls.fromCompat(b).asNumber()\n const bit = Uint64Cls.fromCompat(c).asNumber()\n if (uint64Cls) {\n const binaryString = toBinaryString(uint64Cls?.toBytes().asAlgoTs())\n const index = binaryString.length - indexParam - 1\n const newBytes = doSetBit(binaryString, index, bit)\n return newBytes.toUint64().asAlgoTs()\n } else {\n const bytesCls = asMaybeBytesCls(a)\n testInvariant(bytesCls, 'a must be uint64 or bytes')\n const binaryString = toBinaryString(bytesCls.asAlgoTs())\n const newBytes = doSetBit(binaryString, indexParam, bit)\n return newBytes.asAlgoTs()\n }\n}) as SetBitType\n\nexport const setByte = (a: StubBytesCompat, b: StubUint64Compat, c: StubUint64Compat): bytes => {\n const binaryString = toBinaryString(BytesCls.fromCompat(a).asAlgoTs())\n\n const byteIndex = Uint64Cls.fromCompat(b).asNumber()\n const bitIndex = byteIndex * BITS_IN_BYTE\n\n const replacementNumber = Uint64Cls.fromCompat(c)\n const replacement = toBinaryString(replacementNumber.toBytes().at(-1).asAlgoTs())\n\n if (bitIndex >= binaryString.length) {\n throw new CodeError(`setByte index ${byteIndex} is beyond length`)\n }\n if (replacementNumber.valueOf() > MAX_UINT8) {\n throw new CodeError(`setByte value ${replacementNumber.asNumber()} > ${MAX_UINT8}`)\n }\n const updatedString = binaryString.slice(0, bitIndex) + replacement + binaryString.slice(bitIndex + replacement.length)\n const updatedBytes = binaryStringToBytes(updatedString)\n return updatedBytes.asAlgoTs()\n}\n\nexport const shl = (a: StubUint64Compat, b: StubUint64Compat): uint64 => {\n const uint64A = Uint64Cls.fromCompat(a)\n const uint64B = Uint64Cls.fromCompat(b)\n const bigIntA = uint64A.asBigInt()\n const bigIntB = uint64B.asBigInt()\n if (bigIntB >= UINT64_SIZE) {\n throw new CodeError(`shl value ${bigIntB} >= ${UINT64_SIZE}`)\n }\n const shifted = (bigIntA * 2n ** bigIntB) % 2n ** BigInt(UINT64_SIZE)\n return Uint64(shifted)\n}\n\nexport const shr = (a: StubUint64Compat, b: StubUint64Compat): uint64 => {\n const uint64A = Uint64Cls.fromCompat(a)\n const uint64B = Uint64Cls.fromCompat(b)\n const bigIntA = uint64A.asBigInt()\n const bigIntB = uint64B.asBigInt()\n if (bigIntB >= UINT64_SIZE) {\n throw new CodeError(`shr value ${bigIntB} >= ${UINT64_SIZE}`)\n }\n const shifted = bigIntA / 2n ** bigIntB\n return Uint64(shifted)\n}\n\nexport const sqrt = (a: StubUint64Compat): uint64 => {\n const bigIntValue = Uint64Cls.fromCompat(a).asBigInt()\n const sqrtValue = squareroot(bigIntValue)\n return Uint64(sqrtValue)\n}\n\nexport const substring = (a: StubBytesCompat, b: StubUint64Compat, c: StubUint64Compat): bytes => {\n const bytesValue = BytesCls.fromCompat(a)\n const start = Uint64Cls.fromCompat(b).asBigInt()\n const end = Uint64Cls.fromCompat(c).asBigInt()\n if (start > end) {\n throw new CodeError('substring end before start')\n }\n if (end > bytesValue.length.asNumber()) {\n throw new CodeError('substring range beyond length of string')\n }\n return bytesValue.slice(start, end).asAlgoTs()\n}\n\nexport const JsonRef = new Proxy({} as typeof op.JsonRef, {\n get: (_target, prop) => {\n throw new NotImplementedError(`JsonRef.${prop.toString()}`)\n },\n})\n\nconst squareroot = (x: bigint): bigint => {\n let lo = 0n,\n hi = x\n while (lo <= hi) {\n const mid = (lo + hi) / 2n\n if (mid * mid > x) hi = mid - 1n\n else lo = mid + 1n\n }\n return hi\n}\n\nconst toUint128 = (value: bigint): [uint64, uint64] => {\n const cf = value >> 64n\n const rest = value & MAX_UINT64\n return [Uint64(cf), Uint64(rest)]\n}\n\nconst uint128ToBigInt = (a: StubUint64Compat, b: StubUint64Compat): bigint => {\n const bigIntA = Uint64Cls.fromCompat(a).asBigInt()\n const bigIntB = Uint64Cls.fromCompat(b).asBigInt()\n return (bigIntA << 64n) + bigIntB\n}\n\nconst toBinaryString = (a: bytes): string => {\n return [...BytesCls.fromCompat(a).asUint8Array()].map((x) => x.toString(2).padStart(BITS_IN_BYTE, '0')).join('')\n}\n\nconst doSetBit = (binaryString: string, index: number, bit: number): BytesCls => {\n if (index < 0 || index >= binaryString.length) {\n throw new CodeError(`setBit index ${index < 0 ? binaryString.length - index : index} is beyond length`)\n }\n if (bit !== 0 && bit !== 1) {\n throw new CodeError(`setBit value > 1`)\n }\n const updatedString = binaryString.slice(0, index) + bit.toString() + binaryString.slice(index + 1)\n return binaryStringToBytes(updatedString)\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.ApplicationTxn\n return txn.assets(input).id\n}\n\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\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, boolean] {\n const asset = getAsset(a)\n return asset === undefined ? [Bytes(), 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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AC,CAAC,CAAC;QACzB,OAAO,KAAK,KAAK,SAAS,GAAG,CAAC,OAAO,EAAE,EAAE,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC;KACxE;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;KACvE;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;KACzE;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;KACxE;;;;;"}
@@ -1,6 +1,6 @@
1
1
  import type { TestExecutionContext } from '../test-execution-context';
2
2
  export declare class ContextManager {
3
- private static asyncStore;
3
+ private static _instance;
4
4
  static set instance(ctx: TestExecutionContext);
5
5
  static get instance(): TestExecutionContext;
6
6
  static reset(): void;
@@ -1,6 +1,6 @@
1
1
  import { encodingUtil } from '@algorandfoundation/puya-ts';
2
- import { e as captureMethodConfig } from './abi-metadata-CRbKDwP2.js';
3
- import { d as BaseContract, am as sha512_256, h as Bytes } from './crypto-DmkHXzw6.js';
2
+ import { e as captureMethodConfig } from './abi-metadata-BA4rupKi.js';
3
+ import { d as BaseContract, am as sha512_256, h as Bytes } from './crypto-BV_GljWM.js';
4
4
 
5
5
  class Contract extends BaseContract {
6
6
  static isArc4 = true;
@@ -21,4 +21,4 @@ const methodSelector = (methodSignature) => {
21
21
  };
22
22
 
23
23
  export { Contract as C, abimethod as a, methodSelector as m };
24
- //# sourceMappingURL=contract-B0nKfmx-.js.map
24
+ //# sourceMappingURL=contract-G60Xb_gx.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"contract-B0nKfmx-.js","sources":["../src/impl/contract.ts"],"sourcesContent":["import type { arc4, bytes } from '@algorandfoundation/algorand-typescript'\nimport { encodingUtil } from '@algorandfoundation/puya-ts'\nimport { captureMethodConfig } from '../abi-metadata'\nimport type { DeliberateAny } from '../typescript-helpers'\nimport { BaseContract } from './base-contract'\nimport { sha512_256 } from './crypto'\nimport { Bytes } from './primitives'\n\nexport class Contract extends BaseContract {\n static isArc4 = true\n\n override approvalProgram(): boolean {\n return true\n }\n}\n\nexport function abimethod<TContract extends Contract>(config?: arc4.AbiMethodConfig<TContract>) {\n return function <TArgs extends DeliberateAny[], TReturn>(\n target: (this: TContract, ...args: TArgs) => TReturn,\n ctx: ClassMethodDecoratorContext<TContract>,\n ): (this: TContract, ...args: TArgs) => TReturn {\n ctx.addInitializer(function () {\n captureMethodConfig(this, target.name, config)\n })\n return target\n }\n}\n\nexport function baremethod<TContract extends Contract>(config?: arc4.BareMethodConfig) {\n return function <TArgs extends DeliberateAny[], TReturn>(\n target: (this: TContract, ...args: TArgs) => TReturn,\n ctx: ClassMethodDecoratorContext<TContract>,\n ): (this: TContract, ...args: TArgs) => TReturn {\n ctx.addInitializer(function () {\n captureMethodConfig(this, target.name, config)\n })\n return target\n }\n}\n\nexport const methodSelector: typeof arc4.methodSelector = (methodSignature: string): bytes => {\n return sha512_256(Bytes(encodingUtil.utf8ToUint8Array(methodSignature))).slice(0, 4)\n}\n"],"names":[],"mappings":";;;;AAQM,MAAO,QAAS,SAAQ,YAAY,CAAA;AACxC,IAAA,OAAO,MAAM,GAAG,IAAI;IAEX,eAAe,GAAA;AACtB,QAAA,OAAO,IAAI;;;AAIT,SAAU,SAAS,CAA6B,MAAwC,EAAA;IAC5F,OAAO,UACL,MAAoD,EACpD,GAA2C,EAAA;QAE3C,GAAG,CAAC,cAAc,CAAC,YAAA;YACjB,mBAAmB,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC;AAChD,SAAC,CAAC;AACF,QAAA,OAAO,MAAM;AACf,KAAC;AACH;AAca,MAAA,cAAc,GAA+B,CAAC,eAAuB,KAAW;AAC3F,IAAA,OAAO,UAAU,CAAC,KAAK,CAAC,YAAY,CAAC,gBAAgB,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC;AACtF;;;;"}
1
+ {"version":3,"file":"contract-G60Xb_gx.js","sources":["../src/impl/contract.ts"],"sourcesContent":["import type { arc4, bytes } from '@algorandfoundation/algorand-typescript'\nimport { encodingUtil } from '@algorandfoundation/puya-ts'\nimport { captureMethodConfig } from '../abi-metadata'\nimport type { DeliberateAny } from '../typescript-helpers'\nimport { BaseContract } from './base-contract'\nimport { sha512_256 } from './crypto'\nimport { Bytes } from './primitives'\n\nexport class Contract extends BaseContract {\n static isArc4 = true\n\n override approvalProgram(): boolean {\n return true\n }\n}\n\nexport function abimethod<TContract extends Contract>(config?: arc4.AbiMethodConfig<TContract>) {\n return function <TArgs extends DeliberateAny[], TReturn>(\n target: (this: TContract, ...args: TArgs) => TReturn,\n ctx: ClassMethodDecoratorContext<TContract>,\n ): (this: TContract, ...args: TArgs) => TReturn {\n ctx.addInitializer(function () {\n captureMethodConfig(this, target.name, config)\n })\n return target\n }\n}\n\nexport function baremethod<TContract extends Contract>(config?: arc4.BareMethodConfig) {\n return function <TArgs extends DeliberateAny[], TReturn>(\n target: (this: TContract, ...args: TArgs) => TReturn,\n ctx: ClassMethodDecoratorContext<TContract>,\n ): (this: TContract, ...args: TArgs) => TReturn {\n ctx.addInitializer(function () {\n captureMethodConfig(this, target.name, config)\n })\n return target\n }\n}\n\nexport const methodSelector: typeof arc4.methodSelector = (methodSignature: string): bytes => {\n return sha512_256(Bytes(encodingUtil.utf8ToUint8Array(methodSignature))).slice(0, 4)\n}\n"],"names":[],"mappings":";;;;AAQM,MAAO,QAAS,SAAQ,YAAY,CAAA;AACxC,IAAA,OAAO,MAAM,GAAG,IAAI;IAEX,eAAe,GAAA;AACtB,QAAA,OAAO,IAAI;;;AAIT,SAAU,SAAS,CAA6B,MAAwC,EAAA;IAC5F,OAAO,UACL,MAAoD,EACpD,GAA2C,EAAA;QAE3C,GAAG,CAAC,cAAc,CAAC,YAAA;YACjB,mBAAmB,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC;AAChD,SAAC,CAAC;AACF,QAAA,OAAO,MAAM;AACf,KAAC;AACH;AAca,MAAA,cAAc,GAA+B,CAAC,eAAuB,KAAW;AAC3F,IAAA,OAAO,UAAU,CAAC,KAAK,CAAC,YAAY,CAAC,gBAAgB,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC;AACtF;;;;"}
@@ -8,7 +8,6 @@ import js_sha256 from 'js-sha256';
8
8
  import js_sha3 from 'js-sha3';
9
9
  import nacl from 'tweetnacl';
10
10
  import { n as nameOfType$1 } from './typescript-helpers-CAukFXpp.js';
11
- import { AsyncLocalStorage } from 'node:async_hooks';
12
11
  import { randomBytes } from 'crypto';
13
12
 
14
13
  /**
@@ -789,21 +788,19 @@ function contract(options) {
789
788
  }
790
789
 
791
790
  class ContextManager {
792
- static asyncStore = new AsyncLocalStorage();
791
+ static _instance;
793
792
  static set instance(ctx) {
794
- const instance = this.asyncStore.getStore();
795
- if (instance !== undefined)
793
+ if (this._instance !== undefined)
796
794
  throw new Error('Execution context has already been set');
797
- this.asyncStore.enterWith(ctx);
795
+ this._instance = ctx;
798
796
  }
799
797
  static get instance() {
800
- const instance = this.asyncStore.getStore();
801
- if (instance === undefined)
798
+ if (this._instance === undefined)
802
799
  throw new Error('No execution context has been set');
803
- return instance;
800
+ return this._instance;
804
801
  }
805
802
  static reset() {
806
- this.asyncStore.disable();
803
+ this._instance = undefined;
807
804
  }
808
805
  }
809
806
 
@@ -2286,4 +2283,4 @@ const curveMap = {
2286
2283
  };
2287
2284
 
2288
2285
  export { StrImpl as $, AccountCls as A, BigUintCls as B, CodeError as C, asNumber as D, ABI_RETURN_VALUE_LOG_PREFIX as E, testInvariant as F, Uint64 as G, getRandomBigInt as H, InternalError as I, asBigUintCls as J, BigUint as K, MAX_BYTES_SIZE as L, MAX_UINT64 as M, Account as N, getRandomBytes as O, MAX_UINT512 as P, AddressImpl as Q, UintNImpl as R, MAX_UINT8 as S, TRANSACTION_GROUP_MAX_SIZE as T, Uint64Cls as U, MAX_UINT16 as V, MAX_UINT32 as W, MAX_UINT128 as X, MAX_UINT256 as Y, DynamicBytesImpl as Z, BITS_IN_BYTE as _, BytesCls as a, ContextManager as a0, DEFAULT_TEMPLATE_VAR_PREFIX as a1, AvmError as a2, NotImplementedError as a3, toExternalValue as a4, BytesBackedCls as a5, Uint64BackedCls as a6, assert as a7, asMaybeBigUintCls as a8, contract as a9, arc4Encoders as aA, getArc4Encoder as aB, EllipticCurve as aC, ecdsaPkDecompress as aD, ecdsaPkRecover as aE, ecdsaVerify as aF, ed25519verify as aG, ed25519verifyBare as aH, keccak256 as aI, mimc as aJ, sha256 as aK, sha3_256 as aL, vrfVerify as aM, getObjectReference as aN, getApplicationAddress as aO, MIN_TXN_FEE as aP, DEFAULT_ACCOUNT_MIN_BALANCE as aQ, DEFAULT_MAX_TXN_LIFE as aR, ZERO_ADDRESS as aS, DEFAULT_ASSET_CREATE_MIN_BALANCE as aT, DEFAULT_ASSET_OPT_IN_MIN_BALANCE as aU, DEFAULT_GLOBAL_GENESIS_HASH as aV, asBigUint as aW, isUint64 as aX, binaryStringToBytes as aY, UINT64_SIZE as aZ, err as aa, combineIntoMaxBytePages as ab, MAX_ITEMS_IN_LOG as ac, asBytesCls as ad, MAX_BOX_SIZE as ae, conactUint8Arrays as af, asAccount as ag, asAsset as ah, asApplication as ai, nameOfType as aj, getArc4Encoded as ak, getArc4TypeName as al, sha512_256 as am, checkBigUint as an, checkBytes as ao, decodeArc4Impl as ap, encodeArc4Impl as aq, UFixedNxMImpl as ar, ByteImpl as as, BoolImpl as at, StaticArrayImpl as au, DynamicArrayImpl as av, TupleImpl as aw, StructImpl as ax, StaticBytesImpl as ay, interpretAsArc4Impl as az, AlgoTsPrimitiveCls as b, AssertError as c, BaseContract as d, ContractOptionsSymbol as e, ApplicationCls as f, AssetCls as g, Bytes as h, BytesMap as i, iterBigInt as j, Uint64Map as k, lazyContext as l, AccountMap as m, Asset as n, asUint64 as o, Application as p, asMaybeUint64Cls as q, asUint64Cls as r, AssetHolding as s, AccountData as t, ApplicationData as u, getDefaultAssetData as v, asBigInt as w, asBytes as x, asMaybeBytesCls as y, asUint8Array as z };
2289
- //# sourceMappingURL=crypto-DmkHXzw6.js.map
2286
+ //# sourceMappingURL=crypto-BV_GljWM.js.map