@lightprotocol/stateless.js 0.20.8 → 0.21.0
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/dist/cjs/browser/actions/compress.d.ts +9 -7
- package/dist/cjs/browser/actions/create-account.d.ts +25 -28
- package/dist/cjs/browser/actions/decompress.d.ts +6 -7
- package/dist/cjs/browser/actions/index.d.ts +1 -1
- package/dist/cjs/browser/actions/transfer.d.ts +8 -11
- package/dist/cjs/browser/constants.d.ts +16 -6
- package/dist/cjs/browser/index.cjs +1 -1
- package/dist/cjs/browser/index.cjs.map +1 -1
- package/dist/cjs/browser/index.d.ts +2 -2
- package/dist/cjs/browser/instruction/pack-compressed-accounts.d.ts +6 -24
- package/dist/cjs/browser/programs/layout.d.ts +27 -0
- package/dist/cjs/browser/programs/system.d.ts +18 -27
- package/dist/cjs/browser/rpc-interface.d.ts +115 -50
- package/dist/cjs/browser/rpc.d.ts +21 -41
- package/dist/cjs/browser/state/BN254.d.ts +0 -1
- package/dist/cjs/browser/state/bn.d.ts +3 -0
- package/dist/cjs/browser/state/compressed-account.d.ts +53 -13
- package/dist/cjs/browser/state/index.d.ts +1 -0
- package/dist/cjs/browser/state/types.d.ts +87 -12
- package/dist/cjs/browser/test-helpers/test-rpc/get-compressed-accounts.d.ts +10 -1
- package/dist/cjs/browser/test-helpers/test-rpc/get-compressed-token-accounts.d.ts +1 -1
- package/dist/cjs/browser/test-helpers/test-rpc/test-rpc.d.ts +15 -19
- package/dist/cjs/browser/utils/get-state-tree-infos.d.ts +41 -0
- package/dist/cjs/browser/utils/index.d.ts +5 -2
- package/dist/cjs/browser/utils/parse-validity-proof.d.ts +3 -3
- package/dist/cjs/browser/utils/state-tree-lookup-table.d.ts +68 -0
- package/dist/cjs/node/actions/compress.d.ts +9 -7
- package/dist/cjs/node/actions/create-account.d.ts +25 -28
- package/dist/cjs/node/actions/decompress.d.ts +6 -7
- package/dist/cjs/node/actions/index.d.ts +1 -1
- package/dist/cjs/node/actions/transfer.d.ts +8 -11
- package/dist/cjs/node/constants.d.ts +16 -6
- package/dist/cjs/node/index.cjs +1 -1
- package/dist/cjs/node/index.cjs.map +1 -1
- package/dist/cjs/node/index.d.ts +2 -2
- package/dist/cjs/node/instruction/pack-compressed-accounts.d.ts +6 -24
- package/dist/cjs/node/programs/layout.d.ts +27 -0
- package/dist/cjs/node/programs/system.d.ts +18 -27
- package/dist/cjs/node/rpc-interface.d.ts +115 -50
- package/dist/cjs/node/rpc.d.ts +21 -41
- package/dist/cjs/node/state/BN254.d.ts +0 -1
- package/dist/cjs/node/state/bn.d.ts +3 -0
- package/dist/cjs/node/state/compressed-account.d.ts +53 -13
- package/dist/cjs/node/state/index.d.ts +1 -0
- package/dist/cjs/node/state/types.d.ts +87 -12
- package/dist/cjs/node/test-helpers/test-rpc/get-compressed-accounts.d.ts +10 -1
- package/dist/cjs/node/test-helpers/test-rpc/get-compressed-token-accounts.d.ts +1 -1
- package/dist/cjs/node/test-helpers/test-rpc/test-rpc.d.ts +15 -19
- package/dist/cjs/node/utils/get-state-tree-infos.d.ts +41 -0
- package/dist/cjs/node/utils/index.d.ts +5 -2
- package/dist/cjs/node/utils/parse-validity-proof.d.ts +3 -3
- package/dist/cjs/node/utils/state-tree-lookup-table.d.ts +68 -0
- package/dist/types/index.d.ts +596 -405
- package/package.json +4 -3
- package/dist/cjs/browser/utils/get-light-state-tree-info.d.ts +0 -76
- package/dist/cjs/node/utils/get-light-state-tree-info.d.ts +0 -76
- /package/dist/cjs/browser/{actions/common.d.ts → utils/dedupe-signer.d.ts} +0 -0
- /package/dist/cjs/node/{actions/common.d.ts → utils/dedupe-signer.d.ts} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lightprotocol/stateless.js",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.21.0",
|
|
4
4
|
"description": "JavaScript API for Light & ZK Compression",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "dist/cjs/node/index.cjs",
|
|
@@ -99,12 +99,13 @@
|
|
|
99
99
|
"test": "pnpm test:unit:all && pnpm test:e2e:all",
|
|
100
100
|
"test-all": "vitest run",
|
|
101
101
|
"test:unit:all": "vitest run tests/unit --reporter=verbose",
|
|
102
|
+
"test:unit:tree-info": "vitest run tests/unit/utils/tree-info.test.ts --reporter=verbose",
|
|
102
103
|
"test:conversions": "vitest run tests/unit/utils/conversion.test.ts --reporter=verbose",
|
|
103
104
|
"test-validator": "./../../cli/test_bin/run test-validator --prover-run-mode rpc",
|
|
104
105
|
"test:e2e:transfer": "pnpm test-validator && vitest run tests/e2e/transfer.test.ts --reporter=verbose",
|
|
105
106
|
"test:e2e:compress": "pnpm test-validator && vitest run tests/e2e/compress.test.ts --reporter=verbose",
|
|
106
|
-
"test:e2e:test-rpc": "pnpm test-validator && vitest run tests/e2e/test-rpc.test.ts",
|
|
107
|
-
"test:e2e:rpc-interop": "pnpm test-validator && vitest run tests/e2e/rpc-interop.test.ts",
|
|
107
|
+
"test:e2e:test-rpc": "pnpm test-validator && vitest run tests/e2e/test-rpc.test.ts --reporter=verbose --bail=1",
|
|
108
|
+
"test:e2e:rpc-interop": "pnpm test-validator && vitest run tests/e2e/rpc-interop.test.ts --reporter=verbose --bail=1",
|
|
108
109
|
"test:e2e:rpc-multi-trees": "pnpm test-validator && vitest run tests/e2e/rpc-multi-trees.test.ts",
|
|
109
110
|
"test:e2e:browser": "pnpm playwright test",
|
|
110
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",
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import { Connection, Keypair, PublicKey } from '@solana/web3.js';
|
|
2
|
-
import { ActiveTreeBundle } from '../state/types';
|
|
3
|
-
/**
|
|
4
|
-
* Create two lookup tables storing all public state tree and queue addresses
|
|
5
|
-
* returns lookup table addresses and txId
|
|
6
|
-
*
|
|
7
|
-
* @internal
|
|
8
|
-
* @param connection - Connection to the Solana network
|
|
9
|
-
* @param payer - Keypair of the payer
|
|
10
|
-
* @param authority - Keypair of the authority
|
|
11
|
-
* @param recentSlot - Slot of the recent block
|
|
12
|
-
*/
|
|
13
|
-
export declare function createStateTreeLookupTable({ connection, payer, authority, recentSlot, }: {
|
|
14
|
-
connection: Connection;
|
|
15
|
-
payer: Keypair;
|
|
16
|
-
authority: Keypair;
|
|
17
|
-
recentSlot: number;
|
|
18
|
-
}): Promise<{
|
|
19
|
-
address: PublicKey;
|
|
20
|
-
txId: string;
|
|
21
|
-
}>;
|
|
22
|
-
/**
|
|
23
|
-
* Extend state tree lookup table with new state tree and queue addresses
|
|
24
|
-
* @internal
|
|
25
|
-
* @param connection - Connection to the Solana network
|
|
26
|
-
* @param tableAddress - Address of the lookup table to extend
|
|
27
|
-
* @param newStateTreeAddresses - Addresses of the new state trees to add
|
|
28
|
-
* @param newQueueAddresses - Addresses of the new queues to add
|
|
29
|
-
* @param newCpiContextAddresses - Addresses of the new cpi contexts to add
|
|
30
|
-
* @param payer - Keypair of the payer
|
|
31
|
-
* @param authority - Keypair of the authority
|
|
32
|
-
*/
|
|
33
|
-
export declare function extendStateTreeLookupTable({ connection, tableAddress, newStateTreeAddresses, newQueueAddresses, newCpiContextAddresses, payer, authority, }: {
|
|
34
|
-
connection: Connection;
|
|
35
|
-
tableAddress: PublicKey;
|
|
36
|
-
newStateTreeAddresses: PublicKey[];
|
|
37
|
-
newQueueAddresses: PublicKey[];
|
|
38
|
-
newCpiContextAddresses: PublicKey[];
|
|
39
|
-
payer: Keypair;
|
|
40
|
-
authority: Keypair;
|
|
41
|
-
}): Promise<{
|
|
42
|
-
tableAddress: PublicKey;
|
|
43
|
-
txId: string;
|
|
44
|
-
}>;
|
|
45
|
-
/**
|
|
46
|
-
* Adds state tree address to lookup table. Acts as nullifier lookup for rolled
|
|
47
|
-
* over state trees.
|
|
48
|
-
* @internal
|
|
49
|
-
* @param connection - Connection to the Solana network
|
|
50
|
-
* @param stateTreeAddress - Address of the state tree to nullify
|
|
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
|
|
55
|
-
* @param payer - Keypair of the payer
|
|
56
|
-
* @param authority - Keypair of the authority
|
|
57
|
-
*/
|
|
58
|
-
export declare function nullifyLookupTable({ connection, fullStateTreeAddress, nullifyTableAddress, stateTreeLookupTableAddress, payer, authority, }: {
|
|
59
|
-
connection: Connection;
|
|
60
|
-
fullStateTreeAddress: PublicKey;
|
|
61
|
-
nullifyTableAddress: PublicKey;
|
|
62
|
-
stateTreeLookupTableAddress: PublicKey;
|
|
63
|
-
payer: Keypair;
|
|
64
|
-
authority: Keypair;
|
|
65
|
-
}): Promise<{
|
|
66
|
-
txId: string;
|
|
67
|
-
}>;
|
|
68
|
-
/**
|
|
69
|
-
* Get most recent , active state tree data
|
|
70
|
-
* we store in lookup table for each public state tree
|
|
71
|
-
*/
|
|
72
|
-
export declare function getLightStateTreeInfo({ connection, stateTreeLookupTableAddress, nullifyTableAddress, }: {
|
|
73
|
-
connection: Connection;
|
|
74
|
-
stateTreeLookupTableAddress: PublicKey;
|
|
75
|
-
nullifyTableAddress: PublicKey;
|
|
76
|
-
}): Promise<ActiveTreeBundle[]>;
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import { Connection, Keypair, PublicKey } from '@solana/web3.js';
|
|
2
|
-
import { ActiveTreeBundle } from '../state/types';
|
|
3
|
-
/**
|
|
4
|
-
* Create two lookup tables storing all public state tree and queue addresses
|
|
5
|
-
* returns lookup table addresses and txId
|
|
6
|
-
*
|
|
7
|
-
* @internal
|
|
8
|
-
* @param connection - Connection to the Solana network
|
|
9
|
-
* @param payer - Keypair of the payer
|
|
10
|
-
* @param authority - Keypair of the authority
|
|
11
|
-
* @param recentSlot - Slot of the recent block
|
|
12
|
-
*/
|
|
13
|
-
export declare function createStateTreeLookupTable({ connection, payer, authority, recentSlot, }: {
|
|
14
|
-
connection: Connection;
|
|
15
|
-
payer: Keypair;
|
|
16
|
-
authority: Keypair;
|
|
17
|
-
recentSlot: number;
|
|
18
|
-
}): Promise<{
|
|
19
|
-
address: PublicKey;
|
|
20
|
-
txId: string;
|
|
21
|
-
}>;
|
|
22
|
-
/**
|
|
23
|
-
* Extend state tree lookup table with new state tree and queue addresses
|
|
24
|
-
* @internal
|
|
25
|
-
* @param connection - Connection to the Solana network
|
|
26
|
-
* @param tableAddress - Address of the lookup table to extend
|
|
27
|
-
* @param newStateTreeAddresses - Addresses of the new state trees to add
|
|
28
|
-
* @param newQueueAddresses - Addresses of the new queues to add
|
|
29
|
-
* @param newCpiContextAddresses - Addresses of the new cpi contexts to add
|
|
30
|
-
* @param payer - Keypair of the payer
|
|
31
|
-
* @param authority - Keypair of the authority
|
|
32
|
-
*/
|
|
33
|
-
export declare function extendStateTreeLookupTable({ connection, tableAddress, newStateTreeAddresses, newQueueAddresses, newCpiContextAddresses, payer, authority, }: {
|
|
34
|
-
connection: Connection;
|
|
35
|
-
tableAddress: PublicKey;
|
|
36
|
-
newStateTreeAddresses: PublicKey[];
|
|
37
|
-
newQueueAddresses: PublicKey[];
|
|
38
|
-
newCpiContextAddresses: PublicKey[];
|
|
39
|
-
payer: Keypair;
|
|
40
|
-
authority: Keypair;
|
|
41
|
-
}): Promise<{
|
|
42
|
-
tableAddress: PublicKey;
|
|
43
|
-
txId: string;
|
|
44
|
-
}>;
|
|
45
|
-
/**
|
|
46
|
-
* Adds state tree address to lookup table. Acts as nullifier lookup for rolled
|
|
47
|
-
* over state trees.
|
|
48
|
-
* @internal
|
|
49
|
-
* @param connection - Connection to the Solana network
|
|
50
|
-
* @param stateTreeAddress - Address of the state tree to nullify
|
|
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
|
|
55
|
-
* @param payer - Keypair of the payer
|
|
56
|
-
* @param authority - Keypair of the authority
|
|
57
|
-
*/
|
|
58
|
-
export declare function nullifyLookupTable({ connection, fullStateTreeAddress, nullifyTableAddress, stateTreeLookupTableAddress, payer, authority, }: {
|
|
59
|
-
connection: Connection;
|
|
60
|
-
fullStateTreeAddress: PublicKey;
|
|
61
|
-
nullifyTableAddress: PublicKey;
|
|
62
|
-
stateTreeLookupTableAddress: PublicKey;
|
|
63
|
-
payer: Keypair;
|
|
64
|
-
authority: Keypair;
|
|
65
|
-
}): Promise<{
|
|
66
|
-
txId: string;
|
|
67
|
-
}>;
|
|
68
|
-
/**
|
|
69
|
-
* Get most recent , active state tree data
|
|
70
|
-
* we store in lookup table for each public state tree
|
|
71
|
-
*/
|
|
72
|
-
export declare function getLightStateTreeInfo({ connection, stateTreeLookupTableAddress, nullifyTableAddress, }: {
|
|
73
|
-
connection: Connection;
|
|
74
|
-
stateTreeLookupTableAddress: PublicKey;
|
|
75
|
-
nullifyTableAddress: PublicKey;
|
|
76
|
-
}): Promise<ActiveTreeBundle[]>;
|
|
File without changes
|
|
File without changes
|