@algorandfoundation/algorand-typescript-testing 1.0.0-alpha.32 → 1.0.0-alpha.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -3
- package/abi-metadata.d.ts +4 -1
- package/{arc4-NUIDD7u8.js → arc4-D8pjYoEx.js} +16 -9
- package/arc4-D8pjYoEx.js.map +1 -0
- package/{asset-params-DUSsiQc-.js → asset-params-CB1bSY-h.js} +20 -6
- package/asset-params-CB1bSY-h.js.map +1 -0
- package/index.mjs +16 -6
- package/index.mjs.map +1 -1
- package/{inner-transactions-DRcscck-.js → inner-transactions-BNLLTHy1.js} +5 -17
- package/inner-transactions-BNLLTHy1.js.map +1 -0
- package/internal/arc4.mjs +6 -6
- package/internal/index.mjs +11 -11
- package/internal/index.mjs.map +1 -1
- package/internal/op.mjs +4 -4
- package/{op-CVk0hPaW.js → op-CijHY8aC.js} +4 -4
- package/{op-CVk0hPaW.js.map → op-CijHY8aC.js.map} +1 -1
- package/package.json +5 -4
- package/{program-factory-CnCxBkRE.js → program-factory-hpvWBZGd.js} +55 -17
- package/program-factory-hpvWBZGd.js.map +1 -0
- package/{pure-DhEtcaWK.js → pure-CAsk1mZp.js} +4 -4
- package/pure-CAsk1mZp.js.map +1 -0
- package/{runtime-helpers-DupU6hSL.js → runtime-helpers-CuMj7wHA.js} +26 -4
- package/runtime-helpers-CuMj7wHA.js.map +1 -0
- package/runtime-helpers.mjs +2 -2
- package/test-transformer/jest-transformer.mjs +2 -1
- package/test-transformer/jest-transformer.mjs.map +1 -1
- package/test-transformer/vitest-transformer.mjs +2 -1
- package/test-transformer/vitest-transformer.mjs.map +1 -1
- package/{utils-Bkc_IVMO.js → utils-C5PYEp-V.js} +4 -4
- package/utils-C5PYEp-V.js.map +1 -0
- package/arc4-NUIDD7u8.js.map +0 -1
- package/asset-params-DUSsiQc-.js.map +0 -1
- package/inner-transactions-DRcscck-.js.map +0 -1
- package/program-factory-CnCxBkRE.js.map +0 -1
- package/pure-DhEtcaWK.js.map +0 -1
- package/runtime-helpers-DupU6hSL.js.map +0 -1
- package/utils-Bkc_IVMO.js.map +0 -1
package/README.md
CHANGED
|
@@ -169,7 +169,19 @@ After the setup, the examples provided using `vitest` can be converted to work w
|
|
|
169
169
|
#### Contract Definition
|
|
170
170
|
|
|
171
171
|
```typescript
|
|
172
|
-
import {
|
|
172
|
+
import {
|
|
173
|
+
arc4,
|
|
174
|
+
assert,
|
|
175
|
+
Bytes,
|
|
176
|
+
GlobalState,
|
|
177
|
+
gtxn,
|
|
178
|
+
LocalState,
|
|
179
|
+
op,
|
|
180
|
+
readonly,
|
|
181
|
+
Txn,
|
|
182
|
+
uint64,
|
|
183
|
+
Uint64,
|
|
184
|
+
} from '@algorandfoundation/algorand-typescript'
|
|
173
185
|
|
|
174
186
|
export default class VotingContract extends arc4.Contract {
|
|
175
187
|
topic = GlobalState({ initialValue: 'default_topic', key: Bytes('topic') })
|
|
@@ -195,7 +207,7 @@ export default class VotingContract extends arc4.Contract {
|
|
|
195
207
|
return true
|
|
196
208
|
}
|
|
197
209
|
|
|
198
|
-
@
|
|
210
|
+
@readonly
|
|
199
211
|
public getVotes(): uint64 {
|
|
200
212
|
return this.votes.value
|
|
201
213
|
}
|
|
@@ -262,7 +274,7 @@ This example demonstrates key aspects of testing with `algorand-typescript-testi
|
|
|
262
274
|
|
|
263
275
|
- Use of `arc4.Contract` as the base class for the contract.
|
|
264
276
|
- ABI methods defined using the `@arc4.abimethod` decorator.
|
|
265
|
-
- Readonly method annotation with `@arc4.abimethod({readonly: true})`.
|
|
277
|
+
- Readonly method annotation with `@arc4.abimethod({readonly: true})` or `@readonly`.
|
|
266
278
|
|
|
267
279
|
2. Testing ARC4 Contracts:
|
|
268
280
|
|
package/abi-metadata.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import * as arc4$1 from '@algorandfoundation/algorand-typescript/arc4';
|
|
2
2
|
import { OnCompleteAction } from '@algorandfoundation/algorand-typescript';
|
|
3
|
-
import { g as getContractMethodAbiMetadata, C as Contract, b as abimethod, c as baremethod } from './runtime-helpers-
|
|
4
|
-
import { v as lazyContext, a0 as
|
|
5
|
-
import {
|
|
6
|
-
import { A as
|
|
3
|
+
import { d as getContractByName, g as getContractMethodAbiMetadata, C as Contract, b as abimethod, c as baremethod, r as readonly } from './runtime-helpers-CuMj7wHA.js';
|
|
4
|
+
import { v as lazyContext, a0 as sizeOf } from './utils-C5PYEp-V.js';
|
|
5
|
+
import { I as InternalError } from './typescript-helpers-sobuICoc.js';
|
|
6
|
+
import { A as ApplicationCallInnerTxnContext, m as methodSelector } from './inner-transactions-BNLLTHy1.js';
|
|
7
|
+
import { A as Address, B as Bool, b as Byte, c as DynamicArray, D as DynamicBytes, F as FixedArray, R as ReferenceArray, d as StaticArray, e as StaticBytes, S as Str, f as Struct, T as Tuple, h as UFixed, U as Uint, i as decodeArc4, j as encodeArc4, k as interpretAsArc4 } from './asset-params-CB1bSY-h.js';
|
|
7
8
|
|
|
8
9
|
function _mergeNamespaces(n, m) {
|
|
9
10
|
m.forEach(function (e) {
|
|
@@ -93,8 +94,13 @@ function getApplicationCallInnerTxnContext(method, methodArgs, contract) {
|
|
|
93
94
|
}, selector, abiMetadata?.resourceEncoding);
|
|
94
95
|
}
|
|
95
96
|
/** @internal */
|
|
96
|
-
function abiCall(method, methodArgs
|
|
97
|
-
const
|
|
97
|
+
function abiCall(contractFullName, method, methodArgs) {
|
|
98
|
+
const contract = getContractByName(contractFullName);
|
|
99
|
+
if (contract === undefined || typeof contract !== 'function')
|
|
100
|
+
throw new InternalError(`Unknown contract: ${contractFullName}`);
|
|
101
|
+
if (!Object.hasOwn(contract.prototype, method))
|
|
102
|
+
throw new InternalError(`Unknown method: ${method} in contract: ${contractFullName}`);
|
|
103
|
+
const itxnContext = getApplicationCallInnerTxnContext(contract.prototype[method], methodArgs, contract);
|
|
98
104
|
invokeAbiCall(itxnContext);
|
|
99
105
|
return {
|
|
100
106
|
itxn: itxnContext,
|
|
@@ -123,14 +129,15 @@ var arc4 = /*#__PURE__*/_mergeNamespaces({
|
|
|
123
129
|
Uint: Uint,
|
|
124
130
|
abiCall: abiCall,
|
|
125
131
|
abimethod: abimethod,
|
|
126
|
-
arc4EncodedLength: arc4EncodedLength,
|
|
127
132
|
baremethod: baremethod,
|
|
128
133
|
compileArc4: compileArc4,
|
|
129
134
|
decodeArc4: decodeArc4,
|
|
130
135
|
encodeArc4: encodeArc4,
|
|
131
136
|
interpretAsArc4: interpretAsArc4,
|
|
132
|
-
methodSelector: methodSelector
|
|
137
|
+
methodSelector: methodSelector,
|
|
138
|
+
readonly: readonly,
|
|
139
|
+
sizeOf: sizeOf
|
|
133
140
|
}, [arc4$1]);
|
|
134
141
|
|
|
135
142
|
export { arc4 as a, abiCall as b, compileArc4 as c, getApplicationCallInnerTxnContext as g };
|
|
136
|
-
//# sourceMappingURL=arc4-
|
|
143
|
+
//# sourceMappingURL=arc4-D8pjYoEx.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"arc4-D8pjYoEx.js","sources":["../src/impl/c2c.ts","../src/internal/arc4.ts"],"sourcesContent":["import { type CompileContractOptions, type Contract, OnCompleteAction } from '@algorandfoundation/algorand-typescript'\nimport type {\n BareCreateApplicationCallFields,\n ContractProxy,\n TypedApplicationCallFields,\n} from '@algorandfoundation/algorand-typescript/arc4'\nimport { getContractByName, getContractMethodAbiMetadata } from '../abi-metadata'\nimport { lazyContext } from '../context-helpers/internal-context'\nimport { InternalError } from '../errors'\nimport type { ConstructorFor, DeliberateAny, InstanceMethod } from '../typescript-helpers'\nimport type { ApplicationCallInnerTxn } from './inner-transactions'\nimport { ApplicationCallInnerTxnContext } from './inner-transactions'\nimport { methodSelector } from './method-selector'\nimport type { ApplicationData } from './reference'\n\n/** @internal */\nexport function compileArc4<TContract extends Contract>(\n contract: ConstructorFor<TContract>,\n options?: CompileContractOptions,\n): ContractProxy<TContract> {\n let app: ApplicationData | undefined\n const compiledAppEntry = lazyContext.value.getCompiledAppEntry(contract)\n if (compiledAppEntry !== undefined) {\n app = lazyContext.ledger.applicationDataMap.get(compiledAppEntry.value)\n }\n\n if (options?.templateVars) {\n Object.entries(options.templateVars).forEach(([key, value]) => {\n lazyContext.value.setTemplateVar(key, value, options.templateVarsPrefix)\n })\n }\n\n return {\n call: new Proxy({} as unknown as TContract, {\n get: (_target, prop) => {\n return (methodArgs: TypedApplicationCallFields<DeliberateAny[]>) => {\n const selector = methodSelector(prop as string, contract)\n const abiMetadata = getContractMethodAbiMetadata(contract, prop as string)\n const onCompleteActions = abiMetadata?.allowActions?.map((action) => OnCompleteAction[action])\n const itxnContext = ApplicationCallInnerTxnContext.createFromTypedApplicationCallFields(\n {\n ...getCommonApplicationCallFields(app, options),\n onCompletion: onCompleteActions?.[0],\n ...methodArgs,\n },\n selector,\n abiMetadata?.resourceEncoding,\n )\n invokeAbiCall(itxnContext)\n return {\n itxn: itxnContext,\n returnValue: itxnContext.loggedReturnValue,\n }\n }\n },\n }),\n\n bareCreate: (methodArgs?: BareCreateApplicationCallFields) => {\n const itxnContext = ApplicationCallInnerTxnContext.createFromBareCreateApplicationCallFields({\n ...getCommonApplicationCallFields(app, options),\n ...methodArgs,\n })\n invokeAbiCall(itxnContext)\n return itxnContext\n },\n approvalProgram: app?.application.approvalProgram ?? [lazyContext.any.bytes(10), lazyContext.any.bytes(10)],\n clearStateProgram: app?.application.clearStateProgram ?? [lazyContext.any.bytes(10), lazyContext.any.bytes(10)],\n extraProgramPages: options?.extraProgramPages ?? app?.application.extraProgramPages ?? lazyContext.any.uint64(),\n globalUints: options?.globalUints ?? app?.application.globalNumUint ?? lazyContext.any.uint64(),\n globalBytes: options?.globalBytes ?? app?.application.globalNumBytes ?? lazyContext.any.uint64(),\n localUints: options?.localUints ?? app?.application.localNumUint ?? lazyContext.any.uint64(),\n localBytes: options?.localBytes ?? app?.application.localNumBytes ?? lazyContext.any.uint64(),\n } as unknown as ContractProxy<TContract>\n}\n\n/** @internal */\nexport const invokeAbiCall = (itxnContext: ApplicationCallInnerTxnContext) => {\n lazyContext.value.notifyApplicationSpies(itxnContext)\n lazyContext.txn.activeGroup.addInnerTransactionGroup(...(itxnContext.itxns ?? []), itxnContext)\n}\nconst getCommonApplicationCallFields = (app: ApplicationData | undefined, options: CompileContractOptions | undefined) => ({\n approvalProgram: app?.application.approvalProgram ?? [lazyContext.any.bytes(10), lazyContext.any.bytes(10)],\n clearStateProgram: app?.application.clearStateProgram ?? [lazyContext.any.bytes(10), lazyContext.any.bytes(10)],\n extraProgramPages: options?.extraProgramPages ?? app?.application.extraProgramPages ?? lazyContext.any.uint64(),\n globalNumUint: options?.globalUints ?? app?.application.globalNumUint ?? lazyContext.any.uint64(),\n globalNumBytes: options?.globalBytes ?? app?.application.globalNumBytes ?? lazyContext.any.uint64(),\n localNumUint: options?.localUints ?? app?.application.localNumUint ?? lazyContext.any.uint64(),\n localNumBytes: options?.localBytes ?? app?.application.localNumBytes ?? lazyContext.any.uint64(),\n})\n\n/** @internal */\nexport function getApplicationCallInnerTxnContext<TArgs extends DeliberateAny[], TReturn = void>(\n method: InstanceMethod<Contract, TArgs, TReturn>,\n methodArgs: TypedApplicationCallFields<TArgs>,\n contract?: Contract | { new (): Contract },\n) {\n const abiMetadata = contract ? getContractMethodAbiMetadata(contract, method.name) : undefined\n const selector = methodSelector(method, contract)\n return ApplicationCallInnerTxnContext.createFromTypedApplicationCallFields<TReturn>(\n {\n ...methodArgs,\n onCompletion: methodArgs.onCompletion ?? abiMetadata?.allowActions?.map((action) => OnCompleteAction[action])[0],\n },\n selector,\n abiMetadata?.resourceEncoding,\n )\n}\n/** @internal */\nexport function abiCall<TArgs extends DeliberateAny[], TReturn>(\n contractFullName: string,\n method: string,\n methodArgs: TypedApplicationCallFields<TArgs>,\n): { itxn: ApplicationCallInnerTxn; returnValue: TReturn | undefined } {\n const contract = getContractByName(contractFullName)\n if (contract === undefined || typeof contract !== 'function') throw new InternalError(`Unknown contract: ${contractFullName}`)\n if (!Object.hasOwn(contract.prototype, method)) throw new InternalError(`Unknown method: ${method} in contract: ${contractFullName}`)\n\n const itxnContext = getApplicationCallInnerTxnContext<TArgs, TReturn>(contract.prototype[method], methodArgs, contract)\n\n invokeAbiCall(itxnContext)\n\n return {\n itxn: itxnContext,\n returnValue: itxnContext.loggedReturnValue,\n }\n}\n","/** @internal */\nexport * from '@algorandfoundation/algorand-typescript/arc4'\n/** @internal */\nexport { abiCall, compileArc4 } from '../impl/c2c'\n/** @internal */\nexport { abimethod, baremethod, Contract, readonly } from '../impl/contract'\n/** @internal */\nexport {\n Address,\n Bool,\n Byte,\n decodeArc4,\n DynamicArray,\n DynamicBytes,\n encodeArc4,\n FixedArray,\n interpretAsArc4,\n ReferenceArray,\n sizeOf,\n StaticArray,\n StaticBytes,\n Str,\n Struct,\n Tuple,\n UFixed,\n Uint,\n} from '../impl/encoded-types'\n/** @internal */\nexport { methodSelector } from '../impl/method-selector'\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAeA;AACM,SAAU,WAAW,CACzB,QAAmC,EACnC,OAAgC,EAAA;AAEhC,IAAA,IAAI,GAAgC;IACpC,MAAM,gBAAgB,GAAG,WAAW,CAAC,KAAK,CAAC,mBAAmB,CAAC,QAAQ,CAAC;AACxE,IAAA,IAAI,gBAAgB,KAAK,SAAS,EAAE;AAClC,QAAA,GAAG,GAAG,WAAW,CAAC,MAAM,CAAC,kBAAkB,CAAC,GAAG,CAAC,gBAAgB,CAAC,KAAK,CAAC;IACzE;AAEA,IAAA,IAAI,OAAO,EAAE,YAAY,EAAE;AACzB,QAAA,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,KAAI;AAC5D,YAAA,WAAW,CAAC,KAAK,CAAC,cAAc,CAAC,GAAG,EAAE,KAAK,EAAE,OAAO,CAAC,kBAAkB,CAA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U,CAAC,YAAY,IAAI,WAAW,EAAE,YAAY,EAAE,GAAG,CAAC,CAAC,MAAM,KAAK,gBAAgB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;AACjH,KAAA,EACD,QAAQ,EACR,WAAW,EAAE,gBAAgB,CAC9B;AACH;AACA;SACgB,OAAO,CACrB,gBAAwB,EACxB,MAAc,EACd,UAA6C,EAAA;AAE7C,IAAA,MAAM,QAAQ,GAAG,iBAAiB,CAAC,gBAAgB,CAAC;AACpD,IAAA,IAAI,QAAQ,KAAK,SAAS,IAAI,OAAO,QAAQ,KAAK,UAAU;AAAE,QAAA,MAAM,IAAI,aAAa,CAAC,qBAAqB,gBAAgB,CAAA,CAAE,CAAC;IAC9H,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;QAAE,MAAM,IAAI,aAAa,CAAC,CAAA,gBAAA,EAAmB,MAAM,CAAA,cAAA,EAAiB,gBAAgB,CAAA,CAAE,CAAC;AAErI,IAAA,MAAM,WAAW,GAAG,iCAAiC,CAAiB,QAAQ,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,UAAU,EAAE,QAAQ,CAAC;IAEvH,aAAa,CAAC,WAAW,CAAC;IAE1B,OAAO;AACL,QAAA,IAAI,EAAE,WAAW;QACjB,WAAW,EAAE,WAAW,CAAC,iBAAiB;KAC3C;AACH;;AC7HA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -2,7 +2,7 @@ import { FixedArray as FixedArray$1, ReferenceArray as ReferenceArray$1, Ecdsa,
|
|
|
2
2
|
import { Address as Address$1, Bool as Bool$1, Byte as Byte$1, DynamicArray as DynamicArray$1, DynamicBytes as DynamicBytes$1, StaticArray as StaticArray$1, StaticBytes as StaticBytes$1, Str as Str$1, Struct as Struct$1, Tuple as Tuple$1, UFixed as UFixed$1, Uint as Uint$1, ARC4Encoded } from '@algorandfoundation/algorand-typescript/arc4';
|
|
3
3
|
import { encodingUtil } from '@algorandfoundation/puya-ts';
|
|
4
4
|
import assert from 'assert';
|
|
5
|
-
import { au as arrayUtil, av as ALGORAND_ADDRESS_BYTE_LENGTH, aw as ALGORAND_CHECKSUM_BYTE_LENGTH, ax as isBytes, ay as getUint8Array, E as Account, az as TRUE_BIGINT_VALUE, aA as FALSE_BIGINT_VALUE, D as Bytes, a4 as asBytesCls, u as ABI_RETURN_VALUE_LOG_PREFIX, s as asUint8Array, aB as getNativeValue, aC as areAllARC4Encoded, aD as checkItemTypeName, aE as readLength, a6 as conactUint8Arrays, aF as encodeLength, aG as ABI_LENGTH_SIZE, f as asBytes, aH as getMaxLengthOfStaticContentType, a as asNumber, aI as IS_INITIALISING_FROM_BYTES_SYMBOL, aJ as trimTrailingDecimalZeros, aK as regExpNxM, aL as maxBigIntValue, aM as maxBytesLength, h as asUint64, aq as asBigUint, at as UINT64_SIZE, aN as validBitSizes, y as asBigUintCls, k as asMaybeUint64Cls, r as asMaybeBytesCls, Z as asMaybeBigUintCls, X as BytesBackedCls, Y as Uint64BackedCls, l as asUint64Cls, aO as transactionTypeFromBytes, aP as onCompletionFromBytes, aQ as uint64FromBytes, aR as stringFromBytes, aS as bytesFromBytes, aT as bigUintFromBytes, aU as booleanFromBytes, G as AssetCls, t as ApplicationCls, A as AccountCls, U as Uint64Cls, q as asBigInt, B as BigUintCls, b as BytesCls, aV as holdsDynamicLengthContent, aW as uint8ArrayToNumber, aX as findBoolTypes, aY as compressMultipleBool, aZ as findBool, ag as FixedBytes, a_ as LOGIC_DATA_PREFIX, v as lazyContext, a$ as PROGRAM_TAG, w as Uint64 } from './utils-
|
|
5
|
+
import { au as arrayUtil, av as ALGORAND_ADDRESS_BYTE_LENGTH, aw as ALGORAND_CHECKSUM_BYTE_LENGTH, ax as isBytes, ay as getUint8Array, E as Account, az as TRUE_BIGINT_VALUE, aA as FALSE_BIGINT_VALUE, D as Bytes, a4 as asBytesCls, u as ABI_RETURN_VALUE_LOG_PREFIX, s as asUint8Array, aB as getNativeValue, aC as areAllARC4Encoded, aD as checkItemTypeName, aE as readLength, a6 as conactUint8Arrays, aF as encodeLength, aG as ABI_LENGTH_SIZE, f as asBytes, aH as getMaxLengthOfStaticContentType, a as asNumber, aI as IS_INITIALISING_FROM_BYTES_SYMBOL, aJ as trimTrailingDecimalZeros, aK as regExpNxM, aL as maxBigIntValue, aM as maxBytesLength, h as asUint64, aq as asBigUint, at as UINT64_SIZE, aN as validBitSizes, y as asBigUintCls, M as MAX_UINT64, k as asMaybeUint64Cls, r as asMaybeBytesCls, Z as asMaybeBigUintCls, X as BytesBackedCls, Y as Uint64BackedCls, l as asUint64Cls, aO as transactionTypeFromBytes, aP as onCompletionFromBytes, aQ as uint64FromBytes, aR as stringFromBytes, aS as bytesFromBytes, aT as bigUintFromBytes, aU as booleanFromBytes, G as AssetCls, t as ApplicationCls, A as AccountCls, U as Uint64Cls, q as asBigInt, B as BigUintCls, b as BytesCls, aV as holdsDynamicLengthContent, aW as uint8ArrayToNumber, aX as findBoolTypes, aY as compressMultipleBool, aZ as findBool, ag as FixedBytes, a_ as LOGIC_DATA_PREFIX, v as lazyContext, a$ as PROGRAM_TAG, w as Uint64 } from './utils-C5PYEp-V.js';
|
|
6
6
|
import { a as AvmError, b as avmInvariant, C as CodeError, I as InternalError, n as nameOfType, N as NotImplementedError } from './typescript-helpers-sobuICoc.js';
|
|
7
7
|
import elliptic from 'elliptic';
|
|
8
8
|
import js_sha256 from 'js-sha256';
|
|
@@ -65,7 +65,18 @@ class Uint extends Uint$1 {
|
|
|
65
65
|
}
|
|
66
66
|
get native() {
|
|
67
67
|
const bigIntValue = encodingUtil.uint8ArrayToBigInt(this.value);
|
|
68
|
-
return
|
|
68
|
+
return this.bitSize <= UINT64_SIZE ? asUint64(bigIntValue) : asBigUint(bigIntValue);
|
|
69
|
+
}
|
|
70
|
+
asUint64() {
|
|
71
|
+
const bigIntValue = encodingUtil.uint8ArrayToBigInt(this.value);
|
|
72
|
+
if (bigIntValue > MAX_UINT64) {
|
|
73
|
+
throw new CodeError('value too large to fit in uint64');
|
|
74
|
+
}
|
|
75
|
+
return asUint64(bigIntValue);
|
|
76
|
+
}
|
|
77
|
+
asBigUint() {
|
|
78
|
+
const bigIntValue = encodingUtil.uint8ArrayToBigInt(this.value);
|
|
79
|
+
return asBigUint(bigIntValue);
|
|
69
80
|
}
|
|
70
81
|
get bytes() {
|
|
71
82
|
return Bytes(this.value);
|
|
@@ -111,7 +122,7 @@ class UFixed extends UFixed$1 {
|
|
|
111
122
|
}
|
|
112
123
|
get native() {
|
|
113
124
|
const bigIntValue = encodingUtil.uint8ArrayToBigInt(this.value);
|
|
114
|
-
return
|
|
125
|
+
return this.bitSize <= UINT64_SIZE ? asUint64(bigIntValue) : asBigUint(bigIntValue);
|
|
115
126
|
}
|
|
116
127
|
get bytes() {
|
|
117
128
|
return Bytes(this.value);
|
|
@@ -146,8 +157,11 @@ class Byte extends Byte$1 {
|
|
|
146
157
|
this.typeInfo = typeof typeInfo === 'string' ? JSON.parse(typeInfo) : typeInfo;
|
|
147
158
|
this.value = new Uint(typeInfo, v);
|
|
148
159
|
}
|
|
149
|
-
|
|
150
|
-
return this.value.
|
|
160
|
+
asUint64() {
|
|
161
|
+
return this.value.asUint64();
|
|
162
|
+
}
|
|
163
|
+
asBigUint() {
|
|
164
|
+
return this.value.asBigUint();
|
|
151
165
|
}
|
|
152
166
|
get bytes() {
|
|
153
167
|
return this.value.bytes;
|
|
@@ -1355,4 +1369,4 @@ const AssetParams = {
|
|
|
1355
1369
|
};
|
|
1356
1370
|
|
|
1357
1371
|
export { Address as A, Bool as B, vrfVerify as C, DynamicBytes as D, EllipticCurve as E, FixedArray as F, ReferenceArray as R, Str as S, Tuple as T, Uint as U, getArc4Encoded as a, Byte as b, DynamicArray as c, StaticArray as d, StaticBytes as e, Struct as f, getEncoder as g, UFixed as h, decodeArc4 as i, encodeArc4 as j, interpretAsArc4 as k, getApp as l, getAsset as m, AppParams as n, AssetParams as o, ecdsaPkDecompress as p, ecdsaPkRecover as q, ecdsaVerify as r, sha512_256 as s, toBytes as t, ed25519verify as u, ed25519verifyBare as v, keccak256 as w, mimc as x, sha256 as y, sha3_256 as z };
|
|
1358
|
-
//# sourceMappingURL=asset-params-
|
|
1372
|
+
//# sourceMappingURL=asset-params-CB1bSY-h.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"asset-params-CB1bSY-h.js","sources":["../src/impl/encoded-types/array-proxy.ts","../src/impl/encoded-types/encoded-types.ts","../src/impl/crypto.ts","../src/impl/app-params.ts","../src/impl/asset-params.ts"],"sourcesContent":["import type { Uint64Compat } from '@algorandfoundation/algorand-typescript'\nimport { AvmError } from '../../errors'\nimport { arrayUtil } from '../primitives'\n\n/** @internal */\nexport const arrayProxyHandler = <TItem>() => ({\n get(target: { items: readonly TItem[] }, prop: PropertyKey) {\n const idx = prop ? parseInt(prop.toString(), 10) : NaN\n if (!isNaN(idx)) {\n if (idx >= 0 && idx < target.items.length) return target.items[idx]\n throw new AvmError('Index out of bounds')\n } else if (prop === Symbol.iterator) {\n return target.items[Symbol.iterator].bind(target.items)\n } else if (prop === 'entries') {\n return target.items.entries.bind(target.items)\n } else if (prop === 'keys') {\n return target.items.keys.bind(target.items)\n } else if (prop === 'at') {\n return (index: Uint64Compat): TItem => {\n return arrayUtil.arrayAt(target.items, index)\n }\n }\n return Reflect.get(target, prop)\n },\n set(target: { items: TItem[]; setItem: (index: number, value: TItem) => void }, prop: PropertyKey, value: TItem) {\n const idx = prop ? parseInt(prop.toString(), 10) : NaN\n if (!isNaN(idx)) {\n if (idx >= 0 && idx < target.items.length) {\n target.setItem(idx, value)\n return true\n }\n throw new AvmError('Index out of bounds')\n }\n\n return Reflect.set(target, prop, value)\n },\n})\n","import type { Account as AccountType, bytes, NTuple, StringCompat, uint64, Uint64Compat } from '@algorandfoundation/algorand-typescript'\nimport { FixedArray as _FixedArray, ReferenceArray as _ReferenceArray } from '@algorandfoundation/algorand-typescript'\nimport type { BitSize } from '@algorandfoundation/algorand-typescript/arc4'\nimport {\n Address as _Address,\n ARC4Encoded as _ARC4Encoded,\n Bool as _Bool,\n Byte as _Byte,\n DynamicArray as _DynamicArray,\n DynamicBytes as _DynamicBytes,\n StaticArray as _StaticArray,\n StaticBytes as _StaticBytes,\n Str as _Str,\n Struct as _Struct,\n Tuple as _Tuple,\n UFixed as _UFixed,\n Uint as _Uint,\n} from '@algorandfoundation/algorand-typescript/arc4'\nimport { encodingUtil } from '@algorandfoundation/puya-ts'\nimport assert from 'assert'\nimport {\n ABI_RETURN_VALUE_LOG_PREFIX,\n ALGORAND_ADDRESS_BYTE_LENGTH,\n ALGORAND_CHECKSUM_BYTE_LENGTH,\n MAX_UINT64,\n UINT64_SIZE,\n} from '../../constants'\nimport { AvmError, avmInvariant, CodeError, InternalError } from '../../errors'\nimport { nameOfType, type DeliberateAny } from '../../typescript-helpers'\nimport {\n asBigInt,\n asBigUint,\n asBigUintCls,\n asBytes,\n asBytesCls,\n asMaybeBigUintCls,\n asMaybeBytesCls,\n asMaybeUint64Cls,\n asNumber,\n asUint64,\n asUint64Cls,\n asUint8Array,\n conactUint8Arrays,\n uint8ArrayToNumber,\n} from '../../util'\nimport { BytesBackedCls, Uint64BackedCls } from '../base'\nimport type { StubBytesCompat } from '../primitives'\nimport { BigUintCls, Bytes, BytesCls, getUint8Array, isBytes, Uint64Cls } from '../primitives'\nimport { Account, AccountCls, ApplicationCls, AssetCls } from '../reference'\nimport { arrayProxyHandler } from './array-proxy'\nimport { ABI_LENGTH_SIZE, FALSE_BIGINT_VALUE, IS_INITIALISING_FROM_BYTES_SYMBOL, TRUE_BIGINT_VALUE } from './constants'\nimport {\n areAllARC4Encoded,\n bigUintFromBytes,\n booleanFromBytes,\n bytesFromBytes,\n checkItemTypeName,\n compressMultipleBool,\n encodeLength,\n findBool,\n findBoolTypes,\n getNativeValue,\n holdsDynamicLengthContent,\n maxBigIntValue,\n maxBytesLength,\n onCompletionFromBytes,\n readLength,\n regExpNxM,\n stringFromBytes,\n transactionTypeFromBytes,\n trimTrailingDecimalZeros,\n uint64FromBytes,\n validBitSizes,\n} from './helpers'\nimport type {\n CompatForArc4Int,\n DynamicArrayGenericArgs,\n fromBytes,\n StaticArrayGenericArgs,\n StructConstraint,\n TypeInfo,\n uFixedGenericArgs,\n} from './types'\nimport { getMaxLengthOfStaticContentType } from './utils'\n\n/** @internal */\nexport class Uint<N extends BitSize> extends _Uint<N> {\n private value: Uint8Array\n private bitSize: N\n typeInfo: TypeInfo\n\n constructor(typeInfo: TypeInfo | string, v?: CompatForArc4Int<N>) {\n super()\n this.typeInfo = typeof typeInfo === 'string' ? JSON.parse(typeInfo) : typeInfo\n this.bitSize = Uint.getMaxBitsLength(this.typeInfo) as N\n\n assert(validBitSizes.includes(this.bitSize), `Invalid bit size ${this.bitSize}`)\n\n const bigIntValue = asBigUintCls(v ?? 0n).valueOf()\n const maxValue = maxBigIntValue(this.bitSize)\n assert(bigIntValue <= maxValue, `expected value <= ${maxValue}, got: ${bigIntValue}`)\n\n this.value = encodingUtil.bigIntToUint8Array(bigIntValue, maxBytesLength(this.bitSize))\n }\n\n get native() {\n const bigIntValue = encodingUtil.uint8ArrayToBigInt(this.value)\n return this.bitSize <= UINT64_SIZE ? asUint64(bigIntValue) : asBigUint(bigIntValue)\n }\n\n asUint64() {\n const bigIntValue = encodingUtil.uint8ArrayToBigInt(this.value)\n if (bigIntValue > MAX_UINT64) {\n throw new CodeError('value too large to fit in uint64')\n }\n return asUint64(bigIntValue)\n }\n\n asBigUint() {\n const bigIntValue = encodingUtil.uint8ArrayToBigInt(this.value)\n return asBigUint(bigIntValue)\n }\n\n get bytes(): bytes {\n return Bytes(this.value)\n }\n\n equals(other: this): boolean {\n if (!(other instanceof Uint) || JSON.stringify(this.typeInfo) !== JSON.stringify(other.typeInfo)) {\n throw new CodeError(`Expected expression of type ${this.typeInfo.name}, got ${other.typeInfo.name}`)\n }\n return this.bytes.equals(other.bytes)\n }\n\n static fromBytes(value: StubBytesCompat | Uint8Array, typeInfo: string | TypeInfo, prefix: 'none' | 'log' = 'none'): Uint<BitSize> {\n let bytesValue = asBytesCls(value)\n if (prefix === 'log') {\n assert(bytesValue.slice(0, 4).equals(ABI_RETURN_VALUE_LOG_PREFIX), 'ABI return prefix not found')\n bytesValue = bytesValue.slice(4)\n }\n const result = new Uint<BitSize>(typeInfo)\n result.value = asUint8Array(bytesValue)\n return result\n }\n\n static getMaxBitsLength(typeInfo: TypeInfo): BitSize {\n return parseInt((typeInfo.genericArgs as TypeInfo[])![0].name, 10) as BitSize\n }\n}\n\n/** @internal */\nexport class UFixed<N extends BitSize, M extends number> extends _UFixed<N, M> {\n private value: Uint8Array\n private bitSize: N\n private precision: M\n typeInfo: TypeInfo\n\n constructor(typeInfo: TypeInfo | string, v?: `${number}.${number}`) {\n super(v)\n this.typeInfo = typeof typeInfo === 'string' ? JSON.parse(typeInfo) : typeInfo\n const genericArgs = this.typeInfo.genericArgs as uFixedGenericArgs\n this.bitSize = UFixed.getMaxBitsLength(this.typeInfo) as N\n this.precision = parseInt(genericArgs.m.name, 10) as M\n\n const trimmedValue = trimTrailingDecimalZeros(v ?? '0.0')\n assert(regExpNxM(this.precision).test(trimmedValue), `expected positive decimal literal with max of ${this.precision} decimal places`)\n\n const bigIntValue = BigInt(trimmedValue.replace('.', ''))\n const maxValue = maxBigIntValue(this.bitSize)\n assert(bigIntValue <= maxValue, `expected value <= ${maxValue}, got: ${bigIntValue}`)\n\n this.value = encodingUtil.bigIntToUint8Array(bigIntValue, maxBytesLength(this.bitSize))\n }\n\n get native() {\n const bigIntValue = encodingUtil.uint8ArrayToBigInt(this.value)\n return this.bitSize <= UINT64_SIZE ? asUint64(bigIntValue) : asBigUint(bigIntValue)\n }\n\n get bytes(): bytes {\n return Bytes(this.value)\n }\n\n equals(other: this): boolean {\n if (!(other instanceof UFixed) || JSON.stringify(this.typeInfo) !== JSON.stringify(other.typeInfo)) {\n throw new CodeError(`Expected expression of type ${this.typeInfo.name}, got ${other.typeInfo.name}`)\n }\n return this.bytes.equals(other.bytes)\n }\n\n static fromBytes(\n value: StubBytesCompat | Uint8Array,\n typeInfo: string | TypeInfo,\n prefix: 'none' | 'log' = 'none',\n ): _UFixed<BitSize, number> {\n let bytesValue = asBytesCls(value)\n if (prefix === 'log') {\n assert(bytesValue.slice(0, 4).equals(ABI_RETURN_VALUE_LOG_PREFIX), 'ABI return prefix not found')\n bytesValue = bytesValue.slice(4)\n }\n const result = new UFixed<BitSize, number>(typeInfo, '0.0')\n result.value = asUint8Array(bytesValue)\n return result\n }\n\n static getMaxBitsLength(typeInfo: TypeInfo): BitSize {\n const genericArgs = typeInfo.genericArgs as uFixedGenericArgs\n return parseInt(genericArgs.n.name, 10) as BitSize\n }\n}\n\n/** @internal */\nexport class Byte extends _Byte {\n typeInfo: TypeInfo\n private value: Uint<8>\n\n constructor(typeInfo: TypeInfo | string, v?: CompatForArc4Int<8>) {\n super(v)\n this.typeInfo = typeof typeInfo === 'string' ? JSON.parse(typeInfo) : typeInfo\n this.value = new Uint<8>(typeInfo, v)\n }\n\n asUint64() {\n return this.value.asUint64()\n }\n\n asBigUint() {\n return this.value.asBigUint()\n }\n\n get bytes(): bytes {\n return this.value.bytes\n }\n\n equals(other: this): boolean {\n if (!(other instanceof Byte) || JSON.stringify(this.value.typeInfo) !== JSON.stringify(other.value.typeInfo)) {\n throw new CodeError(`Expected expression of type ${this.value.typeInfo.name}, got ${other.value.typeInfo.name}`)\n }\n return this.bytes.equals(other.bytes)\n }\n\n static fromBytes(value: StubBytesCompat | Uint8Array, typeInfo: string | TypeInfo, prefix: 'none' | 'log' = 'none'): Byte {\n const uintNValue = Uint.fromBytes(value, typeInfo, prefix) as Uint<8>\n const result = new Byte(typeInfo)\n result.value = uintNValue\n return result\n }\n\n static getMaxBitsLength(typeInfo: TypeInfo): BitSize {\n return Uint.getMaxBitsLength(typeInfo)\n }\n}\n\n/** @internal */\nexport class Str extends _Str {\n typeInfo: TypeInfo\n private value: Uint8Array\n\n constructor(typeInfo: TypeInfo | string, s?: StringCompat) {\n super()\n const bytesValue = asBytesCls(s ?? '')\n const bytesLength = encodeLength(bytesValue.length.asNumber())\n this.typeInfo = typeof typeInfo === 'string' ? JSON.parse(typeInfo) : typeInfo\n this.value = asUint8Array(bytesLength.concat(bytesValue))\n }\n get native(): string {\n return encodingUtil.uint8ArrayToUtf8(this.value.slice(ABI_LENGTH_SIZE))\n }\n\n get bytes(): bytes {\n return Bytes(this.value)\n }\n\n equals(other: this): boolean {\n if (!(other instanceof Str)) {\n throw new CodeError(`Expected expression of type Str, got ${(other as object).constructor.name}`)\n }\n return this.bytes.equals(other.bytes)\n }\n\n static fromBytes(value: StubBytesCompat | Uint8Array, typeInfo: string | TypeInfo, prefix: 'none' | 'log' = 'none'): Str {\n let bytesValue = asBytesCls(value)\n if (prefix === 'log') {\n assert(bytesValue.slice(0, 4).equals(ABI_RETURN_VALUE_LOG_PREFIX), 'ABI return prefix not found')\n bytesValue = bytesValue.slice(4)\n }\n const result = new Str(typeInfo)\n result.value = asUint8Array(bytesValue)\n return result\n }\n}\n\n/** @internal */\nexport class Bool extends _Bool {\n private value: Uint8Array\n typeInfo: TypeInfo\n\n constructor(typeInfo: TypeInfo | string, v?: boolean) {\n super(v)\n this.typeInfo = typeof typeInfo === 'string' ? JSON.parse(typeInfo) : typeInfo\n this.value = encodingUtil.bigIntToUint8Array(v ? TRUE_BIGINT_VALUE : FALSE_BIGINT_VALUE, 1)\n }\n\n get native(): boolean {\n return encodingUtil.uint8ArrayToBigInt(this.value) === TRUE_BIGINT_VALUE\n }\n\n equals(other: this): boolean {\n if (!(other instanceof Bool)) {\n throw new CodeError(`Expected expression of type Bool, got ${(other as object).constructor.name}`)\n }\n return this.bytes.equals(other.bytes)\n }\n\n get bytes(): bytes {\n return Bytes(this.value?.length ? this.value : new Uint8Array([0]))\n }\n\n static fromBytes(value: StubBytesCompat | Uint8Array, typeInfo: string | TypeInfo, prefix: 'none' | 'log' = 'none'): Bool {\n let bytesValue = asBytesCls(value)\n if (prefix === 'log') {\n assert(bytesValue.slice(0, 4).equals(ABI_RETURN_VALUE_LOG_PREFIX), 'ABI return prefix not found')\n bytesValue = bytesValue.slice(4)\n }\n const result = new Bool(typeInfo)\n result.value = asUint8Array(bytesValue)\n return result\n }\n}\n\n/** @internal */\nexport class StaticArray<TItem extends _ARC4Encoded, TLength extends number> extends _StaticArray<TItem, TLength> {\n private value?: NTuple<TItem, TLength>\n private uint8ArrayValue?: Uint8Array\n private size: number\n typeInfo: TypeInfo\n genericArgs: StaticArrayGenericArgs\n\n constructor(typeInfo: TypeInfo | string, ...items: TItem[] & { length: TLength })\n constructor(typeInfo: TypeInfo | string, ...items: TItem[])\n constructor(typeInfo: TypeInfo | string, ...items: TItem[] & { length: TLength }) {\n // if first item is the symbol, we are initialising from bytes\n // so we don't need to pass the items to the super constructor\n const isInitialisingFromBytes = items.length === 1 && (items[0] as DeliberateAny) === IS_INITIALISING_FROM_BYTES_SYMBOL\n super(...(isInitialisingFromBytes ? [] : (items as DeliberateAny)))\n\n this.typeInfo = typeof typeInfo === 'string' ? JSON.parse(typeInfo) : typeInfo\n this.genericArgs = this.typeInfo.genericArgs as StaticArrayGenericArgs\n this.size = parseInt(this.genericArgs.size.name, 10)\n\n // if we are not initialising from bytes, we need to check and set the items\n if (!isInitialisingFromBytes) {\n if (items.length && items.length !== this.size) {\n throw new CodeError(`expected ${this.size} items, not ${items.length}`)\n }\n\n assert(areAllARC4Encoded(items), 'expected ARC4 type')\n\n items.forEach((item) => {\n checkItemTypeName(this.genericArgs.elementType, item)\n })\n\n if (items.length) {\n this.value = items as NTuple<TItem, TLength>\n } else {\n this.uint8ArrayValue = new Uint8Array(getMaxLengthOfStaticContentType(this.typeInfo))\n }\n }\n return new Proxy(this, arrayProxyHandler<TItem>()) as StaticArray<TItem, TLength>\n }\n\n get bytes(): bytes {\n return Bytes(this.uint8ArrayValue ?? encode(this.items))\n }\n\n equals(other: this): boolean {\n if (!(other instanceof StaticArray) || JSON.stringify(this.typeInfo) !== JSON.stringify(other.typeInfo)) {\n throw new CodeError(`Expected expression of type ${this.typeInfo.name}, got ${other.typeInfo.name}`)\n }\n return this.bytes.equals(other.bytes)\n }\n\n get length(): uint64 {\n return this.size\n }\n\n get items(): NTuple<TItem, TLength> {\n if (this.uint8ArrayValue) {\n const childTypes = Array(this.size).fill(this.genericArgs.elementType)\n this.value = decode(this.uint8ArrayValue, childTypes) as NTuple<TItem, TLength>\n this.uint8ArrayValue = undefined\n return this.value\n } else if (this.value) {\n this.uint8ArrayValue = undefined\n return this.value\n }\n throw new CodeError('value is not set')\n }\n\n setItem(index: number, value: TItem): void {\n this.items[index] = value\n }\n\n copy(): StaticArray<TItem, TLength> {\n return StaticArray.fromBytes(this.bytes, JSON.stringify(this.typeInfo)) as unknown as StaticArray<TItem, TLength>\n }\n\n concat(other: Parameters<InstanceType<typeof _StaticArray>['concat']>[0]): DynamicArray<TItem> {\n const items = this.items\n const otherEntries = other.entries()\n let next = otherEntries.next()\n while (!next.done) {\n items.push(next.value[1] as TItem)\n next = otherEntries.next()\n }\n return new DynamicArray<TItem>(\n { name: `DynamicArray<${this.genericArgs.elementType.name}>`, genericArgs: { elementType: this.genericArgs.elementType } },\n ...items,\n )\n }\n\n get native(): NTuple<TItem, TLength> {\n return this.items\n }\n\n static fromBytes(\n value: StubBytesCompat | Uint8Array,\n typeInfo: string | TypeInfo,\n prefix: 'none' | 'log' = 'none',\n ): StaticArray<_ARC4Encoded, number> {\n let bytesValue = asBytesCls(value)\n if (prefix === 'log') {\n assert(bytesValue.slice(0, 4).equals(ABI_RETURN_VALUE_LOG_PREFIX), 'ABI return prefix not found')\n bytesValue = bytesValue.slice(4)\n }\n // pass the symbol to the constructor to let it know we are initialising from bytes\n const result = new StaticArray<_ARC4Encoded, number>(typeInfo, IS_INITIALISING_FROM_BYTES_SYMBOL as DeliberateAny)\n result.uint8ArrayValue = asUint8Array(bytesValue)\n return result\n }\n}\n\n/** @internal */\nexport class Address extends _Address {\n typeInfo: TypeInfo\n private value: StaticArray<Byte, 32>\n\n constructor(typeInfo: TypeInfo | string, value?: AccountType | string | bytes) {\n super(value)\n let uint8ArrayValue: Uint8Array\n if (value === undefined) {\n uint8ArrayValue = new Uint8Array(32)\n } else if (typeof value === 'string') {\n uint8ArrayValue = encodingUtil.base32ToUint8Array(value).slice(0, ALGORAND_ADDRESS_BYTE_LENGTH - ALGORAND_CHECKSUM_BYTE_LENGTH)\n } else if (isBytes(value)) {\n uint8ArrayValue = getUint8Array(value)\n } else {\n uint8ArrayValue = getUint8Array(value.bytes)\n }\n avmInvariant(uint8ArrayValue.length === 32, 'Addresses should be 32 bytes')\n\n this.value = StaticArray.fromBytes(uint8ArrayValue, typeInfo) as StaticArray<Byte, 32>\n this.typeInfo = typeof typeInfo === 'string' ? JSON.parse(typeInfo) : typeInfo\n return new Proxy(this, arrayProxyHandler<Byte>()) as Address\n }\n\n get bytes(): bytes {\n return this.value.bytes\n }\n\n equals(other: this): boolean {\n if (!(other instanceof Address) || JSON.stringify(this.typeInfo) !== JSON.stringify(other.typeInfo)) {\n throw new CodeError(`Expected expression of type ${this.typeInfo.name}, got ${other.typeInfo.name}`)\n }\n return this.bytes.equals(other.bytes)\n }\n\n get length(): uint64 {\n return 32\n }\n\n get native(): AccountType {\n return Account(this.value.bytes)\n }\n\n get items(): readonly Byte[] {\n return this.value.items\n }\n\n setItem(_index: number, _value: Byte): void {\n throw new CodeError('Address is immutable')\n }\n\n static fromBytes(value: StubBytesCompat | Uint8Array, typeInfo: string | TypeInfo, prefix: 'none' | 'log' = 'none'): Address {\n const staticArrayValue = StaticArray.fromBytes(value, typeInfo, prefix) as StaticArray<Byte, 32>\n const result = new Address(typeInfo)\n result.value = staticArrayValue\n return result\n }\n}\n\n/** @internal */\nexport class DynamicArray<TItem extends _ARC4Encoded> extends _DynamicArray<TItem> {\n private value?: TItem[]\n private uint8ArrayValue?: Uint8Array\n typeInfo: TypeInfo\n genericArgs: DynamicArrayGenericArgs\n\n constructor(typeInfo: TypeInfo | string, ...items: TItem[]) {\n super(...(items as TItem[]))\n this.typeInfo = typeof typeInfo === 'string' ? JSON.parse(typeInfo) : typeInfo\n this.genericArgs = this.typeInfo.genericArgs as DynamicArrayGenericArgs\n\n assert(areAllARC4Encoded(items), 'expected ARC4 type')\n\n items.forEach((item) => {\n checkItemTypeName(this.genericArgs.elementType, item)\n })\n this.value = items\n\n return new Proxy(this, arrayProxyHandler<TItem>()) as DynamicArray<TItem>\n }\n\n get bytes(): bytes {\n return Bytes(this.uint8ArrayValue ?? this.encodeWithLength(this.items))\n }\n\n equals(other: this): boolean {\n if (!(other instanceof DynamicArray) || JSON.stringify(this.typeInfo) !== JSON.stringify(other.typeInfo)) {\n throw new CodeError(`Expected expression of type ${this.typeInfo.name}, got ${other.typeInfo.name}`)\n }\n return this.bytes.equals(other.bytes)\n }\n\n get length(): uint64 {\n return this.items.length\n }\n\n get items(): TItem[] {\n if (this.uint8ArrayValue) {\n const [length, data] = readLength(this.uint8ArrayValue)\n const childTypes = Array(length).fill(this.genericArgs.elementType)\n this.value = decode(data, childTypes) as TItem[]\n this.uint8ArrayValue = undefined\n return this.value\n } else if (this.value) {\n this.uint8ArrayValue = undefined\n return this.value\n }\n throw new CodeError('value is not set')\n }\n\n setItem(index: number, value: TItem): void {\n this.items[index] = value\n }\n\n copy(): DynamicArray<TItem> {\n return DynamicArray.fromBytes(this.bytes, JSON.stringify(this.typeInfo)) as DynamicArray<TItem>\n }\n\n get native(): TItem[] {\n return this.items\n }\n\n push(...values: TItem[]) {\n const items = this.items\n items.push(...values)\n }\n\n pop(): TItem {\n const items = this.items\n const popped = items.pop()\n if (popped === undefined) throw new AvmError('The array is empty')\n return popped\n }\n\n concat(other: Parameters<InstanceType<typeof _DynamicArray>['concat']>[0]): DynamicArray<TItem> {\n const items = this.items\n const otherEntries = other.entries()\n let next = otherEntries.next()\n while (!next.done) {\n items.push(next.value[1] as TItem)\n next = otherEntries.next()\n }\n return new DynamicArray<TItem>(this.typeInfo, ...items)\n }\n\n static fromBytes(\n value: StubBytesCompat | Uint8Array,\n typeInfo: string | TypeInfo,\n prefix: 'none' | 'log' = 'none',\n ): DynamicArray<_ARC4Encoded> {\n let bytesValue = asBytesCls(value)\n if (prefix === 'log') {\n assert(bytesValue.slice(0, 4).equals(ABI_RETURN_VALUE_LOG_PREFIX), 'ABI return prefix not found')\n bytesValue = bytesValue.slice(4)\n }\n const result = new DynamicArray(typeInfo)\n result.uint8ArrayValue = asUint8Array(bytesValue)\n return result\n }\n\n private encodeWithLength(items: TItem[]) {\n return conactUint8Arrays(encodeLength(items.length).asUint8Array(), encode(items))\n }\n}\n\n/** @internal */\nexport class Tuple<TTuple extends [_ARC4Encoded, ..._ARC4Encoded[]]> extends _Tuple<TTuple> {\n private value?: TTuple\n private uint8ArrayValue?: Uint8Array\n typeInfo: TypeInfo\n genericArgs: TypeInfo[]\n\n constructor(typeInfo: TypeInfo | string, ...items: TTuple) {\n // if first item is the symbol, we are initialising from bytes\n // so we don't need to pass the items to the super constructor\n const isInitialisingFromBytes = items.length === 1 && (items[0] as DeliberateAny) === IS_INITIALISING_FROM_BYTES_SYMBOL\n super(...(isInitialisingFromBytes ? ([] as DeliberateAny) : items))\n this.typeInfo = typeof typeInfo === 'string' ? JSON.parse(typeInfo) : typeInfo\n this.genericArgs = Object.values(this.typeInfo.genericArgs as Record<string, TypeInfo>)\n\n // if we are not initialising from bytes, we need to check and set the items\n if (!isInitialisingFromBytes) {\n assert(areAllARC4Encoded(items), 'expected ARC4 type')\n\n items.forEach((item, index) => {\n checkItemTypeName(this.genericArgs[index], item)\n })\n if (items.length) {\n this.value = items\n } else {\n this.uint8ArrayValue = new Uint8Array(getMaxLengthOfStaticContentType(this.typeInfo))\n }\n }\n }\n\n get bytes(): bytes {\n return Bytes(this.uint8ArrayValue ?? encode(this.items))\n }\n\n equals(other: this): boolean {\n if (!(other instanceof Tuple) || JSON.stringify(this.typeInfo) !== JSON.stringify(other.typeInfo)) {\n throw new CodeError(`Expected expression of type ${this.typeInfo.name}, got ${other.typeInfo.name}`)\n }\n return this.bytes.equals(other.bytes)\n }\n\n get length(): TTuple['length'] & uint64 {\n return this.items.length\n }\n\n get native(): TTuple {\n return this.items\n }\n\n at<TIndex extends keyof TTuple>(index: TIndex): TTuple[TIndex] {\n return this.items[index]\n }\n\n private get items(): TTuple {\n if (this.uint8ArrayValue) {\n this.value = decode(this.uint8ArrayValue, this.genericArgs) as TTuple\n this.uint8ArrayValue = undefined\n return this.value\n } else if (this.value) {\n this.uint8ArrayValue = undefined\n return this.value\n }\n throw new CodeError('value is not set')\n }\n\n static fromBytes(\n value: StubBytesCompat | Uint8Array,\n typeInfo: string | TypeInfo,\n prefix: 'none' | 'log' = 'none',\n ): Tuple<[_ARC4Encoded, ..._ARC4Encoded[]]> {\n let bytesValue = asBytesCls(value)\n if (prefix === 'log') {\n assert(bytesValue.slice(0, 4).equals(ABI_RETURN_VALUE_LOG_PREFIX), 'ABI return prefix not found')\n bytesValue = bytesValue.slice(4)\n }\n // pass the symbol to the constructor to let it know we are initialising from bytes\n const result = new Tuple(typeInfo, IS_INITIALISING_FROM_BYTES_SYMBOL as DeliberateAny)\n result.uint8ArrayValue = asUint8Array(bytesValue)\n return result\n }\n}\n\n/** @internal */\nexport class Struct<T extends StructConstraint> extends (_Struct<StructConstraint> as DeliberateAny) {\n private uint8ArrayValue?: Uint8Array\n genericArgs: Record<string, TypeInfo>\n\n constructor(typeInfo: TypeInfo | string, value: T = {} as T) {\n super(value)\n this.typeInfo = typeof typeInfo === 'string' ? JSON.parse(typeInfo) : typeInfo\n this.genericArgs = this.typeInfo.genericArgs as Record<string, TypeInfo>\n\n Object.keys(this.genericArgs).forEach((key) => {\n Object.defineProperty(this, key, {\n value: value[key],\n writable: true,\n enumerable: true,\n })\n })\n\n return new Proxy(this, {\n get(target, prop) {\n const originalValue = Reflect.get(target, prop)\n if (originalValue === undefined && target.uint8ArrayValue?.length && Object.keys(target.genericArgs).includes(prop.toString())) {\n return target.items[prop.toString()]\n }\n return originalValue\n },\n set(target, prop, value) {\n if (target.uint8ArrayValue && Object.keys(target.genericArgs).includes(prop.toString())) {\n target.decodeAsProperties()\n }\n return Reflect.set(target, prop, value)\n },\n })\n }\n\n get bytes(): bytes {\n return Bytes(this.uint8ArrayValue ?? encode(Object.values(this.items)))\n }\n\n get items(): T {\n this.decodeAsProperties()\n const result = {} as StructConstraint\n Object.keys(this.genericArgs).forEach((key) => {\n result[key] = (this as unknown as StructConstraint)[key]\n })\n return result as T\n }\n\n get native(): T {\n return this.items\n }\n\n copy(): Struct<T> {\n return Struct.fromBytes(this.bytes, JSON.stringify(this.typeInfo)) as Struct<T>\n }\n\n private decodeAsProperties() {\n if (this.uint8ArrayValue) {\n const values = decode(this.uint8ArrayValue, Object.values(this.genericArgs))\n Object.keys(this.genericArgs).forEach((key, index) => {\n ;(this as unknown as StructConstraint)[key] = values[index]\n })\n this.uint8ArrayValue = undefined\n }\n }\n\n static fromBytes(\n value: StubBytesCompat | Uint8Array,\n typeInfo: string | TypeInfo,\n prefix: 'none' | 'log' = 'none',\n ): Struct<StructConstraint> {\n let bytesValue = asBytesCls(value)\n if (prefix === 'log') {\n assert(bytesValue.slice(0, 4).equals(ABI_RETURN_VALUE_LOG_PREFIX), 'ABI return prefix not found')\n bytesValue = bytesValue.slice(4)\n }\n const result = new Struct(typeInfo)\n result.uint8ArrayValue = asUint8Array(bytesValue)\n return result\n }\n}\n\n/** @internal */\nexport class DynamicBytes extends _DynamicBytes {\n typeInfo: TypeInfo\n private value: DynamicArray<Byte>\n\n constructor(typeInfo: TypeInfo | string, value?: bytes | string) {\n super(value)\n const uint8ArrayValue = conactUint8Arrays(encodeLength(value?.length ?? 0).asUint8Array(), asUint8Array(value ?? new Uint8Array()))\n this.value = DynamicArray.fromBytes(uint8ArrayValue, typeInfo) as DynamicArray<Byte>\n this.typeInfo = typeof typeInfo === 'string' ? JSON.parse(typeInfo) : typeInfo\n return new Proxy(this, arrayProxyHandler<Byte>()) as DynamicBytes\n }\n\n get bytes(): bytes {\n return this.value.bytes\n }\n\n equals(other: this): boolean {\n if (!(other instanceof DynamicBytes) || JSON.stringify(this.typeInfo) !== JSON.stringify(other.typeInfo)) {\n throw new CodeError(`Expected expression of type ${this.typeInfo.name}, got ${other.typeInfo.name}`)\n }\n return this.bytes.equals(other.bytes)\n }\n\n get length(): uint64 {\n return this.value.length\n }\n\n get native(): bytes {\n return this.value.bytes.slice(ABI_LENGTH_SIZE)\n }\n\n get items(): Byte[] {\n return this.value.items\n }\n\n setItem(_index: number, _value: Byte): void {\n throw new CodeError('DynamicBytes is immutable')\n }\n\n concat(other: Parameters<InstanceType<typeof _DynamicBytes>['concat']>[0]): DynamicBytes {\n const items = this.items\n const otherEntries = other.entries()\n let next = otherEntries.next()\n while (!next.done) {\n items.push(next.value[1] as Byte)\n next = otherEntries.next()\n }\n const concatenatedBytes = items\n .map((item) => item.bytes)\n .reduce((acc, curr) => conactUint8Arrays(acc, asUint8Array(curr)), new Uint8Array())\n return new DynamicBytes(this.typeInfo, asBytes(concatenatedBytes))\n }\n\n static fromBytes(value: StubBytesCompat | Uint8Array, typeInfo: string | TypeInfo, prefix: 'none' | 'log' = 'none'): DynamicBytes {\n const dynamicArrayValue = DynamicArray.fromBytes(value, typeInfo, prefix) as DynamicArray<Byte>\n const result = new DynamicBytes(typeInfo)\n result.value = dynamicArrayValue\n return result\n }\n}\n\n/** @internal */\nexport class StaticBytes<TLength extends uint64 = 0> extends _StaticBytes<TLength> {\n private value: StaticArray<Byte, TLength>\n typeInfo: TypeInfo\n\n constructor(typeInfo: TypeInfo | string, value?: bytes<TLength>) {\n super(value ?? (Bytes() as bytes<TLength>))\n this.typeInfo = typeof typeInfo === 'string' ? JSON.parse(typeInfo) : typeInfo\n const uint8ArrayValue = asUint8Array(value ?? new Uint8Array(getMaxLengthOfStaticContentType(this.typeInfo)))\n this.value = StaticArray.fromBytes(uint8ArrayValue, typeInfo) as unknown as StaticArray<Byte, TLength>\n return new Proxy(this, arrayProxyHandler<Byte>()) as StaticBytes<TLength>\n }\n\n get bytes(): bytes {\n return this.value.bytes\n }\n\n equals(other: this): boolean {\n if (!(other instanceof StaticBytes) || JSON.stringify(this.typeInfo) !== JSON.stringify(other.typeInfo)) {\n throw new CodeError(`Expected expression of type ${this.typeInfo.name}, got ${other.typeInfo.name}`)\n }\n return this.bytes.equals(other.bytes)\n }\n\n get length(): uint64 {\n return this.value.length\n }\n\n get native(): bytes<TLength> {\n return this.value.bytes as bytes<TLength>\n }\n\n get items(): Byte[] {\n return this.value.items\n }\n\n setItem(_index: number, _value: Byte): void {\n throw new CodeError('StaticBytes is immutable')\n }\n\n concat(other: Parameters<InstanceType<typeof _StaticBytes>['concat']>[0]): DynamicBytes {\n const items = this.items\n const otherEntries = other.entries()\n let next = otherEntries.next()\n while (!next.done) {\n items.push(next.value[1] as Byte)\n next = otherEntries.next()\n }\n const concatenatedBytes = items\n .map((item) => item.bytes)\n .reduce((acc, curr) => conactUint8Arrays(acc, asUint8Array(curr)), new Uint8Array())\n return new DynamicBytes(this.typeInfo, asBytes(concatenatedBytes))\n }\n\n static fromBytes(value: StubBytesCompat | Uint8Array, typeInfo: string | TypeInfo, prefix: 'none' | 'log' = 'none'): StaticBytes {\n const staticArrayValue = StaticArray.fromBytes(value, typeInfo, prefix) as StaticArray<Byte, number>\n const result = new StaticBytes(typeInfo)\n result.value = staticArrayValue as StaticArray<Byte, 0>\n return result\n }\n}\n\n/** @internal */\nexport class ReferenceArray<TItem> extends _ReferenceArray<TItem> {\n private _values: TItem[]\n typeInfo: TypeInfo\n\n constructor(typeInfo: TypeInfo | string, ...items: TItem[]) {\n super(...items)\n this.typeInfo = typeof typeInfo === 'string' ? JSON.parse(typeInfo) : typeInfo\n this._values = items\n\n return new Proxy(this, arrayProxyHandler<TItem>()) as ReferenceArray<TItem>\n }\n\n /**\n * Returns the current length of this array\n */\n get length(): uint64 {\n return this._values.length\n }\n\n get items(): TItem[] {\n return this._values\n }\n\n setItem(index: number, value: TItem): void {\n this.items[index] = value\n }\n\n slice(start?: Uint64Compat, end?: Uint64Compat): _ReferenceArray<TItem> {\n const startIndex = end === undefined ? 0 : asNumber(start ?? 0)\n const endIndex = end === undefined ? asNumber(start ?? this._values.length) : asNumber(end)\n return new ReferenceArray<TItem>(this.typeInfo, ...this._values.slice(startIndex, endIndex))\n }\n\n /**\n * Push a number of items into this array\n * @param items The items to be added to this array\n */\n push(...items: TItem[]): void {\n this._values.push(...items)\n }\n\n /**\n * Pop a single item from this array\n */\n pop(): TItem {\n return this._values.pop()!\n }\n\n copy(): _ReferenceArray<TItem> {\n const bytesValue = toBytes(this)\n return getEncoder<_ReferenceArray<TItem>>(this.typeInfo)(bytesValue, this.typeInfo)\n }\n}\n\n/** @internal */\nexport class FixedArray<TItem, TLength extends number> extends _FixedArray<TItem, TLength> {\n private _values: NTuple<TItem, TLength>\n private size: number\n typeInfo: TypeInfo\n private genericArgs: StaticArrayGenericArgs\n\n constructor(typeInfo: TypeInfo | string, ...items: TItem[] & { length: TLength }) {\n super(...(items as DeliberateAny))\n this.typeInfo = typeof typeInfo === 'string' ? JSON.parse(typeInfo) : typeInfo\n this.genericArgs = this.typeInfo.genericArgs as StaticArrayGenericArgs\n this.size = parseInt(this.genericArgs.size.name, 10)\n if (items.length) {\n this._values = items as NTuple<TItem, TLength>\n } else {\n const bytesValue = asBytes(new Uint8Array(getMaxLengthOfStaticContentType(this.typeInfo)))\n this._values = (getEncoder<_FixedArray<TItem, TLength>>(this.typeInfo)(bytesValue, this.typeInfo) as FixedArray<TItem, TLength>).items\n }\n return new Proxy(this, arrayProxyHandler<TItem>()) as FixedArray<TItem, TLength>\n }\n\n concat(...others: (TItem | ConcatArray<TItem>)[]): TItem[] {\n return this.items.concat(...others)\n }\n\n get length(): uint64 {\n return this.size\n }\n\n get items(): NTuple<TItem, TLength> {\n return this._values\n }\n\n setItem(index: number, value: TItem): void {\n this.items[index] = value\n }\n\n slice(start?: Uint64Compat, end?: Uint64Compat): Array<TItem> {\n const startIndex = end === undefined ? 0 : asNumber(start ?? 0)\n const endIndex = end === undefined ? asNumber(start ?? this._values.length) : asNumber(end)\n return this._values.slice(startIndex, endIndex)\n }\n\n copy(): _FixedArray<TItem, TLength> {\n const bytesValue = toBytes(this)\n return getEncoder<_FixedArray<TItem, TLength>>(this.typeInfo)(bytesValue, this.typeInfo)\n }\n}\n\nconst decode = (value: Uint8Array, childTypes: TypeInfo[]) => {\n let i = 0\n let arrayIndex = 0\n const valuePartitions: Uint8Array[] = []\n const dynamicSegments: Array<Array<number>> = [] // Store the start and end of a dynamic element\n\n while (i < childTypes.length) {\n const childType = childTypes[i]\n if (holdsDynamicLengthContent(childType)) {\n // Decode the size of the dynamic element\n const dynamicIndex = uint8ArrayToNumber(value.slice(arrayIndex, arrayIndex + ABI_LENGTH_SIZE))\n if (dynamicSegments.length) {\n dynamicSegments.at(-1)![1] = dynamicIndex\n }\n // Since we do not know where the current dynamic element ends,\n // put a placeholder and update later\n dynamicSegments.push([dynamicIndex, -1])\n valuePartitions.push(new Uint8Array())\n arrayIndex += ABI_LENGTH_SIZE\n } else if (['Bool', 'boolean'].includes(childType.name)) {\n const before = findBoolTypes(childTypes, i, -1)\n let after = findBoolTypes(childTypes, i, 1)\n\n if (before % 8 != 0) {\n throw new CodeError('\"expected before index should have number of bool mod 8 equal 0\"')\n }\n after = Math.min(7, after)\n const bits = uint8ArrayToNumber(value.slice(arrayIndex, arrayIndex + 1))\n Array(after + 1)\n .fill(0)\n .forEach((_, j) => {\n const mask = 128 >> j\n valuePartitions.push(\n mask & bits ? encodingUtil.bigIntToUint8Array(TRUE_BIGINT_VALUE) : encodingUtil.bigIntToUint8Array(FALSE_BIGINT_VALUE),\n )\n })\n i += after\n arrayIndex += 1\n } else {\n const currLen = getMaxLengthOfStaticContentType(childType)\n valuePartitions.push(value.slice(arrayIndex, arrayIndex + currLen))\n arrayIndex += currLen\n }\n\n if (arrayIndex >= value.length && i != childTypes.length - 1) {\n throw new CodeError('input string is not long enough to be decoded')\n }\n i += 1\n }\n\n if (dynamicSegments.length > 0) {\n dynamicSegments.at(-1)![1] = value.length\n arrayIndex = value.length\n }\n if (arrayIndex < value.length) {\n throw new CodeError('input string was not fully consumed')\n }\n\n // Check dynamic element partitions\n let segmentIndex = 0\n childTypes.forEach((childType, index) => {\n if (holdsDynamicLengthContent(childType)) {\n const [segmentStart, segmentEnd] = dynamicSegments[segmentIndex]\n valuePartitions[index] = value.slice(segmentStart, segmentEnd)\n segmentIndex += 1\n }\n })\n\n const values: _ARC4Encoded[] = []\n childTypes.forEach((childType, index) => {\n values.push(\n getEncoder<_ARC4Encoded>(childType)(\n ['bytes', 'string'].includes(childType.name) ? valuePartitions[index].slice(2) : valuePartitions[index],\n childType,\n ),\n )\n })\n return values\n}\n\nconst encode = (values: _ARC4Encoded[]) => {\n const length = values.length\n const heads = []\n const tails = []\n const dynamicLengthTypeIndex = []\n let i = 0\n const valuesLengthBytes = values instanceof _DynamicArray ? encodeLength(length).asUint8Array() : new Uint8Array()\n while (i < length) {\n const value = values[i]\n assert(value instanceof _ARC4Encoded, `expected ARC4 type ${value.constructor.name}`)\n dynamicLengthTypeIndex.push(isDynamicLengthType(value))\n if (dynamicLengthTypeIndex.at(-1)) {\n heads.push(asUint8Array(Bytes.fromHex('0000')))\n tails.push(asUint8Array(value.bytes))\n } else {\n if (value instanceof _Bool) {\n const before = findBool(values, i, -1)\n let after = findBool(values, i, 1)\n if (before % 8 != 0) {\n throw new CodeError('\"expected before index should have number of bool mod 8 equal 0\"')\n }\n after = Math.min(7, after)\n const consecutiveBools = values.slice(i, i + after + 1) as _Bool[]\n const compressedNumber = compressMultipleBool(consecutiveBools)\n heads.push(new Uint8Array([compressedNumber]))\n i += after\n } else {\n heads.push(asUint8Array(value.bytes))\n }\n tails.push(new Uint8Array())\n }\n i += 1\n }\n\n // Adjust heads for dynamic types\n let headLength = 0\n heads.forEach((head) => {\n // If the element is not a placeholder, append the length of the element\n headLength += head.length\n })\n\n // Correctly encode dynamic types and replace placeholder\n let tailCurrLength = 0\n for (let i = 0; i < heads.length; i++) {\n if (dynamicLengthTypeIndex[i]) {\n const headValue = headLength + tailCurrLength\n heads[i] = asUint8Array(encodeLength(headValue))\n }\n tailCurrLength += tails[i].length\n }\n\n return conactUint8Arrays(valuesLengthBytes, ...heads, ...tails)\n}\n\nconst isDynamicLengthType = (value: _ARC4Encoded) => {\n return (\n value instanceof Str ||\n (value instanceof StaticArray && holdsDynamicLengthContent(value.typeInfo)) ||\n (value instanceof Tuple && value.genericArgs.some(holdsDynamicLengthContent)) ||\n (value instanceof Struct && Object.values(value.genericArgs).some(holdsDynamicLengthContent)) ||\n value instanceof DynamicArray ||\n value instanceof DynamicBytes\n )\n}\n\n/** @internal */\nexport function encodeArc4<T>(sourceTypeInfoString: string | undefined, source: T): bytes {\n const arc4Encoded = getArc4Encoded(source, sourceTypeInfoString)\n return arc4Encoded.bytes\n}\n\n/** @internal */\nexport function decodeArc4<T>(\n sourceTypeInfoString: string,\n targetTypeInfoString: string,\n bytes: StubBytesCompat,\n prefix: 'none' | 'log' = 'none',\n): T {\n const sourceTypeInfo = JSON.parse(sourceTypeInfoString)\n const targetTypeInfo = JSON.parse(targetTypeInfoString)\n const encoder = getEncoder(sourceTypeInfo)\n const source = encoder(bytes, sourceTypeInfo, prefix) as { typeInfo: TypeInfo }\n return getNativeValue(source, targetTypeInfo) as T\n}\n\n/** @internal */\nexport function interpretAsArc4<T extends _ARC4Encoded>(\n typeInfoString: string,\n bytes: StubBytesCompat,\n prefix: 'none' | 'log' = 'none',\n): T {\n const typeInfo = JSON.parse(typeInfoString)\n return getEncoder<T>(typeInfo)(bytes, typeInfo, prefix)\n}\n\n/** @internal */\nexport const getArc4Encoded = (value: DeliberateAny, sourceTypeInfoString?: string): _ARC4Encoded => {\n if (value instanceof _ARC4Encoded) {\n return value\n }\n if (value instanceof AccountCls) {\n return getArc4Encoded(value.bytes)\n }\n if (value instanceof AssetCls) {\n return getArc4Encoded(value.id)\n }\n if (value instanceof ApplicationCls) {\n return getArc4Encoded(value.id)\n }\n if (typeof value === 'boolean') {\n return new Bool({ name: 'Bool' }, value)\n }\n if (value instanceof Uint64Cls || typeof value === 'number') {\n return new Uint({ name: 'Uint<64>', genericArgs: [{ name: '64' }] }, asBigInt(value))\n }\n if (value instanceof BigUintCls) {\n return new Uint({ name: 'Uint<512>', genericArgs: [{ name: '512' }] }, value.asBigInt())\n }\n if (typeof value === 'bigint') {\n return new Uint({ name: 'Uint<512>', genericArgs: [{ name: '512' }] }, value)\n }\n if (value instanceof BytesCls) {\n if (value.fixedLength !== undefined) {\n return new StaticBytes(\n {\n name: 'StaticBytes',\n genericArgs: { elementType: { name: 'Byte', genericArgs: [{ name: '8' }] }, size: { name: value.fixedLength.toString() } },\n },\n value.asAlgoTs(),\n )\n }\n return new DynamicBytes(\n { name: 'DynamicBytes', genericArgs: { elementType: { name: 'Byte', genericArgs: [{ name: '8' }] } } },\n value.asAlgoTs(),\n )\n }\n if (typeof value === 'string') {\n return new Str({ name: 'Str' }, value)\n }\n if (Array.isArray(value) || value instanceof ReferenceArray || value instanceof FixedArray) {\n const sourceTypeInfo = sourceTypeInfoString ? JSON.parse(sourceTypeInfoString) : undefined\n const sourceGenericArgs = ((value as DeliberateAny).typeInfo || sourceTypeInfo || {})?.genericArgs\n const result: _ARC4Encoded[] = (value instanceof ReferenceArray || value instanceof FixedArray ? value.items : value).reduce(\n (acc: _ARC4Encoded[], cur: DeliberateAny, currentIndex: number) => {\n const elementTypeInfo = sourceGenericArgs?.elementType || sourceGenericArgs?.[currentIndex]\n const elementTypeInfoString = elementTypeInfo ? JSON.stringify(elementTypeInfo) : undefined\n return acc.concat(getArc4Encoded(cur, elementTypeInfoString))\n },\n [],\n )\n\n const genericArgs: TypeInfo[] = result.map((x) => (x as DeliberateAny).typeInfo)\n if (value instanceof FixedArray) {\n const typeInfo = {\n name: `StaticArray<${genericArgs[0].name},${genericArgs.length}>`,\n genericArgs: { elementType: genericArgs[0], size: { name: genericArgs.length.toString() } },\n }\n return new StaticArray(typeInfo, ...(result as [_ARC4Encoded, ..._ARC4Encoded[]]))\n } else if (\n sourceTypeInfo?.name?.startsWith('Array') ||\n sourceTypeInfo?.name?.startsWith('ReadonlyArray') ||\n value instanceof ReferenceArray\n ) {\n const elementType = genericArgs[0] ?? sourceTypeInfo.genericArgs?.elementType\n const typeInfo = { name: `DynamicArray<${elementType.name}>`, genericArgs: { elementType } }\n return new DynamicArray(typeInfo, ...(result as [_ARC4Encoded, ..._ARC4Encoded[]]))\n } else {\n const typeInfo = { name: `Tuple<[${genericArgs.map((x) => x.name).join(',')}]>`, genericArgs }\n return new Tuple(typeInfo, ...(result as [_ARC4Encoded, ..._ARC4Encoded[]]))\n }\n }\n if (typeof value === 'object') {\n const sourceTypeInfo = sourceTypeInfoString ? JSON.parse(sourceTypeInfoString) : undefined\n const propTypeInfos = (value.typeInfo || sourceTypeInfo || {}).genericArgs\n const result = Object.entries(value).reduce((acc: _ARC4Encoded[], [key, cur]: DeliberateAny) => {\n const propTypeInfoString = propTypeInfos?.[key] ? JSON.stringify(propTypeInfos[key]) : undefined\n return acc.concat(getArc4Encoded(cur, propTypeInfoString))\n }, [])\n const genericArgs: TypeInfo[] = result.map((x) => (x as DeliberateAny).typeInfo)\n const typeInfo = {\n name: `Struct<${value.constructor.name}>`,\n genericArgs: Object.fromEntries(Object.keys(value).map((x, i) => [x, genericArgs[i]])),\n }\n return new Struct(typeInfo, Object.fromEntries(Object.keys(value).map((x, i) => [x, result[i]])))\n }\n\n throw new CodeError(`Unsupported type for encoding: ${typeof value}`)\n}\n\n/** @internal */\nexport const toBytes = (val: unknown, sourceTypeInfoString?: string): bytes => {\n const uint64Val = asMaybeUint64Cls(val, false)\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 (Array.isArray(val) || typeof val === 'object') {\n return encodeArc4(sourceTypeInfoString, val)\n }\n throw new InternalError(`Invalid type for bytes: ${nameOfType(val)}`)\n}\n\n/** @internal */\nexport const getEncoder = <T>(typeInfo: TypeInfo): fromBytes<T> => {\n const mutableTupleFromBytes = (value: StubBytesCompat | Uint8Array, typeInfo: string | TypeInfo, prefix: 'none' | 'log' = 'none') => {\n const tuple = Tuple.fromBytes(value, typeInfo, prefix)\n return asNumber(tuple.bytes.length) ? tuple.native : ([] as unknown as typeof tuple.native)\n }\n const readonlyMutableTupleFromBytes = (\n value: StubBytesCompat | Uint8Array,\n typeInfo: string | TypeInfo,\n prefix: 'none' | 'log' = 'none',\n ) => {\n const result = mutableTupleFromBytes(value, typeInfo, prefix)\n return result as Readonly<typeof result>\n }\n const mutableObjectFromBytes = (value: StubBytesCompat | Uint8Array, typeInfo: string | TypeInfo, prefix: 'none' | 'log' = 'none') => {\n const struct = Struct.fromBytes(value, typeInfo, prefix)\n return asNumber(struct.bytes.length) ? struct.native : ({} as unknown as typeof struct.native)\n }\n const readonlyObjectFromBytes = (value: StubBytesCompat | Uint8Array, typeInfo: string | TypeInfo, prefix: 'none' | 'log' = 'none') => {\n const result = mutableObjectFromBytes(value, typeInfo, prefix)\n return result as Readonly<typeof result>\n }\n const arrayFromBytes = (value: StubBytesCompat | Uint8Array, typeInfo: string | TypeInfo, prefix: 'none' | 'log' = 'none') => {\n const dynamicArray = DynamicArray.fromBytes(value, typeInfo, prefix)\n return asNumber(dynamicArray.bytes.length) ? dynamicArray.native : ([] as unknown as typeof dynamicArray.native)\n }\n const readonlyArrayFromBytes = (value: StubBytesCompat | Uint8Array, typeInfo: string | TypeInfo, prefix: 'none' | 'log' = 'none') => {\n const result = arrayFromBytes(value, typeInfo, prefix)\n return result as Readonly<typeof result>\n }\n const referenceArrayFromBytes = (value: StubBytesCompat | Uint8Array, typeInfo: string | TypeInfo, prefix: 'none' | 'log' = 'none') => {\n const dynamicArray = DynamicArray.fromBytes(value, typeInfo, prefix)\n return new ReferenceArray(\n typeInfo,\n ...(asNumber(dynamicArray.bytes.length) ? dynamicArray.native : ([] as unknown as typeof dynamicArray.native)),\n )\n }\n const fixedArrayFromBytes = (value: StubBytesCompat | Uint8Array, typeInfo: string | TypeInfo, prefix: 'none' | 'log' = 'none') => {\n const staticArray = StaticArray.fromBytes(value, typeInfo, prefix)\n return new FixedArray(\n typeInfo,\n ...(asNumber(staticArray.bytes.length) ? staticArray.native : ([] as unknown as typeof staticArray.native)),\n )\n }\n const encoders: Record<string, fromBytes<DeliberateAny>> = {\n account: AccountCls.fromBytes,\n application: ApplicationCls.fromBytes,\n asset: AssetCls.fromBytes,\n boolean: booleanFromBytes,\n biguint: bigUintFromBytes,\n 'bytes(<.*>)?': bytesFromBytes,\n string: stringFromBytes,\n uint64: uint64FromBytes,\n OnCompleteAction: onCompletionFromBytes,\n TransactionType: transactionTypeFromBytes,\n Address: Address.fromBytes,\n Bool: Bool.fromBytes,\n Byte: Byte.fromBytes,\n Str: Str.fromBytes,\n 'Uint<.*>': Uint.fromBytes,\n 'UFixed<.*>': UFixed.fromBytes,\n 'StaticArray<.*>': StaticArray.fromBytes,\n 'DynamicArray<.*>': DynamicArray.fromBytes,\n 'Tuple(<.*>)?': Tuple.fromBytes,\n 'ReadonlyTuple(<.*>)?': readonlyMutableTupleFromBytes,\n 'MutableTuple(<.*>)?': mutableTupleFromBytes,\n 'Struct(<.*>)?': Struct.fromBytes,\n DynamicBytes: DynamicBytes.fromBytes,\n 'StaticBytes<.*>': StaticBytes.fromBytes,\n object: Struct.fromBytes,\n 'Object<.*>': mutableObjectFromBytes,\n 'ReadonlyObject<.*>': readonlyObjectFromBytes,\n 'ReferenceArray<.*>': referenceArrayFromBytes,\n 'FixedArray<.*>': fixedArrayFromBytes,\n 'Array<.*>': arrayFromBytes,\n 'ReadonlyArray<.*>': readonlyArrayFromBytes,\n }\n\n const encoder = Object.entries(encoders).find(([k, _]) => new RegExp(`^${k}$`, 'i').test(typeInfo.name))?.[1]\n if (!encoder) {\n throw new Error(`No encoder found for type ${typeInfo.name}`)\n }\n return encoder as fromBytes<T>\n}\n","import type { bytes, gtxn, MimcConfigurations, op, VrfVerify } from '@algorandfoundation/algorand-typescript'\nimport { Ecdsa, OnCompleteAction } from '@algorandfoundation/algorand-typescript'\nimport elliptic from 'elliptic'\nimport js_sha256 from 'js-sha256'\nimport js_sha3 from 'js-sha3'\nimport js_sha512 from 'js-sha512'\nimport nacl from 'tweetnacl'\nimport { LOGIC_DATA_PREFIX, PROGRAM_TAG } from '../constants'\nimport { lazyContext } from '../context-helpers/internal-context'\nimport { InternalError, NotImplementedError } from '../errors'\nimport { asBytes, asBytesCls, asUint8Array, conactUint8Arrays } from '../util'\nimport type { StubBytesCompat, StubUint64Compat } from './primitives'\nimport { Bytes, BytesCls, FixedBytes, Uint64Cls } from './primitives'\n\n/** @internal */\nexport const sha256 = (a: StubBytesCompat): bytes<32> => {\n const bytesA = BytesCls.fromCompat(a)\n const hashArray = js_sha256.sha256.create().update(bytesA.asUint8Array()).digest()\n const hashBytes = FixedBytes(32, new Uint8Array(hashArray))\n return hashBytes\n}\n\n/** @internal */\nexport const sha3_256 = (a: StubBytesCompat): bytes<32> => {\n const bytesA = BytesCls.fromCompat(a)\n const hashArray = js_sha3.sha3_256.create().update(bytesA.asUint8Array()).digest()\n const hashBytes = FixedBytes(32, new Uint8Array(hashArray))\n return hashBytes\n}\n\n/** @internal */\nexport const keccak256 = (a: StubBytesCompat): bytes<32> => {\n const bytesA = BytesCls.fromCompat(a)\n const hashArray = js_sha3.keccak256.create().update(bytesA.asUint8Array()).digest()\n const hashBytes = FixedBytes(32, new Uint8Array(hashArray))\n return hashBytes\n}\n\n/** @internal */\nexport const sha512_256 = (a: StubBytesCompat): bytes<32> => {\n const bytesA = BytesCls.fromCompat(a)\n const hashArray = js_sha512.sha512_256.create().update(bytesA.asUint8Array()).digest()\n const hashBytes = FixedBytes(32, new Uint8Array(hashArray))\n return hashBytes\n}\n\n/** @internal */\nexport const ed25519verifyBare = (a: StubBytesCompat, b: StubBytesCompat, c: StubBytesCompat): boolean => {\n const bytesA = BytesCls.fromCompat(a)\n const bytesB = BytesCls.fromCompat(b)\n const bytesC = BytesCls.fromCompat(c)\n return nacl.sign.detached.verify(bytesA.asUint8Array(), bytesB.asUint8Array(), bytesC.asUint8Array())\n}\n\n/** @internal */\nexport const ed25519verify = (a: StubBytesCompat, b: StubBytesCompat, c: StubBytesCompat): boolean => {\n const txn = lazyContext.activeGroup.activeTransaction as gtxn.ApplicationCallTxn\n const programBytes = asBytesCls(txn.onCompletion == OnCompleteAction.ClearState ? txn.clearStateProgram : txn.approvalProgram)\n\n const logicSig = conactUint8Arrays(asUint8Array(PROGRAM_TAG), programBytes.asUint8Array())\n const logicSigAddress = js_sha512.sha512_256.array(logicSig)\n\n const addressBytes = Bytes(logicSigAddress)\n const data = LOGIC_DATA_PREFIX.concat(addressBytes).concat(asBytes(a))\n return ed25519verifyBare(data, b, c)\n}\n\n/** @internal */\nexport const ecdsaVerify = (\n v: Ecdsa,\n a: StubBytesCompat,\n b: StubBytesCompat,\n c: StubBytesCompat,\n d: StubBytesCompat,\n e: StubBytesCompat,\n): boolean => {\n const dataBytes = BytesCls.fromCompat(a)\n const sigRBytes = BytesCls.fromCompat(b)\n const sigSBytes = BytesCls.fromCompat(c)\n const pubkeyXBytes = BytesCls.fromCompat(d)\n const pubkeyYBytes = BytesCls.fromCompat(e)\n\n const publicKey = BytesCls.fromCompat(new Uint8Array([0x04]))\n .concat(pubkeyXBytes)\n .concat(pubkeyYBytes)\n\n const ecdsa = new elliptic.ec(curveMap[v])\n const keyPair = ecdsa.keyFromPublic(publicKey.asUint8Array())\n return keyPair.verify(dataBytes.asUint8Array(), { r: sigRBytes.asUint8Array(), s: sigSBytes.asUint8Array() })\n}\n\n/** @internal */\nexport const ecdsaPkRecover = (\n v: Ecdsa,\n a: StubBytesCompat,\n b: StubUint64Compat,\n c: StubBytesCompat,\n d: StubBytesCompat,\n): readonly [bytes<32>, bytes<32>] => {\n if (v !== Ecdsa.Secp256k1) {\n throw new InternalError(`Unsupported ECDSA curve: ${v}`)\n }\n const dataBytes = BytesCls.fromCompat(a)\n const rBytes = BytesCls.fromCompat(c)\n const sBytes = BytesCls.fromCompat(d)\n const recoveryId = Uint64Cls.fromCompat(b)\n\n const ecdsa = new elliptic.ec(curveMap[v])\n const pubKey = ecdsa.recoverPubKey(\n dataBytes.asUint8Array(),\n { r: rBytes.asUint8Array(), s: sBytes.asUint8Array() },\n recoveryId.asNumber(),\n )\n\n const x = pubKey.getX().toArray('be')\n const y = pubKey.getY().toArray('be')\n return [FixedBytes(32, x), FixedBytes(32, y)]\n}\n\n/** @internal */\nexport const ecdsaPkDecompress = (v: Ecdsa, a: StubBytesCompat): readonly [bytes<32>, bytes<32>] => {\n const bytesA = BytesCls.fromCompat(a)\n\n const ecdsa = new elliptic.ec(curveMap[v])\n const keyPair = ecdsa.keyFromPublic(bytesA.asUint8Array())\n const pubKey = keyPair.getPublic()\n\n const x = pubKey.getX().toArray('be')\n const y = pubKey.getY().toArray('be')\n return [FixedBytes(32, new Uint8Array(x)), FixedBytes(32, new Uint8Array(y))]\n}\n\n/** @internal */\nexport const vrfVerify = (_s: VrfVerify, _a: StubBytesCompat, _b: StubBytesCompat, _c: StubBytesCompat): readonly [bytes<64>, boolean] => {\n throw new NotImplementedError('vrfVerify')\n}\n\n/** @internal */\nexport const EllipticCurve = new Proxy({} as typeof op.EllipticCurve, {\n get: (_target, prop) => {\n throw new NotImplementedError(`EllipticCurve.${prop.toString()}`)\n },\n})\n\n/** @internal */\nexport const mimc = (_c: MimcConfigurations, _a: StubBytesCompat): bytes => {\n throw new NotImplementedError('mimc')\n}\n\nconst curveMap = {\n [Ecdsa.Secp256k1]: 'secp256k1',\n [Ecdsa.Secp256r1]: 'p256',\n}\n","import type {\n Account as AccountType,\n Application as ApplicationType,\n bytes,\n gtxn,\n op,\n uint64,\n} from '@algorandfoundation/algorand-typescript'\nimport { lazyContext } from '../context-helpers/internal-context'\nimport { asMaybeUint64Cls, asUint64 } from '../util'\nimport { Bytes, Uint64, type StubUint64Compat } from './primitives'\nimport { Account } from './reference'\n\nconst resolveAppIndex = (appIdOrIndex: StubUint64Compat): uint64 => {\n const input = asUint64(appIdOrIndex)\n if (input >= 1001) {\n return input\n }\n const txn = lazyContext.activeGroup.activeTransaction as gtxn.ApplicationCallTxn\n return txn.apps(input).id\n}\n\n/** @internal */\nexport const getApp = (app: ApplicationType | StubUint64Compat): ApplicationType | undefined => {\n try {\n const appId = asMaybeUint64Cls(app)\n if (appId !== undefined) {\n return lazyContext.ledger.getApplication(resolveAppIndex(appId))\n }\n return app as ApplicationType\n } catch {\n return undefined\n }\n}\n\n/** @internal */\nexport const AppParams: typeof op.AppParams = {\n appApprovalProgram(a: ApplicationType | StubUint64Compat): readonly [bytes, boolean] {\n const app = getApp(a)\n return app === undefined ? [Bytes(), false] : [app.approvalProgram, true]\n },\n appClearStateProgram(a: ApplicationType | StubUint64Compat): readonly [bytes, boolean] {\n const app = getApp(a)\n return app === undefined ? [Bytes(), false] : [app.clearStateProgram, true]\n },\n appGlobalNumUint(a: ApplicationType | StubUint64Compat): readonly [uint64, boolean] {\n const app = getApp(a)\n return app === undefined ? [Uint64(0), false] : [app.globalNumUint, true]\n },\n appGlobalNumByteSlice(a: ApplicationType | StubUint64Compat): readonly [uint64, boolean] {\n const app = getApp(a)\n return app === undefined ? [Uint64(0), false] : [app.globalNumBytes, true]\n },\n appLocalNumUint(a: ApplicationType | StubUint64Compat): readonly [uint64, boolean] {\n const app = getApp(a)\n return app === undefined ? [Uint64(0), false] : [app.localNumUint, true]\n },\n appLocalNumByteSlice(a: ApplicationType | StubUint64Compat): readonly [uint64, boolean] {\n const app = getApp(a)\n return app === undefined ? [Uint64(0), false] : [app.localNumBytes, true]\n },\n appExtraProgramPages(a: ApplicationType | StubUint64Compat): readonly [uint64, boolean] {\n const app = getApp(a)\n return app === undefined ? [Uint64(0), false] : [app.extraProgramPages, true]\n },\n appCreator(a: ApplicationType | StubUint64Compat): readonly [AccountType, boolean] {\n const app = getApp(a)\n return app === undefined ? [Account(), false] : [app.creator, true]\n },\n appAddress(a: ApplicationType | StubUint64Compat): readonly [AccountType, boolean] {\n const app = getApp(a)\n return app === undefined ? [Account(), false] : [app.address, true]\n },\n}\n","import type { Account as AccountType, Asset as AssetType, bytes, gtxn, op, uint64 } from '@algorandfoundation/algorand-typescript'\nimport { lazyContext } from '../context-helpers/internal-context'\nimport { asMaybeUint64Cls, asUint64 } from '../util'\nimport { Bytes, Uint64, type StubUint64Compat } from './primitives'\nimport { Account } from './reference'\n\nconst resolveAssetIndex = (assetIdOrIndex: StubUint64Compat): uint64 => {\n const input = asUint64(assetIdOrIndex)\n if (input >= 1001) {\n return input\n }\n const txn = lazyContext.activeGroup.activeTransaction as gtxn.ApplicationCallTxn\n return txn.assets(input).id\n}\n\n/** @internal */\nexport const getAsset = (asset: AssetType | StubUint64Compat): AssetType | undefined => {\n try {\n const assetId = asMaybeUint64Cls(asset)\n if (assetId !== undefined) {\n return lazyContext.ledger.getAsset(resolveAssetIndex(assetId))\n }\n return asset as AssetType\n } catch {\n return undefined\n }\n}\n\n/** @internal */\nexport const AssetParams: typeof op.AssetParams = {\n assetTotal(a: AssetType | StubUint64Compat): readonly [uint64, boolean] {\n const asset = getAsset(a)\n return asset === undefined ? [Uint64(0), false] : [asset.total, true]\n },\n assetDecimals(a: AssetType | StubUint64Compat): readonly [uint64, boolean] {\n const asset = getAsset(a)\n return asset === undefined ? [Uint64(0), false] : [asset.decimals, true]\n },\n assetDefaultFrozen(a: AssetType | StubUint64Compat): readonly [boolean, boolean] {\n const asset = getAsset(a)\n return asset === undefined ? [false, false] : [asset.defaultFrozen, true]\n },\n assetUnitName(a: AssetType | StubUint64Compat): readonly [bytes, boolean] {\n const asset = getAsset(a)\n return asset === undefined ? [Bytes(), false] : [asset.unitName, true]\n },\n assetName(a: AssetType | StubUint64Compat): readonly [bytes, boolean] {\n const asset = getAsset(a)\n return asset === undefined ? [Bytes(), false] : [asset.name, true]\n },\n assetUrl(a: AssetType | StubUint64Compat): readonly [bytes, boolean] {\n const asset = getAsset(a)\n return asset === undefined ? [Bytes(), false] : [asset.url, true]\n },\n assetMetadataHash(a: AssetType | StubUint64Compat): readonly [bytes<32>, boolean] {\n const asset = getAsset(a)\n return asset === undefined ? [Bytes() as bytes<32>, false] : [asset.metadataHash, true]\n },\n assetManager(a: AssetType | StubUint64Compat): readonly [AccountType, boolean] {\n const asset = getAsset(a)\n return asset === undefined ? [Account(), false] : [asset.manager, true]\n },\n assetReserve(a: AssetType | StubUint64Compat): readonly [AccountType, boolean] {\n const asset = getAsset(a)\n return asset === undefined ? [Account(), false] : [asset.reserve, true]\n },\n assetFreeze(a: AssetType | StubUint64Compat): readonly [AccountType, boolean] {\n const asset = getAsset(a)\n return asset === undefined ? [Account(), false] : [asset.freeze, true]\n },\n assetClawback(a: AssetType | StubUint64Compat): readonly [AccountType, boolean] {\n const asset = getAsset(a)\n return asset === undefined ? [Account(), false] : [asset.clawback, true]\n },\n assetCreator(a: AssetType | StubUint64Compat): readonly [AccountType, boolean] {\n const asset = getAsset(a)\n return asset === undefined ? [Account(), false] : [asset.creator, true]\n },\n}\n"],"names":["_Uint","_UFixed","_Byte","_Str","_Bool","_StaticArray","_Address","_DynamicArray","_Tuple","_Struct","_DynamicBytes","_StaticBytes","_ReferenceArray","_FixedArray","_ARC4Encoded"],"mappings":";;;;;;;;;;;;AAIA;AACO,MAAM,iBAAiB,GAAG,OAAc;IAC7C,GAAG,CAAC,MAAmC,EAAE,IAAiB,EAAA;AACxD,QAA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AAE,EAAE,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC;IACzE,CAAC;;;;;"}
|
package/index.mjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { OnCompleteAction, TransactionType } from '@algorandfoundation/algorand-typescript';
|
|
2
|
-
import { g as getContractMethodAbiMetadata, a as getContractAbiMetadata } from './runtime-helpers-
|
|
3
|
-
import { m as methodSelector, G as GlobalStateCls, L as LocalStateCls, C as ContractContext, c as checkRoutingConditions, a as createInnerTxn, A as ApplicationCallInnerTxnContext, I as ItxnParams, b as ApplicationCallTransaction, P as PaymentTransaction, K as KeyRegistrationTransaction, d as AssetConfigTransaction, e as AssetTransferTransaction, f as AssetFreezeTransaction } from './inner-transactions-
|
|
4
|
-
import { a as asNumber, U as Uint64Cls, B as BigUintCls, b as BytesCls, A as AccountCls, c as AlgoTsPrimitiveCls, i as iterBigInt, d as Uint64Map, e as AccountMap, f as asBytes, g as Asset, h as asUint64, j as Application, k as asMaybeUint64Cls, l as asUint64Cls, m as AssetHolding, n as AccountData, o as ApplicationData, p as getDefaultAssetData, q as asBigInt, r as asMaybeBytesCls, s as asUint8Array, t as ApplicationCls, M as MAX_UINT64, u as ABI_RETURN_VALUE_LOG_PREFIX, v as lazyContext, T as TRANSACTION_GROUP_MAX_SIZE, w as Uint64, x as getRandomBigInt, y as asBigUintCls, z as BigUint, C as MAX_BYTES_SIZE, D as Bytes, E as Account, F as getRandomBytes, G as AssetCls, H as MAX_UINT512, I as MAX_UINT8, J as MAX_UINT16, K as MAX_UINT32, L as MAX_UINT128, N as MAX_UINT256, O as BITS_IN_BYTE, P as BaseContract, Q as ContextManager, R as DEFAULT_TEMPLATE_VAR_PREFIX } from './utils-
|
|
5
|
-
export { S as toExternalValue } from './utils-
|
|
2
|
+
import { g as getContractMethodAbiMetadata, a as getContractAbiMetadata } from './runtime-helpers-CuMj7wHA.js';
|
|
3
|
+
import { m as methodSelector, G as GlobalStateCls, L as LocalStateCls, C as ContractContext, c as checkRoutingConditions, a as createInnerTxn, A as ApplicationCallInnerTxnContext, I as ItxnParams, b as ApplicationCallTransaction, P as PaymentTransaction, K as KeyRegistrationTransaction, d as AssetConfigTransaction, e as AssetTransferTransaction, f as AssetFreezeTransaction } from './inner-transactions-BNLLTHy1.js';
|
|
4
|
+
import { a as asNumber, U as Uint64Cls, B as BigUintCls, b as BytesCls, A as AccountCls, c as AlgoTsPrimitiveCls, i as iterBigInt, d as Uint64Map, e as AccountMap, f as asBytes, g as Asset, h as asUint64, j as Application, k as asMaybeUint64Cls, l as asUint64Cls, m as AssetHolding, n as AccountData, o as ApplicationData, p as getDefaultAssetData, q as asBigInt, r as asMaybeBytesCls, s as asUint8Array, t as ApplicationCls, M as MAX_UINT64, u as ABI_RETURN_VALUE_LOG_PREFIX, v as lazyContext, T as TRANSACTION_GROUP_MAX_SIZE, w as Uint64, x as getRandomBigInt, y as asBigUintCls, z as BigUint, C as MAX_BYTES_SIZE, D as Bytes, E as Account, F as getRandomBytes, G as AssetCls, H as MAX_UINT512, I as MAX_UINT8, J as MAX_UINT16, K as MAX_UINT32, L as MAX_UINT128, N as MAX_UINT256, O as BITS_IN_BYTE, P as BaseContract, Q as ContextManager, R as DEFAULT_TEMPLATE_VAR_PREFIX } from './utils-C5PYEp-V.js';
|
|
5
|
+
export { S as toExternalValue } from './utils-C5PYEp-V.js';
|
|
6
6
|
import { I as InternalError, i as invariant } from './typescript-helpers-sobuICoc.js';
|
|
7
7
|
export { A as AssertError, a as AvmError, C as CodeError, N as NotImplementedError } from './typescript-helpers-sobuICoc.js';
|
|
8
8
|
import { Address as Address$1 } from '@algorandfoundation/algorand-typescript/arc4';
|
|
9
9
|
import { encodingUtil } from '@algorandfoundation/puya-ts';
|
|
10
|
-
import { G as GlobalData, V as VoterData, B as BlockData, b as btoi } from './pure-
|
|
11
|
-
import { t as toBytes, A as Address, U as Uint, D as DynamicBytes, S as Str } from './asset-params-
|
|
10
|
+
import { G as GlobalData, V as VoterData, B as BlockData, b as btoi } from './pure-CAsk1mZp.js';
|
|
11
|
+
import { t as toBytes, A as Address, U as Uint, D as DynamicBytes, S as Str } from './asset-params-CB1bSY-h.js';
|
|
12
12
|
import { randomBytes } from 'crypto';
|
|
13
13
|
import 'js-sha512';
|
|
14
14
|
import 'assert';
|
|
@@ -135,6 +135,16 @@ function doAddEqualityTesters(expectObj) {
|
|
|
135
135
|
// Defer to other testers
|
|
136
136
|
return undefined;
|
|
137
137
|
},
|
|
138
|
+
function NumericLiteralIsNumericPrimitive(subject, test, customTesters) {
|
|
139
|
+
if (typeof subject === 'bigint' || typeof subject === 'number') {
|
|
140
|
+
const testValue = test instanceof Uint64Cls || test instanceof BigUintCls ? test.valueOf() : undefined;
|
|
141
|
+
if (testValue !== undefined)
|
|
142
|
+
return this.equals(BigInt(subject), testValue, customTesters);
|
|
143
|
+
return undefined;
|
|
144
|
+
}
|
|
145
|
+
// Defer to other testers
|
|
146
|
+
return undefined;
|
|
147
|
+
},
|
|
138
148
|
function BytesPrimitiveIsUint8Array(subject, test, customTesters) {
|
|
139
149
|
if (subject instanceof BytesCls) {
|
|
140
150
|
const testValue = test instanceof Uint8Array ? test : undefined;
|