@algorandfoundation/algorand-typescript-testing 1.0.0-alpha.2 → 1.0.0-alpha.4
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/abi-metadata.d.ts +2 -2
- package/collections/custom-key-map.d.ts +22 -0
- package/constants.d.ts +4 -0
- package/context-helpers/internal-context.d.ts +3 -3
- package/decode-logs.d.ts +2 -1
- package/impl/account.d.ts +3 -3
- package/impl/application.d.ts +3 -2
- package/impl/asset.d.ts +3 -2
- package/impl/base.d.ts +11 -0
- package/impl/transactions.d.ts +1 -0
- package/index.mjs +325 -246
- package/index.mjs.map +1 -1
- package/package.json +5 -5
- package/{runtime-helpers-B6YRp95T.js → runtime-helpers-DT7VSgbs.js} +49 -12
- package/runtime-helpers-DT7VSgbs.js.map +1 -0
- package/runtime-helpers.mjs +1 -1
- package/set-up.d.ts +11 -0
- package/subcontexts/contract-context.d.ts +1 -0
- package/subcontexts/ledger-context.d.ts +4 -3
- package/subcontexts/transaction-context.d.ts +2 -2
- package/test-execution-context.d.ts +1 -1
- package/{test-transformer.mjs → test-transformer/index.mjs} +1 -13
- package/test-transformer/index.mjs.map +1 -0
- package/util.d.ts +1 -1
- package/value-generators/avm.d.ts +1 -1
- package/runtime-helpers-B6YRp95T.js.map +0 -1
- package/test-transformer.mjs.map +0 -1
package/abi-metadata.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Contract } from '@algorandfoundation/algorand-typescript';
|
|
1
|
+
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;
|
|
@@ -13,4 +13,4 @@ export declare const attachAbiMetadata: (contract: {
|
|
|
13
13
|
}, methodName: string, metadata: AbiMetadata) => void;
|
|
14
14
|
export declare const captureMethodConfig: <T extends Contract>(contract: T, methodName: string, config?: AbiMethodConfig<T> | BareMethodConfig) => void;
|
|
15
15
|
export declare const hasAbiMetadata: <T extends Contract>(contract: T) => boolean;
|
|
16
|
-
export declare const getAbiMetadata: <T extends
|
|
16
|
+
export declare const getAbiMetadata: <T extends BaseContract>(contract: T, methodName: string) => AbiMetadata;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Account } from '@algorandfoundation/algorand-typescript';
|
|
2
|
+
import { DeliberateAny } from '../typescript-helpers';
|
|
3
|
+
export declare abstract class CustomKeyMap<TKey, TValue> implements Map<TKey, TValue> {
|
|
4
|
+
#private;
|
|
5
|
+
constructor(keySerializer: (key: TKey) => number | bigint | string);
|
|
6
|
+
clear(): void;
|
|
7
|
+
delete(key: TKey): boolean;
|
|
8
|
+
forEach(callbackfn: (value: TValue, key: TKey, map: Map<TKey, TValue>) => void, thisArg?: DeliberateAny): void;
|
|
9
|
+
get(key: TKey): TValue | undefined;
|
|
10
|
+
has(key: TKey): boolean;
|
|
11
|
+
set(key: TKey, value: TValue): this;
|
|
12
|
+
get size(): number;
|
|
13
|
+
entries(): MapIterator<[TKey, TValue]>;
|
|
14
|
+
keys(): MapIterator<TKey>;
|
|
15
|
+
values(): MapIterator<TValue>;
|
|
16
|
+
[Symbol.iterator](): MapIterator<[TKey, TValue]>;
|
|
17
|
+
get [Symbol.toStringTag](): string;
|
|
18
|
+
}
|
|
19
|
+
export declare class AccountMap<TValue> extends CustomKeyMap<Account, TValue> {
|
|
20
|
+
constructor();
|
|
21
|
+
private static getAddressStrFromAccount;
|
|
22
|
+
}
|
package/constants.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ export declare const DEFAULT_MAX_TXN_LIFE = 1000;
|
|
|
11
11
|
export declare const DEFAULT_ASSET_CREATE_MIN_BALANCE = 1000000;
|
|
12
12
|
export declare const DEFAULT_ASSET_OPT_IN_MIN_BALANCE = 10000;
|
|
13
13
|
export declare const DEFAULT_GLOBAL_GENESIS_HASH: import("@algorandfoundation/algorand-typescript").bytes;
|
|
14
|
+
export declare const ZERO_ADDRESS_B32 = "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAY5HFKQ";
|
|
14
15
|
export declare const ZERO_ADDRESS: import("@algorandfoundation/algorand-typescript").bytes;
|
|
15
16
|
/**
|
|
16
17
|
"\x09" # pragma version 9
|
|
@@ -19,3 +20,6 @@ export declare const ZERO_ADDRESS: import("@algorandfoundation/algorand-typescri
|
|
|
19
20
|
export declare const ALWAYS_APPROVE_TEAL_PROGRAM: import("@algorandfoundation/algorand-typescript").bytes;
|
|
20
21
|
export declare const LOGIC_DATA_PREFIX: import("@algorandfoundation/algorand-typescript").bytes;
|
|
21
22
|
export declare const MIN_TXN_FEE = 1000;
|
|
23
|
+
export declare const ABI_RETURN_VALUE_LOG_PREFIX: import("@algorandfoundation/algorand-typescript").bytes;
|
|
24
|
+
export declare const UINT64_OVERFLOW_UNDERFLOW_MESSAGE = "Uint64 overflow or underflow";
|
|
25
|
+
export declare const BIGUINT_OVERFLOW_UNDERFLOW_MESSAGE = "BigUint overflow or underflow";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { internal } from '@algorandfoundation/algorand-typescript';
|
|
1
|
+
import { Account, 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';
|
|
@@ -11,14 +11,14 @@ import { TestExecutionContext } from '../test-execution-context';
|
|
|
11
11
|
*/
|
|
12
12
|
declare class InternalContext {
|
|
13
13
|
get value(): TestExecutionContext;
|
|
14
|
-
get defaultSender():
|
|
14
|
+
get defaultSender(): Account;
|
|
15
15
|
get ledger(): import("../subcontexts/ledger-context").LedgerContext;
|
|
16
16
|
get txn(): import("../subcontexts/transaction-context").TransactionContext;
|
|
17
17
|
get contract(): import("../subcontexts/contract-context").ContractContext;
|
|
18
18
|
get any(): import("../value-generators").ValueGenerator;
|
|
19
19
|
get activeApplication(): import("@algorandfoundation/algorand-typescript").Application;
|
|
20
20
|
get activeGroup(): TransactionGroup;
|
|
21
|
-
getAccountData(
|
|
21
|
+
getAccountData(account: Account): AccountData;
|
|
22
22
|
getAssetData(id: internal.primitives.StubUint64Compat): AssetData;
|
|
23
23
|
getApplicationData(id: internal.primitives.StubUint64Compat): ApplicationData;
|
|
24
24
|
}
|
package/decode-logs.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { bytes } from '@algorandfoundation/algorand-typescript';
|
|
1
2
|
export type LogDecoding = 'i' | 's' | 'b';
|
|
2
3
|
export type DecodedLog<T extends LogDecoding> = T extends 'i' ? bigint : T extends 's' ? string : Uint8Array;
|
|
3
4
|
export type DecodedLogs<T extends [...LogDecoding[]]> = {
|
|
@@ -5,4 +6,4 @@ export type DecodedLogs<T extends [...LogDecoding[]]> = {
|
|
|
5
6
|
} & {
|
|
6
7
|
length: T['length'];
|
|
7
8
|
};
|
|
8
|
-
export declare function decodeLogs<const T extends [...LogDecoding[]]>(logs:
|
|
9
|
+
export declare function decodeLogs<const T extends [...LogDecoding[]]>(logs: bytes[], decoding: T): DecodedLogs<T>;
|
package/impl/account.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Account, Application, Asset, bytes, internal, uint64 } from '@algorandfoundation/algorand-typescript';
|
|
2
2
|
import { Mutable } from '../typescript-helpers';
|
|
3
|
+
import { BytesBackedCls } from './base';
|
|
3
4
|
export declare class AssetHolding {
|
|
4
5
|
balance: uint64;
|
|
5
6
|
frozen: boolean;
|
|
@@ -11,9 +12,8 @@ export declare class AccountData {
|
|
|
11
12
|
account: Mutable<Omit<Account, 'bytes' | 'isOptedIn'>>;
|
|
12
13
|
constructor();
|
|
13
14
|
}
|
|
14
|
-
export declare class AccountCls implements Account {
|
|
15
|
-
|
|
16
|
-
constructor(address?: internal.primitives.StubBytesCompat);
|
|
15
|
+
export declare class AccountCls extends BytesBackedCls implements Account {
|
|
16
|
+
constructor(address?: bytes);
|
|
17
17
|
private get data();
|
|
18
18
|
get balance(): uint64;
|
|
19
19
|
get minBalance(): uint64;
|
package/impl/application.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Account, Application, bytes, uint64 } from '@algorandfoundation/algorand-typescript';
|
|
2
2
|
import { Mutable } from '../typescript-helpers';
|
|
3
|
+
import { Uint64BackedCls } from './base';
|
|
3
4
|
export declare class ApplicationData {
|
|
4
5
|
application: Mutable<Omit<Application, 'id' | 'address'>> & {
|
|
5
6
|
appLogs: bytes[];
|
|
@@ -8,8 +9,8 @@ export declare class ApplicationData {
|
|
|
8
9
|
get appLogs(): bytes[];
|
|
9
10
|
constructor();
|
|
10
11
|
}
|
|
11
|
-
export declare class ApplicationCls implements Application {
|
|
12
|
-
|
|
12
|
+
export declare class ApplicationCls extends Uint64BackedCls implements Application {
|
|
13
|
+
get id(): uint64;
|
|
13
14
|
constructor(id?: uint64);
|
|
14
15
|
private get data();
|
|
15
16
|
get approvalProgram(): bytes;
|
package/impl/asset.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { Account, Asset, bytes, internal, uint64 } from '@algorandfoundation/algorand-typescript';
|
|
2
2
|
import { Mutable } from '../typescript-helpers';
|
|
3
|
+
import { Uint64BackedCls } from './base';
|
|
3
4
|
export type AssetData = Mutable<Omit<Asset, 'id' | 'balance' | 'frozen'>>;
|
|
4
|
-
export declare class AssetCls implements Asset {
|
|
5
|
-
|
|
5
|
+
export declare class AssetCls extends Uint64BackedCls implements Asset {
|
|
6
|
+
get id(): uint64;
|
|
6
7
|
constructor(id?: internal.primitives.StubUint64Compat);
|
|
7
8
|
private get data();
|
|
8
9
|
get total(): uint64;
|
package/impl/base.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { bytes, uint64 } from '@algorandfoundation/algorand-typescript';
|
|
2
|
+
export declare abstract class BytesBackedCls {
|
|
3
|
+
#private;
|
|
4
|
+
get bytes(): bytes;
|
|
5
|
+
constructor(value: bytes);
|
|
6
|
+
}
|
|
7
|
+
export declare abstract class Uint64BackedCls {
|
|
8
|
+
#private;
|
|
9
|
+
get uint64(): uint64;
|
|
10
|
+
constructor(value: uint64);
|
|
11
|
+
}
|
package/impl/transactions.d.ts
CHANGED
|
@@ -133,6 +133,7 @@ export declare class ApplicationTransaction extends TransactionBase implements g
|
|
|
133
133
|
readonly typeBytes: bytes;
|
|
134
134
|
get appLogs(): bytes[];
|
|
135
135
|
appendLog(value: internal.primitives.StubBytesCompat): void;
|
|
136
|
+
logArc4ReturnValue(value: unknown): void;
|
|
136
137
|
}
|
|
137
138
|
export type Transaction = PaymentTransaction | KeyRegistrationTransaction | AssetConfigTransaction | AssetTransferTransaction | AssetFreezeTransaction | ApplicationTransaction;
|
|
138
139
|
export type AllTransactionFields = TxnFields<gtxn.PaymentTxn> & TxnFields<gtxn.KeyRegistrationTxn> & TxnFields<gtxn.AssetConfigTxn> & TxnFields<gtxn.AssetTransferTxn> & TxnFields<gtxn.AssetFreezeTxn> & ApplicationTransactionFields;
|