@algorandfoundation/algorand-typescript 1.0.0-alpha.68 → 1.0.0-alpha.70

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/index.d.ts CHANGED
@@ -3,8 +3,8 @@ import { AnyFunction, DeliberateAny, InstanceMethod } from '../internal/typescri
3
3
  import { OnCompleteActionStr } from '../on-complete-action';
4
4
  import { bytes, BytesCompat, uint64 } from '../primitives';
5
5
  import { ARC4Encoded } from './encoded-types';
6
- export * from './encoded-types';
7
6
  export * from './c2c';
7
+ export * from './encoded-types';
8
8
  /**
9
9
  * The base type for all ARC4 contracts in Algorand TypeScript
10
10
  */
@@ -95,6 +95,15 @@ export type AbiMethodConfig<TContract extends Contract> = {
95
95
  * Override the name used to generate the abi method selector
96
96
  */
97
97
  name?: string;
98
+ /**
99
+ * The resource encoding to use for this method. The default is 'value'
100
+ *
101
+ * foreign_index: Application, Asset, and Account arguments are included in the transaction's relevant foreign array. The argument
102
+ * value is the uint8 index of the resource in the that array.
103
+ * value: Application, Asset and Account arguments are passed by their uint64 id (Application and Asset) or bytes[32] address (Account).
104
+ * The resource must still be 'available' to this transaction but can take advantage of resource sharing within the transaction group.
105
+ */
106
+ resourceEncoding?: 'foreign_index' | 'value';
98
107
  /**
99
108
  * Specify default arguments that can be populated by clients calling this method.
100
109
  *
package/arc4/index.mjs CHANGED
@@ -1,3 +1,3 @@
1
- export { A as ARC4Encoded, t as Address, r as Bool, h as Byte, C as Contract, D as DynamicArray, v as DynamicBytes, s as StaticArray, w as StaticBytes, S as Str, u as Struct, T as Tuple, q as UFixed, U as Uint, o as Uint128, k as Uint16, p as Uint256, l as Uint32, n as Uint64, j as Uint8, y as abiCall, a as abimethod, g as arc4EncodedLength, b as baremethod, x as compileArc4, e as decodeArc4, f as encodeArc4, d as interpretAsArc4, m as methodSelector } from '../index-Dsr3xdFj.js';
1
+ export { A as ARC4Encoded, v as Address, t as Bool, k as Byte, C as Contract, D as DynamicArray, x as DynamicBytes, u as StaticArray, y as StaticBytes, S as Str, w as Struct, T as Tuple, s as UFixed, U as Uint, q as Uint128, n as Uint16, r as Uint256, o as Uint32, p as Uint64, l as Uint8, j as abiCall, a as abimethod, g as arc4EncodedLength, b as baremethod, h as compileArc4, e as decodeArc4, f as encodeArc4, d as interpretAsArc4, m as methodSelector } from '../index-C9UF0TqG.js';
2
2
  import '../errors-Bg4n2Chz.js';
3
3
  //# sourceMappingURL=index.mjs.map
@@ -21,6 +21,23 @@ function contract(options) {
21
21
  };
22
22
  }
23
23
 
24
+ /**
25
+ * Pre compile the target ARC4 contract and return a proxy object for constructing inner transactions to call an instance of that contract.
26
+ * @param contract An ARC4 contract class
27
+ * @param options Compile contract arguments
28
+ */
29
+ function compileArc4(contract, options) {
30
+ throw new NoImplementation();
31
+ }
32
+ /**
33
+ * Invokes the target ABI method using a strongly typed fields object.
34
+ * @param method An ABI method function reference.
35
+ * @param fields Specify values for transaction fields.
36
+ */
37
+ function abiCall(method, fields) {
38
+ throw new NoImplementation();
39
+ }
40
+
24
41
  /**
25
42
  * @hidden
26
43
  */
@@ -377,23 +394,6 @@ class StaticBytes extends Arc4ArrayBase {
377
394
  }
378
395
  }
379
396
 
380
- /**
381
- * Pre compile the target ARC4 contract and return a proxy object for constructing inner transactions to call an instance of that contract.
382
- * @param contract An ARC4 contract class
383
- * @param options Compile contract arguments
384
- */
385
- function compileArc4(contract, options) {
386
- throw new NoImplementation();
387
- }
388
- /**
389
- * Invokes the target ABI method using a strongly typed fields object.
390
- * @param method An ABI method function reference.
391
- * @param fields Specify values for transaction fields.
392
- */
393
- function abiCall(method, fields) {
394
- throw new NoImplementation();
395
- }
396
-
397
397
  /**
398
398
  * The base type for all ARC4 contracts in Algorand TypeScript
399
399
  */
@@ -495,5 +495,5 @@ var index = /*#__PURE__*/Object.freeze({
495
495
  methodSelector: methodSelector
496
496
  });
497
497
 
498
- export { ARC4Encoded as A, BaseContract as B, Contract as C, DynamicArray as D, Str as S, Tuple as T, Uint as U, abimethod as a, baremethod as b, contract as c, interpretAsArc4 as d, decodeArc4 as e, encodeArc4 as f, arc4EncodedLength as g, Byte as h, index as i, Uint8 as j, Uint16 as k, Uint32 as l, methodSelector as m, Uint64 as n, Uint128 as o, Uint256 as p, UFixed as q, Bool as r, StaticArray as s, Address as t, Struct as u, DynamicBytes as v, StaticBytes as w, compileArc4 as x, abiCall as y };
499
- //# sourceMappingURL=index-Dsr3xdFj.js.map
498
+ export { ARC4Encoded as A, BaseContract as B, Contract as C, DynamicArray as D, Str as S, Tuple as T, Uint as U, abimethod as a, baremethod as b, contract as c, interpretAsArc4 as d, decodeArc4 as e, encodeArc4 as f, arc4EncodedLength as g, compileArc4 as h, index as i, abiCall as j, Byte as k, Uint8 as l, methodSelector as m, Uint16 as n, Uint32 as o, Uint64 as p, Uint128 as q, Uint256 as r, UFixed as s, Bool as t, StaticArray as u, Address as v, Struct as w, DynamicBytes as x, StaticBytes as y };
499
+ //# sourceMappingURL=index-C9UF0TqG.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-C9UF0TqG.js","sources":["../src/base-contract.ts","../src/arc4/c2c.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\n/**\n * The base type for all Algorand TypeScript contracts\n */\nexport abstract class BaseContract {\n /**\n * The program to be run when the On Completion Action is != ClearState (3)\n */\n public abstract approvalProgram(): boolean | uint64\n\n /**\n * The program to be run when the On Completion Action is == ClearState (3)\n */\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\n/**\n * Additional configuration options for a contract\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 { CompileContractOptions, CompiledContract } from '../compiled'\nimport { gtxn } from '../gtxn'\nimport { NoImplementation } from '../internal/errors'\nimport { AnyFunction, ConstructorFor, DeliberateAny, InstanceMethod } from '../internal/typescript-helpers'\nimport { itxn } from '../itxn'\nimport { Contract } from './index'\n\n/**\n * Defines txn fields that are available for a bare create application call.\n *\n * This is the regular application call fields minus:\n * - appId: because the appId is not known when creating an application\n * - appArgs: because a bare call cannot have arguments\n */\nexport type BareCreateApplicationCallFields = Omit<itxn.ApplicationCallFields, 'appId' | 'appArgs'>\n\n/**\n * Conditional type which given a group transaction type, returns the equivalent inner transaction\n * params type.\n */\nexport type GtxnToItxnFields<T extends gtxn.Transaction> = T extends gtxn.PaymentTxn\n ? itxn.PaymentItxnParams\n : T extends gtxn.KeyRegistrationTxn\n ? itxn.KeyRegistrationItxnParams\n : T extends gtxn.AssetConfigTxn\n ? itxn.AssetConfigItxnParams\n : T extends gtxn.AssetTransferTxn\n ? itxn.AssetTransferItxnParams\n : T extends gtxn.AssetFreezeTxn\n ? itxn.AssetFreezeItxnParams\n : T extends gtxn.ApplicationCallTxn\n ? itxn.ApplicationCallItxnParams\n : itxn.ItxnParams\n\n/**\n * Conditional type which given an application argument, returns the input type for that argument.\n *\n * The input type will usually be the original type apart from group transactions which will be substituted\n * with their equivalent inner transaction type.\n */\nexport type TypedApplicationArg<TArg> = TArg extends gtxn.Transaction ? GtxnToItxnFields<TArg> : TArg\n\n/**\n * Conditional type which maps a tuple of application arguments to a tuple of input types for specifying those arguments.\n */\nexport type TypedApplicationArgs<TArgs> = TArgs extends []\n ? []\n : TArgs extends [infer TArg, ...infer TRest]\n ? readonly [TypedApplicationArg<TArg>, ...TypedApplicationArgs<TRest>]\n : never\n\n/**\n * Application call fields with `appArgs` replaced with an `args` property that is strongly typed to the actual arguments for the\n * given application call.\n */\nexport type TypedApplicationCallFields<TArgs> = Omit<itxn.ApplicationCallFields, 'appArgs'> &\n (TArgs extends [] ? { readonly args?: TypedApplicationArgs<TArgs> } : { readonly args: TypedApplicationArgs<TArgs> })\n\n/**\n * The response type of a typed application call. Includes the raw itxn result object and the parsed ABI return value if applicable.\n */\nexport type TypedApplicationCallResponse<TReturn> = TReturn extends void\n ? { readonly itxn: itxn.ApplicationCallInnerTxn }\n : { readonly itxn: itxn.ApplicationCallInnerTxn; readonly returnValue: TReturn }\n\n/**\n * Conditional type which maps an ABI method to a factory method for constructing an application call transaction to call that method.\n */\nexport type ContractProxyMethod<TMethod> = TMethod extends (...args: infer TArgs) => infer TReturn\n ? (fields?: TypedApplicationCallFields<TArgs>) => TypedApplicationCallResponse<TReturn>\n : never\n\n/**\n * Conditional type which maps an ARC4 compatible contract to a proxy object which allows for constructing application call transactions for\n * all available ABI and bare methods. Also includes the compiled contract result data.\n */\nexport type ContractProxy<TContract extends Contract> = CompiledContract & {\n /**\n * Get methods for calling ABI and bare methods on the target contract\n */\n call: {\n /**\n * Invoke this method via an inner transaction call\n */\n [key in keyof TContract as key extends 'approvalProgram' | 'clearStateProgram'\n ? never\n : TContract[key] extends AnyFunction\n ? key\n : never]: ContractProxyMethod<TContract[key]>\n }\n /**\n * Create a bare application call itxn to create the contract.\n * @param fields Specify values for transaction fields which should override the default values.\n */\n bareCreate(fields?: BareCreateApplicationCallFields): itxn.ApplicationCallInnerTxn\n}\n\n/**\n * Pre compile the target ARC4 contract and return a proxy object for constructing inner transactions to call an instance of that contract.\n * @param contract An ARC4 contract class\n * @param options Compile contract arguments\n */\nexport function compileArc4<TContract extends Contract>(\n contract: ConstructorFor<TContract>,\n options?: CompileContractOptions,\n): ContractProxy<TContract> {\n throw new NoImplementation()\n}\n\n/**\n * Invokes the target ABI method using a strongly typed fields object.\n * @param method An ABI method function reference.\n * @param fields Specify values for transaction fields.\n */\nexport function abiCall<TArgs extends DeliberateAny[], TReturn>(\n method: InstanceMethod<Contract, TArgs, TReturn>,\n fields: TypedApplicationCallFields<TArgs>,\n): TypedApplicationCallResponse<TReturn> {\n throw new NoImplementation()\n}\n","import { NoImplementation } from '../internal/errors'\nimport { biguint, BigUintCompat, bytes, BytesBacked, StringCompat, uint64, Uint64Compat } from '../primitives'\nimport { Account } from '../reference'\n\n/**\n * Defines UintN bit sizes which are compatible with the uint64 type\n */\ntype UintBitSize = 8 | 16 | 24 | 32 | 40 | 48 | 56 | 64\n/**\n * Defines UintN bit sizes which are only compatible with the biguint type\n */\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\n/**\n * Defines supported bit sizes for the UintN and UFixed types\n */\nexport type BitSize = UintBitSize | BigUintBitSize\n/**\n * Conditional type which returns the native equivalent type for a given UintN bit size\n */\ntype NativeForArc4Int<N extends BitSize> = N extends UintBitSize ? uint64 : biguint\n/**\n * Conditional type which returns the compat type relevant to a given UintN bit size\n */\ntype CompatForArc4Int<N extends BitSize> = N extends UintBitSize ? Uint64Compat : BigUintCompat\n\n/**\n * @hidden\n */\nconst TypeProperty = Symbol('ARC4Type')\n\n/**\n * A base type for ARC4 encoded values\n */\nexport abstract class ARC4Encoded implements BytesBacked {\n /**\n * @hidden\n *\n * Since TypeScript is structurally typed, different ARC4Encodeds with compatible\n * structures will often be assignable to one and another and this is generally\n * not desirable. The TypeProperty property should be used to declare a literal value\n * (usually the class name) on each distinct ARC4Encoded class to ensure they are\n * structurally different.\n */\n abstract [TypeProperty]?: string\n\n /**\n * Retrieve the encoded bytes for this type\n */\n get bytes(): bytes {\n throw new NoImplementation()\n }\n}\n\n/**\n * A utf8 encoded string prefixed with its length expressed as a 2 byte uint\n */\nexport class Str extends ARC4Encoded {\n /** @hidden */\n [TypeProperty]?: 'arc4.Str'\n\n /**\n * Create a new Str instance\n * @param s The native string to initialize this Str from\n */\n constructor(s?: StringCompat) {\n super()\n }\n\n /**\n * Retrieve the decoded native string\n */\n get native(): string {\n throw new NoImplementation()\n }\n}\n\n/**\n * A fixed bit size unsigned int\n */\nexport class Uint<N extends BitSize> extends ARC4Encoded {\n /** @hidden */\n [TypeProperty]?: `arc4.Uint<${N}>`\n\n /**\n * Create a new UintN instance\n * @param v The native uint64 or biguint value to initialize this UintN from\n */\n constructor(v?: CompatForArc4Int<N>) {\n super()\n }\n\n /**\n * Retrieve the decoded native uint64 or biguint\n */\n get native(): NativeForArc4Int<N> {\n throw new NoImplementation()\n }\n}\n\n/**\n * An alias for Uint<8>\n */\nexport class Byte extends Uint<8> {}\n\n/**\n * An alias for Uint<8>\n */\nexport class Uint8 extends Uint<8> {}\n\n/**\n * An alias for Uint<16>\n */\nexport class Uint16 extends Uint<16> {}\n\n/**\n * An alias for Uint<32>\n */\nexport class Uint32 extends Uint<32> {}\n\n/**\n * An alias for Uint<64>\n */\nexport class Uint64 extends Uint<64> {}\n\n/**\n * An alias for Uint<128>\n */\nexport class Uint128 extends Uint<128> {}\n\n/**\n * An alias for Uint<256>\n */\nexport class Uint256 extends Uint<256> {}\n\n/**\n * A fixed bit size, fixed decimal unsigned value\n */\nexport class UFixed<N extends BitSize, M extends number> extends ARC4Encoded {\n /** @hidden */\n [TypeProperty]?: `arc4.UFixed<${N}x${M}>`\n\n /**\n * Create a new UFixed value\n * @param v A string representing the integer and fractional portion of the number\n */\n constructor(v?: `${number}.${number}`) {\n super()\n }\n\n /**\n * Retrieve the decoded native uint64 or biguint where the returned integer represents the fixed decimal value * (10 ^ M)\n */\n get native(): NativeForArc4Int<N> {\n throw new NoImplementation()\n }\n}\n\n/**\n * A boolean value\n */\nexport class Bool extends ARC4Encoded {\n /** @hidden */\n [TypeProperty]?: 'arc4.Bool'\n\n /**\n * Create a new Bool value\n * @param v The native boolean to initialize this value from\n */\n constructor(v?: boolean) {\n super()\n }\n\n /**\n * Get the decoded native boolean for this value\n */\n get native(): boolean {\n throw new NoImplementation()\n }\n}\n\n/**\n * A base type for arc4 array types\n */\nabstract class Arc4ArrayBase<TItem extends ARC4Encoded> extends ARC4Encoded implements ConcatArray<TItem> {\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 /** @deprecated Array slicing is not yet supported in Algorand TypeScript\n * Create a new Dynamic array with all items from this array\n */\n slice(): Array<TItem>\n /** @deprecated Array slicing is not yet supported in Algorand TypeScript\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): Array<TItem>\n /** @deprecated Array slicing is not yet supported in Algorand TypeScript\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): Array<TItem>\n slice(start?: Uint64Compat, end?: Uint64Compat): Array<TItem> {\n throw new NoImplementation()\n }\n\n /**\n * Creates a string by concatenating all the items in the array delimited by the\n * specified separator (or ',' by default)\n * @param separator\n * @deprecated Join is not supported in Algorand TypeScript\n */\n join(separator?: string): string {\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/**\n * A fixed sized array of arc4 items\n * @typeParam TItem The type of a single item in the array\n * @typeParam TLength The fixed length of the array\n */\nexport class StaticArray<TItem extends ARC4Encoded, TLength extends number> extends Arc4ArrayBase<TItem> {\n /** @hidden */\n [TypeProperty]?: `arc4.StaticArray<${TItem[typeof TypeProperty]}, ${TLength}>`\n\n /**\n * Create a new StaticArray instance\n */\n constructor()\n /**\n * Create a new StaticArray instance with the specified items\n * @param items The initial items for the array\n */\n constructor(...items: TItem[] & { length: TLength })\n constructor(...items: TItem[] & { length: TLength }) {\n super()\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: Arc4ArrayBase<TItem>): DynamicArray<TItem> {\n throw new NoImplementation()\n }\n}\n\n/**\n * A dynamic sized array of arc4 items\n * @typeParam TItem The type of a single item in the array\n */\nexport class DynamicArray<TItem extends ARC4Encoded> extends Arc4ArrayBase<TItem> {\n /** @hidden */\n [TypeProperty]?: `arc4.DynamicArray<${TItem[typeof TypeProperty]}>`\n\n /**\n * Create a new DynamicArray with the specified items\n * @param items The initial items for the array\n */\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 /**\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: Arc4ArrayBase<TItem>): DynamicArray<TItem> {\n throw new NoImplementation()\n }\n}\n\n/**\n * @hidden\n */\ntype ExpandTupleType<T extends readonly 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\n/**\n * An arc4 encoded tuple of values\n * @typeParam TTuple A type representing the native tuple of item types\n */\nexport class Tuple<const TTuple extends readonly [ARC4Encoded, ...ARC4Encoded[]]> extends ARC4Encoded {\n /** @hidden */\n [TypeProperty]?: `arc4.Tuple<${ExpandTupleType<TTuple>}>`\n\n /**\n * Create a new Tuple with the default zero values for items\n */\n constructor()\n /**\n * Create a new Tuple with the specified items\n * @param items The tuple items\n */\n constructor(...items: TTuple)\n constructor(...items: TTuple | []) {\n super()\n }\n\n /**\n * Returns the item at the specified index\n * @param index The index of the item to get. Must be a positive literal representing a tuple index\n */\n at<TIndex extends keyof TTuple>(index: TIndex): TTuple[TIndex] {\n throw new NoImplementation()\n }\n\n /**\n * Returns the length of this tuple\n */\n get length(): TTuple['length'] & uint64 {\n throw new NoImplementation()\n }\n\n /**\n * Returns the decoded native tuple (with arc4 encoded items)\n */\n get native(): TTuple {\n throw new NoImplementation()\n }\n}\n\n/**\n * A 32 byte Algorand Address\n */\nexport class Address extends Arc4ArrayBase<Byte> {\n /** @hidden */\n [TypeProperty]?: 'arc4.Address'\n\n /**\n * Create a new Address instance\n * @param value An Account, base 32 address string, or the address bytes\n */\n constructor(value?: Account | string | bytes) {\n super()\n }\n\n /**\n * Returns an Account instance for this Address\n */\n get native(): Account {\n throw new NoImplementation()\n }\n}\n\n/**\n * The base type for arc4 structs\n */\nclass StructBase<T> extends ARC4Encoded {\n /** @hidden */\n [TypeProperty]?: 'arc4.Struct'\n\n get native(): T {\n throw new NoImplementation()\n }\n}\n\n/**\n * Type alias for the Struct constructor function\n * @typeParam T The shape of the arc4 struct\n */\ntype StructConstructor = {\n new <T extends Record<string, ARC4Encoded>>(initial: T): StructBase<T> & T\n}\n\n/**\n * The base type of arc4 structs\n *\n * Usage:\n * ```\n * class MyStruct extends Struct<{ x: Uint8, y: Str, z: DynamicBytes }> { }\n * ```\n */\nexport const Struct = StructBase as unknown as StructConstructor\n\n/**\n * A variable length sequence of bytes prefixed with its length expressed as a 2 byte uint\n */\nexport class DynamicBytes extends Arc4ArrayBase<Byte> {\n /** @hidden */\n [TypeProperty]?: 'arc4.DynamicBytes'\n\n /**\n * Create a new DynamicBytes instance\n * @param value The bytes or utf8 interpreted string to initialize this type\n */\n constructor(value?: bytes | string) {\n super()\n }\n\n /**\n * Get the native bytes value (excludes the length prefix)\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: Arc4ArrayBase<Byte>): DynamicBytes {\n throw new NoImplementation()\n }\n}\n\n/**\n * A fixed length sequence of bytes\n */\nexport class StaticBytes<TLength extends uint64 = 0> extends Arc4ArrayBase<Byte> {\n /** @hidden */\n [TypeProperty]?: `arc4.StaticBytes<${TLength}>`\n\n /**\n * Create a new StaticBytes instance from native bytes\n * @param value The bytes\n */\n constructor(value: bytes<TLength>)\n /**\n * Create a new StaticBytes instance from a utf8 string\n * @param value A string\n */\n constructor(value: string)\n /**\n * Create a new StaticBytes instance of length 0\n */\n constructor()\n constructor(value?: bytes | string) {\n super()\n }\n\n /**\n * Get the native bytes value\n */\n get native(): bytes<TLength> {\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: Arc4ArrayBase<Byte>): DynamicBytes {\n throw new NoImplementation()\n }\n}\n","import { BaseContract } from '../base-contract'\nimport { NoImplementation } from '../internal/errors'\nimport { AnyFunction, DeliberateAny, InstanceMethod } from '../internal/typescript-helpers'\nimport { OnCompleteActionStr } from '../on-complete-action'\nimport { bytes, BytesCompat, uint64 } from '../primitives'\nimport { ARC4Encoded } from './encoded-types'\n\nexport * from './c2c'\nexport * from './encoded-types'\n\n/**\n * The base type for all ARC4 contracts in Algorand TypeScript\n */\nexport class Contract extends BaseContract {\n /**\n * Default implementation of an ARC4 approval program, routes transactions to ABI or bare methods based on application\n * args and on completion actions\n */\n override approvalProgram(): boolean {\n throw new NoImplementation()\n }\n}\n\n/**\n * Defines conventional routing method names. When used, methods with these names will be implicitly routed to the corresponding\n * application lifecycle event.\n *\n * @remarks This behaviour is independent of a contract explicitly implementing this interface. The interface is provided simply to improve\n * the developer experience of using this feature.\n */\nexport interface ConventionalRouting {\n /**\n * The function to invoke when closing out of this application\n */\n closeOutOfApplication?: AnyFunction\n /**\n * The function to invoke when creating this application\n */\n createApplication?: AnyFunction\n /**\n * The function to invoke when deleting this application\n */\n deleteApplication?: AnyFunction\n /**\n * The function to invoke when opting in to this application\n */\n optInToApplication?: AnyFunction\n /**\n * The function to invoke when updating this application\n */\n updateApplication?: AnyFunction\n}\n\n/**\n * The possible options for a method being available on application create\n *\n * allow: This method CAN be called when the application is being created, but it is not required\n * disallow: This method CANNOT be called when the application is being created\n * require: This method CAN ONLY be called when the application is being created\n */\nexport type CreateOptions = 'allow' | 'disallow' | 'require'\n\n/**\n * Type alias for a default argument schema\n * @typeParam TContract The type of the contract containing the method this default argument is for\n */\nexport type DefaultArgument<TContract extends Contract> =\n | {\n /**\n * A compile time constant value to be used as a default\n */\n constant: string | boolean | number | bigint\n }\n | {\n /**\n * Retrieve the default value from a member of this contract. The member can be\n *\n * LocalState: The value is retrieved from the calling user's local state before invoking this method\n * GlobalState: The value is retrieved from the specified global state key before invoking this method\n * Method: Any readonly abimethod with no arguments can be used as a source\n */\n from: keyof TContract\n }\n/**\n * Configuration options for an abi method\n * @typeParam TContract the type of the contract this method is a part of\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 * The resource encoding to use for this method. The default is 'value'\n *\n * foreign_index: Application, Asset, and Account arguments are included in the transaction's relevant foreign array. The argument\n * value is the uint8 index of the resource in the that array.\n * value: Application, Asset and Account arguments are passed by their uint64 id (Application and Asset) or bytes[32] address (Account).\n * The resource must still be 'available' to this transaction but can take advantage of resource sharing within the transaction group.\n */\n resourceEncoding?: 'foreign_index' | 'value'\n\n /**\n * Specify default arguments that can be populated by clients calling this method.\n *\n * A map of parameter names to the default argument source\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 The config for this abi method\n * @typeParam TContract the type of the contract this method is a part of\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\n/**\n * Configuration options for a bare method\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 The config for this bare method\n * @typeParam TContract the type of the contract this method is a part of\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 * 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 contract method reference. (Eg. `MyContract.prototype.myMethod`)\n * @returns The ARC4 method selector. Eg. `02BECE11`\n */\nexport function methodSelector(methodSignature: InstanceMethod<Contract>): bytes<4>\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 string (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<4>\nexport function methodSelector(methodSignature: string | InstanceMethod<Contract>): bytes<4> {\n throw new NoImplementation()\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<const T>(value: T): bytes {\n throw new NoImplementation()\n}\n\n/**\n * Return the total number of bytes required to store T as ARC4 bytes.\n *\n * T must represent a type with a fixed length encoding scheme.\n * @typeParam T Any native or arc4 type with a fixed encoding size.\n */\nexport function arc4EncodedLength<T>(): uint64 {\n throw new NoImplementation()\n}\n"],"names":[],"mappings":";;AAKA;;AAEG;MACmB,YAAY,CAAA;AAMhC;;AAEG;IACI,iBAAiB,GAAA;AACtB,QAAA,OAAO,IAAI;;AAEd;AA6DD;;;AAGG;AACG,SAAU,QAAQ,CAAC,OAAwB,EAAA;AAC/C,IAAA,OAAO,CAAyC,QAAW,EAAE,GAA0B,KAAI;QACzF,MAAM,IAAI,gBAAgB,EAAE;AAC9B,KAAC;AACH;;ACQA;;;;AAIG;AACa,SAAA,WAAW,CACzB,QAAmC,EACnC,OAAgC,EAAA;IAEhC,MAAM,IAAI,gBAAgB,EAAE;AAC9B;AAEA;;;;AAIG;AACa,SAAA,OAAO,CACrB,MAAgD,EAChD,MAAyC,EAAA;IAEzC,MAAM,IAAI,g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;AACG,SAAU,UAAU,CAAU,KAAQ,EAAA;IAC1C,MAAM,IAAI,gBAAgB,EAAE;AAC9B;AAEA;;;;;AAKG;SACa,iBAAiB,GAAA;IAC/B,MAAM,IAAI,gBAAgB,EAAE;AAC9B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import { N as NoImplementation } from './errors-Bg4n2Chz.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-Dbcue2tX.js';
3
- export { B as BaseContract, C as Contract, a as abimethod, i as arc4, b as baremethod, c as contract } from './index-Dsr3xdFj.js';
3
+ export { B as BaseContract, C as Contract, a as abimethod, i as arc4, b as baremethod, c as contract } from './index-C9UF0TqG.js';
4
4
 
5
5
  function Uint64(v) {
6
6
  throw new NoImplementation();
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "**"
5
5
  ],
6
6
  "name": "@algorandfoundation/algorand-typescript",
7
- "version": "1.0.0-alpha.68",
7
+ "version": "1.0.0-alpha.70",
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": {
@@ -1 +0,0 @@
1
- {"version":3,"file":"index-Dsr3xdFj.js","sources":["../src/base-contract.ts","../src/arc4/encoded-types.ts","../src/arc4/c2c.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\n/**\n * The base type for all Algorand TypeScript contracts\n */\nexport abstract class BaseContract {\n /**\n * The program to be run when the On Completion Action is != ClearState (3)\n */\n public abstract approvalProgram(): boolean | uint64\n\n /**\n * The program to be run when the On Completion Action is == ClearState (3)\n */\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\n/**\n * Additional configuration options for a contract\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, StringCompat, uint64, Uint64Compat } from '../primitives'\nimport { Account } from '../reference'\n\n/**\n * Defines UintN bit sizes which are compatible with the uint64 type\n */\ntype UintBitSize = 8 | 16 | 24 | 32 | 40 | 48 | 56 | 64\n/**\n * Defines UintN bit sizes which are only compatible with the biguint type\n */\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\n/**\n * Defines supported bit sizes for the UintN and UFixed types\n */\nexport type BitSize = UintBitSize | BigUintBitSize\n/**\n * Conditional type which returns the native equivalent type for a given UintN bit size\n */\ntype NativeForArc4Int<N extends BitSize> = N extends UintBitSize ? uint64 : biguint\n/**\n * Conditional type which returns the compat type relevant to a given UintN bit size\n */\ntype CompatForArc4Int<N extends BitSize> = N extends UintBitSize ? Uint64Compat : BigUintCompat\n\n/**\n * @hidden\n */\nconst TypeProperty = Symbol('ARC4Type')\n\n/**\n * A base type for ARC4 encoded values\n */\nexport abstract class ARC4Encoded implements BytesBacked {\n /**\n * @hidden\n *\n * Since TypeScript is structurally typed, different ARC4Encodeds with compatible\n * structures will often be assignable to one and another and this is generally\n * not desirable. The TypeProperty property should be used to declare a literal value\n * (usually the class name) on each distinct ARC4Encoded class to ensure they are\n * structurally different.\n */\n abstract [TypeProperty]?: string\n\n /**\n * Retrieve the encoded bytes for this type\n */\n get bytes(): bytes {\n throw new NoImplementation()\n }\n}\n\n/**\n * A utf8 encoded string prefixed with its length expressed as a 2 byte uint\n */\nexport class Str extends ARC4Encoded {\n /** @hidden */\n [TypeProperty]?: 'arc4.Str'\n\n /**\n * Create a new Str instance\n * @param s The native string to initialize this Str from\n */\n constructor(s?: StringCompat) {\n super()\n }\n\n /**\n * Retrieve the decoded native string\n */\n get native(): string {\n throw new NoImplementation()\n }\n}\n\n/**\n * A fixed bit size unsigned int\n */\nexport class Uint<N extends BitSize> extends ARC4Encoded {\n /** @hidden */\n [TypeProperty]?: `arc4.Uint<${N}>`\n\n /**\n * Create a new UintN instance\n * @param v The native uint64 or biguint value to initialize this UintN from\n */\n constructor(v?: CompatForArc4Int<N>) {\n super()\n }\n\n /**\n * Retrieve the decoded native uint64 or biguint\n */\n get native(): NativeForArc4Int<N> {\n throw new NoImplementation()\n }\n}\n\n/**\n * An alias for Uint<8>\n */\nexport class Byte extends Uint<8> {}\n\n/**\n * An alias for Uint<8>\n */\nexport class Uint8 extends Uint<8> {}\n\n/**\n * An alias for Uint<16>\n */\nexport class Uint16 extends Uint<16> {}\n\n/**\n * An alias for Uint<32>\n */\nexport class Uint32 extends Uint<32> {}\n\n/**\n * An alias for Uint<64>\n */\nexport class Uint64 extends Uint<64> {}\n\n/**\n * An alias for Uint<128>\n */\nexport class Uint128 extends Uint<128> {}\n\n/**\n * An alias for Uint<256>\n */\nexport class Uint256 extends Uint<256> {}\n\n/**\n * A fixed bit size, fixed decimal unsigned value\n */\nexport class UFixed<N extends BitSize, M extends number> extends ARC4Encoded {\n /** @hidden */\n [TypeProperty]?: `arc4.UFixed<${N}x${M}>`\n\n /**\n * Create a new UFixed value\n * @param v A string representing the integer and fractional portion of the number\n */\n constructor(v?: `${number}.${number}`) {\n super()\n }\n\n /**\n * Retrieve the decoded native uint64 or biguint where the returned integer represents the fixed decimal value * (10 ^ M)\n */\n get native(): NativeForArc4Int<N> {\n throw new NoImplementation()\n }\n}\n\n/**\n * A boolean value\n */\nexport class Bool extends ARC4Encoded {\n /** @hidden */\n [TypeProperty]?: 'arc4.Bool'\n\n /**\n * Create a new Bool value\n * @param v The native boolean to initialize this value from\n */\n constructor(v?: boolean) {\n super()\n }\n\n /**\n * Get the decoded native boolean for this value\n */\n get native(): boolean {\n throw new NoImplementation()\n }\n}\n\n/**\n * A base type for arc4 array types\n */\nabstract class Arc4ArrayBase<TItem extends ARC4Encoded> extends ARC4Encoded implements ConcatArray<TItem> {\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 /** @deprecated Array slicing is not yet supported in Algorand TypeScript\n * Create a new Dynamic array with all items from this array\n */\n slice(): Array<TItem>\n /** @deprecated Array slicing is not yet supported in Algorand TypeScript\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): Array<TItem>\n /** @deprecated Array slicing is not yet supported in Algorand TypeScript\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): Array<TItem>\n slice(start?: Uint64Compat, end?: Uint64Compat): Array<TItem> {\n throw new NoImplementation()\n }\n\n /**\n * Creates a string by concatenating all the items in the array delimited by the\n * specified separator (or ',' by default)\n * @param separator\n * @deprecated Join is not supported in Algorand TypeScript\n */\n join(separator?: string): string {\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/**\n * A fixed sized array of arc4 items\n * @typeParam TItem The type of a single item in the array\n * @typeParam TLength The fixed length of the array\n */\nexport class StaticArray<TItem extends ARC4Encoded, TLength extends number> extends Arc4ArrayBase<TItem> {\n /** @hidden */\n [TypeProperty]?: `arc4.StaticArray<${TItem[typeof TypeProperty]}, ${TLength}>`\n\n /**\n * Create a new StaticArray instance\n */\n constructor()\n /**\n * Create a new StaticArray instance with the specified items\n * @param items The initial items for the array\n */\n constructor(...items: TItem[] & { length: TLength })\n constructor(...items: TItem[] & { length: TLength }) {\n super()\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: Arc4ArrayBase<TItem>): DynamicArray<TItem> {\n throw new NoImplementation()\n }\n}\n\n/**\n * A dynamic sized array of arc4 items\n * @typeParam TItem The type of a single item in the array\n */\nexport class DynamicArray<TItem extends ARC4Encoded> extends Arc4ArrayBase<TItem> {\n /** @hidden */\n [TypeProperty]?: `arc4.DynamicArray<${TItem[typeof TypeProperty]}>`\n\n /**\n * Create a new DynamicArray with the specified items\n * @param items The initial items for the array\n */\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 /**\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: Arc4ArrayBase<TItem>): DynamicArray<TItem> {\n throw new NoImplementation()\n }\n}\n\n/**\n * @hidden\n */\ntype ExpandTupleType<T extends readonly 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\n/**\n * An arc4 encoded tuple of values\n * @typeParam TTuple A type representing the native tuple of item types\n */\nexport class Tuple<const TTuple extends readonly [ARC4Encoded, ...ARC4Encoded[]]> extends ARC4Encoded {\n /** @hidden */\n [TypeProperty]?: `arc4.Tuple<${ExpandTupleType<TTuple>}>`\n\n /**\n * Create a new Tuple with the default zero values for items\n */\n constructor()\n /**\n * Create a new Tuple with the specified items\n * @param items The tuple items\n */\n constructor(...items: TTuple)\n constructor(...items: TTuple | []) {\n super()\n }\n\n /**\n * Returns the item at the specified index\n * @param index The index of the item to get. Must be a positive literal representing a tuple index\n */\n at<TIndex extends keyof TTuple>(index: TIndex): TTuple[TIndex] {\n throw new NoImplementation()\n }\n\n /**\n * Returns the length of this tuple\n */\n get length(): TTuple['length'] & uint64 {\n throw new NoImplementation()\n }\n\n /**\n * Returns the decoded native tuple (with arc4 encoded items)\n */\n get native(): TTuple {\n throw new NoImplementation()\n }\n}\n\n/**\n * A 32 byte Algorand Address\n */\nexport class Address extends Arc4ArrayBase<Byte> {\n /** @hidden */\n [TypeProperty]?: 'arc4.Address'\n\n /**\n * Create a new Address instance\n * @param value An Account, base 32 address string, or the address bytes\n */\n constructor(value?: Account | string | bytes) {\n super()\n }\n\n /**\n * Returns an Account instance for this Address\n */\n get native(): Account {\n throw new NoImplementation()\n }\n}\n\n/**\n * The base type for arc4 structs\n */\nclass StructBase<T> extends ARC4Encoded {\n /** @hidden */\n [TypeProperty]?: 'arc4.Struct'\n\n get native(): T {\n throw new NoImplementation()\n }\n}\n\n/**\n * Type alias for the Struct constructor function\n * @typeParam T The shape of the arc4 struct\n */\ntype StructConstructor = {\n new <T extends Record<string, ARC4Encoded>>(initial: T): StructBase<T> & T\n}\n\n/**\n * The base type of arc4 structs\n *\n * Usage:\n * ```\n * class MyStruct extends Struct<{ x: Uint8, y: Str, z: DynamicBytes }> { }\n * ```\n */\nexport const Struct = StructBase as unknown as StructConstructor\n\n/**\n * A variable length sequence of bytes prefixed with its length expressed as a 2 byte uint\n */\nexport class DynamicBytes extends Arc4ArrayBase<Byte> {\n /** @hidden */\n [TypeProperty]?: 'arc4.DynamicBytes'\n\n /**\n * Create a new DynamicBytes instance\n * @param value The bytes or utf8 interpreted string to initialize this type\n */\n constructor(value?: bytes | string) {\n super()\n }\n\n /**\n * Get the native bytes value (excludes the length prefix)\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: Arc4ArrayBase<Byte>): DynamicBytes {\n throw new NoImplementation()\n }\n}\n\n/**\n * A fixed length sequence of bytes\n */\nexport class StaticBytes<TLength extends uint64 = 0> extends Arc4ArrayBase<Byte> {\n /** @hidden */\n [TypeProperty]?: `arc4.StaticBytes<${TLength}>`\n\n /**\n * Create a new StaticBytes instance from native bytes\n * @param value The bytes\n */\n constructor(value: bytes<TLength>)\n /**\n * Create a new StaticBytes instance from a utf8 string\n * @param value A string\n */\n constructor(value: string)\n /**\n * Create a new StaticBytes instance of length 0\n */\n constructor()\n constructor(value?: bytes | string) {\n super()\n }\n\n /**\n * Get the native bytes value\n */\n get native(): bytes<TLength> {\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: Arc4ArrayBase<Byte>): DynamicBytes {\n throw new NoImplementation()\n }\n}\n","import { CompileContractOptions, CompiledContract } from '../compiled'\nimport { gtxn } from '../gtxn'\nimport { NoImplementation } from '../internal/errors'\nimport { AnyFunction, ConstructorFor, DeliberateAny, InstanceMethod } from '../internal/typescript-helpers'\nimport { itxn } from '../itxn'\nimport { Contract } from './index'\n\n/**\n * Defines txn fields that are available for a bare create application call.\n *\n * This is the regular application call fields minus:\n * - appId: because the appId is not known when creating an application\n * - appArgs: because a bare call cannot have arguments\n */\nexport type BareCreateApplicationCallFields = Omit<itxn.ApplicationCallFields, 'appId' | 'appArgs'>\n\n/**\n * Conditional type which given a group transaction type, returns the equivalent inner transaction\n * params type.\n */\nexport type GtxnToItxnFields<T extends gtxn.Transaction> = T extends gtxn.PaymentTxn\n ? itxn.PaymentItxnParams\n : T extends gtxn.KeyRegistrationTxn\n ? itxn.KeyRegistrationItxnParams\n : T extends gtxn.AssetConfigTxn\n ? itxn.AssetConfigItxnParams\n : T extends gtxn.AssetTransferTxn\n ? itxn.AssetTransferItxnParams\n : T extends gtxn.AssetFreezeTxn\n ? itxn.AssetFreezeItxnParams\n : T extends gtxn.ApplicationCallTxn\n ? itxn.ApplicationCallItxnParams\n : itxn.ItxnParams\n\n/**\n * Conditional type which given an application argument, returns the input type for that argument.\n *\n * The input type will usually be the original type apart from group transactions which will be substituted\n * with their equivalent inner transaction type.\n */\nexport type TypedApplicationArg<TArg> = TArg extends gtxn.Transaction ? GtxnToItxnFields<TArg> : TArg\n\n/**\n * Conditional type which maps a tuple of application arguments to a tuple of input types for specifying those arguments.\n */\nexport type TypedApplicationArgs<TArgs> = TArgs extends []\n ? []\n : TArgs extends [infer TArg, ...infer TRest]\n ? readonly [TypedApplicationArg<TArg>, ...TypedApplicationArgs<TRest>]\n : never\n\n/**\n * Application call fields with `appArgs` replaced with an `args` property that is strongly typed to the actual arguments for the\n * given application call.\n */\nexport type TypedApplicationCallFields<TArgs> = Omit<itxn.ApplicationCallFields, 'appArgs'> &\n (TArgs extends [] ? { readonly args?: TypedApplicationArgs<TArgs> } : { readonly args: TypedApplicationArgs<TArgs> })\n\n/**\n * The response type of a typed application call. Includes the raw itxn result object and the parsed ABI return value if applicable.\n */\nexport type TypedApplicationCallResponse<TReturn> = TReturn extends void\n ? { readonly itxn: itxn.ApplicationCallInnerTxn }\n : { readonly itxn: itxn.ApplicationCallInnerTxn; readonly returnValue: TReturn }\n\n/**\n * Conditional type which maps an ABI method to a factory method for constructing an application call transaction to call that method.\n */\nexport type ContractProxyMethod<TMethod> = TMethod extends (...args: infer TArgs) => infer TReturn\n ? (fields?: TypedApplicationCallFields<TArgs>) => TypedApplicationCallResponse<TReturn>\n : never\n\n/**\n * Conditional type which maps an ARC4 compatible contract to a proxy object which allows for constructing application call transactions for\n * all available ABI and bare methods. Also includes the compiled contract result data.\n */\nexport type ContractProxy<TContract extends Contract> = CompiledContract & {\n /**\n * Get methods for calling ABI and bare methods on the target contract\n */\n call: {\n /**\n * Invoke this method via an inner transaction call\n */\n [key in keyof TContract as key extends 'approvalProgram' | 'clearStateProgram'\n ? never\n : TContract[key] extends AnyFunction\n ? key\n : never]: ContractProxyMethod<TContract[key]>\n }\n /**\n * Create a bare application call itxn to create the contract.\n * @param fields Specify values for transaction fields which should override the default values.\n */\n bareCreate(fields?: BareCreateApplicationCallFields): itxn.ApplicationCallInnerTxn\n}\n\n/**\n * Pre compile the target ARC4 contract and return a proxy object for constructing inner transactions to call an instance of that contract.\n * @param contract An ARC4 contract class\n * @param options Compile contract arguments\n */\nexport function compileArc4<TContract extends Contract>(\n contract: ConstructorFor<TContract>,\n options?: CompileContractOptions,\n): ContractProxy<TContract> {\n throw new NoImplementation()\n}\n\n/**\n * Invokes the target ABI method using a strongly typed fields object.\n * @param method An ABI method function reference.\n * @param fields Specify values for transaction fields.\n */\nexport function abiCall<TArgs extends DeliberateAny[], TReturn>(\n method: InstanceMethod<Contract, TArgs, TReturn>,\n fields: TypedApplicationCallFields<TArgs>,\n): TypedApplicationCallResponse<TReturn> {\n throw new NoImplementation()\n}\n","import { BaseContract } from '../base-contract'\nimport { NoImplementation } from '../internal/errors'\nimport { AnyFunction, DeliberateAny, InstanceMethod } from '../internal/typescript-helpers'\nimport { OnCompleteActionStr } from '../on-complete-action'\nimport { bytes, BytesCompat, uint64 } from '../primitives'\nimport { ARC4Encoded } from './encoded-types'\n\nexport * from './encoded-types'\nexport * from './c2c'\n\n/**\n * The base type for all ARC4 contracts in Algorand TypeScript\n */\nexport class Contract extends BaseContract {\n /**\n * Default implementation of an ARC4 approval program, routes transactions to ABI or bare methods based on application\n * args and on completion actions\n */\n override approvalProgram(): boolean {\n throw new NoImplementation()\n }\n}\n\n/**\n * Defines conventional routing method names. When used, methods with these names will be implicitly routed to the corresponding\n * application lifecycle event.\n *\n * @remarks This behaviour is independent of a contract explicitly implementing this interface. The interface is provided simply to improve\n * the developer experience of using this feature.\n */\nexport interface ConventionalRouting {\n /**\n * The function to invoke when closing out of this application\n */\n closeOutOfApplication?: AnyFunction\n /**\n * The function to invoke when creating this application\n */\n createApplication?: AnyFunction\n /**\n * The function to invoke when deleting this application\n */\n deleteApplication?: AnyFunction\n /**\n * The function to invoke when opting in to this application\n */\n optInToApplication?: AnyFunction\n /**\n * The function to invoke when updating this application\n */\n updateApplication?: AnyFunction\n}\n\n/**\n * The possible options for a method being available on application create\n *\n * allow: This method CAN be called when the application is being created, but it is not required\n * disallow: This method CANNOT be called when the application is being created\n * require: This method CAN ONLY be called when the application is being created\n */\nexport type CreateOptions = 'allow' | 'disallow' | 'require'\n\n/**\n * Type alias for a default argument schema\n * @typeParam TContract The type of the contract containing the method this default argument is for\n */\nexport type DefaultArgument<TContract extends Contract> =\n | {\n /**\n * A compile time constant value to be used as a default\n */\n constant: string | boolean | number | bigint\n }\n | {\n /**\n * Retrieve the default value from a member of this contract. The member can be\n *\n * LocalState: The value is retrieved from the calling user's local state before invoking this method\n * GlobalState: The value is retrieved from the specified global state key before invoking this method\n * Method: Any readonly abimethod with no arguments can be used as a source\n */\n from: keyof TContract\n }\n/**\n * Configuration options for an abi method\n * @typeParam TContract the type of the contract this method is a part of\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 /**\n * Specify default arguments that can be populated by clients calling this method.\n *\n * A map of parameter names to the default argument source\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 The config for this abi method\n * @typeParam TContract the type of the contract this method is a part of\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\n/**\n * Configuration options for a bare method\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 The config for this bare method\n * @typeParam TContract the type of the contract this method is a part of\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 * 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 contract method reference. (Eg. `MyContract.prototype.myMethod`)\n * @returns The ARC4 method selector. Eg. `02BECE11`\n */\nexport function methodSelector(methodSignature: InstanceMethod<Contract>): bytes<4>\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 string (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<4>\nexport function methodSelector(methodSignature: string | InstanceMethod<Contract>): bytes<4> {\n throw new NoImplementation()\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<const T>(value: T): bytes {\n throw new NoImplementation()\n}\n\n/**\n * Return the total number of bytes required to store T as ARC4 bytes.\n *\n * T must represent a type with a fixed length encoding scheme.\n * @typeParam T Any native or arc4 type with a fixed encoding size.\n */\nexport function arc4EncodedLength<T>(): uint64 {\n throw new NoImplementation()\n}\n"],"names":[],"mappings":";;AAKA;;AAEG;MACmB,YAAY,CAAA;AAMhC;;AAEG;IACI,iBAAiB,GAAA;AACtB,QAAA,OAAO,IAAI;;AAEd;AA6DD;;;AAGG;AACG,SAAU,QAAQ,CAAC,OAAwB,EAAA;AAC/C,IAAA,OAAO,CAAyC,QAAW,EAAE,GAA0B,KAAI;QACzF,MAAM,IAAI,gBAAgB,EAAE;AAC9B,KAAC;AACH;;ACRA;;AAEG;AACH,MAAM,YAAY,GAAG,MAAM,CAAC,UAAU,CAAC;AAEvC;;AAEG;MACmB,WAAW,CAAA;AAY/B;;AAEG;AACH,IAAA,IAAI,KAAK,GAAA;QACP,MAAM,IAAI,gBAAgB,EAAE;;AAE/B;AAED;;AAEG;AACG,MAAO,GAAI,SAAQ,WAAW,CAAA;;IAElC,CAAC,YAAY;AAEb;;;AAGG;AACH,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