@algorandfoundation/algorand-typescript-testing 1.0.0-alpha.6 → 1.0.0-alpha.8
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/constants.d.ts +1 -0
- package/encoders.d.ts +21 -0
- package/impl/application.d.ts +1 -0
- package/impl/base.d.ts +8 -1
- package/impl/box.d.ts +2 -0
- package/impl/crypto.d.ts +5 -5
- package/impl/index.d.ts +1 -0
- package/impl/pure.d.ts +2 -2
- package/impl/state.d.ts +80 -4
- package/index.mjs +533 -35
- package/index.mjs.map +1 -1
- package/package.json +3 -3
- package/{runtime-helpers-Dv3qU-7_.js → runtime-helpers-C_HAST0y.js} +31 -16
- package/runtime-helpers-C_HAST0y.js.map +1 -0
- package/runtime-helpers.d.ts +2 -1
- package/runtime-helpers.mjs +2 -1
- package/runtime-helpers.mjs.map +1 -1
- package/subcontexts/contract-context.d.ts +2 -0
- package/subcontexts/ledger-context.d.ts +4 -0
- package/subcontexts/transaction-context.d.ts +11 -2
- package/test-execution-context.d.ts +6 -3
- package/test-transformer/index.mjs +87 -21
- package/test-transformer/index.mjs.map +1 -1
- package/test-transformer/node-factory.d.ts +2 -1
- package/test-transformer/supported-binary-op-string.d.ts +1 -0
- package/util.d.ts +2 -0
- package/runtime-helpers-Dv3qU-7_.js.map +0 -1
package/constants.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ export declare const MAX_UINT64: bigint;
|
|
|
5
5
|
export declare const MAX_UINT512: bigint;
|
|
6
6
|
export declare const MAX_BYTES_SIZE = 4096;
|
|
7
7
|
export declare const MAX_ITEMS_IN_LOG = 32;
|
|
8
|
+
export declare const MAX_BOX_SIZE = 32768;
|
|
8
9
|
export declare const BITS_IN_BYTE = 8;
|
|
9
10
|
export declare const DEFAULT_ACCOUNT_MIN_BALANCE = 100000;
|
|
10
11
|
export declare const DEFAULT_MAX_TXN_LIFE = 1000;
|
package/encoders.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { biguint, bytes, TransactionType, uint64 } from '@algorandfoundation/algorand-typescript';
|
|
2
|
+
import { OnCompleteAction } from '@algorandfoundation/algorand-typescript/arc4';
|
|
3
|
+
export interface TypeInfo {
|
|
4
|
+
name: string;
|
|
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
|
+
};
|
|
20
|
+
export declare const getEncoder: <T>(typeInfo: TypeInfo) => fromBytes<T>;
|
|
21
|
+
export {};
|
package/impl/application.d.ts
CHANGED
package/impl/base.d.ts
CHANGED
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
import { bytes, uint64 } from '@algorandfoundation/algorand-typescript';
|
|
2
|
+
import type { TypeInfo } from '../encoders';
|
|
2
3
|
export declare abstract class BytesBackedCls {
|
|
3
4
|
#private;
|
|
4
5
|
get bytes(): bytes;
|
|
5
|
-
constructor(value: bytes);
|
|
6
|
+
constructor(value: bytes, _typeInfo?: TypeInfo);
|
|
7
|
+
static fromBytes<T extends BytesBackedCls>(this: {
|
|
8
|
+
new (v: bytes, typeInfo?: TypeInfo): T;
|
|
9
|
+
}, value: Uint8Array, typeInfo?: TypeInfo): T;
|
|
6
10
|
}
|
|
7
11
|
export declare abstract class Uint64BackedCls {
|
|
8
12
|
#private;
|
|
9
13
|
get uint64(): uint64;
|
|
10
14
|
constructor(value: uint64);
|
|
15
|
+
static fromBytes<T extends Uint64BackedCls>(this: {
|
|
16
|
+
new (v: uint64): T;
|
|
17
|
+
}, value: Uint8Array): T;
|
|
11
18
|
}
|
package/impl/box.d.ts
ADDED
package/impl/crypto.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { bytes, internal } from '@algorandfoundation/algorand-typescript';
|
|
1
|
+
import { bytes, Ecdsa, internal, VrfVerify } from '@algorandfoundation/algorand-typescript';
|
|
2
2
|
export declare const sha256: (a: internal.primitives.StubBytesCompat) => bytes;
|
|
3
3
|
export declare const sha3_256: (a: internal.primitives.StubBytesCompat) => bytes;
|
|
4
4
|
export declare const keccak256: (a: internal.primitives.StubBytesCompat) => bytes;
|
|
5
5
|
export declare const sha512_256: (a: internal.primitives.StubBytesCompat) => bytes;
|
|
6
6
|
export declare const ed25519verifyBare: (a: internal.primitives.StubBytesCompat, b: internal.primitives.StubBytesCompat, c: internal.primitives.StubBytesCompat) => boolean;
|
|
7
7
|
export declare const ed25519verify: (a: internal.primitives.StubBytesCompat, b: internal.primitives.StubBytesCompat, c: internal.primitives.StubBytesCompat) => boolean;
|
|
8
|
-
export declare const ecdsaVerify: (v:
|
|
9
|
-
export declare const ecdsaPkRecover: (v:
|
|
10
|
-
export declare const ecdsaPkDecompress: (v:
|
|
11
|
-
export declare const vrfVerify: (_s:
|
|
8
|
+
export declare const ecdsaVerify: (v: Ecdsa, a: internal.primitives.StubBytesCompat, b: internal.primitives.StubBytesCompat, c: internal.primitives.StubBytesCompat, d: internal.primitives.StubBytesCompat, e: internal.primitives.StubBytesCompat) => boolean;
|
|
9
|
+
export declare const ecdsaPkRecover: (v: Ecdsa, a: internal.primitives.StubBytesCompat, b: internal.primitives.StubUint64Compat, c: internal.primitives.StubBytesCompat, d: internal.primitives.StubBytesCompat) => readonly [bytes, bytes];
|
|
10
|
+
export declare const ecdsaPkDecompress: (v: Ecdsa, a: internal.primitives.StubBytesCompat) => readonly [bytes, bytes];
|
|
11
|
+
export declare const vrfVerify: (_s: VrfVerify, _a: internal.primitives.StubBytesCompat, _b: internal.primitives.StubBytesCompat, _c: internal.primitives.StubBytesCompat) => readonly [bytes, boolean];
|
|
12
12
|
export declare const EllipticCurve: internal.opTypes.EllipticCurveType;
|
package/impl/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ 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 { Box } from './box';
|
|
7
8
|
export * from './crypto';
|
|
8
9
|
export { Global } from './global';
|
|
9
10
|
export { GTxn } from './gtxn';
|
package/impl/pure.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { biguint, bytes, internal, uint64 } from '@algorandfoundation/algorand-typescript';
|
|
1
|
+
import { Base64, biguint, bytes, internal, uint64 } from '@algorandfoundation/algorand-typescript';
|
|
2
2
|
export declare const addw: (a: internal.primitives.StubUint64Compat, b: internal.primitives.StubUint64Compat) => readonly [uint64, uint64];
|
|
3
|
-
export declare const base64Decode: (e:
|
|
3
|
+
export declare const base64Decode: (e: Base64, a: internal.primitives.StubBytesCompat) => bytes;
|
|
4
4
|
export declare const bitLength: (a: internal.primitives.StubUint64Compat | internal.primitives.StubBytesCompat) => uint64;
|
|
5
5
|
export declare const bsqrt: (a: internal.primitives.StubBigUintCompat) => biguint;
|
|
6
6
|
export declare const btoi: (a: internal.primitives.StubBytesCompat) => uint64;
|
package/impl/state.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { Account, bytes, GlobalState,
|
|
1
|
+
import { Account, BoxMap as BoxMapType, BoxRef as BoxRefType, Box as BoxType, bytes, GlobalStateOptions, GlobalState as GlobalStateType, internal, LocalState as LocalStateType, uint64 } from '@algorandfoundation/algorand-typescript';
|
|
2
2
|
export declare class GlobalStateCls<ValueType> {
|
|
3
3
|
#private;
|
|
4
4
|
private readonly _type;
|
|
5
5
|
key: bytes | undefined;
|
|
6
|
+
get hasKey(): boolean;
|
|
6
7
|
delete: () => void;
|
|
7
8
|
static [Symbol.hasInstance](x: unknown): x is GlobalStateCls<unknown>;
|
|
8
9
|
get value(): ValueType;
|
|
@@ -21,7 +22,82 @@ export declare class LocalStateMapCls<ValueType> {
|
|
|
21
22
|
#private;
|
|
22
23
|
getValue(account: Account): LocalStateCls<ValueType>;
|
|
23
24
|
}
|
|
24
|
-
export declare function
|
|
25
|
-
export declare function
|
|
25
|
+
export declare function GlobalState<ValueType>(options?: GlobalStateOptions<ValueType>): GlobalStateType<ValueType>;
|
|
26
|
+
export declare function LocalState<ValueType>(options?: {
|
|
26
27
|
key?: bytes | string;
|
|
27
|
-
}):
|
|
28
|
+
}): LocalStateType<ValueType>;
|
|
29
|
+
export declare class BoxCls<TValue> {
|
|
30
|
+
#private;
|
|
31
|
+
private readonly _type;
|
|
32
|
+
static [Symbol.hasInstance](x: unknown): x is BoxCls<unknown>;
|
|
33
|
+
constructor(key?: internal.primitives.StubBytesCompat);
|
|
34
|
+
private get fromBytes();
|
|
35
|
+
get value(): TValue;
|
|
36
|
+
set value(v: TValue);
|
|
37
|
+
get hasKey(): boolean;
|
|
38
|
+
get key(): bytes;
|
|
39
|
+
set key(key: internal.primitives.StubBytesCompat);
|
|
40
|
+
get exists(): boolean;
|
|
41
|
+
get length(): uint64;
|
|
42
|
+
get(options: {
|
|
43
|
+
default: TValue;
|
|
44
|
+
}): TValue;
|
|
45
|
+
delete(): boolean;
|
|
46
|
+
maybe(): readonly [TValue, boolean];
|
|
47
|
+
}
|
|
48
|
+
export declare class BoxMapCls<TKey, TValue> {
|
|
49
|
+
#private;
|
|
50
|
+
private readonly _type;
|
|
51
|
+
static [Symbol.hasInstance](x: unknown): x is BoxMapCls<unknown, unknown>;
|
|
52
|
+
private get fromBytes();
|
|
53
|
+
constructor(keyPrefix?: internal.primitives.StubBytesCompat);
|
|
54
|
+
get hasKeyPrefix(): boolean;
|
|
55
|
+
get keyPrefix(): bytes;
|
|
56
|
+
set keyPrefix(keyPrefix: internal.primitives.StubBytesCompat);
|
|
57
|
+
get(key: TKey, options?: {
|
|
58
|
+
default: TValue;
|
|
59
|
+
}): TValue;
|
|
60
|
+
set(key: TKey, value: TValue): void;
|
|
61
|
+
delete(key: TKey): boolean;
|
|
62
|
+
has(key: TKey): boolean;
|
|
63
|
+
maybe(key: TKey): readonly [TValue, boolean];
|
|
64
|
+
length(key: TKey): uint64;
|
|
65
|
+
private getFullKey;
|
|
66
|
+
}
|
|
67
|
+
export declare class BoxRefCls {
|
|
68
|
+
#private;
|
|
69
|
+
private readonly _type;
|
|
70
|
+
static [Symbol.hasInstance](x: unknown): x is BoxRefCls;
|
|
71
|
+
constructor(key?: internal.primitives.StubBytesCompat);
|
|
72
|
+
get hasKey(): boolean;
|
|
73
|
+
get key(): bytes;
|
|
74
|
+
set key(key: internal.primitives.StubBytesCompat);
|
|
75
|
+
get value(): bytes;
|
|
76
|
+
set value(v: internal.primitives.StubBytesCompat);
|
|
77
|
+
get exists(): boolean;
|
|
78
|
+
create(options: {
|
|
79
|
+
size: internal.primitives.StubUint64Compat;
|
|
80
|
+
}): boolean;
|
|
81
|
+
get(options: {
|
|
82
|
+
default: internal.primitives.StubBytesCompat;
|
|
83
|
+
}): bytes;
|
|
84
|
+
put(value: internal.primitives.StubBytesCompat): void;
|
|
85
|
+
splice(start: internal.primitives.StubUint64Compat, length: internal.primitives.StubUint64Compat, value: internal.primitives.StubBytesCompat): void;
|
|
86
|
+
replace(start: internal.primitives.StubUint64Compat, value: internal.primitives.StubBytesCompat): void;
|
|
87
|
+
extract(start: internal.primitives.StubUint64Compat, length: internal.primitives.StubUint64Compat): bytes;
|
|
88
|
+
delete(): boolean;
|
|
89
|
+
resize(newSize: uint64): void;
|
|
90
|
+
maybe(): readonly [bytes, boolean];
|
|
91
|
+
get length(): uint64;
|
|
92
|
+
private get backingValue();
|
|
93
|
+
private set backingValue(value);
|
|
94
|
+
}
|
|
95
|
+
export declare function Box<TValue>(options?: {
|
|
96
|
+
key: bytes | string;
|
|
97
|
+
}): BoxType<TValue>;
|
|
98
|
+
export declare function BoxMap<TKey, TValue>(options?: {
|
|
99
|
+
keyPrefix: bytes | string;
|
|
100
|
+
}): BoxMapType<TKey, TValue>;
|
|
101
|
+
export declare function BoxRef(options?: {
|
|
102
|
+
key: bytes | string;
|
|
103
|
+
}): BoxRefType;
|