@algorandfoundation/algorand-typescript 0.0.1-alpha.15 → 0.0.1-alpha.16

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.
@@ -3,20 +3,25 @@ import { Account } from '../reference';
3
3
  export type BitSize = 8 | 16 | 32 | 64 | 128 | 256 | 512;
4
4
  type NativeForArc4Int<N extends BitSize> = N extends 8 | 16 | 32 | 64 ? uint64 : biguint;
5
5
  type CompatForArc4Int<N extends BitSize> = N extends 8 | 16 | 32 | 64 ? Uint64Compat : BigUintCompat;
6
- declare abstract class AbiEncoded implements BytesBacked {
6
+ declare abstract class ARC4Encoded implements BytesBacked {
7
+ abstract __type?: string;
7
8
  get bytes(): bytes;
8
9
  equals(other: this): boolean;
9
10
  }
10
- export declare class Str extends AbiEncoded {
11
- constructor(s: StringCompat);
11
+ export declare class Str extends ARC4Encoded {
12
+ #private;
13
+ __type?: 'arc4.Str';
14
+ constructor(s?: StringCompat);
12
15
  get native(): string;
13
16
  }
14
- export declare class UintN<N extends BitSize> extends AbiEncoded {
17
+ export declare class UintN<N extends BitSize> extends ARC4Encoded {
18
+ __type?: `arc4.UintN<${N}>`;
15
19
  constructor(v?: CompatForArc4Int<N>);
16
20
  get native(): NativeForArc4Int<N>;
17
21
  }
18
- export declare class UFixedNxM<N extends BitSize, M extends number> {
19
- constructor(v: `${number}:${number}`, n?: N, m?: M);
22
+ export declare class UFixedNxM<N extends BitSize, M extends number> extends ARC4Encoded {
23
+ __type?: `arc4.UFixedNxM<${N}x${M}>`;
24
+ constructor(v: `${number}.${number}`, n?: N, m?: M);
20
25
  get native(): NativeForArc4Int<N>;
21
26
  }
22
27
  export declare class Byte extends UintN<8> {
@@ -24,10 +29,11 @@ export declare class Byte extends UintN<8> {
24
29
  }
25
30
  export declare class Bool {
26
31
  #private;
32
+ __type?: `arc4.Bool`;
27
33
  constructor(v?: boolean);
28
34
  get native(): boolean;
29
35
  }
30
- declare abstract class Arc4ReadonlyArray<TItem extends AbiEncoded> extends AbiEncoded {
36
+ declare abstract class Arc4ReadonlyArray<TItem extends ARC4Encoded> extends ARC4Encoded {
31
37
  protected items: TItem[];
32
38
  protected constructor(items: TItem[]);
33
39
  /**
@@ -58,7 +64,8 @@ declare abstract class Arc4ReadonlyArray<TItem extends AbiEncoded> extends AbiEn
58
64
  */
59
65
  [index: uint64]: TItem;
60
66
  }
61
- export declare class StaticArray<TItem extends AbiEncoded, TLength extends number> extends Arc4ReadonlyArray<TItem> {
67
+ export declare class StaticArray<TItem extends ARC4Encoded, TLength extends number> extends Arc4ReadonlyArray<TItem> {
68
+ __type?: `arc4.StaticArray<${TItem['__type']}, ${TLength}>`;
62
69
  constructor();
63
70
  constructor(...items: TItem[] & {
64
71
  length: TLength;
@@ -66,7 +73,8 @@ export declare class StaticArray<TItem extends AbiEncoded, TLength extends numbe
66
73
  constructor(...items: TItem[]);
67
74
  copy(): StaticArray<TItem, TLength>;
68
75
  }
69
- export declare class DynamicArray<TItem extends AbiEncoded> extends Arc4ReadonlyArray<TItem> {
76
+ export declare class DynamicArray<TItem extends ARC4Encoded> extends Arc4ReadonlyArray<TItem> {
77
+ __type?: `arc4.DynamicArray<${TItem['__type']}>`;
70
78
  constructor(...items: TItem[]);
71
79
  /**
72
80
  * Push a number of items into this array
@@ -79,15 +87,24 @@ export declare class DynamicArray<TItem extends AbiEncoded> extends Arc4Readonly
79
87
  pop(): TItem;
80
88
  copy(): DynamicArray<TItem>;
81
89
  }
82
- type ItemAt<TTuple extends unknown[], TIndex extends number> = undefined extends TTuple[TIndex] ? never : TTuple[TIndex];
83
- export declare class Tuple<TTuple extends unknown[]> {
90
+ type ExpandTupleType<T extends ARC4Encoded[]> = T extends [infer T1 extends ARC4Encoded, ...infer TRest extends ARC4Encoded[]] ? TRest extends [] ? `${T1['__type']}` : `${T1['__type']},${ExpandTupleType<TRest>}` : '';
91
+ export declare class Tuple<TTuple extends [ARC4Encoded, ...ARC4Encoded[]]> extends ARC4Encoded {
84
92
  #private;
93
+ __type?: `arc4.Tuple<${ExpandTupleType<TTuple>}>`;
85
94
  constructor(...items: TTuple);
86
- at<TIndex extends number>(index: TIndex): ItemAt<TTuple, TIndex>;
95
+ at<TIndex extends keyof TTuple>(index: TIndex): TTuple[TIndex];
96
+ get length(): TTuple['length'] & uint64;
87
97
  get native(): TTuple;
88
98
  }
89
99
  export declare class Address extends Arc4ReadonlyArray<Byte> {
100
+ __type?: `arc4.Address`;
90
101
  constructor(value?: Account | string | bytes);
91
102
  get native(): Account;
92
103
  }
104
+ type StructConstraint = Record<string, ARC4Encoded>;
105
+ declare class StructBase extends ARC4Encoded {
106
+ __type: string;
107
+ }
108
+ type StructConstructor = new <T extends StructConstraint>(initial: T) => StructBase & T;
109
+ export declare const Struct: StructConstructor;
93
110
  export {};
package/arc4/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- export { x as Address, v as Bool, t as Byte, C as Contract, D as DynamicArray, o as OnCompleteAction, w as StaticArray, S as Str, T as Tuple, s as UFixedNxM, r as UintN, g as abimethod, q as baremethod } from '../index-hpwu00-P.js';
1
+ export { x as Address, v as Bool, t as Byte, C as Contract, D as DynamicArray, o as OnCompleteAction, w as StaticArray, S as Str, y as Struct, T as Tuple, s as UFixedNxM, r as UintN, g as abimethod, q as baremethod } from '../index-DaaqFl7S.js';
2
2
  import '../execution-context-BznYSiE4.js';
3
3
  import 'node:buffer';
4
4
  import 'node:util';
@@ -627,7 +627,7 @@ function assert(condition, message) {
627
627
  }
628
628
  }
629
629
  function err(message) {
630
- throw new AvmError(message ?? 'Err');
630
+ throw new AvmError(message ?? 'err opcode executed');
631
631
  }
632
632
  function match(subject, test) {
633
633
  return true;
@@ -664,7 +664,7 @@ class BaseContract {
664
664
  }
665
665
  }
666
666
 
667
- class AbiEncoded {
667
+ class ARC4Encoded {
668
668
  get bytes() {
669
669
  throw new Error('todo');
670
670
  }
@@ -672,15 +672,19 @@ class AbiEncoded {
672
672
  return this.bytes.equals(other.bytes);
673
673
  }
674
674
  }
675
- class Str extends AbiEncoded {
675
+ class Str extends ARC4Encoded {
676
+ __type;
677
+ #value;
676
678
  constructor(s) {
677
679
  super();
680
+ this.#value = s ?? '';
678
681
  }
679
682
  get native() {
680
- throw new Error('TODO');
683
+ return this.#value;
681
684
  }
682
685
  }
683
- class UintN extends AbiEncoded {
686
+ class UintN extends ARC4Encoded {
687
+ __type;
684
688
  constructor(v) {
685
689
  super();
686
690
  }
@@ -688,8 +692,11 @@ class UintN extends AbiEncoded {
688
692
  throw new Error('TODO');
689
693
  }
690
694
  }
691
- class UFixedNxM {
692
- constructor(v, n, m) { }
695
+ class UFixedNxM extends ARC4Encoded {
696
+ __type;
697
+ constructor(v, n, m) {
698
+ super();
699
+ }
693
700
  get native() {
694
701
  throw new Error('TODO');
695
702
  }
@@ -700,6 +707,7 @@ class Byte extends UintN {
700
707
  }
701
708
  }
702
709
  class Bool {
710
+ __type;
703
711
  #v;
704
712
  constructor(v) {
705
713
  this.#v = v ?? false;
@@ -708,7 +716,7 @@ class Bool {
708
716
  return this.#v;
709
717
  }
710
718
  }
711
- class Arc4ReadonlyArray extends AbiEncoded {
719
+ class Arc4ReadonlyArray extends ARC4Encoded {
712
720
  items;
713
721
  constructor(items) {
714
722
  super();
@@ -777,6 +785,7 @@ class Arc4ReadonlyArray extends AbiEncoded {
777
785
  }
778
786
  }
779
787
  class StaticArray extends Arc4ReadonlyArray {
788
+ __type;
780
789
  constructor(...items) {
781
790
  super(items);
782
791
  }
@@ -785,6 +794,7 @@ class StaticArray extends Arc4ReadonlyArray {
785
794
  }
786
795
  }
787
796
  class DynamicArray extends Arc4ReadonlyArray {
797
+ __type;
788
798
  constructor(...items) {
789
799
  super(items);
790
800
  }
@@ -808,19 +818,25 @@ class DynamicArray extends Arc4ReadonlyArray {
808
818
  return new DynamicArray(...this.items);
809
819
  }
810
820
  }
811
- class Tuple {
821
+ class Tuple extends ARC4Encoded {
822
+ __type;
812
823
  #items;
813
824
  constructor(...items) {
825
+ super();
814
826
  this.#items = items;
815
827
  }
816
828
  at(index) {
817
- return (this.#items[index] ?? err('Index out of bounds'));
829
+ return this.#items[index] ?? err('Index out of bounds');
830
+ }
831
+ get length() {
832
+ return this.#items.length;
818
833
  }
819
834
  get native() {
820
835
  return this.#items;
821
836
  }
822
837
  }
823
838
  class Address extends Arc4ReadonlyArray {
839
+ __type;
824
840
  constructor(value) {
825
841
  let byteValues;
826
842
  if (value === undefined) {
@@ -843,6 +859,22 @@ class Address extends Arc4ReadonlyArray {
843
859
  return Account(Bytes(this.items.map((i) => i.native)));
844
860
  }
845
861
  }
862
+ class StructBase extends ARC4Encoded {
863
+ __type = 'arc4.Struct';
864
+ }
865
+ class StructImpl extends StructBase {
866
+ constructor(initial) {
867
+ super();
868
+ for (const [prop, val] of Object.entries(initial)) {
869
+ Object.defineProperty(this, prop, {
870
+ value: val,
871
+ writable: true,
872
+ enumerable: true,
873
+ });
874
+ }
875
+ }
876
+ }
877
+ const Struct = StructImpl;
846
878
 
847
879
  class Contract extends BaseContract {
848
880
  approvalProgram() {
@@ -885,6 +917,7 @@ var index = /*#__PURE__*/Object.freeze({
885
917
  get OnCompleteAction () { return OnCompleteAction; },
886
918
  StaticArray: StaticArray,
887
919
  Str: Str,
920
+ Struct: Struct,
888
921
  Tuple: Tuple,
889
922
  UFixedNxM: UFixedNxM,
890
923
  UintN: UintN,
@@ -892,5 +925,5 @@ var index = /*#__PURE__*/Object.freeze({
892
925
  baremethod: baremethod
893
926
  });
894
927
 
895
- export { Account as A, BaseContract as B, Contract as C, DynamicArray as D, OpUpFeeSource as O, Str as S, Tuple as T, Uint64 as U, errors as a, err as b, assert as c, assertMatch as d, encodingUtil as e, ensureBudget as f, abimethod as g, BigUint as h, index as i, Bytes as j, Asset as k, log as l, match as m, Application as n, OnCompleteAction as o, primitives as p, baremethod as q, UintN as r, UFixedNxM as s, Byte as t, urange as u, Bool as v, StaticArray as w, Address as x };
896
- //# sourceMappingURL=index-hpwu00-P.js.map
928
+ export { Account as A, BaseContract as B, Contract as C, DynamicArray as D, OpUpFeeSource as O, Str as S, Tuple as T, Uint64 as U, errors as a, err as b, assert as c, assertMatch as d, encodingUtil as e, ensureBudget as f, abimethod as g, BigUint as h, index as i, Bytes as j, Asset as k, log as l, match as m, Application as n, OnCompleteAction as o, primitives as p, baremethod as q, UintN as r, UFixedNxM as s, Byte as t, urange as u, Bool as v, StaticArray as w, Address as x, Struct as y };
929
+ //# sourceMappingURL=index-DaaqFl7S.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-DaaqFl7S.js","sources":["../src/impl/errors.ts","../src/impl/base-32.ts","../src/impl/encoding-util.ts","../src/impl/name-of-type.ts","../src/impl/primitives.ts","../src/primitives.ts","../src/util.ts","../src/reference.ts","../src/base-contract.ts","../src/arc4/encoded-types.ts","../src/arc4/index.ts"],"sourcesContent":["/**\n * Raised when an `err` op is encountered, or when the testing VM is asked to do something that would cause\n * the AVM to fail.\n */\nexport class AvmError extends Error {\n constructor(message: string) {\n super(message)\n }\n}\nexport function avmError(message: string): never {\n throw new AvmError(message)\n}\n\nexport function avmInvariant(condition: unknown, message: string): asserts condition {\n if (!condition) {\n throw new AvmError(message)\n }\n}\n/**\n * Raised when an assertion fails\n */\nexport class AssertError extends AvmError {\n constructor(message: string) {\n super(message)\n }\n}\n\n/**\n * Raised when testing code errors\n */\nexport class InternalError extends Error {\n constructor(message: string, options?: ErrorOptions) {\n super(message, options)\n }\n}\n\nexport function internalError(message: string): never {\n throw new InternalError(message)\n}\n\n/**\n * Raised when unsupported user code is encountered\n */\nexport class CodeError extends Error {\n constructor(message: string, options?: ErrorOptions) {\n super(message, options)\n }\n}\n\nexport function codeError(message: string): never {\n throw new CodeError(message)\n}\n","const BASE32_ALPHABET = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567'.split('')\n\nconst CHAR_TO_NUM = BASE32_ALPHABET.reduce((acc, cur, index) => ((acc[cur] = index), acc), {} as Record<string, number>)\n\nexport const base32ToUint8Array = (value: string): Uint8Array => {\n let allChars = value\n .split('')\n .filter((c) => c !== '=')\n .map((c) => {\n const cUpper = c.toUpperCase()\n if (cUpper in CHAR_TO_NUM) return CHAR_TO_NUM[cUpper]\n throw new Error(`Invalid base32 char ${c}`)\n })\n const bytes = new Array<number>()\n while (allChars.length) {\n const [a, b, c, d, e, f, g, h, ...rest] = allChars\n if (a === undefined || b === undefined) break\n bytes.push(((a << 3) | (b >>> 2)) & 255)\n if (c === undefined || d === undefined) break\n bytes.push(((b << 6) | (c << 1) | (d >>> 4)) & 255)\n if (e === undefined) break\n bytes.push(((d << 4) | (e >>> 1)) & 255)\n if (f === undefined || g === undefined) break\n bytes.push(((e << 7) | (f << 2) | (g >>> 3)) & 255)\n if (h === undefined) break\n bytes.push(((g << 5) | h) & 255)\n allChars = rest\n }\n return new Uint8Array(bytes)\n}\n\nexport const uint8ArrayToBase32 = (value: Uint8Array): string => {\n let allBytes = Array.from(value)\n let base32str = ''\n while (allBytes.length) {\n const [a, b, c, d, e, ...rest] = allBytes ?? [0, 0, 0, 0, 0]\n\n if (allBytes.length < 1) break\n base32str += BASE32_ALPHABET[a >>> 3]\n base32str += BASE32_ALPHABET[((a << 2) | ((b || 0) >>> 6)) & 31]\n if (allBytes.length < 2) break\n base32str += BASE32_ALPHABET[(b >>> 1) & 31]\n base32str += BASE32_ALPHABET[((b << 4) | (c >>> 4)) & 31]\n if (allBytes.length < 3) break\n base32str += BASE32_ALPHABET[((c << 1) | (d >>> 7)) & 31]\n if (allBytes.length < 4) break\n base32str += BASE32_ALPHABET[(d >>> 2) & 31]\n base32str += BASE32_ALPHABET[((d << 3) | (e >>> 5)) & 31]\n if (allBytes.length < 5) break\n base32str += BASE32_ALPHABET[e & 31]\n allBytes = rest\n }\n return base32str\n}\n","import { Buffer } from 'node:buffer'\nimport { TextDecoder } from 'node:util'\nimport { AvmError } from './errors'\n\nexport const uint8ArrayToBigInt = (v: Uint8Array): bigint => {\n // Assume big-endian\n return Array.from(v)\n .toReversed()\n .map((byte_value, i): bigint => BigInt(byte_value) << BigInt(i * 8))\n .reduce((a, b) => a + b, 0n)\n}\n\nexport const hexToUint8Array = (value: string): Uint8Array => {\n if (value.length % 2 !== 0) {\n // TODO: Verify AVM behaviour is to fail\n throw new AvmError('Hex string must have even number of characters')\n }\n return Uint8Array.from(Buffer.from(value, 'hex'))\n}\n\nexport const base64ToUint8Array = (value: string): Uint8Array => {\n return Uint8Array.from(Buffer.from(value, 'base64'))\n}\n\nexport const bigIntToUint8Array = (val: bigint, fixedSize: number | 'dynamic' = 'dynamic'): Uint8Array => {\n if (val === 0n && fixedSize === 'dynamic') {\n return new Uint8Array(0)\n }\n const maxBytes = fixedSize === 'dynamic' ? undefined : fixedSize\n\n let hex = val.toString(16)\n\n // Pad the hex with zeros so it matches the size in bytes\n if (fixedSize !== 'dynamic' && hex.length !== fixedSize * 2) {\n hex = hex.padStart(fixedSize * 2, '0')\n } else if (hex.length % 2 == 1) {\n // Pad to 'whole' byte\n hex = `0${hex}`\n }\n if (maxBytes && hex.length > maxBytes * 2) {\n throw new AvmError(`Cannot encode ${val} as ${maxBytes} bytes as it would overflow`)\n }\n const byteArray = new Uint8Array(hex.length / 2)\n for (let i = 0, j = 0; i < hex.length / 2; i++, j += 2) {\n byteArray[i] = parseInt(hex.slice(j, j + 2), 16)\n }\n return byteArray\n}\n\nexport const utf8ToUint8Array = (value: string): Uint8Array => {\n const encoder = new TextEncoder()\n return encoder.encode(value)\n}\n\nexport const uint8ArrayToUtf8 = (value: Uint8Array): string => {\n const decoder = new TextDecoder()\n return decoder.decode(value)\n}\n\nexport const uint8ArrayToHex = (value: Uint8Array): string => Buffer.from(value).toString('hex')\n\nexport const uint8ArrayToBase64 = (value: Uint8Array): string => Buffer.from(value).toString('base64')\n\nexport const uint8ArrayToBase64Url = (value: Uint8Array): string => Buffer.from(value).toString('base64url')\n\nexport { uint8ArrayToBase32 } from './base-32'\n","export const nameOfType = (x: unknown) => {\n if (typeof x === 'object') {\n if (x === null) return 'Null'\n if (x === undefined) return 'undefined'\n if ('constructor' in x) {\n return x.constructor.name\n }\n }\n return typeof x\n}\n","import type { biguint, BigUintCompat, bytes, BytesCompat, uint64, Uint64Compat } from '../index'\nimport { base32ToUint8Array } from './base-32'\nimport {\n base64ToUint8Array,\n bigIntToUint8Array,\n hexToUint8Array,\n uint8ArrayToBigInt,\n uint8ArrayToHex,\n uint8ArrayToUtf8,\n utf8ToUint8Array,\n} from './encoding-util'\nimport { avmError, AvmError, avmInvariant, internalError } from './errors'\nimport { nameOfType } from './name-of-type'\n\nconst MAX_UINT8 = 2 ** 8 - 1\nconst MAX_BYTES_SIZE = 4096\n\nexport type StubBigUintCompat = BigUintCompat | BigUintCls | Uint64Cls\nexport type StubBytesCompat = BytesCompat | BytesCls\nexport type StubUint64Compat = Uint64Compat | Uint64Cls\n\nexport function toExternalValue(val: uint64): bigint\nexport function toExternalValue(val: biguint): bigint\nexport function toExternalValue(val: bytes): Uint8Array\nexport function toExternalValue(val: string): string\nexport function toExternalValue(val: uint64 | biguint | bytes | string) {\n const instance = val as unknown\n if (instance instanceof BytesCls) return instance.asUint8Array()\n if (instance instanceof Uint64Cls) return instance.asBigInt()\n if (instance instanceof BigUintCls) return instance.asBigInt()\n if (typeof val === 'string') return val\n}\nexport const toBytes = (val: unknown): bytes => {\n if (val instanceof AlgoTsPrimitiveCls) return val.toBytes().asAlgoTs()\n\n switch (typeof val) {\n case 'string':\n return BytesCls.fromCompat(val).asAlgoTs()\n case 'bigint':\n return BigUintCls.fromCompat(val).toBytes().asAlgoTs()\n case 'number':\n return Uint64Cls.fromCompat(val).toBytes().asAlgoTs()\n default:\n internalError(`Unsupported arg type ${nameOfType(val)}`)\n }\n}\n\n/**\n * Convert a StubUint64Compat value into a 'number' if possible.\n * This value may be negative\n * @param v\n */\nexport const getNumber = (v: StubUint64Compat): number => {\n if (typeof v == 'boolean') return v ? 1 : 0\n if (typeof v == 'number') return v\n if (typeof v == 'bigint') {\n avmInvariant(\n v <= BigInt(Number.MAX_SAFE_INTEGER) && v >= BigInt(Number.MIN_SAFE_INTEGER),\n 'value cannot be safely converted to a number',\n )\n return Number(v)\n }\n if (v instanceof Uint64Cls) return v.asNumber()\n internalError(`Cannot convert ${v} to number`)\n}\n\nexport const getUint8Array = (v: StubBytesCompat): Uint8Array => {\n return BytesCls.fromCompat(v).asUint8Array()\n}\n\nexport const isBytes = (v: unknown): v is StubBytesCompat => {\n if (typeof v === 'string') return true\n if (v instanceof BytesCls) return true\n return v instanceof Uint8Array\n}\n\nexport const isUint64 = (v: unknown): v is StubUint64Compat => {\n if (typeof v == 'number') return true\n if (typeof v == 'bigint') return true\n return v instanceof Uint64Cls\n}\n\nexport const checkUint64 = (v: bigint): bigint => {\n const u64 = BigInt.asUintN(64, v)\n if (u64 !== v) throw new AvmError(`Uint64 overflow or underflow`)\n return u64\n}\nexport const checkBigUint = (v: bigint): bigint => {\n const uBig = BigInt.asUintN(64 * 8, v)\n if (uBig !== v) throw new AvmError(`BigUint overflow or underflow`)\n return uBig\n}\n\nexport const checkBytes = (v: Uint8Array): Uint8Array => {\n if (v.length > MAX_BYTES_SIZE) throw new AvmError(`Bytes length ${v.length} exceeds maximum length ${MAX_BYTES_SIZE}`)\n return v\n}\n\n/**\n * Verifies that an object is an instance of a type based on its name rather than reference equality.\n *\n * This is useful in scenarios where a module loader has loaded a module twice and hence two instances of a\n * type do not have reference equality on their constructors.\n * @param subject The object to check\n * @param typeCtor The ctor of the type\n */\nfunction isInstanceOfTypeByName(subject: unknown, typeCtor: { name: string }): boolean {\n if (subject === null || typeof subject !== 'object') return false\n\n let ctor = subject.constructor\n while (typeof ctor === 'function') {\n if (ctor.name === typeCtor.name) return true\n ctor = Object.getPrototypeOf(ctor)\n }\n return false\n}\n\nexport abstract class AlgoTsPrimitiveCls {\n static [Symbol.hasInstance](x: unknown): x is AlgoTsPrimitiveCls {\n return isInstanceOfTypeByName(x, AlgoTsPrimitiveCls)\n }\n\n abstract valueOf(): bigint | string\n abstract toBytes(): BytesCls\n}\n\nexport class Uint64Cls extends AlgoTsPrimitiveCls {\n readonly #value: bigint\n constructor(value: bigint | number | string) {\n super()\n this.#value = BigInt(value)\n checkUint64(this.#value)\n\n Object.defineProperty(this, 'uint64', {\n value: this.#value.toString(),\n writable: false,\n enumerable: true,\n })\n }\n static [Symbol.hasInstance](x: unknown): x is Uint64Cls {\n return isInstanceOfTypeByName(x, Uint64Cls)\n }\n static fromCompat(v: StubUint64Compat): Uint64Cls {\n if (typeof v == 'boolean') return new Uint64Cls(v ? 1n : 0n)\n if (typeof v == 'number') return new Uint64Cls(BigInt(v))\n if (typeof v == 'bigint') return new Uint64Cls(v)\n if (v instanceof Uint64Cls) return v\n internalError(`Cannot convert ${v} to uint64`)\n }\n\n valueOf(): bigint {\n return this.#value\n }\n\n toBytes(): BytesCls {\n return new BytesCls(bigIntToUint8Array(this.#value, 8))\n }\n\n asAlgoTs(): uint64 {\n return this as unknown as uint64\n }\n\n asBigInt(): bigint {\n return this.#value\n }\n asNumber(): number {\n if (this.#value > Number.MAX_SAFE_INTEGER) {\n throw new AvmError('value cannot be safely converted to a number')\n }\n return Number(this.#value)\n }\n}\n\nexport class BigUintCls extends AlgoTsPrimitiveCls {\n readonly #value: bigint\n constructor(value: bigint) {\n super()\n this.#value = value\n Object.defineProperty(this, 'biguint', {\n value: value.toString(),\n writable: false,\n enumerable: true,\n })\n }\n valueOf(): bigint {\n return this.#value\n }\n\n toBytes(): BytesCls {\n return new BytesCls(bigIntToUint8Array(this.#value))\n }\n\n asAlgoTs(): biguint {\n return this as unknown as biguint\n }\n\n asBigInt(): bigint {\n return this.#value\n }\n asNumber(): number {\n if (this.#value > Number.MAX_SAFE_INTEGER) {\n throw new AvmError('value cannot be safely converted to a number')\n }\n return Number(this.#value)\n }\n static [Symbol.hasInstance](x: unknown): x is BigUintCls {\n return isInstanceOfTypeByName(x, BigUintCls)\n }\n static fromCompat(v: StubBigUintCompat): BigUintCls {\n if (typeof v == 'boolean') return new BigUintCls(v ? 1n : 0n)\n if (typeof v == 'number') return new BigUintCls(BigInt(v))\n if (typeof v == 'bigint') return new BigUintCls(v)\n if (v instanceof Uint64Cls) return new BigUintCls(v.valueOf())\n if (v instanceof BytesCls) return v.toBigUint()\n if (v instanceof BigUintCls) return v\n internalError(`Cannot convert ${nameOfType(v)} to BigUint`)\n }\n}\n\nexport class BytesCls extends AlgoTsPrimitiveCls {\n readonly #v: Uint8Array\n constructor(v: Uint8Array) {\n super()\n this.#v = v\n checkBytes(this.#v)\n // Add an enumerable property for debugging code to show\n Object.defineProperty(this, 'bytes', {\n value: uint8ArrayToHex(this.#v),\n writable: false,\n enumerable: true,\n })\n }\n\n get length() {\n return new Uint64Cls(this.#v.length)\n }\n\n toBytes(): BytesCls {\n return this\n }\n\n at(i: StubUint64Compat): BytesCls {\n return new BytesCls(arrayUtil.arrayAt(this.#v, i))\n }\n\n slice(start: undefined | StubUint64Compat, end: undefined | StubUint64Compat): BytesCls {\n const sliced = arrayUtil.arraySlice(this.#v, start, end)\n return new BytesCls(sliced)\n }\n\n concat(other: StubBytesCompat): BytesCls {\n const otherArray = BytesCls.fromCompat(other).asUint8Array()\n const mergedArray = new Uint8Array(this.#v.length + otherArray.length)\n mergedArray.set(this.#v)\n mergedArray.set(otherArray, this.#v.length)\n return new BytesCls(mergedArray)\n }\n\n bitwiseAnd(other: StubBytesCompat): BytesCls {\n return this.bitwiseOp(other, (a, b) => a & b)\n }\n\n bitwiseOr(other: StubBytesCompat): BytesCls {\n return this.bitwiseOp(other, (a, b) => a | b)\n }\n\n bitwiseXor(other: StubBytesCompat): BytesCls {\n return this.bitwiseOp(other, (a, b) => a ^ b)\n }\n\n bitwiseInvert(): BytesCls {\n const result = new Uint8Array(this.#v.length)\n this.#v.forEach((v, i) => {\n result[i] = ~v & MAX_UINT8\n })\n return new BytesCls(result)\n }\n\n equals(other: StubBytesCompat): boolean {\n const otherArray = BytesCls.fromCompat(other).asUint8Array()\n if (this.#v.length !== otherArray.length) return false\n for (let i = 0; i < this.#v.length; i++) {\n if (this.#v[i] !== otherArray[i]) return false\n }\n return true\n }\n\n private bitwiseOp(other: StubBytesCompat, op: (a: number, b: number) => number): BytesCls {\n const otherArray = BytesCls.fromCompat(other).asUint8Array()\n const result = new Uint8Array(Math.max(this.#v.length, otherArray.length))\n for (let i = result.length - 1; i >= 0; i--) {\n const thisIndex = i - (result.length - this.#v.length)\n const otherIndex = i - (result.length - otherArray.length)\n result[i] = op(this.#v[thisIndex] ?? 0, otherArray[otherIndex] ?? 0)\n }\n return new BytesCls(result)\n }\n\n valueOf(): string {\n return uint8ArrayToHex(this.#v)\n }\n\n static [Symbol.hasInstance](x: unknown): x is BytesCls {\n return isInstanceOfTypeByName(x, BytesCls)\n }\n\n static fromCompat(v: StubBytesCompat | Uint8Array | undefined): BytesCls {\n if (v === undefined) return new BytesCls(new Uint8Array())\n if (typeof v === 'string') return new BytesCls(utf8ToUint8Array(v))\n if (v instanceof BytesCls) return v\n if (v instanceof Uint8Array) return new BytesCls(v)\n internalError(`Cannot convert ${nameOfType(v)} to bytes`)\n }\n\n static fromInterpolation(template: TemplateStringsArray, replacements: StubBytesCompat[]) {\n return template\n .flatMap((templateText, index) => {\n const replacement = replacements[index]\n if (replacement) {\n return [BytesCls.fromCompat(templateText), BytesCls.fromCompat(replacement)]\n }\n return [BytesCls.fromCompat(templateText)]\n })\n .reduce((a, b) => a.concat(b))\n }\n\n static fromHex(hex: string): BytesCls {\n return new BytesCls(hexToUint8Array(hex))\n }\n\n static fromBase64(b64: string): BytesCls {\n return new BytesCls(base64ToUint8Array(b64))\n }\n\n static fromBase32(b32: string): BytesCls {\n return new BytesCls(base32ToUint8Array(b32))\n }\n\n toUint64(): Uint64Cls {\n return new Uint64Cls(uint8ArrayToBigInt(this.#v))\n }\n\n toBigUint(): BigUintCls {\n return new BigUintCls(uint8ArrayToBigInt(this.#v))\n }\n\n toString(): string {\n return uint8ArrayToUtf8(this.#v)\n }\n\n asAlgoTs(): bytes {\n return this as unknown as bytes\n }\n\n asUint8Array(): Uint8Array {\n return this.#v\n }\n}\n\nexport const arrayUtil = new (class ArrayUtil {\n arrayAt(arrayLike: Uint8Array, index: StubUint64Compat): Uint8Array\n arrayAt<T>(arrayLike: T[], index: StubUint64Compat): T\n arrayAt<T>(arrayLike: T[] | Uint8Array, index: StubUint64Compat): T | Uint8Array\n arrayAt<T>(arrayLike: T[] | Uint8Array, index: StubUint64Compat): T | Uint8Array {\n const indexNum = getNumber(index)\n if (arrayLike instanceof Uint8Array) {\n const res = arrayLike.slice(indexNum, indexNum === -1 ? undefined : indexNum + 1)\n avmInvariant(res.length, 'Index out of bounds')\n return res\n }\n return arrayLike.at(indexNum) ?? avmError('Index out of bounds')\n }\n arraySlice(arrayLike: Uint8Array, start: undefined | StubUint64Compat, end: undefined | StubUint64Compat): Uint8Array\n arraySlice<T>(arrayLike: T[], start: undefined | StubUint64Compat, end: undefined | StubUint64Compat): T[]\n arraySlice<T>(arrayLike: T[] | Uint8Array, start: undefined | StubUint64Compat, end: undefined | StubUint64Compat): Uint8Array | T[]\n arraySlice<T>(arrayLike: T[] | Uint8Array, start: undefined | StubUint64Compat, end: undefined | StubUint64Compat) {\n const startNum = start === undefined ? undefined : getNumber(start)\n const endNum = end === undefined ? undefined : getNumber(end)\n if (arrayLike instanceof Uint8Array) {\n return arrayLike.slice(startNum, endNum)\n } else {\n return arrayLike.slice(startNum, endNum)\n }\n }\n})()\n","import { CodeError } from './impl/errors'\nimport { BigUintCls, BytesCls, getNumber, Uint64Cls } from './impl/primitives'\n\nexport type Uint64Compat = uint64 | bigint | boolean | number\nexport type BigUintCompat = bigint | bytes | number | boolean\nexport type StringCompat = string\nexport type BytesCompat = bytes | string\n\n/**\n * An unsigned integer of exactly 64 bits\n */\nexport type uint64 = {\n __type?: 'uint64'\n} & number\n\n/**\n * Create a uint64 from a bigint literal\n */\nexport function Uint64(v: bigint): uint64\n/**\n * Create a uint64 from a number literal\n */\nexport function Uint64(v: number): uint64\n/**\n * Create a uint64 from a boolean value. True is 1, False is 0\n */\nexport function Uint64(v: boolean): uint64\nexport function Uint64(v: Uint64Compat): uint64 {\n return Uint64Cls.fromCompat(v).asAlgoTs()\n}\n\n/**\n * An unsigned integer of up to 512 bits\n *\n * Stored as a big-endian variable byte array\n */\nexport type biguint = {\n __type?: 'biguint'\n} & bigint\n\n/**\n * Create a biguint from a bigint literal\n */\nexport function BigUint(v: bigint): biguint\n/**\n * Create a biguint from a boolean value (true = 1, false = 0)\n */\nexport function BigUint(v: boolean): biguint\n/**\n * Create a biguint from a uint64 value\n */\nexport function BigUint(v: uint64): biguint\n/**\n * Create a biguint from a number literal\n */\nexport function BigUint(v: number): biguint\n/**\n * Create a biguint from a byte array interpreted as a big-endian number\n */\nexport function BigUint(v: bytes): biguint\n/**\n * Create a biguint from a string literal containing the decimal digits\n */\nexport function BigUint(v: string): biguint\n/**\n * Create a biguint with the default value of 0\n */\nexport function BigUint(): biguint\nexport function BigUint(v?: BigUintCompat | string): biguint {\n if (typeof v === 'string') v = BigInt(v)\n else if (v === undefined) v = 0n\n return BigUintCls.fromCompat(v).asAlgoTs()\n}\n\nexport type bytes = {\n readonly length: uint64\n\n at(i: Uint64Compat): bytes\n\n concat(other: BytesCompat): bytes\n\n bitwiseAnd(other: BytesCompat): bytes\n\n bitwiseOr(other: BytesCompat): bytes\n\n bitwiseXor(other: BytesCompat): bytes\n\n bitwiseInvert(): bytes\n\n equals(other: BytesCompat): boolean\n\n slice(): bytes\n slice(start: Uint64Compat): bytes\n slice(start: Uint64Compat, end: Uint64Compat): bytes\n slice(start?: Uint64Compat, end?: Uint64Compat): bytes\n\n toString(): string\n}\n\n/**\n * Create a byte array from a string interpolation template and compatible replacements\n * @param value\n * @param replacements\n */\nexport function Bytes(value: TemplateStringsArray, ...replacements: BytesCompat[]): bytes\n/**\n * Create a byte array from a utf8 string\n */\nexport function Bytes(value: string): bytes\n/**\n * No op, returns the provided byte array.\n */\nexport function Bytes(value: bytes): bytes\n/**\n * Create a byte array from a biguint value encoded as a variable length big-endian number\n */\nexport function Bytes(value: biguint): bytes\n/**\n * Create a byte array from a uint64 value encoded as a fixed length 64-bit number\n */\nexport function Bytes(value: uint64): bytes\n/**\n * Create a byte array from an Iterable<uint64> where each item is interpreted as a single byte and must be between 0 and 255 inclusively\n */\nexport function Bytes(value: Iterable<uint64>): bytes\n/**\n * Create an empty byte array\n */\nexport function Bytes(): bytes\nexport function Bytes(\n value?: BytesCompat | TemplateStringsArray | biguint | uint64 | Iterable<number>,\n ...replacements: BytesCompat[]\n): bytes {\n if (isTemplateStringsArray(value)) {\n return BytesCls.fromInterpolation(value, replacements).asAlgoTs()\n } else if (typeof value === 'bigint' || value instanceof BigUintCls) {\n return BigUintCls.fromCompat(value).toBytes().asAlgoTs()\n } else if (typeof value === 'number' || value instanceof Uint64Cls) {\n return Uint64Cls.fromCompat(value).toBytes().asAlgoTs()\n } else if (typeof value === 'object' && Symbol.iterator in value) {\n const valueItems = Array.from(value).map((v) => getNumber(v))\n const invalidValue = valueItems.find((v) => v < 0 && v > 255)\n if (invalidValue) {\n throw new CodeError(`Cannot convert ${invalidValue} to a byte`)\n }\n return new BytesCls(new Uint8Array(value)).asAlgoTs()\n } else {\n return BytesCls.fromCompat(value).asAlgoTs()\n }\n}\n\n/**\n * Create a new bytes value from a hexadecimal encoded string\n * @param hex\n */\nBytes.fromHex = (hex: string): bytes => {\n return BytesCls.fromHex(hex).asAlgoTs()\n}\n/**\n * Create a new bytes value from a base 64 encoded string\n * @param b64\n */\nBytes.fromBase64 = (b64: string): bytes => {\n return BytesCls.fromBase64(b64).asAlgoTs()\n}\n\n/**\n * Create a new bytes value from a base 32 encoded string\n * @param b32\n */\nBytes.fromBase32 = (b32: string): bytes => {\n return BytesCls.fromBase32(b32).asAlgoTs()\n}\n\nfunction isTemplateStringsArray(v: unknown): v is TemplateStringsArray {\n return Boolean(v) && Array.isArray(v) && typeof v[0] === 'string'\n}\n\nexport interface BytesBacked {\n get bytes(): bytes\n}\n","import { ctxMgr } from './execution-context'\nimport { AssertError, AvmError } from './impl/errors'\nimport { toBytes } from './impl/primitives'\nimport { biguint, BigUintCompat, BytesBacked, BytesCompat, StringCompat, uint64, Uint64Compat } from './primitives'\n\nexport function log(...args: Array<Uint64Compat | BytesCompat | BigUintCompat | StringCompat | BytesBacked>): void {\n ctxMgr.instance.log(args.map(toBytes).reduce((left, right) => left.concat(right)))\n}\n\nexport function assert(condition: unknown, message?: string): asserts condition {\n if (!condition) {\n throw new AssertError(message ?? 'Assertion failed')\n }\n}\n\nexport function err(message?: string): never {\n throw new AvmError(message ?? 'err opcode executed')\n}\n\ntype NumericComparison<T> = T | { lessThan: T } | { greaterThan: T } | { greaterThanEq: T } | { lessThanEq: T } | { between: [T, T] }\n\ntype ComparisonFor<T> = T extends uint64 | biguint ? NumericComparison<T> : T\n\ntype MatchTest<T> = {\n [key in keyof T]?: ComparisonFor<T[key]>\n}\n\nexport function match<T>(subject: T, test: MatchTest<T>): boolean {\n return true\n}\nexport function assertMatch<T>(subject: T, test: MatchTest<T>, message?: string): boolean {\n return true\n}\n\nexport enum OpUpFeeSource {\n GroupCredit = 0,\n AppAccount = 1,\n Any = 2,\n}\n\nexport function ensureBudget(budget: uint64, feeSource: OpUpFeeSource = OpUpFeeSource.GroupCredit) {\n throw new Error('Not implemented')\n}\n\nexport function urange(stop: Uint64Compat): IterableIterator<uint64>\nexport function urange(start: Uint64Compat, stop: Uint64Compat): IterableIterator<uint64>\nexport function urange(start: Uint64Compat, stop: Uint64Compat, step: Uint64Compat): IterableIterator<uint64>\nexport function urange(a: Uint64Compat, b?: Uint64Compat, c?: Uint64Compat): IterableIterator<uint64> {\n throw new Error('Not implemented')\n}\n","import { ctxMgr } from './execution-context'\nimport { bytes, uint64 } from './primitives'\n\nexport type Account = {\n readonly bytes: bytes\n\n /**\n * Account balance in microalgos\n *\n * Account must be an available resource\n */\n readonly balance: uint64\n\n /**\n * Minimum required balance for account, in microalgos\n *\n * Account must be an available resource\n */\n readonly minBalance: uint64\n\n /**\n * Address the account is rekeyed to\n *\n * Account must be an available resource\n */\n readonly authAddress: Account\n\n /**\n * The total number of uint64 values allocated by this account in Global and Local States.\n *\n * Account must be an available resource\n */\n readonly totalNumUint: uint64\n\n /**\n * The total number of byte array values allocated by this account in Global and Local States.\n *\n * Account must be an available resource\n */\n readonly totalNumByteSlice: uint64\n\n /**\n * The number of extra app code pages used by this account.\n *\n * Account must be an available resource\n */\n readonly totalExtraAppPages: uint64\n\n /**\n * The number of existing apps created by this account.\n *\n * Account must be an available resource\n */\n readonly totalAppsCreated: uint64\n\n /**\n * The number of apps this account is opted into.\n *\n * Account must be an available resource\n */\n readonly totalAppsOptedIn: uint64\n\n /**\n * The number of existing ASAs created by this account.\n *\n * Account must be an available resource\n */\n readonly totalAssetsCreated: uint64\n\n /**\n * The numbers of ASAs held by this account (including ASAs this account created).\n *\n * Account must be an available resource\n */\n readonly totalAssets: uint64\n\n /**\n * The number of existing boxes created by this account's app.\n *\n * Account must be an available resource\n */\n readonly totalBoxes: uint64\n\n /**\n * The total number of bytes used by this account's app's box keys and values.\n *\n * Account must be an available resource\n */\n readonly totalBoxBytes: uint64\n\n /**\n * Returns true if this account is opted in to the specified Asset or Application.\n * Note: Account and Asset/Application must be an available resource\n *\n * @param assetOrApp\n */\n isOptedIn(assetOrApp: Asset | Application): boolean\n}\n\nexport function Account(): Account\nexport function Account(address: bytes): Account\nexport function Account(address?: bytes): Account {\n return ctxMgr.instance.account(address)\n}\n\nexport function Asset(): Asset\nexport function Asset(assetId: uint64): Asset\nexport function Asset(assetId?: uint64): Asset {\n return ctxMgr.instance.asset(assetId)\n}\n/**\n * An Asset on the Algorand network.\n */\nexport type Asset = {\n /**\n * Returns the id of the Asset\n */\n readonly id: uint64\n\n /**\n * Total number of units of this asset\n */\n readonly total: uint64\n\n /**\n * @see AssetParams.decimals\n */\n readonly decimals: uint64\n\n /**\n * Frozen by default or not\n */\n readonly defaultFrozen: boolean\n\n /**\n * Asset unit name\n */\n readonly unitName: bytes\n\n /**\n * Asset name\n */\n readonly name: bytes\n\n /**\n * URL with additional info about the asset\n */\n readonly url: bytes\n\n /**\n * Arbitrary commitment\n */\n readonly metadataHash: bytes\n\n /**\n * Manager address\n */\n readonly manager: Account\n\n /**\n * Reserve address\n */\n readonly reserve: Account\n\n /**\n * Freeze address\n */\n readonly freeze: Account\n\n /**\n * Clawback address\n */\n readonly clawback: Account\n\n /**\n * Creator address\n */\n readonly creator: Account\n\n /**\n * Amount of the asset unit held by this account. Fails if the account has not\n * opted in to the asset.\n * Asset and supplied Account must be an available resource\n * @param account Account\n * @return balance: uint64\n */\n balance(account: Account): uint64\n\n /**\n * Is the asset frozen or not. Fails if the account has not\n * opted in to the asset.\n * Asset and supplied Account must be an available resource\n * @param account Account\n * @return isFrozen: boolean\n */\n frozen(account: Account): boolean\n}\n\nexport function Application(): Application\nexport function Application(applicationId: uint64): Application\nexport function Application(applicationId?: uint64): Application {\n return ctxMgr.instance.application(applicationId)\n}\n\n/**\n * An Application on the Algorand network.\n */\nexport type Application = {\n /**\n * The id of this application on the current network\n */\n readonly id: uint64\n /**\n * Bytecode of Approval Program\n */\n readonly approvalProgram: bytes\n\n /**\n * Bytecode of Clear State Program\n */\n readonly clearStateProgram: bytes\n\n /**\n * Number of uint64 values allowed in Global State\n */\n readonly globalNumUint: uint64\n\n /**\n * Number of byte array values allowed in Global State\n */\n readonly globalNumBytes: uint64\n\n /**\n * Number of uint64 values allowed in Local State\n */\n readonly localNumUint: uint64\n\n /**\n * Number of byte array values allowed in Local State\n */\n readonly localNumBytes: uint64\n\n /**\n * Number of Extra Program Pages of code space\n */\n readonly extraProgramPages: uint64\n\n /**\n * Creator address\n */\n readonly creator: Account\n\n /**\n * Address for which this application has authority\n */\n readonly address: Account\n}\n","import { uint64 } from './primitives'\n\nexport abstract class BaseContract {\n public abstract approvalProgram(): boolean | uint64\n public clearStateProgram(): boolean | uint64 {\n return true\n }\n}\n","import { avmError, avmInvariant } from '../impl/errors'\nimport { arrayUtil, BytesCls, getNumber, getUint8Array, isBytes, isUint64 } from '../impl/primitives'\nimport { biguint, BigUintCompat, Bytes, bytes, BytesBacked, StringCompat, Uint64, uint64, Uint64Compat } from '../primitives'\nimport { Account } from '../reference'\nimport { err } from '../util'\n\nexport type BitSize = 8 | 16 | 32 | 64 | 128 | 256 | 512\ntype NativeForArc4Int<N extends BitSize> = N extends 8 | 16 | 32 | 64 ? uint64 : biguint\ntype CompatForArc4Int<N extends BitSize> = N extends 8 | 16 | 32 | 64 ? Uint64Compat : BigUintCompat\n\nabstract class ARC4Encoded implements BytesBacked {\n abstract __type?: string\n get bytes(): bytes {\n throw new Error('todo')\n }\n\n equals(other: this): boolean {\n return this.bytes.equals(other.bytes)\n }\n}\n\nexport class Str extends ARC4Encoded {\n __type?: 'arc4.Str'\n #value: string\n constructor(s?: StringCompat) {\n super()\n this.#value = s ?? ''\n }\n get native(): string {\n return this.#value\n }\n}\nexport class UintN<N extends BitSize> extends ARC4Encoded {\n __type?: `arc4.UintN<${N}>`\n\n constructor(v?: CompatForArc4Int<N>) {\n super()\n }\n get native(): NativeForArc4Int<N> {\n throw new Error('TODO')\n }\n}\nexport class UFixedNxM<N extends BitSize, M extends number> extends ARC4Encoded {\n __type?: `arc4.UFixedNxM<${N}x${M}>`\n constructor(v: `${number}.${number}`, n?: N, m?: M) {\n super()\n }\n\n get native(): NativeForArc4Int<N> {\n throw new Error('TODO')\n }\n}\n\nexport class Byte extends UintN<8> {\n constructor(v?: Uint64Compat) {\n super(v)\n }\n}\nexport class Bool {\n __type?: `arc4.Bool`\n #v: boolean\n constructor(v?: boolean) {\n this.#v = v ?? false\n }\n\n get native(): boolean {\n return this.#v\n }\n}\n\nabstract class Arc4ReadonlyArray<TItem extends ARC4Encoded> extends ARC4Encoded {\n protected items: TItem[]\n protected constructor(items: TItem[]) {\n super()\n this.items = items.slice()\n return new Proxy(this, {\n get(target, prop) {\n if (isUint64(prop)) {\n const idx = getNumber(prop)\n if (idx < target.items.length) return target.items[idx]\n avmError('Index out of bounds')\n }\n return Reflect.get(target, prop)\n },\n set(target, prop, value) {\n if (isUint64(prop)) {\n const idx = getNumber(prop)\n if (idx < target.items.length) {\n target.items[idx] = value\n return true\n }\n avmError('Index out of bounds')\n }\n avmError('Property is not writable')\n },\n })\n }\n\n /**\n * Returns the current length of this array\n */\n get length(): uint64 {\n return Uint64(this.items.length)\n }\n\n /**\n * Returns the item at the given index.\n * Negative indexes are taken from the end.\n * @param index The index of the item to retrieve\n */\n at(index: Uint64Compat): TItem {\n return arrayUtil.arrayAt(this.items, index)\n }\n\n /** @internal\n * Create a new Dynamic array with all items from this array\n */\n slice(): DynamicArray<TItem>\n /** @internal\n * Create a new DynamicArray with all items up till `end`.\n * Negative indexes are taken from the end.\n * @param end An index in which to stop copying items.\n */\n slice(end: Uint64Compat): DynamicArray<TItem>\n /** @internal\n * Create a new DynamicArray with items from `start`, up until `end`\n * Negative indexes are taken from the end.\n * @param start An index in which to start copying items.\n * @param end An index in which to stop copying items\n */\n slice(start: Uint64Compat, end: Uint64Compat): DynamicArray<TItem>\n slice(start?: Uint64Compat, end?: Uint64Compat): DynamicArray<TItem> {\n return new DynamicArray(...arrayUtil.arraySlice(this.items, start, end))\n }\n\n /**\n * Returns an iterator for the items in this array\n */\n [Symbol.iterator](): IterableIterator<TItem> {\n return this.items[Symbol.iterator]()\n }\n\n /**\n * Returns an iterator for a tuple of the indexes and items in this array\n */\n *entries(): IterableIterator<readonly [uint64, TItem]> {\n for (const [idx, item] of this.items.entries()) {\n yield [Uint64(idx), item]\n }\n }\n\n /**\n * Returns an iterator for the indexes in this array\n */\n *keys(): IterableIterator<uint64> {\n for (const idx of this.items.keys()) {\n yield Uint64(idx)\n }\n }\n\n /**\n * Get or set the item at the specified index.\n * Negative indexes are not supported\n */\n [index: uint64]: TItem\n}\n\nexport class StaticArray<TItem extends ARC4Encoded, TLength extends number> extends Arc4ReadonlyArray<TItem> {\n __type?: `arc4.StaticArray<${TItem['__type']}, ${TLength}>`\n constructor()\n constructor(...items: TItem[] & { length: TLength })\n constructor(...items: TItem[])\n constructor(...items: TItem[] & { length: TLength }) {\n super(items)\n }\n\n copy(): StaticArray<TItem, TLength> {\n return new StaticArray<TItem, TLength>(...this.items)\n }\n}\n\nexport class DynamicArray<TItem extends ARC4Encoded> extends Arc4ReadonlyArray<TItem> {\n __type?: `arc4.DynamicArray<${TItem['__type']}>`\n constructor(...items: TItem[]) {\n super(items)\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.items.push(...items)\n }\n\n /**\n * Pop a single item from this array\n */\n pop(): TItem {\n const item = this.items.pop()\n if (item === undefined) avmError('The array is empty')\n return item\n }\n\n copy(): DynamicArray<TItem> {\n return new DynamicArray<TItem>(...this.items)\n }\n}\ntype ExpandTupleType<T extends ARC4Encoded[]> = T extends [infer T1 extends ARC4Encoded, ...infer TRest extends ARC4Encoded[]]\n ? TRest extends []\n ? `${T1['__type']}`\n : `${T1['__type']},${ExpandTupleType<TRest>}`\n : ''\n\nexport class Tuple<TTuple extends [ARC4Encoded, ...ARC4Encoded[]]> extends ARC4Encoded {\n __type?: `arc4.Tuple<${ExpandTupleType<TTuple>}>`\n #items: TTuple\n constructor(...items: TTuple) {\n super()\n this.#items = items\n }\n\n at<TIndex extends keyof TTuple>(index: TIndex): TTuple[TIndex] {\n return this.#items[index] ?? err('Index out of bounds')\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\nexport class Address extends Arc4ReadonlyArray<Byte> {\n __type?: `arc4.Address`\n constructor(value?: Account | string | bytes) {\n let byteValues: Uint8Array\n if (value === undefined) {\n byteValues = new Uint8Array(32)\n } else if (typeof value === 'string') {\n // Interpret as base 32\n byteValues = BytesCls.fromBase32(value).asUint8Array()\n } else if (isBytes(value)) {\n byteValues = getUint8Array(value)\n } else {\n byteValues = getUint8Array(value.bytes)\n }\n avmInvariant(byteValues.length === 32, 'Addresses should be 32 bytes')\n super(Array.from(byteValues).map((b) => new Byte(b)))\n }\n\n get native(): Account {\n return Account(Bytes(this.items.map((i) => i.native)))\n }\n}\n\ntype StructConstraint = Record<string, ARC4Encoded>\n\nclass StructBase extends ARC4Encoded {\n __type = 'arc4.Struct'\n}\nclass StructImpl<T extends StructConstraint> extends StructBase {\n constructor(initial: T) {\n super()\n for (const [prop, val] of Object.entries(initial)) {\n Object.defineProperty(this, prop, {\n value: val,\n writable: true,\n enumerable: true,\n })\n }\n }\n}\n\ntype StructConstructor = new <T extends StructConstraint>(initial: T) => StructBase & T\n\nexport const Struct = StructImpl as StructConstructor\n","import { BaseContract } from '../base-contract'\nimport { ctxMgr } from '../execution-context'\nimport { Uint64 } from '../primitives'\nimport { DeliberateAny } from '../typescript-helpers'\n\nexport * from './encoded-types'\n\nexport class Contract extends BaseContract {\n override approvalProgram(): boolean {\n return true\n }\n}\n\nexport type CreateOptions = 'allow' | 'disallow' | 'require'\nexport type OnCompleteActionStr = 'NoOp' | 'OptIn' | 'ClearState' | 'CloseOut' | 'UpdateApplication' | 'DeleteApplication'\n\nexport enum OnCompleteAction {\n NoOp = Uint64(0),\n OptIn = Uint64(1),\n CloseOut = Uint64(2),\n ClearState = Uint64(3),\n UpdateApplication = Uint64(4),\n DeleteApplication = Uint64(5),\n}\n\nexport type DefaultArgument<TContract extends Contract> = { constant: string | boolean | number | bigint } | { from: keyof TContract }\nexport type AbiMethodConfig<TContract extends Contract> = {\n /**\n * Which on complete action(s) are allowed when invoking this method.\n * @default 'NoOp'\n */\n allowActions?: OnCompleteActionStr | OnCompleteActionStr[]\n /**\n * Whether this method should be callable when creating the application.\n * @default 'disallow'\n */\n onCreate?: CreateOptions\n /**\n * Does the method only perform read operations (no mutation of chain state)\n * @default false\n */\n readonly?: boolean\n /**\n * Override the name used to generate the abi method selector\n */\n name?: string\n\n defaultArguments?: Record<string, DefaultArgument<TContract>>\n}\nexport function abimethod<TContract extends Contract>(config?: AbiMethodConfig<TContract>) {\n return function <TArgs extends DeliberateAny[], TReturn>(\n target: (this: TContract, ...args: TArgs) => TReturn,\n ctx: ClassMethodDecoratorContext<TContract>,\n ): (this: TContract, ...args: TArgs) => TReturn {\n ctx.addInitializer(function () {\n ctxMgr.instance.abiMetadata.captureMethodConfig(this, target.name, config)\n })\n return target\n }\n}\n\nexport type BareMethodConfig = {\n /**\n * Which on complete action(s) are allowed when invoking this method.\n * @default 'NoOp'\n */\n allowActions?: OnCompleteActionStr | OnCompleteActionStr[]\n /**\n * Whether this method should be callable when creating the application.\n * @default 'disallow'\n */\n onCreate?: CreateOptions\n}\nexport function baremethod<TContract extends Contract>(config?: BareMethodConfig) {\n return function <TArgs extends DeliberateAny[], TReturn>(\n target: (this: TContract, ...args: TArgs) => TReturn,\n ctx: ClassMethodDecoratorContext<TContract>,\n ): (this: TContract, ...args: TArgs) => TReturn {\n ctx.addInitializer(function () {\n ctxMgr.instance.abiMetadata.captureMethodConfig(this, target.name, config)\n })\n return target\n }\n}\n"],"names":[],"mappings":";;;;AAAA;;;AAGG;AACG,MAAO,QAAS,SAAQ,KAAK,CAAA;AACjC,IAAA,WAAA,CAAY,OAAe,EAAA;QACzB,KAAK,CAAC,OAAO,CAAC,CAAA;KACf;AACF,CAAA;AACK,SAAU,QAAQ,CAAC,OAAe,EAAA;AACtC,IAAA,MAAM,IAAI,QAAQ,CAAC,OAAO,CAAC,CAAA;AAC7B,CAAC;AAEe,SAAA,YAAY,CAAC,SAAkB,EAAE,OAAe,EAAA;IAC9D,IAAI,CAAC,SAAS,EAAE;AACd,QAAA,MAAM,IAAI,QAAQ,CAAC,OAAO,CAAC,CAAA;KAC5B;AACH,CAAC;AACD;;AAEG;AACG,MAAO,WAAY,SAAQ,QAAQ,CAAA;AACvC,IAAA,WAAA,CAAY,OAAe,EAAA;QACzB,KAAK,CAAC,OAAO,CAAC,CAAA;KACf;AACF,CAAA;AAED;;AAEG;AACG,MAAO,aAAc,S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AO,UACL,MAAoD,EACpD,GAA2C,EAAA;QAE3C,GAAG,CAAC,cAAc,CAAC,YAAA;AACjB,YAAA,MAAM,CAAC,QAAQ,CAAC,WAAW,CAAC,mBAAmB,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,CAAA;AAC5E,SAAC,CAAC,CAAA;AACF,QAAA,OAAO,MAAM,CAAA;AACf,KAAC,CAAA;AACH,CAAC;AAcK,SAAU,UAAU,CAA6B,MAAyB,EAAA;IAC9E,OAAO,UACL,MAAoD,EACpD,GAA2C,EAAA;QAE3C,GAAG,CAAC,cAAc,CAAC,YAAA;AACjB,YAAA,MAAM,CAAC,QAAQ,CAAC,WAAW,CAAC,mBAAmB,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,CAAA;AAC5E,SAAC,CAAC,CAAA;AACF,QAAA,OAAO,MAAM,CAAA;AACf,KAAC,CAAA;AACH;;;;;;;;;;;;;;;;;;;;;;"}
package/index.d.ts CHANGED
@@ -12,3 +12,6 @@ export * from './state';
12
12
  export * as itxn from './itxn';
13
13
  export * as gtxn from './gtxn';
14
14
  export { TransactionType } from './transactions';
15
+ export { LogicSig } from './logic-sig';
16
+ export { TemplateVar } from './template-var';
17
+ export { Base64, Ec, Ecdsa, VrfVerify } from './op-types';
package/index.mjs CHANGED
@@ -1,11 +1,40 @@
1
- import { e as encodingUtil, a as errors, p as primitives } from './index-hpwu00-P.js';
2
- export { A as Account, n as Application, k as Asset, B as BaseContract, h as BigUint, j as Bytes, C as Contract, O as OpUpFeeSource, U as Uint64, g as abimethod, i as arc4, c as assert, d as assertMatch, f as ensureBudget, b as err, l as log, m as match, u as urange } from './index-hpwu00-P.js';
3
- import { o as opTypes } from './op-plv5yuzk.js';
4
- export { G as Global, T as Txn, a as op } from './op-plv5yuzk.js';
1
+ import { e as encodingUtil, a as errors, p as primitives } from './index-DaaqFl7S.js';
2
+ export { A as Account, n as Application, k as Asset, B as BaseContract, h as BigUint, j as Bytes, C as Contract, O as OpUpFeeSource, U as Uint64, g as abimethod, i as arc4, c as assert, d as assertMatch, f as ensureBudget, b as err, l as log, m as match, u as urange } from './index-DaaqFl7S.js';
3
+ export { G as Global, T as Txn, o as op } from './op-COyMsFkC.js';
5
4
  import { c as ctxMgr } from './execution-context-BznYSiE4.js';
6
5
  import 'node:buffer';
7
6
  import 'node:util';
8
7
 
8
+ var Base64;
9
+ (function (Base64) {
10
+ Base64["URLEncoding"] = "URLEncoding";
11
+ Base64["StdEncoding"] = "StdEncoding";
12
+ })(Base64 || (Base64 = {}));
13
+ var Ec;
14
+ (function (Ec) {
15
+ Ec["BN254g1"] = "BN254g1";
16
+ Ec["BN254g2"] = "BN254g2";
17
+ Ec["BLS12_381g1"] = "BLS12_381g1";
18
+ Ec["BLS12_381g2"] = "BLS12_381g2";
19
+ })(Ec || (Ec = {}));
20
+ var Ecdsa;
21
+ (function (Ecdsa) {
22
+ Ecdsa["Secp256k1"] = "Secp256k1";
23
+ Ecdsa["Secp256r1"] = "Secp256r1";
24
+ })(Ecdsa || (Ecdsa = {}));
25
+ var VrfVerify;
26
+ (function (VrfVerify) {
27
+ VrfVerify["VrfAlgorand"] = "VrfAlgorand";
28
+ })(VrfVerify || (VrfVerify = {}));
29
+
30
+ var opTypes = /*#__PURE__*/Object.freeze({
31
+ __proto__: null,
32
+ get Base64 () { return Base64; },
33
+ get Ec () { return Ec; },
34
+ get Ecdsa () { return Ecdsa; },
35
+ get VrfVerify () { return VrfVerify; }
36
+ });
37
+
9
38
  var internal = /*#__PURE__*/Object.freeze({
10
39
  __proto__: null,
11
40
  ctxMgr: ctxMgr,
@@ -131,5 +160,12 @@ var TransactionType;
131
160
  TransactionType[TransactionType["ApplicationCall"] = 6] = "ApplicationCall";
132
161
  })(TransactionType || (TransactionType = {}));
133
162
 
134
- export { Box, BoxMap, BoxRef, GlobalState, LocalState, TransactionType, gtxn, internal, itxn };
163
+ class LogicSig {
164
+ }
165
+
166
+ function TemplateVar(variableName, prefix = 'TMPL_') {
167
+ throw new Error('TODO');
168
+ }
169
+
170
+ export { Base64, Box, BoxMap, BoxRef, Ec, Ecdsa, GlobalState, LocalState, LogicSig, TemplateVar, TransactionType, VrfVerify, gtxn, internal, itxn };
135
171
  //# sourceMappingURL=index.mjs.map