@algorandfoundation/algorand-typescript-testing 1.0.0-alpha.8 → 1.0.0-beta.1

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.
Files changed (43) hide show
  1. package/abi-metadata.d.ts +7 -2
  2. package/constants.d.ts +21 -1
  3. package/context-helpers/context-util.d.ts +3 -0
  4. package/context-helpers/internal-context.d.ts +2 -2
  5. package/encoders.d.ts +6 -17
  6. package/impl/acct-params.d.ts +2 -1
  7. package/impl/base.d.ts +3 -3
  8. package/impl/compiled.d.ts +3 -0
  9. package/impl/emit.d.ts +1 -0
  10. package/impl/encoded-types.d.ts +183 -0
  11. package/impl/ensure-budget.d.ts +2 -0
  12. package/impl/index.d.ts +5 -4
  13. package/impl/inner-transactions.d.ts +2 -17
  14. package/impl/logicSigArg.d.ts +2 -0
  15. package/impl/match.d.ts +3 -0
  16. package/impl/pure.d.ts +1 -0
  17. package/impl/template-var.d.ts +1 -0
  18. package/impl/transactions.d.ts +4 -10
  19. package/impl/urange.d.ts +2 -0
  20. package/index.d.ts +14 -0
  21. package/index.mjs +811 -910
  22. package/index.mjs.map +1 -1
  23. package/package.json +7 -5
  24. package/runtime-helpers-DEtwEuFb.js +2238 -0
  25. package/runtime-helpers-DEtwEuFb.js.map +1 -0
  26. package/runtime-helpers.d.ts +8 -0
  27. package/runtime-helpers.mjs +9 -2
  28. package/runtime-helpers.mjs.map +1 -1
  29. package/subcontexts/contract-context.d.ts +3 -6
  30. package/subcontexts/ledger-context.d.ts +3 -2
  31. package/subcontexts/transaction-context.d.ts +8 -3
  32. package/test-execution-context.d.ts +11 -38
  33. package/test-transformer/helpers.d.ts +1 -0
  34. package/test-transformer/index.mjs +199 -41
  35. package/test-transformer/index.mjs.map +1 -1
  36. package/test-transformer/node-factory.d.ts +5 -2
  37. package/typescript-helpers.d.ts +7 -0
  38. package/util.d.ts +11 -8
  39. package/value-generators/arc4.d.ts +70 -0
  40. package/value-generators/avm.d.ts +2 -1
  41. package/value-generators/index.d.ts +2 -0
  42. package/runtime-helpers-C_HAST0y.js +0 -514
  43. package/runtime-helpers-C_HAST0y.js.map +0 -1
package/abi-metadata.d.ts CHANGED
@@ -2,15 +2,20 @@ import { BaseContract, Contract } from '@algorandfoundation/algorand-typescript'
2
2
  import { AbiMethodConfig, BareMethodConfig, CreateOptions, OnCompleteActionStr } from '@algorandfoundation/algorand-typescript/arc4';
3
3
  export interface AbiMetadata {
4
4
  methodName: string;
5
- methodSelector: string;
5
+ methodSignature: string | undefined;
6
6
  argTypes: string[];
7
7
  returnType: string;
8
8
  onCreate?: CreateOptions;
9
9
  allowActions?: OnCompleteActionStr[];
10
10
  }
11
+ export declare const isContractProxy: unique symbol;
11
12
  export declare const attachAbiMetadata: (contract: {
12
13
  new (): Contract;
13
14
  }, methodName: string, metadata: AbiMetadata) => void;
15
+ export declare const copyAbiMetadatas: <T extends BaseContract>(sourceContract: T, targetContract: T) => void;
14
16
  export declare const captureMethodConfig: <T extends Contract>(contract: T, methodName: string, config?: AbiMethodConfig<T> | BareMethodConfig) => void;
15
17
  export declare const hasAbiMetadata: <T extends Contract>(contract: T) => boolean;
16
- export declare const getAbiMetadata: <T extends BaseContract>(contract: T, methodName: string) => AbiMetadata;
18
+ export declare const getContractAbiMetadata: <T extends BaseContract>(contract: T) => Record<string, AbiMetadata>;
19
+ export declare const getContractMethodAbiMetadata: <T extends BaseContract>(contract: T, methodName: string) => AbiMetadata;
20
+ export declare const getArc4Signature: (metadata: AbiMetadata) => string;
21
+ export declare const getArc4Selector: (metadata: AbiMetadata) => Uint8Array;
package/constants.d.ts CHANGED
@@ -1,9 +1,14 @@
1
1
  export declare const UINT64_SIZE = 64;
2
2
  export declare const UINT512_SIZE = 512;
3
3
  export declare const MAX_UINT8: number;
4
+ export declare const MAX_UINT16: number;
5
+ export declare const MAX_UINT32: number;
4
6
  export declare const MAX_UINT64: bigint;
7
+ export declare const MAX_UINT128: bigint;
8
+ export declare const MAX_UINT256: bigint;
5
9
  export declare const MAX_UINT512: bigint;
6
10
  export declare const MAX_BYTES_SIZE = 4096;
11
+ export declare const MAX_LOG_SIZE = 1024;
7
12
  export declare const MAX_ITEMS_IN_LOG = 32;
8
13
  export declare const MAX_BOX_SIZE = 32768;
9
14
  export declare const BITS_IN_BYTE = 8;
@@ -12,7 +17,6 @@ export declare const DEFAULT_MAX_TXN_LIFE = 1000;
12
17
  export declare const DEFAULT_ASSET_CREATE_MIN_BALANCE = 1000000;
13
18
  export declare const DEFAULT_ASSET_OPT_IN_MIN_BALANCE = 10000;
14
19
  export declare const DEFAULT_GLOBAL_GENESIS_HASH: import("@algorandfoundation/algorand-typescript").bytes;
15
- export declare const ZERO_ADDRESS_B32 = "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAY5HFKQ";
16
20
  export declare const ZERO_ADDRESS: import("@algorandfoundation/algorand-typescript").bytes;
17
21
  /**
18
22
  "\x09" # pragma version 9
@@ -24,3 +28,19 @@ export declare const MIN_TXN_FEE = 1000;
24
28
  export declare const ABI_RETURN_VALUE_LOG_PREFIX: import("@algorandfoundation/algorand-typescript").bytes;
25
29
  export declare const UINT64_OVERFLOW_UNDERFLOW_MESSAGE = "Uint64 overflow or underflow";
26
30
  export declare const BIGUINT_OVERFLOW_UNDERFLOW_MESSAGE = "BigUint overflow or underflow";
31
+ export declare const DEFAULT_TEMPLATE_VAR_PREFIX = "TMPL_";
32
+ export declare const APP_ID_PREFIX = "appID";
33
+ export declare const HASH_BYTES_LENGTH = 32;
34
+ export declare const ALGORAND_ADDRESS_BYTE_LENGTH = 36;
35
+ export declare const ALGORAND_CHECKSUM_BYTE_LENGTH = 4;
36
+ export declare const ALGORAND_ADDRESS_LENGTH = 58;
37
+ export declare const PROGRAM_TAG = "Program";
38
+ export declare const TRANSACTION_GROUP_MAX_SIZE = 16;
39
+ export declare enum OnApplicationComplete {
40
+ NoOpOC = 0,
41
+ OptInOC = 1,
42
+ CloseOutOC = 2,
43
+ ClearStateOC = 3,
44
+ UpdateApplicationOC = 4,
45
+ DeleteApplicationOC = 5
46
+ }
@@ -0,0 +1,3 @@
1
+ import { uint64 } from '@algorandfoundation/algorand-typescript';
2
+ import { AbiMetadata } from '../abi-metadata';
3
+ export declare const checkRoutingConditions: (appId: uint64, metadata: AbiMetadata) => void;
@@ -1,4 +1,4 @@
1
- import { Account, internal } from '@algorandfoundation/algorand-typescript';
1
+ import { Account, BaseContract, internal } from '@algorandfoundation/algorand-typescript';
2
2
  import { AccountData } from '../impl/account';
3
3
  import { ApplicationData } from '../impl/application';
4
4
  import { AssetData } from '../impl/asset';
@@ -20,7 +20,7 @@ declare class InternalContext {
20
20
  get activeGroup(): TransactionGroup;
21
21
  getAccountData(account: Account): AccountData;
22
22
  getAssetData(id: internal.primitives.StubUint64Compat): AssetData;
23
- getApplicationData(id: internal.primitives.StubUint64Compat): ApplicationData;
23
+ getApplicationData(id: internal.primitives.StubUint64Compat | BaseContract): ApplicationData;
24
24
  }
25
25
  export declare const lazyContext: InternalContext;
26
26
  export {};
package/encoders.d.ts CHANGED
@@ -1,21 +1,10 @@
1
- import { biguint, bytes, TransactionType, uint64 } from '@algorandfoundation/algorand-typescript';
2
- import { OnCompleteAction } from '@algorandfoundation/algorand-typescript/arc4';
3
- export interface TypeInfo {
1
+ import { bytes, internal } from '@algorandfoundation/algorand-typescript';
2
+ import { DeliberateAny } from './typescript-helpers';
3
+ export type TypeInfo = {
4
4
  name: string;
5
5
  genericArgs?: TypeInfo[] | Record<string, TypeInfo>;
6
- }
7
- type fromBytes<T> = (val: Uint8Array, typeInfo: TypeInfo) => T;
8
- export declare const encoders: {
9
- account: typeof import("./impl/base").BytesBackedCls.fromBytes;
10
- application: typeof import("./impl/base").Uint64BackedCls.fromBytes;
11
- asset: typeof import("./impl/base").Uint64BackedCls.fromBytes;
12
- 'bool(ean)?': fromBytes<boolean>;
13
- biguint: fromBytes<biguint>;
14
- bytes: fromBytes<bytes>;
15
- string: fromBytes<string>;
16
- uint64: fromBytes<uint64>;
17
- OnCompleteAction: fromBytes<OnCompleteAction>;
18
- TransactionType: fromBytes<TransactionType>;
19
6
  };
7
+ export type fromBytes<T> = (val: Uint8Array | internal.primitives.StubBytesCompat, typeInfo: TypeInfo, prefix?: 'none' | 'log') => T;
8
+ export declare const encoders: Record<string, fromBytes<DeliberateAny>>;
20
9
  export declare const getEncoder: <T>(typeInfo: TypeInfo) => fromBytes<T>;
21
- export {};
10
+ export declare const toBytes: (val: unknown) => bytes;
@@ -1,5 +1,6 @@
1
- import { Account, internal, uint64 } from '@algorandfoundation/algorand-typescript';
1
+ import { Account, Application, internal, uint64 } from '@algorandfoundation/algorand-typescript';
2
2
  export declare const getAccount: (acct: Account | internal.primitives.StubUint64Compat) => Account;
3
3
  export declare const balance: (a: Account | internal.primitives.StubUint64Compat) => uint64;
4
4
  export declare const minBalance: (a: Account | internal.primitives.StubUint64Compat) => uint64;
5
+ export declare const appOptedIn: (a: Account | internal.primitives.StubUint64Compat, b: Application | internal.primitives.StubUint64Compat) => boolean;
5
6
  export declare const AcctParams: internal.opTypes.AcctParamsType;
package/impl/base.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { bytes, uint64 } from '@algorandfoundation/algorand-typescript';
1
+ import { bytes, internal, uint64 } from '@algorandfoundation/algorand-typescript';
2
2
  import type { TypeInfo } from '../encoders';
3
3
  export declare abstract class BytesBackedCls {
4
4
  #private;
@@ -6,7 +6,7 @@ export declare abstract class BytesBackedCls {
6
6
  constructor(value: bytes, _typeInfo?: TypeInfo);
7
7
  static fromBytes<T extends BytesBackedCls>(this: {
8
8
  new (v: bytes, typeInfo?: TypeInfo): T;
9
- }, value: Uint8Array, typeInfo?: TypeInfo): T;
9
+ }, value: internal.primitives.StubBytesCompat | Uint8Array, typeInfo?: TypeInfo): T;
10
10
  }
11
11
  export declare abstract class Uint64BackedCls {
12
12
  #private;
@@ -14,5 +14,5 @@ export declare abstract class Uint64BackedCls {
14
14
  constructor(value: uint64);
15
15
  static fromBytes<T extends Uint64BackedCls>(this: {
16
16
  new (v: uint64): T;
17
- }, value: Uint8Array): T;
17
+ }, value: internal.primitives.StubBytesCompat | Uint8Array): T;
18
18
  }
@@ -0,0 +1,3 @@
1
+ import { BaseContract, CompileContractOptions, CompiledContract, CompiledLogicSig, CompileLogicSigOptions, LogicSig } from '@algorandfoundation/algorand-typescript';
2
+ import { ConstructorFor } from '../typescript-helpers';
3
+ export declare function compileImpl(artefact: ConstructorFor<BaseContract> | ConstructorFor<LogicSig>, options?: CompileContractOptions | CompileLogicSigOptions): CompiledLogicSig | CompiledContract;
package/impl/emit.d.ts ADDED
@@ -0,0 +1 @@
1
+ export declare function emitImpl<T>(typeInfoString: string, event: T | string, ...eventProps: unknown[]): void;
@@ -0,0 +1,183 @@
1
+ import { Account, BigUintCompat, bytes, internal, StringCompat, uint64, Uint64Compat } from '@algorandfoundation/algorand-typescript';
2
+ import { Address, ARC4Encoded, BitSize, Bool, Byte, DynamicArray, DynamicBytes, StaticArray, StaticBytes, Str, Tuple, UFixedNxM, UintN } from '@algorandfoundation/algorand-typescript/arc4';
3
+ import { fromBytes, TypeInfo } from '../encoders';
4
+ import { DeliberateAny } from '../typescript-helpers';
5
+ type CompatForArc4Int<N extends BitSize> = N extends 8 | 16 | 32 | 64 ? Uint64Compat : BigUintCompat;
6
+ export declare class UintNImpl<N extends BitSize> extends UintN<N> {
7
+ private value;
8
+ private bitSize;
9
+ typeInfo: TypeInfo;
10
+ constructor(typeInfo: TypeInfo | string, v?: CompatForArc4Int<N>);
11
+ get native(): UintN<N>["native"];
12
+ get bytes(): bytes;
13
+ equals(other: this): boolean;
14
+ static fromBytesImpl(value: internal.primitives.StubBytesCompat | Uint8Array, typeInfo: string | TypeInfo, prefix?: 'none' | 'log'): UintNImpl<BitSize>;
15
+ static getMaxBitsLength(typeInfo: TypeInfo): BitSize;
16
+ static getArc4TypeName: (t: TypeInfo) => string;
17
+ }
18
+ export declare class UFixedNxMImpl<N extends BitSize, M extends number> extends UFixedNxM<N, M> {
19
+ private value;
20
+ private bitSize;
21
+ private precision;
22
+ typeInfo: TypeInfo;
23
+ constructor(typeInfo: TypeInfo | string, v: `${number}.${number}`);
24
+ get native(): UFixedNxM<N, M>["native"];
25
+ get bytes(): bytes;
26
+ equals(other: this): boolean;
27
+ static fromBytesImpl(value: internal.primitives.StubBytesCompat | Uint8Array, typeInfo: string | TypeInfo, prefix?: 'none' | 'log'): UFixedNxM<BitSize, number>;
28
+ static getMaxBitsLength(typeInfo: TypeInfo): BitSize;
29
+ static getArc4TypeName: (t: TypeInfo) => string;
30
+ }
31
+ export declare class ByteImpl extends Byte {
32
+ typeInfo: TypeInfo;
33
+ private value;
34
+ constructor(typeInfo: TypeInfo | string, v?: CompatForArc4Int<8>);
35
+ get native(): uint64;
36
+ get bytes(): bytes;
37
+ equals(other: this): boolean;
38
+ static fromBytesImpl(value: internal.primitives.StubBytesCompat | Uint8Array, typeInfo: string | TypeInfo, prefix?: 'none' | 'log'): ByteImpl;
39
+ static getMaxBitsLength(typeInfo: TypeInfo): BitSize;
40
+ }
41
+ export declare class StrImpl extends Str {
42
+ typeInfo: TypeInfo;
43
+ private value;
44
+ constructor(typeInfo: TypeInfo | string, s?: StringCompat);
45
+ get native(): string;
46
+ get bytes(): bytes;
47
+ equals(other: this): boolean;
48
+ static fromBytesImpl(value: internal.primitives.StubBytesCompat | Uint8Array, typeInfo: string | TypeInfo, prefix?: 'none' | 'log'): StrImpl;
49
+ }
50
+ export declare class BoolImpl extends Bool {
51
+ private value;
52
+ typeInfo: TypeInfo;
53
+ constructor(typeInfo: TypeInfo | string, v?: boolean);
54
+ get native(): boolean;
55
+ equals(other: this): boolean;
56
+ get bytes(): bytes;
57
+ static fromBytesImpl(value: internal.primitives.StubBytesCompat | Uint8Array, typeInfo: string | TypeInfo, prefix?: 'none' | 'log'): BoolImpl;
58
+ }
59
+ type StaticArrayGenericArgs = {
60
+ elementType: TypeInfo;
61
+ size: TypeInfo;
62
+ };
63
+ export declare class StaticArrayImpl<TItem extends ARC4Encoded, TLength extends number> extends StaticArray<TItem, TLength> {
64
+ private value?;
65
+ private uint8ArrayValue?;
66
+ private size;
67
+ typeInfo: TypeInfo;
68
+ genericArgs: StaticArrayGenericArgs;
69
+ constructor(typeInfo: TypeInfo | string, ...items: TItem[] & {
70
+ length: TLength;
71
+ });
72
+ constructor(typeInfo: TypeInfo | string, ...items: TItem[]);
73
+ get bytes(): bytes;
74
+ equals(other: this): boolean;
75
+ get length(): uint64;
76
+ get items(): TItem[];
77
+ setItem(index: number, value: TItem): void;
78
+ copy(): StaticArrayImpl<TItem, TLength>;
79
+ get native(): TItem[];
80
+ static fromBytesImpl(value: internal.primitives.StubBytesCompat | Uint8Array, typeInfo: string | TypeInfo, prefix?: 'none' | 'log'): StaticArrayImpl<ARC4Encoded, number>;
81
+ static getMaxBytesLength(typeInfo: TypeInfo): number;
82
+ static getArc4TypeName: (t: TypeInfo) => string;
83
+ }
84
+ export declare class AddressImpl extends Address {
85
+ typeInfo: TypeInfo;
86
+ private value;
87
+ constructor(typeInfo: TypeInfo | string, value?: Account | string | bytes);
88
+ get bytes(): bytes;
89
+ equals(other: this): boolean;
90
+ get length(): uint64;
91
+ get native(): Account;
92
+ get items(): ByteImpl[];
93
+ setItem(_index: number, _value: ByteImpl): void;
94
+ static fromBytesImpl(value: internal.primitives.StubBytesCompat | Uint8Array, typeInfo: string | TypeInfo, prefix?: 'none' | 'log'): AddressImpl;
95
+ static getMaxBytesLength(typeInfo: TypeInfo): number;
96
+ }
97
+ type DynamicArrayGenericArgs = {
98
+ elementType: TypeInfo;
99
+ };
100
+ export declare class DynamicArrayImpl<TItem extends ARC4Encoded> extends DynamicArray<TItem> {
101
+ private value?;
102
+ private uint8ArrayValue?;
103
+ typeInfo: TypeInfo;
104
+ genericArgs: DynamicArrayGenericArgs;
105
+ constructor(typeInfo: TypeInfo | string, ...items: TItem[]);
106
+ get bytes(): bytes;
107
+ equals(other: this): boolean;
108
+ get length(): uint64;
109
+ get items(): TItem[];
110
+ setItem(index: number, value: TItem): void;
111
+ copy(): DynamicArrayImpl<TItem>;
112
+ get native(): TItem[];
113
+ push(...values: TItem[]): void;
114
+ pop(): TItem;
115
+ static fromBytesImpl(value: internal.primitives.StubBytesCompat | Uint8Array, typeInfo: string | TypeInfo, prefix?: 'none' | 'log'): DynamicArrayImpl<ARC4Encoded>;
116
+ static getArc4TypeName: (t: TypeInfo) => string;
117
+ private encodeWithLength;
118
+ }
119
+ export declare class TupleImpl<TTuple extends [ARC4Encoded, ...ARC4Encoded[]]> extends Tuple<TTuple> {
120
+ private value?;
121
+ private uint8ArrayValue?;
122
+ typeInfo: TypeInfo;
123
+ genericArgs: TypeInfo[];
124
+ constructor(typeInfo: TypeInfo | string);
125
+ get bytes(): bytes;
126
+ equals(other: this): boolean;
127
+ get length(): TTuple['length'] & uint64;
128
+ get native(): TTuple;
129
+ at<TIndex extends keyof TTuple>(index: TIndex): TTuple[TIndex];
130
+ private get items();
131
+ static fromBytesImpl(value: internal.primitives.StubBytesCompat | Uint8Array, typeInfo: string | TypeInfo, prefix?: 'none' | 'log'): TupleImpl<[ARC4Encoded, ...ARC4Encoded[]]>;
132
+ static getMaxBytesLength(typeInfo: TypeInfo): number;
133
+ static getArc4TypeName: (t: TypeInfo) => string;
134
+ }
135
+ type StructConstraint = Record<string, ARC4Encoded>;
136
+ declare const StructImpl_base: DeliberateAny;
137
+ export declare class StructImpl<T extends StructConstraint> extends StructImpl_base {
138
+ static [x: string]: any;
139
+ private uint8ArrayValue?;
140
+ genericArgs: Record<string, TypeInfo>;
141
+ constructor(typeInfo: TypeInfo | string, value?: T);
142
+ get bytes(): bytes;
143
+ get items(): T;
144
+ get native(): T;
145
+ private decodeAsProperties;
146
+ static fromBytesImpl(value: internal.primitives.StubBytesCompat | Uint8Array, typeInfo: string | TypeInfo, prefix?: 'none' | 'log'): StructImpl<StructConstraint>;
147
+ static getArc4TypeName: (t: TypeInfo) => string;
148
+ }
149
+ export declare class DynamicBytesImpl extends DynamicBytes {
150
+ typeInfo: TypeInfo;
151
+ private value;
152
+ constructor(typeInfo: TypeInfo | string, value?: bytes | string);
153
+ get bytes(): bytes;
154
+ equals(other: this): boolean;
155
+ get length(): uint64;
156
+ get native(): bytes;
157
+ get items(): ByteImpl[];
158
+ setItem(_index: number, _value: ByteImpl): void;
159
+ static fromBytesImpl(value: internal.primitives.StubBytesCompat | Uint8Array, typeInfo: string | TypeInfo, prefix?: 'none' | 'log'): DynamicBytesImpl;
160
+ static getArc4TypeName: (_t: TypeInfo) => string;
161
+ }
162
+ export declare class StaticBytesImpl extends StaticBytes {
163
+ private value;
164
+ typeInfo: TypeInfo;
165
+ constructor(typeInfo: TypeInfo | string, value?: bytes | string);
166
+ get bytes(): bytes;
167
+ equals(other: this): boolean;
168
+ get length(): uint64;
169
+ get native(): bytes;
170
+ get items(): ByteImpl[];
171
+ setItem(_index: number, _value: ByteImpl): void;
172
+ static fromBytesImpl(value: internal.primitives.StubBytesCompat | Uint8Array, typeInfo: string | TypeInfo, prefix?: 'none' | 'log'): StaticBytesImpl;
173
+ static getMaxBytesLength(typeInfo: TypeInfo): number;
174
+ static getArc4TypeName: (t: TypeInfo) => string;
175
+ }
176
+ export declare function interpretAsArc4Impl<T extends ARC4Encoded>(typeInfoString: string, bytes: internal.primitives.StubBytesCompat, prefix?: 'none' | 'log'): T;
177
+ export declare const arc4Encoders: Record<string, fromBytes<DeliberateAny>>;
178
+ export declare const getArc4Encoder: <T>(typeInfo: TypeInfo, encoders?: Record<string, fromBytes<DeliberateAny>>) => fromBytes<T>;
179
+ export declare const getArc4TypeName: (typeInfo: TypeInfo) => string | undefined;
180
+ export declare function decodeArc4Impl<T>(sourceTypeInfoString: string, bytes: internal.primitives.StubBytesCompat, prefix?: 'none' | 'log'): T;
181
+ export declare function encodeArc4Impl<T>(_targetTypeInfoString: string, source: T): bytes;
182
+ export declare const getArc4Encoded: (value: DeliberateAny) => ARC4Encoded;
183
+ export {};
@@ -0,0 +1,2 @@
1
+ import { OpUpFeeSource, uint64 } from '@algorandfoundation/algorand-typescript';
2
+ export declare function ensureBudgetImpl(_budget: uint64, _feeSource?: OpUpFeeSource): void;
package/impl/index.d.ts CHANGED
@@ -1,15 +1,16 @@
1
- export { AcctParams, balance, minBalance } from './acct-params';
1
+ export { AcctParams, appOptedIn, balance, minBalance } from './acct-params';
2
2
  export { AppGlobal } from './app-global';
3
3
  export { AppLocal } from './app-local';
4
4
  export { AppParams } from './app-params';
5
5
  export { AssetHolding } from './asset-holding';
6
6
  export { AssetParams } from './asset-params';
7
+ export { Block } from './block';
7
8
  export { Box } from './box';
8
9
  export * from './crypto';
9
10
  export { Global } from './global';
10
11
  export { GTxn } from './gtxn';
11
12
  export { GITxn, ITxn, ITxnCreate } from './itxn';
13
+ export { arg } from './logicSigArg';
12
14
  export * from './pure';
13
- export { Scratch, gloadBytes, gloadUint64 } from './scratch';
14
- export { Block } from './block';
15
- export { Txn, gaid } from './txn';
15
+ export { gloadBytes, gloadUint64, Scratch } from './scratch';
16
+ export { gaid, Txn } from './txn';
@@ -1,38 +1,23 @@
1
- import { arc4, itxn, TransactionType, uint64 } from '@algorandfoundation/algorand-typescript';
2
- import { ApplicationTransaction, AssetConfigTransaction, AssetFreezeTransaction, AssetTransferTransaction, KeyRegistrationTransaction, PaymentTransaction } from './transactions';
1
+ import { itxn, TransactionType } from '@algorandfoundation/algorand-typescript';
3
2
  import { InnerTxn, InnerTxnFields } from './itxn';
4
- import { Mutable } from '../typescript-helpers';
3
+ import { ApplicationTransaction, AssetConfigTransaction, AssetFreezeTransaction, AssetTransferTransaction, KeyRegistrationTransaction, PaymentTransaction } from './transactions';
5
4
  export declare class PaymentInnerTxn extends PaymentTransaction implements itxn.PaymentInnerTxn {
6
5
  readonly isItxn?: true;
7
- static create(fields: itxn.PaymentFields): PaymentInnerTxn;
8
- constructor(fields: itxn.PaymentFields);
9
6
  }
10
7
  export declare class KeyRegistrationInnerTxn extends KeyRegistrationTransaction implements itxn.KeyRegistrationInnerTxn {
11
8
  readonly isItxn?: true;
12
- static create(fields: itxn.KeyRegistrationFields): KeyRegistrationInnerTxn;
13
- constructor(fields: itxn.KeyRegistrationFields);
14
9
  }
15
10
  export declare class AssetConfigInnerTxn extends AssetConfigTransaction implements itxn.AssetConfigInnerTxn {
16
11
  readonly isItxn?: true;
17
- static create(fields: itxn.AssetConfigFields): AssetConfigInnerTxn;
18
- constructor(fields: itxn.AssetConfigFields);
19
12
  }
20
13
  export declare class AssetTransferInnerTxn extends AssetTransferTransaction implements itxn.AssetTransferInnerTxn {
21
14
  readonly isItxn?: true;
22
- static create(fields: Partial<itxn.AssetTransferFields>): AssetTransferInnerTxn;
23
- constructor(fields: itxn.AssetTransferFields);
24
15
  }
25
16
  export declare class AssetFreezeInnerTxn extends AssetFreezeTransaction implements itxn.AssetFreezeInnerTxn {
26
17
  readonly isItxn?: true;
27
- static create(fields: Partial<itxn.AssetFreezeFields>): AssetFreezeInnerTxn;
28
- constructor(fields: itxn.AssetFreezeFields);
29
18
  }
30
19
  export declare class ApplicationInnerTxn extends ApplicationTransaction implements itxn.ApplicationInnerTxn {
31
20
  readonly isItxn?: true;
32
- static create(fields: Omit<itxn.ApplicationCallFields, 'onCompletion'> & {
33
- onCompletion?: arc4.OnCompleteAction | uint64 | arc4.OnCompleteActionStr;
34
- }): ApplicationInnerTxn;
35
- constructor(fields: Mutable<itxn.ApplicationCallFields>);
36
21
  }
37
22
  export declare const createInnerTxn: <TFields extends InnerTxnFields>(fields: TFields) => PaymentInnerTxn | KeyRegistrationInnerTxn | AssetTransferInnerTxn | ApplicationInnerTxn | AssetConfigInnerTxn | AssetFreezeInnerTxn;
38
23
  export declare function submitGroup<TFields extends itxn.InnerTxnList>(...transactionFields: TFields): itxn.TxnFor<TFields>;
@@ -0,0 +1,2 @@
1
+ import { bytes, internal } from '@algorandfoundation/algorand-typescript';
2
+ export declare const arg: (a: internal.primitives.StubUint64Compat) => bytes;
@@ -0,0 +1,3 @@
1
+ import { assertMatch, match } from '@algorandfoundation/algorand-typescript';
2
+ export declare const matchImpl: typeof match;
3
+ export declare const assertMatchImpl: typeof assertMatch;
package/impl/pure.d.ts CHANGED
@@ -17,6 +17,7 @@ export declare const extractUint64: (a: internal.primitives.StubBytesCompat, b:
17
17
  export declare const getBit: (a: internal.primitives.StubUint64Compat | internal.primitives.StubBytesCompat, b: internal.primitives.StubUint64Compat) => uint64;
18
18
  export declare const getByte: (a: internal.primitives.StubBytesCompat, b: internal.primitives.StubUint64Compat) => uint64;
19
19
  export declare const itob: (a: internal.primitives.StubUint64Compat) => bytes;
20
+ export declare const len: (a: internal.primitives.StubBytesCompat) => uint64;
20
21
  export declare const mulw: (a: internal.primitives.StubUint64Compat, b: internal.primitives.StubUint64Compat) => readonly [uint64, uint64];
21
22
  export declare const replace: (a: internal.primitives.StubBytesCompat, b: internal.primitives.StubUint64Compat, c: internal.primitives.StubBytesCompat) => bytes;
22
23
  type selectType = ((a: internal.primitives.StubBytesCompat, b: internal.primitives.StubBytesCompat, c: internal.primitives.StubUint64Compat) => bytes) & ((a: internal.primitives.StubUint64Compat, b: internal.primitives.StubUint64Compat, c: internal.primitives.StubUint64Compat) => uint64);
@@ -0,0 +1 @@
1
+ export declare function TemplateVarImpl<T>(variableName: string, prefix?: string): T;
@@ -30,7 +30,6 @@ declare abstract class TransactionBase {
30
30
  getScratchSlot(index: internal.primitives.StubUint64Compat): bytes | uint64;
31
31
  }
32
32
  export declare class PaymentTransaction extends TransactionBase implements gtxn.PaymentTxn {
33
- static create(fields: TxnFields<gtxn.PaymentTxn>): PaymentTransaction;
34
33
  protected constructor(fields: TxnFields<gtxn.PaymentTxn>);
35
34
  readonly receiver: Account;
36
35
  readonly amount: uint64;
@@ -39,7 +38,6 @@ export declare class PaymentTransaction extends TransactionBase implements gtxn.
39
38
  readonly typeBytes: bytes;
40
39
  }
41
40
  export declare class KeyRegistrationTransaction extends TransactionBase implements gtxn.KeyRegistrationTxn {
42
- static create(fields: TxnFields<gtxn.KeyRegistrationTxn>): KeyRegistrationTransaction;
43
41
  protected constructor(fields: TxnFields<gtxn.KeyRegistrationTxn>);
44
42
  readonly voteKey: bytes;
45
43
  readonly selectionKey: bytes;
@@ -52,7 +50,6 @@ export declare class KeyRegistrationTransaction extends TransactionBase implemen
52
50
  readonly typeBytes: bytes;
53
51
  }
54
52
  export declare class AssetConfigTransaction extends TransactionBase implements gtxn.AssetConfigTxn {
55
- static create(fields: TxnFields<gtxn.AssetConfigTxn>): AssetConfigTransaction;
56
53
  protected constructor(fields: TxnFields<gtxn.AssetConfigTxn>);
57
54
  readonly configAsset: Asset;
58
55
  readonly total: uint64;
@@ -71,7 +68,6 @@ export declare class AssetConfigTransaction extends TransactionBase implements g
71
68
  readonly typeBytes: bytes;
72
69
  }
73
70
  export declare class AssetTransferTransaction extends TransactionBase implements gtxn.AssetTransferTxn {
74
- static create(fields: TxnFields<gtxn.AssetTransferTxn>): AssetTransferTransaction;
75
71
  protected constructor(fields: TxnFields<gtxn.AssetTransferTxn>);
76
72
  readonly xferAsset: Asset;
77
73
  readonly assetAmount: uint64;
@@ -82,7 +78,6 @@ export declare class AssetTransferTransaction extends TransactionBase implements
82
78
  readonly typeBytes: bytes;
83
79
  }
84
80
  export declare class AssetFreezeTransaction extends TransactionBase implements gtxn.AssetFreezeTxn {
85
- static create(fields: TxnFields<gtxn.AssetFreezeTxn>): AssetFreezeTransaction;
86
81
  protected constructor(fields: TxnFields<gtxn.AssetFreezeTxn>);
87
82
  readonly freezeAsset: Asset;
88
83
  readonly freezeAccount: Account;
@@ -91,7 +86,7 @@ export declare class AssetFreezeTransaction extends TransactionBase implements g
91
86
  readonly typeBytes: bytes;
92
87
  }
93
88
  export type ApplicationTransactionFields = TxnFields<gtxn.ApplicationTxn> & Partial<{
94
- appArgs: Array<bytes>;
89
+ appArgs: Array<unknown>;
95
90
  accounts: Array<Account>;
96
91
  assets: Array<Asset>;
97
92
  apps: Array<Application>;
@@ -102,7 +97,6 @@ export type ApplicationTransactionFields = TxnFields<gtxn.ApplicationTxn> & Part
102
97
  }>;
103
98
  export declare class ApplicationTransaction extends TransactionBase implements gtxn.ApplicationTxn {
104
99
  #private;
105
- static create(fields: ApplicationTransactionFields): ApplicationTransaction;
106
100
  protected constructor(fields: ApplicationTransactionFields);
107
101
  readonly appId: Application;
108
102
  readonly onCompletion: arc4.OnCompleteActionStr;
@@ -122,6 +116,9 @@ export declare class ApplicationTransaction extends TransactionBase implements g
122
116
  get numClearStateProgramPages(): uint64;
123
117
  get numLogs(): uint64;
124
118
  get lastLog(): bytes;
119
+ get apat(): Account[];
120
+ get apas(): Asset[];
121
+ get apfa(): Application[];
125
122
  appArgs(index: internal.primitives.StubUint64Compat): bytes;
126
123
  accounts(index: internal.primitives.StubUint64Compat): Account;
127
124
  assets(index: internal.primitives.StubUint64Compat): Asset;
@@ -131,9 +128,6 @@ export declare class ApplicationTransaction extends TransactionBase implements g
131
128
  logs(index: internal.primitives.StubUint64Compat): bytes;
132
129
  readonly type: TransactionType.ApplicationCall;
133
130
  readonly typeBytes: bytes;
134
- get appLogs(): bytes[];
135
- appendLog(value: internal.primitives.StubBytesCompat): void;
136
- logArc4ReturnValue(value: unknown): void;
137
131
  }
138
132
  export type Transaction = PaymentTransaction | KeyRegistrationTransaction | AssetConfigTransaction | AssetTransferTransaction | AssetFreezeTransaction | ApplicationTransaction;
139
133
  export type AllTransactionFields = TxnFields<gtxn.PaymentTxn> & TxnFields<gtxn.KeyRegistrationTxn> & TxnFields<gtxn.AssetConfigTxn> & TxnFields<gtxn.AssetTransferTxn> & TxnFields<gtxn.AssetFreezeTxn> & ApplicationTransactionFields;
@@ -0,0 +1,2 @@
1
+ import { internal } from '@algorandfoundation/algorand-typescript';
2
+ export declare function urangeImpl(a: internal.primitives.StubUint64Compat, b?: internal.primitives.StubUint64Compat, c?: internal.primitives.StubUint64Compat): Generator<import("@algorandfoundation/algorand-typescript").uint64, number, unknown>;
package/index.d.ts CHANGED
@@ -1 +1,15 @@
1
+ import { internal } from '@algorandfoundation/algorand-typescript';
1
2
  export { TestExecutionContext } from './test-execution-context';
3
+ export declare const encodingUtil: {
4
+ toExternalValue: typeof internal.primitives.toExternalValue;
5
+ uint8ArrayToBigInt: (v: Uint8Array) => bigint;
6
+ hexToUint8Array: (value: string) => Uint8Array;
7
+ base64ToUint8Array: (value: string) => Uint8Array;
8
+ bigIntToUint8Array: (val: bigint, fixedSize?: number | "dynamic") => Uint8Array;
9
+ utf8ToUint8Array: (value: string) => Uint8Array;
10
+ uint8ArrayToUtf8: (value: Uint8Array) => string;
11
+ uint8ArrayToHex: (value: Uint8Array) => string;
12
+ uint8ArrayToBase64: (value: Uint8Array) => string;
13
+ uint8ArrayToBase64Url: (value: Uint8Array) => string;
14
+ uint8ArrayToBase32: (value: Uint8Array) => string;
15
+ };