@algorandfoundation/algorand-typescript-testing 1.0.0-alpha.39 → 1.0.0-alpha.40

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 CHANGED
@@ -5,7 +5,7 @@
5
5
  [![github-stars](https://img.shields.io/github/stars/algorandfoundation/algorand-typescript-testing?color=74dfdc&logo=star&style=flat)](https://github.com/algorandfoundation/algorand-typescript-testing)
6
6
  [![visitor-badge](https://api.visitorbadge.io/api/visitors?path=https%3A%2F%2Fgithub.com%2Falgorandfoundation%2Falgorand-typescript-testing&countColor=%2374dfdc&style=flat)](https://github.com/algorandfoundation/algorand-typescript-testing/)
7
7
 
8
- `algorand-typescript-testing` is a companion package to [Algorand Typescript](https://github.com/algorandfoundation/puya-ts/tree/main/packages/algo-ts) that enables efficient unit testing of Algorand TypeScript smart contracts in an offline environment. This package emulates key AVM behaviors without requiring a network connection, offering fast and reliable testing capabilities with a familiar TypeScript interface.
8
+ `algorand-typescript-testing` is a companion package to [Algorand Typescript](https://github.com/algorandfoundation/puya-ts/tree/main/packages/algo-ts) that enables efficient unit testing of Algorand TypeScript smart contracts in an offline environment. This package emulates key AVM behaviours without requiring a network connection, offering fast and reliable testing capabilities with a familiar TypeScript interface.
9
9
 
10
10
  The `algorand-typescript-testing` package provides:
11
11
 
@@ -46,7 +46,7 @@ Let's write a simple contract and test it using the `algorand-typescript-testing
46
46
 
47
47
  `algorand-typescript-testing` includes a TypeScript transformer (`puyaTsTransformer`) that ensures contracts (with `.algo.ts` extension) and tests (with `.algo.spec.ts` or `.algo.test.ts` extensions) behave consistently between Node.js and AVM environments.
48
48
 
49
- The transformer replicates AVM behavior, such as integer-only arithmetic where `3 / 2` produces `1`. For code requiring standard Node.js behaviour (e.g., `3 / 2` produces `1.5`), place it in separate `.ts` files and reference them from test files.
49
+ The transformer replicates AVM behaviour, such as integer-only arithmetic where `3 / 2` produces `1`. For code requiring standard Node.js behaviour (e.g., `3 / 2` produces `1.5`), place it in separate `.ts` files and reference them from test files.
50
50
 
51
51
  The transformer also redirects `@algorandfoundation/algorand-typescript` imports to `@algorandfoundation/algorand-typescript-testing/internal` to provide executable implementations of Algorand TypeScript constructs like `Global`, `Box`, `Uint64`, and `clone`.
52
52
 
@@ -302,6 +302,6 @@ To dig deeper into the capabilities of `algorand-typescript-testing`, continue w
302
302
  - [Testing Guide](./docs/testing-guide.md)
303
303
  - [Examples](./docs/examples.md)
304
304
  - [Coverage](./docs/coverage.md)
305
- - [FQA](./docs/faq.md)
305
+ - [FAQ](./docs/faq.md)
306
306
  - [API Reference](./docs/api.md)
307
307
  - [Algorand TypeScript](./docs/algots.md)
@@ -1 +1 @@
1
- {"version":3,"file":"asset-params-BwXtTjOo.js","sources":["../src/impl/encoded-types/array-proxy.ts","../src/impl/encoded-types/encoded-types.ts","../src/impl/crypto.ts","../src/impl/app-params.ts","../src/impl/asset-params.ts"],"sourcesContent":["import type { Uint64Compat } from '@algorandfoundation/algorand-typescript'\nimport { AvmError } from '../../errors'\nimport { arrayUtil } from '../primitives'\n\n/** @internal */\nexport const arrayProxyHandler = <TItem>() => ({\n get(target: { items: readonly TItem[] }, prop: PropertyKey) {\n const idx = prop ? parseInt(prop.toString(), 10) : NaN\n if (!isNaN(idx)) {\n if (idx >= 0 && idx < target.items.length) return target.items[idx]\n throw new AvmError('Index out of bounds')\n } else if (prop === Symbol.iterator) {\n return target.items[Symbol.iterator].bind(target.items)\n } else if (prop === 'entries') {\n return target.items.entries.bind(target.items)\n } else if (prop === 'keys') {\n return target.items.keys.bind(target.items)\n } else if (prop === 'at') {\n return (index: Uint64Compat): TItem => {\n return arrayUtil.arrayAt(target.items, index)\n }\n }\n return Reflect.get(target, prop)\n },\n set(target: { items: TItem[]; setItem: (index: number, value: TItem) => void }, prop: PropertyKey, value: TItem) {\n const idx = prop ? parseInt(prop.toString(), 10) : NaN\n if (!isNaN(idx)) {\n if (idx >= 0 && idx < target.items.length) {\n target.setItem(idx, value)\n return true\n }\n throw new AvmError('Index out of bounds')\n }\n\n return Reflect.set(target, prop, value)\n },\n})\n","import type { Account as AccountType, bytes, NTuple, StringCompat, uint64, Uint64Compat } from '@algorandfoundation/algorand-typescript'\nimport { FixedArray as _FixedArray, ReferenceArray as _ReferenceArray } from '@algorandfoundation/algorand-typescript'\nimport type { BitSize } from '@algorandfoundation/algorand-typescript/arc4'\nimport {\n Address as _Address,\n ARC4Encoded as _ARC4Encoded,\n Bool as _Bool,\n Byte as _Byte,\n DynamicArray as _DynamicArray,\n DynamicBytes as _DynamicBytes,\n StaticArray as _StaticArray,\n StaticBytes as _StaticBytes,\n Str as _Str,\n Struct as _Struct,\n Tuple as _Tuple,\n UFixed as _UFixed,\n Uint as _Uint,\n} from '@algorandfoundation/algorand-typescript/arc4'\nimport { encodingUtil } from '@algorandfoundation/puya-ts'\nimport assert from 'assert'\nimport {\n ABI_RETURN_VALUE_LOG_PREFIX,\n ALGORAND_ADDRESS_BYTE_LENGTH,\n ALGORAND_CHECKSUM_BYTE_LENGTH,\n MAX_UINT64,\n UINT64_SIZE,\n} from '../../constants'\nimport { AvmError, avmInvariant, CodeError, InternalError } from '../../errors'\nimport { nameOfType, type DeliberateAny } from '../../typescript-helpers'\nimport {\n asBigInt,\n asBigUint,\n asBigUintCls,\n asBytes,\n asBytesCls,\n asMaybeBigUintCls,\n asMaybeBytesCls,\n asMaybeUint64Cls,\n asNumber,\n asUint64,\n asUint64Cls,\n asUint8Array,\n concatUint8Arrays,\n uint8ArrayToNumber,\n} from '../../util'\nimport { BytesBackedCls, Uint64BackedCls } from '../base'\nimport type { StubBytesCompat } from '../primitives'\nimport { BigUintCls, Bytes, BytesCls, getUint8Array, isBytes, Uint64Cls } from '../primitives'\nimport { Account, AccountCls, ApplicationCls, AssetCls } from '../reference'\nimport { arrayProxyHandler } from './array-proxy'\nimport { ABI_LENGTH_SIZE, FALSE_BIGINT_VALUE, IS_INITIALISING_FROM_BYTES_SYMBOL, TRUE_BIGINT_VALUE } from './constants'\nimport {\n areAllARC4Encoded,\n bigUintFromBytes,\n booleanFromBytes,\n bytesFromBytes,\n checkItemTypeName,\n compressMultipleBool,\n encodeLength,\n findBool,\n findBoolTypes,\n getNativeValue,\n holdsDynamicLengthContent,\n maxBigIntValue,\n maxBytesLength,\n onCompletionFromBytes,\n readLength,\n regExpNxM,\n stringFromBytes,\n transactionTypeFromBytes,\n trimTrailingDecimalZeros,\n uint64FromBytes,\n validBitSizes,\n} from './helpers'\nimport type {\n CompatForArc4Int,\n DynamicArrayGenericArgs,\n fromBytes,\n StaticArrayGenericArgs,\n StructConstraint,\n TypeInfo,\n uFixedGenericArgs,\n} from './types'\nimport { getMaxLengthOfStaticContentType } from './utils'\n\ninterface _ARC4Encodedint8Array extends _ARC4Encoded {\n get uint8ArrayValue(): Uint8Array\n}\n/** @internal */\nexport class Uint<N extends BitSize> extends _Uint<N> implements _ARC4Encodedint8Array {\n private _value: Uint8Array\n private bitSize: N\n typeInfo: TypeInfo\n\n constructor(typeInfo: TypeInfo | string, v?: CompatForArc4Int<N>) {\n super()\n this.typeInfo = typeof typeInfo === 'string' ? JSON.parse(typeInfo) : typeInfo\n this.bitSize = Uint.getMaxBitsLength(this.typeInfo) as N\n\n assert(validBitSizes.includes(this.bitSize), `Invalid bit size ${this.bitSize}`)\n\n const bigIntValue = asBigUintCls(v ?? 0n).valueOf()\n const maxValue = maxBigIntValue(this.bitSize)\n assert(bigIntValue <= maxValue, `expected value <= ${maxValue}, got: ${bigIntValue}`)\n\n this._value = encodingUtil.bigIntToUint8Array(bigIntValue, maxBytesLength(this.bitSize))\n }\n\n get native() {\n const bigIntValue = encodingUtil.uint8ArrayToBigInt(this._value)\n return this.bitSize <= UINT64_SIZE ? asUint64(bigIntValue) : asBigUint(bigIntValue)\n }\n\n asUint64() {\n const bigIntValue = encodingUtil.uint8ArrayToBigInt(this._value)\n if (bigIntValue > MAX_UINT64) {\n throw new CodeError('value too large to fit in uint64')\n }\n return asUint64(bigIntValue)\n }\n\n asBigUint() {\n const bigIntValue = encodingUtil.uint8ArrayToBigInt(this._value)\n return asBigUint(bigIntValue)\n }\n\n get uint8ArrayValue(): Uint8Array {\n return this._value\n }\n\n get bytes(): bytes {\n return Bytes(this._value)\n }\n\n equals(other: this): boolean {\n if (!(other instanceof Uint) || JSON.stringify(this.typeInfo) !== JSON.stringify(other.typeInfo)) {\n throw new CodeError(`Expected expression of type ${this.typeInfo.name}, got ${other.typeInfo.name}`)\n }\n return this.bytes.equals(other.bytes)\n }\n\n static fromBytes(value: StubBytesCompat | Uint8Array, typeInfo: string | TypeInfo, prefix: 'none' | 'log' = 'none'): Uint<BitSize> {\n let bytesValue = asBytesCls(value)\n if (prefix === 'log') {\n assert(bytesValue.slice(0, 4).equals(ABI_RETURN_VALUE_LOG_PREFIX), 'ABI return prefix not found')\n bytesValue = bytesValue.slice(4)\n }\n const result = new Uint<BitSize>(typeInfo)\n result._value = asUint8Array(bytesValue)\n return result\n }\n\n static getMaxBitsLength(typeInfo: TypeInfo): BitSize {\n return parseInt((typeInfo.genericArgs as TypeInfo[])![0].name, 10) as BitSize\n }\n}\n\n/** @internal */\nexport class UFixed<N extends BitSize, M extends number> extends _UFixed<N, M> implements _ARC4Encodedint8Array {\n private _value: Uint8Array\n private bitSize: N\n private precision: M\n typeInfo: TypeInfo\n\n constructor(typeInfo: TypeInfo | string, v?: `${number}.${number}`) {\n super(v)\n this.typeInfo = typeof typeInfo === 'string' ? JSON.parse(typeInfo) : typeInfo\n const genericArgs = this.typeInfo.genericArgs as uFixedGenericArgs\n this.bitSize = UFixed.getMaxBitsLength(this.typeInfo) as N\n this.precision = parseInt(genericArgs.m.name, 10) as M\n\n const trimmedValue = trimTrailingDecimalZeros(v ?? '0.0')\n assert(regExpNxM(this.precision).test(trimmedValue), `expected positive decimal literal with max of ${this.precision} decimal places`)\n\n const bigIntValue = BigInt(trimmedValue.replace('.', ''))\n const maxValue = maxBigIntValue(this.bitSize)\n assert(bigIntValue <= maxValue, `expected value <= ${maxValue}, got: ${bigIntValue}`)\n\n this._value = encodingUtil.bigIntToUint8Array(bigIntValue, maxBytesLength(this.bitSize))\n }\n\n get native() {\n const bigIntValue = encodingUtil.uint8ArrayToBigInt(this._value)\n return this.bitSize <= UINT64_SIZE ? asUint64(bigIntValue) : asBigUint(bigIntValue)\n }\n\n get uint8ArrayValue(): Uint8Array {\n return this._value\n }\n\n get bytes(): bytes {\n return Bytes(this._value)\n }\n\n equals(other: this): boolean {\n if (!(other instanceof UFixed) || JSON.stringify(this.typeInfo) !== JSON.stringify(other.typeInfo)) {\n throw new CodeError(`Expected expression of type ${this.typeInfo.name}, got ${other.typeInfo.name}`)\n }\n return this.bytes.equals(other.bytes)\n }\n\n static fromBytes(\n value: StubBytesCompat | Uint8Array,\n typeInfo: string | TypeInfo,\n prefix: 'none' | 'log' = 'none',\n ): _UFixed<BitSize, number> {\n let bytesValue = asBytesCls(value)\n if (prefix === 'log') {\n assert(bytesValue.slice(0, 4).equals(ABI_RETURN_VALUE_LOG_PREFIX), 'ABI return prefix not found')\n bytesValue = bytesValue.slice(4)\n }\n const result = new UFixed<BitSize, number>(typeInfo, '0.0')\n result._value = asUint8Array(bytesValue)\n return result\n }\n\n static getMaxBitsLength(typeInfo: TypeInfo): BitSize {\n const genericArgs = typeInfo.genericArgs as uFixedGenericArgs\n return parseInt(genericArgs.n.name, 10) as BitSize\n }\n}\n\n/** @internal */\nexport class Byte extends _Byte implements _ARC4Encodedint8Array {\n typeInfo: TypeInfo\n private _value: Uint<8>\n\n constructor(typeInfo: TypeInfo | string, v?: CompatForArc4Int<8>) {\n super(v)\n this.typeInfo = typeof typeInfo === 'string' ? JSON.parse(typeInfo) : typeInfo\n this._value = new Uint<8>(typeInfo, v)\n }\n\n asUint64() {\n return this._value.asUint64()\n }\n\n asBigUint() {\n return this._value.asBigUint()\n }\n\n get uint8ArrayValue(): Uint8Array {\n return this._value.uint8ArrayValue\n }\n\n get bytes(): bytes {\n return this._value.bytes\n }\n\n equals(other: this): boolean {\n if (!(other instanceof Byte) || JSON.stringify(this._value.typeInfo) !== JSON.stringify(other._value.typeInfo)) {\n throw new CodeError(`Expected expression of type ${this._value.typeInfo.name}, got ${other._value.typeInfo.name}`)\n }\n return this.bytes.equals(other.bytes)\n }\n\n static fromBytes(value: StubBytesCompat | Uint8Array, typeInfo: string | TypeInfo, prefix: 'none' | 'log' = 'none'): Byte {\n const uintNValue = Uint.fromBytes(value, typeInfo, prefix) as Uint<8>\n const result = new Byte(typeInfo)\n result._value = uintNValue\n return result\n }\n\n static getMaxBitsLength(typeInfo: TypeInfo): BitSize {\n return Uint.getMaxBitsLength(typeInfo)\n }\n}\n\n/** @internal */\nexport class Str extends _Str implements _ARC4Encodedint8Array {\n typeInfo: TypeInfo\n private _value: Uint8Array\n\n constructor(typeInfo: TypeInfo | string, s?: StringCompat) {\n super()\n const bytesValue = asBytesCls(s ?? '')\n const bytesLength = encodeLength(bytesValue.length.asNumber())\n this.typeInfo = typeof typeInfo === 'string' ? JSON.parse(typeInfo) : typeInfo\n this._value = asUint8Array(bytesLength.concat(bytesValue))\n }\n get native(): string {\n return encodingUtil.uint8ArrayToUtf8(this._value.slice(ABI_LENGTH_SIZE))\n }\n\n get uint8ArrayValue(): Uint8Array {\n return this._value\n }\n\n get bytes(): bytes {\n return Bytes(this._value)\n }\n\n equals(other: this): boolean {\n if (!(other instanceof Str)) {\n throw new CodeError(`Expected expression of type Str, got ${(other as object).constructor.name}`)\n }\n return this.bytes.equals(other.bytes)\n }\n\n static fromBytes(value: StubBytesCompat | Uint8Array, typeInfo: string | TypeInfo, prefix: 'none' | 'log' = 'none'): Str {\n let bytesValue = asBytesCls(value)\n if (prefix === 'log') {\n assert(bytesValue.slice(0, 4).equals(ABI_RETURN_VALUE_LOG_PREFIX), 'ABI return prefix not found')\n bytesValue = bytesValue.slice(4)\n }\n const result = new Str(typeInfo)\n result._value = asUint8Array(bytesValue)\n return result\n }\n}\n\n/** @internal */\nexport class Bool extends _Bool implements _ARC4Encodedint8Array {\n private _value: Uint8Array\n typeInfo: TypeInfo\n\n constructor(typeInfo: TypeInfo | string, v?: boolean) {\n super(v)\n this.typeInfo = typeof typeInfo === 'string' ? JSON.parse(typeInfo) : typeInfo\n this._value = encodingUtil.bigIntToUint8Array(v ? TRUE_BIGINT_VALUE : FALSE_BIGINT_VALUE, 1)\n }\n\n get native(): boolean {\n return encodingUtil.uint8ArrayToBigInt(this._value) === TRUE_BIGINT_VALUE\n }\n\n equals(other: this): boolean {\n if (!(other instanceof Bool)) {\n throw new CodeError(`Expected expression of type Bool, got ${(other as object).constructor.name}`)\n }\n return this.bytes.equals(other.bytes)\n }\n\n get uint8ArrayValue(): Uint8Array {\n return this._value\n }\n\n get bytes(): bytes {\n return Bytes(this._value?.length ? this._value : new Uint8Array([0]))\n }\n\n static fromBytes(value: StubBytesCompat | Uint8Array, typeInfo: string | TypeInfo, prefix: 'none' | 'log' = 'none'): Bool {\n let bytesValue = asBytesCls(value)\n if (prefix === 'log') {\n assert(bytesValue.slice(0, 4).equals(ABI_RETURN_VALUE_LOG_PREFIX), 'ABI return prefix not found')\n bytesValue = bytesValue.slice(4)\n }\n const result = new Bool(typeInfo)\n result._value = asUint8Array(bytesValue)\n return result\n }\n}\n\n/** @internal */\nexport class StaticArray<TItem extends _ARC4Encoded, TLength extends number>\n extends _StaticArray<TItem, TLength>\n implements _ARC4Encodedint8Array\n{\n private _value?: NTuple<TItem, TLength>\n private _uint8ArrayValue?: Uint8Array\n private size: number\n typeInfo: TypeInfo\n genericArgs: StaticArrayGenericArgs\n\n constructor(typeInfo: TypeInfo | string, ...items: TItem[] & { length: TLength })\n constructor(typeInfo: TypeInfo | string, ...items: TItem[])\n constructor(typeInfo: TypeInfo | string, ...items: TItem[] & { length: TLength }) {\n // if first item is the symbol, we are initialising from bytes\n // so we don't need to pass the items to the super constructor\n const isInitialisingFromBytes = items.length === 1 && (items[0] as DeliberateAny) === IS_INITIALISING_FROM_BYTES_SYMBOL\n super()\n\n this.typeInfo = typeof typeInfo === 'string' ? JSON.parse(typeInfo) : typeInfo\n this.genericArgs = this.typeInfo.genericArgs as StaticArrayGenericArgs\n this.size = parseInt(this.genericArgs.size.name, 10)\n\n // if we are not initialising from bytes, we need to check and set the items\n if (!isInitialisingFromBytes) {\n if (items.length && items.length !== this.size) {\n throw new CodeError(`expected ${this.size} items, not ${items.length}`)\n }\n\n assert(areAllARC4Encoded(items), 'expected ARC4 type')\n\n items.forEach((item) => {\n checkItemTypeName(this.genericArgs.elementType, item)\n })\n\n if (items.length) {\n this._value = items as NTuple<TItem, TLength>\n } else {\n this._uint8ArrayValue = new Uint8Array(getMaxLengthOfStaticContentType(this.typeInfo))\n }\n }\n return new Proxy(this, arrayProxyHandler<TItem>()) as StaticArray<TItem, TLength>\n }\n\n get uint8ArrayValue(): Uint8Array {\n return this._uint8ArrayValue ?? encode(this.items, true)\n }\n\n get bytes(): bytes {\n return Bytes(this._uint8ArrayValue ?? encode(this.items, true))\n }\n\n equals(other: this): boolean {\n if (!(other instanceof StaticArray) || JSON.stringify(this.typeInfo) !== JSON.stringify(other.typeInfo)) {\n throw new CodeError(`Expected expression of type ${this.typeInfo.name}, got ${other.typeInfo.name}`)\n }\n return this.bytes.equals(other.bytes)\n }\n\n get length(): uint64 {\n return this.size\n }\n\n get items(): NTuple<TItem, TLength> {\n if (this._uint8ArrayValue) {\n const childTypes = Array(this.size).fill(this.genericArgs.elementType)\n this._value = decode(this._uint8ArrayValue, childTypes, true) as NTuple<TItem, TLength>\n this._uint8ArrayValue = undefined\n return this._value\n } else if (this._value) {\n this._uint8ArrayValue = undefined\n return this._value\n }\n throw new CodeError('value is not set')\n }\n\n setItem(index: number, value: TItem): void {\n this.items[index] = value\n }\n\n copy(): StaticArray<TItem, TLength> {\n return StaticArray.fromBytes(this.uint8ArrayValue, JSON.stringify(this.typeInfo)) as unknown as StaticArray<TItem, TLength>\n }\n\n concat(other: Parameters<InstanceType<typeof _StaticArray>['concat']>[0]): DynamicArray<TItem> {\n const items = this.items\n const otherEntries = other.entries()\n let next = otherEntries.next()\n while (!next.done) {\n items.push(next.value[1] as TItem)\n next = otherEntries.next()\n }\n return new DynamicArray<TItem>(\n { name: `DynamicArray<${this.genericArgs.elementType.name}>`, genericArgs: { elementType: this.genericArgs.elementType } },\n ...items,\n )\n }\n\n get native(): NTuple<TItem, TLength> {\n return this.items\n }\n\n static fromBytes(\n value: StubBytesCompat | Uint8Array,\n typeInfo: string | TypeInfo,\n prefix: 'none' | 'log' = 'none',\n ): StaticArray<_ARC4Encoded, number> {\n let bytesValue = value instanceof Uint8Array ? value : asUint8Array(value)\n if (prefix === 'log') {\n assert(Bytes(bytesValue.slice(0, 4)).equals(ABI_RETURN_VALUE_LOG_PREFIX), 'ABI return prefix not found')\n bytesValue = bytesValue.slice(4)\n }\n // pass the symbol to the constructor to let it know we are initialising from bytes\n const result = new StaticArray<_ARC4Encoded, number>(typeInfo, IS_INITIALISING_FROM_BYTES_SYMBOL as DeliberateAny)\n result._uint8ArrayValue = bytesValue\n return result\n }\n}\n\n/** @internal */\nexport class Address extends _Address implements _ARC4Encodedint8Array {\n typeInfo: TypeInfo\n private _value: StaticArray<Byte, 32>\n\n constructor(typeInfo: TypeInfo | string, value?: AccountType | string | bytes) {\n super(value)\n let uint8ArrayValue: Uint8Array\n if (value === undefined) {\n uint8ArrayValue = new Uint8Array(32)\n } else if (typeof value === 'string') {\n uint8ArrayValue = encodingUtil.base32ToUint8Array(value).slice(0, ALGORAND_ADDRESS_BYTE_LENGTH - ALGORAND_CHECKSUM_BYTE_LENGTH)\n } else if (isBytes(value)) {\n uint8ArrayValue = getUint8Array(value)\n } else {\n uint8ArrayValue = getUint8Array(value.bytes)\n }\n avmInvariant(uint8ArrayValue.length === 32, 'Addresses should be 32 bytes')\n\n this._value = StaticArray.fromBytes(uint8ArrayValue, typeInfo) as StaticArray<Byte, 32>\n this.typeInfo = typeof typeInfo === 'string' ? JSON.parse(typeInfo) : typeInfo\n return new Proxy(this, arrayProxyHandler<Byte>()) as Address\n }\n\n get uint8ArrayValue(): Uint8Array {\n return this._value.uint8ArrayValue\n }\n\n get bytes(): bytes {\n return this._value.bytes\n }\n\n equals(other: this): boolean {\n if (!(other instanceof Address) || JSON.stringify(this.typeInfo) !== JSON.stringify(other.typeInfo)) {\n throw new CodeError(`Expected expression of type ${this.typeInfo.name}, got ${other.typeInfo.name}`)\n }\n return this.bytes.equals(other.bytes)\n }\n\n get length(): uint64 {\n return 32\n }\n\n get native(): AccountType {\n return Account(this._value.bytes)\n }\n\n get items(): readonly Byte[] {\n return this._value.items\n }\n\n setItem(_index: number, _value: Byte): void {\n throw new CodeError('Address is immutable')\n }\n\n static fromBytes(value: StubBytesCompat | Uint8Array, typeInfo: string | TypeInfo, prefix: 'none' | 'log' = 'none'): Address {\n const staticArrayValue = StaticArray.fromBytes(value, typeInfo, prefix) as StaticArray<Byte, 32>\n const result = new Address(typeInfo)\n result._value = staticArrayValue\n return result\n }\n}\n\n/** @internal */\nexport class DynamicArray<TItem extends _ARC4Encoded> extends _DynamicArray<TItem> implements _ARC4Encodedint8Array {\n private _value?: TItem[]\n private _uint8ArrayValue?: Uint8Array\n typeInfo: TypeInfo\n genericArgs: DynamicArrayGenericArgs\n\n constructor(typeInfo: TypeInfo | string, ...items: TItem[]) {\n super()\n this.typeInfo = typeof typeInfo === 'string' ? JSON.parse(typeInfo) : typeInfo\n this.genericArgs = this.typeInfo.genericArgs as DynamicArrayGenericArgs\n\n assert(areAllARC4Encoded(items), 'expected ARC4 type')\n\n items.forEach((item) => {\n checkItemTypeName(this.genericArgs.elementType, item)\n })\n this._value = items\n\n return new Proxy(this, arrayProxyHandler<TItem>()) as DynamicArray<TItem>\n }\n\n get uint8ArrayValue(): Uint8Array {\n return this._uint8ArrayValue ?? this.encodeWithLength(this.items)\n }\n\n get bytes(): bytes {\n return Bytes(this._uint8ArrayValue ?? this.encodeWithLength(this.items))\n }\n\n equals(other: this): boolean {\n if (!(other instanceof DynamicArray) || JSON.stringify(this.typeInfo) !== JSON.stringify(other.typeInfo)) {\n throw new CodeError(`Expected expression of type ${this.typeInfo.name}, got ${other.typeInfo.name}`)\n }\n return this.bytes.equals(other.bytes)\n }\n\n get length(): uint64 {\n return this.items.length\n }\n\n get items(): TItem[] {\n if (this._uint8ArrayValue) {\n const [length, data] = readLength(this._uint8ArrayValue)\n const childTypes = Array(length).fill(this.genericArgs.elementType)\n this._value = decode(data, childTypes, true) as TItem[]\n this._uint8ArrayValue = undefined\n return this._value\n } else if (this._value) {\n this._uint8ArrayValue = undefined\n return this._value\n }\n throw new CodeError('value is not set')\n }\n\n setItem(index: number, value: TItem): void {\n this.items[index] = value\n }\n\n copy(): DynamicArray<TItem> {\n return DynamicArray.fromBytes(this.uint8ArrayValue, JSON.stringify(this.typeInfo)) as DynamicArray<TItem>\n }\n\n get native(): TItem[] {\n return this.items\n }\n\n push(...values: TItem[]) {\n const items = this.items\n items.push(...values)\n }\n\n pop(): TItem {\n const items = this.items\n const popped = items.pop()\n if (popped === undefined) throw new AvmError('The array is empty')\n return popped\n }\n\n concat(other: Parameters<InstanceType<typeof _DynamicArray>['concat']>[0]): DynamicArray<TItem> {\n const items = this.items\n const otherEntries = other.entries()\n let next = otherEntries.next()\n while (!next.done) {\n items.push(next.value[1] as TItem)\n next = otherEntries.next()\n }\n return new DynamicArray<TItem>(this.typeInfo, ...items)\n }\n\n static fromBytes(\n value: StubBytesCompat | Uint8Array,\n typeInfo: string | TypeInfo,\n prefix: 'none' | 'log' = 'none',\n ): DynamicArray<_ARC4Encoded> {\n let bytesValue = asBytesCls(value)\n if (prefix === 'log') {\n assert(bytesValue.slice(0, 4).equals(ABI_RETURN_VALUE_LOG_PREFIX), 'ABI return prefix not found')\n bytesValue = bytesValue.slice(4)\n }\n const result = new DynamicArray(typeInfo)\n result._uint8ArrayValue = asUint8Array(bytesValue)\n return result\n }\n\n private encodeWithLength(items: TItem[]) {\n return concatUint8Arrays(encodeLength(items.length).asUint8Array(), encode(items, true))\n }\n}\n\n/** @internal */\nexport class Tuple<TTuple extends [_ARC4Encoded, ..._ARC4Encoded[]]> extends _Tuple<TTuple> implements _ARC4Encodedint8Array {\n private _value?: TTuple\n private _uint8ArrayValue?: Uint8Array\n typeInfo: TypeInfo\n genericArgs: TypeInfo[]\n\n constructor(typeInfo: TypeInfo | string, ...items: TTuple) {\n // if first item is the symbol, we are initialising from bytes\n // so we don't need to pass the items to the super constructor\n const isInitialisingFromBytes = items.length === 1 && (items[0] as DeliberateAny) === IS_INITIALISING_FROM_BYTES_SYMBOL\n super(...(isInitialisingFromBytes ? ([] as DeliberateAny) : items))\n this.typeInfo = typeof typeInfo === 'string' ? JSON.parse(typeInfo) : typeInfo\n this.genericArgs = Object.values(this.typeInfo.genericArgs as Record<string, TypeInfo>)\n\n // if we are not initialising from bytes, we need to check and set the items\n if (!isInitialisingFromBytes) {\n assert(areAllARC4Encoded(items), 'expected ARC4 type')\n\n items.forEach((item, index) => {\n checkItemTypeName(this.genericArgs[index], item)\n })\n if (items.length) {\n this._value = items\n } else {\n this._uint8ArrayValue = new Uint8Array(getMaxLengthOfStaticContentType(this.typeInfo))\n }\n }\n }\n\n get uint8ArrayValue(): Uint8Array {\n return this._uint8ArrayValue ?? encode(this.items)\n }\n\n get bytes(): bytes {\n return Bytes(this._uint8ArrayValue ?? encode(this.items))\n }\n\n equals(other: this): boolean {\n if (!(other instanceof Tuple) || JSON.stringify(this.typeInfo) !== JSON.stringify(other.typeInfo)) {\n throw new CodeError(`Expected expression of type ${this.typeInfo.name}, got ${other.typeInfo.name}`)\n }\n return this.bytes.equals(other.bytes)\n }\n\n get length(): TTuple['length'] & uint64 {\n return this.items.length\n }\n\n get native(): TTuple {\n return this.items\n }\n\n at<TIndex extends keyof TTuple>(index: TIndex): TTuple[TIndex] {\n return this.items[index]\n }\n\n private get items(): TTuple {\n if (this._uint8ArrayValue) {\n this._value = decode(this._uint8ArrayValue, this.genericArgs) as TTuple\n this._uint8ArrayValue = undefined\n return this._value\n } else if (this._value) {\n this._uint8ArrayValue = undefined\n return this._value\n }\n throw new CodeError('value is not set')\n }\n\n static fromBytes(\n value: StubBytesCompat | Uint8Array,\n typeInfo: string | TypeInfo,\n prefix: 'none' | 'log' = 'none',\n ): Tuple<[_ARC4Encoded, ..._ARC4Encoded[]]> {\n let bytesValue = asBytesCls(value)\n if (prefix === 'log') {\n assert(bytesValue.slice(0, 4).equals(ABI_RETURN_VALUE_LOG_PREFIX), 'ABI return prefix not found')\n bytesValue = bytesValue.slice(4)\n }\n // pass the symbol to the constructor to let it know we are initialising from bytes\n const result = new Tuple(typeInfo, IS_INITIALISING_FROM_BYTES_SYMBOL as DeliberateAny)\n result._uint8ArrayValue = asUint8Array(bytesValue)\n return result\n }\n}\n\n/** @internal */\nexport class Struct<T extends StructConstraint> extends (_Struct<StructConstraint> as DeliberateAny) implements _ARC4Encodedint8Array {\n private _uint8ArrayValue?: Uint8Array\n genericArgs: Record<string, TypeInfo>\n\n constructor(typeInfo: TypeInfo | string, value: T = {} as T) {\n super(value)\n this.typeInfo = typeof typeInfo === 'string' ? JSON.parse(typeInfo) : typeInfo\n this.genericArgs = this.typeInfo.genericArgs as Record<string, TypeInfo>\n\n Object.keys(this.genericArgs).forEach((key) => {\n Object.defineProperty(this, key, {\n value: value[key],\n writable: true,\n enumerable: true,\n })\n })\n\n return new Proxy(this, {\n get(target, prop) {\n const originalValue = Reflect.get(target, prop)\n if (originalValue === undefined && target._uint8ArrayValue?.length && Object.keys(target.genericArgs).includes(prop.toString())) {\n return target.items[prop.toString()]\n }\n return originalValue\n },\n set(target, prop, value) {\n if (target._uint8ArrayValue && Object.keys(target.genericArgs).includes(prop.toString())) {\n target.decodeAsProperties()\n }\n return Reflect.set(target, prop, value)\n },\n })\n }\n\n get uint8ArrayValue(): Uint8Array {\n return this._uint8ArrayValue ?? encode(Object.values(this.items))\n }\n\n get bytes(): bytes {\n return Bytes(this._uint8ArrayValue ?? encode(Object.values(this.items)))\n }\n\n get items(): T {\n this.decodeAsProperties()\n const result = {} as StructConstraint\n Object.keys(this.genericArgs).forEach((key) => {\n result[key] = (this as unknown as StructConstraint)[key]\n })\n return result as T\n }\n\n get native(): T {\n return this.items\n }\n\n copy(): Struct<T> {\n return Struct.fromBytes(this.uint8ArrayValue, JSON.stringify(this.typeInfo)) as Struct<T>\n }\n\n private decodeAsProperties() {\n if (this._uint8ArrayValue) {\n const values = decode(this._uint8ArrayValue, Object.values(this.genericArgs))\n Object.keys(this.genericArgs).forEach((key, index) => {\n ;(this as unknown as StructConstraint)[key] = values[index]\n })\n this._uint8ArrayValue = undefined\n }\n }\n\n static fromBytes(\n value: StubBytesCompat | Uint8Array,\n typeInfo: string | TypeInfo,\n prefix: 'none' | 'log' = 'none',\n ): Struct<StructConstraint> {\n let bytesValue = asBytesCls(value)\n if (prefix === 'log') {\n assert(bytesValue.slice(0, 4).equals(ABI_RETURN_VALUE_LOG_PREFIX), 'ABI return prefix not found')\n bytesValue = bytesValue.slice(4)\n }\n const result = new Struct(typeInfo)\n result._uint8ArrayValue = asUint8Array(bytesValue)\n return result\n }\n}\n\n/** @internal */\nexport class DynamicBytes extends _DynamicBytes implements _ARC4Encodedint8Array {\n typeInfo: TypeInfo\n private _value: DynamicArray<Byte>\n\n constructor(typeInfo: TypeInfo | string, value?: bytes | string) {\n super(value)\n const uint8ArrayValue = concatUint8Arrays(encodeLength(value?.length ?? 0).asUint8Array(), asUint8Array(value ?? new Uint8Array()))\n this._value = DynamicArray.fromBytes(uint8ArrayValue, typeInfo) as DynamicArray<Byte>\n this.typeInfo = typeof typeInfo === 'string' ? JSON.parse(typeInfo) : typeInfo\n return new Proxy(this, arrayProxyHandler<Byte>()) as DynamicBytes\n }\n\n get uint8ArrayValue(): Uint8Array {\n return this._value.uint8ArrayValue\n }\n\n get bytes(): bytes {\n return this._value.bytes\n }\n\n equals(other: this): boolean {\n if (!(other instanceof DynamicBytes) || JSON.stringify(this.typeInfo) !== JSON.stringify(other.typeInfo)) {\n throw new CodeError(`Expected expression of type ${this.typeInfo.name}, got ${other.typeInfo.name}`)\n }\n return this.bytes.equals(other.bytes)\n }\n\n get length(): uint64 {\n return this._value.length\n }\n\n get native(): bytes {\n return this._value.bytes.slice(ABI_LENGTH_SIZE)\n }\n\n get items(): Byte[] {\n return this._value.items\n }\n\n setItem(_index: number, _value: Byte): void {\n throw new CodeError('DynamicBytes is immutable')\n }\n\n concat(other: Parameters<InstanceType<typeof _DynamicBytes>['concat']>[0]): DynamicBytes {\n const items = this.items\n const otherEntries = other.entries()\n let next = otherEntries.next()\n while (!next.done) {\n items.push(next.value[1] as Byte)\n next = otherEntries.next()\n }\n const concatenatedBytes = items\n .map((item) => item.uint8ArrayValue)\n .reduce((acc, curr) => concatUint8Arrays(acc, curr), new Uint8Array())\n return new DynamicBytes(this.typeInfo, asBytes(concatenatedBytes))\n }\n\n static fromBytes(value: StubBytesCompat | Uint8Array, typeInfo: string | TypeInfo, prefix: 'none' | 'log' = 'none'): DynamicBytes {\n const dynamicArrayValue = DynamicArray.fromBytes(value, typeInfo, prefix) as DynamicArray<Byte>\n const result = new DynamicBytes(typeInfo)\n result._value = dynamicArrayValue\n return result\n }\n}\n\n/** @internal */\nexport class StaticBytes<TLength extends uint64 = 0> extends _StaticBytes<TLength> implements _ARC4Encodedint8Array {\n private _value: StaticArray<Byte, TLength>\n typeInfo: TypeInfo\n\n constructor(typeInfo: TypeInfo | string, value?: bytes<TLength>) {\n super(value ?? (Bytes() as bytes<TLength>))\n this.typeInfo = typeof typeInfo === 'string' ? JSON.parse(typeInfo) : typeInfo\n const uint8ArrayValue = asUint8Array(value ?? new Uint8Array(getMaxLengthOfStaticContentType(this.typeInfo)))\n this._value = StaticArray.fromBytes(uint8ArrayValue, typeInfo) as unknown as StaticArray<Byte, TLength>\n return new Proxy(this, arrayProxyHandler<Byte>()) as StaticBytes<TLength>\n }\n\n get uint8ArrayValue(): Uint8Array {\n return this._value.uint8ArrayValue\n }\n\n get bytes(): bytes {\n return this._value.bytes\n }\n\n equals(other: this): boolean {\n if (!(other instanceof StaticBytes) || JSON.stringify(this.typeInfo) !== JSON.stringify(other.typeInfo)) {\n throw new CodeError(`Expected expression of type ${this.typeInfo.name}, got ${other.typeInfo.name}`)\n }\n return this.bytes.equals(other.bytes)\n }\n\n get length(): uint64 {\n return this._value.length\n }\n\n get native(): bytes<TLength> {\n return this._value.bytes as bytes<TLength>\n }\n\n get items(): Byte[] {\n return this._value.items\n }\n\n setItem(_index: number, _value: Byte): void {\n throw new CodeError('StaticBytes is immutable')\n }\n\n concat(other: Parameters<InstanceType<typeof _StaticBytes>['concat']>[0]): DynamicBytes {\n const items = this.items\n const otherEntries = other.entries()\n let next = otherEntries.next()\n while (!next.done) {\n items.push(next.value[1] as Byte)\n next = otherEntries.next()\n }\n const concatenatedBytes = items\n .map((item) => item.uint8ArrayValue)\n .reduce((acc, curr) => concatUint8Arrays(acc, curr), new Uint8Array())\n return new DynamicBytes(this.typeInfo, asBytes(concatenatedBytes))\n }\n\n static fromBytes(value: StubBytesCompat | Uint8Array, typeInfo: string | TypeInfo, prefix: 'none' | 'log' = 'none'): StaticBytes {\n const staticArrayValue = StaticArray.fromBytes(value, typeInfo, prefix) as StaticArray<Byte, number>\n const result = new StaticBytes(typeInfo)\n result._value = staticArrayValue as StaticArray<Byte, 0>\n return result\n }\n}\n\n/** @internal */\nexport class ReferenceArray<TItem> extends _ReferenceArray<TItem> {\n private _values: TItem[]\n typeInfo: TypeInfo\n\n constructor(typeInfo: TypeInfo | string, ...items: TItem[]) {\n super(...items)\n this.typeInfo = typeof typeInfo === 'string' ? JSON.parse(typeInfo) : typeInfo\n this._values = items\n\n return new Proxy(this, arrayProxyHandler<TItem>()) as ReferenceArray<TItem>\n }\n\n /**\n * Returns the current length of this array\n */\n get length(): uint64 {\n return this._values.length\n }\n\n get items(): TItem[] {\n return this._values\n }\n\n setItem(index: number, value: TItem): void {\n this.items[index] = value\n }\n\n slice(start?: Uint64Compat, end?: Uint64Compat): _ReferenceArray<TItem> {\n const startIndex = end === undefined ? 0 : asNumber(start ?? 0)\n const endIndex = end === undefined ? asNumber(start ?? this._values.length) : asNumber(end)\n return new ReferenceArray<TItem>(this.typeInfo, ...this._values.slice(startIndex, endIndex))\n }\n\n /**\n * Push a number of items into this array\n * @param items The items to be added to this array\n */\n push(...items: TItem[]): void {\n this._values.push(...items)\n }\n\n /**\n * Pop a single item from this array\n */\n pop(): TItem {\n return this._values.pop()!\n }\n\n copy(): _ReferenceArray<TItem> {\n const bytesValue = toBytes(this)\n return getEncoder<_ReferenceArray<TItem>>(this.typeInfo)(bytesValue, this.typeInfo)\n }\n}\n\n/** @internal */\nexport class FixedArray<TItem, TLength extends number> extends _FixedArray<TItem, TLength> {\n private _values: NTuple<TItem, TLength>\n private size: number\n typeInfo: TypeInfo\n private genericArgs: StaticArrayGenericArgs\n\n constructor(typeInfo: TypeInfo | string, ...items: TItem[] & { length: TLength }) {\n super()\n this.typeInfo = typeof typeInfo === 'string' ? JSON.parse(typeInfo) : typeInfo\n this.genericArgs = this.typeInfo.genericArgs as StaticArrayGenericArgs\n this.size = parseInt(this.genericArgs.size.name, 10)\n if (items.length) {\n this._values = items as NTuple<TItem, TLength>\n } else {\n const bytesValue = asBytes(new Uint8Array(getMaxLengthOfStaticContentType(this.typeInfo)))\n this._values = (getEncoder<_FixedArray<TItem, TLength>>(this.typeInfo)(bytesValue, this.typeInfo) as FixedArray<TItem, TLength>).items\n }\n return new Proxy(this, arrayProxyHandler<TItem>()) as FixedArray<TItem, TLength>\n }\n\n concat(...others: (TItem | ConcatArray<TItem>)[]): TItem[] {\n return this.items.concat(...others)\n }\n\n get length(): uint64 {\n return this.size\n }\n\n get items(): NTuple<TItem, TLength> {\n return this._values\n }\n\n setItem(index: number, value: TItem): void {\n this.items[index] = value\n }\n\n slice(start?: Uint64Compat, end?: Uint64Compat): Array<TItem> {\n const startIndex = end === undefined ? 0 : asNumber(start ?? 0)\n const endIndex = end === undefined ? asNumber(start ?? this._values.length) : asNumber(end)\n return this._values.slice(startIndex, endIndex)\n }\n\n copy(): _FixedArray<TItem, TLength> {\n const bytesValue = toBytes(this)\n return getEncoder<_FixedArray<TItem, TLength>>(this.typeInfo)(bytesValue, this.typeInfo)\n }\n}\n\nconst decode = (value: Uint8Array, childTypes: TypeInfo[], isHomogenous?: boolean) => {\n let i = 0\n let arrayIndex = 0\n const valuePartitions: Uint8Array[] = []\n const dynamicSegments: Array<Array<number>> = [] // Store the start and end of a dynamic element\n\n while (i < childTypes.length) {\n const childType = childTypes[i]\n if (holdsDynamicLengthContent(childType)) {\n // Decode the size of the dynamic element\n const dynamicIndex = uint8ArrayToNumber(value.slice(arrayIndex, arrayIndex + ABI_LENGTH_SIZE))\n if (dynamicSegments.length) {\n dynamicSegments.at(-1)![1] = dynamicIndex\n }\n // Since we do not know where the current dynamic element ends,\n // put a placeholder and update later\n dynamicSegments.push([dynamicIndex, -1])\n valuePartitions.push(new Uint8Array())\n arrayIndex += ABI_LENGTH_SIZE\n } else if (['Bool', 'boolean'].includes(childType.name)) {\n const before = findBoolTypes(childTypes, i, -1, isHomogenous)\n let after = findBoolTypes(childTypes, i, 1, isHomogenous)\n\n if (before % 8 != 0) {\n throw new CodeError('\"expected before index should have number of bool mod 8 equal 0\"')\n }\n after = Math.min(7, after)\n const bits = uint8ArrayToNumber(value.slice(arrayIndex, arrayIndex + 1))\n Array(after + 1)\n .fill(0)\n .forEach((_, j) => {\n const mask = 128 >> j\n valuePartitions.push(\n mask & bits ? encodingUtil.bigIntToUint8Array(TRUE_BIGINT_VALUE) : encodingUtil.bigIntToUint8Array(FALSE_BIGINT_VALUE),\n )\n })\n i += after\n arrayIndex += 1\n } else {\n const currLen = getMaxLengthOfStaticContentType(childType)\n valuePartitions.push(value.slice(arrayIndex, arrayIndex + currLen))\n arrayIndex += currLen\n }\n\n if (arrayIndex >= value.length && i != childTypes.length - 1) {\n throw new CodeError('input string is not long enough to be decoded')\n }\n i += 1\n }\n\n if (dynamicSegments.length > 0) {\n dynamicSegments.at(-1)![1] = value.length\n arrayIndex = value.length\n }\n if (arrayIndex < value.length) {\n throw new CodeError('input string was not fully consumed')\n }\n\n // Check dynamic element partitions\n let segmentIndex = 0\n childTypes.forEach((childType, index) => {\n if (holdsDynamicLengthContent(childType)) {\n const [segmentStart, segmentEnd] = dynamicSegments[segmentIndex]\n valuePartitions[index] = value.slice(segmentStart, segmentEnd)\n segmentIndex += 1\n }\n })\n\n const values: _ARC4Encoded[] = []\n childTypes.forEach((childType, index) => {\n values.push(\n getEncoder<_ARC4Encoded>(childType)(\n ['bytes', 'string'].includes(childType.name) ? valuePartitions[index].slice(2) : valuePartitions[index],\n childType,\n ),\n )\n })\n return values\n}\n\nconst encode = (values: (_ARC4Encoded & { uint8ArrayValue?: Uint8Array })[], isHomogenous?: boolean) => {\n const length = values.length\n const heads = []\n const tails = []\n const dynamicLengthTypeIndex = []\n let i = 0\n const valuesLengthBytes = values instanceof _DynamicArray ? encodeLength(length).asUint8Array() : new Uint8Array()\n while (i < length) {\n const value = values[i]\n assert(value instanceof _ARC4Encoded, `expected ARC4 type ${value.constructor.name}`)\n dynamicLengthTypeIndex.push(isDynamicLengthType(value))\n if (dynamicLengthTypeIndex.at(-1)) {\n heads.push(asUint8Array(Bytes.fromHex('0000')))\n tails.push((value as _ARC4Encodedint8Array).uint8ArrayValue ?? asUint8Array(value.bytes))\n } else {\n if (value instanceof _Bool) {\n const before = findBool(values, i, -1, isHomogenous)\n let after = findBool(values, i, 1, isHomogenous)\n if (before % 8 != 0) {\n throw new CodeError('\"expected before index should have number of bool mod 8 equal 0\"')\n }\n after = Math.min(7, after)\n const consecutiveBools = values.slice(i, i + after + 1) as _Bool[]\n const compressedNumber = compressMultipleBool(consecutiveBools)\n heads.push(new Uint8Array([compressedNumber]))\n i += after\n } else {\n heads.push((value as _ARC4Encodedint8Array).uint8ArrayValue ?? asUint8Array(value.bytes))\n }\n tails.push(new Uint8Array())\n }\n i += 1\n }\n\n // Adjust heads for dynamic types\n let headLength = 0\n heads.forEach((head) => {\n // If the element is not a placeholder, append the length of the element\n headLength += head.length\n })\n\n // Correctly encode dynamic types and replace placeholder\n let tailCurrLength = 0\n for (let i = 0; i < heads.length; i++) {\n if (dynamicLengthTypeIndex[i]) {\n const headValue = headLength + tailCurrLength\n heads[i] = asUint8Array(encodeLength(headValue))\n }\n tailCurrLength += tails[i].length\n }\n\n return concatUint8Arrays(valuesLengthBytes, ...heads, ...tails)\n}\n\nconst isDynamicLengthType = (value: _ARC4Encoded) => {\n return (\n value instanceof Str ||\n (value instanceof StaticArray && holdsDynamicLengthContent(value.typeInfo)) ||\n (value instanceof Tuple && value.genericArgs.some(holdsDynamicLengthContent)) ||\n (value instanceof Struct && Object.values(value.genericArgs).some(holdsDynamicLengthContent)) ||\n value instanceof DynamicArray ||\n value instanceof DynamicBytes\n )\n}\n\n/** @internal */\nexport function encodeArc4<T>(sourceTypeInfoString: string | undefined, source: T): bytes {\n const arc4Encoded = getArc4Encoded(source, sourceTypeInfoString)\n return arc4Encoded.bytes\n}\n\n/** @internal */\nexport function decodeArc4<T>(\n sourceTypeInfoString: string,\n targetTypeInfoString: string,\n bytes: StubBytesCompat,\n prefix: 'none' | 'log' = 'none',\n): T {\n const sourceTypeInfo = JSON.parse(sourceTypeInfoString)\n const targetTypeInfo = JSON.parse(targetTypeInfoString)\n const encoder = getEncoder(sourceTypeInfo)\n const source = encoder(bytes, sourceTypeInfo, prefix) as { typeInfo: TypeInfo }\n return getNativeValue(source, targetTypeInfo) as T\n}\n\n/** @internal */\nexport function convertBytes<T extends _ARC4Encoded>(\n typeInfoString: string,\n bytes: StubBytesCompat,\n options: { prefix?: 'none' | 'log'; strategy: 'unsafe-cast' },\n): T {\n const typeInfo = JSON.parse(typeInfoString)\n return getEncoder<T>(typeInfo)(bytes, typeInfo, options.prefix)\n}\n\n/** @internal */\nexport const getArc4Encoded = (value: DeliberateAny, sourceTypeInfoString?: string): _ARC4Encoded => {\n if (value instanceof _ARC4Encoded) {\n return value\n }\n if (value instanceof AccountCls) {\n return getArc4Encoded(value.bytes)\n }\n if (value instanceof AssetCls) {\n return getArc4Encoded(value.id)\n }\n if (value instanceof ApplicationCls) {\n return getArc4Encoded(value.id)\n }\n if (typeof value === 'boolean') {\n return new Bool({ name: 'Bool' }, value)\n }\n if (value instanceof Uint64Cls || typeof value === 'number') {\n return new Uint({ name: 'Uint<64>', genericArgs: [{ name: '64' }] }, asBigInt(value))\n }\n if (value instanceof BigUintCls) {\n return new Uint({ name: 'Uint<512>', genericArgs: [{ name: '512' }] }, value.asBigInt())\n }\n if (typeof value === 'bigint') {\n return new Uint({ name: 'Uint<512>', genericArgs: [{ name: '512' }] }, value)\n }\n if (value instanceof BytesCls) {\n if (value.fixedLength !== undefined) {\n return new StaticBytes(\n {\n name: 'StaticBytes',\n genericArgs: { elementType: { name: 'Byte', genericArgs: [{ name: '8' }] }, size: { name: value.fixedLength.toString() } },\n },\n value.asAlgoTs(),\n )\n }\n return new DynamicBytes(\n { name: 'DynamicBytes', genericArgs: { elementType: { name: 'Byte', genericArgs: [{ name: '8' }] } } },\n value.asAlgoTs(),\n )\n }\n if (typeof value === 'string') {\n return new Str({ name: 'Str' }, value)\n }\n if (Array.isArray(value) || value instanceof ReferenceArray || value instanceof FixedArray) {\n const sourceTypeInfo = sourceTypeInfoString ? JSON.parse(sourceTypeInfoString) : undefined\n const sourceGenericArgs = ((value as DeliberateAny).typeInfo || sourceTypeInfo || {})?.genericArgs\n const result: _ARC4Encoded[] = (value instanceof ReferenceArray || value instanceof FixedArray ? value.items : value).reduce(\n (acc: _ARC4Encoded[], cur: DeliberateAny, currentIndex: number) => {\n const elementTypeInfo = sourceGenericArgs?.elementType || sourceGenericArgs?.[currentIndex]\n const elementTypeInfoString = elementTypeInfo ? JSON.stringify(elementTypeInfo) : undefined\n return acc.concat(getArc4Encoded(cur, elementTypeInfoString))\n },\n [],\n )\n\n const genericArgs: TypeInfo[] = result.map((x) => (x as DeliberateAny).typeInfo)\n if (value instanceof FixedArray) {\n const typeInfo = {\n name: `StaticArray<${genericArgs[0].name},${genericArgs.length}>`,\n genericArgs: { elementType: genericArgs[0], size: { name: genericArgs.length.toString() } },\n }\n return new StaticArray(typeInfo, ...(result as [_ARC4Encoded, ..._ARC4Encoded[]]))\n } else if (\n sourceTypeInfo?.name?.startsWith('Array') ||\n sourceTypeInfo?.name?.startsWith('ReadonlyArray') ||\n value instanceof ReferenceArray\n ) {\n const elementType = genericArgs[0] ?? sourceTypeInfo.genericArgs?.elementType\n const typeInfo = { name: `DynamicArray<${elementType.name}>`, genericArgs: { elementType } }\n return new DynamicArray(typeInfo, ...(result as [_ARC4Encoded, ..._ARC4Encoded[]]))\n } else {\n const typeInfo = { name: `Tuple<[${genericArgs.map((x) => x.name).join(',')}]>`, genericArgs }\n return new Tuple(typeInfo, ...(result as [_ARC4Encoded, ..._ARC4Encoded[]]))\n }\n }\n if (typeof value === 'object') {\n const sourceTypeInfo = sourceTypeInfoString ? JSON.parse(sourceTypeInfoString) : undefined\n const propTypeInfos = (value.typeInfo || sourceTypeInfo || {}).genericArgs\n const result = Object.entries(value).reduce((acc: _ARC4Encoded[], [key, cur]: DeliberateAny) => {\n const propTypeInfoString = propTypeInfos?.[key] ? JSON.stringify(propTypeInfos[key]) : undefined\n return acc.concat(getArc4Encoded(cur, propTypeInfoString))\n }, [])\n const genericArgs: TypeInfo[] = result.map((x) => (x as DeliberateAny).typeInfo)\n const typeInfo = {\n name: `Struct<${value.constructor.name}>`,\n genericArgs: Object.fromEntries(Object.keys(value).map((x, i) => [x, genericArgs[i]])),\n }\n 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 return asBytes(toUint8Array(val, sourceTypeInfoString))\n}\n\n/** @internal */\nexport const toUint8Array = (val: unknown, sourceTypeInfoString?: string): Uint8Array => {\n const uint64Val = asMaybeUint64Cls(val, false)\n if (uint64Val !== undefined) {\n return uint64Val.toBytes().asUint8Array()\n }\n const bytesVal = asMaybeBytesCls(val)\n if (bytesVal !== undefined) {\n return bytesVal.asUint8Array()\n }\n const bigUintVal = asMaybeBigUintCls(val)\n if (bigUintVal !== undefined) {\n return bigUintVal.toBytes().asUint8Array()\n }\n if (val instanceof BytesBackedCls) {\n return asUint8Array(val.bytes)\n }\n if (val instanceof Uint64BackedCls) {\n return asUint64Cls(val.uint64).toBytes().asUint8Array()\n }\n if (Array.isArray(val) || typeof val === 'object') {\n const arc4Encoded = getArc4Encoded(val, sourceTypeInfoString)\n return (arc4Encoded as _ARC4Encodedint8Array).uint8ArrayValue ?? asUint8Array(arc4Encoded.bytes)\n }\n throw new InternalError(`Invalid type for bytes: ${nameOfType(val)}`)\n}\n\n/** @internal */\nexport const getEncoder = <T>(typeInfo: TypeInfo): fromBytes<T> => {\n const mutableTupleFromBytes = (value: StubBytesCompat | Uint8Array, typeInfo: string | TypeInfo, prefix: 'none' | 'log' = 'none') => {\n const tuple = Tuple.fromBytes(value, typeInfo, prefix)\n return asNumber(tuple.bytes.length) ? tuple.native : ([] as unknown as typeof tuple.native)\n }\n const readonlyMutableTupleFromBytes = (\n value: StubBytesCompat | Uint8Array,\n typeInfo: string | TypeInfo,\n prefix: 'none' | 'log' = 'none',\n ) => {\n const result = mutableTupleFromBytes(value, typeInfo, prefix)\n return result as Readonly<typeof result>\n }\n const mutableObjectFromBytes = (value: StubBytesCompat | Uint8Array, typeInfo: string | TypeInfo, prefix: 'none' | 'log' = 'none') => {\n const struct = Struct.fromBytes(value, typeInfo, prefix)\n return asNumber(struct.bytes.length) ? struct.native : ({} as unknown as typeof struct.native)\n }\n const readonlyObjectFromBytes = (value: StubBytesCompat | Uint8Array, typeInfo: string | TypeInfo, prefix: 'none' | 'log' = 'none') => {\n const result = mutableObjectFromBytes(value, typeInfo, prefix)\n return result as Readonly<typeof result>\n }\n const arrayFromBytes = (value: StubBytesCompat | Uint8Array, typeInfo: string | TypeInfo, prefix: 'none' | 'log' = 'none') => {\n const dynamicArray = DynamicArray.fromBytes(value, typeInfo, prefix)\n return asNumber(dynamicArray.bytes.length) ? dynamicArray.native : ([] as unknown as typeof dynamicArray.native)\n }\n const readonlyArrayFromBytes = (value: StubBytesCompat | Uint8Array, typeInfo: string | TypeInfo, prefix: 'none' | 'log' = 'none') => {\n const result = arrayFromBytes(value, typeInfo, prefix)\n return result as Readonly<typeof result>\n }\n const referenceArrayFromBytes = (value: StubBytesCompat | Uint8Array, typeInfo: string | TypeInfo, prefix: 'none' | 'log' = 'none') => {\n const dynamicArray = DynamicArray.fromBytes(value, typeInfo, prefix)\n return new ReferenceArray(\n typeInfo,\n ...(asNumber(dynamicArray.bytes.length) ? dynamicArray.native : ([] as unknown as typeof dynamicArray.native)),\n )\n }\n const fixedArrayFromBytes = (value: StubBytesCompat | Uint8Array, typeInfo: string | TypeInfo, prefix: 'none' | 'log' = 'none') => {\n const staticArray = StaticArray.fromBytes(value, typeInfo, prefix)\n return new FixedArray(\n typeInfo,\n ...(asNumber(staticArray.uint8ArrayValue.length) ? staticArray.native : ([] as unknown as typeof staticArray.native)),\n )\n }\n const encoders: Record<string, fromBytes<DeliberateAny>> = {\n account: AccountCls.fromBytes,\n application: ApplicationCls.fromBytes,\n asset: AssetCls.fromBytes,\n boolean: booleanFromBytes,\n biguint: bigUintFromBytes,\n 'bytes(<.*>)?': bytesFromBytes,\n string: stringFromBytes,\n uint64: uint64FromBytes,\n OnCompleteAction: onCompletionFromBytes,\n TransactionType: transactionTypeFromBytes,\n Address: Address.fromBytes,\n Bool: Bool.fromBytes,\n Byte: Byte.fromBytes,\n Str: Str.fromBytes,\n 'Uint<.*>': Uint.fromBytes,\n 'UFixed<.*>': UFixed.fromBytes,\n 'StaticArray<.*>': StaticArray.fromBytes,\n 'DynamicArray<.*>': DynamicArray.fromBytes,\n 'Tuple(<.*>)?': Tuple.fromBytes,\n 'ReadonlyTuple(<.*>)?': readonlyMutableTupleFromBytes,\n 'MutableTuple(<.*>)?': mutableTupleFromBytes,\n 'Struct(<.*>)?': Struct.fromBytes,\n DynamicBytes: DynamicBytes.fromBytes,\n 'StaticBytes<.*>': StaticBytes.fromBytes,\n object: Struct.fromBytes,\n 'Object<.*>': mutableObjectFromBytes,\n 'ReadonlyObject<.*>': readonlyObjectFromBytes,\n 'ReferenceArray<.*>': referenceArrayFromBytes,\n 'FixedArray<.*>': fixedArrayFromBytes,\n 'Array<.*>': arrayFromBytes,\n 'ReadonlyArray<.*>': readonlyArrayFromBytes,\n }\n\n const encoder = Object.entries(encoders).find(([k, _]) => new RegExp(`^${k}$`, 'i').test(typeInfo.name))?.[1]\n if (!encoder) {\n throw new Error(`No encoder found for type ${typeInfo.name}`)\n }\n return encoder as fromBytes<T>\n}\n","import type { bytes, gtxn, MimcConfigurations, op, VrfVerify } from '@algorandfoundation/algorand-typescript'\nimport { Ecdsa, OnCompleteAction } from '@algorandfoundation/algorand-typescript'\nimport elliptic from 'elliptic'\nimport js_sha256 from 'js-sha256'\nimport js_sha3 from 'js-sha3'\nimport js_sha512 from 'js-sha512'\nimport nacl from 'tweetnacl'\nimport { LOGIC_DATA_PREFIX, PROGRAM_TAG } from '../constants'\nimport { lazyContext } from '../context-helpers/internal-context'\nimport { InternalError, NotImplementedError } from '../errors'\nimport { asBytes, asBytesCls, asUint8Array, concatUint8Arrays } from '../util'\nimport type { StubBytesCompat, StubUint64Compat } from './primitives'\nimport { Bytes, BytesCls, Uint64Cls } from './primitives'\n\n/** @internal */\nexport const sha256 = (a: StubBytesCompat): bytes<32> => {\n const bytesA = BytesCls.fromCompat(a)\n const hashArray = js_sha256.sha256.create().update(bytesA.asUint8Array()).digest()\n const hashBytes = Bytes(new Uint8Array(hashArray), { length: 32 })\n return hashBytes\n}\n\n/** @internal */\nexport const sha3_256 = (a: StubBytesCompat): bytes<32> => {\n const bytesA = BytesCls.fromCompat(a)\n const hashArray = js_sha3.sha3_256.create().update(bytesA.asUint8Array()).digest()\n const hashBytes = Bytes(new Uint8Array(hashArray), { length: 32 })\n return hashBytes\n}\n\n/** @internal */\nexport const keccak256 = (a: StubBytesCompat): bytes<32> => {\n const bytesA = BytesCls.fromCompat(a)\n const hashArray = js_sha3.keccak256.create().update(bytesA.asUint8Array()).digest()\n const hashBytes = Bytes(new Uint8Array(hashArray), { length: 32 })\n return hashBytes\n}\n\n/** @internal */\nexport const sha512_256 = (a: StubBytesCompat): bytes<32> => {\n const bytesA = BytesCls.fromCompat(a)\n const hashArray = js_sha512.sha512_256.create().update(bytesA.asUint8Array()).digest()\n const hashBytes = Bytes(new Uint8Array(hashArray), { length: 32 })\n return hashBytes\n}\n\n/** @internal */\nexport const ed25519verifyBare = (a: StubBytesCompat, b: StubBytesCompat, c: StubBytesCompat): boolean => {\n const bytesA = BytesCls.fromCompat(a)\n const bytesB = BytesCls.fromCompat(b)\n const bytesC = BytesCls.fromCompat(c)\n return nacl.sign.detached.verify(bytesA.asUint8Array(), bytesB.asUint8Array(), bytesC.asUint8Array())\n}\n\n/** @internal */\nexport const ed25519verify = (a: StubBytesCompat, b: StubBytesCompat, c: StubBytesCompat): boolean => {\n const txn = lazyContext.activeGroup.activeTransaction as gtxn.ApplicationCallTxn\n const programBytes = asBytesCls(txn.onCompletion == OnCompleteAction.ClearState ? txn.clearStateProgram : txn.approvalProgram)\n\n const logicSig = concatUint8Arrays(asUint8Array(PROGRAM_TAG), programBytes.asUint8Array())\n const logicSigAddress = js_sha512.sha512_256.array(logicSig)\n\n const addressBytes = Bytes(logicSigAddress)\n const data = LOGIC_DATA_PREFIX.concat(addressBytes).concat(asBytes(a))\n return ed25519verifyBare(data, b, c)\n}\n\n/** @internal */\nexport const ecdsaVerify = (\n v: Ecdsa,\n a: StubBytesCompat,\n b: StubBytesCompat,\n c: StubBytesCompat,\n d: StubBytesCompat,\n e: StubBytesCompat,\n): boolean => {\n const dataBytes = BytesCls.fromCompat(a)\n const sigRBytes = BytesCls.fromCompat(b)\n const sigSBytes = BytesCls.fromCompat(c)\n const pubkeyXBytes = BytesCls.fromCompat(d)\n const pubkeyYBytes = BytesCls.fromCompat(e)\n\n const publicKey = BytesCls.fromCompat(new Uint8Array([0x04]))\n .concat(pubkeyXBytes)\n .concat(pubkeyYBytes)\n\n const ecdsa = new elliptic.ec(curveMap[v])\n const keyPair = ecdsa.keyFromPublic(publicKey.asUint8Array())\n return keyPair.verify(dataBytes.asUint8Array(), { r: sigRBytes.asUint8Array(), s: sigSBytes.asUint8Array() })\n}\n\n/** @internal */\nexport const ecdsaPkRecover = (\n v: Ecdsa,\n a: StubBytesCompat,\n b: StubUint64Compat,\n c: StubBytesCompat,\n d: StubBytesCompat,\n): readonly [bytes<32>, bytes<32>] => {\n if (v !== Ecdsa.Secp256k1) {\n throw new InternalError(`Unsupported ECDSA curve: ${v}`)\n }\n const dataBytes = BytesCls.fromCompat(a)\n const rBytes = BytesCls.fromCompat(c)\n const sBytes = BytesCls.fromCompat(d)\n const recoveryId = Uint64Cls.fromCompat(b)\n\n const ecdsa = new elliptic.ec(curveMap[v])\n const pubKey = ecdsa.recoverPubKey(\n dataBytes.asUint8Array(),\n { r: rBytes.asUint8Array(), s: sBytes.asUint8Array() },\n recoveryId.asNumber(),\n )\n\n const x = pubKey.getX().toArray('be')\n const y = pubKey.getY().toArray('be')\n return [Bytes(x, { length: 32 }), Bytes(y, { length: 32 })]\n}\n\n/** @internal */\nexport const ecdsaPkDecompress = (v: Ecdsa, a: StubBytesCompat): readonly [bytes<32>, bytes<32>] => {\n const bytesA = BytesCls.fromCompat(a)\n\n const ecdsa = new elliptic.ec(curveMap[v])\n const keyPair = ecdsa.keyFromPublic(bytesA.asUint8Array())\n const pubKey = keyPair.getPublic()\n\n const x = pubKey.getX().toArray('be')\n const y = pubKey.getY().toArray('be')\n return [Bytes(x, { length: 32 }), Bytes(y, { length: 32 })]\n}\n\n/** @internal */\nexport const vrfVerify = (_s: VrfVerify, _a: StubBytesCompat, _b: StubBytesCompat, _c: StubBytesCompat): readonly [bytes<64>, boolean] => {\n throw new NotImplementedError('vrfVerify')\n}\n\n/** @internal */\nexport const EllipticCurve = new Proxy({} as typeof op.EllipticCurve, {\n get: (_target, prop) => {\n throw new NotImplementedError(`EllipticCurve.${prop.toString()}`)\n },\n})\n\n/** @internal */\nexport const mimc = (_c: MimcConfigurations, _a: StubBytesCompat): bytes => {\n throw new NotImplementedError('mimc')\n}\n\n/** @internal */\nexport const falconVerify = (_a: StubBytesCompat, _b: StubBytesCompat, _c: StubBytesCompat): boolean => {\n throw new NotImplementedError('falconVerify')\n}\n\nconst curveMap = {\n [Ecdsa.Secp256k1]: 'secp256k1',\n [Ecdsa.Secp256r1]: 'p256',\n}\n","import type {\n Account as AccountType,\n Application as ApplicationType,\n bytes,\n gtxn,\n op,\n uint64,\n} from '@algorandfoundation/algorand-typescript'\nimport { lazyContext } from '../context-helpers/internal-context'\nimport { asMaybeUint64Cls, asUint64 } from '../util'\nimport { Bytes, Uint64, type StubUint64Compat } from './primitives'\nimport { Account } from './reference'\n\nconst resolveAppIndex = (appIdOrIndex: StubUint64Compat): uint64 => {\n const input = asUint64(appIdOrIndex)\n if (input >= 1001) {\n return input\n }\n const txn = lazyContext.activeGroup.activeTransaction as gtxn.ApplicationCallTxn\n return txn.apps(input).id\n}\n\n/** @internal */\nexport const getApp = (app: ApplicationType | StubUint64Compat): ApplicationType | undefined => {\n try {\n const appId = asMaybeUint64Cls(app)\n if (appId !== undefined) {\n return lazyContext.ledger.getApplication(resolveAppIndex(appId))\n }\n return app as ApplicationType\n } catch {\n return undefined\n }\n}\n\n/** @internal */\nexport const AppParams: typeof op.AppParams = {\n appApprovalProgram(a: ApplicationType | StubUint64Compat): readonly [bytes, boolean] {\n const app = getApp(a)\n return app === undefined ? [Bytes(), false] : [app.approvalProgram, true]\n },\n appClearStateProgram(a: ApplicationType | StubUint64Compat): readonly [bytes, boolean] {\n const app = getApp(a)\n return app === undefined ? [Bytes(), false] : [app.clearStateProgram, true]\n },\n appGlobalNumUint(a: ApplicationType | StubUint64Compat): readonly [uint64, boolean] {\n const app = getApp(a)\n return app === undefined ? [Uint64(0), false] : [app.globalNumUint, true]\n },\n appGlobalNumByteSlice(a: ApplicationType | StubUint64Compat): readonly [uint64, boolean] {\n const app = getApp(a)\n return app === undefined ? [Uint64(0), false] : [app.globalNumBytes, true]\n },\n appLocalNumUint(a: ApplicationType | StubUint64Compat): readonly [uint64, boolean] {\n const app = getApp(a)\n return app === undefined ? [Uint64(0), false] : [app.localNumUint, true]\n },\n appLocalNumByteSlice(a: ApplicationType | StubUint64Compat): readonly [uint64, boolean] {\n const app = getApp(a)\n return app === undefined ? [Uint64(0), false] : [app.localNumBytes, true]\n },\n appExtraProgramPages(a: ApplicationType | StubUint64Compat): readonly [uint64, boolean] {\n const app = getApp(a)\n return app === undefined ? [Uint64(0), false] : [app.extraProgramPages, true]\n },\n appCreator(a: ApplicationType | StubUint64Compat): readonly [AccountType, boolean] {\n const app = getApp(a)\n return app === undefined ? [Account(), false] : [app.creator, true]\n },\n appAddress(a: ApplicationType | StubUint64Compat): readonly [AccountType, boolean] {\n const app = getApp(a)\n return app === undefined ? [Account(), false] : [app.address, true]\n },\n appVersion: function (a: ApplicationType | uint64): readonly [uint64, boolean] {\n const app = getApp(a)\n return app === undefined ? [Uint64(0), false] : [app.version, true]\n },\n}\n","import type { Account as AccountType, Asset as AssetType, bytes, gtxn, op, uint64 } from '@algorandfoundation/algorand-typescript'\nimport { lazyContext } from '../context-helpers/internal-context'\nimport { asMaybeUint64Cls, asUint64 } from '../util'\nimport { Bytes, Uint64, type StubUint64Compat } from './primitives'\nimport { Account } from './reference'\n\nconst resolveAssetIndex = (assetIdOrIndex: StubUint64Compat): uint64 => {\n const input = asUint64(assetIdOrIndex)\n if (input >= 1001) {\n return input\n }\n const txn = lazyContext.activeGroup.activeTransaction as gtxn.ApplicationCallTxn\n return txn.assets(input).id\n}\n\n/** @internal */\nexport const getAsset = (asset: AssetType | StubUint64Compat): AssetType | undefined => {\n try {\n const assetId = asMaybeUint64Cls(asset)\n if (assetId !== undefined) {\n return lazyContext.ledger.getAsset(resolveAssetIndex(assetId))\n }\n return asset as AssetType\n } catch {\n return undefined\n }\n}\n\n/** @internal */\nexport const AssetParams: typeof op.AssetParams = {\n assetTotal(a: AssetType | StubUint64Compat): readonly [uint64, boolean] {\n const asset = getAsset(a)\n return asset === undefined ? [Uint64(0), false] : [asset.total, true]\n },\n assetDecimals(a: AssetType | StubUint64Compat): readonly [uint64, boolean] {\n const asset = getAsset(a)\n return asset === undefined ? [Uint64(0), false] : [asset.decimals, true]\n },\n assetDefaultFrozen(a: AssetType | StubUint64Compat): readonly [boolean, boolean] {\n const asset = getAsset(a)\n return asset === undefined ? [false, false] : [asset.defaultFrozen, true]\n },\n assetUnitName(a: AssetType | StubUint64Compat): readonly [bytes, boolean] {\n const asset = getAsset(a)\n return asset === undefined ? [Bytes(), false] : [asset.unitName, true]\n },\n assetName(a: AssetType | StubUint64Compat): readonly [bytes, boolean] {\n const asset = getAsset(a)\n return asset === undefined ? [Bytes(), false] : [asset.name, true]\n },\n assetUrl(a: AssetType | StubUint64Compat): readonly [bytes, boolean] {\n const asset = getAsset(a)\n return asset === undefined ? [Bytes(), false] : [asset.url, true]\n },\n assetMetadataHash(a: AssetType | StubUint64Compat): readonly [bytes<32>, boolean] {\n const asset = getAsset(a)\n return asset === undefined ? [Bytes() as bytes<32>, false] : [asset.metadataHash, true]\n },\n assetManager(a: AssetType | StubUint64Compat): readonly [AccountType, boolean] {\n const asset = getAsset(a)\n return asset === undefined ? [Account(), false] : [asset.manager, true]\n },\n assetReserve(a: AssetType | StubUint64Compat): readonly [AccountType, boolean] {\n const asset = getAsset(a)\n return asset === undefined ? [Account(), false] : [asset.reserve, true]\n },\n assetFreeze(a: AssetType | StubUint64Compat): readonly [AccountType, boolean] {\n const asset = getAsset(a)\n return asset === undefined ? [Account(), false] : [asset.freeze, true]\n },\n assetClawback(a: AssetType | StubUint64Compat): readonly [AccountType, boolean] {\n const asset = getAsset(a)\n return asset === undefined ? [Account(), false] : [asset.clawback, true]\n },\n assetCreator(a: AssetType | StubUint64Compat): readonly [AccountType, boolean] {\n const asset = getAsset(a)\n return asset === undefined ? [Account(), false] : [asset.creator, true]\n },\n}\n"],"names":["_Uint","_UFixed","_Byte","_Str","_Bool","_StaticArray","_Address","_DynamicArray","_Tuple","_Struct","_DynamicBytes","_StaticBytes","_ReferenceArray","_FixedArray","_ARC4Encoded"],"mappings":";;;;;;;;;;;;AAIA;AACO,MAAM,iBAAiB,GAAG,OAAc;IAC7C,GAAG,CAAC,MAAmC,EAAE,IAAiB,EAAA;AACxD,QAAA,MAAM,GAAG,GAAG,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAC,QAAQ,EAAE,EAAE,EAAE,CAAC,GAAG,GAAG;AACtD,QAAA,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE;YACf,IAAI,GAAG,IAAI,CAAC,IAAI,GAAG,GAAG,MAAM,CAAC,KAAK,CAAC,MAAM;AAAE,gBAAA,OAAO,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC;AACnE,YAAA,MAAM,IAAI,QAAQ,CAAC,qBAAqB,CAAC;QAC3C;AAAO,aAAA,IAAI,IAAI,KAAK,MAAM,CAAC,QAAQ,EAAE;AACnC,YAAA,OAAO,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC;QACzD;AAAO,aAAA,IAAI,IAAI,KAAK,SAAS,EAAE;AAC7B,YAAA,OAAO,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC;QAChD;AAAO,aAAA,IAAI,IAAI,KAAK,MAAM,EAAE;AAC1B,YAAA,OAAO,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC;QAC7C;AAAO,aAAA,IAAI,I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,SAAS,GAAG,CAAC,OAAO,EAAE,EAAE,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC;IACzE,CAAC;;;;;"}
1
+ {"version":3,"file":"asset-params-BwXtTjOo.js","sources":["../src/impl/encoded-types/array-proxy.ts","../src/impl/encoded-types/encoded-types.ts","../src/impl/crypto.ts","../src/impl/app-params.ts","../src/impl/asset-params.ts"],"sourcesContent":["import type { Uint64Compat } from '@algorandfoundation/algorand-typescript'\nimport { AvmError } from '../../errors'\nimport { arrayUtil } from '../primitives'\n\n/** @internal */\nexport const arrayProxyHandler = <TItem>() => ({\n get(target: { items: readonly TItem[] }, prop: PropertyKey) {\n const idx = prop ? parseInt(prop.toString(), 10) : NaN\n if (!isNaN(idx)) {\n if (idx >= 0 && idx < target.items.length) return target.items[idx]\n throw new AvmError('Index out of bounds')\n } else if (prop === Symbol.iterator) {\n return target.items[Symbol.iterator].bind(target.items)\n } else if (prop === 'entries') {\n return target.items.entries.bind(target.items)\n } else if (prop === 'keys') {\n return target.items.keys.bind(target.items)\n } else if (prop === 'at') {\n return (index: Uint64Compat): TItem => {\n return arrayUtil.arrayAt(target.items, index)\n }\n }\n return Reflect.get(target, prop)\n },\n set(target: { items: TItem[]; setItem: (index: number, value: TItem) => void }, prop: PropertyKey, value: TItem) {\n const idx = prop ? parseInt(prop.toString(), 10) : NaN\n if (!isNaN(idx)) {\n if (idx >= 0 && idx < target.items.length) {\n target.setItem(idx, value)\n return true\n }\n throw new AvmError('Index out of bounds')\n }\n\n return Reflect.set(target, prop, value)\n },\n})\n","import type { Account as AccountType, bytes, NTuple, StringCompat, uint64, Uint64Compat } from '@algorandfoundation/algorand-typescript'\nimport { FixedArray as _FixedArray, ReferenceArray as _ReferenceArray } from '@algorandfoundation/algorand-typescript'\nimport type { BitSize } from '@algorandfoundation/algorand-typescript/arc4'\nimport {\n Address as _Address,\n ARC4Encoded as _ARC4Encoded,\n Bool as _Bool,\n Byte as _Byte,\n DynamicArray as _DynamicArray,\n DynamicBytes as _DynamicBytes,\n StaticArray as _StaticArray,\n StaticBytes as _StaticBytes,\n Str as _Str,\n Struct as _Struct,\n Tuple as _Tuple,\n UFixed as _UFixed,\n Uint as _Uint,\n} from '@algorandfoundation/algorand-typescript/arc4'\nimport { encodingUtil } from '@algorandfoundation/puya-ts'\nimport assert from 'assert'\nimport {\n ABI_RETURN_VALUE_LOG_PREFIX,\n ALGORAND_ADDRESS_BYTE_LENGTH,\n ALGORAND_CHECKSUM_BYTE_LENGTH,\n MAX_UINT64,\n UINT64_SIZE,\n} from '../../constants'\nimport { AvmError, avmInvariant, CodeError, InternalError } from '../../errors'\nimport { nameOfType, type DeliberateAny } from '../../typescript-helpers'\nimport {\n asBigInt,\n asBigUint,\n asBigUintCls,\n asBytes,\n asBytesCls,\n asMaybeBigUintCls,\n asMaybeBytesCls,\n asMaybeUint64Cls,\n asNumber,\n asUint64,\n asUint64Cls,\n asUint8Array,\n concatUint8Arrays,\n uint8ArrayToNumber,\n} from '../../util'\nimport { BytesBackedCls, Uint64BackedCls } from '../base'\nimport type { StubBytesCompat } from '../primitives'\nimport { BigUintCls, Bytes, BytesCls, getUint8Array, isBytes, Uint64Cls } from '../primitives'\nimport { Account, AccountCls, ApplicationCls, AssetCls } from '../reference'\nimport { arrayProxyHandler } from './array-proxy'\nimport { ABI_LENGTH_SIZE, FALSE_BIGINT_VALUE, IS_INITIALISING_FROM_BYTES_SYMBOL, TRUE_BIGINT_VALUE } from './constants'\nimport {\n areAllARC4Encoded,\n bigUintFromBytes,\n booleanFromBytes,\n bytesFromBytes,\n checkItemTypeName,\n compressMultipleBool,\n encodeLength,\n findBool,\n findBoolTypes,\n getNativeValue,\n holdsDynamicLengthContent,\n maxBigIntValue,\n maxBytesLength,\n onCompletionFromBytes,\n readLength,\n regExpNxM,\n stringFromBytes,\n transactionTypeFromBytes,\n trimTrailingDecimalZeros,\n uint64FromBytes,\n validBitSizes,\n} from './helpers'\nimport type {\n CompatForArc4Int,\n DynamicArrayGenericArgs,\n fromBytes,\n StaticArrayGenericArgs,\n StructConstraint,\n TypeInfo,\n uFixedGenericArgs,\n} from './types'\nimport { getMaxLengthOfStaticContentType } from './utils'\n\ninterface _ARC4Encodedint8Array extends _ARC4Encoded {\n get uint8ArrayValue(): Uint8Array\n}\n/** @internal */\nexport class Uint<N extends BitSize> extends _Uint<N> implements _ARC4Encodedint8Array {\n private _value: Uint8Array\n private bitSize: N\n typeInfo: TypeInfo\n\n constructor(typeInfo: TypeInfo | string, v?: CompatForArc4Int<N>) {\n super()\n this.typeInfo = typeof typeInfo === 'string' ? JSON.parse(typeInfo) : typeInfo\n this.bitSize = Uint.getMaxBitsLength(this.typeInfo) as N\n\n assert(validBitSizes.includes(this.bitSize), `Invalid bit size ${this.bitSize}`)\n\n const bigIntValue = asBigUintCls(v ?? 0n).valueOf()\n const maxValue = maxBigIntValue(this.bitSize)\n assert(bigIntValue <= maxValue, `expected value <= ${maxValue}, got: ${bigIntValue}`)\n\n this._value = encodingUtil.bigIntToUint8Array(bigIntValue, maxBytesLength(this.bitSize))\n }\n\n get native() {\n const bigIntValue = encodingUtil.uint8ArrayToBigInt(this._value)\n return this.bitSize <= UINT64_SIZE ? asUint64(bigIntValue) : asBigUint(bigIntValue)\n }\n\n asUint64() {\n const bigIntValue = encodingUtil.uint8ArrayToBigInt(this._value)\n if (bigIntValue > MAX_UINT64) {\n throw new CodeError('value too large to fit in uint64')\n }\n return asUint64(bigIntValue)\n }\n\n asBigUint() {\n const bigIntValue = encodingUtil.uint8ArrayToBigInt(this._value)\n return asBigUint(bigIntValue)\n }\n\n get uint8ArrayValue(): Uint8Array {\n return this._value\n }\n\n get bytes(): bytes {\n return Bytes(this._value)\n }\n\n equals(other: this): boolean {\n if (!(other instanceof Uint) || JSON.stringify(this.typeInfo) !== JSON.stringify(other.typeInfo)) {\n throw new CodeError(`Expected expression of type ${this.typeInfo.name}, got ${other.typeInfo.name}`)\n }\n return this.bytes.equals(other.bytes)\n }\n\n static fromBytes(value: StubBytesCompat | Uint8Array, typeInfo: string | TypeInfo, prefix: 'none' | 'log' = 'none'): Uint<BitSize> {\n let bytesValue = asBytesCls(value)\n if (prefix === 'log') {\n assert(bytesValue.slice(0, 4).equals(ABI_RETURN_VALUE_LOG_PREFIX), 'ABI return prefix not found')\n bytesValue = bytesValue.slice(4)\n }\n const result = new Uint<BitSize>(typeInfo)\n result._value = asUint8Array(bytesValue)\n return result\n }\n\n static getMaxBitsLength(typeInfo: TypeInfo): BitSize {\n return parseInt((typeInfo.genericArgs as TypeInfo[])![0].name, 10) as BitSize\n }\n}\n\n/** @internal */\nexport class UFixed<N extends BitSize, M extends number> extends _UFixed<N, M> implements _ARC4Encodedint8Array {\n private _value: Uint8Array\n private bitSize: N\n private precision: M\n typeInfo: TypeInfo\n\n constructor(typeInfo: TypeInfo | string, v?: `${number}.${number}`) {\n super(v)\n this.typeInfo = typeof typeInfo === 'string' ? JSON.parse(typeInfo) : typeInfo\n const genericArgs = this.typeInfo.genericArgs as uFixedGenericArgs\n this.bitSize = UFixed.getMaxBitsLength(this.typeInfo) as N\n this.precision = parseInt(genericArgs.m.name, 10) as M\n\n const trimmedValue = trimTrailingDecimalZeros(v ?? '0.0')\n assert(regExpNxM(this.precision).test(trimmedValue), `expected positive decimal literal with max of ${this.precision} decimal places`)\n\n const bigIntValue = BigInt(trimmedValue.replace('.', ''))\n const maxValue = maxBigIntValue(this.bitSize)\n assert(bigIntValue <= maxValue, `expected value <= ${maxValue}, got: ${bigIntValue}`)\n\n this._value = encodingUtil.bigIntToUint8Array(bigIntValue, maxBytesLength(this.bitSize))\n }\n\n get native() {\n const bigIntValue = encodingUtil.uint8ArrayToBigInt(this._value)\n return this.bitSize <= UINT64_SIZE ? asUint64(bigIntValue) : asBigUint(bigIntValue)\n }\n\n get uint8ArrayValue(): Uint8Array {\n return this._value\n }\n\n get bytes(): bytes {\n return Bytes(this._value)\n }\n\n equals(other: this): boolean {\n if (!(other instanceof UFixed) || JSON.stringify(this.typeInfo) !== JSON.stringify(other.typeInfo)) {\n throw new CodeError(`Expected expression of type ${this.typeInfo.name}, got ${other.typeInfo.name}`)\n }\n return this.bytes.equals(other.bytes)\n }\n\n static fromBytes(\n value: StubBytesCompat | Uint8Array,\n typeInfo: string | TypeInfo,\n prefix: 'none' | 'log' = 'none',\n ): _UFixed<BitSize, number> {\n let bytesValue = asBytesCls(value)\n if (prefix === 'log') {\n assert(bytesValue.slice(0, 4).equals(ABI_RETURN_VALUE_LOG_PREFIX), 'ABI return prefix not found')\n bytesValue = bytesValue.slice(4)\n }\n const result = new UFixed<BitSize, number>(typeInfo, '0.0')\n result._value = asUint8Array(bytesValue)\n return result\n }\n\n static getMaxBitsLength(typeInfo: TypeInfo): BitSize {\n const genericArgs = typeInfo.genericArgs as uFixedGenericArgs\n return parseInt(genericArgs.n.name, 10) as BitSize\n }\n}\n\n/** @internal */\nexport class Byte extends _Byte implements _ARC4Encodedint8Array {\n typeInfo: TypeInfo\n private _value: Uint<8>\n\n constructor(typeInfo: TypeInfo | string, v?: CompatForArc4Int<8>) {\n super(v)\n this.typeInfo = typeof typeInfo === 'string' ? JSON.parse(typeInfo) : typeInfo\n this._value = new Uint<8>(typeInfo, v)\n }\n\n asUint64() {\n return this._value.asUint64()\n }\n\n asBigUint() {\n return this._value.asBigUint()\n }\n\n get uint8ArrayValue(): Uint8Array {\n return this._value.uint8ArrayValue\n }\n\n get bytes(): bytes {\n return this._value.bytes\n }\n\n equals(other: this): boolean {\n if (!(other instanceof Byte) || JSON.stringify(this._value.typeInfo) !== JSON.stringify(other._value.typeInfo)) {\n throw new CodeError(`Expected expression of type ${this._value.typeInfo.name}, got ${other._value.typeInfo.name}`)\n }\n return this.bytes.equals(other.bytes)\n }\n\n static fromBytes(value: StubBytesCompat | Uint8Array, typeInfo: string | TypeInfo, prefix: 'none' | 'log' = 'none'): Byte {\n const uintNValue = Uint.fromBytes(value, typeInfo, prefix) as Uint<8>\n const result = new Byte(typeInfo)\n result._value = uintNValue\n return result\n }\n\n static getMaxBitsLength(typeInfo: TypeInfo): BitSize {\n return Uint.getMaxBitsLength(typeInfo)\n }\n}\n\n/** @internal */\nexport class Str extends _Str implements _ARC4Encodedint8Array {\n typeInfo: TypeInfo\n private _value: Uint8Array\n\n constructor(typeInfo: TypeInfo | string, s?: StringCompat) {\n super()\n const bytesValue = asBytesCls(s ?? '')\n const bytesLength = encodeLength(bytesValue.length.asNumber())\n this.typeInfo = typeof typeInfo === 'string' ? JSON.parse(typeInfo) : typeInfo\n this._value = asUint8Array(bytesLength.concat(bytesValue))\n }\n get native(): string {\n return encodingUtil.uint8ArrayToUtf8(this._value.slice(ABI_LENGTH_SIZE))\n }\n\n get uint8ArrayValue(): Uint8Array {\n return this._value\n }\n\n get bytes(): bytes {\n return Bytes(this._value)\n }\n\n equals(other: this): boolean {\n if (!(other instanceof Str)) {\n throw new CodeError(`Expected expression of type Str, got ${(other as object).constructor.name}`)\n }\n return this.bytes.equals(other.bytes)\n }\n\n static fromBytes(value: StubBytesCompat | Uint8Array, typeInfo: string | TypeInfo, prefix: 'none' | 'log' = 'none'): Str {\n let bytesValue = asBytesCls(value)\n if (prefix === 'log') {\n assert(bytesValue.slice(0, 4).equals(ABI_RETURN_VALUE_LOG_PREFIX), 'ABI return prefix not found')\n bytesValue = bytesValue.slice(4)\n }\n const result = new Str(typeInfo)\n result._value = asUint8Array(bytesValue)\n return result\n }\n}\n\n/** @internal */\nexport class Bool extends _Bool implements _ARC4Encodedint8Array {\n private _value: Uint8Array\n typeInfo: TypeInfo\n\n constructor(typeInfo: TypeInfo | string, v?: boolean) {\n super(v)\n this.typeInfo = typeof typeInfo === 'string' ? JSON.parse(typeInfo) : typeInfo\n this._value = encodingUtil.bigIntToUint8Array(v ? TRUE_BIGINT_VALUE : FALSE_BIGINT_VALUE, 1)\n }\n\n get native(): boolean {\n return encodingUtil.uint8ArrayToBigInt(this._value) === TRUE_BIGINT_VALUE\n }\n\n equals(other: this): boolean {\n if (!(other instanceof Bool)) {\n throw new CodeError(`Expected expression of type Bool, got ${(other as object).constructor.name}`)\n }\n return this.bytes.equals(other.bytes)\n }\n\n get uint8ArrayValue(): Uint8Array {\n return this._value\n }\n\n get bytes(): bytes {\n return Bytes(this._value?.length ? this._value : new Uint8Array([0]))\n }\n\n static fromBytes(value: StubBytesCompat | Uint8Array, typeInfo: string | TypeInfo, prefix: 'none' | 'log' = 'none'): Bool {\n let bytesValue = asBytesCls(value)\n if (prefix === 'log') {\n assert(bytesValue.slice(0, 4).equals(ABI_RETURN_VALUE_LOG_PREFIX), 'ABI return prefix not found')\n bytesValue = bytesValue.slice(4)\n }\n const result = new Bool(typeInfo)\n result._value = asUint8Array(bytesValue)\n return result\n }\n}\n\n/** @internal */\nexport class StaticArray<TItem extends _ARC4Encoded, TLength extends number>\n extends _StaticArray<TItem, TLength>\n implements _ARC4Encodedint8Array\n{\n private _value?: NTuple<TItem, TLength>\n private _uint8ArrayValue?: Uint8Array\n private size: number\n typeInfo: TypeInfo\n genericArgs: StaticArrayGenericArgs\n\n constructor(typeInfo: TypeInfo | string, ...items: TItem[] & { length: TLength })\n constructor(typeInfo: TypeInfo | string, ...items: TItem[])\n constructor(typeInfo: TypeInfo | string, ...items: TItem[] & { length: TLength }) {\n // if first item is the symbol, we are initialising from bytes\n // so we don't need to pass the items to the super constructor\n const isInitialisingFromBytes = items.length === 1 && (items[0] as DeliberateAny) === IS_INITIALISING_FROM_BYTES_SYMBOL\n super()\n\n this.typeInfo = typeof typeInfo === 'string' ? JSON.parse(typeInfo) : typeInfo\n this.genericArgs = this.typeInfo.genericArgs as StaticArrayGenericArgs\n this.size = parseInt(this.genericArgs.size.name, 10)\n\n // if we are not initialising from bytes, we need to check and set the items\n if (!isInitialisingFromBytes) {\n if (items.length && items.length !== this.size) {\n throw new CodeError(`expected ${this.size} items, not ${items.length}`)\n }\n\n assert(areAllARC4Encoded(items), 'expected ARC4 type')\n\n items.forEach((item) => {\n checkItemTypeName(this.genericArgs.elementType, item)\n })\n\n if (items.length) {\n this._value = items as NTuple<TItem, TLength>\n } else {\n this._uint8ArrayValue = new Uint8Array(getMaxLengthOfStaticContentType(this.typeInfo))\n }\n }\n return new Proxy(this, arrayProxyHandler<TItem>()) as StaticArray<TItem, TLength>\n }\n\n get uint8ArrayValue(): Uint8Array {\n return this._uint8ArrayValue ?? encode(this.items, true)\n }\n\n get bytes(): bytes {\n return Bytes(this._uint8ArrayValue ?? encode(this.items, true))\n }\n\n equals(other: this): boolean {\n if (!(other instanceof StaticArray) || JSON.stringify(this.typeInfo) !== JSON.stringify(other.typeInfo)) {\n throw new CodeError(`Expected expression of type ${this.typeInfo.name}, got ${other.typeInfo.name}`)\n }\n return this.bytes.equals(other.bytes)\n }\n\n get length(): uint64 {\n return this.size\n }\n\n get items(): NTuple<TItem, TLength> {\n if (this._uint8ArrayValue) {\n const childTypes = Array(this.size).fill(this.genericArgs.elementType)\n this._value = decode(this._uint8ArrayValue, childTypes, true) as NTuple<TItem, TLength>\n this._uint8ArrayValue = undefined\n return this._value\n } else if (this._value) {\n this._uint8ArrayValue = undefined\n return this._value\n }\n throw new CodeError('value is not set')\n }\n\n setItem(index: number, value: TItem): void {\n this.items[index] = value\n }\n\n copy(): StaticArray<TItem, TLength> {\n return StaticArray.fromBytes(this.uint8ArrayValue, JSON.stringify(this.typeInfo)) as unknown as StaticArray<TItem, TLength>\n }\n\n concat(other: Parameters<InstanceType<typeof _StaticArray>['concat']>[0]): DynamicArray<TItem> {\n const items = this.items\n const otherEntries = other.entries()\n let next = otherEntries.next()\n while (!next.done) {\n items.push(next.value[1] as TItem)\n next = otherEntries.next()\n }\n return new DynamicArray<TItem>(\n { name: `DynamicArray<${this.genericArgs.elementType.name}>`, genericArgs: { elementType: this.genericArgs.elementType } },\n ...items,\n )\n }\n\n get native(): NTuple<TItem, TLength> {\n return this.items\n }\n\n static fromBytes(\n value: StubBytesCompat | Uint8Array,\n typeInfo: string | TypeInfo,\n prefix: 'none' | 'log' = 'none',\n ): StaticArray<_ARC4Encoded, number> {\n let bytesValue = value instanceof Uint8Array ? value : asUint8Array(value)\n if (prefix === 'log') {\n assert(Bytes(bytesValue.slice(0, 4)).equals(ABI_RETURN_VALUE_LOG_PREFIX), 'ABI return prefix not found')\n bytesValue = bytesValue.slice(4)\n }\n // pass the symbol to the constructor to let it know we are initialising from bytes\n const result = new StaticArray<_ARC4Encoded, number>(typeInfo, IS_INITIALISING_FROM_BYTES_SYMBOL as DeliberateAny)\n result._uint8ArrayValue = bytesValue\n return result\n }\n}\n\n/** @internal */\nexport class Address extends _Address implements _ARC4Encodedint8Array {\n typeInfo: TypeInfo\n private _value: StaticArray<Byte, 32>\n\n constructor(typeInfo: TypeInfo | string, value?: AccountType | string | bytes) {\n super(value)\n let uint8ArrayValue: Uint8Array\n if (value === undefined) {\n uint8ArrayValue = new Uint8Array(32)\n } else if (typeof value === 'string') {\n uint8ArrayValue = encodingUtil.base32ToUint8Array(value).slice(0, ALGORAND_ADDRESS_BYTE_LENGTH - ALGORAND_CHECKSUM_BYTE_LENGTH)\n } else if (isBytes(value)) {\n uint8ArrayValue = getUint8Array(value)\n } else {\n uint8ArrayValue = getUint8Array(value.bytes)\n }\n avmInvariant(uint8ArrayValue.length === 32, 'Addresses should be 32 bytes')\n\n this._value = StaticArray.fromBytes(uint8ArrayValue, typeInfo) as StaticArray<Byte, 32>\n this.typeInfo = typeof typeInfo === 'string' ? JSON.parse(typeInfo) : typeInfo\n return new Proxy(this, arrayProxyHandler<Byte>()) as Address\n }\n\n get uint8ArrayValue(): Uint8Array {\n return this._value.uint8ArrayValue\n }\n\n get bytes(): bytes {\n return this._value.bytes\n }\n\n equals(other: this): boolean {\n if (!(other instanceof Address) || JSON.stringify(this.typeInfo) !== JSON.stringify(other.typeInfo)) {\n throw new CodeError(`Expected expression of type ${this.typeInfo.name}, got ${other.typeInfo.name}`)\n }\n return this.bytes.equals(other.bytes)\n }\n\n get length(): uint64 {\n return 32\n }\n\n get native(): AccountType {\n return Account(this._value.bytes)\n }\n\n get items(): readonly Byte[] {\n return this._value.items\n }\n\n setItem(_index: number, _value: Byte): void {\n throw new CodeError('Address is immutable')\n }\n\n static fromBytes(value: StubBytesCompat | Uint8Array, typeInfo: string | TypeInfo, prefix: 'none' | 'log' = 'none'): Address {\n const staticArrayValue = StaticArray.fromBytes(value, typeInfo, prefix) as StaticArray<Byte, 32>\n const result = new Address(typeInfo)\n result._value = staticArrayValue\n return result\n }\n}\n\n/** @internal */\nexport class DynamicArray<TItem extends _ARC4Encoded> extends _DynamicArray<TItem> implements _ARC4Encodedint8Array {\n private _value?: TItem[]\n private _uint8ArrayValue?: Uint8Array\n typeInfo: TypeInfo\n genericArgs: DynamicArrayGenericArgs\n\n constructor(typeInfo: TypeInfo | string, ...items: TItem[]) {\n super()\n this.typeInfo = typeof typeInfo === 'string' ? JSON.parse(typeInfo) : typeInfo\n this.genericArgs = this.typeInfo.genericArgs as DynamicArrayGenericArgs\n\n assert(areAllARC4Encoded(items), 'expected ARC4 type')\n\n items.forEach((item) => {\n checkItemTypeName(this.genericArgs.elementType, item)\n })\n this._value = items\n\n return new Proxy(this, arrayProxyHandler<TItem>()) as DynamicArray<TItem>\n }\n\n get uint8ArrayValue(): Uint8Array {\n return this._uint8ArrayValue ?? this.encodeWithLength(this.items)\n }\n\n get bytes(): bytes {\n return Bytes(this._uint8ArrayValue ?? this.encodeWithLength(this.items))\n }\n\n equals(other: this): boolean {\n if (!(other instanceof DynamicArray) || JSON.stringify(this.typeInfo) !== JSON.stringify(other.typeInfo)) {\n throw new CodeError(`Expected expression of type ${this.typeInfo.name}, got ${other.typeInfo.name}`)\n }\n return this.bytes.equals(other.bytes)\n }\n\n get length(): uint64 {\n return this.items.length\n }\n\n get items(): TItem[] {\n if (this._uint8ArrayValue) {\n const [length, data] = readLength(this._uint8ArrayValue)\n const childTypes = Array(length).fill(this.genericArgs.elementType)\n this._value = decode(data, childTypes, true) as TItem[]\n this._uint8ArrayValue = undefined\n return this._value\n } else if (this._value) {\n this._uint8ArrayValue = undefined\n return this._value\n }\n throw new CodeError('value is not set')\n }\n\n setItem(index: number, value: TItem): void {\n this.items[index] = value\n }\n\n copy(): DynamicArray<TItem> {\n return DynamicArray.fromBytes(this.uint8ArrayValue, JSON.stringify(this.typeInfo)) as DynamicArray<TItem>\n }\n\n get native(): TItem[] {\n return this.items\n }\n\n push(...values: TItem[]) {\n const items = this.items\n items.push(...values)\n }\n\n pop(): TItem {\n const items = this.items\n const popped = items.pop()\n if (popped === undefined) throw new AvmError('The array is empty')\n return popped\n }\n\n concat(other: Parameters<InstanceType<typeof _DynamicArray>['concat']>[0]): DynamicArray<TItem> {\n const items = this.items\n const otherEntries = other.entries()\n let next = otherEntries.next()\n while (!next.done) {\n items.push(next.value[1] as TItem)\n next = otherEntries.next()\n }\n return new DynamicArray<TItem>(this.typeInfo, ...items)\n }\n\n static fromBytes(\n value: StubBytesCompat | Uint8Array,\n typeInfo: string | TypeInfo,\n prefix: 'none' | 'log' = 'none',\n ): DynamicArray<_ARC4Encoded> {\n let bytesValue = asBytesCls(value)\n if (prefix === 'log') {\n assert(bytesValue.slice(0, 4).equals(ABI_RETURN_VALUE_LOG_PREFIX), 'ABI return prefix not found')\n bytesValue = bytesValue.slice(4)\n }\n const result = new DynamicArray(typeInfo)\n result._uint8ArrayValue = asUint8Array(bytesValue)\n return result\n }\n\n private encodeWithLength(items: TItem[]) {\n return concatUint8Arrays(encodeLength(items.length).asUint8Array(), encode(items, true))\n }\n}\n\n/** @internal */\nexport class Tuple<TTuple extends [_ARC4Encoded, ..._ARC4Encoded[]]> extends _Tuple<TTuple> implements _ARC4Encodedint8Array {\n private _value?: TTuple\n private _uint8ArrayValue?: Uint8Array\n typeInfo: TypeInfo\n genericArgs: TypeInfo[]\n\n constructor(typeInfo: TypeInfo | string, ...items: TTuple) {\n // if first item is the symbol, we are initialising from bytes\n // so we don't need to pass the items to the super constructor\n const isInitialisingFromBytes = items.length === 1 && (items[0] as DeliberateAny) === IS_INITIALISING_FROM_BYTES_SYMBOL\n super(...(isInitialisingFromBytes ? ([] as DeliberateAny) : items))\n this.typeInfo = typeof typeInfo === 'string' ? JSON.parse(typeInfo) : typeInfo\n this.genericArgs = Object.values(this.typeInfo.genericArgs as Record<string, TypeInfo>)\n\n // if we are not initialising from bytes, we need to check and set the items\n if (!isInitialisingFromBytes) {\n assert(areAllARC4Encoded(items), 'expected ARC4 type')\n\n items.forEach((item, index) => {\n checkItemTypeName(this.genericArgs[index], item)\n })\n if (items.length) {\n this._value = items\n } else {\n this._uint8ArrayValue = new Uint8Array(getMaxLengthOfStaticContentType(this.typeInfo))\n }\n }\n }\n\n get uint8ArrayValue(): Uint8Array {\n return this._uint8ArrayValue ?? encode(this.items)\n }\n\n get bytes(): bytes {\n return Bytes(this._uint8ArrayValue ?? encode(this.items))\n }\n\n equals(other: this): boolean {\n if (!(other instanceof Tuple) || JSON.stringify(this.typeInfo) !== JSON.stringify(other.typeInfo)) {\n throw new CodeError(`Expected expression of type ${this.typeInfo.name}, got ${other.typeInfo.name}`)\n }\n return this.bytes.equals(other.bytes)\n }\n\n get length(): TTuple['length'] & uint64 {\n return this.items.length\n }\n\n get native(): TTuple {\n return this.items\n }\n\n at<TIndex extends keyof TTuple>(index: TIndex): TTuple[TIndex] {\n return this.items[index]\n }\n\n private get items(): TTuple {\n if (this._uint8ArrayValue) {\n this._value = decode(this._uint8ArrayValue, this.genericArgs) as TTuple\n this._uint8ArrayValue = undefined\n return this._value\n } else if (this._value) {\n this._uint8ArrayValue = undefined\n return this._value\n }\n throw new CodeError('value is not set')\n }\n\n static fromBytes(\n value: StubBytesCompat | Uint8Array,\n typeInfo: string | TypeInfo,\n prefix: 'none' | 'log' = 'none',\n ): Tuple<[_ARC4Encoded, ..._ARC4Encoded[]]> {\n let bytesValue = asBytesCls(value)\n if (prefix === 'log') {\n assert(bytesValue.slice(0, 4).equals(ABI_RETURN_VALUE_LOG_PREFIX), 'ABI return prefix not found')\n bytesValue = bytesValue.slice(4)\n }\n // pass the symbol to the constructor to let it know we are initialising from bytes\n const result = new Tuple(typeInfo, IS_INITIALISING_FROM_BYTES_SYMBOL as DeliberateAny)\n result._uint8ArrayValue = asUint8Array(bytesValue)\n return result\n }\n}\n\n/** @internal */\nexport class Struct<T extends StructConstraint> extends (_Struct<StructConstraint> as DeliberateAny) implements _ARC4Encodedint8Array {\n private _uint8ArrayValue?: Uint8Array\n genericArgs: Record<string, TypeInfo>\n\n constructor(typeInfo: TypeInfo | string, value: T = {} as T) {\n super(value)\n this.typeInfo = typeof typeInfo === 'string' ? JSON.parse(typeInfo) : typeInfo\n this.genericArgs = this.typeInfo.genericArgs as Record<string, TypeInfo>\n\n Object.keys(this.genericArgs).forEach((key) => {\n Object.defineProperty(this, key, {\n value: value[key],\n writable: true,\n enumerable: true,\n })\n })\n\n return new Proxy(this, {\n get(target, prop) {\n const originalValue = Reflect.get(target, prop)\n if (originalValue === undefined && target._uint8ArrayValue?.length && Object.keys(target.genericArgs).includes(prop.toString())) {\n return target.items[prop.toString()]\n }\n return originalValue\n },\n set(target, prop, value) {\n if (target._uint8ArrayValue && Object.keys(target.genericArgs).includes(prop.toString())) {\n target.decodeAsProperties()\n }\n return Reflect.set(target, prop, value)\n },\n })\n }\n\n get uint8ArrayValue(): Uint8Array {\n return this._uint8ArrayValue ?? encode(Object.values(this.items))\n }\n\n get bytes(): bytes {\n return Bytes(this._uint8ArrayValue ?? encode(Object.values(this.items)))\n }\n\n get items(): T {\n this.decodeAsProperties()\n const result = {} as StructConstraint\n Object.keys(this.genericArgs).forEach((key) => {\n result[key] = (this as unknown as StructConstraint)[key]\n })\n return result as T\n }\n\n get native(): T {\n return this.items\n }\n\n copy(): Struct<T> {\n return Struct.fromBytes(this.uint8ArrayValue, JSON.stringify(this.typeInfo)) as Struct<T>\n }\n\n private decodeAsProperties() {\n if (this._uint8ArrayValue) {\n const values = decode(this._uint8ArrayValue, Object.values(this.genericArgs))\n Object.keys(this.genericArgs).forEach((key, index) => {\n ;(this as unknown as StructConstraint)[key] = values[index]\n })\n this._uint8ArrayValue = undefined\n }\n }\n\n static fromBytes(\n value: StubBytesCompat | Uint8Array,\n typeInfo: string | TypeInfo,\n prefix: 'none' | 'log' = 'none',\n ): Struct<StructConstraint> {\n let bytesValue = asBytesCls(value)\n if (prefix === 'log') {\n assert(bytesValue.slice(0, 4).equals(ABI_RETURN_VALUE_LOG_PREFIX), 'ABI return prefix not found')\n bytesValue = bytesValue.slice(4)\n }\n const result = new Struct(typeInfo)\n result._uint8ArrayValue = asUint8Array(bytesValue)\n return result\n }\n}\n\n/** @internal */\nexport class DynamicBytes extends _DynamicBytes implements _ARC4Encodedint8Array {\n typeInfo: TypeInfo\n private _value: DynamicArray<Byte>\n\n constructor(typeInfo: TypeInfo | string, value?: bytes | string) {\n super(value)\n const uint8ArrayValue = concatUint8Arrays(encodeLength(value?.length ?? 0).asUint8Array(), asUint8Array(value ?? new Uint8Array()))\n this._value = DynamicArray.fromBytes(uint8ArrayValue, typeInfo) as DynamicArray<Byte>\n this.typeInfo = typeof typeInfo === 'string' ? JSON.parse(typeInfo) : typeInfo\n return new Proxy(this, arrayProxyHandler<Byte>()) as DynamicBytes\n }\n\n get uint8ArrayValue(): Uint8Array {\n return this._value.uint8ArrayValue\n }\n\n get bytes(): bytes {\n return this._value.bytes\n }\n\n equals(other: this): boolean {\n if (!(other instanceof DynamicBytes) || JSON.stringify(this.typeInfo) !== JSON.stringify(other.typeInfo)) {\n throw new CodeError(`Expected expression of type ${this.typeInfo.name}, got ${other.typeInfo.name}`)\n }\n return this.bytes.equals(other.bytes)\n }\n\n get length(): uint64 {\n return this._value.length\n }\n\n get native(): bytes {\n return this._value.bytes.slice(ABI_LENGTH_SIZE)\n }\n\n get items(): Byte[] {\n return this._value.items\n }\n\n setItem(_index: number, _value: Byte): void {\n throw new CodeError('DynamicBytes is immutable')\n }\n\n concat(other: Parameters<InstanceType<typeof _DynamicBytes>['concat']>[0]): DynamicBytes {\n const items = this.items\n const otherEntries = other.entries()\n let next = otherEntries.next()\n while (!next.done) {\n items.push(next.value[1] as Byte)\n next = otherEntries.next()\n }\n const concatenatedBytes = items\n .map((item) => item.uint8ArrayValue)\n .reduce((acc, curr) => concatUint8Arrays(acc, curr), new Uint8Array())\n return new DynamicBytes(this.typeInfo, asBytes(concatenatedBytes))\n }\n\n static fromBytes(value: StubBytesCompat | Uint8Array, typeInfo: string | TypeInfo, prefix: 'none' | 'log' = 'none'): DynamicBytes {\n const dynamicArrayValue = DynamicArray.fromBytes(value, typeInfo, prefix) as DynamicArray<Byte>\n const result = new DynamicBytes(typeInfo)\n result._value = dynamicArrayValue\n return result\n }\n}\n\n/** @internal */\nexport class StaticBytes<TLength extends uint64 = 0> extends _StaticBytes<TLength> implements _ARC4Encodedint8Array {\n private _value: StaticArray<Byte, TLength>\n typeInfo: TypeInfo\n\n constructor(typeInfo: TypeInfo | string, value?: bytes<TLength>) {\n super(value ?? (Bytes() as bytes<TLength>))\n this.typeInfo = typeof typeInfo === 'string' ? JSON.parse(typeInfo) : typeInfo\n const uint8ArrayValue = asUint8Array(value ?? new Uint8Array(getMaxLengthOfStaticContentType(this.typeInfo)))\n this._value = StaticArray.fromBytes(uint8ArrayValue, typeInfo) as unknown as StaticArray<Byte, TLength>\n return new Proxy(this, arrayProxyHandler<Byte>()) as StaticBytes<TLength>\n }\n\n get uint8ArrayValue(): Uint8Array {\n return this._value.uint8ArrayValue\n }\n\n get bytes(): bytes {\n return this._value.bytes\n }\n\n equals(other: this): boolean {\n if (!(other instanceof StaticBytes) || JSON.stringify(this.typeInfo) !== JSON.stringify(other.typeInfo)) {\n throw new CodeError(`Expected expression of type ${this.typeInfo.name}, got ${other.typeInfo.name}`)\n }\n return this.bytes.equals(other.bytes)\n }\n\n get length(): uint64 {\n return this._value.length\n }\n\n get native(): bytes<TLength> {\n return this._value.bytes as bytes<TLength>\n }\n\n get items(): Byte[] {\n return this._value.items\n }\n\n setItem(_index: number, _value: Byte): void {\n throw new CodeError('StaticBytes is immutable')\n }\n\n concat(other: Parameters<InstanceType<typeof _StaticBytes>['concat']>[0]): DynamicBytes {\n const items = this.items\n const otherEntries = other.entries()\n let next = otherEntries.next()\n while (!next.done) {\n items.push(next.value[1] as Byte)\n next = otherEntries.next()\n }\n const concatenatedBytes = items\n .map((item) => item.uint8ArrayValue)\n .reduce((acc, curr) => concatUint8Arrays(acc, curr), new Uint8Array())\n return new DynamicBytes(this.typeInfo, asBytes(concatenatedBytes))\n }\n\n static fromBytes(value: StubBytesCompat | Uint8Array, typeInfo: string | TypeInfo, prefix: 'none' | 'log' = 'none'): StaticBytes {\n const staticArrayValue = StaticArray.fromBytes(value, typeInfo, prefix) as StaticArray<Byte, number>\n const result = new StaticBytes(typeInfo)\n result._value = staticArrayValue as StaticArray<Byte, 0>\n return result\n }\n}\n\n/** @internal */\nexport class ReferenceArray<TItem> extends _ReferenceArray<TItem> {\n private _values: TItem[]\n typeInfo: TypeInfo\n\n constructor(typeInfo: TypeInfo | string, ...items: TItem[]) {\n super(...items)\n this.typeInfo = typeof typeInfo === 'string' ? JSON.parse(typeInfo) : typeInfo\n this._values = items\n\n return new Proxy(this, arrayProxyHandler<TItem>()) as ReferenceArray<TItem>\n }\n\n /**\n * Returns the current length of this array\n */\n get length(): uint64 {\n return this._values.length\n }\n\n get items(): TItem[] {\n return this._values\n }\n\n setItem(index: number, value: TItem): void {\n this.items[index] = value\n }\n\n slice(start?: Uint64Compat, end?: Uint64Compat): _ReferenceArray<TItem> {\n const startIndex = end === undefined ? 0 : asNumber(start ?? 0)\n const endIndex = end === undefined ? asNumber(start ?? this._values.length) : asNumber(end)\n return new ReferenceArray<TItem>(this.typeInfo, ...this._values.slice(startIndex, endIndex))\n }\n\n /**\n * Push a number of items into this array\n * @param items The items to be added to this array\n */\n push(...items: TItem[]): void {\n this._values.push(...items)\n }\n\n /**\n * Pop a single item from this array\n */\n pop(): TItem {\n return this._values.pop()!\n }\n\n copy(): _ReferenceArray<TItem> {\n const bytesValue = toBytes(this)\n return getEncoder<_ReferenceArray<TItem>>(this.typeInfo)(bytesValue, this.typeInfo)\n }\n}\n\n/** @internal */\nexport class FixedArray<TItem, TLength extends number> extends _FixedArray<TItem, TLength> {\n private _values: NTuple<TItem, TLength>\n private size: number\n typeInfo: TypeInfo\n private genericArgs: StaticArrayGenericArgs\n\n constructor(typeInfo: TypeInfo | string, ...items: TItem[] & { length: TLength }) {\n super()\n this.typeInfo = typeof typeInfo === 'string' ? JSON.parse(typeInfo) : typeInfo\n this.genericArgs = this.typeInfo.genericArgs as StaticArrayGenericArgs\n this.size = parseInt(this.genericArgs.size.name, 10)\n if (items.length) {\n this._values = items as NTuple<TItem, TLength>\n } else {\n const bytesValue = asBytes(new Uint8Array(getMaxLengthOfStaticContentType(this.typeInfo)))\n this._values = (getEncoder<_FixedArray<TItem, TLength>>(this.typeInfo)(bytesValue, this.typeInfo) as FixedArray<TItem, TLength>).items\n }\n return new Proxy(this, arrayProxyHandler<TItem>()) as FixedArray<TItem, TLength>\n }\n\n concat(...others: (TItem | ConcatArray<TItem>)[]): TItem[] {\n return this.items.concat(...others)\n }\n\n get length(): uint64 {\n return this.size\n }\n\n get items(): NTuple<TItem, TLength> {\n return this._values\n }\n\n setItem(index: number, value: TItem): void {\n this.items[index] = value\n }\n\n slice(start?: Uint64Compat, end?: Uint64Compat): Array<TItem> {\n const startIndex = end === undefined ? 0 : asNumber(start ?? 0)\n const endIndex = end === undefined ? asNumber(start ?? this._values.length) : asNumber(end)\n return this._values.slice(startIndex, endIndex)\n }\n\n copy(): _FixedArray<TItem, TLength> {\n const bytesValue = toBytes(this)\n return getEncoder<_FixedArray<TItem, TLength>>(this.typeInfo)(bytesValue, this.typeInfo)\n }\n}\n\nconst decode = (value: Uint8Array, childTypes: TypeInfo[], isHomogenous?: boolean) => {\n let i = 0\n let arrayIndex = 0\n const valuePartitions: Uint8Array[] = []\n const dynamicSegments: Array<Array<number>> = [] // Store the start and end of a dynamic element\n\n while (i < childTypes.length) {\n const childType = childTypes[i]\n if (holdsDynamicLengthContent(childType)) {\n // Decode the size of the dynamic element\n const dynamicIndex = uint8ArrayToNumber(value.slice(arrayIndex, arrayIndex + ABI_LENGTH_SIZE))\n if (dynamicSegments.length) {\n dynamicSegments.at(-1)![1] = dynamicIndex\n }\n // Since we do not know where the current dynamic element ends,\n // put a placeholder and update later\n dynamicSegments.push([dynamicIndex, -1])\n valuePartitions.push(new Uint8Array())\n arrayIndex += ABI_LENGTH_SIZE\n } else if (['Bool', 'boolean'].includes(childType.name)) {\n const before = findBoolTypes(childTypes, i, -1, isHomogenous)\n let after = findBoolTypes(childTypes, i, 1, isHomogenous)\n\n if (before % 8 != 0) {\n throw new CodeError('\"expected before index should have number of bool mod 8 equal 0\"')\n }\n after = Math.min(7, after)\n const bits = uint8ArrayToNumber(value.slice(arrayIndex, arrayIndex + 1))\n Array(after + 1)\n .fill(0)\n .forEach((_, j) => {\n const mask = 128 >> j\n valuePartitions.push(\n mask & bits ? encodingUtil.bigIntToUint8Array(TRUE_BIGINT_VALUE) : encodingUtil.bigIntToUint8Array(FALSE_BIGINT_VALUE),\n )\n })\n i += after\n arrayIndex += 1\n } else {\n const currLen = getMaxLengthOfStaticContentType(childType)\n valuePartitions.push(value.slice(arrayIndex, arrayIndex + currLen))\n arrayIndex += currLen\n }\n\n if (arrayIndex >= value.length && i != childTypes.length - 1) {\n throw new CodeError('input string is not long enough to be decoded')\n }\n i += 1\n }\n\n if (dynamicSegments.length > 0) {\n dynamicSegments.at(-1)![1] = value.length\n arrayIndex = value.length\n }\n if (arrayIndex < value.length) {\n throw new CodeError('input string was not fully consumed')\n }\n\n // Check dynamic element partitions\n let segmentIndex = 0\n childTypes.forEach((childType, index) => {\n if (holdsDynamicLengthContent(childType)) {\n const [segmentStart, segmentEnd] = dynamicSegments[segmentIndex]\n valuePartitions[index] = value.slice(segmentStart, segmentEnd)\n segmentIndex += 1\n }\n })\n\n const values: _ARC4Encoded[] = []\n childTypes.forEach((childType, index) => {\n values.push(\n getEncoder<_ARC4Encoded>(childType)(\n ['bytes', 'string'].includes(childType.name) ? valuePartitions[index].slice(2) : valuePartitions[index],\n childType,\n ),\n )\n })\n return values\n}\n\nconst encode = (values: (_ARC4Encoded & { uint8ArrayValue?: Uint8Array })[], isHomogenous?: boolean) => {\n const length = values.length\n const heads = []\n const tails = []\n const dynamicLengthTypeIndex = []\n let i = 0\n const valuesLengthBytes = values instanceof _DynamicArray ? encodeLength(length).asUint8Array() : new Uint8Array()\n while (i < length) {\n const value = values[i]\n assert(value instanceof _ARC4Encoded, `expected ARC4 type ${value.constructor.name}`)\n dynamicLengthTypeIndex.push(isDynamicLengthType(value))\n if (dynamicLengthTypeIndex.at(-1)) {\n heads.push(asUint8Array(Bytes.fromHex('0000')))\n tails.push((value as _ARC4Encodedint8Array).uint8ArrayValue ?? asUint8Array(value.bytes))\n } else {\n if (value instanceof _Bool) {\n const before = findBool(values, i, -1, isHomogenous)\n let after = findBool(values, i, 1, isHomogenous)\n if (before % 8 != 0) {\n throw new CodeError('\"expected before index should have number of bool mod 8 equal 0\"')\n }\n after = Math.min(7, after)\n const consecutiveBools = values.slice(i, i + after + 1) as _Bool[]\n const compressedNumber = compressMultipleBool(consecutiveBools)\n heads.push(new Uint8Array([compressedNumber]))\n i += after\n } else {\n heads.push((value as _ARC4Encodedint8Array).uint8ArrayValue ?? asUint8Array(value.bytes))\n }\n tails.push(new Uint8Array())\n }\n i += 1\n }\n\n // Adjust heads for dynamic types\n let headLength = 0\n heads.forEach((head) => {\n // If the element is not a placeholder, append the length of the element\n headLength += head.length\n })\n\n // Correctly encode dynamic types and replace placeholder\n let tailCurrLength = 0\n for (let i = 0; i < heads.length; i++) {\n if (dynamicLengthTypeIndex[i]) {\n const headValue = headLength + tailCurrLength\n heads[i] = asUint8Array(encodeLength(headValue))\n }\n tailCurrLength += tails[i].length\n }\n\n return concatUint8Arrays(valuesLengthBytes, ...heads, ...tails)\n}\n\nconst isDynamicLengthType = (value: _ARC4Encoded) => {\n return (\n value instanceof Str ||\n (value instanceof StaticArray && holdsDynamicLengthContent(value.typeInfo)) ||\n (value instanceof Tuple && value.genericArgs.some(holdsDynamicLengthContent)) ||\n (value instanceof Struct && Object.values(value.genericArgs).some(holdsDynamicLengthContent)) ||\n value instanceof DynamicArray ||\n value instanceof DynamicBytes\n )\n}\n\n/** @internal */\nexport function encodeArc4<T>(sourceTypeInfoString: string | undefined, source: T): bytes {\n const arc4Encoded = getArc4Encoded(source, sourceTypeInfoString)\n return arc4Encoded.bytes\n}\n\n/** @internal */\nexport function decodeArc4<T>(\n sourceTypeInfoString: string,\n targetTypeInfoString: string,\n bytes: StubBytesCompat,\n prefix: 'none' | 'log' = 'none',\n): T {\n const sourceTypeInfo = JSON.parse(sourceTypeInfoString)\n const targetTypeInfo = JSON.parse(targetTypeInfoString)\n const encoder = getEncoder(sourceTypeInfo)\n const source = encoder(bytes, sourceTypeInfo, prefix) as { typeInfo: TypeInfo }\n return getNativeValue(source, targetTypeInfo) as T\n}\n\n/** @internal */\nexport function convertBytes<T extends _ARC4Encoded>(\n typeInfoString: string,\n bytes: StubBytesCompat,\n options: { prefix?: 'none' | 'log'; strategy: 'unsafe-cast' | 'validate' },\n): T {\n const typeInfo = JSON.parse(typeInfoString)\n return getEncoder<T>(typeInfo)(bytes, typeInfo, options.prefix)\n}\n\n/** @internal */\nexport const getArc4Encoded = (value: DeliberateAny, sourceTypeInfoString?: string): _ARC4Encoded => {\n if (value instanceof _ARC4Encoded) {\n return value\n }\n if (value instanceof AccountCls) {\n return getArc4Encoded(value.bytes)\n }\n if (value instanceof AssetCls) {\n return getArc4Encoded(value.id)\n }\n if (value instanceof ApplicationCls) {\n return getArc4Encoded(value.id)\n }\n if (typeof value === 'boolean') {\n return new Bool({ name: 'Bool' }, value)\n }\n if (value instanceof Uint64Cls || typeof value === 'number') {\n return new Uint({ name: 'Uint<64>', genericArgs: [{ name: '64' }] }, asBigInt(value))\n }\n if (value instanceof BigUintCls) {\n return new Uint({ name: 'Uint<512>', genericArgs: [{ name: '512' }] }, value.asBigInt())\n }\n if (typeof value === 'bigint') {\n return new Uint({ name: 'Uint<512>', genericArgs: [{ name: '512' }] }, value)\n }\n if (value instanceof BytesCls) {\n if (value.fixedLength !== undefined) {\n return new StaticBytes(\n {\n name: 'StaticBytes',\n genericArgs: { elementType: { name: 'Byte', genericArgs: [{ name: '8' }] }, size: { name: value.fixedLength.toString() } },\n },\n value.asAlgoTs(),\n )\n }\n return new DynamicBytes(\n { name: 'DynamicBytes', genericArgs: { elementType: { name: 'Byte', genericArgs: [{ name: '8' }] } } },\n value.asAlgoTs(),\n )\n }\n if (typeof value === 'string') {\n return new Str({ name: 'Str' }, value)\n }\n if (Array.isArray(value) || value instanceof ReferenceArray || value instanceof FixedArray) {\n const sourceTypeInfo = sourceTypeInfoString ? JSON.parse(sourceTypeInfoString) : undefined\n const sourceGenericArgs = ((value as DeliberateAny).typeInfo || sourceTypeInfo || {})?.genericArgs\n const result: _ARC4Encoded[] = (value instanceof ReferenceArray || value instanceof FixedArray ? value.items : value).reduce(\n (acc: _ARC4Encoded[], cur: DeliberateAny, currentIndex: number) => {\n const elementTypeInfo = sourceGenericArgs?.elementType || sourceGenericArgs?.[currentIndex]\n const elementTypeInfoString = elementTypeInfo ? JSON.stringify(elementTypeInfo) : undefined\n return acc.concat(getArc4Encoded(cur, elementTypeInfoString))\n },\n [],\n )\n\n const genericArgs: TypeInfo[] = result.map((x) => (x as DeliberateAny).typeInfo)\n if (value instanceof FixedArray) {\n const typeInfo = {\n name: `StaticArray<${genericArgs[0].name},${genericArgs.length}>`,\n genericArgs: { elementType: genericArgs[0], size: { name: genericArgs.length.toString() } },\n }\n return new StaticArray(typeInfo, ...(result as [_ARC4Encoded, ..._ARC4Encoded[]]))\n } else if (\n sourceTypeInfo?.name?.startsWith('Array') ||\n sourceTypeInfo?.name?.startsWith('ReadonlyArray') ||\n value instanceof ReferenceArray\n ) {\n const elementType = genericArgs[0] ?? sourceTypeInfo.genericArgs?.elementType\n const typeInfo = { name: `DynamicArray<${elementType.name}>`, genericArgs: { elementType } }\n return new DynamicArray(typeInfo, ...(result as [_ARC4Encoded, ..._ARC4Encoded[]]))\n } else {\n const typeInfo = { name: `Tuple<[${genericArgs.map((x) => x.name).join(',')}]>`, genericArgs }\n return new Tuple(typeInfo, ...(result as [_ARC4Encoded, ..._ARC4Encoded[]]))\n }\n }\n if (typeof value === 'object') {\n const sourceTypeInfo = sourceTypeInfoString ? JSON.parse(sourceTypeInfoString) : undefined\n const propTypeInfos = (value.typeInfo || sourceTypeInfo || {}).genericArgs\n const result = Object.entries(value).reduce((acc: _ARC4Encoded[], [key, cur]: DeliberateAny) => {\n const propTypeInfoString = propTypeInfos?.[key] ? JSON.stringify(propTypeInfos[key]) : undefined\n return acc.concat(getArc4Encoded(cur, propTypeInfoString))\n }, [])\n const genericArgs: TypeInfo[] = result.map((x) => (x as DeliberateAny).typeInfo)\n const typeInfo = {\n name: `Struct<${value.constructor.name}>`,\n genericArgs: Object.fromEntries(Object.keys(value).map((x, i) => [x, genericArgs[i]])),\n }\n 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 return asBytes(toUint8Array(val, sourceTypeInfoString))\n}\n\n/** @internal */\nexport const toUint8Array = (val: unknown, sourceTypeInfoString?: string): Uint8Array => {\n const uint64Val = asMaybeUint64Cls(val, false)\n if (uint64Val !== undefined) {\n return uint64Val.toBytes().asUint8Array()\n }\n const bytesVal = asMaybeBytesCls(val)\n if (bytesVal !== undefined) {\n return bytesVal.asUint8Array()\n }\n const bigUintVal = asMaybeBigUintCls(val)\n if (bigUintVal !== undefined) {\n return bigUintVal.toBytes().asUint8Array()\n }\n if (val instanceof BytesBackedCls) {\n return asUint8Array(val.bytes)\n }\n if (val instanceof Uint64BackedCls) {\n return asUint64Cls(val.uint64).toBytes().asUint8Array()\n }\n if (Array.isArray(val) || typeof val === 'object') {\n const arc4Encoded = getArc4Encoded(val, sourceTypeInfoString)\n return (arc4Encoded as _ARC4Encodedint8Array).uint8ArrayValue ?? asUint8Array(arc4Encoded.bytes)\n }\n throw new InternalError(`Invalid type for bytes: ${nameOfType(val)}`)\n}\n\n/** @internal */\nexport const getEncoder = <T>(typeInfo: TypeInfo): fromBytes<T> => {\n const mutableTupleFromBytes = (value: StubBytesCompat | Uint8Array, typeInfo: string | TypeInfo, prefix: 'none' | 'log' = 'none') => {\n const tuple = Tuple.fromBytes(value, typeInfo, prefix)\n return asNumber(tuple.bytes.length) ? tuple.native : ([] as unknown as typeof tuple.native)\n }\n const readonlyMutableTupleFromBytes = (\n value: StubBytesCompat | Uint8Array,\n typeInfo: string | TypeInfo,\n prefix: 'none' | 'log' = 'none',\n ) => {\n const result = mutableTupleFromBytes(value, typeInfo, prefix)\n return result as Readonly<typeof result>\n }\n const mutableObjectFromBytes = (value: StubBytesCompat | Uint8Array, typeInfo: string | TypeInfo, prefix: 'none' | 'log' = 'none') => {\n const struct = Struct.fromBytes(value, typeInfo, prefix)\n return asNumber(struct.bytes.length) ? struct.native : ({} as unknown as typeof struct.native)\n }\n const readonlyObjectFromBytes = (value: StubBytesCompat | Uint8Array, typeInfo: string | TypeInfo, prefix: 'none' | 'log' = 'none') => {\n const result = mutableObjectFromBytes(value, typeInfo, prefix)\n return result as Readonly<typeof result>\n }\n const arrayFromBytes = (value: StubBytesCompat | Uint8Array, typeInfo: string | TypeInfo, prefix: 'none' | 'log' = 'none') => {\n const dynamicArray = DynamicArray.fromBytes(value, typeInfo, prefix)\n return asNumber(dynamicArray.bytes.length) ? dynamicArray.native : ([] as unknown as typeof dynamicArray.native)\n }\n const readonlyArrayFromBytes = (value: StubBytesCompat | Uint8Array, typeInfo: string | TypeInfo, prefix: 'none' | 'log' = 'none') => {\n const result = arrayFromBytes(value, typeInfo, prefix)\n return result as Readonly<typeof result>\n }\n const referenceArrayFromBytes = (value: StubBytesCompat | Uint8Array, typeInfo: string | TypeInfo, prefix: 'none' | 'log' = 'none') => {\n const dynamicArray = DynamicArray.fromBytes(value, typeInfo, prefix)\n return new ReferenceArray(\n typeInfo,\n ...(asNumber(dynamicArray.bytes.length) ? dynamicArray.native : ([] as unknown as typeof dynamicArray.native)),\n )\n }\n const fixedArrayFromBytes = (value: StubBytesCompat | Uint8Array, typeInfo: string | TypeInfo, prefix: 'none' | 'log' = 'none') => {\n const staticArray = StaticArray.fromBytes(value, typeInfo, prefix)\n return new FixedArray(\n typeInfo,\n ...(asNumber(staticArray.uint8ArrayValue.length) ? staticArray.native : ([] as unknown as typeof staticArray.native)),\n )\n }\n const encoders: Record<string, fromBytes<DeliberateAny>> = {\n account: AccountCls.fromBytes,\n application: ApplicationCls.fromBytes,\n asset: AssetCls.fromBytes,\n boolean: booleanFromBytes,\n biguint: bigUintFromBytes,\n 'bytes(<.*>)?': bytesFromBytes,\n string: stringFromBytes,\n uint64: uint64FromBytes,\n OnCompleteAction: onCompletionFromBytes,\n TransactionType: transactionTypeFromBytes,\n Address: Address.fromBytes,\n Bool: Bool.fromBytes,\n Byte: Byte.fromBytes,\n Str: Str.fromBytes,\n 'Uint<.*>': Uint.fromBytes,\n 'UFixed<.*>': UFixed.fromBytes,\n 'StaticArray<.*>': StaticArray.fromBytes,\n 'DynamicArray<.*>': DynamicArray.fromBytes,\n 'Tuple(<.*>)?': Tuple.fromBytes,\n 'ReadonlyTuple(<.*>)?': readonlyMutableTupleFromBytes,\n 'MutableTuple(<.*>)?': mutableTupleFromBytes,\n 'Struct(<.*>)?': Struct.fromBytes,\n DynamicBytes: DynamicBytes.fromBytes,\n 'StaticBytes<.*>': StaticBytes.fromBytes,\n object: Struct.fromBytes,\n 'Object<.*>': mutableObjectFromBytes,\n 'ReadonlyObject<.*>': readonlyObjectFromBytes,\n 'ReferenceArray<.*>': referenceArrayFromBytes,\n 'FixedArray<.*>': fixedArrayFromBytes,\n 'Array<.*>': arrayFromBytes,\n 'ReadonlyArray<.*>': readonlyArrayFromBytes,\n }\n\n const encoder = Object.entries(encoders).find(([k, _]) => new RegExp(`^${k}$`, 'i').test(typeInfo.name))?.[1]\n if (!encoder) {\n throw new Error(`No encoder found for type ${typeInfo.name}`)\n }\n return encoder as fromBytes<T>\n}\n","import type { bytes, gtxn, MimcConfigurations, op, VrfVerify } from '@algorandfoundation/algorand-typescript'\nimport { Ecdsa, OnCompleteAction } from '@algorandfoundation/algorand-typescript'\nimport elliptic from 'elliptic'\nimport js_sha256 from 'js-sha256'\nimport js_sha3 from 'js-sha3'\nimport js_sha512 from 'js-sha512'\nimport nacl from 'tweetnacl'\nimport { LOGIC_DATA_PREFIX, PROGRAM_TAG } from '../constants'\nimport { lazyContext } from '../context-helpers/internal-context'\nimport { InternalError, NotImplementedError } from '../errors'\nimport { asBytes, asBytesCls, asUint8Array, concatUint8Arrays } from '../util'\nimport type { StubBytesCompat, StubUint64Compat } from './primitives'\nimport { Bytes, BytesCls, Uint64Cls } from './primitives'\n\n/** @internal */\nexport const sha256 = (a: StubBytesCompat): bytes<32> => {\n const bytesA = BytesCls.fromCompat(a)\n const hashArray = js_sha256.sha256.create().update(bytesA.asUint8Array()).digest()\n const hashBytes = Bytes(new Uint8Array(hashArray), { length: 32 })\n return hashBytes\n}\n\n/** @internal */\nexport const sha3_256 = (a: StubBytesCompat): bytes<32> => {\n const bytesA = BytesCls.fromCompat(a)\n const hashArray = js_sha3.sha3_256.create().update(bytesA.asUint8Array()).digest()\n const hashBytes = Bytes(new Uint8Array(hashArray), { length: 32 })\n return hashBytes\n}\n\n/** @internal */\nexport const keccak256 = (a: StubBytesCompat): bytes<32> => {\n const bytesA = BytesCls.fromCompat(a)\n const hashArray = js_sha3.keccak256.create().update(bytesA.asUint8Array()).digest()\n const hashBytes = Bytes(new Uint8Array(hashArray), { length: 32 })\n return hashBytes\n}\n\n/** @internal */\nexport const sha512_256 = (a: StubBytesCompat): bytes<32> => {\n const bytesA = BytesCls.fromCompat(a)\n const hashArray = js_sha512.sha512_256.create().update(bytesA.asUint8Array()).digest()\n const hashBytes = Bytes(new Uint8Array(hashArray), { length: 32 })\n return hashBytes\n}\n\n/** @internal */\nexport const ed25519verifyBare = (a: StubBytesCompat, b: StubBytesCompat, c: StubBytesCompat): boolean => {\n const bytesA = BytesCls.fromCompat(a)\n const bytesB = BytesCls.fromCompat(b)\n const bytesC = BytesCls.fromCompat(c)\n return nacl.sign.detached.verify(bytesA.asUint8Array(), bytesB.asUint8Array(), bytesC.asUint8Array())\n}\n\n/** @internal */\nexport const ed25519verify = (a: StubBytesCompat, b: StubBytesCompat, c: StubBytesCompat): boolean => {\n const txn = lazyContext.activeGroup.activeTransaction as gtxn.ApplicationCallTxn\n const programBytes = asBytesCls(txn.onCompletion == OnCompleteAction.ClearState ? txn.clearStateProgram : txn.approvalProgram)\n\n const logicSig = concatUint8Arrays(asUint8Array(PROGRAM_TAG), programBytes.asUint8Array())\n const logicSigAddress = js_sha512.sha512_256.array(logicSig)\n\n const addressBytes = Bytes(logicSigAddress)\n const data = LOGIC_DATA_PREFIX.concat(addressBytes).concat(asBytes(a))\n return ed25519verifyBare(data, b, c)\n}\n\n/** @internal */\nexport const ecdsaVerify = (\n v: Ecdsa,\n a: StubBytesCompat,\n b: StubBytesCompat,\n c: StubBytesCompat,\n d: StubBytesCompat,\n e: StubBytesCompat,\n): boolean => {\n const dataBytes = BytesCls.fromCompat(a)\n const sigRBytes = BytesCls.fromCompat(b)\n const sigSBytes = BytesCls.fromCompat(c)\n const pubkeyXBytes = BytesCls.fromCompat(d)\n const pubkeyYBytes = BytesCls.fromCompat(e)\n\n const publicKey = BytesCls.fromCompat(new Uint8Array([0x04]))\n .concat(pubkeyXBytes)\n .concat(pubkeyYBytes)\n\n const ecdsa = new elliptic.ec(curveMap[v])\n const keyPair = ecdsa.keyFromPublic(publicKey.asUint8Array())\n return keyPair.verify(dataBytes.asUint8Array(), { r: sigRBytes.asUint8Array(), s: sigSBytes.asUint8Array() })\n}\n\n/** @internal */\nexport const ecdsaPkRecover = (\n v: Ecdsa,\n a: StubBytesCompat,\n b: StubUint64Compat,\n c: StubBytesCompat,\n d: StubBytesCompat,\n): readonly [bytes<32>, bytes<32>] => {\n if (v !== Ecdsa.Secp256k1) {\n throw new InternalError(`Unsupported ECDSA curve: ${v}`)\n }\n const dataBytes = BytesCls.fromCompat(a)\n const rBytes = BytesCls.fromCompat(c)\n const sBytes = BytesCls.fromCompat(d)\n const recoveryId = Uint64Cls.fromCompat(b)\n\n const ecdsa = new elliptic.ec(curveMap[v])\n const pubKey = ecdsa.recoverPubKey(\n dataBytes.asUint8Array(),\n { r: rBytes.asUint8Array(), s: sBytes.asUint8Array() },\n recoveryId.asNumber(),\n )\n\n const x = pubKey.getX().toArray('be')\n const y = pubKey.getY().toArray('be')\n return [Bytes(x, { length: 32 }), Bytes(y, { length: 32 })]\n}\n\n/** @internal */\nexport const ecdsaPkDecompress = (v: Ecdsa, a: StubBytesCompat): readonly [bytes<32>, bytes<32>] => {\n const bytesA = BytesCls.fromCompat(a)\n\n const ecdsa = new elliptic.ec(curveMap[v])\n const keyPair = ecdsa.keyFromPublic(bytesA.asUint8Array())\n const pubKey = keyPair.getPublic()\n\n const x = pubKey.getX().toArray('be')\n const y = pubKey.getY().toArray('be')\n return [Bytes(x, { length: 32 }), Bytes(y, { length: 32 })]\n}\n\n/** @internal */\nexport const vrfVerify = (_s: VrfVerify, _a: StubBytesCompat, _b: StubBytesCompat, _c: StubBytesCompat): readonly [bytes<64>, boolean] => {\n throw new NotImplementedError('vrfVerify')\n}\n\n/** @internal */\nexport const EllipticCurve = new Proxy({} as typeof op.EllipticCurve, {\n get: (_target, prop) => {\n throw new NotImplementedError(`EllipticCurve.${prop.toString()}`)\n },\n})\n\n/** @internal */\nexport const mimc = (_c: MimcConfigurations, _a: StubBytesCompat): bytes => {\n throw new NotImplementedError('mimc')\n}\n\n/** @internal */\nexport const falconVerify = (_a: StubBytesCompat, _b: StubBytesCompat, _c: StubBytesCompat): boolean => {\n throw new NotImplementedError('falconVerify')\n}\n\nconst curveMap = {\n [Ecdsa.Secp256k1]: 'secp256k1',\n [Ecdsa.Secp256r1]: 'p256',\n}\n","import type {\n Account as AccountType,\n Application as ApplicationType,\n bytes,\n gtxn,\n op,\n uint64,\n} from '@algorandfoundation/algorand-typescript'\nimport { lazyContext } from '../context-helpers/internal-context'\nimport { asMaybeUint64Cls, asUint64 } from '../util'\nimport { Bytes, Uint64, type StubUint64Compat } from './primitives'\nimport { Account } from './reference'\n\nconst resolveAppIndex = (appIdOrIndex: StubUint64Compat): uint64 => {\n const input = asUint64(appIdOrIndex)\n if (input >= 1001) {\n return input\n }\n const txn = lazyContext.activeGroup.activeTransaction as gtxn.ApplicationCallTxn\n return txn.apps(input).id\n}\n\n/** @internal */\nexport const getApp = (app: ApplicationType | StubUint64Compat): ApplicationType | undefined => {\n try {\n const appId = asMaybeUint64Cls(app)\n if (appId !== undefined) {\n return lazyContext.ledger.getApplication(resolveAppIndex(appId))\n }\n return app as ApplicationType\n } catch {\n return undefined\n }\n}\n\n/** @internal */\nexport const AppParams: typeof op.AppParams = {\n appApprovalProgram(a: ApplicationType | StubUint64Compat): readonly [bytes, boolean] {\n const app = getApp(a)\n return app === undefined ? [Bytes(), false] : [app.approvalProgram, true]\n },\n appClearStateProgram(a: ApplicationType | StubUint64Compat): readonly [bytes, boolean] {\n const app = getApp(a)\n return app === undefined ? [Bytes(), false] : [app.clearStateProgram, true]\n },\n appGlobalNumUint(a: ApplicationType | StubUint64Compat): readonly [uint64, boolean] {\n const app = getApp(a)\n return app === undefined ? [Uint64(0), false] : [app.globalNumUint, true]\n },\n appGlobalNumByteSlice(a: ApplicationType | StubUint64Compat): readonly [uint64, boolean] {\n const app = getApp(a)\n return app === undefined ? [Uint64(0), false] : [app.globalNumBytes, true]\n },\n appLocalNumUint(a: ApplicationType | StubUint64Compat): readonly [uint64, boolean] {\n const app = getApp(a)\n return app === undefined ? [Uint64(0), false] : [app.localNumUint, true]\n },\n appLocalNumByteSlice(a: ApplicationType | StubUint64Compat): readonly [uint64, boolean] {\n const app = getApp(a)\n return app === undefined ? [Uint64(0), false] : [app.localNumBytes, true]\n },\n appExtraProgramPages(a: ApplicationType | StubUint64Compat): readonly [uint64, boolean] {\n const app = getApp(a)\n return app === undefined ? [Uint64(0), false] : [app.extraProgramPages, true]\n },\n appCreator(a: ApplicationType | StubUint64Compat): readonly [AccountType, boolean] {\n const app = getApp(a)\n return app === undefined ? [Account(), false] : [app.creator, true]\n },\n appAddress(a: ApplicationType | StubUint64Compat): readonly [AccountType, boolean] {\n const app = getApp(a)\n return app === undefined ? [Account(), false] : [app.address, true]\n },\n appVersion: function (a: ApplicationType | uint64): readonly [uint64, boolean] {\n const app = getApp(a)\n return app === undefined ? [Uint64(0), false] : [app.version, true]\n },\n}\n","import type { Account as AccountType, Asset as AssetType, bytes, gtxn, op, uint64 } from '@algorandfoundation/algorand-typescript'\nimport { lazyContext } from '../context-helpers/internal-context'\nimport { asMaybeUint64Cls, asUint64 } from '../util'\nimport { Bytes, Uint64, type StubUint64Compat } from './primitives'\nimport { Account } from './reference'\n\nconst resolveAssetIndex = (assetIdOrIndex: StubUint64Compat): uint64 => {\n const input = asUint64(assetIdOrIndex)\n if (input >= 1001) {\n return input\n }\n const txn = lazyContext.activeGroup.activeTransaction as gtxn.ApplicationCallTxn\n return txn.assets(input).id\n}\n\n/** @internal */\nexport const getAsset = (asset: AssetType | StubUint64Compat): AssetType | undefined => {\n try {\n const assetId = asMaybeUint64Cls(asset)\n if (assetId !== undefined) {\n return lazyContext.ledger.getAsset(resolveAssetIndex(assetId))\n }\n return asset as AssetType\n } catch {\n return undefined\n }\n}\n\n/** @internal */\nexport const AssetParams: typeof op.AssetParams = {\n assetTotal(a: AssetType | StubUint64Compat): readonly [uint64, boolean] {\n const asset = getAsset(a)\n return asset === undefined ? [Uint64(0), false] : [asset.total, true]\n },\n assetDecimals(a: AssetType | StubUint64Compat): readonly [uint64, boolean] {\n const asset = getAsset(a)\n return asset === undefined ? [Uint64(0), false] : [asset.decimals, true]\n },\n assetDefaultFrozen(a: AssetType | StubUint64Compat): readonly [boolean, boolean] {\n const asset = getAsset(a)\n return asset === undefined ? [false, false] : [asset.defaultFrozen, true]\n },\n assetUnitName(a: AssetType | StubUint64Compat): readonly [bytes, boolean] {\n const asset = getAsset(a)\n return asset === undefined ? [Bytes(), false] : [asset.unitName, true]\n },\n assetName(a: AssetType | StubUint64Compat): readonly [bytes, boolean] {\n const asset = getAsset(a)\n return asset === undefined ? [Bytes(), false] : [asset.name, true]\n },\n assetUrl(a: AssetType | StubUint64Compat): readonly [bytes, boolean] {\n const asset = getAsset(a)\n return asset === undefined ? [Bytes(), false] : [asset.url, true]\n },\n assetMetadataHash(a: AssetType | StubUint64Compat): readonly [bytes<32>, boolean] {\n const asset = getAsset(a)\n return asset === undefined ? [Bytes() as bytes<32>, false] : [asset.metadataHash, true]\n },\n assetManager(a: AssetType | StubUint64Compat): readonly [AccountType, boolean] {\n const asset = getAsset(a)\n return asset === undefined ? [Account(), false] : [asset.manager, true]\n },\n assetReserve(a: AssetType | StubUint64Compat): readonly [AccountType, boolean] {\n const asset = getAsset(a)\n return asset === undefined ? [Account(), false] : [asset.reserve, true]\n },\n assetFreeze(a: AssetType | StubUint64Compat): readonly [AccountType, boolean] {\n const asset = getAsset(a)\n return asset === undefined ? [Account(), false] : [asset.freeze, true]\n },\n assetClawback(a: AssetType | StubUint64Compat): readonly [AccountType, boolean] {\n const asset = getAsset(a)\n return asset === undefined ? [Account(), false] : [asset.clawback, true]\n },\n assetCreator(a: AssetType | StubUint64Compat): readonly [AccountType, boolean] {\n const asset = getAsset(a)\n return asset === undefined ? [Account(), false] : [asset.creator, true]\n },\n}\n"],"names":["_Uint","_UFixed","_Byte","_Str","_Bool","_StaticArray","_Address","_DynamicArray","_Tuple","_Struct","_DynamicBytes","_StaticBytes","_ReferenceArray","_FixedArray","_ARC4Encoded"],"mapp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C;QACzB,OAAO,KAAK,KAAK,SAAS,GAAG,CAAC,OAAO,EAAE,EAAE,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC;IACzE,CAAC;AACD,IAAA,YAAY,CAAC,CAA+B,EAAA;AAC1C,QAAA,MAAM,KAAK,GAAG,QAAQ,CAAC,CAAC,CAAC;QACzB,OAAO,KAAK,KAAK,SAAS,GAAG,CAAC,OAAO,EAAE,EAAE,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC;IACzE,CAAC;AACD,IAAA,WAAW,CAAC,CAA+B,EAAA;AACzC,QAAA,MAAM,KAAK,GAAG,QAAQ,CAAC,CAAC,CAAC;QACzB,OAAO,KAAK,KAAK,SAAS,GAAG,CAAC,OAAO,EAAE,EAAE,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC;IACxE,CAAC;AACD,IAAA,aAAa,CAAC,CAA+B,EAAA;AAC3C,QAAA,MAAM,KAAK,GAAG,QAAQ,CAAC,CAAC,CAAC;QACzB,OAAO,KAAK,KAAK,SAAS,GAAG,CAAC,OAAO,EAAE,EAAE,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,QAAQ,EAAE,IAAI,CAAC;IAC1E,CAAC;AACD,IAAA,YAAY,CAAC,CAA+B,EAAA;AAC1C,QAAA,MAAM,KAAK,GAAG,QAAQ,CAAC,CAAC,CAAC;QACzB,OAAO,KAAK,KAAK,SAAS,GAAG,CAAC,OAAO,EAAE,EAAE,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC;IACzE,CAAC;;;;;"}
@@ -0,0 +1 @@
1
+ export {};
@@ -34,6 +34,9 @@ function clone(typeInfoString, value) {
34
34
  return encoder(bytes, typeInfo);
35
35
  }
36
36
 
37
+ /** @internal */
38
+ function validateEncoding(_value) { }
39
+
37
40
  /** @internal */
38
41
  function compile(artefact, options) {
39
42
  let app;
@@ -238,5 +241,5 @@ const itxn = {
238
241
  applicationCall,
239
242
  };
240
243
 
241
- export { TemplateVar, assert, assertMatch, clone, compile, emit, ensureBudget, gtxn, itxn, itxnCompose, log, match, urange };
244
+ export { TemplateVar, assert, assertMatch, clone, compile, emit, ensureBudget, gtxn, itxn, itxnCompose, log, match, urange, validateEncoding };
242
245
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../../src/impl/clone.ts","../../src/impl/compiled.ts","../../src/impl/log.ts","../../src/impl/emit.ts","../../src/impl/ensure-budget.ts","../../src/impl/match.ts","../../src/impl/template-var.ts","../../src/impl/urange.ts","../../src/impl/itxn-compose.ts","../../src/internal/index.ts"],"sourcesContent":["import { getEncoder, toBytes } from './encoded-types'\n\n/** @internal */\nexport function clone<T>(typeInfoString: string, value: T): T {\n if (value && typeof value === 'object' && 'copy' in value && typeof value.copy === 'function') {\n return value.copy() as T\n }\n const bytes = toBytes(value, typeInfoString)\n const typeInfo = JSON.parse(typeInfoString)\n const encoder = getEncoder(typeInfo)\n return encoder(bytes, typeInfo) as T\n}\n","import type {\n Account,\n BaseContract,\n CompileContractOptions,\n CompiledContract,\n CompiledLogicSig,\n CompileLogicSigOptions,\n LogicSig,\n} from '@algorandfoundation/algorand-typescript'\nimport { lazyContext } from '../context-helpers/internal-context'\nimport type { ConstructorFor } from '../typescript-helpers'\nimport type { ApplicationData } from './reference'\n\n/** @internal */\nexport function compile(\n artefact: ConstructorFor<BaseContract> | ConstructorFor<LogicSig>,\n options?: CompileContractOptions | CompileLogicSigOptions,\n): CompiledLogicSig | CompiledContract {\n let app: ApplicationData | undefined\n let account: Account | undefined\n const compiledAppEntry = lazyContext.value.getCompiledAppEntry(artefact as ConstructorFor<BaseContract>)\n const compiledLogicSigEntry = lazyContext.value.getCompiledLogicSigEntry(artefact as ConstructorFor<LogicSig>)\n if (compiledAppEntry !== undefined) {\n app = lazyContext.ledger.applicationDataMap.get(compiledAppEntry.value)\n }\n if (compiledLogicSigEntry !== undefined) {\n account = compiledLogicSigEntry.value\n }\n if (options?.templateVars) {\n Object.entries(options.templateVars).forEach(([key, value]) => {\n lazyContext.value.setTemplateVar(key, value, options.templateVarsPrefix)\n })\n }\n return new Proxy({} as CompiledLogicSig | CompiledContract, {\n get: (_target, prop) => {\n switch (prop) {\n case 'approvalProgram':\n return app?.application.approvalProgram ?? [lazyContext.any.bytes(10), lazyContext.any.bytes(10)]\n case 'clearStateProgram':\n return app?.application.clearStateProgram ?? [lazyContext.any.bytes(10), lazyContext.any.bytes(10)]\n case 'extraProgramPages':\n return (options as CompileContractOptions)?.extraProgramPages ?? app?.application.extraProgramPages ?? lazyContext.any.uint64()\n case 'globalUints':\n return (options as CompileContractOptions)?.globalUints ?? app?.application.globalNumUint ?? lazyContext.any.uint64()\n case 'globalBytes':\n return (options as CompileContractOptions)?.globalBytes ?? app?.application.globalNumBytes ?? lazyContext.any.uint64()\n case 'localUints':\n return (options as CompileContractOptions)?.localUints ?? app?.application.localNumUint ?? lazyContext.any.uint64()\n case 'localBytes':\n return (options as CompileContractOptions)?.localBytes ?? app?.application.localNumBytes ?? lazyContext.any.uint64()\n case 'account':\n return account ?? lazyContext.any.account()\n }\n },\n })\n}\n","import type { BytesBacked, StringCompat } from '@algorandfoundation/algorand-typescript'\nimport { lazyContext } from '../context-helpers/internal-context'\n\nimport { toBytes } from './encoded-types'\nimport type { StubBigUintCompat, StubBytesCompat, StubUint64Compat } from './primitives'\n\n/** @internal */\nexport function log(...args: Array<StubUint64Compat | StubBytesCompat | StubBigUintCompat | StringCompat | BytesBacked>): void {\n lazyContext.txn.appendLog(args.map((a) => toBytes(a)).reduce((left, right) => left.concat(right)))\n}\n","import { CodeError } from '../errors'\nimport type { DeliberateAny } from '../typescript-helpers'\nimport { sha512_256 } from './crypto'\nimport { getArc4Encoded, getArc4TypeName } from './encoded-types'\nimport { log } from './log'\n\n/** @internal */\nexport function emit<T>(typeInfoString: string, event: T | string, ...eventProps: unknown[]) {\n let eventData\n let eventName\n if (typeof event === 'string') {\n eventData = getArc4Encoded(eventProps)\n eventName = event\n const argTypes = getArc4TypeName((eventData as DeliberateAny).typeInfo)!\n if (eventName.indexOf('(') === -1) {\n eventName += argTypes\n } else if (event.indexOf(argTypes) === -1) {\n throw new CodeError(`Event signature ${event} does not match arg types ${argTypes}`)\n }\n } else {\n eventData = getArc4Encoded(event)\n const typeInfo = JSON.parse(typeInfoString)\n const argTypes = getArc4TypeName((eventData as DeliberateAny).typeInfo)!\n eventName = typeInfo.name.replace(/.*</, '').replace(/>.*/, '') + argTypes\n }\n\n const eventHash = sha512_256(eventName)\n log(eventHash.slice(0, 4).concat(eventData.bytes))\n}\n","import type { uint64 } from '@algorandfoundation/algorand-typescript'\nimport { OpUpFeeSource } from '@algorandfoundation/algorand-typescript'\n\n/** @internal */\nexport function ensureBudget(_budget: uint64, _feeSource: OpUpFeeSource = OpUpFeeSource.GroupCredit) {\n // ensureBudget function is emulated to be a no-op\n}\n","import type { assertMatch as _assertMatch, match as _match } from '@algorandfoundation/algorand-typescript'\nimport { ARC4Encoded } from '@algorandfoundation/algorand-typescript/arc4'\nimport type { DeliberateAny } from '../typescript-helpers'\nimport { asBytes, asMaybeBigUintCls, assert } from '../util'\nimport { BytesBackedCls, Uint64BackedCls } from './base'\nimport { FixedArray } from './encoded-types/encoded-types'\nimport type { StubBytesCompat, Uint64Cls } from './primitives'\nimport { BytesCls } from './primitives'\n\n/** @internal */\nexport const match: typeof _match = (subject, test): boolean => {\n if (Object.hasOwn(test, 'not')) {\n return !match(subject, (test as DeliberateAny).not)\n }\n const bigIntSubjectValue = getBigIntValue(subject)\n if (bigIntSubjectValue !== undefined) {\n const bigIntTestValue = getBigIntValue(test)\n if (bigIntTestValue !== undefined) {\n return bigIntSubjectValue === bigIntTestValue\n } else if (Object.hasOwn(test, 'lessThan')) {\n return bigIntSubjectValue < getBigIntValue((test as DeliberateAny).lessThan)!\n } else if (Object.hasOwn(test, 'greaterThan')) {\n return bigIntSubjectValue > getBigIntValue((test as DeliberateAny).greaterThan)!\n } else if (Object.hasOwn(test, 'lessThanEq')) {\n return bigIntSubjectValue <= getBigIntValue((test as DeliberateAny).lessThanEq)!\n } else if (Object.hasOwn(test, 'greaterThanEq')) {\n return bigIntSubjectValue >= getBigIntValue((test as DeliberateAny).greaterThanEq)!\n } else if (Object.hasOwn(test, 'between')) {\n const [start, end] = (test as DeliberateAny).between\n return bigIntSubjectValue >= getBigIntValue(start)! && bigIntSubjectValue <= getBigIntValue(end)!\n }\n } else if (subject instanceof BytesCls) {\n return subject.equals(asBytes(test as unknown as StubBytesCompat))\n } else if (typeof subject === 'string') {\n return subject === test\n } else if (subject instanceof BytesBackedCls) {\n return subject.bytes.equals((test as unknown as BytesBackedCls).bytes)\n } else if (subject instanceof Uint64BackedCls) {\n return match(\n getBigIntValue(subject.uint64 as unknown as Uint64Cls),\n getBigIntValue((test as unknown as Uint64BackedCls).uint64 as unknown as Uint64Cls),\n )\n } else if (test instanceof ARC4Encoded) {\n return (subject as unknown as ARC4Encoded).bytes.equals(test.bytes)\n } else if (Array.isArray(test)) {\n return (\n (subject as DeliberateAny).length === test.length &&\n test.map((x, i) => match((subject as DeliberateAny)[i], x as DeliberateAny)).every((x) => x)\n )\n } else if (test instanceof FixedArray) {\n return test.items.map((x, i) => match((subject as DeliberateAny[])[i], x as DeliberateAny)).every((x) => x)\n } else if (typeof test === 'object') {\n return Object.entries(test!)\n .map(([k, v]) => match((subject as DeliberateAny)[k], v as DeliberateAny))\n .every((x) => x)\n }\n return false\n}\n\n/** @internal */\nexport const assertMatch: typeof _assertMatch = (subject, test, message): void => {\n const isMatching = match(subject, test)\n assert(isMatching, message)\n}\n\nconst getBigIntValue = (x: unknown) => {\n return asMaybeBigUintCls(x)?.asBigInt()\n}\n","import { DEFAULT_TEMPLATE_VAR_PREFIX } from '../constants'\nimport { lazyContext } from '../context-helpers/internal-context'\nimport { CodeError } from '../errors'\n\n/** @internal */\nexport function TemplateVar<T>(variableName: string, prefix = DEFAULT_TEMPLATE_VAR_PREFIX): T {\n const key = prefix + variableName\n if (!Object.hasOwn(lazyContext.value.templateVars, key)) {\n throw new CodeError(`Template variable ${key} not found in test context!`)\n }\n return lazyContext.value.templateVars[prefix + variableName] as T\n}\n","import { asBigInt, asUint64 } from '../util'\nimport type { StubUint64Compat } from './primitives'\n\n/** @internal */\nexport function* urange(a: StubUint64Compat, b?: StubUint64Compat, c?: StubUint64Compat) {\n const start = b ? asBigInt(a) : BigInt(0)\n const end = b ? asBigInt(b) : asBigInt(a)\n const step = c ? asBigInt(c) : BigInt(1)\n let iterationCount = 0\n for (let i = start; i < end; i += step) {\n iterationCount++\n yield asUint64(i)\n }\n return iterationCount\n}\n","import type {\n ItxnCompose as _ItxnCompose,\n AnyTransactionComposeFields,\n ApplicationCallComposeFields,\n AssetConfigComposeFields,\n AssetFreezeComposeFields,\n AssetTransferComposeFields,\n ComposeItxnParams,\n Contract,\n KeyRegistrationComposeFields,\n PaymentComposeFields,\n} from '@algorandfoundation/algorand-typescript'\nimport type { TypedApplicationCallFields } from '@algorandfoundation/algorand-typescript/arc4'\nimport { lazyContext } from '../context-helpers/internal-context'\nimport type { DeliberateAny, InstanceMethod } from '../typescript-helpers'\nimport { getApplicationCallInnerTxnContext } from './c2c'\n\nclass ItxnCompose {\n begin(fields: PaymentComposeFields): void\n begin(fields: KeyRegistrationComposeFields): void\n begin(fields: AssetConfigComposeFields): void\n begin(fields: AssetTransferComposeFields): void\n begin(fields: AssetFreezeComposeFields): void\n begin(fields: ApplicationCallComposeFields): void\n begin(fields: AnyTransactionComposeFields): void\n begin(fields: ComposeItxnParams): void\n begin<TArgs extends DeliberateAny[]>(\n method: InstanceMethod<Contract, TArgs>,\n fields: TypedApplicationCallFields<TArgs>,\n contract?: Contract | { new (): Contract },\n ): void\n begin<TArgs extends DeliberateAny[]>(...args: unknown[]): void {\n lazyContext.txn.activeGroup.constructingItxnGroup.push(\n args.length === 1\n ? (args[0] as AnyTransactionComposeFields)\n : getApplicationCallInnerTxnContext(\n args[0] as InstanceMethod<Contract, TArgs>,\n args[1] as TypedApplicationCallFields<TArgs>,\n args[2] as Contract | { new (): Contract },\n ),\n )\n }\n\n next(fields: PaymentComposeFields): void\n next(fields: KeyRegistrationComposeFields): void\n next(fields: AssetConfigComposeFields): void\n next(fields: AssetTransferComposeFields): void\n next(fields: AssetFreezeComposeFields): void\n next(fields: ApplicationCallComposeFields): void\n next(fields: AnyTransactionComposeFields): void\n next(fields: ComposeItxnParams): void\n next<TArgs extends DeliberateAny[]>(_method: InstanceMethod<Contract, TArgs>, _fields: TypedApplicationCallFields<TArgs>): void\n next<TArgs extends DeliberateAny[]>(...args: unknown[]): void {\n lazyContext.txn.activeGroup.constructingItxnGroup.push(\n args.length === 1\n ? (args[0] as AnyTransactionComposeFields)\n : getApplicationCallInnerTxnContext(\n args[0] as InstanceMethod<Contract, TArgs>,\n args[1] as TypedApplicationCallFields<TArgs>,\n args[2] as Contract | { new (): Contract },\n ),\n )\n }\n\n submit(): void {\n lazyContext.txn.activeGroup.submitInnerTransactionGroup()\n }\n}\n\n/** @internal */\nexport const itxnCompose: _ItxnCompose = new ItxnCompose()\n","/** @internal */\nexport * from '@algorandfoundation/algorand-typescript'\n/** @internal */\nexport { BaseContract, contract } from '../impl/base-contract'\n/** @internal */\nexport { clone } from '../impl/clone'\n/** @internal */\nexport { compile } from '../impl/compiled'\n/** @internal */\nexport { abimethod, baremethod, Contract, readonly } from '../impl/contract'\n/** @internal */\nexport { emit } from '../impl/emit'\n/** @internal */\nexport { ensureBudget } from '../impl/ensure-budget'\n/** @internal */\nexport { Global } from '../impl/global'\n/** @internal */\nexport { log } from '../impl/log'\n/** @internal */\nexport { assertMatch, match } from '../impl/match'\n/** @internal */\nexport { BigUint, Bytes, Uint64 } from '../impl/primitives'\n/** @internal */\nexport { Account, Application, Asset } from '../impl/reference'\n/** @internal */\nexport { Box, BoxMap, GlobalState, LocalState } from '../impl/state'\n/** @internal */\nexport { TemplateVar } from '../impl/template-var'\n/** @internal */\nexport { Txn } from '../impl/txn'\n/** @internal */\nexport { urange } from '../impl/urange'\n/** @internal */\nexport { assert, err } from '../util'\n/** @internal */\nexport * as arc4 from './arc4'\n/** @internal */\nexport * as op from './op'\nimport {\n ApplicationCallTxn,\n AssetConfigTxn,\n AssetFreezeTxn,\n AssetTransferTxn,\n KeyRegistrationTxn,\n PaymentTxn,\n Transaction,\n} from '../impl/gtxn'\n/** @internal */\nexport const gtxn = {\n Transaction,\n PaymentTxn,\n KeyRegistrationTxn,\n AssetConfigTxn,\n AssetTransferTxn,\n AssetFreezeTxn,\n ApplicationCallTxn,\n}\n\nimport { applicationCall, assetConfig, assetFreeze, assetTransfer, keyRegistration, payment, submitGroup } from '../impl/inner-transactions'\n/** @internal */\nexport const itxn = {\n submitGroup,\n payment,\n keyRegistration,\n assetConfig,\n assetTransfer,\n assetFreeze,\n applicationCall,\n}\n\n/** @internal */\nexport { itxnCompose } from '../impl/itxn-compose'\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAEA;AACM,SAAU,KAAK,CAAI,cAAsB,EAAE,KAAQ,EAAA;AACvD,IAAA,IAAI,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,MAAM,IAAI,KAAK,IAAI,OAAO,KAAK,CAAC,IAAI,KAAK,UAAU,EAAE;AAC7F,QAAA,OAAO,KAAK,CAAC,IAAI,EAAO;IAC1B;IACA,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,EAAE,cAAc,CAAC;IAC5C,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC;AAC3C,IAAA,MAAM,OAAO,GAAG,UAAU,CAAC,QAAQ,CAAC;AACpC,IAAA,OAAO,OAAO,CAAC,KAAK,EAAE,QAAQ,CAAM;AACtC;;ACEA;AACM,SAAU,OAAO,CACrB,QAAiE,EACjE,OAAyD,EAAA;AAEzD,IAAA,IAAI,GAAgC;AACp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,QAAA,cAAc,EAAE;AAChB,QAAA,MAAM,QAAQ,CAAC,CAAC,CAAC;IACnB;AACA,IAAA,OAAO,cAAc;AACvB;;ACGA,MAAM,WAAW,CAAA;IAcf,KAAK,CAAgC,GAAG,IAAe,EAAA;AACrD,QAAA,WAAW,CAAC,GAAG,CAAC,WAAW,CAAC,qBAAqB,CAAC,IAAI,CACpD,IAAI,CAAC,MAAM,KAAK;AACd,cAAG,IAAI,CAAC,CAAC;AACT,cAAE,iCAAiC,CAC/B,IAAI,CAAC,CAAC,CAAoC,EAC1C,IAAI,CAAC,CAAC,CAAsC,EAC5C,IAAI,CAAC,CAAC,CAAoC,CAC3C,CACN;IACH;IAWA,IAAI,CAAgC,GAAG,IAAe,EAAA;AACpD,QAAA,WAAW,CAAC,GAAG,CAAC,WAAW,CAAC,qBAAqB,CAAC,IAAI,CACpD,IAAI,CAAC,MAAM,KAAK;AACd,cAAG,IAAI,CAAC,CAAC;AACT,cAAE,iCAAiC,CAC/B,IAAI,CAAC,CAAC,CAAoC,EAC1C,IAAI,CAAC,CAAC,CAAsC,EAC5C,IAAI,CAAC,CAAC,CAAoC,CAC3C,CACN;IACH;IAEA,MAAM,GAAA;AACJ,QAAA,WAAW,CAAC,GAAG,CAAC,WAAW,CAAC,2BAA2B,EAAE;IAC3D;AACD;AAED;AACO,MAAM,WAAW,GAAiB,IAAI,WAAW;;ACtExD;AA+CA;AACO,MAAM,IAAI,GAAG;IAClB,WAAW;IACX,UAAU;IACV,kBAAkB;IAClB,cAAc;IACd,gBAAgB;IAChB,cAAc;IACd,kBAAkB;;AAIpB;AACO,MAAM,IAAI,GAAG;IAClB,WAAW;IACX,OAAO;IACP,eAAe;IACf,WAAW;IACX,aAAa;IACb,WAAW;IACX,eAAe;;;;;"}
1
+ {"version":3,"file":"index.mjs","sources":["../../src/impl/clone.ts","../../src/impl/validate-encoding.ts","../../src/impl/compiled.ts","../../src/impl/log.ts","../../src/impl/emit.ts","../../src/impl/ensure-budget.ts","../../src/impl/match.ts","../../src/impl/template-var.ts","../../src/impl/urange.ts","../../src/impl/itxn-compose.ts","../../src/internal/index.ts"],"sourcesContent":["import { getEncoder, toBytes } from './encoded-types'\n\n/** @internal */\nexport function clone<T>(typeInfoString: string, value: T): T {\n if (value && typeof value === 'object' && 'copy' in value && typeof value.copy === 'function') {\n return value.copy() as T\n }\n const bytes = toBytes(value, typeInfoString)\n const typeInfo = JSON.parse(typeInfoString)\n const encoder = getEncoder(typeInfo)\n return encoder(bytes, typeInfo) as T\n}\n","/** @internal */\nexport function validateEncoding<T>(_value: T) {}\n","import type {\n Account,\n BaseContract,\n CompileContractOptions,\n CompiledContract,\n CompiledLogicSig,\n CompileLogicSigOptions,\n LogicSig,\n} from '@algorandfoundation/algorand-typescript'\nimport { lazyContext } from '../context-helpers/internal-context'\nimport type { ConstructorFor } from '../typescript-helpers'\nimport type { ApplicationData } from './reference'\n\n/** @internal */\nexport function compile(\n artefact: ConstructorFor<BaseContract> | ConstructorFor<LogicSig>,\n options?: CompileContractOptions | CompileLogicSigOptions,\n): CompiledLogicSig | CompiledContract {\n let app: ApplicationData | undefined\n let account: Account | undefined\n const compiledAppEntry = lazyContext.value.getCompiledAppEntry(artefact as ConstructorFor<BaseContract>)\n const compiledLogicSigEntry = lazyContext.value.getCompiledLogicSigEntry(artefact as ConstructorFor<LogicSig>)\n if (compiledAppEntry !== undefined) {\n app = lazyContext.ledger.applicationDataMap.get(compiledAppEntry.value)\n }\n if (compiledLogicSigEntry !== undefined) {\n account = compiledLogicSigEntry.value\n }\n if (options?.templateVars) {\n Object.entries(options.templateVars).forEach(([key, value]) => {\n lazyContext.value.setTemplateVar(key, value, options.templateVarsPrefix)\n })\n }\n return new Proxy({} as CompiledLogicSig | CompiledContract, {\n get: (_target, prop) => {\n switch (prop) {\n case 'approvalProgram':\n return app?.application.approvalProgram ?? [lazyContext.any.bytes(10), lazyContext.any.bytes(10)]\n case 'clearStateProgram':\n return app?.application.clearStateProgram ?? [lazyContext.any.bytes(10), lazyContext.any.bytes(10)]\n case 'extraProgramPages':\n return (options as CompileContractOptions)?.extraProgramPages ?? app?.application.extraProgramPages ?? lazyContext.any.uint64()\n case 'globalUints':\n return (options as CompileContractOptions)?.globalUints ?? app?.application.globalNumUint ?? lazyContext.any.uint64()\n case 'globalBytes':\n return (options as CompileContractOptions)?.globalBytes ?? app?.application.globalNumBytes ?? lazyContext.any.uint64()\n case 'localUints':\n return (options as CompileContractOptions)?.localUints ?? app?.application.localNumUint ?? lazyContext.any.uint64()\n case 'localBytes':\n return (options as CompileContractOptions)?.localBytes ?? app?.application.localNumBytes ?? lazyContext.any.uint64()\n case 'account':\n return account ?? lazyContext.any.account()\n }\n },\n })\n}\n","import type { BytesBacked, StringCompat } from '@algorandfoundation/algorand-typescript'\nimport { lazyContext } from '../context-helpers/internal-context'\n\nimport { toBytes } from './encoded-types'\nimport type { StubBigUintCompat, StubBytesCompat, StubUint64Compat } from './primitives'\n\n/** @internal */\nexport function log(...args: Array<StubUint64Compat | StubBytesCompat | StubBigUintCompat | StringCompat | BytesBacked>): void {\n lazyContext.txn.appendLog(args.map((a) => toBytes(a)).reduce((left, right) => left.concat(right)))\n}\n","import { CodeError } from '../errors'\nimport type { DeliberateAny } from '../typescript-helpers'\nimport { sha512_256 } from './crypto'\nimport { getArc4Encoded, getArc4TypeName } from './encoded-types'\nimport { log } from './log'\n\n/** @internal */\nexport function emit<T>(typeInfoString: string, event: T | string, ...eventProps: unknown[]) {\n let eventData\n let eventName\n if (typeof event === 'string') {\n eventData = getArc4Encoded(eventProps)\n eventName = event\n const argTypes = getArc4TypeName((eventData as DeliberateAny).typeInfo)!\n if (eventName.indexOf('(') === -1) {\n eventName += argTypes\n } else if (event.indexOf(argTypes) === -1) {\n throw new CodeError(`Event signature ${event} does not match arg types ${argTypes}`)\n }\n } else {\n eventData = getArc4Encoded(event)\n const typeInfo = JSON.parse(typeInfoString)\n const argTypes = getArc4TypeName((eventData as DeliberateAny).typeInfo)!\n eventName = typeInfo.name.replace(/.*</, '').replace(/>.*/, '') + argTypes\n }\n\n const eventHash = sha512_256(eventName)\n log(eventHash.slice(0, 4).concat(eventData.bytes))\n}\n","import type { uint64 } from '@algorandfoundation/algorand-typescript'\nimport { OpUpFeeSource } from '@algorandfoundation/algorand-typescript'\n\n/** @internal */\nexport function ensureBudget(_budget: uint64, _feeSource: OpUpFeeSource = OpUpFeeSource.GroupCredit) {\n // ensureBudget function is emulated to be a no-op\n}\n","import type { assertMatch as _assertMatch, match as _match } from '@algorandfoundation/algorand-typescript'\nimport { ARC4Encoded } from '@algorandfoundation/algorand-typescript/arc4'\nimport type { DeliberateAny } from '../typescript-helpers'\nimport { asBytes, asMaybeBigUintCls, assert } from '../util'\nimport { BytesBackedCls, Uint64BackedCls } from './base'\nimport { FixedArray } from './encoded-types/encoded-types'\nimport type { StubBytesCompat, Uint64Cls } from './primitives'\nimport { BytesCls } from './primitives'\n\n/** @internal */\nexport const match: typeof _match = (subject, test): boolean => {\n if (Object.hasOwn(test, 'not')) {\n return !match(subject, (test as DeliberateAny).not)\n }\n const bigIntSubjectValue = getBigIntValue(subject)\n if (bigIntSubjectValue !== undefined) {\n const bigIntTestValue = getBigIntValue(test)\n if (bigIntTestValue !== undefined) {\n return bigIntSubjectValue === bigIntTestValue\n } else if (Object.hasOwn(test, 'lessThan')) {\n return bigIntSubjectValue < getBigIntValue((test as DeliberateAny).lessThan)!\n } else if (Object.hasOwn(test, 'greaterThan')) {\n return bigIntSubjectValue > getBigIntValue((test as DeliberateAny).greaterThan)!\n } else if (Object.hasOwn(test, 'lessThanEq')) {\n return bigIntSubjectValue <= getBigIntValue((test as DeliberateAny).lessThanEq)!\n } else if (Object.hasOwn(test, 'greaterThanEq')) {\n return bigIntSubjectValue >= getBigIntValue((test as DeliberateAny).greaterThanEq)!\n } else if (Object.hasOwn(test, 'between')) {\n const [start, end] = (test as DeliberateAny).between\n return bigIntSubjectValue >= getBigIntValue(start)! && bigIntSubjectValue <= getBigIntValue(end)!\n }\n } else if (subject instanceof BytesCls) {\n return subject.equals(asBytes(test as unknown as StubBytesCompat))\n } else if (typeof subject === 'string') {\n return subject === test\n } else if (subject instanceof BytesBackedCls) {\n return subject.bytes.equals((test as unknown as BytesBackedCls).bytes)\n } else if (subject instanceof Uint64BackedCls) {\n return match(\n getBigIntValue(subject.uint64 as unknown as Uint64Cls),\n getBigIntValue((test as unknown as Uint64BackedCls).uint64 as unknown as Uint64Cls),\n )\n } else if (test instanceof ARC4Encoded) {\n return (subject as unknown as ARC4Encoded).bytes.equals(test.bytes)\n } else if (Array.isArray(test)) {\n return (\n (subject as DeliberateAny).length === test.length &&\n test.map((x, i) => match((subject as DeliberateAny)[i], x as DeliberateAny)).every((x) => x)\n )\n } else if (test instanceof FixedArray) {\n return test.items.map((x, i) => match((subject as DeliberateAny[])[i], x as DeliberateAny)).every((x) => x)\n } else if (typeof test === 'object') {\n return Object.entries(test!)\n .map(([k, v]) => match((subject as DeliberateAny)[k], v as DeliberateAny))\n .every((x) => x)\n }\n return false\n}\n\n/** @internal */\nexport const assertMatch: typeof _assertMatch = (subject, test, message): void => {\n const isMatching = match(subject, test)\n assert(isMatching, message)\n}\n\nconst getBigIntValue = (x: unknown) => {\n return asMaybeBigUintCls(x)?.asBigInt()\n}\n","import { DEFAULT_TEMPLATE_VAR_PREFIX } from '../constants'\nimport { lazyContext } from '../context-helpers/internal-context'\nimport { CodeError } from '../errors'\n\n/** @internal */\nexport function TemplateVar<T>(variableName: string, prefix = DEFAULT_TEMPLATE_VAR_PREFIX): T {\n const key = prefix + variableName\n if (!Object.hasOwn(lazyContext.value.templateVars, key)) {\n throw new CodeError(`Template variable ${key} not found in test context!`)\n }\n return lazyContext.value.templateVars[prefix + variableName] as T\n}\n","import { asBigInt, asUint64 } from '../util'\nimport type { StubUint64Compat } from './primitives'\n\n/** @internal */\nexport function* urange(a: StubUint64Compat, b?: StubUint64Compat, c?: StubUint64Compat) {\n const start = b ? asBigInt(a) : BigInt(0)\n const end = b ? asBigInt(b) : asBigInt(a)\n const step = c ? asBigInt(c) : BigInt(1)\n let iterationCount = 0\n for (let i = start; i < end; i += step) {\n iterationCount++\n yield asUint64(i)\n }\n return iterationCount\n}\n","import type {\n ItxnCompose as _ItxnCompose,\n AnyTransactionComposeFields,\n ApplicationCallComposeFields,\n AssetConfigComposeFields,\n AssetFreezeComposeFields,\n AssetTransferComposeFields,\n ComposeItxnParams,\n Contract,\n KeyRegistrationComposeFields,\n PaymentComposeFields,\n} from '@algorandfoundation/algorand-typescript'\nimport type { TypedApplicationCallFields } from '@algorandfoundation/algorand-typescript/arc4'\nimport { lazyContext } from '../context-helpers/internal-context'\nimport type { DeliberateAny, InstanceMethod } from '../typescript-helpers'\nimport { getApplicationCallInnerTxnContext } from './c2c'\n\nclass ItxnCompose {\n begin(fields: PaymentComposeFields): void\n begin(fields: KeyRegistrationComposeFields): void\n begin(fields: AssetConfigComposeFields): void\n begin(fields: AssetTransferComposeFields): void\n begin(fields: AssetFreezeComposeFields): void\n begin(fields: ApplicationCallComposeFields): void\n begin(fields: AnyTransactionComposeFields): void\n begin(fields: ComposeItxnParams): void\n begin<TArgs extends DeliberateAny[]>(\n method: InstanceMethod<Contract, TArgs>,\n fields: TypedApplicationCallFields<TArgs>,\n contract?: Contract | { new (): Contract },\n ): void\n begin<TArgs extends DeliberateAny[]>(...args: unknown[]): void {\n lazyContext.txn.activeGroup.constructingItxnGroup.push(\n args.length === 1\n ? (args[0] as AnyTransactionComposeFields)\n : getApplicationCallInnerTxnContext(\n args[0] as InstanceMethod<Contract, TArgs>,\n args[1] as TypedApplicationCallFields<TArgs>,\n args[2] as Contract | { new (): Contract },\n ),\n )\n }\n\n next(fields: PaymentComposeFields): void\n next(fields: KeyRegistrationComposeFields): void\n next(fields: AssetConfigComposeFields): void\n next(fields: AssetTransferComposeFields): void\n next(fields: AssetFreezeComposeFields): void\n next(fields: ApplicationCallComposeFields): void\n next(fields: AnyTransactionComposeFields): void\n next(fields: ComposeItxnParams): void\n next<TArgs extends DeliberateAny[]>(_method: InstanceMethod<Contract, TArgs>, _fields: TypedApplicationCallFields<TArgs>): void\n next<TArgs extends DeliberateAny[]>(...args: unknown[]): void {\n lazyContext.txn.activeGroup.constructingItxnGroup.push(\n args.length === 1\n ? (args[0] as AnyTransactionComposeFields)\n : getApplicationCallInnerTxnContext(\n args[0] as InstanceMethod<Contract, TArgs>,\n args[1] as TypedApplicationCallFields<TArgs>,\n args[2] as Contract | { new (): Contract },\n ),\n )\n }\n\n submit(): void {\n lazyContext.txn.activeGroup.submitInnerTransactionGroup()\n }\n}\n\n/** @internal */\nexport const itxnCompose: _ItxnCompose = new ItxnCompose()\n","/** @internal */\nexport * from '@algorandfoundation/algorand-typescript'\n/** @internal */\nexport { BaseContract, contract } from '../impl/base-contract'\n/** @internal */\nexport { clone } from '../impl/clone'\n/** @internal */\nexport { validateEncoding } from '../impl/validate-encoding'\n/** @internal */\nexport { compile } from '../impl/compiled'\n/** @internal */\nexport { abimethod, baremethod, Contract, readonly } from '../impl/contract'\n/** @internal */\nexport { emit } from '../impl/emit'\n/** @internal */\nexport { ensureBudget } from '../impl/ensure-budget'\n/** @internal */\nexport { Global } from '../impl/global'\n/** @internal */\nexport { log } from '../impl/log'\n/** @internal */\nexport { assertMatch, match } from '../impl/match'\n/** @internal */\nexport { BigUint, Bytes, Uint64 } from '../impl/primitives'\n/** @internal */\nexport { Account, Application, Asset } from '../impl/reference'\n/** @internal */\nexport { Box, BoxMap, GlobalState, LocalState } from '../impl/state'\n/** @internal */\nexport { TemplateVar } from '../impl/template-var'\n/** @internal */\nexport { Txn } from '../impl/txn'\n/** @internal */\nexport { urange } from '../impl/urange'\n/** @internal */\nexport { assert, err } from '../util'\n/** @internal */\nexport * as arc4 from './arc4'\n/** @internal */\nexport * as op from './op'\nimport {\n ApplicationCallTxn,\n AssetConfigTxn,\n AssetFreezeTxn,\n AssetTransferTxn,\n KeyRegistrationTxn,\n PaymentTxn,\n Transaction,\n} from '../impl/gtxn'\n/** @internal */\nexport const gtxn = {\n Transaction,\n PaymentTxn,\n KeyRegistrationTxn,\n AssetConfigTxn,\n AssetTransferTxn,\n AssetFreezeTxn,\n ApplicationCallTxn,\n}\n\nimport { applicationCall, assetConfig, assetFreeze, assetTransfer, keyRegistration, payment, submitGroup } from '../impl/inner-transactions'\n/** @internal */\nexport const itxn = {\n submitGroup,\n payment,\n keyRegistration,\n assetConfig,\n assetTransfer,\n assetFreeze,\n applicationCall,\n}\n\n/** @internal */\nexport { itxnCompose } from '../impl/itxn-compose'\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAEA;AACM,SAAU,KAAK,CAAI,cAAsB,EAAE,KAAQ,EAAA;AACvD,IAAA,IAAI,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,MAAM,IAAI,KAAK,IAAI,OAAO,KAAK,CAAC,IAAI,KAAK,UAAU,EAAE;AAC7F,QAAA,OAAO,KAAK,CAAC,IAAI,EAAO;IAC1B;IACA,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,EAAE,cAAc,CAAC;IAC5C,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC;AAC3C,IAAA,MAAM,OAAO,GAAG,UAAU,CAAC,QAAQ,CAAC;AACpC,IAAA,OAAO,OAAO,CAAC,KAAK,EAAE,QAAQ,CAAM;AACtC;;ACXA;AACM,SAAU,gBAAgB,CAAI,MAAS,IAAG;;ACYhD;AACM,SAAU,OAAO,CACrB,QAAiE,EACjE,OAAyD,EAAA;AAEzD,IAAA,IAAI,GAAgC;AACpC,IAAA,IAAI,OAA4B;IAChC,MAAM,gBAAgB,GAAG,WAAW,CAAC,KAAK,CAAC,mBAAmB,CAAC,QAAwC,CAAC;IACxG,MAAM,qBAAqB,GAAG,WAAW,CAAC,KAAK,CAAC,wBAAwB,CAAC,QAAoC,CAAC;AAC9G,IAAA,IAAI,gBAAgB,KAAK,SAAS,EAAE;AAClC,QAAA,GAAG,GAAG,WAAW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KAAK;AACd,cAAG,IAAI,CAAC,CAAC;AACT,cAAE,iCAAiC,CAC/B,IAAI,CAAC,CAAC,CAAoC,EAC1C,IAAI,CAAC,CAAC,CAAsC,EAC5C,IAAI,CAAC,CAAC,CAAoC,CAC3C,CACN;IACH;IAWA,IAAI,CAAgC,GAAG,IAAe,EAAA;AACpD,QAAA,WAAW,CAAC,GAAG,CAAC,WAAW,CAAC,qBAAqB,CAAC,IAAI,CACpD,IAAI,CAAC,MAAM,KAAK;AACd,cAAG,IAAI,CAAC,CAAC;AACT,cAAE,iCAAiC,CAC/B,IAAI,CAAC,CAAC,CAAoC,EAC1C,IAAI,CAAC,CAAC,CAAsC,EAC5C,IAAI,CAAC,CAAC,CAAoC,CAC3C,CACN;IACH;IAEA,MAAM,GAAA;AACJ,QAAA,WAAW,CAAC,GAAG,CAAC,WAAW,CAAC,2BAA2B,EAAE;IAC3D;AACD;AAED;AACO,MAAM,WAAW,GAAiB,IAAI,WAAW;;ACtExD;AAiDA;AACO,MAAM,IAAI,GAAG;IAClB,WAAW;IACX,UAAU;IACV,kBAAkB;IAClB,cAAc;IACd,gBAAgB;IAChB,cAAc;IACd,kBAAkB;;AAIpB;AACO,MAAM,IAAI,GAAG;IAClB,WAAW;IACX,OAAO;IACP,eAAe;IACf,WAAW;IACX,aAAa;IACb,WAAW;IACX,eAAe;;;;;"}
package/package.json CHANGED
@@ -4,12 +4,12 @@
4
4
  "**"
5
5
  ],
6
6
  "name": "@algorandfoundation/algorand-typescript-testing",
7
- "version": "1.0.0-alpha.39",
7
+ "version": "1.0.0-alpha.40",
8
8
  "description": "A library which allows you to execute Algorand TypeScript code locally under a test context either emulating or mocking AVM behaviour.",
9
9
  "private": false,
10
10
  "dependencies": {
11
- "@algorandfoundation/algorand-typescript": "1.0.0-alpha.87",
12
- "@algorandfoundation/puya-ts": "1.0.0-alpha.87",
11
+ "@algorandfoundation/algorand-typescript": "1.0.0-alpha.90",
12
+ "@algorandfoundation/puya-ts": "1.0.0-alpha.90",
13
13
  "elliptic": "^6.6.1",
14
14
  "js-sha256": "^0.11.0",
15
15
  "js-sha3": "^0.9.3",