@lightprotocol/stateless.js 0.19.0 → 0.20.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.
- package/README.md +1 -1
- package/dist/cjs/browser/constants.d.ts +33 -16
- package/dist/cjs/browser/index.cjs +1 -1
- package/dist/cjs/browser/index.cjs.map +1 -1
- package/dist/cjs/browser/index.d.ts +1 -0
- package/dist/cjs/browser/logger.d.ts +1 -0
- package/dist/cjs/browser/programs/layout.d.ts +17 -1
- package/dist/cjs/browser/rpc-interface.d.ts +109 -109
- package/dist/cjs/browser/rpc.d.ts +8 -9
- package/dist/cjs/browser/state/types.d.ts +39 -0
- package/dist/cjs/browser/test-helpers/test-rpc/get-parsed-events.d.ts +3 -1
- package/dist/cjs/browser/test-helpers/test-rpc/test-rpc.d.ts +5 -6
- package/dist/cjs/browser/utils/get-light-state-tree-info.d.ts +11 -9
- package/dist/cjs/node/constants.d.ts +33 -16
- package/dist/cjs/node/index.cjs +1 -1
- package/dist/cjs/node/index.cjs.map +1 -1
- package/dist/cjs/node/index.d.ts +1 -0
- package/dist/cjs/node/logger.d.ts +1 -0
- package/dist/cjs/node/programs/layout.d.ts +17 -1
- package/dist/cjs/node/rpc-interface.d.ts +109 -109
- package/dist/cjs/node/rpc.d.ts +8 -9
- package/dist/cjs/node/state/types.d.ts +39 -0
- package/dist/cjs/node/test-helpers/test-rpc/get-parsed-events.d.ts +3 -1
- package/dist/cjs/node/test-helpers/test-rpc/test-rpc.d.ts +5 -6
- package/dist/cjs/node/utils/get-light-state-tree-info.d.ts +11 -9
- package/dist/types/index.d.ts +116 -43
- package/package.json +7 -2
package/dist/cjs/node/rpc.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { CompressedProofWithContext, CompressedTransaction, CompressionApiInterf
|
|
|
4
4
|
import { MerkleContextWithMerkleProof, BN254, CompressedAccountWithMerkleContext, CompressedProof } from './state';
|
|
5
5
|
import BN from 'bn.js';
|
|
6
6
|
import { LightWasm } from './test-helpers';
|
|
7
|
-
import {
|
|
7
|
+
import { ActiveTreeBundle } from './state/types';
|
|
8
8
|
/** @internal */
|
|
9
9
|
export declare function parseAccountData({ discriminator, data, dataHash, }: {
|
|
10
10
|
discriminator: BN;
|
|
@@ -70,7 +70,7 @@ export declare function getPublicInputHash(accountProofs: MerkleContextWithMerkl
|
|
|
70
70
|
* @param tree - The tree to get the queue for
|
|
71
71
|
* @returns The queue for the given tree, or undefined if not found
|
|
72
72
|
*/
|
|
73
|
-
export declare function getQueueForTree(info:
|
|
73
|
+
export declare function getQueueForTree(info: ActiveTreeBundle[], tree: PublicKey): PublicKey;
|
|
74
74
|
/**
|
|
75
75
|
* Get the tree for a given queue
|
|
76
76
|
*
|
|
@@ -78,7 +78,7 @@ export declare function getQueueForTree(info: ActiveStateTreeAddresses, tree: Pu
|
|
|
78
78
|
* @param queue - The queue to get the tree for
|
|
79
79
|
* @returns The tree for the given queue, or undefined if not found
|
|
80
80
|
*/
|
|
81
|
-
export declare function getTreeForQueue(info:
|
|
81
|
+
export declare function getTreeForQueue(info: ActiveTreeBundle[], queue: PublicKey): PublicKey;
|
|
82
82
|
/**
|
|
83
83
|
* Get a random tree and queue from the active state tree addresses.
|
|
84
84
|
*
|
|
@@ -87,7 +87,7 @@ export declare function getTreeForQueue(info: ActiveStateTreeAddresses, queue: P
|
|
|
87
87
|
* @param info - The active state tree addresses
|
|
88
88
|
* @returns A random tree and queue
|
|
89
89
|
*/
|
|
90
|
-
export declare function pickRandomTreeAndQueue(info:
|
|
90
|
+
export declare function pickRandomTreeAndQueue(info: ActiveTreeBundle[]): {
|
|
91
91
|
tree: PublicKey;
|
|
92
92
|
queue: PublicKey;
|
|
93
93
|
};
|
|
@@ -97,22 +97,21 @@ export declare function pickRandomTreeAndQueue(info: ActiveStateTreeAddresses):
|
|
|
97
97
|
export declare class Rpc extends Connection implements CompressionApiInterface {
|
|
98
98
|
compressionApiEndpoint: string;
|
|
99
99
|
proverEndpoint: string;
|
|
100
|
-
activeStateTreeInfo:
|
|
101
|
-
fetchStateTreePromise: Promise<ActiveStateTreeAddresses> | null;
|
|
100
|
+
activeStateTreeInfo: ActiveTreeBundle[] | null;
|
|
102
101
|
constructor(endpoint: string, compressionApiEndpoint: string, proverEndpoint: string, config?: ConnectionConfig);
|
|
103
102
|
/**
|
|
104
103
|
* Manually set state tree addresses
|
|
105
104
|
*/
|
|
106
|
-
setStateTreeInfo(info:
|
|
105
|
+
setStateTreeInfo(info: ActiveTreeBundle[]): void;
|
|
107
106
|
/**
|
|
108
107
|
* Get the active state tree addresses from the cluster.
|
|
109
108
|
* If not already cached, fetches from the cluster.
|
|
110
109
|
*/
|
|
111
|
-
getCachedActiveStateTreeInfo(): Promise<
|
|
110
|
+
getCachedActiveStateTreeInfo(): Promise<ActiveTreeBundle[]>;
|
|
112
111
|
/**
|
|
113
112
|
* Fetch the latest state tree addresses from the cluster.
|
|
114
113
|
*/
|
|
115
|
-
getLatestActiveStateTreeInfo(): Promise<
|
|
114
|
+
getLatestActiveStateTreeInfo(): Promise<ActiveTreeBundle[]>;
|
|
116
115
|
/**
|
|
117
116
|
* Fetch the compressed account for the specified account address or hash
|
|
118
117
|
*/
|
|
@@ -2,6 +2,30 @@ import BN from 'bn.js';
|
|
|
2
2
|
import { PublicKey } from '@solana/web3.js';
|
|
3
3
|
import { Buffer } from 'buffer';
|
|
4
4
|
import { NewAddressParamsPacked } from '../utils';
|
|
5
|
+
export declare enum TreeType {
|
|
6
|
+
/**
|
|
7
|
+
* v1 state merkle tree
|
|
8
|
+
*/
|
|
9
|
+
State = 0,
|
|
10
|
+
/**
|
|
11
|
+
* v1 address merkle tree
|
|
12
|
+
*/
|
|
13
|
+
Address = 1,
|
|
14
|
+
/**
|
|
15
|
+
* v2 state merkle tree
|
|
16
|
+
*/
|
|
17
|
+
BatchedState = 2,
|
|
18
|
+
/**
|
|
19
|
+
* v2 address merkle tree
|
|
20
|
+
*/
|
|
21
|
+
BatchedAddress = 3
|
|
22
|
+
}
|
|
23
|
+
export type ActiveTreeBundle = {
|
|
24
|
+
tree: PublicKey;
|
|
25
|
+
queue: PublicKey | null;
|
|
26
|
+
cpiContext: PublicKey | null;
|
|
27
|
+
treeType: TreeType;
|
|
28
|
+
};
|
|
5
29
|
export interface PackedCompressedAccountWithMerkleContext {
|
|
6
30
|
compressedAccount: CompressedAccount;
|
|
7
31
|
merkleContext: PackedMerkleContext;
|
|
@@ -73,6 +97,21 @@ export interface InstructionDataInvoke {
|
|
|
73
97
|
compressOrDecompressLamports: BN | null;
|
|
74
98
|
isCompress: boolean;
|
|
75
99
|
}
|
|
100
|
+
export interface InstructionDataInvokeCpi {
|
|
101
|
+
proof: CompressedProof | null;
|
|
102
|
+
inputCompressedAccountsWithMerkleContext: PackedCompressedAccountWithMerkleContext[];
|
|
103
|
+
outputCompressedAccounts: OutputCompressedAccountWithPackedContext[];
|
|
104
|
+
relayFee: BN | null;
|
|
105
|
+
newAddressParams: NewAddressParamsPacked[];
|
|
106
|
+
compressOrDecompressLamports: BN | null;
|
|
107
|
+
isCompress: boolean;
|
|
108
|
+
compressedCpiContext: CompressedCpiContext | null;
|
|
109
|
+
}
|
|
110
|
+
export interface CompressedCpiContext {
|
|
111
|
+
set_context: boolean;
|
|
112
|
+
first_set_context: boolean;
|
|
113
|
+
cpi_context_account_index: number;
|
|
114
|
+
}
|
|
76
115
|
export interface CompressedProof {
|
|
77
116
|
a: number[];
|
|
78
117
|
b: number[];
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { ParsedTransactionWithMeta } from '@solana/web3.js';
|
|
1
|
+
import { ParsedTransactionWithMeta, PublicKey } from '@solana/web3.js';
|
|
2
2
|
import { Rpc } from '../../rpc';
|
|
3
3
|
import { PublicTransactionEvent } from '../../state';
|
|
4
|
+
import { Buffer } from 'buffer';
|
|
4
5
|
type Deserializer<T> = (data: Buffer, tx: ParsedTransactionWithMeta) => T;
|
|
5
6
|
/**
|
|
6
7
|
* @internal
|
|
@@ -10,4 +11,5 @@ type Deserializer<T> = (data: Buffer, tx: ParsedTransactionWithMeta) => T;
|
|
|
10
11
|
export declare function getParsedEvents(rpc: Rpc): Promise<PublicTransactionEvent[]>;
|
|
11
12
|
export declare const parseEvents: <T>(indexerEventsTransactions: (ParsedTransactionWithMeta | null)[], deserializeFn: Deserializer<T>) => NonNullable<T>[];
|
|
12
13
|
export declare const parsePublicTransactionEventWithIdl: (data: Buffer) => PublicTransactionEvent | null;
|
|
14
|
+
export declare function parseLightTransaction(dataVec: Uint8Array[], accountKeys: PublicKey[][]): PublicTransactionEvent | null | undefined;
|
|
13
15
|
export {};
|
|
@@ -4,7 +4,7 @@ import { AddressWithTree, CompressedMintTokenHolders, CompressedTransaction, Get
|
|
|
4
4
|
import { CompressedProofWithContext, CompressionApiInterface, GetCompressedTokenAccountsByOwnerOrDelegateOptions, ParsedTokenAccount, TokenBalance } from '../../rpc-interface';
|
|
5
5
|
import { BN254, CompressedAccountWithMerkleContext, MerkleContextWithMerkleProof } from '../../state';
|
|
6
6
|
import { MerkleContextWithNewAddressProof } from '../../rpc';
|
|
7
|
-
import {
|
|
7
|
+
import { ActiveTreeBundle } from '../../state/types';
|
|
8
8
|
export interface TestRpcConfig {
|
|
9
9
|
/**
|
|
10
10
|
* Address of the state tree to index. Default: public default test state
|
|
@@ -75,8 +75,7 @@ export declare class TestRpc extends Connection implements CompressionApiInterfa
|
|
|
75
75
|
lightWasm: LightWasm;
|
|
76
76
|
depth: number;
|
|
77
77
|
log: boolean;
|
|
78
|
-
activeStateTreeInfo:
|
|
79
|
-
fetchStateTreePromise: Promise<ActiveStateTreeAddresses> | null;
|
|
78
|
+
activeStateTreeInfo: ActiveTreeBundle[] | null;
|
|
80
79
|
/**
|
|
81
80
|
* Establish a Compression-compatible JSON RPC mock-connection
|
|
82
81
|
*
|
|
@@ -93,15 +92,15 @@ export declare class TestRpc extends Connection implements CompressionApiInterfa
|
|
|
93
92
|
/**
|
|
94
93
|
* Manually set state tree addresses
|
|
95
94
|
*/
|
|
96
|
-
setStateTreeInfo(info:
|
|
95
|
+
setStateTreeInfo(info: ActiveTreeBundle[]): void;
|
|
97
96
|
/**
|
|
98
97
|
* Returns local test state trees.
|
|
99
98
|
*/
|
|
100
|
-
getCachedActiveStateTreeInfo(): Promise<
|
|
99
|
+
getCachedActiveStateTreeInfo(): Promise<ActiveTreeBundle[]>;
|
|
101
100
|
/**
|
|
102
101
|
* Returns local test state trees.
|
|
103
102
|
*/
|
|
104
|
-
getLatestActiveStateTreeInfo(): Promise<
|
|
103
|
+
getLatestActiveStateTreeInfo(): Promise<ActiveTreeBundle[]>;
|
|
105
104
|
/**
|
|
106
105
|
* Fetch the compressed account for the specified account hash
|
|
107
106
|
*/
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Connection, Keypair, PublicKey } from '@solana/web3.js';
|
|
2
|
+
import { ActiveTreeBundle } from '../state/types';
|
|
2
3
|
/**
|
|
3
4
|
* Create two lookup tables storing all public state tree and queue addresses
|
|
4
5
|
* returns lookup table addresses and txId
|
|
@@ -25,14 +26,16 @@ export declare function createStateTreeLookupTable({ connection, payer, authorit
|
|
|
25
26
|
* @param tableAddress - Address of the lookup table to extend
|
|
26
27
|
* @param newStateTreeAddresses - Addresses of the new state trees to add
|
|
27
28
|
* @param newQueueAddresses - Addresses of the new queues to add
|
|
29
|
+
* @param newCpiContextAddresses - Addresses of the new cpi contexts to add
|
|
28
30
|
* @param payer - Keypair of the payer
|
|
29
31
|
* @param authority - Keypair of the authority
|
|
30
32
|
*/
|
|
31
|
-
export declare function extendStateTreeLookupTable({ connection, tableAddress, newStateTreeAddresses, newQueueAddresses, payer, authority, }: {
|
|
33
|
+
export declare function extendStateTreeLookupTable({ connection, tableAddress, newStateTreeAddresses, newQueueAddresses, newCpiContextAddresses, payer, authority, }: {
|
|
32
34
|
connection: Connection;
|
|
33
35
|
tableAddress: PublicKey;
|
|
34
36
|
newStateTreeAddresses: PublicKey[];
|
|
35
37
|
newQueueAddresses: PublicKey[];
|
|
38
|
+
newCpiContextAddresses: PublicKey[];
|
|
36
39
|
payer: Keypair;
|
|
37
40
|
authority: Keypair;
|
|
38
41
|
}): Promise<{
|
|
@@ -40,12 +43,15 @@ export declare function extendStateTreeLookupTable({ connection, tableAddress, n
|
|
|
40
43
|
txId: string;
|
|
41
44
|
}>;
|
|
42
45
|
/**
|
|
43
|
-
* Adds
|
|
46
|
+
* Adds state tree address to lookup table. Acts as nullifier lookup for rolled
|
|
47
|
+
* over state trees.
|
|
44
48
|
* @internal
|
|
45
49
|
* @param connection - Connection to the Solana network
|
|
46
50
|
* @param stateTreeAddress - Address of the state tree to nullify
|
|
47
|
-
* @param nullifyTableAddress - Address nullifier lookup table to store
|
|
48
|
-
*
|
|
51
|
+
* @param nullifyTableAddress - Address of the nullifier lookup table to store
|
|
52
|
+
* address in
|
|
53
|
+
* @param stateTreeLookupTableAddress - lookup table storing all state tree
|
|
54
|
+
* addresses
|
|
49
55
|
* @param payer - Keypair of the payer
|
|
50
56
|
* @param authority - Keypair of the authority
|
|
51
57
|
*/
|
|
@@ -59,10 +65,6 @@ export declare function nullifyLookupTable({ connection, fullStateTreeAddress, n
|
|
|
59
65
|
}): Promise<{
|
|
60
66
|
txId: string;
|
|
61
67
|
}>;
|
|
62
|
-
export type ActiveStateTreeAddresses = {
|
|
63
|
-
activeStateTrees: PublicKey[];
|
|
64
|
-
activeQueues: PublicKey[];
|
|
65
|
-
};
|
|
66
68
|
/**
|
|
67
69
|
* Get most recent , active state tree data
|
|
68
70
|
* we store in lookup table for each public state tree
|
|
@@ -71,4 +73,4 @@ export declare function getLightStateTreeInfo({ connection, stateTreeLookupTable
|
|
|
71
73
|
connection: Connection;
|
|
72
74
|
stateTreeLookupTableAddress: PublicKey;
|
|
73
75
|
nullifyTableAddress: PublicKey;
|
|
74
|
-
}): Promise<
|
|
76
|
+
}): Promise<ActiveTreeBundle[]>;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -230,14 +230,16 @@ declare function createStateTreeLookupTable({ connection, payer, authority, rece
|
|
|
230
230
|
* @param tableAddress - Address of the lookup table to extend
|
|
231
231
|
* @param newStateTreeAddresses - Addresses of the new state trees to add
|
|
232
232
|
* @param newQueueAddresses - Addresses of the new queues to add
|
|
233
|
+
* @param newCpiContextAddresses - Addresses of the new cpi contexts to add
|
|
233
234
|
* @param payer - Keypair of the payer
|
|
234
235
|
* @param authority - Keypair of the authority
|
|
235
236
|
*/
|
|
236
|
-
declare function extendStateTreeLookupTable({ connection, tableAddress, newStateTreeAddresses, newQueueAddresses, payer, authority, }: {
|
|
237
|
+
declare function extendStateTreeLookupTable({ connection, tableAddress, newStateTreeAddresses, newQueueAddresses, newCpiContextAddresses, payer, authority, }: {
|
|
237
238
|
connection: Connection;
|
|
238
239
|
tableAddress: PublicKey;
|
|
239
240
|
newStateTreeAddresses: PublicKey[];
|
|
240
241
|
newQueueAddresses: PublicKey[];
|
|
242
|
+
newCpiContextAddresses: PublicKey[];
|
|
241
243
|
payer: Keypair;
|
|
242
244
|
authority: Keypair;
|
|
243
245
|
}): Promise<{
|
|
@@ -245,12 +247,15 @@ declare function extendStateTreeLookupTable({ connection, tableAddress, newState
|
|
|
245
247
|
txId: string;
|
|
246
248
|
}>;
|
|
247
249
|
/**
|
|
248
|
-
* Adds
|
|
250
|
+
* Adds state tree address to lookup table. Acts as nullifier lookup for rolled
|
|
251
|
+
* over state trees.
|
|
249
252
|
* @internal
|
|
250
253
|
* @param connection - Connection to the Solana network
|
|
251
254
|
* @param stateTreeAddress - Address of the state tree to nullify
|
|
252
|
-
* @param nullifyTableAddress - Address nullifier lookup table to store
|
|
253
|
-
*
|
|
255
|
+
* @param nullifyTableAddress - Address of the nullifier lookup table to store
|
|
256
|
+
* address in
|
|
257
|
+
* @param stateTreeLookupTableAddress - lookup table storing all state tree
|
|
258
|
+
* addresses
|
|
254
259
|
* @param payer - Keypair of the payer
|
|
255
260
|
* @param authority - Keypair of the authority
|
|
256
261
|
*/
|
|
@@ -264,10 +269,6 @@ declare function nullifyLookupTable({ connection, fullStateTreeAddress, nullifyT
|
|
|
264
269
|
}): Promise<{
|
|
265
270
|
txId: string;
|
|
266
271
|
}>;
|
|
267
|
-
type ActiveStateTreeAddresses = {
|
|
268
|
-
activeStateTrees: PublicKey[];
|
|
269
|
-
activeQueues: PublicKey[];
|
|
270
|
-
};
|
|
271
272
|
/**
|
|
272
273
|
* Get most recent , active state tree data
|
|
273
274
|
* we store in lookup table for each public state tree
|
|
@@ -276,8 +277,32 @@ declare function getLightStateTreeInfo({ connection, stateTreeLookupTableAddress
|
|
|
276
277
|
connection: Connection;
|
|
277
278
|
stateTreeLookupTableAddress: PublicKey;
|
|
278
279
|
nullifyTableAddress: PublicKey;
|
|
279
|
-
}): Promise<
|
|
280
|
+
}): Promise<ActiveTreeBundle[]>;
|
|
280
281
|
|
|
282
|
+
declare enum TreeType {
|
|
283
|
+
/**
|
|
284
|
+
* v1 state merkle tree
|
|
285
|
+
*/
|
|
286
|
+
State = 0,
|
|
287
|
+
/**
|
|
288
|
+
* v1 address merkle tree
|
|
289
|
+
*/
|
|
290
|
+
Address = 1,
|
|
291
|
+
/**
|
|
292
|
+
* v2 state merkle tree
|
|
293
|
+
*/
|
|
294
|
+
BatchedState = 2,
|
|
295
|
+
/**
|
|
296
|
+
* v2 address merkle tree
|
|
297
|
+
*/
|
|
298
|
+
BatchedAddress = 3
|
|
299
|
+
}
|
|
300
|
+
type ActiveTreeBundle = {
|
|
301
|
+
tree: PublicKey;
|
|
302
|
+
queue: PublicKey | null;
|
|
303
|
+
cpiContext: PublicKey | null;
|
|
304
|
+
treeType: TreeType;
|
|
305
|
+
};
|
|
281
306
|
interface PackedCompressedAccountWithMerkleContext {
|
|
282
307
|
compressedAccount: CompressedAccount;
|
|
283
308
|
merkleContext: PackedMerkleContext;
|
|
@@ -349,6 +374,21 @@ interface InstructionDataInvoke {
|
|
|
349
374
|
compressOrDecompressLamports: BN | null;
|
|
350
375
|
isCompress: boolean;
|
|
351
376
|
}
|
|
377
|
+
interface InstructionDataInvokeCpi {
|
|
378
|
+
proof: CompressedProof | null;
|
|
379
|
+
inputCompressedAccountsWithMerkleContext: PackedCompressedAccountWithMerkleContext[];
|
|
380
|
+
outputCompressedAccounts: OutputCompressedAccountWithPackedContext[];
|
|
381
|
+
relayFee: BN | null;
|
|
382
|
+
newAddressParams: NewAddressParamsPacked[];
|
|
383
|
+
compressOrDecompressLamports: BN | null;
|
|
384
|
+
isCompress: boolean;
|
|
385
|
+
compressedCpiContext: CompressedCpiContext | null;
|
|
386
|
+
}
|
|
387
|
+
interface CompressedCpiContext {
|
|
388
|
+
set_context: boolean;
|
|
389
|
+
first_set_context: boolean;
|
|
390
|
+
cpi_context_account_index: number;
|
|
391
|
+
}
|
|
352
392
|
interface CompressedProof {
|
|
353
393
|
a: number[];
|
|
354
394
|
b: number[];
|
|
@@ -1052,9 +1092,9 @@ declare const NewAddressProofResult: Struct<{
|
|
|
1052
1092
|
*/
|
|
1053
1093
|
declare const ValidityProofResult: Struct<{
|
|
1054
1094
|
compressedProof: {
|
|
1095
|
+
c: number[];
|
|
1055
1096
|
a: number[];
|
|
1056
1097
|
b: number[];
|
|
1057
|
-
c: number[];
|
|
1058
1098
|
};
|
|
1059
1099
|
leafIndices: number[];
|
|
1060
1100
|
leaves: BN[];
|
|
@@ -1063,9 +1103,9 @@ declare const ValidityProofResult: Struct<{
|
|
|
1063
1103
|
merkleTrees: PublicKey[];
|
|
1064
1104
|
}, {
|
|
1065
1105
|
compressedProof: Struct<{
|
|
1106
|
+
c: number[];
|
|
1066
1107
|
a: number[];
|
|
1067
1108
|
b: number[];
|
|
1068
|
-
c: number[];
|
|
1069
1109
|
}, {
|
|
1070
1110
|
a: Struct<number[], Struct<number, null>>;
|
|
1071
1111
|
b: Struct<number[], Struct<number, null>>;
|
|
@@ -1638,8 +1678,7 @@ declare class TestRpc extends Connection implements CompressionApiInterface {
|
|
|
1638
1678
|
lightWasm: LightWasm;
|
|
1639
1679
|
depth: number;
|
|
1640
1680
|
log: boolean;
|
|
1641
|
-
activeStateTreeInfo:
|
|
1642
|
-
fetchStateTreePromise: Promise<ActiveStateTreeAddresses> | null;
|
|
1681
|
+
activeStateTreeInfo: ActiveTreeBundle[] | null;
|
|
1643
1682
|
/**
|
|
1644
1683
|
* Establish a Compression-compatible JSON RPC mock-connection
|
|
1645
1684
|
*
|
|
@@ -1656,15 +1695,15 @@ declare class TestRpc extends Connection implements CompressionApiInterface {
|
|
|
1656
1695
|
/**
|
|
1657
1696
|
* Manually set state tree addresses
|
|
1658
1697
|
*/
|
|
1659
|
-
setStateTreeInfo(info:
|
|
1698
|
+
setStateTreeInfo(info: ActiveTreeBundle[]): void;
|
|
1660
1699
|
/**
|
|
1661
1700
|
* Returns local test state trees.
|
|
1662
1701
|
*/
|
|
1663
|
-
getCachedActiveStateTreeInfo(): Promise<
|
|
1702
|
+
getCachedActiveStateTreeInfo(): Promise<ActiveTreeBundle[]>;
|
|
1664
1703
|
/**
|
|
1665
1704
|
* Returns local test state trees.
|
|
1666
1705
|
*/
|
|
1667
|
-
getLatestActiveStateTreeInfo(): Promise<
|
|
1706
|
+
getLatestActiveStateTreeInfo(): Promise<ActiveTreeBundle[]>;
|
|
1668
1707
|
/**
|
|
1669
1708
|
* Fetch the compressed account for the specified account hash
|
|
1670
1709
|
*/
|
|
@@ -2002,7 +2041,7 @@ declare class MerkleTree {
|
|
|
2002
2041
|
static deserialize(data: any, hashFunction: (left: string, right: string) => string): any;
|
|
2003
2042
|
}
|
|
2004
2043
|
|
|
2005
|
-
type Deserializer<T> = (data: Buffer, tx: ParsedTransactionWithMeta) => T;
|
|
2044
|
+
type Deserializer<T> = (data: Buffer$1, tx: ParsedTransactionWithMeta) => T;
|
|
2006
2045
|
/**
|
|
2007
2046
|
* @internal
|
|
2008
2047
|
* Returns newest first.
|
|
@@ -2010,7 +2049,8 @@ type Deserializer<T> = (data: Buffer, tx: ParsedTransactionWithMeta) => T;
|
|
|
2010
2049
|
* */
|
|
2011
2050
|
declare function getParsedEvents(rpc: Rpc): Promise<PublicTransactionEvent[]>;
|
|
2012
2051
|
declare const parseEvents: <T>(indexerEventsTransactions: (ParsedTransactionWithMeta | null)[], deserializeFn: Deserializer<T>) => NonNullable<T>[];
|
|
2013
|
-
declare const parsePublicTransactionEventWithIdl: (data: Buffer) => PublicTransactionEvent | null;
|
|
2052
|
+
declare const parsePublicTransactionEventWithIdl: (data: Buffer$1) => PublicTransactionEvent | null;
|
|
2053
|
+
declare function parseLightTransaction(dataVec: Uint8Array[], accountKeys: PublicKey[][]): PublicTransactionEvent | null | undefined;
|
|
2014
2054
|
|
|
2015
2055
|
type TokenData = {
|
|
2016
2056
|
mint: PublicKey;
|
|
@@ -2141,7 +2181,7 @@ declare function getPublicInputHash(accountProofs: MerkleContextWithMerkleProof[
|
|
|
2141
2181
|
* @param tree - The tree to get the queue for
|
|
2142
2182
|
* @returns The queue for the given tree, or undefined if not found
|
|
2143
2183
|
*/
|
|
2144
|
-
declare function getQueueForTree(info:
|
|
2184
|
+
declare function getQueueForTree(info: ActiveTreeBundle[], tree: PublicKey): PublicKey;
|
|
2145
2185
|
/**
|
|
2146
2186
|
* Get the tree for a given queue
|
|
2147
2187
|
*
|
|
@@ -2149,7 +2189,7 @@ declare function getQueueForTree(info: ActiveStateTreeAddresses, tree: PublicKey
|
|
|
2149
2189
|
* @param queue - The queue to get the tree for
|
|
2150
2190
|
* @returns The tree for the given queue, or undefined if not found
|
|
2151
2191
|
*/
|
|
2152
|
-
declare function getTreeForQueue(info:
|
|
2192
|
+
declare function getTreeForQueue(info: ActiveTreeBundle[], queue: PublicKey): PublicKey;
|
|
2153
2193
|
/**
|
|
2154
2194
|
* Get a random tree and queue from the active state tree addresses.
|
|
2155
2195
|
*
|
|
@@ -2158,7 +2198,7 @@ declare function getTreeForQueue(info: ActiveStateTreeAddresses, queue: PublicKe
|
|
|
2158
2198
|
* @param info - The active state tree addresses
|
|
2159
2199
|
* @returns A random tree and queue
|
|
2160
2200
|
*/
|
|
2161
|
-
declare function pickRandomTreeAndQueue(info:
|
|
2201
|
+
declare function pickRandomTreeAndQueue(info: ActiveTreeBundle[]): {
|
|
2162
2202
|
tree: PublicKey;
|
|
2163
2203
|
queue: PublicKey;
|
|
2164
2204
|
};
|
|
@@ -2168,22 +2208,21 @@ declare function pickRandomTreeAndQueue(info: ActiveStateTreeAddresses): {
|
|
|
2168
2208
|
declare class Rpc extends Connection implements CompressionApiInterface {
|
|
2169
2209
|
compressionApiEndpoint: string;
|
|
2170
2210
|
proverEndpoint: string;
|
|
2171
|
-
activeStateTreeInfo:
|
|
2172
|
-
fetchStateTreePromise: Promise<ActiveStateTreeAddresses> | null;
|
|
2211
|
+
activeStateTreeInfo: ActiveTreeBundle[] | null;
|
|
2173
2212
|
constructor(endpoint: string, compressionApiEndpoint: string, proverEndpoint: string, config?: ConnectionConfig);
|
|
2174
2213
|
/**
|
|
2175
2214
|
* Manually set state tree addresses
|
|
2176
2215
|
*/
|
|
2177
|
-
setStateTreeInfo(info:
|
|
2216
|
+
setStateTreeInfo(info: ActiveTreeBundle[]): void;
|
|
2178
2217
|
/**
|
|
2179
2218
|
* Get the active state tree addresses from the cluster.
|
|
2180
2219
|
* If not already cached, fetches from the cluster.
|
|
2181
2220
|
*/
|
|
2182
|
-
getCachedActiveStateTreeInfo(): Promise<
|
|
2221
|
+
getCachedActiveStateTreeInfo(): Promise<ActiveTreeBundle[]>;
|
|
2183
2222
|
/**
|
|
2184
2223
|
* Fetch the latest state tree addresses from the cluster.
|
|
2185
2224
|
*/
|
|
2186
|
-
getLatestActiveStateTreeInfo(): Promise<
|
|
2225
|
+
getLatestActiveStateTreeInfo(): Promise<ActiveTreeBundle[]>;
|
|
2187
2226
|
/**
|
|
2188
2227
|
* Fetch the compressed account for the specified account address or hash
|
|
2189
2228
|
*/
|
|
@@ -2722,7 +2761,9 @@ declare const MerkleContextLayout: buffer_layout.Layout<unknown>;
|
|
|
2722
2761
|
declare const NewAddressParamsLayout: buffer_layout.Layout<unknown>;
|
|
2723
2762
|
declare const InstructionDataInvokeLayout: Layout<InstructionDataInvoke>;
|
|
2724
2763
|
declare function encodeInstructionDataInvoke(data: InstructionDataInvoke): Buffer$1;
|
|
2764
|
+
declare const InstructionDataInvokeCpiLayout: Layout<InstructionDataInvokeCpi>;
|
|
2725
2765
|
declare function decodeInstructionDataInvoke(buffer: Buffer$1): InstructionDataInvoke;
|
|
2766
|
+
declare function decodeInstructionDataInvokeCpi(buffer: Buffer$1): InstructionDataInvokeCpi;
|
|
2726
2767
|
type invokeAccountsLayoutParams = {
|
|
2727
2768
|
feePayer: PublicKey;
|
|
2728
2769
|
authority: PublicKey;
|
|
@@ -2738,10 +2779,27 @@ declare const invokeAccountsLayout: (accounts: invokeAccountsLayoutParams) => Ac
|
|
|
2738
2779
|
declare const PublicTransactionEventLayout: Layout<PublicTransactionEvent>;
|
|
2739
2780
|
declare function encodePublicTransactionEvent(data: PublicTransactionEvent): Buffer$1;
|
|
2740
2781
|
declare function decodePublicTransactionEvent(buffer: Buffer$1): PublicTransactionEvent;
|
|
2782
|
+
declare const AppendNullifyCreateAddressInputsMetaLayout: buffer_layout.Layout<unknown>;
|
|
2783
|
+
declare const AppendLeavesInputLayout: buffer_layout.Layout<unknown>;
|
|
2784
|
+
declare const InsertNullifierInputLayout: buffer_layout.Layout<unknown>;
|
|
2785
|
+
declare const InsertAddressInputLayout: buffer_layout.Layout<unknown>;
|
|
2786
|
+
declare const MerkleTreeSequenceNumberLayout: buffer_layout.Layout<unknown>;
|
|
2787
|
+
declare function deserializeAppendNullifyCreateAddressInputsIndexer(buffer: Buffer$1): {
|
|
2788
|
+
meta: unknown;
|
|
2789
|
+
leaves: unknown[];
|
|
2790
|
+
nullifiers: unknown[];
|
|
2791
|
+
addresses: unknown[];
|
|
2792
|
+
sequence_numbers: unknown[];
|
|
2793
|
+
output_leaf_indices: number[];
|
|
2794
|
+
};
|
|
2795
|
+
declare function convertToPublicTransactionEvent(decoded: any, remainingAccounts: PublicKey[], invokeData: InstructionDataInvoke): PublicTransactionEvent;
|
|
2741
2796
|
|
|
2742
2797
|
declare const FIELD_SIZE: BN;
|
|
2743
2798
|
declare const HIGHEST_ADDRESS_PLUS_ONE: BN;
|
|
2799
|
+
declare const COMPUTE_BUDGET_PATTERN: number[];
|
|
2744
2800
|
declare const INVOKE_DISCRIMINATOR: Buffer$1;
|
|
2801
|
+
declare const INVOKE_CPI_DISCRIMINATOR: Buffer$1;
|
|
2802
|
+
declare const INSERT_INTO_QUEUES_DISCRIMINATOR: Buffer$1;
|
|
2745
2803
|
declare const noopProgram = "noopb9bkMVfRPU8AsbpTUg8AQkHtKwMYZiFUjNRtMmV";
|
|
2746
2804
|
declare const lightProgram = "SySTEM1eSU2p4BGQfQpimFEWWSC1XDFeun3Nqzz3rT7";
|
|
2747
2805
|
declare const accountCompressionProgram = "compr6CUsB5m2jS4Y3831ztGSTnDpnKJTKS95d64XVq";
|
|
@@ -2755,21 +2813,29 @@ declare const defaultStaticAccountsStruct: () => {
|
|
|
2755
2813
|
accountCompressionAuthority: PublicKey;
|
|
2756
2814
|
cpiSignatureAccount: null;
|
|
2757
2815
|
};
|
|
2816
|
+
type StateTreeLUTPair = {
|
|
2817
|
+
stateTreeLookupTable: PublicKey;
|
|
2818
|
+
nullifyTable: PublicKey;
|
|
2819
|
+
};
|
|
2820
|
+
/**
|
|
2821
|
+
* Returns the Default Public State Tree LUTs for Devnet and Mainnet-Beta.
|
|
2822
|
+
*/
|
|
2758
2823
|
declare const defaultStateTreeLookupTables: () => {
|
|
2759
|
-
mainnet:
|
|
2760
|
-
|
|
2761
|
-
nullifyTable: PublicKey;
|
|
2762
|
-
};
|
|
2763
|
-
devnet: {
|
|
2764
|
-
stateTreeLookupTable: PublicKey;
|
|
2765
|
-
nullifyTable: PublicKey;
|
|
2766
|
-
};
|
|
2824
|
+
mainnet: StateTreeLUTPair[];
|
|
2825
|
+
devnet: StateTreeLUTPair[];
|
|
2767
2826
|
};
|
|
2827
|
+
/**
|
|
2828
|
+
* @internal
|
|
2829
|
+
*/
|
|
2768
2830
|
declare const isLocalTest: (url: string) => boolean;
|
|
2769
|
-
|
|
2770
|
-
|
|
2771
|
-
|
|
2772
|
-
|
|
2831
|
+
/**
|
|
2832
|
+
* @internal
|
|
2833
|
+
*/
|
|
2834
|
+
declare const localTestActiveStateTreeInfo: () => ActiveTreeBundle[];
|
|
2835
|
+
/**
|
|
2836
|
+
* Use only with Localnet testing.
|
|
2837
|
+
* For public networks, fetch via {@link defaultStateTreeLookupTables} and {@link getLightStateTreeInfo}.
|
|
2838
|
+
*/
|
|
2773
2839
|
declare const defaultTestStateTreeAccounts: () => {
|
|
2774
2840
|
nullifierQueue: PublicKey;
|
|
2775
2841
|
merkleTree: PublicKey;
|
|
@@ -2777,20 +2843,25 @@ declare const defaultTestStateTreeAccounts: () => {
|
|
|
2777
2843
|
addressTree: PublicKey;
|
|
2778
2844
|
addressQueue: PublicKey;
|
|
2779
2845
|
};
|
|
2846
|
+
/**
|
|
2847
|
+
* @internal testing only
|
|
2848
|
+
*/
|
|
2780
2849
|
declare const defaultTestStateTreeAccounts2: () => {
|
|
2781
2850
|
nullifierQueue2: PublicKey;
|
|
2782
2851
|
merkleTree2: PublicKey;
|
|
2783
2852
|
};
|
|
2784
|
-
declare const stateTreeLookupTableMainnet = "
|
|
2785
|
-
declare const nullifiedStateTreeLookupTableMainnet = "
|
|
2786
|
-
declare const stateTreeLookupTableDevnet = "
|
|
2787
|
-
declare const nullifiedStateTreeLookupTableDevnet = "
|
|
2853
|
+
declare const stateTreeLookupTableMainnet = "7i86eQs3GSqHjN47WdWLTCGMW6gde1q96G2EVnUyK2st";
|
|
2854
|
+
declare const nullifiedStateTreeLookupTableMainnet = "H9QD4u1fG7KmkAzn2tDXhheushxFe1EcrjGGyEFXeMqT";
|
|
2855
|
+
declare const stateTreeLookupTableDevnet = "8n8rH2bFRVA6cSGNDpgqcKHCndbFCT1bXxAQG89ejVsh";
|
|
2856
|
+
declare const nullifiedStateTreeLookupTableDevnet = "5dhaJLBjnVBQFErr8oiCJmcVsx3Zj6xDekGB2zULPsnP";
|
|
2788
2857
|
declare const nullifierQueuePubkey = "nfq1NvQDJ2GEgnS8zt9prAe8rjjpAW1zFkrvZoBR148";
|
|
2858
|
+
declare const cpiContextPubkey = "cpi1uHzrEhBG733DoEJNgHCyRS3XmmyVNZx5fonubE4";
|
|
2789
2859
|
declare const merkletreePubkey = "smt1NamzXdq4AMqS2fS2F1i5KTYPZRhoHgWx38d8WsT";
|
|
2790
2860
|
declare const addressTree = "amt1Ayt45jfbdw5YSo7iz6WZxUmnZsQTYXy82hVwyC2";
|
|
2791
2861
|
declare const addressQueue = "aq1S9z4reTSQAdgWHGD2zDaS39sjGrAxbR31vxJ2F4F";
|
|
2792
2862
|
declare const merkleTree2Pubkey = "smt2rJAFdyJJupwMKAqTNAJwvjhmiZ4JYGZmbVRw1Ho";
|
|
2793
2863
|
declare const nullifierQueue2Pubkey = "nfq2hgS7NYemXsFaFUCe3EMXSDSfnZnAe27jC6aPP1X";
|
|
2864
|
+
declare const cpiContext2Pubkey = "cpi2cdhkH5roePvcudTgUL8ppEBfTay1desGh8G8QxK";
|
|
2794
2865
|
declare const confirmConfig: ConfirmOptions;
|
|
2795
2866
|
declare const DEFAULT_MERKLE_TREE_HEIGHT = 26;
|
|
2796
2867
|
declare const DEFAULT_MERKLE_TREE_ROOTS = 2800;
|
|
@@ -3921,4 +3992,6 @@ type LightSystemProgram = {
|
|
|
3921
3992
|
};
|
|
3922
3993
|
declare const IDL: LightSystemProgram;
|
|
3923
3994
|
|
|
3924
|
-
|
|
3995
|
+
declare const logger: any;
|
|
3996
|
+
|
|
3997
|
+
export { ADDRESS_QUEUE_ROLLOVER_FEE, ADDRESS_TREE_NETWORK_FEE, ALICE, AccountProofResult, type ActiveTreeBundle, type AddressWithTree, AppendLeavesInputLayout, AppendNullifyCreateAddressInputsMetaLayout, type BN254, BOB, BalanceResult, CHARLIE, COMPUTE_BUDGET_PATTERN, type ClientSubscriptionId, type CompressedAccount, type CompressedAccountData, CompressedAccountLayout, CompressedAccountResult, type CompressedAccountWithMerkleContext, CompressedAccountsByOwnerResult, type CompressedCpiContext, type CompressedMintTokenHolders, CompressedMintTokenHoldersResult, type CompressedProof, type CompressedProofWithContext, CompressedTokenAccountResult, CompressedTokenAccountsByOwnerOrDelegateResult, type CompressedTransaction, CompressedTransactionResult, type CompressionApiInterface, CreateUtxoError, CreateUtxoErrorCode, DAVE, DEFAULT_MERKLE_TREE_HEIGHT, DEFAULT_MERKLE_TREE_ROOTS, DEFAULT_ZERO, type EventWithParsedTokenTlvData, FIELD_SIZE, type GetCompressedAccountConfig, type GetCompressedAccountsByOwnerConfig, type GetCompressedAccountsConfig, type GetCompressedAccountsFilter, type GetCompressedTokenAccountsByOwnerOrDelegateOptions, HIGHEST_ADDRESS_PLUS_ONE, HashError, HashErrorCode, type HashWithTree, HealthResult, type HexBatchInputsForProver, type HexInputsForProver, IDL, INSERT_INTO_QUEUES_DISCRIMINATOR, INVOKE_CPI_DISCRIMINATOR, INVOKE_DISCRIMINATOR, IndexedArray, IndexedElement, IndexedElementBundle, type InputTokenDataWithContext, InsertAddressInputLayout, InsertNullifierInputLayout, type InstructionDataInvoke, type InstructionDataInvokeCpi, InstructionDataInvokeCpiLayout, InstructionDataInvokeLayout, type LatestNonVotingSignatures, type LatestNonVotingSignaturesPaginated, LatestNonVotingSignaturesResult, LatestNonVotingSignaturesResultPaginated, LightSystemProgram$1 as LightSystemProgram, type LightSystemProgram as LightSystemProgramIDL, type LightWasm, LookupTableError, LookupTableErrorCode, MerkeProofResult, type MerkleContext, MerkleContextLayout, type MerkleContextWithMerkleProof, type MerkleContextWithNewAddressProof, MerkleTree, MerkleTreeError, MerkleTreeErrorCode, type MerkleTreeSequenceNumber, MerkleTreeSequenceNumberLayout, MultipleCompressedAccountsResult, MultipleMerkleProofsResult, NativeBalanceResult, type NewAddressParams, NewAddressParamsLayout, type NewAddressParamsPacked, NewAddressProofResult, type NonInclusionJsonStruct, type NonInclusionMerkleProofInputs, type OutputCompressedAccountWithPackedContext, type PackedCompressedAccountWithMerkleContext, type PackedMerkleContext, type PaginatedOptions, type ParsedTokenAccount, ProofError, ProofErrorCode, type PublicTransactionEvent, PublicTransactionEventLayout, type QueueIndex, Rpc, RpcError, RpcErrorCode, type RpcResult, type RpcResultError, type RpcResultSuccess, STATE_MERKLE_TREE_NETWORK_FEE, STATE_MERKLE_TREE_ROLLOVER_FEE, SelectInUtxosError, SelectInUtxosErrorCode, SignatureListResult, SignatureListWithCursorResult, type SignatureWithMetadata, SlotResult, type StateTreeLUTPair, TRANSACTION_MERKLE_TREE_ROLLOVER_THRESHOLD, TestRpc, type TestRpcConfig, type TokenBalance, TokenBalanceListResult, TokenBalanceListResultV2, TokenBalanceResult, type TokenData$1 as TokenData, TokenDataLayout, TokenDataResult, TreeType, UTXO_MERGE_MAXIMUM, UTXO_MERGE_THRESHOLD, UtilsError, UtilsErrorCode, UtxoError, UtxoErrorCode, ValidityProofResult, type WithContext, type WithCursor, type WithRpcContext, accountCompressionProgram, addressQueue, addressTree, airdropSol, bn, bufToDecStr, buildAndSignTx, buildTx, byteArrayToKeypair, calculateComputeUnitPrice, checkValidityProofShape, compress, confirmConfig, confirmTransaction, confirmTx, convertMerkleProofsWithContextToHex, convertNonInclusionMerkleProofInputsToHex, convertToPublicTransactionEvent, cpiContext2Pubkey, cpiContextPubkey, createAccount, createAccountWithLamports, createBN254, createCompressedAccount, createCompressedAccountWithMerkleContext, createMerkleContext, createRpc, createRpcResult, createStateTreeLookupTable, decodeInstructionDataInvoke, decodeInstructionDataInvokeCpi, decodePublicTransactionEvent, decompress, dedupeSigner, deepEqual, defaultStateTreeLookupTables, defaultStaticAccounts, defaultStaticAccountsStruct, defaultTestStateTreeAccounts, defaultTestStateTreeAccounts2, deriveAddress, deriveAddressSeed, deserializeAppendNullifyCreateAddressInputsIndexer, encodeBN254toBase58, encodeInstructionDataInvoke, encodePublicTransactionEvent, extendStateTreeLookupTable, getAccountCompressionAuthority, getCompressedTokenAccountByHashTest, getCompressedTokenAccounts, getCompressedTokenAccountsByDelegateTest, getCompressedTokenAccountsByOwnerTest, getConnection, getIndexOrAdd, getLightStateTreeInfo, getParsedEvents, getPublicInputHash, getQueueForTree, getRegisteredProgramPda, getTestKeypair, getTestRpc, getTreeForQueue, hashToBn254FieldSizeBe, hashvToBn254FieldSizeBe, invokeAccountsLayout, type invokeAccountsLayoutParams, isLocalTest, jsonRpcResult, jsonRpcResultAndContext, lightProgram, localTestActiveStateTreeInfo, logger, merkleTree2Pubkey, merkletreePubkey, negateAndCompressProof, newAccountWithLamports, noopProgram, nullifiedStateTreeLookupTableDevnet, nullifiedStateTreeLookupTableMainnet, nullifierQueue2Pubkey, nullifierQueuePubkey, nullifyLookupTable, packCompressedAccounts, packNewAddressParams, padOutputStateMerkleTrees, parseAccountData, parseEvents, parseLightTransaction, parsePublicTransactionEventWithIdl, parseTokenLayoutWithIdl, pickRandomTreeAndQueue, pipe, placeholderValidityProof, proofFromJsonStruct, proverRequest, pushUniqueItems, rpcRequest, selectMinCompressedSolAccountsForTransfer, sendAndConfirmTx, sleep, stateTreeLookupTableDevnet, stateTreeLookupTableMainnet, sumUpLamports, toAccountMetas, toArray, toCamelCase, toHex, toUnixTimestamp, transfer, validateSameOwner, validateSufficientBalance };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lightprotocol/stateless.js",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.20.1",
|
|
4
4
|
"description": "JavaScript API for Light & ZK Compression",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "dist/cjs/node/index.cjs",
|
|
@@ -45,10 +45,12 @@
|
|
|
45
45
|
"buffer": "6.0.3",
|
|
46
46
|
"buffer-layout": "^1.2.2",
|
|
47
47
|
"camelcase": "^8.0.0",
|
|
48
|
+
"json-bigint": "^1.0.0",
|
|
48
49
|
"superstruct": "2.0.2"
|
|
49
50
|
},
|
|
50
51
|
"devDependencies": {
|
|
51
52
|
"@coral-xyz/anchor": "0.29.0",
|
|
53
|
+
"@coral-xyz/borsh": "^0.29.0",
|
|
52
54
|
"@esbuild-plugins/node-globals-polyfill": "^0.2.3",
|
|
53
55
|
"@lightprotocol/hasher.rs": "0.2.1",
|
|
54
56
|
"@playwright/test": "^1.47.1",
|
|
@@ -80,6 +82,7 @@
|
|
|
80
82
|
"tweetnacl": "1.0.3",
|
|
81
83
|
"typescript": "^5.6.2",
|
|
82
84
|
"vitest": "^2.1.1",
|
|
85
|
+
"winston": "^3.17.0",
|
|
83
86
|
"@lightprotocol/programs": "0.3.0"
|
|
84
87
|
},
|
|
85
88
|
"nx": {
|
|
@@ -97,6 +100,7 @@
|
|
|
97
100
|
"test": "pnpm test:unit:all && pnpm test:e2e:all",
|
|
98
101
|
"test-all": "vitest run",
|
|
99
102
|
"test:unit:all": "vitest run tests/unit --reporter=verbose",
|
|
103
|
+
"test:conversions": "vitest run tests/unit/utils/conversion.test.ts --reporter=verbose",
|
|
100
104
|
"test-validator": "./../../cli/test_bin/run test-validator --prover-run-mode rpc",
|
|
101
105
|
"test:e2e:transfer": "pnpm test-validator && vitest run tests/e2e/transfer.test.ts --reporter=verbose",
|
|
102
106
|
"test:e2e:compress": "pnpm test-validator && vitest run tests/e2e/compress.test.ts --reporter=verbose",
|
|
@@ -104,9 +108,10 @@
|
|
|
104
108
|
"test:e2e:rpc-interop": "pnpm test-validator && vitest run tests/e2e/rpc-interop.test.ts",
|
|
105
109
|
"test:e2e:rpc-multi-trees": "pnpm test-validator && vitest run tests/e2e/rpc-multi-trees.test.ts",
|
|
106
110
|
"test:e2e:browser": "pnpm playwright test",
|
|
107
|
-
"test:e2e:all": "pnpm test-validator && vitest run tests/e2e/test-rpc.test.ts && vitest run tests/e2e/compress.test.ts && vitest run tests/e2e/transfer.test.ts && vitest run tests/e2e/rpc-interop.test.ts && vitest run tests/e2e/rpc-multi-trees.test.ts && vitest run tests/e2e/layout.test.ts",
|
|
111
|
+
"test:e2e:all": "pnpm test-validator && vitest run tests/e2e/test-rpc.test.ts && vitest run tests/e2e/compress.test.ts && vitest run tests/e2e/transfer.test.ts && vitest run tests/e2e/rpc-interop.test.ts && vitest run tests/e2e/rpc-multi-trees.test.ts && vitest run tests/e2e/layout.test.ts && vitest run tests/e2e/safe-conversion.test.ts",
|
|
108
112
|
"test:index": "vitest run tests/e2e/program.test.ts",
|
|
109
113
|
"test:e2e:layout": "vitest run tests/e2e/layout.test.ts --reporter=verbose",
|
|
114
|
+
"test:e2e:safe-conversion": "vitest run tests/e2e/safe-conversion.test.ts --reporter=verbose",
|
|
110
115
|
"test:verbose": "vitest run --reporter=verbose",
|
|
111
116
|
"test:testnet": "vitest run tests/e2e/testnet.test.ts --reporter=verbose",
|
|
112
117
|
"pull-idls": "../../scripts/push-stateless-js-idls.sh && ../../scripts/push-compressed-token-idl.sh",
|