@algorandfoundation/algorand-typescript-testing 1.0.0-alpha.13 → 1.0.0-alpha.14

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.
@@ -19,7 +19,7 @@ export declare class UFixedNxMImpl<N extends BitSize, M extends number> extends
19
19
  private value;
20
20
  private bitSize;
21
21
  private precision;
22
- private typeInfo;
22
+ typeInfo: TypeInfo;
23
23
  constructor(typeInfo: TypeInfo | string, v: `${number}.${number}`);
24
24
  get native(): UFixedNxM<N, M>["native"];
25
25
  get bytes(): bytes;
@@ -29,6 +29,7 @@ export declare class UFixedNxMImpl<N extends BitSize, M extends number> extends
29
29
  static getArc4TypeName: (t: TypeInfo) => string;
30
30
  }
31
31
  export declare class ByteImpl extends Byte {
32
+ typeInfo: TypeInfo | string;
32
33
  private value;
33
34
  constructor(typeInfo: TypeInfo | string, v?: CompatForArc4Int<8>);
34
35
  get native(): uint64;
@@ -38,16 +39,18 @@ export declare class ByteImpl extends Byte {
38
39
  static getMaxBitsLength(typeInfo: TypeInfo): BitSize;
39
40
  }
40
41
  export declare class StrImpl extends Str {
42
+ typeInfo: TypeInfo | string;
41
43
  private value;
42
- constructor(_typeInfo: TypeInfo | string, s?: StringCompat);
44
+ constructor(typeInfo: TypeInfo | string, s?: StringCompat);
43
45
  get native(): string;
44
46
  get bytes(): bytes;
45
47
  equals(other: this): boolean;
46
48
  static fromBytesImpl(value: internal.primitives.StubBytesCompat | Uint8Array, typeInfo: string | TypeInfo, prefix?: 'none' | 'log'): StrImpl;
47
49
  }
48
50
  export declare class BoolImpl extends Bool {
51
+ typeInfo: TypeInfo | string;
49
52
  private value;
50
- constructor(_typeInfo: TypeInfo | string, v?: boolean);
53
+ constructor(typeInfo: TypeInfo | string, v?: boolean);
51
54
  get native(): boolean;
52
55
  equals(other: this): boolean;
53
56
  get bytes(): bytes;
@@ -60,8 +63,8 @@ type StaticArrayGenericArgs = {
60
63
  export declare class StaticArrayImpl<TItem extends ARC4Encoded, TLength extends number> extends StaticArray<TItem, TLength> {
61
64
  private value?;
62
65
  private uint8ArrayValue?;
63
- private typeInfo;
64
66
  private size;
67
+ typeInfo: TypeInfo;
65
68
  genericArgs: StaticArrayGenericArgs;
66
69
  constructor(typeInfo: TypeInfo | string, ...items: TItem[] & {
67
70
  length: TLength;
@@ -73,12 +76,13 @@ export declare class StaticArrayImpl<TItem extends ARC4Encoded, TLength extends
73
76
  get items(): TItem[];
74
77
  setItem(index: number, value: TItem): void;
75
78
  copy(): StaticArrayImpl<TItem, TLength>;
79
+ get native(): TItem[];
76
80
  static fromBytesImpl(value: internal.primitives.StubBytesCompat | Uint8Array, typeInfo: string | TypeInfo, prefix?: 'none' | 'log'): StaticArrayImpl<ARC4Encoded, number>;
77
81
  static getMaxBytesLength(typeInfo: TypeInfo): number;
78
82
  static getArc4TypeName: (t: TypeInfo) => string;
79
83
  }
80
84
  export declare class AddressImpl extends Address {
81
- private typeInfo;
85
+ typeInfo: TypeInfo;
82
86
  private value;
83
87
  constructor(typeInfo: TypeInfo | string, value?: Account | string | bytes);
84
88
  get bytes(): bytes;
@@ -96,7 +100,7 @@ type DynamicArrayGenericArgs = {
96
100
  export declare class DynamicArrayImpl<TItem extends ARC4Encoded> extends DynamicArray<TItem> {
97
101
  private value?;
98
102
  private uint8ArrayValue?;
99
- private typeInfo;
103
+ typeInfo: TypeInfo;
100
104
  genericArgs: DynamicArrayGenericArgs;
101
105
  constructor(typeInfo: TypeInfo | string, ...items: TItem[]);
102
106
  get bytes(): bytes;
@@ -105,6 +109,7 @@ export declare class DynamicArrayImpl<TItem extends ARC4Encoded> extends Dynamic
105
109
  get items(): TItem[];
106
110
  setItem(index: number, value: TItem): void;
107
111
  copy(): DynamicArrayImpl<TItem>;
112
+ get native(): TItem[];
108
113
  push(...values: TItem[]): void;
109
114
  pop(): TItem;
110
115
  static fromBytesImpl(value: internal.primitives.StubBytesCompat | Uint8Array, typeInfo: string | TypeInfo, prefix?: 'none' | 'log'): DynamicArrayImpl<ARC4Encoded>;
@@ -114,7 +119,7 @@ export declare class DynamicArrayImpl<TItem extends ARC4Encoded> extends Dynamic
114
119
  export declare class TupleImpl<TTuple extends [ARC4Encoded, ...ARC4Encoded[]]> extends Tuple<TTuple> {
115
120
  private value?;
116
121
  private uint8ArrayValue?;
117
- private typeInfo;
122
+ typeInfo: TypeInfo;
118
123
  genericArgs: TypeInfo[];
119
124
  constructor(typeInfo: TypeInfo | string);
120
125
  get bytes(): bytes;
@@ -132,17 +137,17 @@ declare const StructImpl_base: DeliberateAny;
132
137
  export declare class StructImpl<T extends StructConstraint> extends StructImpl_base {
133
138
  static [x: string]: any;
134
139
  private uint8ArrayValue?;
135
- private typeInfo;
136
140
  genericArgs: Record<string, TypeInfo>;
137
141
  constructor(typeInfo: TypeInfo | string, value?: T);
138
142
  get bytes(): bytes;
139
143
  get items(): T;
144
+ get native(): T;
140
145
  private decodeAsProperties;
141
146
  static fromBytesImpl(value: internal.primitives.StubBytesCompat | Uint8Array, typeInfo: string | TypeInfo, prefix?: 'none' | 'log'): StructImpl<StructConstraint>;
142
147
  static getArc4TypeName: (t: TypeInfo) => string;
143
148
  }
144
149
  export declare class DynamicBytesImpl extends DynamicBytes {
145
- private typeInfo;
150
+ typeInfo: TypeInfo;
146
151
  private value;
147
152
  constructor(typeInfo: TypeInfo | string, value?: bytes | string);
148
153
  get bytes(): bytes;
@@ -156,7 +161,7 @@ export declare class DynamicBytesImpl extends DynamicBytes {
156
161
  }
157
162
  export declare class StaticBytesImpl extends StaticBytes {
158
163
  private value;
159
- private typeInfo;
164
+ typeInfo: TypeInfo;
160
165
  constructor(typeInfo: TypeInfo | string, value?: bytes | string);
161
166
  get bytes(): bytes;
162
167
  equals(other: this): boolean;
@@ -172,4 +177,6 @@ export declare function interpretAsArc4Impl<T extends ARC4Encoded>(typeInfoStrin
172
177
  export declare const arc4Encoders: Record<string, fromBytes<DeliberateAny>>;
173
178
  export declare const getArc4Encoder: <T>(typeInfo: TypeInfo, encoders?: Record<string, fromBytes<DeliberateAny>>) => fromBytes<T>;
174
179
  export declare const getArc4TypeName: (typeInfo: TypeInfo) => string | undefined;
180
+ export declare function decodeArc4Impl<T>(sourceTypeInfoString: string, bytes: internal.primitives.StubBytesCompat): T;
181
+ export declare function encodeArc4Impl<T>(_targetTypeInfoString: string, source: T): bytes;
175
182
  export {};
@@ -122,6 +122,9 @@ export declare class ApplicationTransaction extends TransactionBase implements g
122
122
  get numClearStateProgramPages(): uint64;
123
123
  get numLogs(): uint64;
124
124
  get lastLog(): bytes;
125
+ get apat(): Account[];
126
+ get apas(): Asset[];
127
+ get apfa(): Application[];
125
128
  appArgs(index: internal.primitives.StubUint64Compat): bytes;
126
129
  accounts(index: internal.primitives.StubUint64Compat): Account;
127
130
  assets(index: internal.primitives.StubUint64Compat): Asset;
package/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import { Bytes, Uint64, Account, internal, Base64, arc4, Ecdsa, op, TransactionType, Asset, Application, BigUint, BaseContract, Contract } from '@algorandfoundation/algorand-typescript';
2
- import { a as asMaybeUint64Cls, l as lazyContext, b as asUint64, c as asBytes, t as toBytes, d as asMaybeBytesCls, e as asBigUint, B as BITS_IN_BYTE, M as MAX_BYTES_SIZE, f as asUint64Cls, g as asBytesCls, h as MAX_UINT8, i as binaryStringToBytes, U as UINT64_SIZE, j as MAX_UINT64, k as asNumber, m as MAX_BOX_SIZE, n as asUint8Array, o as conactUint8Arrays, P as PROGRAM_TAG, L as LOGIC_DATA_PREFIX, p as getObjectReference, q as getApplicationAddress, r as MIN_TXN_FEE, D as DEFAULT_ACCOUNT_MIN_BALANCE, s as DEFAULT_MAX_TXN_LIFE, Z as ZERO_ADDRESS, u as DEFAULT_ASSET_CREATE_MIN_BALANCE, v as DEFAULT_ASSET_OPT_IN_MIN_BALANCE, w as DEFAULT_GLOBAL_GENESIS_HASH, x as combineIntoMaxBytePages, y as MAX_ITEMS_IN_LOG, A as ABI_RETURN_VALUE_LOG_PREFIX, z as getRandomBytes, C as getArc4Encoder, E as AccountCls, F as ApplicationCls, G as AssetCls, H as arc4Encoders, I as AccountMap, J as getGenericTypeInfo, K as getArc4Selector, N as isContractProxy, O as getContractMethodAbiMetadata, Q as copyAbiMetadatas, R as getContractAbiMetadata, S as BytesMap, T as iterBigInt, V as Uint64Map, W as AssetHolding$1, X as asBigInt, Y as TRANSACTION_GROUP_MAX_SIZE, _ as getRandomBigInt, $ as AccountData, a0 as ApplicationData, a1 as AddressImpl, a2 as UintNImpl, a3 as getRandomNumber, a4 as MAX_UINT16, a5 as MAX_UINT32, a6 as MAX_UINT128, a7 as MAX_UINT256, a8 as MAX_UINT512, a9 as DynamicBytesImpl, aa as StrImpl, ab as captureMethodConfig, ac as DEFAULT_TEMPLATE_VAR_PREFIX } from './runtime-helpers-CUc689EZ.js';
2
+ import { a as asMaybeUint64Cls, l as lazyContext, b as asUint64, c as asBytes, t as toBytes, d as asMaybeBytesCls, e as asBigUint, B as BITS_IN_BYTE, M as MAX_BYTES_SIZE, f as asUint64Cls, g as asBytesCls, h as MAX_UINT8, i as binaryStringToBytes, U as UINT64_SIZE, j as MAX_UINT64, k as asNumber, m as MAX_BOX_SIZE, n as asUint8Array, o as conactUint8Arrays, P as PROGRAM_TAG, L as LOGIC_DATA_PREFIX, p as getObjectReference, q as getApplicationAddress, r as MIN_TXN_FEE, D as DEFAULT_ACCOUNT_MIN_BALANCE, s as DEFAULT_MAX_TXN_LIFE, Z as ZERO_ADDRESS, u as DEFAULT_ASSET_CREATE_MIN_BALANCE, v as DEFAULT_ASSET_OPT_IN_MIN_BALANCE, w as DEFAULT_GLOBAL_GENESIS_HASH, x as combineIntoMaxBytePages, y as MAX_ITEMS_IN_LOG, A as ABI_RETURN_VALUE_LOG_PREFIX, z as getRandomBytes, C as getArc4Encoder, E as AccountCls, F as ApplicationCls, G as AssetCls, H as arc4Encoders, I as AccountMap, J as getGenericTypeInfo, K as getArc4Selector, N as isContractProxy, O as getContractMethodAbiMetadata, Q as copyAbiMetadatas, R as getContractAbiMetadata, S as BytesMap, T as iterBigInt, V as Uint64Map, W as AssetHolding$1, X as asBigInt, Y as TRANSACTION_GROUP_MAX_SIZE, _ as getRandomBigInt, $ as AccountData, a0 as ApplicationData, a1 as AddressImpl, a2 as UintNImpl, a3 as getRandomNumber, a4 as MAX_UINT16, a5 as MAX_UINT32, a6 as MAX_UINT128, a7 as MAX_UINT256, a8 as MAX_UINT512, a9 as DynamicBytesImpl, aa as StrImpl, ab as captureMethodConfig, ac as DEFAULT_TEMPLATE_VAR_PREFIX } from './runtime-helpers-C5d5vNab.js';
3
3
  import { ec } from 'elliptic';
4
4
  import { sha256 as sha256$1 } from 'js-sha256';
5
5
  import { sha3_256 as sha3_256$1, keccak256 as keccak256$1 } from 'js-sha3';
@@ -2817,6 +2817,15 @@ class ApplicationTransaction extends TransactionBase {
2817
2817
  get lastLog() {
2818
2818
  return this.#appLogs.at(-1) ?? lazyContext.getApplicationData(this.appId.id).appLogs.at(-1) ?? Bytes();
2819
2819
  }
2820
+ get apat() {
2821
+ return this.#accounts;
2822
+ }
2823
+ get apas() {
2824
+ return this.#assets;
2825
+ }
2826
+ get apfa() {
2827
+ return this.#apps;
2828
+ }
2820
2829
  appArgs(index) {
2821
2830
  return toBytes(this.#appArgs[asNumber(index)]);
2822
2831
  }
@@ -4164,7 +4173,7 @@ class Arc4ValueGenerator {
4164
4173
  * */
4165
4174
  address() {
4166
4175
  const source = new AvmValueGenerator().account();
4167
- const result = new AddressImpl({ name: 'StaticArray', genericArgs: { elementType: { name: 'Byte' }, size: { name: '32' } } }, source);
4176
+ const result = new AddressImpl({ name: 'StaticArray', genericArgs: { elementType: { name: 'Byte', genericArgs: [{ name: '8' }] }, size: { name: '32' } } }, source);
4168
4177
  return result;
4169
4178
  }
4170
4179
  /**
@@ -4237,7 +4246,7 @@ class Arc4ValueGenerator {
4237
4246
  * @returns: A new, random dynamic bytes of size `n` bits.
4238
4247
  * */
4239
4248
  dynamicBytes(n) {
4240
- return new DynamicBytesImpl({ name: 'DynamicArray', genericArgs: { elementType: { name: 'Byte' } } }, getRandomBytes(n / BITS_IN_BYTE).asAlgoTs());
4249
+ return new DynamicBytesImpl({ name: 'DynamicBytes', genericArgs: { elementType: { name: 'Byte', genericArgs: [{ name: '8' }] } } }, getRandomBytes(n / BITS_IN_BYTE).asAlgoTs());
4241
4250
  }
4242
4251
  /**
4243
4252
  * Generate a random dynamic string of size `n` bits.