@algorandfoundation/algorand-typescript-testing 1.0.0-alpha.4 → 1.0.0-alpha.6
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/collections/custom-key-map.d.ts +8 -1
- package/impl/account.d.ts +3 -2
- package/impl/app-global.d.ts +2 -0
- package/impl/app-local.d.ts +2 -0
- package/impl/application.d.ts +5 -1
- package/impl/block.d.ts +2 -0
- package/impl/index.d.ts +5 -2
- package/impl/scratch.d.ts +2 -0
- package/impl/state.d.ts +27 -0
- package/impl/transactions.d.ts +1 -1
- package/index.mjs +1226 -966
- package/index.mjs.map +1 -1
- package/package.json +2 -2
- package/{runtime-helpers-DT7VSgbs.js → runtime-helpers-Dv3qU-7_.js} +5 -3
- package/runtime-helpers-Dv3qU-7_.js.map +1 -0
- package/runtime-helpers.mjs +1 -1
- package/subcontexts/ledger-context.d.ts +18 -5
- package/subcontexts/transaction-context.d.ts +1 -0
- package/test-execution-context.d.ts +5 -0
- package/runtime-helpers-DT7VSgbs.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Account } from '@algorandfoundation/algorand-typescript';
|
|
1
|
+
import { Account, internal } from '@algorandfoundation/algorand-typescript';
|
|
2
2
|
import { DeliberateAny } from '../typescript-helpers';
|
|
3
3
|
export declare abstract class CustomKeyMap<TKey, TValue> implements Map<TKey, TValue> {
|
|
4
4
|
#private;
|
|
@@ -7,6 +7,7 @@ export declare abstract class CustomKeyMap<TKey, TValue> implements Map<TKey, TV
|
|
|
7
7
|
delete(key: TKey): boolean;
|
|
8
8
|
forEach(callbackfn: (value: TValue, key: TKey, map: Map<TKey, TValue>) => void, thisArg?: DeliberateAny): void;
|
|
9
9
|
get(key: TKey): TValue | undefined;
|
|
10
|
+
getOrFail(key: TKey): TValue;
|
|
10
11
|
has(key: TKey): boolean;
|
|
11
12
|
set(key: TKey, value: TValue): this;
|
|
12
13
|
get size(): number;
|
|
@@ -20,3 +21,9 @@ export declare class AccountMap<TValue> extends CustomKeyMap<Account, TValue> {
|
|
|
20
21
|
constructor();
|
|
21
22
|
private static getAddressStrFromAccount;
|
|
22
23
|
}
|
|
24
|
+
export declare class BytesMap<TValue> extends CustomKeyMap<internal.primitives.StubBytesCompat, TValue> {
|
|
25
|
+
constructor();
|
|
26
|
+
}
|
|
27
|
+
export declare class Uint64Map<TValue> extends CustomKeyMap<internal.primitives.StubUint64Compat, TValue> {
|
|
28
|
+
constructor();
|
|
29
|
+
}
|
package/impl/account.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Account, Application, Asset, bytes, internal, uint64 } from '@algorandfoundation/algorand-typescript';
|
|
2
|
+
import { Uint64Map } from '../collections/custom-key-map';
|
|
2
3
|
import { Mutable } from '../typescript-helpers';
|
|
3
4
|
import { BytesBackedCls } from './base';
|
|
4
5
|
export declare class AssetHolding {
|
|
@@ -7,8 +8,8 @@ export declare class AssetHolding {
|
|
|
7
8
|
constructor(balance: internal.primitives.StubUint64Compat, frozen: boolean);
|
|
8
9
|
}
|
|
9
10
|
export declare class AccountData {
|
|
10
|
-
optedAssets:
|
|
11
|
-
optedApplications:
|
|
11
|
+
optedAssets: Uint64Map<AssetHolding>;
|
|
12
|
+
optedApplications: Uint64Map<Application>;
|
|
12
13
|
account: Mutable<Omit<Account, 'bytes' | 'isOptedIn'>>;
|
|
13
14
|
constructor();
|
|
14
15
|
}
|
package/impl/application.d.ts
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
import { Account, Application, bytes, uint64 } from '@algorandfoundation/algorand-typescript';
|
|
1
|
+
import { Account, Application, bytes, LocalState, uint64 } from '@algorandfoundation/algorand-typescript';
|
|
2
|
+
import { BytesMap } from '../collections/custom-key-map';
|
|
2
3
|
import { Mutable } from '../typescript-helpers';
|
|
3
4
|
import { Uint64BackedCls } from './base';
|
|
5
|
+
import { GlobalStateCls } from './state';
|
|
4
6
|
export declare class ApplicationData {
|
|
5
7
|
application: Mutable<Omit<Application, 'id' | 'address'>> & {
|
|
6
8
|
appLogs: bytes[];
|
|
9
|
+
globalStates: BytesMap<GlobalStateCls<unknown>>;
|
|
10
|
+
localStates: BytesMap<LocalState<unknown>>;
|
|
7
11
|
};
|
|
8
12
|
isCreating: boolean;
|
|
9
13
|
get appLogs(): bytes[];
|
package/impl/block.d.ts
ADDED
package/impl/index.d.ts
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
export { AcctParams, balance, minBalance } from './acct-params';
|
|
2
|
+
export { AppGlobal } from './app-global';
|
|
3
|
+
export { AppLocal } from './app-local';
|
|
2
4
|
export { AppParams } from './app-params';
|
|
3
5
|
export { AssetHolding } from './asset-holding';
|
|
4
6
|
export { AssetParams } from './asset-params';
|
|
5
7
|
export * from './crypto';
|
|
6
8
|
export { Global } from './global';
|
|
7
9
|
export { GTxn } from './gtxn';
|
|
10
|
+
export { GITxn, ITxn, ITxnCreate } from './itxn';
|
|
8
11
|
export * from './pure';
|
|
12
|
+
export { Scratch, gloadBytes, gloadUint64 } from './scratch';
|
|
13
|
+
export { Block } from './block';
|
|
9
14
|
export { Txn, gaid } from './txn';
|
|
10
|
-
export { GITxn, ITxn, ITxnCreate } from './itxn';
|
|
11
|
-
export { Scratch } from './scratch';
|
package/impl/scratch.d.ts
CHANGED
package/impl/state.d.ts
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Account, bytes, GlobalState, GlobalStateOptions, LocalState } from '@algorandfoundation/algorand-typescript';
|
|
2
|
+
export declare class GlobalStateCls<ValueType> {
|
|
3
|
+
#private;
|
|
4
|
+
private readonly _type;
|
|
5
|
+
key: bytes | undefined;
|
|
6
|
+
delete: () => void;
|
|
7
|
+
static [Symbol.hasInstance](x: unknown): x is GlobalStateCls<unknown>;
|
|
8
|
+
get value(): ValueType;
|
|
9
|
+
set value(v: ValueType);
|
|
10
|
+
get hasValue(): boolean;
|
|
11
|
+
constructor(key?: bytes | string, value?: ValueType);
|
|
12
|
+
}
|
|
13
|
+
export declare class LocalStateCls<ValueType> {
|
|
14
|
+
#private;
|
|
15
|
+
delete: () => void;
|
|
16
|
+
get value(): ValueType;
|
|
17
|
+
set value(v: ValueType);
|
|
18
|
+
get hasValue(): boolean;
|
|
19
|
+
}
|
|
20
|
+
export declare class LocalStateMapCls<ValueType> {
|
|
21
|
+
#private;
|
|
22
|
+
getValue(account: Account): LocalStateCls<ValueType>;
|
|
23
|
+
}
|
|
24
|
+
export declare function createGlobalState<ValueType>(options?: GlobalStateOptions<ValueType>): GlobalState<ValueType>;
|
|
25
|
+
export declare function createLocalState<ValueType>(options?: {
|
|
26
|
+
key?: bytes | string;
|
|
27
|
+
}): LocalState<ValueType>;
|
package/impl/transactions.d.ts
CHANGED
|
@@ -98,7 +98,7 @@ export type ApplicationTransactionFields = TxnFields<gtxn.ApplicationTxn> & Part
|
|
|
98
98
|
approvalProgramPages: Array<bytes>;
|
|
99
99
|
clearStateProgramPages: Array<bytes>;
|
|
100
100
|
appLogs: Array<bytes>;
|
|
101
|
-
scratchSpace:
|
|
101
|
+
scratchSpace: Record<number, bytes | uint64>;
|
|
102
102
|
}>;
|
|
103
103
|
export declare class ApplicationTransaction extends TransactionBase implements gtxn.ApplicationTxn {
|
|
104
104
|
#private;
|