@algorandfoundation/algorand-typescript 1.0.0-beta.17 → 1.0.0-beta.18
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/arc4/encoded-types.d.ts +20 -0
- package/arc4/index.mjs +1 -1
- package/{index-Bb3pKUmT.js → index-DLHfNF70.js} +29 -1
- package/index-DLHfNF70.js.map +1 -0
- package/index.mjs +1 -1
- package/index.mjs.map +1 -1
- package/itxn.d.ts +1 -1
- package/logic-sig.d.ts +12 -0
- package/mutable-array.d.ts +0 -17
- package/package.json +1 -1
- package/index-Bb3pKUmT.js.map +0 -1
package/arc4/encoded-types.d.ts
CHANGED
@@ -83,6 +83,11 @@ export declare class StaticArray<TItem extends ARC4Encoded, TLength extends numb
|
|
83
83
|
});
|
84
84
|
constructor(...items: TItem[]);
|
85
85
|
copy(): StaticArray<TItem, TLength>;
|
86
|
+
/**
|
87
|
+
* Returns a new array containing all items from _this_ array, and _other_ array
|
88
|
+
* @param other Another array to concat with this one
|
89
|
+
*/
|
90
|
+
concat(other: Arc4ReadonlyArray<TItem>): DynamicArray<TItem>;
|
86
91
|
}
|
87
92
|
export declare class DynamicArray<TItem extends ARC4Encoded> extends Arc4ReadonlyArray<TItem> {
|
88
93
|
[TypeProperty]?: `arc4.DynamicArray<${TItem[typeof TypeProperty]}>`;
|
@@ -97,6 +102,11 @@ export declare class DynamicArray<TItem extends ARC4Encoded> extends Arc4Readonl
|
|
97
102
|
*/
|
98
103
|
pop(): TItem;
|
99
104
|
copy(): DynamicArray<TItem>;
|
105
|
+
/**
|
106
|
+
* Returns a new array containing all items from _this_ array, and _other_ array
|
107
|
+
* @param other Another array to concat with this one
|
108
|
+
*/
|
109
|
+
concat(other: Arc4ReadonlyArray<TItem>): DynamicArray<TItem>;
|
100
110
|
}
|
101
111
|
type ExpandTupleType<T extends ARC4Encoded[]> = T extends [infer T1 extends ARC4Encoded, ...infer TRest extends ARC4Encoded[]] ? TRest extends [] ? `${T1[typeof TypeProperty]}` : `${T1[typeof TypeProperty]},${ExpandTupleType<TRest>}` : '';
|
102
112
|
export declare class Tuple<TTuple extends [ARC4Encoded, ...ARC4Encoded[]]> extends ARC4Encoded {
|
@@ -121,11 +131,21 @@ export declare class DynamicBytes extends Arc4ReadonlyArray<Byte> {
|
|
121
131
|
[TypeProperty]?: `arc4.DynamicBytes`;
|
122
132
|
constructor(value?: bytes | string);
|
123
133
|
get native(): bytes;
|
134
|
+
/**
|
135
|
+
* Returns a dynamic bytes object containing all bytes from _this_ and _other_
|
136
|
+
* @param other Another array of bytes to concat with this one
|
137
|
+
*/
|
138
|
+
concat(other: Arc4ReadonlyArray<Byte>): DynamicBytes;
|
124
139
|
}
|
125
140
|
export declare class StaticBytes<TLength extends number = 0> extends Arc4ReadonlyArray<Byte> {
|
126
141
|
[TypeProperty]?: `arc4.StaticBytes<${TLength}>`;
|
127
142
|
constructor(value?: bytes | string);
|
128
143
|
get native(): bytes;
|
144
|
+
/**
|
145
|
+
* Returns a dynamic bytes object containing all bytes from _this_ and _other_
|
146
|
+
* @param other Another array of bytes to concat with this one
|
147
|
+
*/
|
148
|
+
concat(other: Arc4ReadonlyArray<Byte>): DynamicBytes;
|
129
149
|
}
|
130
150
|
/**
|
131
151
|
* Interpret the provided bytes as an ARC4 encoded type with no validation
|
package/arc4/index.mjs
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
export { A as ARC4Encoded, p as Address, n as Bool, d as Byte, C as Contract, D as DynamicArray, r as DynamicBytes, O as OnCompleteAction, o as StaticArray, s as StaticBytes, S as Str, q as Struct, T as Tuple, l as UFixedNxM, U as UintN, j as UintN128, f as UintN16, k as UintN256, g as UintN32, h as UintN64, e as UintN8, a as abimethod, b as baremethod, u as decodeArc4, v as encodeArc4, t as interpretAsArc4, m as methodSelector } from '../index-
|
1
|
+
export { A as ARC4Encoded, p as Address, n as Bool, d as Byte, C as Contract, D as DynamicArray, r as DynamicBytes, O as OnCompleteAction, o as StaticArray, s as StaticBytes, S as Str, q as Struct, T as Tuple, l as UFixedNxM, U as UintN, j as UintN128, f as UintN16, k as UintN256, g as UintN32, h as UintN64, e as UintN8, a as abimethod, b as baremethod, u as decodeArc4, v as encodeArc4, t as interpretAsArc4, m as methodSelector } from '../index-DLHfNF70.js';
|
2
2
|
import '../errors-D124-zqo.js';
|
3
3
|
//# sourceMappingURL=index.mjs.map
|
@@ -121,6 +121,13 @@ class StaticArray extends Arc4ReadonlyArray {
|
|
121
121
|
copy() {
|
122
122
|
throw new NoImplementation();
|
123
123
|
}
|
124
|
+
/**
|
125
|
+
* Returns a new array containing all items from _this_ array, and _other_ array
|
126
|
+
* @param other Another array to concat with this one
|
127
|
+
*/
|
128
|
+
concat(other) {
|
129
|
+
throw new NoImplementation();
|
130
|
+
}
|
124
131
|
}
|
125
132
|
class DynamicArray extends Arc4ReadonlyArray {
|
126
133
|
[TypeProperty];
|
@@ -143,6 +150,13 @@ class DynamicArray extends Arc4ReadonlyArray {
|
|
143
150
|
copy() {
|
144
151
|
throw new NoImplementation();
|
145
152
|
}
|
153
|
+
/**
|
154
|
+
* Returns a new array containing all items from _this_ array, and _other_ array
|
155
|
+
* @param other Another array to concat with this one
|
156
|
+
*/
|
157
|
+
concat(other) {
|
158
|
+
throw new NoImplementation();
|
159
|
+
}
|
146
160
|
}
|
147
161
|
class Tuple extends ARC4Encoded {
|
148
162
|
[TypeProperty];
|
@@ -192,6 +206,13 @@ class DynamicBytes extends Arc4ReadonlyArray {
|
|
192
206
|
get native() {
|
193
207
|
throw new NoImplementation();
|
194
208
|
}
|
209
|
+
/**
|
210
|
+
* Returns a dynamic bytes object containing all bytes from _this_ and _other_
|
211
|
+
* @param other Another array of bytes to concat with this one
|
212
|
+
*/
|
213
|
+
concat(other) {
|
214
|
+
throw new NoImplementation();
|
215
|
+
}
|
195
216
|
}
|
196
217
|
class StaticBytes extends Arc4ReadonlyArray {
|
197
218
|
[TypeProperty];
|
@@ -201,6 +222,13 @@ class StaticBytes extends Arc4ReadonlyArray {
|
|
201
222
|
get native() {
|
202
223
|
throw new NoImplementation();
|
203
224
|
}
|
225
|
+
/**
|
226
|
+
* Returns a dynamic bytes object containing all bytes from _this_ and _other_
|
227
|
+
* @param other Another array of bytes to concat with this one
|
228
|
+
*/
|
229
|
+
concat(other) {
|
230
|
+
throw new NoImplementation();
|
231
|
+
}
|
204
232
|
}
|
205
233
|
/**
|
206
234
|
* Interpret the provided bytes as an ARC4 encoded type with no validation
|
@@ -300,4 +328,4 @@ var index = /*#__PURE__*/Object.freeze({
|
|
300
328
|
});
|
301
329
|
|
302
330
|
export { ARC4Encoded as A, BaseContract as B, Contract as C, DynamicArray as D, OnCompleteAction as O, Str as S, Tuple as T, UintN as U, abimethod as a, baremethod as b, contract as c, Byte as d, UintN8 as e, UintN16 as f, UintN32 as g, UintN64 as h, index as i, UintN128 as j, UintN256 as k, UFixedNxM as l, methodSelector as m, Bool as n, StaticArray as o, Address as p, Struct as q, DynamicBytes as r, StaticBytes as s, interpretAsArc4 as t, decodeArc4 as u, encodeArc4 as v };
|
303
|
-
//# sourceMappingURL=index-
|
331
|
+
//# sourceMappingURL=index-DLHfNF70.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index-DLHfNF70.js","sources":["../src/base-contract.ts","../src/arc4/encoded-types.ts","../src/arc4/index.ts"],"sourcesContent":["import { NoImplementation } from './internal/errors'\nimport { ConstructorFor } from './internal/typescript-helpers'\nimport { uint64 } from './primitives'\nimport { NumberRange } from './util'\n\nexport abstract class BaseContract {\n public abstract approvalProgram(): boolean | uint64\n public clearStateProgram(): boolean | uint64 {\n return true\n }\n}\n\n/**\n * Options class to manually define the total amount of global and local state contract will use.\n *\n * This is not required when all state is assigned to `this.`, but is required if a\n * contract dynamically interacts with state via `AppGlobal.getBytes` etc, or if you want\n * to reserve additional state storage for future contract updates, since the Algorand protocol\n * doesn't allow increasing them after creation.\n */\nexport type StateTotals = {\n globalUints?: number\n globalBytes?: number\n localUints?: number\n localBytes?: number\n}\n\nexport type ContractOptions = {\n /**\n * Determines which AVM version to use, this affects what operations are supported.\n * Defaults to value provided supplied on command line (which defaults to current mainnet version)\n */\n avmVersion?: 10 | 11\n\n /**\n * Override the name of the logic signature when generating build artifacts.\n * Defaults to the class name\n */\n name?: string\n /**\n * Allows you to mark a slot ID or range of slot IDs as \"off limits\" to Puya.\n * These slot ID(s) will never be written to or otherwise manipulating by the compiler itself.\n * This is particularly useful in combination with `op.gload_bytes` / `op.gload_uint64`\n * which lets a contract in a group transaction read from the scratch slots of another contract\n * that occurs earlier in the transaction group.\n *\n * In the case of inheritance, scratch slots reserved become cumulative. It is not an error\n * to have overlapping ranges or values either, so if a base class contract reserves slots\n * 0-5 inclusive and the derived contract reserves 5-10 inclusive, then within the derived\n * contract all slots 0-10 will be marked as reserved.\n */\n scratchSlots?: Array<number | NumberRange>\n /**\n * Allows defining what values should be used for global and local uint and bytes storage\n * values when creating a contract. Used when outputting ARC-32 application.json schemas.\n *\n * If left unspecified, the totals will be determined by the compiler based on state\n * variables assigned to `this`.\n *\n * This setting is not inherited, and only applies to the exact `Contract` it is specified\n * on. If a base class does specify this setting, and a derived class does not, a warning\n * will be emitted for the derived class. To resolve this warning, `stateTotals` must be\n * specified. An empty object may be provided in order to indicate that this contract should\n * revert to the default behaviour\n */\n stateTotals?: StateTotals\n}\n\n/**\n * The contract decorator can be used to specify additional configuration options for a smart contract\n * @param options An object containing the configuration options\n */\nexport function contract(options: ContractOptions) {\n return <T extends ConstructorFor<BaseContract>>(contract: T, ctx: ClassDecoratorContext) => {\n throw new NoImplementation()\n }\n}\n","import { NoImplementation } from '../internal/errors'\nimport { biguint, BigUintCompat, bytes, BytesBacked, BytesCompat, StringCompat, uint64, Uint64Compat } from '../primitives'\nimport { Account } from '../reference'\n\ntype UintBitSize = 8 | 16 | 24 | 32 | 40 | 48 | 56 | 64\ntype BigUintBitSize =\n | 72\n | 80\n | 88\n | 96\n | 104\n | 112\n | 120\n | 128\n | 136\n | 144\n | 152\n | 160\n | 168\n | 176\n | 184\n | 192\n | 200\n | 208\n | 216\n | 224\n | 232\n | 240\n | 248\n | 256\n | 264\n | 272\n | 280\n | 288\n | 296\n | 304\n | 312\n | 320\n | 328\n | 336\n | 344\n | 352\n | 360\n | 368\n | 376\n | 384\n | 392\n | 400\n | 408\n | 416\n | 424\n | 432\n | 440\n | 448\n | 456\n | 464\n | 472\n | 480\n | 488\n | 496\n | 504\n | 512\nexport type BitSize = UintBitSize | BigUintBitSize\ntype NativeForArc4Int<N extends BitSize> = N extends UintBitSize ? uint64 : biguint\ntype CompatForArc4Int<N extends BitSize> = N extends UintBitSize ? Uint64Compat : BigUintCompat\n\nconst TypeProperty = Symbol('ARC4Type')\n\nexport abstract class ARC4Encoded implements BytesBacked {\n abstract [TypeProperty]?: string\n get bytes(): bytes {\n throw new NoImplementation()\n }\n}\n\nexport class Str extends ARC4Encoded {\n [TypeProperty]?: '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 [TypeProperty]?: `arc4.UintN<${N}>`\n\n constructor(v?: CompatForArc4Int<N>) {\n super()\n }\n get native(): NativeForArc4Int<N> {\n throw new NoImplementation()\n }\n}\nexport class Byte extends UintN<8> {}\nexport class UintN8 extends UintN<8> {}\nexport class UintN16 extends UintN<16> {}\nexport class UintN32 extends UintN<32> {}\nexport class UintN64 extends UintN<64> {}\nexport class UintN128 extends UintN<128> {}\nexport class UintN256 extends UintN<256> {}\nexport class UFixedNxM<N extends BitSize, M extends number> extends ARC4Encoded {\n [TypeProperty]?: `arc4.UFixedNxM<${N}x${M}>`\n constructor(v: `${number}.${number}`) {\n super()\n }\n\n get native(): NativeForArc4Int<N> {\n throw new NoImplementation()\n }\n}\nexport class Bool extends ARC4Encoded {\n [TypeProperty]?: `arc4.Bool`\n\n constructor(v?: boolean) {\n super()\n }\n\n get native(): boolean {\n throw new NoImplementation()\n }\n}\n\nabstract class Arc4ReadonlyArray<TItem extends ARC4Encoded> extends ARC4Encoded {\n protected constructor() {\n super()\n }\n\n /**\n * Returns the current length of this array\n */\n get length(): uint64 {\n throw new NoImplementation()\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 throw new NoImplementation()\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 throw new NoImplementation()\n }\n\n /**\n * Returns an iterator for the items in this array\n */\n [Symbol.iterator](): IterableIterator<TItem> {\n throw new NoImplementation()\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 throw new NoImplementation()\n }\n\n /**\n * Returns an iterator for the indexes in this array\n */\n keys(): IterableIterator<uint64> {\n throw new NoImplementation()\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 [TypeProperty]?: `arc4.StaticArray<${TItem[typeof TypeProperty]}, ${TLength}>`\n constructor()\n constructor(...items: TItem[] & { length: TLength })\n constructor(...items: TItem[])\n constructor(...items: TItem[] & { length: TLength }) {\n super()\n }\n\n copy(): StaticArray<TItem, TLength> {\n throw new NoImplementation()\n }\n\n /**\n * Returns a new array containing all items from _this_ array, and _other_ array\n * @param other Another array to concat with this one\n */\n concat(other: Arc4ReadonlyArray<TItem>): DynamicArray<TItem> {\n throw new NoImplementation()\n }\n}\nexport class DynamicArray<TItem extends ARC4Encoded> extends Arc4ReadonlyArray<TItem> {\n [TypeProperty]?: `arc4.DynamicArray<${TItem[typeof TypeProperty]}>`\n constructor(...items: TItem[]) {\n super()\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 throw new NoImplementation()\n }\n\n /**\n * Pop a single item from this array\n */\n pop(): TItem {\n throw new NoImplementation()\n }\n\n copy(): DynamicArray<TItem> {\n throw new NoImplementation()\n }\n\n /**\n * Returns a new array containing all items from _this_ array, and _other_ array\n * @param other Another array to concat with this one\n */\n concat(other: Arc4ReadonlyArray<TItem>): DynamicArray<TItem> {\n throw new NoImplementation()\n }\n}\ntype ExpandTupleType<T extends ARC4Encoded[]> = T extends [infer T1 extends ARC4Encoded, ...infer TRest extends ARC4Encoded[]]\n ? TRest extends []\n ? `${T1[typeof TypeProperty]}`\n : `${T1[typeof TypeProperty]},${ExpandTupleType<TRest>}`\n : ''\n\nexport class Tuple<TTuple extends [ARC4Encoded, ...ARC4Encoded[]]> extends ARC4Encoded {\n [TypeProperty]?: `arc4.Tuple<${ExpandTupleType<TTuple>}>`\n constructor(...items: TTuple) {\n super()\n }\n\n at<TIndex extends keyof TTuple>(index: TIndex): TTuple[TIndex] {\n throw new NoImplementation()\n }\n\n get length(): TTuple['length'] & uint64 {\n throw new NoImplementation()\n }\n\n get native(): TTuple {\n throw new NoImplementation()\n }\n}\n\nexport class Address extends Arc4ReadonlyArray<Byte> {\n [TypeProperty]?: `arc4.Address`\n constructor(value?: Account | string | bytes) {\n super()\n }\n\n get native(): Account {\n throw new NoImplementation()\n }\n}\n\ntype StructConstraint = Record<string, ARC4Encoded>\n\nclass StructBase extends ARC4Encoded {\n [TypeProperty] = '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 & Readonly<T>\n\nexport const Struct = StructImpl as StructConstructor\n\nexport class DynamicBytes extends Arc4ReadonlyArray<Byte> {\n [TypeProperty]?: `arc4.DynamicBytes`\n\n constructor(value?: bytes | string) {\n super()\n }\n\n get native(): bytes {\n throw new NoImplementation()\n }\n\n /**\n * Returns a dynamic bytes object containing all bytes from _this_ and _other_\n * @param other Another array of bytes to concat with this one\n */\n concat(other: Arc4ReadonlyArray<Byte>): DynamicBytes {\n throw new NoImplementation()\n }\n}\n\nexport class StaticBytes<TLength extends number = 0> extends Arc4ReadonlyArray<Byte> {\n [TypeProperty]?: `arc4.StaticBytes<${TLength}>`\n\n constructor(value?: bytes | string) {\n super()\n }\n\n get native(): bytes {\n throw new NoImplementation()\n }\n\n /**\n * Returns a dynamic bytes object containing all bytes from _this_ and _other_\n * @param other Another array of bytes to concat with this one\n */\n concat(other: Arc4ReadonlyArray<Byte>): DynamicBytes {\n throw new NoImplementation()\n }\n}\n\n/**\n * Interpret the provided bytes as an ARC4 encoded type with no validation\n * @param bytes An arc4 encoded bytes value\n * @param prefix The prefix (if any), present in the bytes value. This prefix will be validated and removed\n */\nexport function interpretAsArc4<T extends ARC4Encoded>(bytes: BytesCompat, prefix: 'none' | 'log' = 'none'): T {\n throw new NoImplementation()\n}\n\n/**\n * Decode the provided bytes to a native Algorand TypeScript value\n * @param bytes An arc4 encoded bytes value\n * @param prefix The prefix (if any), present in the bytes value. This prefix will be validated and removed\n */\nexport function decodeArc4<T>(bytes: BytesCompat, prefix: 'none' | 'log' = 'none'): T {\n throw new NoImplementation()\n}\n\n/**\n * Encode the provided Algorand TypeScript value as ARC4 bytes\n * @param value Any native Algorand TypeScript value with a supported ARC4 encoding\n */\nexport function encodeArc4<T>(value: T): bytes {\n throw new NoImplementation()\n}\n","import { BaseContract } from '../base-contract'\nimport { NoImplementation } from '../internal/errors'\nimport { DeliberateAny } from '../internal/typescript-helpers'\nimport { bytes } from '../primitives'\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 = 0,\n OptIn = 1,\n CloseOut = 2,\n ClearState = 3,\n UpdateApplication = 4,\n DeleteApplication = 5,\n}\n\nexport type DefaultArgument<TContract extends Contract> = { constant: string | boolean | number | bigint } | { from: keyof TContract }\n\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}\n\n/**\n * Declares the decorated method as an abimethod that is called when the first transaction arg matches the method selector\n * @param config\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 throw new NoImplementation()\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}\n\n/**\n * Declares the decorated method as a baremethod that can only be called with no transaction args\n * @param config\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 throw new NoImplementation()\n }\n}\n\n/**\n * Returns the ARC4 method selector for a given ARC4 method signature. The method selector is the first\n * 4 bytes of the SHA512/256 hash of the method signature.\n * @param methodSignature An ARC4 method signature. Eg. `hello(string)string`. Must be a compile time constant.\n * @returns The ARC4 method selector. Eg. `02BECE11`\n */\nexport function methodSelector(methodSignature: string): bytes {\n throw new NoImplementation()\n}\n"],"names":[],"mappings":";;MAKsB,YAAY,CAAA;IAEzB,iBAAiB,GAAA;AACtB,QAAA,OAAO,IAAI;;AAEd;AA0DD;;;AAGG;AACG,SAAU,QAAQ,CAAC,OAAwB,EAAA;AAC/C,IAAA,OAAO,CAAyC,QAAW,EAAE,GAA0B,KAAI;QACzF,MAAM,IAAI,gBAAgB,EAAE;AAC9B,KAAC;AACH;;ACVA,MAAM,YAAY,GAAG,MAAM,CAAC,UAAU,CAAC;MAEjB,WAAW,CAAA;AAE/B,IAAA,IAAI,KAAK,GAAA;QACP,MAAM,IAAI,gBAAgB,EAAE;;AAE/B;AAEK,MAAO,GAAI,SAAQ,WAAW,CAAA;IAClC,CAAC,YAAY;AACb,IAAA,MAAM;AACN,IAAA,WAAA,CAAY,CAAgB,EAAA;AAC1B,QAAA,KAAK,EAAE;AACP,QAAA,IAAI,CAAC,MAAM,GAAG,CAAC,IAAI,EAAE;;AAEvB,IAAA,IAAI,MAAM,GAAA;QACR,OAAO,IAAI,CAAC,MAAM;;AAErB;AACK,MAAO,KAAyB,SAAQ,WAAW,CAAA;IACvD,CAAC,YAAY;AAEb,IAAA,WAAA,CAAY,CAAuB,EAAA;AACjC,QAAA,KAAK,EAAE;;AAET,IAAA,IAAI,MAAM,GAAA;QACR,MAAM,IAAI,gBAAgB,EAA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
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
import { N as NoImplementation } from './errors-D124-zqo.js';
|
2
2
|
export { B as Base64, E as Ec, a as Ecdsa, G as Global, M as MimcConfigurations, T as Txn, V as VrfVerify, o as op } from './op-BKy1vBsJ.js';
|
3
|
-
export { B as BaseContract, C as Contract, a as abimethod, i as arc4, c as contract } from './index-
|
3
|
+
export { B as BaseContract, C as Contract, a as abimethod, i as arc4, c as contract } from './index-DLHfNF70.js';
|
4
4
|
|
5
5
|
function Uint64(v) {
|
6
6
|
throw new NoImplementation();
|
package/index.mjs.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../src/primitives.ts","../src/util.ts","../src/reference.ts","../src/box.ts","../src/state.ts","../src/itxn.ts","../src/gtxn.ts","../src/transactions.ts","../src/logic-sig.ts","../src/template-var.ts","../src/compiled.ts","../src/mutable-array.ts","../src/arc-28.ts"],"sourcesContent":["import { NoImplementation } from './internal/errors'\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 with the default value of 0\n */\nexport function Uint64(): uint64\n/**\n * Create a uint64 from a string literal\n */\nexport function Uint64(v: string): uint64\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 | string): uint64 {\n throw new NoImplementation()\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 throw new NoImplementation()\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 throw new NoImplementation()\n}\n\n/**\n * Create a new bytes value from a hexadecimal encoded string\n * @param hex\n */\nBytes.fromHex = (hex: string): bytes => {\n throw new NoImplementation()\n}\n/**\n * Create a new bytes value from a base 64 encoded string\n * @param b64\n */\nBytes.fromBase64 = (b64: string): bytes => {\n throw new NoImplementation()\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 throw new NoImplementation()\n}\n\nexport interface BytesBacked {\n get bytes(): bytes\n}\n","import { NoImplementation } from './internal/errors'\nimport { biguint, BigUintCompat, BytesBacked, BytesCompat, StringCompat, uint64, Uint64Compat } from './primitives'\n\nexport function log(...args: Array<Uint64Compat | BytesCompat | BigUintCompat | StringCompat | BytesBacked>): void {\n throw new NoImplementation()\n}\n\nexport function assert(condition: unknown, message?: string): asserts condition {\n throw new NoImplementation()\n}\n\nexport function err(message?: string): never {\n throw new NoImplementation()\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 throw new NoImplementation()\n}\nexport function assertMatch<T>(subject: T, test: MatchTest<T>, message?: string): boolean {\n throw new NoImplementation()\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 NoImplementation()\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 NoImplementation()\n}\n\n/**\n * Defines a numeric range including all numbers between from and to\n */\nexport type NumberRange = { from: number; to: number }\n","import { NoImplementation } from './internal/errors'\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 throw new NoImplementation()\n}\n\nexport function Asset(): Asset\nexport function Asset(assetId: uint64): Asset\nexport function Asset(assetId?: uint64): Asset {\n throw new NoImplementation()\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 throw new NoImplementation()\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 { NoImplementation } from './internal/errors'\nimport { bytes, uint64 } from './primitives'\n\nexport type Box<TValue> = {\n readonly key: bytes\n value: TValue\n\n readonly exists: boolean\n get(options: { default: TValue }): TValue\n delete(): boolean\n maybe(): readonly [TValue, boolean]\n readonly length: uint64\n}\n\nexport type BoxMap<TKey, TValue> = {\n readonly keyPrefix: bytes\n get(key: TKey): TValue\n get(key: TKey, options: { default: TValue }): TValue\n set(key: TKey, value: TValue): void\n delete(key: TKey): boolean\n has(key: TKey): boolean\n maybe(key: TKey): readonly [TValue, boolean]\n length(key: TKey): uint64\n}\n\nexport type BoxRef = {\n readonly key: bytes\n readonly exists: boolean\n value: bytes\n get(options: { default: bytes }): bytes\n put(value: bytes): void\n splice(start: uint64, length: uint64, value: bytes): void\n replace(start: uint64, value: bytes): void\n extract(start: uint64, length: uint64): bytes\n delete(): boolean\n create(options: { size: uint64 }): boolean\n resize(newSize: uint64): void\n maybe(): readonly [bytes, boolean]\n readonly length: uint64\n}\n\nexport function Box<TValue>(options: { key: bytes | string }): Box<TValue> {\n throw new NoImplementation()\n}\n\nexport function BoxMap<TKey, TValue>(options: { keyPrefix: bytes | string }): BoxMap<TKey, TValue> {\n throw new NoImplementation()\n}\n\nexport function BoxRef(options: { key: bytes | string }): BoxRef {\n throw new NoImplementation()\n}\n","import { NoImplementation } from './internal/errors'\nimport { bytes } from './primitives'\nimport { Account } from './reference'\n\n/** A value saved in global state */\nexport type GlobalState<ValueType> = {\n value: ValueType\n delete: () => void\n hasValue: boolean\n}\n\nexport type GlobalStateOptions<ValueType> = { key?: bytes | string; initialValue?: ValueType }\n\n/** A single key in global state */\nexport function GlobalState<ValueType>(options?: GlobalStateOptions<ValueType>): GlobalState<ValueType> {\n throw new NoImplementation()\n}\n\n/** A value saved in local state */\nexport type LocalStateForAccount<ValueType> = {\n value: ValueType\n hasValue: boolean\n delete: () => void\n}\n\nexport type LocalState<ValueType> = {\n (account: Account): LocalStateForAccount<ValueType>\n}\n\n/** A single key in local state */\nexport function LocalState<ValueType>(options?: { key?: bytes | string }): LocalState<ValueType> {\n throw new NoImplementation()\n}\n","import { OnCompleteAction } from './arc4'\nimport { NoImplementation } from './internal/errors'\nimport { bytes, uint64 } from './primitives'\nimport type { Account, Application, Asset } from './reference'\nimport type * as txnTypes from './transactions'\n\nconst isItxn = Symbol('isItxn')\n\nexport interface PaymentInnerTxn extends txnTypes.PaymentTxn {\n [isItxn]?: true\n}\nexport interface KeyRegistrationInnerTxn extends txnTypes.KeyRegistrationTxn {\n [isItxn]?: true\n}\nexport interface AssetConfigInnerTxn extends txnTypes.AssetConfigTxn {\n [isItxn]?: true\n}\nexport interface AssetTransferInnerTxn extends txnTypes.AssetTransferTxn {\n [isItxn]?: true\n}\nexport interface AssetFreezeInnerTxn extends txnTypes.AssetFreezeTxn {\n [isItxn]?: true\n}\nexport interface ApplicationInnerTxn extends txnTypes.ApplicationTxn {\n [isItxn]?: true\n}\n\ntype AccountInput = Account | bytes | string\ntype AssetInput = Asset | uint64\ntype ApplicationInput = Application | uint64\n\nexport interface CommonTransactionFields {\n /**\n * 32 byte address\n */\n sender?: AccountInput\n\n /**\n * microalgos\n */\n fee?: uint64\n\n /**\n * round number\n */\n firstValid?: uint64\n\n /**\n * UNIX timestamp of block before txn.FirstValid. Fails if negative\n */\n firstValidTime?: uint64\n\n /**\n * Any data up to 1024 bytes\n */\n note?: bytes | string\n\n /**\n * 32 byte lease value\n */\n lease?: bytes\n\n /**\n * 32 byte Sender's new AuthAddr\n */\n rekeyTo?: AccountInput\n}\n\nexport interface PaymentFields extends CommonTransactionFields {\n /**\n * The amount, in microALGO, to transfer\n *\n */\n amount?: uint64\n /**\n * The address of the receiver\n */\n receiver?: AccountInput\n /**\n * If set, bring the sender balance to 0 and send all remaining balance to this address\n */\n closeRemainderTo?: AccountInput\n}\nexport interface KeyRegistrationFields extends CommonTransactionFields {\n /**\n * 32 byte address\n */\n voteKey?: bytes\n\n /**\n * 32 byte address\n */\n selectionKey?: bytes\n\n /**\n * The first round that the participation key is valid.\n */\n voteFirst?: uint64\n\n /**\n * The last round that the participation key is valid.\n */\n voteLast?: uint64\n\n /**\n * Dilution for the 2-level participation key\n */\n voteKeyDilution?: uint64\n\n /**\n * Marks an account nonparticipating for rewards\n */\n nonparticipation?: boolean\n\n /**\n * 64 byte state proof public key\n */\n stateProofKey?: bytes\n}\nexport interface AssetTransferFields extends CommonTransactionFields {\n /** The asset being transferred */\n xferAsset: AssetInput\n /** The amount of the asset being transferred */\n assetAmount?: uint64\n /** The clawback target */\n assetSender?: AccountInput\n /** The receiver of the asset */\n assetReceiver?: AccountInput\n /** The address to close the asset to */\n assetCloseTo?: AccountInput\n}\nexport interface AssetConfigFields extends CommonTransactionFields {\n configAsset?: AssetInput\n manager?: AccountInput\n reserve?: AccountInput\n freeze?: AccountInput\n clawback?: AccountInput\n assetName?: string | bytes\n unitName?: string | bytes\n total?: uint64\n decimals?: uint64\n defaultFrozen?: boolean\n url?: string | bytes\n metadataHash?: bytes\n}\nexport interface AssetFreezeFields extends CommonTransactionFields {\n freezeAsset: AssetInput\n freezeAccount?: AccountInput\n frozen?: boolean\n}\nexport interface ApplicationCallFields extends CommonTransactionFields {\n appId?: ApplicationInput\n approvalProgram?: bytes | readonly [...bytes[]]\n clearStateProgram?: bytes | readonly [...bytes[]]\n onCompletion?: OnCompleteAction | uint64\n globalNumUint?: uint64\n globalNumBytes?: uint64\n localNumUint?: uint64\n localNumBytes?: uint64\n extraProgramPages?: uint64\n appArgs?: readonly [...unknown[]]\n accounts?: readonly [...AccountInput[]]\n assets?: readonly [...AssetInput[]]\n apps?: readonly [...ApplicationInput[]]\n}\n\nexport type InnerTransaction =\n | PaymentItxnParams\n | KeyRegistrationItxnParams\n | AssetConfigItxnParams\n | AssetTransferItxnParams\n | AssetFreezeItxnParams\n | ApplicationCallItxnParams\n\nexport type InnerTxnList = [...InnerTransaction[]]\n\nexport type TxnFor<TFields extends InnerTxnList> = TFields extends [{ submit(): infer TTxn }, ...infer TRest extends InnerTxnList]\n ? [TTxn, ...TxnFor<TRest>]\n : []\n\nexport interface PaymentItxnParams {\n submit(): PaymentInnerTxn\n set(p: Partial<PaymentFields>): void\n copy(): PaymentItxnParams\n}\nexport interface KeyRegistrationItxnParams {\n submit(): KeyRegistrationInnerTxn\n set(p: Partial<KeyRegistrationFields>): void\n copy(): KeyRegistrationItxnParams\n}\nexport interface AssetConfigItxnParams {\n submit(): AssetConfigInnerTxn\n set(p: Partial<AssetConfigFields>): void\n copy(): AssetConfigItxnParams\n}\nexport interface AssetTransferItxnParams {\n submit(): AssetTransferInnerTxn\n set(p: Partial<AssetTransferFields>): void\n copy(): AssetTransferItxnParams\n}\nexport interface AssetFreezeItxnParams {\n submit(): AssetFreezeInnerTxn\n set(p: Partial<AssetFreezeFields>): void\n copy(): AssetFreezeItxnParams\n}\nexport interface ApplicationCallItxnParams {\n submit(): ApplicationInnerTxn\n set(p: Partial<ApplicationCallFields>): void\n copy(): ApplicationCallItxnParams\n}\n\nexport function submitGroup<TFields extends InnerTxnList>(...transactionFields: TFields): TxnFor<TFields> {\n throw new NoImplementation()\n}\nexport function payment(fields: PaymentFields): PaymentItxnParams {\n throw new NoImplementation()\n}\nexport function keyRegistration(fields: KeyRegistrationFields): KeyRegistrationItxnParams {\n throw new NoImplementation()\n}\nexport function assetConfig(fields: AssetConfigFields): AssetConfigItxnParams {\n throw new NoImplementation()\n}\nexport function assetTransfer(fields: AssetTransferFields): AssetTransferItxnParams {\n throw new NoImplementation()\n}\nexport function assetFreeze(fields: AssetFreezeFields): AssetFreezeItxnParams {\n throw new NoImplementation()\n}\nexport function applicationCall(fields: ApplicationCallFields): ApplicationCallItxnParams {\n throw new NoImplementation()\n}\n","import { NoImplementation } from './internal/errors'\nimport { uint64 } from './primitives'\nimport type * as txnTypes from './transactions'\n\nconst isGtxn = Symbol('isGtxn')\nexport interface PaymentTxn extends txnTypes.PaymentTxn {\n [isGtxn]?: true\n}\nexport interface KeyRegistrationTxn extends txnTypes.KeyRegistrationTxn {\n [isGtxn]?: true\n}\nexport interface AssetConfigTxn extends txnTypes.AssetConfigTxn {\n [isGtxn]?: true\n}\nexport interface AssetTransferTxn extends txnTypes.AssetTransferTxn {\n [isGtxn]?: true\n}\nexport interface AssetFreezeTxn extends txnTypes.AssetFreezeTxn {\n [isGtxn]?: true\n}\nexport interface ApplicationTxn extends txnTypes.ApplicationTxn {\n [isGtxn]?: true\n}\n\nexport type Transaction = PaymentTxn | KeyRegistrationTxn | AssetConfigTxn | AssetTransferTxn | AssetFreezeTxn | ApplicationTxn\n\nexport function Transaction(groupIndex: uint64): Transaction {\n throw new NoImplementation()\n}\nexport function PaymentTxn(groupIndex: uint64): PaymentTxn {\n throw new NoImplementation()\n}\nexport function KeyRegistrationTxn(groupIndex: uint64): KeyRegistrationTxn {\n throw new NoImplementation()\n}\nexport function AssetConfigTxn(groupIndex: uint64): AssetConfigTxn {\n throw new NoImplementation()\n}\nexport function AssetTransferTxn(groupIndex: uint64): AssetTransferTxn {\n throw new NoImplementation()\n}\nexport function AssetFreezeTxn(groupIndex: uint64): AssetFreezeTxn {\n throw new NoImplementation()\n}\nexport function ApplicationTxn(groupIndex: uint64): ApplicationTxn {\n throw new NoImplementation()\n}\n","import { OnCompleteActionStr } from './arc4'\nimport { bytes, uint64 } from './primitives'\nimport { Account, Application, Asset } from './reference'\n\n/**\n * The different transaction types available in a transaction\n */\nexport enum TransactionType {\n /**\n * A Payment transaction\n */\n Payment = 1,\n /**\n * A Key Registration transaction\n */\n KeyRegistration = 2,\n /**\n * An Asset Config transaction\n */\n AssetConfig = 3,\n /**\n * An Asset Transfer transaction\n */\n AssetTransfer = 4,\n /**\n * An Asset Freeze transaction\n */\n AssetFreeze = 5,\n /**\n * An Application Call transaction\n */\n ApplicationCall = 6,\n}\n\ninterface TransactionBase {\n /**\n * 32 byte address\n */\n readonly sender: Account\n\n /**\n * microalgos\n */\n readonly fee: uint64\n\n /**\n * round number\n */\n readonly firstValid: uint64\n\n /**\n * UNIX timestamp of block before txn.FirstValid. Fails if negative\n */\n readonly firstValidTime: uint64\n\n /**\n * round number\n */\n readonly lastValid: uint64\n\n /**\n * Any data up to 1024 bytes\n */\n readonly note: bytes\n\n /**\n * 32 byte lease value\n */\n readonly lease: bytes\n\n /**\n * Transaction type as bytes\n */\n readonly typeBytes: bytes\n\n /**\n * Position of this transaction within an atomic group\n * A stand-alone transaction is implicitly element 0 in a group of 1\n */\n readonly groupIndex: uint64\n\n /**\n * The computed ID for this transaction. 32 bytes.\n */\n readonly txnId: bytes\n\n /**\n * 32 byte Sender's new AuthAddr\n */\n readonly rekeyTo: Account\n}\n\nexport interface PaymentTxn extends TransactionBase {\n /**\n * 32 byte address\n */\n readonly receiver: Account\n\n /**\n * microalgos\n */\n readonly amount: uint64\n\n /**\n * 32 byte address\n */\n readonly closeRemainderTo: Account\n\n /**\n * Transaction type as integer\n */\n readonly type: TransactionType.Payment\n}\n\nexport interface KeyRegistrationTxn extends TransactionBase {\n /**\n * 32 byte address\n */\n readonly voteKey: bytes\n\n /**\n * 32 byte address\n */\n readonly selectionKey: bytes\n\n /**\n * The first round that the participation key is valid.\n */\n readonly voteFirst: uint64\n\n /**\n * The last round that the participation key is valid.\n */\n readonly voteLast: uint64\n\n /**\n * Dilution for the 2-level participation key\n */\n readonly voteKeyDilution: uint64\n\n /**\n * Marks an account nonparticipating for rewards\n */\n readonly nonparticipation: boolean\n\n /**\n * 64 byte state proof public key\n */\n readonly stateProofKey: bytes\n /**\n * Transaction type as integer\n */\n readonly type: TransactionType.KeyRegistration\n}\n\nexport interface AssetConfigTxn extends TransactionBase {\n /**\n * Asset ID in asset config transaction\n */\n readonly configAsset: Asset\n\n /**\n * Total number of units of this asset created\n */\n readonly total: uint64\n\n /**\n * Number of digits to display after the decimal place when displaying the asset\n */\n readonly decimals: uint64\n\n /**\n * Whether the asset's slots are frozen by default or not, 0 or 1\n */\n readonly defaultFrozen: boolean\n\n /**\n * Unit name of the asset\n */\n readonly unitName: bytes\n\n /**\n * The asset name\n */\n readonly assetName: bytes\n\n /**\n * URL\n */\n readonly url: bytes\n\n /**\n * 32 byte commitment to unspecified asset metadata\n */\n readonly metadataHash: bytes\n\n /**\n * 32 byte address\n */\n readonly manager: Account\n\n /**\n * 32 byte address\n */\n readonly reserve: Account\n\n /**\n * 32 byte address\n */\n readonly freeze: Account\n\n /**\n * 32 byte address\n */\n readonly clawback: Account\n /**\n * Asset ID allocated by the creation of an ASA\n */\n createdAsset: Asset\n\n /**\n * Transaction type as integer\n */\n readonly type: TransactionType.AssetConfig\n}\n\nexport interface AssetTransferTxn extends TransactionBase {\n /**\n * Asset ID\n */\n readonly xferAsset: Asset\n\n /**\n * value in Asset's units\n */\n readonly assetAmount: uint64\n\n /**\n * 32 byte address. Source of assets if Sender is the Asset's Clawback address.\n */\n readonly assetSender: Account\n\n /**\n * 32 byte address\n */\n readonly assetReceiver: Account\n\n /**\n * 32 byte address\n */\n readonly assetCloseTo: Account\n /**\n * Transaction type as integer\n */\n readonly type: TransactionType.AssetTransfer\n}\n\nexport interface AssetFreezeTxn extends TransactionBase {\n /**\n * Asset ID being frozen or un-frozen\n */\n readonly freezeAsset: Asset\n\n /**\n * 32 byte address of the account whose asset slot is being frozen or un-frozen\n */\n readonly freezeAccount: Account\n\n /**\n * The new frozen value\n */\n readonly frozen: boolean\n /**\n * Transaction type as integer\n */\n readonly type: TransactionType.AssetFreeze\n}\n\nexport interface ApplicationTxn extends TransactionBase {\n /**\n * ApplicationID from ApplicationCall transaction\n */\n readonly appId: Application\n\n /**\n * ApplicationCall transaction on completion action\n */\n readonly onCompletion: OnCompleteActionStr\n\n /**\n * Number of ApplicationArgs\n */\n readonly numAppArgs: uint64\n\n /**\n * Number of ApplicationArgs\n */\n readonly numAccounts: uint64\n\n /**\n * Approval program\n */\n readonly approvalProgram: bytes\n\n /**\n * Clear State program\n */\n readonly clearStateProgram: bytes\n\n /**\n * Number of Assets\n */\n readonly numAssets: uint64\n\n /**\n * Number of Applications\n */\n readonly numApps: uint64\n\n /**\n * Number of global state integers in ApplicationCall\n */\n readonly globalNumUint: uint64\n\n /**\n * Number of global state byteslices in ApplicationCall\n */\n readonly globalNumBytes: uint64\n\n /**\n * Number of local state integers in ApplicationCall\n */\n readonly localNumUint: uint64\n\n /**\n * Number of local state byteslices in ApplicationCall\n */\n readonly localNumBytes: uint64\n\n /**\n * Number of additional pages for each of the application's approval and clear state programs. An ExtraProgramPages of 1 means 2048 more total bytes, or 1024 for each program.\n */\n readonly extraProgramPages: uint64\n\n /**\n * The last message emitted. Empty bytes if none were emitted. Application mode only\n */\n readonly lastLog: bytes\n\n /**\n * Log messages emitted by an application call\n */\n logs(index: uint64): bytes\n\n /**\n * Number of logs\n */\n readonly numLogs: uint64\n\n /**\n * ApplicationID allocated by the creation of an application\n */\n readonly createdApp: Application\n\n /**\n * Number of Approval Program pages\n */\n readonly numApprovalProgramPages: uint64\n\n /**\n * Number of Clear State Program pages\n */\n readonly numClearStateProgramPages: uint64\n\n /**\n * Arguments passed to the application in the ApplicationCall transaction\n * @param index\n */\n appArgs(index: uint64): bytes\n\n /**\n * Accounts listed in the ApplicationCall transaction\n */\n accounts(index: uint64): Account\n\n /**\n * Foreign Assets listed in the ApplicationCall transaction\n */\n assets(index: uint64): Asset\n\n /**\n * Foreign Apps listed in the ApplicationCall transaction\n */\n apps(index: uint64): Application\n\n /**\n * Approval Program as an array of pages\n */\n approvalProgramPages(index: uint64): bytes\n\n /**\n * Clear State Program as an array of pages\n */\n clearStateProgramPages(index: uint64): bytes\n /**\n * Transaction type as integer\n */\n readonly type: TransactionType.ApplicationCall\n}\n\nexport type Transaction = PaymentTxn | KeyRegistrationTxn | AssetConfigTxn | AssetTransferTxn | AssetFreezeTxn | ApplicationTxn\n","import { ConstructorFor } from './internal/typescript-helpers'\nimport { uint64 } from './primitives'\n\nexport abstract class LogicSig {\n abstract program(): boolean | uint64\n}\n\n/**\n * Defines optional configuration for a logic signature\n */\ntype LogicSigOptions = {\n /**\n * Determines which AVM version to use, this affects what operations are supported.\n * Defaults to value provided supplied on command line (which defaults to current mainnet version)\n */\n avmVersion?: 10 | 11\n /**\n * Override the name of the logic signature when generating build artifacts.\n * Defaults to the class name\n */\n name?: string\n}\n\n/**\n * The logicsig decorator can be used to specify additional configuration options for a logic signature\n * @param options An object containing the configuration options\n */\nexport function logicsig(options: LogicSigOptions) {\n return <T extends ConstructorFor<LogicSig>>(logicSig: T) => logicSig\n}\n","import { NoImplementation } from './internal/errors'\n\nexport function TemplateVar<T>(variableName: string, prefix = 'TMPL_'): T {\n throw new NoImplementation()\n}\n","import { BaseContract } from './base-contract'\nimport { NoImplementation } from './internal/errors'\nimport { ConstructorFor, DeliberateAny } from './internal/typescript-helpers'\nimport { LogicSig } from './logic-sig'\nimport { bytes, uint64 } from './primitives'\nimport { Account } from './reference'\n\n/**\n * Provides compiled programs and state allocation values for a Contract. Created by calling `compile(ExampleContractType)`\n */\nexport type CompiledContract = {\n /**\n * Approval program pages for a contract, after template variables have been replaced and compiled to AVM bytecode\n */\n approvalProgram: [bytes, bytes]\n /**\n * Clear state program pages for a contract, after template variables have been replaced and compiled to AVM bytecode\n */\n clearStateProgram: [bytes, bytes]\n /**\n * By default, provides extra program pages required based on approval and clear state program size, can be overridden when calling `compile(ExampleContractType, { extraProgramPages: ... })`\n */\n extraProgramPages: uint64\n /**\n * By default, provides global num uints based on contract state totals, can be overridden when calling `compile(ExampleContractType, { globalUints: ... })`\n */\n globalUints: uint64\n /**\n * By default, provides global num bytes based on contract state totals, can be overridden when calling `compile(ExampleContractType, { globalBytes: ... })`\n */\n globalBytes: uint64\n /**\n * By default, provides local num uints based on contract state totals, can be overridden when calling `compile(ExampleContractType, { localUints: ... })`\n */\n localUints: uint64\n /**\n * By default, provides local num bytes based on contract state totals, can be overridden when calling `compile(ExampleContractType, { localBytes: ... })`\n */\n localBytes: uint64\n}\n\n/**\n * Provides account for a Logic Signature. Created by calling `compile(LogicSigType)`\n */\nexport type CompiledLogicSig = {\n /**\n * Address of a logic sig program, after template variables have been replaced and compiled to AVM bytecode\n */\n account: Account\n}\n\n/**\n * Options for compiling a contract\n */\nexport type CompileContractOptions = {\n /**\n * Number of extra program pages, defaults to minimum required for contract\n */\n extraProgramPages?: uint64\n /**\n * Number of global uint64s, defaults to value defined for contract\n */\n globalUints?: uint64\n /**\n * Number of global bytes, defaults to value defined for contract\n */\n globalBytes?: uint64\n /**\n * Number of local uint64s, defaults to value defined for contract\n */\n localUints?: uint64\n /**\n * Number of local bytes, defaults to value defined for contract\n */\n localBytes?: uint64\n /**\n * Template variables to substitute into the contract, key should be without the prefix, must evaluate to a compile time constant\n * and match the type of the template var declaration\n */\n templateVars?: Record<string, DeliberateAny>\n /**\n * Prefix to add to provided template vars, defaults to the prefix supplied on command line (which defaults to TMPL_)\n */\n templateVarsPrefix?: string\n}\n\n/**\n * Options for compiling a logic signature\n */\nexport type CompileLogicSigOptions = {\n /**\n * Template variables to substitute into the contract, key should be without the prefix, must evaluate to a compile time constant\n * and match the type of the template var declaration\n */\n templateVars?: Record<string, DeliberateAny>\n /**\n * Prefix to add to provided template vars, defaults to the prefix supplied on command line (which defaults to TMPL_)\n */\n templateVarsPrefix?: string\n}\n\n/**\n * Compile a contract and return the resulting byte code for approval and clear state programs.\n * @param contract The contract class to compile\n * @param options Options for compiling the contract\n */\nexport function compile(contract: ConstructorFor<BaseContract>, options?: CompileContractOptions): CompiledContract\n/**\n * Compile a logic signature and return an account ready for signing transactions.\n * @param logicSig The logic sig class to compile\n * @param options Options for compiling the logic sig\n */\nexport function compile(logicSig: ConstructorFor<LogicSig>, options?: CompileLogicSigOptions): CompiledLogicSig\nexport function compile(artefact: ConstructorFor<BaseContract> | ConstructorFor<LogicSig>): CompiledLogicSig | CompiledContract {\n throw new NoImplementation()\n}\n","import { NoImplementation } from './internal/errors'\nimport { uint64, Uint64Compat } from './primitives'\n\nexport class MutableArray<TItem> {\n constructor(...items: TItem[]) {}\n\n /**\n * Returns the current length of this array\n */\n get length(): uint64 {\n throw new NoImplementation()\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 throw new NoImplementation()\n }\n\n /**\n * Create a new Dynamic array with all items from this array\n */\n slice(): MutableArray<TItem>\n /**\n * Create a new MutableArray 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): MutableArray<TItem>\n /**\n * Create a new MutableArray 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): MutableArray<TItem>\n slice(start?: Uint64Compat, end?: Uint64Compat): MutableArray<TItem> {\n throw new NoImplementation()\n }\n\n /**\n * Returns an iterator for the items in this array\n */\n [Symbol.iterator](): IterableIterator<TItem> {\n throw new NoImplementation()\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 throw new NoImplementation()\n }\n\n /**\n * Returns an iterator for the indexes in this array\n */\n keys(): IterableIterator<uint64> {\n throw new NoImplementation()\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 /**\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 throw new NoImplementation()\n }\n\n /**\n * Pop a single item from this array\n */\n pop(): TItem {\n throw new NoImplementation()\n }\n\n copy(): MutableArray<TItem> {\n throw new NoImplementation()\n }\n}\n","import { NoImplementation } from './internal/errors'\nimport { DeliberateAny } from './internal/typescript-helpers'\n\n/**\n * Emit an arc28 event log using either an ARC4Struct type or a named object type.\n * Object types must have an ARC4 equivalent type.\n *\n * Anonymous types cannot be used as the type name is used to determine the event prefix\n * @param event An ARC4Struct instance, or a plain object with a named type\n *\n * @example\n * class Demo extends Struct<{ a: UintN64 }> {}\n * emit(new Demo({ a: new UintN64(123) }))\n *\n * @example\n * type Demo = { a: uint64 }\n * emit<Demo>({a: 123})\n * // or\n * const d: Demo = { a: 123 }\n * emit(d)\n */\nexport function emit<TEvent extends Record<string, DeliberateAny>>(event: TEvent): void\n/**\n * Emit an arc28 event log using an explicit name and inferred property/field types.\n * Property types must be ARC4 or have an ARC4 equivalent type.\n * @param eventName The name of the event (must be a compile time constant)\n * @param eventProps A set of event properties (order is significant)\n *\n * @example\n * emit(\"Demo\", new UintN64(123))\n *\n * @example\n * const a: uint64 = 123\n * emit(\"Demo\", a)\n */\nexport function emit<TProps extends [...DeliberateAny[]]>(eventName: string, ...eventProps: TProps): void\nexport function emit<T>(event: T | string, ...eventProps: unknown[]): void {\n throw new NoImplementation()\n}\n"],"names":[],"mappings":";;;;AAkCM,SAAU,MAAM,CAAC,CAAyB,EAAA;IAC9C,MAAM,IAAI,gBAAgB,EAAE;AAC9B;AAuCM,SAAU,OAAO,CAAC,CAA0B,EAAA;IAChD,MAAM,IAAI,gBAAgB,EAAE;AAC9B;SAyDgB,KAAK,CACnB,KAAgF,EAChF,GAAG,YAA2B,EAAA;IAE9B,MAAM,IAAI,gBAAgB,EAAE;AAC9B;AAEA;;;AAGG;AACH,KAAK,CAAC,OAAO,GAAG,CAAC,GAAW,KAAW;IACrC,MAAM,IAAI,gBAAgB,EAAE;AAC9B,CAAC;AACD;;;AAGG;AACH,KAAK,CAAC,UAAU,GAAG,CAAC,GAAW,KAAW;IACxC,MAAM,IAAI,gBAAgB,EAAE;AAC9B,CAAC;AAED;;;AAGG;AACH,KAAK,CAAC,UAAU,GAAG,CAAC,GAAW,KAAW;IACxC,MAAM,IAAI,gBAAgB,EAAE;AAC9B,CAAC;;AC/Je,SAAA,GAAG,CAAC,GAAG,IAAoF,EAAA;IACzG,MAAM,IAAI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c,EAAA;AAE7B;;AAEG;AACH,IAAA,IAAI,MAAM,GAAA;QACR,MAAM,IAAI,gBAAgB,EAAE;;AAG9B;;;;AAIG;AACH,IAAA,EAAE,CAAC,KAAmB,EAAA;QACpB,MAAM,IAAI,gBAAgB,EAAE;;IAoB9B,KAAK,CAAC,KAAoB,EAAE,GAAkB,EAAA;QAC5C,MAAM,IAAI,gBAAgB,EAAE;;AAG9B;;AAEG;IACH,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAA;QACf,MAAM,IAAI,gBAAgB,EAAE;;AAG9B;;AAEG;IACH,OAAO,GAAA;QACL,MAAM,IAAI,gBAAgB,EAAE;;AAG9B;;AAEG;IACH,IAAI,GAAA;QACF,MAAM,IAAI,gBAAgB,EAAE;;AAS9B;;;AAGG;IACH,IAAI,CAAC,GAAG,KAAc,EAAA;QACpB,MAAM,IAAI,gBAAgB,EAAE;;AAG9B;;AAEG;IACH,GAAG,GAAA;QACD,MAAM,IAAI,gBAAgB,EAAE;;IAG9B,IAAI,GAAA;QACF,MAAM,IAAI,gBAAgB,EAAE;;AAE/B;;SCpDe,IAAI,CAAI,KAAiB,EAAE,GAAG,UAAqB,EAAA;IACjE,MAAM,IAAI,gBAAgB,EAAE;AAC9B;;;;"}
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../src/primitives.ts","../src/util.ts","../src/reference.ts","../src/box.ts","../src/state.ts","../src/itxn.ts","../src/gtxn.ts","../src/transactions.ts","../src/logic-sig.ts","../src/template-var.ts","../src/compiled.ts","../src/mutable-array.ts","../src/arc-28.ts"],"sourcesContent":["import { NoImplementation } from './internal/errors'\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 with the default value of 0\n */\nexport function Uint64(): uint64\n/**\n * Create a uint64 from a string literal\n */\nexport function Uint64(v: string): uint64\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 | string): uint64 {\n throw new NoImplementation()\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 throw new NoImplementation()\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 throw new NoImplementation()\n}\n\n/**\n * Create a new bytes value from a hexadecimal encoded string\n * @param hex\n */\nBytes.fromHex = (hex: string): bytes => {\n throw new NoImplementation()\n}\n/**\n * Create a new bytes value from a base 64 encoded string\n * @param b64\n */\nBytes.fromBase64 = (b64: string): bytes => {\n throw new NoImplementation()\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 throw new NoImplementation()\n}\n\nexport interface BytesBacked {\n get bytes(): bytes\n}\n","import { NoImplementation } from './internal/errors'\nimport { biguint, BigUintCompat, BytesBacked, BytesCompat, StringCompat, uint64, Uint64Compat } from './primitives'\n\nexport function log(...args: Array<Uint64Compat | BytesCompat | BigUintCompat | StringCompat | BytesBacked>): void {\n throw new NoImplementation()\n}\n\nexport function assert(condition: unknown, message?: string): asserts condition {\n throw new NoImplementation()\n}\n\nexport function err(message?: string): never {\n throw new NoImplementation()\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 throw new NoImplementation()\n}\nexport function assertMatch<T>(subject: T, test: MatchTest<T>, message?: string): boolean {\n throw new NoImplementation()\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 NoImplementation()\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 NoImplementation()\n}\n\n/**\n * Defines a numeric range including all numbers between from and to\n */\nexport type NumberRange = { from: number; to: number }\n","import { NoImplementation } from './internal/errors'\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 throw new NoImplementation()\n}\n\nexport function Asset(): Asset\nexport function Asset(assetId: uint64): Asset\nexport function Asset(assetId?: uint64): Asset {\n throw new NoImplementation()\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 throw new NoImplementation()\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 { NoImplementation } from './internal/errors'\nimport { bytes, uint64 } from './primitives'\n\nexport type Box<TValue> = {\n readonly key: bytes\n value: TValue\n\n readonly exists: boolean\n get(options: { default: TValue }): TValue\n delete(): boolean\n maybe(): readonly [TValue, boolean]\n readonly length: uint64\n}\n\nexport type BoxMap<TKey, TValue> = {\n readonly keyPrefix: bytes\n get(key: TKey): TValue\n get(key: TKey, options: { default: TValue }): TValue\n set(key: TKey, value: TValue): void\n delete(key: TKey): boolean\n has(key: TKey): boolean\n maybe(key: TKey): readonly [TValue, boolean]\n length(key: TKey): uint64\n}\n\nexport type BoxRef = {\n readonly key: bytes\n readonly exists: boolean\n value: bytes\n get(options: { default: bytes }): bytes\n put(value: bytes): void\n splice(start: uint64, length: uint64, value: bytes): void\n replace(start: uint64, value: bytes): void\n extract(start: uint64, length: uint64): bytes\n delete(): boolean\n create(options: { size: uint64 }): boolean\n resize(newSize: uint64): void\n maybe(): readonly [bytes, boolean]\n readonly length: uint64\n}\n\nexport function Box<TValue>(options: { key: bytes | string }): Box<TValue> {\n throw new NoImplementation()\n}\n\nexport function BoxMap<TKey, TValue>(options: { keyPrefix: bytes | string }): BoxMap<TKey, TValue> {\n throw new NoImplementation()\n}\n\nexport function BoxRef(options: { key: bytes | string }): BoxRef {\n throw new NoImplementation()\n}\n","import { NoImplementation } from './internal/errors'\nimport { bytes } from './primitives'\nimport { Account } from './reference'\n\n/** A value saved in global state */\nexport type GlobalState<ValueType> = {\n value: ValueType\n delete: () => void\n hasValue: boolean\n}\n\nexport type GlobalStateOptions<ValueType> = { key?: bytes | string; initialValue?: ValueType }\n\n/** A single key in global state */\nexport function GlobalState<ValueType>(options?: GlobalStateOptions<ValueType>): GlobalState<ValueType> {\n throw new NoImplementation()\n}\n\n/** A value saved in local state */\nexport type LocalStateForAccount<ValueType> = {\n value: ValueType\n hasValue: boolean\n delete: () => void\n}\n\nexport type LocalState<ValueType> = {\n (account: Account): LocalStateForAccount<ValueType>\n}\n\n/** A single key in local state */\nexport function LocalState<ValueType>(options?: { key?: bytes | string }): LocalState<ValueType> {\n throw new NoImplementation()\n}\n","import { OnCompleteAction } from './arc4'\nimport { NoImplementation } from './internal/errors'\nimport { bytes, uint64 } from './primitives'\nimport type { Account, Application, Asset } from './reference'\nimport type * as txnTypes from './transactions'\n\nconst isItxn = Symbol('isItxn')\n\nexport interface PaymentInnerTxn extends txnTypes.PaymentTxn {\n [isItxn]?: true\n}\nexport interface KeyRegistrationInnerTxn extends txnTypes.KeyRegistrationTxn {\n [isItxn]?: true\n}\nexport interface AssetConfigInnerTxn extends txnTypes.AssetConfigTxn {\n [isItxn]?: true\n}\nexport interface AssetTransferInnerTxn extends txnTypes.AssetTransferTxn {\n [isItxn]?: true\n}\nexport interface AssetFreezeInnerTxn extends txnTypes.AssetFreezeTxn {\n [isItxn]?: true\n}\nexport interface ApplicationInnerTxn extends txnTypes.ApplicationTxn {\n [isItxn]?: true\n}\n\ntype AccountInput = Account | bytes\ntype AssetInput = Asset | uint64\ntype ApplicationInput = Application | uint64\n\nexport interface CommonTransactionFields {\n /**\n * 32 byte address\n */\n sender?: AccountInput\n\n /**\n * microalgos\n */\n fee?: uint64\n\n /**\n * round number\n */\n firstValid?: uint64\n\n /**\n * UNIX timestamp of block before txn.FirstValid. Fails if negative\n */\n firstValidTime?: uint64\n\n /**\n * Any data up to 1024 bytes\n */\n note?: bytes | string\n\n /**\n * 32 byte lease value\n */\n lease?: bytes\n\n /**\n * 32 byte Sender's new AuthAddr\n */\n rekeyTo?: AccountInput\n}\n\nexport interface PaymentFields extends CommonTransactionFields {\n /**\n * The amount, in microALGO, to transfer\n *\n */\n amount?: uint64\n /**\n * The address of the receiver\n */\n receiver?: AccountInput\n /**\n * If set, bring the sender balance to 0 and send all remaining balance to this address\n */\n closeRemainderTo?: AccountInput\n}\nexport interface KeyRegistrationFields extends CommonTransactionFields {\n /**\n * 32 byte address\n */\n voteKey?: bytes\n\n /**\n * 32 byte address\n */\n selectionKey?: bytes\n\n /**\n * The first round that the participation key is valid.\n */\n voteFirst?: uint64\n\n /**\n * The last round that the participation key is valid.\n */\n voteLast?: uint64\n\n /**\n * Dilution for the 2-level participation key\n */\n voteKeyDilution?: uint64\n\n /**\n * Marks an account nonparticipating for rewards\n */\n nonparticipation?: boolean\n\n /**\n * 64 byte state proof public key\n */\n stateProofKey?: bytes\n}\nexport interface AssetTransferFields extends CommonTransactionFields {\n /** The asset being transferred */\n xferAsset: AssetInput\n /** The amount of the asset being transferred */\n assetAmount?: uint64\n /** The clawback target */\n assetSender?: AccountInput\n /** The receiver of the asset */\n assetReceiver?: AccountInput\n /** The address to close the asset to */\n assetCloseTo?: AccountInput\n}\nexport interface AssetConfigFields extends CommonTransactionFields {\n configAsset?: AssetInput\n manager?: AccountInput\n reserve?: AccountInput\n freeze?: AccountInput\n clawback?: AccountInput\n assetName?: string | bytes\n unitName?: string | bytes\n total?: uint64\n decimals?: uint64\n defaultFrozen?: boolean\n url?: string | bytes\n metadataHash?: bytes\n}\nexport interface AssetFreezeFields extends CommonTransactionFields {\n freezeAsset: AssetInput\n freezeAccount?: AccountInput\n frozen?: boolean\n}\nexport interface ApplicationCallFields extends CommonTransactionFields {\n appId?: ApplicationInput\n approvalProgram?: bytes | readonly [...bytes[]]\n clearStateProgram?: bytes | readonly [...bytes[]]\n onCompletion?: OnCompleteAction | uint64\n globalNumUint?: uint64\n globalNumBytes?: uint64\n localNumUint?: uint64\n localNumBytes?: uint64\n extraProgramPages?: uint64\n appArgs?: readonly [...unknown[]]\n accounts?: readonly [...AccountInput[]]\n assets?: readonly [...AssetInput[]]\n apps?: readonly [...ApplicationInput[]]\n}\n\nexport type InnerTransaction =\n | PaymentItxnParams\n | KeyRegistrationItxnParams\n | AssetConfigItxnParams\n | AssetTransferItxnParams\n | AssetFreezeItxnParams\n | ApplicationCallItxnParams\n\nexport type InnerTxnList = [...InnerTransaction[]]\n\nexport type TxnFor<TFields extends InnerTxnList> = TFields extends [{ submit(): infer TTxn }, ...infer TRest extends InnerTxnList]\n ? [TTxn, ...TxnFor<TRest>]\n : []\n\nexport interface PaymentItxnParams {\n submit(): PaymentInnerTxn\n set(p: Partial<PaymentFields>): void\n copy(): PaymentItxnParams\n}\nexport interface KeyRegistrationItxnParams {\n submit(): KeyRegistrationInnerTxn\n set(p: Partial<KeyRegistrationFields>): void\n copy(): KeyRegistrationItxnParams\n}\nexport interface AssetConfigItxnParams {\n submit(): AssetConfigInnerTxn\n set(p: Partial<AssetConfigFields>): void\n copy(): AssetConfigItxnParams\n}\nexport interface AssetTransferItxnParams {\n submit(): AssetTransferInnerTxn\n set(p: Partial<AssetTransferFields>): void\n copy(): AssetTransferItxnParams\n}\nexport interface AssetFreezeItxnParams {\n submit(): AssetFreezeInnerTxn\n set(p: Partial<AssetFreezeFields>): void\n copy(): AssetFreezeItxnParams\n}\nexport interface ApplicationCallItxnParams {\n submit(): ApplicationInnerTxn\n set(p: Partial<ApplicationCallFields>): void\n copy(): ApplicationCallItxnParams\n}\n\nexport function submitGroup<TFields extends InnerTxnList>(...transactionFields: TFields): TxnFor<TFields> {\n throw new NoImplementation()\n}\nexport function payment(fields: PaymentFields): PaymentItxnParams {\n throw new NoImplementation()\n}\nexport function keyRegistration(fields: KeyRegistrationFields): KeyRegistrationItxnParams {\n throw new NoImplementation()\n}\nexport function assetConfig(fields: AssetConfigFields): AssetConfigItxnParams {\n throw new NoImplementation()\n}\nexport function assetTransfer(fields: AssetTransferFields): AssetTransferItxnParams {\n throw new NoImplementation()\n}\nexport function assetFreeze(fields: AssetFreezeFields): AssetFreezeItxnParams {\n throw new NoImplementation()\n}\nexport function applicationCall(fields: ApplicationCallFields): ApplicationCallItxnParams {\n throw new NoImplementation()\n}\n","import { NoImplementation } from './internal/errors'\nimport { uint64 } from './primitives'\nimport type * as txnTypes from './transactions'\n\nconst isGtxn = Symbol('isGtxn')\nexport interface PaymentTxn extends txnTypes.PaymentTxn {\n [isGtxn]?: true\n}\nexport interface KeyRegistrationTxn extends txnTypes.KeyRegistrationTxn {\n [isGtxn]?: true\n}\nexport interface AssetConfigTxn extends txnTypes.AssetConfigTxn {\n [isGtxn]?: true\n}\nexport interface AssetTransferTxn extends txnTypes.AssetTransferTxn {\n [isGtxn]?: true\n}\nexport interface AssetFreezeTxn extends txnTypes.AssetFreezeTxn {\n [isGtxn]?: true\n}\nexport interface ApplicationTxn extends txnTypes.ApplicationTxn {\n [isGtxn]?: true\n}\n\nexport type Transaction = PaymentTxn | KeyRegistrationTxn | AssetConfigTxn | AssetTransferTxn | AssetFreezeTxn | ApplicationTxn\n\nexport function Transaction(groupIndex: uint64): Transaction {\n throw new NoImplementation()\n}\nexport function PaymentTxn(groupIndex: uint64): PaymentTxn {\n throw new NoImplementation()\n}\nexport function KeyRegistrationTxn(groupIndex: uint64): KeyRegistrationTxn {\n throw new NoImplementation()\n}\nexport function AssetConfigTxn(groupIndex: uint64): AssetConfigTxn {\n throw new NoImplementation()\n}\nexport function AssetTransferTxn(groupIndex: uint64): AssetTransferTxn {\n throw new NoImplementation()\n}\nexport function AssetFreezeTxn(groupIndex: uint64): AssetFreezeTxn {\n throw new NoImplementation()\n}\nexport function ApplicationTxn(groupIndex: uint64): ApplicationTxn {\n throw new NoImplementation()\n}\n","import { OnCompleteActionStr } from './arc4'\nimport { bytes, uint64 } from './primitives'\nimport { Account, Application, Asset } from './reference'\n\n/**\n * The different transaction types available in a transaction\n */\nexport enum TransactionType {\n /**\n * A Payment transaction\n */\n Payment = 1,\n /**\n * A Key Registration transaction\n */\n KeyRegistration = 2,\n /**\n * An Asset Config transaction\n */\n AssetConfig = 3,\n /**\n * An Asset Transfer transaction\n */\n AssetTransfer = 4,\n /**\n * An Asset Freeze transaction\n */\n AssetFreeze = 5,\n /**\n * An Application Call transaction\n */\n ApplicationCall = 6,\n}\n\ninterface TransactionBase {\n /**\n * 32 byte address\n */\n readonly sender: Account\n\n /**\n * microalgos\n */\n readonly fee: uint64\n\n /**\n * round number\n */\n readonly firstValid: uint64\n\n /**\n * UNIX timestamp of block before txn.FirstValid. Fails if negative\n */\n readonly firstValidTime: uint64\n\n /**\n * round number\n */\n readonly lastValid: uint64\n\n /**\n * Any data up to 1024 bytes\n */\n readonly note: bytes\n\n /**\n * 32 byte lease value\n */\n readonly lease: bytes\n\n /**\n * Transaction type as bytes\n */\n readonly typeBytes: bytes\n\n /**\n * Position of this transaction within an atomic group\n * A stand-alone transaction is implicitly element 0 in a group of 1\n */\n readonly groupIndex: uint64\n\n /**\n * The computed ID for this transaction. 32 bytes.\n */\n readonly txnId: bytes\n\n /**\n * 32 byte Sender's new AuthAddr\n */\n readonly rekeyTo: Account\n}\n\nexport interface PaymentTxn extends TransactionBase {\n /**\n * 32 byte address\n */\n readonly receiver: Account\n\n /**\n * microalgos\n */\n readonly amount: uint64\n\n /**\n * 32 byte address\n */\n readonly closeRemainderTo: Account\n\n /**\n * Transaction type as integer\n */\n readonly type: TransactionType.Payment\n}\n\nexport interface KeyRegistrationTxn extends TransactionBase {\n /**\n * 32 byte address\n */\n readonly voteKey: bytes\n\n /**\n * 32 byte address\n */\n readonly selectionKey: bytes\n\n /**\n * The first round that the participation key is valid.\n */\n readonly voteFirst: uint64\n\n /**\n * The last round that the participation key is valid.\n */\n readonly voteLast: uint64\n\n /**\n * Dilution for the 2-level participation key\n */\n readonly voteKeyDilution: uint64\n\n /**\n * Marks an account nonparticipating for rewards\n */\n readonly nonparticipation: boolean\n\n /**\n * 64 byte state proof public key\n */\n readonly stateProofKey: bytes\n /**\n * Transaction type as integer\n */\n readonly type: TransactionType.KeyRegistration\n}\n\nexport interface AssetConfigTxn extends TransactionBase {\n /**\n * Asset ID in asset config transaction\n */\n readonly configAsset: Asset\n\n /**\n * Total number of units of this asset created\n */\n readonly total: uint64\n\n /**\n * Number of digits to display after the decimal place when displaying the asset\n */\n readonly decimals: uint64\n\n /**\n * Whether the asset's slots are frozen by default or not, 0 or 1\n */\n readonly defaultFrozen: boolean\n\n /**\n * Unit name of the asset\n */\n readonly unitName: bytes\n\n /**\n * The asset name\n */\n readonly assetName: bytes\n\n /**\n * URL\n */\n readonly url: bytes\n\n /**\n * 32 byte commitment to unspecified asset metadata\n */\n readonly metadataHash: bytes\n\n /**\n * 32 byte address\n */\n readonly manager: Account\n\n /**\n * 32 byte address\n */\n readonly reserve: Account\n\n /**\n * 32 byte address\n */\n readonly freeze: Account\n\n /**\n * 32 byte address\n */\n readonly clawback: Account\n /**\n * Asset ID allocated by the creation of an ASA\n */\n createdAsset: Asset\n\n /**\n * Transaction type as integer\n */\n readonly type: TransactionType.AssetConfig\n}\n\nexport interface AssetTransferTxn extends TransactionBase {\n /**\n * Asset ID\n */\n readonly xferAsset: Asset\n\n /**\n * value in Asset's units\n */\n readonly assetAmount: uint64\n\n /**\n * 32 byte address. Source of assets if Sender is the Asset's Clawback address.\n */\n readonly assetSender: Account\n\n /**\n * 32 byte address\n */\n readonly assetReceiver: Account\n\n /**\n * 32 byte address\n */\n readonly assetCloseTo: Account\n /**\n * Transaction type as integer\n */\n readonly type: TransactionType.AssetTransfer\n}\n\nexport interface AssetFreezeTxn extends TransactionBase {\n /**\n * Asset ID being frozen or un-frozen\n */\n readonly freezeAsset: Asset\n\n /**\n * 32 byte address of the account whose asset slot is being frozen or un-frozen\n */\n readonly freezeAccount: Account\n\n /**\n * The new frozen value\n */\n readonly frozen: boolean\n /**\n * Transaction type as integer\n */\n readonly type: TransactionType.AssetFreeze\n}\n\nexport interface ApplicationTxn extends TransactionBase {\n /**\n * ApplicationID from ApplicationCall transaction\n */\n readonly appId: Application\n\n /**\n * ApplicationCall transaction on completion action\n */\n readonly onCompletion: OnCompleteActionStr\n\n /**\n * Number of ApplicationArgs\n */\n readonly numAppArgs: uint64\n\n /**\n * Number of ApplicationArgs\n */\n readonly numAccounts: uint64\n\n /**\n * Approval program\n */\n readonly approvalProgram: bytes\n\n /**\n * Clear State program\n */\n readonly clearStateProgram: bytes\n\n /**\n * Number of Assets\n */\n readonly numAssets: uint64\n\n /**\n * Number of Applications\n */\n readonly numApps: uint64\n\n /**\n * Number of global state integers in ApplicationCall\n */\n readonly globalNumUint: uint64\n\n /**\n * Number of global state byteslices in ApplicationCall\n */\n readonly globalNumBytes: uint64\n\n /**\n * Number of local state integers in ApplicationCall\n */\n readonly localNumUint: uint64\n\n /**\n * Number of local state byteslices in ApplicationCall\n */\n readonly localNumBytes: uint64\n\n /**\n * Number of additional pages for each of the application's approval and clear state programs. An ExtraProgramPages of 1 means 2048 more total bytes, or 1024 for each program.\n */\n readonly extraProgramPages: uint64\n\n /**\n * The last message emitted. Empty bytes if none were emitted. Application mode only\n */\n readonly lastLog: bytes\n\n /**\n * Log messages emitted by an application call\n */\n logs(index: uint64): bytes\n\n /**\n * Number of logs\n */\n readonly numLogs: uint64\n\n /**\n * ApplicationID allocated by the creation of an application\n */\n readonly createdApp: Application\n\n /**\n * Number of Approval Program pages\n */\n readonly numApprovalProgramPages: uint64\n\n /**\n * Number of Clear State Program pages\n */\n readonly numClearStateProgramPages: uint64\n\n /**\n * Arguments passed to the application in the ApplicationCall transaction\n * @param index\n */\n appArgs(index: uint64): bytes\n\n /**\n * Accounts listed in the ApplicationCall transaction\n */\n accounts(index: uint64): Account\n\n /**\n * Foreign Assets listed in the ApplicationCall transaction\n */\n assets(index: uint64): Asset\n\n /**\n * Foreign Apps listed in the ApplicationCall transaction\n */\n apps(index: uint64): Application\n\n /**\n * Approval Program as an array of pages\n */\n approvalProgramPages(index: uint64): bytes\n\n /**\n * Clear State Program as an array of pages\n */\n clearStateProgramPages(index: uint64): bytes\n /**\n * Transaction type as integer\n */\n readonly type: TransactionType.ApplicationCall\n}\n\nexport type Transaction = PaymentTxn | KeyRegistrationTxn | AssetConfigTxn | AssetTransferTxn | AssetFreezeTxn | ApplicationTxn\n","import { ConstructorFor } from './internal/typescript-helpers'\nimport { uint64 } from './primitives'\n\nexport abstract class LogicSig {\n abstract program(): boolean | uint64\n}\n\ntype NumberRange = { from: number; to: number }\n\n/**\n * Defines optional configuration for a logic signature\n */\ntype LogicSigOptions = {\n /**\n * Determines which AVM version to use, this affects what operations are supported.\n * Defaults to value provided supplied on command line (which defaults to current mainnet version)\n */\n avmVersion?: 10 | 11\n /**\n * Override the name of the logic signature when generating build artifacts.\n * Defaults to the class name\n */\n name?: string\n /**\n * Allows you to mark a slot ID or range of slot IDs as \"off limits\" to Puya.\n * These slot ID(s) will never be written to or otherwise manipulating by the compiler itself.\n * This is particularly useful in combination with `op.gload_bytes` / `op.gload_uint64`\n * which lets a contract in a group transaction read from the scratch slots of another contract\n * that occurs earlier in the transaction group.\n */\n scratchSlots?: Array<number | NumberRange>\n}\n\n/**\n * The logicsig decorator can be used to specify additional configuration options for a logic signature\n * @param options An object containing the configuration options\n */\nexport function logicsig(options: LogicSigOptions) {\n return <T extends ConstructorFor<LogicSig>>(logicSig: T) => logicSig\n}\n","import { NoImplementation } from './internal/errors'\n\nexport function TemplateVar<T>(variableName: string, prefix = 'TMPL_'): T {\n throw new NoImplementation()\n}\n","import { BaseContract } from './base-contract'\nimport { NoImplementation } from './internal/errors'\nimport { ConstructorFor, DeliberateAny } from './internal/typescript-helpers'\nimport { LogicSig } from './logic-sig'\nimport { bytes, uint64 } from './primitives'\nimport { Account } from './reference'\n\n/**\n * Provides compiled programs and state allocation values for a Contract. Created by calling `compile(ExampleContractType)`\n */\nexport type CompiledContract = {\n /**\n * Approval program pages for a contract, after template variables have been replaced and compiled to AVM bytecode\n */\n approvalProgram: [bytes, bytes]\n /**\n * Clear state program pages for a contract, after template variables have been replaced and compiled to AVM bytecode\n */\n clearStateProgram: [bytes, bytes]\n /**\n * By default, provides extra program pages required based on approval and clear state program size, can be overridden when calling `compile(ExampleContractType, { extraProgramPages: ... })`\n */\n extraProgramPages: uint64\n /**\n * By default, provides global num uints based on contract state totals, can be overridden when calling `compile(ExampleContractType, { globalUints: ... })`\n */\n globalUints: uint64\n /**\n * By default, provides global num bytes based on contract state totals, can be overridden when calling `compile(ExampleContractType, { globalBytes: ... })`\n */\n globalBytes: uint64\n /**\n * By default, provides local num uints based on contract state totals, can be overridden when calling `compile(ExampleContractType, { localUints: ... })`\n */\n localUints: uint64\n /**\n * By default, provides local num bytes based on contract state totals, can be overridden when calling `compile(ExampleContractType, { localBytes: ... })`\n */\n localBytes: uint64\n}\n\n/**\n * Provides account for a Logic Signature. Created by calling `compile(LogicSigType)`\n */\nexport type CompiledLogicSig = {\n /**\n * Address of a logic sig program, after template variables have been replaced and compiled to AVM bytecode\n */\n account: Account\n}\n\n/**\n * Options for compiling a contract\n */\nexport type CompileContractOptions = {\n /**\n * Number of extra program pages, defaults to minimum required for contract\n */\n extraProgramPages?: uint64\n /**\n * Number of global uint64s, defaults to value defined for contract\n */\n globalUints?: uint64\n /**\n * Number of global bytes, defaults to value defined for contract\n */\n globalBytes?: uint64\n /**\n * Number of local uint64s, defaults to value defined for contract\n */\n localUints?: uint64\n /**\n * Number of local bytes, defaults to value defined for contract\n */\n localBytes?: uint64\n /**\n * Template variables to substitute into the contract, key should be without the prefix, must evaluate to a compile time constant\n * and match the type of the template var declaration\n */\n templateVars?: Record<string, DeliberateAny>\n /**\n * Prefix to add to provided template vars, defaults to the prefix supplied on command line (which defaults to TMPL_)\n */\n templateVarsPrefix?: string\n}\n\n/**\n * Options for compiling a logic signature\n */\nexport type CompileLogicSigOptions = {\n /**\n * Template variables to substitute into the contract, key should be without the prefix, must evaluate to a compile time constant\n * and match the type of the template var declaration\n */\n templateVars?: Record<string, DeliberateAny>\n /**\n * Prefix to add to provided template vars, defaults to the prefix supplied on command line (which defaults to TMPL_)\n */\n templateVarsPrefix?: string\n}\n\n/**\n * Compile a contract and return the resulting byte code for approval and clear state programs.\n * @param contract The contract class to compile\n * @param options Options for compiling the contract\n */\nexport function compile(contract: ConstructorFor<BaseContract>, options?: CompileContractOptions): CompiledContract\n/**\n * Compile a logic signature and return an account ready for signing transactions.\n * @param logicSig The logic sig class to compile\n * @param options Options for compiling the logic sig\n */\nexport function compile(logicSig: ConstructorFor<LogicSig>, options?: CompileLogicSigOptions): CompiledLogicSig\nexport function compile(artefact: ConstructorFor<BaseContract> | ConstructorFor<LogicSig>): CompiledLogicSig | CompiledContract {\n throw new NoImplementation()\n}\n","import { NoImplementation } from './internal/errors'\nimport { uint64, Uint64Compat } from './primitives'\n\nexport class MutableArray<TItem> {\n constructor(...items: TItem[]) {}\n\n /**\n * Returns the current length of this array\n */\n get length(): uint64 {\n throw new NoImplementation()\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 throw new NoImplementation()\n }\n\n /**\n * Create a new Dynamic array with all items from this array\n * @internal Not supported yet\n */\n slice(): MutableArray<TItem>\n /**\n * Create a new MutableArray 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 * @internal Not supported yet\n */\n slice(end: Uint64Compat): MutableArray<TItem>\n /**\n * Create a new MutableArray 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 * @internal Not supported yet\n */\n slice(start: Uint64Compat, end: Uint64Compat): MutableArray<TItem>\n slice(start?: Uint64Compat, end?: Uint64Compat): MutableArray<TItem> {\n throw new NoImplementation()\n }\n\n /**\n * Returns an iterator for the items in this array\n */\n [Symbol.iterator](): IterableIterator<TItem> {\n throw new NoImplementation()\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 throw new NoImplementation()\n }\n\n /**\n * Returns an iterator for the indexes in this array\n */\n keys(): IterableIterator<uint64> {\n throw new NoImplementation()\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 /**\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 throw new NoImplementation()\n }\n\n /**\n * Pop a single item from this array\n */\n pop(): TItem {\n throw new NoImplementation()\n }\n\n copy(): MutableArray<TItem> {\n throw new NoImplementation()\n }\n}\n","import { NoImplementation } from './internal/errors'\nimport { DeliberateAny } from './internal/typescript-helpers'\n\n/**\n * Emit an arc28 event log using either an ARC4Struct type or a named object type.\n * Object types must have an ARC4 equivalent type.\n *\n * Anonymous types cannot be used as the type name is used to determine the event prefix\n * @param event An ARC4Struct instance, or a plain object with a named type\n *\n * @example\n * class Demo extends Struct<{ a: UintN64 }> {}\n * emit(new Demo({ a: new UintN64(123) }))\n *\n * @example\n * type Demo = { a: uint64 }\n * emit<Demo>({a: 123})\n * // or\n * const d: Demo = { a: 123 }\n * emit(d)\n */\nexport function emit<TEvent extends Record<string, DeliberateAny>>(event: TEvent): void\n/**\n * Emit an arc28 event log using an explicit name and inferred property/field types.\n * Property types must be ARC4 or have an ARC4 equivalent type.\n * @param eventName The name of the event (must be a compile time constant)\n * @param eventProps A set of event properties (order is significant)\n *\n * @example\n * emit(\"Demo\", new UintN64(123))\n *\n * @example\n * const a: uint64 = 123\n * emit(\"Demo\", a)\n */\nexport function emit<TProps extends [...DeliberateAny[]]>(eventName: string, ...eventProps: TProps): void\nexport function emit<T>(event: T | string, ...eventProps: unknown[]): void {\n throw new N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;IACH,GAAG,GAAA;QACD,MAAM,IAAI,gBAAgB,EAAE;;IAG9B,IAAI,GAAA;QACF,MAAM,IAAI,gBAAgB,EAAE;;AAE/B;;SCvDe,IAAI,CAAI,KAAiB,EAAE,GAAG,UAAqB,EAAA;IACjE,MAAM,IAAI,gBAAgB,EAAE;AAC9B;;;;"}
|
package/itxn.d.ts
CHANGED
@@ -21,7 +21,7 @@ export interface AssetFreezeInnerTxn extends txnTypes.AssetFreezeTxn {
|
|
21
21
|
export interface ApplicationInnerTxn extends txnTypes.ApplicationTxn {
|
22
22
|
[isItxn]?: true;
|
23
23
|
}
|
24
|
-
type AccountInput = Account | bytes
|
24
|
+
type AccountInput = Account | bytes;
|
25
25
|
type AssetInput = Asset | uint64;
|
26
26
|
type ApplicationInput = Application | uint64;
|
27
27
|
export interface CommonTransactionFields {
|
package/logic-sig.d.ts
CHANGED
@@ -3,6 +3,10 @@ import { uint64 } from './primitives';
|
|
3
3
|
export declare abstract class LogicSig {
|
4
4
|
abstract program(): boolean | uint64;
|
5
5
|
}
|
6
|
+
type NumberRange = {
|
7
|
+
from: number;
|
8
|
+
to: number;
|
9
|
+
};
|
6
10
|
/**
|
7
11
|
* Defines optional configuration for a logic signature
|
8
12
|
*/
|
@@ -17,6 +21,14 @@ type LogicSigOptions = {
|
|
17
21
|
* Defaults to the class name
|
18
22
|
*/
|
19
23
|
name?: string;
|
24
|
+
/**
|
25
|
+
* Allows you to mark a slot ID or range of slot IDs as "off limits" to Puya.
|
26
|
+
* These slot ID(s) will never be written to or otherwise manipulating by the compiler itself.
|
27
|
+
* This is particularly useful in combination with `op.gload_bytes` / `op.gload_uint64`
|
28
|
+
* which lets a contract in a group transaction read from the scratch slots of another contract
|
29
|
+
* that occurs earlier in the transaction group.
|
30
|
+
*/
|
31
|
+
scratchSlots?: Array<number | NumberRange>;
|
20
32
|
};
|
21
33
|
/**
|
22
34
|
* The logicsig decorator can be used to specify additional configuration options for a logic signature
|
package/mutable-array.d.ts
CHANGED
@@ -11,23 +11,6 @@ export declare class MutableArray<TItem> {
|
|
11
11
|
* @param index The index of the item to retrieve
|
12
12
|
*/
|
13
13
|
at(index: Uint64Compat): TItem;
|
14
|
-
/**
|
15
|
-
* Create a new Dynamic array with all items from this array
|
16
|
-
*/
|
17
|
-
slice(): MutableArray<TItem>;
|
18
|
-
/**
|
19
|
-
* Create a new MutableArray with all items up till `end`.
|
20
|
-
* Negative indexes are taken from the end.
|
21
|
-
* @param end An index in which to stop copying items.
|
22
|
-
*/
|
23
|
-
slice(end: Uint64Compat): MutableArray<TItem>;
|
24
|
-
/**
|
25
|
-
* Create a new MutableArray with items from `start`, up until `end`
|
26
|
-
* Negative indexes are taken from the end.
|
27
|
-
* @param start An index in which to start copying items.
|
28
|
-
* @param end An index in which to stop copying items
|
29
|
-
*/
|
30
|
-
slice(start: Uint64Compat, end: Uint64Compat): MutableArray<TItem>;
|
31
14
|
/**
|
32
15
|
* Returns an iterator for the items in this array
|
33
16
|
*/
|
package/package.json
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
"**"
|
5
5
|
],
|
6
6
|
"name": "@algorandfoundation/algorand-typescript",
|
7
|
-
"version": "1.0.0-beta.
|
7
|
+
"version": "1.0.0-beta.18",
|
8
8
|
"description": "This package contains definitions for the types which comprise Algorand TypeScript which can be compiled to run on the Algorand Virtual Machine using the Puya compiler.",
|
9
9
|
"private": false,
|
10
10
|
"overrides": {
|
package/index-Bb3pKUmT.js.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index-Bb3pKUmT.js","sources":["../src/base-contract.ts","../src/arc4/encoded-types.ts","../src/arc4/index.ts"],"sourcesContent":["import { NoImplementation } from './internal/errors'\nimport { ConstructorFor } from './internal/typescript-helpers'\nimport { uint64 } from './primitives'\nimport { NumberRange } from './util'\n\nexport abstract class BaseContract {\n public abstract approvalProgram(): boolean | uint64\n public clearStateProgram(): boolean | uint64 {\n return true\n }\n}\n\n/**\n * Options class to manually define the total amount of global and local state contract will use.\n *\n * This is not required when all state is assigned to `this.`, but is required if a\n * contract dynamically interacts with state via `AppGlobal.getBytes` etc, or if you want\n * to reserve additional state storage for future contract updates, since the Algorand protocol\n * doesn't allow increasing them after creation.\n */\nexport type StateTotals = {\n globalUints?: number\n globalBytes?: number\n localUints?: number\n localBytes?: number\n}\n\nexport type ContractOptions = {\n /**\n * Determines which AVM version to use, this affects what operations are supported.\n * Defaults to value provided supplied on command line (which defaults to current mainnet version)\n */\n avmVersion?: 10 | 11\n\n /**\n * Override the name of the logic signature when generating build artifacts.\n * Defaults to the class name\n */\n name?: string\n /**\n * Allows you to mark a slot ID or range of slot IDs as \"off limits\" to Puya.\n * These slot ID(s) will never be written to or otherwise manipulating by the compiler itself.\n * This is particularly useful in combination with `op.gload_bytes` / `op.gload_uint64`\n * which lets a contract in a group transaction read from the scratch slots of another contract\n * that occurs earlier in the transaction group.\n *\n * In the case of inheritance, scratch slots reserved become cumulative. It is not an error\n * to have overlapping ranges or values either, so if a base class contract reserves slots\n * 0-5 inclusive and the derived contract reserves 5-10 inclusive, then within the derived\n * contract all slots 0-10 will be marked as reserved.\n */\n scratchSlots?: Array<number | NumberRange>\n /**\n * Allows defining what values should be used for global and local uint and bytes storage\n * values when creating a contract. Used when outputting ARC-32 application.json schemas.\n *\n * If left unspecified, the totals will be determined by the compiler based on state\n * variables assigned to `this`.\n *\n * This setting is not inherited, and only applies to the exact `Contract` it is specified\n * on. If a base class does specify this setting, and a derived class does not, a warning\n * will be emitted for the derived class. To resolve this warning, `stateTotals` must be\n * specified. An empty object may be provided in order to indicate that this contract should\n * revert to the default behaviour\n */\n stateTotals?: StateTotals\n}\n\n/**\n * The contract decorator can be used to specify additional configuration options for a smart contract\n * @param options An object containing the configuration options\n */\nexport function contract(options: ContractOptions) {\n return <T extends ConstructorFor<BaseContract>>(contract: T, ctx: ClassDecoratorContext) => {\n throw new NoImplementation()\n }\n}\n","import { NoImplementation } from '../internal/errors'\nimport { biguint, BigUintCompat, bytes, BytesBacked, BytesCompat, StringCompat, uint64, Uint64Compat } from '../primitives'\nimport { Account } from '../reference'\n\ntype UintBitSize = 8 | 16 | 24 | 32 | 40 | 48 | 56 | 64\ntype BigUintBitSize =\n | 72\n | 80\n | 88\n | 96\n | 104\n | 112\n | 120\n | 128\n | 136\n | 144\n | 152\n | 160\n | 168\n | 176\n | 184\n | 192\n | 200\n | 208\n | 216\n | 224\n | 232\n | 240\n | 248\n | 256\n | 264\n | 272\n | 280\n | 288\n | 296\n | 304\n | 312\n | 320\n | 328\n | 336\n | 344\n | 352\n | 360\n | 368\n | 376\n | 384\n | 392\n | 400\n | 408\n | 416\n | 424\n | 432\n | 440\n | 448\n | 456\n | 464\n | 472\n | 480\n | 488\n | 496\n | 504\n | 512\nexport type BitSize = UintBitSize | BigUintBitSize\ntype NativeForArc4Int<N extends BitSize> = N extends UintBitSize ? uint64 : biguint\ntype CompatForArc4Int<N extends BitSize> = N extends UintBitSize ? Uint64Compat : BigUintCompat\n\nconst TypeProperty = Symbol('ARC4Type')\n\nexport abstract class ARC4Encoded implements BytesBacked {\n abstract [TypeProperty]?: string\n get bytes(): bytes {\n throw new NoImplementation()\n }\n}\n\nexport class Str extends ARC4Encoded {\n [TypeProperty]?: '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 [TypeProperty]?: `arc4.UintN<${N}>`\n\n constructor(v?: CompatForArc4Int<N>) {\n super()\n }\n get native(): NativeForArc4Int<N> {\n throw new NoImplementation()\n }\n}\nexport class Byte extends UintN<8> {}\nexport class UintN8 extends UintN<8> {}\nexport class UintN16 extends UintN<16> {}\nexport class UintN32 extends UintN<32> {}\nexport class UintN64 extends UintN<64> {}\nexport class UintN128 extends UintN<128> {}\nexport class UintN256 extends UintN<256> {}\nexport class UFixedNxM<N extends BitSize, M extends number> extends ARC4Encoded {\n [TypeProperty]?: `arc4.UFixedNxM<${N}x${M}>`\n constructor(v: `${number}.${number}`) {\n super()\n }\n\n get native(): NativeForArc4Int<N> {\n throw new NoImplementation()\n }\n}\nexport class Bool extends ARC4Encoded {\n [TypeProperty]?: `arc4.Bool`\n\n constructor(v?: boolean) {\n super()\n }\n\n get native(): boolean {\n throw new NoImplementation()\n }\n}\n\nabstract class Arc4ReadonlyArray<TItem extends ARC4Encoded> extends ARC4Encoded {\n protected constructor() {\n super()\n }\n\n /**\n * Returns the current length of this array\n */\n get length(): uint64 {\n throw new NoImplementation()\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 throw new NoImplementation()\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 throw new NoImplementation()\n }\n\n /**\n * Returns an iterator for the items in this array\n */\n [Symbol.iterator](): IterableIterator<TItem> {\n throw new NoImplementation()\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 throw new NoImplementation()\n }\n\n /**\n * Returns an iterator for the indexes in this array\n */\n keys(): IterableIterator<uint64> {\n throw new NoImplementation()\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 [TypeProperty]?: `arc4.StaticArray<${TItem[typeof TypeProperty]}, ${TLength}>`\n constructor()\n constructor(...items: TItem[] & { length: TLength })\n constructor(...items: TItem[])\n constructor(...items: TItem[] & { length: TLength }) {\n super()\n }\n\n copy(): StaticArray<TItem, TLength> {\n throw new NoImplementation()\n }\n}\nexport class DynamicArray<TItem extends ARC4Encoded> extends Arc4ReadonlyArray<TItem> {\n [TypeProperty]?: `arc4.DynamicArray<${TItem[typeof TypeProperty]}>`\n constructor(...items: TItem[]) {\n super()\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 throw new NoImplementation()\n }\n\n /**\n * Pop a single item from this array\n */\n pop(): TItem {\n throw new NoImplementation()\n }\n\n copy(): DynamicArray<TItem> {\n throw new NoImplementation()\n }\n}\ntype ExpandTupleType<T extends ARC4Encoded[]> = T extends [infer T1 extends ARC4Encoded, ...infer TRest extends ARC4Encoded[]]\n ? TRest extends []\n ? `${T1[typeof TypeProperty]}`\n : `${T1[typeof TypeProperty]},${ExpandTupleType<TRest>}`\n : ''\n\nexport class Tuple<TTuple extends [ARC4Encoded, ...ARC4Encoded[]]> extends ARC4Encoded {\n [TypeProperty]?: `arc4.Tuple<${ExpandTupleType<TTuple>}>`\n constructor(...items: TTuple) {\n super()\n }\n\n at<TIndex extends keyof TTuple>(index: TIndex): TTuple[TIndex] {\n throw new NoImplementation()\n }\n\n get length(): TTuple['length'] & uint64 {\n throw new NoImplementation()\n }\n\n get native(): TTuple {\n throw new NoImplementation()\n }\n}\n\nexport class Address extends Arc4ReadonlyArray<Byte> {\n [TypeProperty]?: `arc4.Address`\n constructor(value?: Account | string | bytes) {\n super()\n }\n\n get native(): Account {\n throw new NoImplementation()\n }\n}\n\ntype StructConstraint = Record<string, ARC4Encoded>\n\nclass StructBase extends ARC4Encoded {\n [TypeProperty] = '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 & Readonly<T>\n\nexport const Struct = StructImpl as StructConstructor\n\nexport class DynamicBytes extends Arc4ReadonlyArray<Byte> {\n [TypeProperty]?: `arc4.DynamicBytes`\n\n constructor(value?: bytes | string) {\n super()\n }\n\n get native(): bytes {\n throw new NoImplementation()\n }\n}\n\nexport class StaticBytes<TLength extends number = 0> extends Arc4ReadonlyArray<Byte> {\n [TypeProperty]?: `arc4.StaticBytes<${TLength}>`\n\n constructor(value?: bytes | string) {\n super()\n }\n\n get native(): bytes {\n throw new NoImplementation()\n }\n}\n\n/**\n * Interpret the provided bytes as an ARC4 encoded type with no validation\n * @param bytes An arc4 encoded bytes value\n * @param prefix The prefix (if any), present in the bytes value. This prefix will be validated and removed\n */\nexport function interpretAsArc4<T extends ARC4Encoded>(bytes: BytesCompat, prefix: 'none' | 'log' = 'none'): T {\n throw new NoImplementation()\n}\n\n/**\n * Decode the provided bytes to a native Algorand TypeScript value\n * @param bytes An arc4 encoded bytes value\n * @param prefix The prefix (if any), present in the bytes value. This prefix will be validated and removed\n */\nexport function decodeArc4<T>(bytes: BytesCompat, prefix: 'none' | 'log' = 'none'): T {\n throw new NoImplementation()\n}\n\n/**\n * Encode the provided Algorand TypeScript value as ARC4 bytes\n * @param value Any native Algorand TypeScript value with a supported ARC4 encoding\n */\nexport function encodeArc4<T>(value: T): bytes {\n throw new NoImplementation()\n}\n","import { BaseContract } from '../base-contract'\nimport { NoImplementation } from '../internal/errors'\nimport { DeliberateAny } from '../internal/typescript-helpers'\nimport { bytes } from '../primitives'\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 = 0,\n OptIn = 1,\n CloseOut = 2,\n ClearState = 3,\n UpdateApplication = 4,\n DeleteApplication = 5,\n}\n\nexport type DefaultArgument<TContract extends Contract> = { constant: string | boolean | number | bigint } | { from: keyof TContract }\n\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}\n\n/**\n * Declares the decorated method as an abimethod that is called when the first transaction arg matches the method selector\n * @param config\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 throw new NoImplementation()\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}\n\n/**\n * Declares the decorated method as a baremethod that can only be called with no transaction args\n * @param config\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 throw new NoImplementation()\n }\n}\n\n/**\n * Returns the ARC4 method selector for a given ARC4 method signature. The method selector is the first\n * 4 bytes of the SHA512/256 hash of the method signature.\n * @param methodSignature An ARC4 method signature. Eg. `hello(string)string`. Must be a compile time constant.\n * @returns The ARC4 method selector. Eg. `02BECE11`\n */\nexport function methodSelector(methodSignature: string): bytes {\n throw new NoImplementation()\n}\n"],"names":[],"mappings":";;MAKsB,YAAY,CAAA;IAEzB,iBAAiB,GAAA;AACtB,QAAA,OAAO,IAAI;;AAEd;AA0DD;;;AAGG;AACG,SAAU,QAAQ,CAAC,OAAwB,EAAA;AAC/C,IAAA,OAAO,CAAyC,QAAW,EAAE,GAA0B,KAAI;QACzF,MAAM,IAAI,gBAAgB,EAAE;AAC9B,KAAC;AACH;;ACVA,MAAM,YAAY,GAAG,MAAM,CAAC,UAAU,CAAC;MAEjB,WAAW,CAAA;AAE/B,IAAA,IAAI,KAAK,GAAA;QACP,MAAM,IAAI,gBAAgB,EAAE;;AAE/B;AAEK,MAAO,GAAI,SAAQ,WAAW,CAAA;IAClC,CAAC,YAAY;AACb,IAAA,MAAM;AACN,IAAA,WAAA,CAAY,CAAgB,EAAA;AAC1B,QAAA,KAAK,EAAE;AACP,QAAA,IAAI,CAAC,MAAM,GAAG,CAAC,IAAI,EAAE;;AAEvB,IAAA,IAAI,MAAM,GAAA;QACR,OAAO,IAAI,CAAC,MAAM;;AAErB;AACK,MAAO,KAAyB,SAAQ,WAAW,CAAA;IACvD,CAAC,YAAY;AAEb,IAAA,WAAA,CAAY,CAAuB,EAAA;AACjC,QAAA,KAAK,EAAE;;AAET,IAAA,IAAI,MAAM,GAAA;QACR,MAAM,IAAI,gBAAgB,EAAE;;AAE/B;AACK,MAAO,IAAK,SAAQ,KAAQ,CAAA;AAAG;AAC/B,MAAO,MAAO,SAAQ,KAAQ,CAAA;AAAG;AACjC,MAAO,OAAQ,SAAQ,KAAS,CAAA;AAAG;AACnC,MAAO,OAAQ,SAAQ,KAAS,CAAA;AAAG;AACnC,MAAO,OAAQ,SAAQ,KAAS,CAAA;AAAG;AACnC,MAAO,QAAS,SAAQ,KAAU,CAAA;AAAG;AACrC,MAAO,QAAS,SAAQ,KAAU,CAAA;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