@lightprotocol/stateless.js 0.20.9 → 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 +15 -17
- 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 +92 -27
- 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 +15 -17
- 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 +92 -27
- 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 +565 -358
- 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
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import { ConfirmOptions, PublicKey, Signer, TransactionSignature } from '@solana/web3.js';
|
|
2
2
|
import { Rpc } from '../rpc';
|
|
3
3
|
import BN from 'bn.js';
|
|
4
|
+
import { StateTreeInfo } from '../state';
|
|
4
5
|
/**
|
|
5
6
|
* Compress lamports to a solana address
|
|
6
7
|
*
|
|
7
|
-
* @param rpc
|
|
8
|
-
* @param payer
|
|
9
|
-
* @param lamports
|
|
10
|
-
* @param toAddress
|
|
11
|
-
* @param
|
|
12
|
-
*
|
|
8
|
+
* @param rpc RPC to use
|
|
9
|
+
* @param payer Payer of the transaction and initialization fees
|
|
10
|
+
* @param lamports Amount of lamports to compress
|
|
11
|
+
* @param toAddress Address of the recipient compressed account
|
|
12
|
+
* @param outputStateTreeInfo Optional output state tree. If not provided,
|
|
13
|
+
* fetches a random active state tree.
|
|
14
|
+
* @param confirmOptions Options for confirming the transaction
|
|
13
15
|
*
|
|
14
16
|
* @return Transaction signature
|
|
15
17
|
*/
|
|
16
|
-
export declare function compress(rpc: Rpc, payer: Signer, lamports: number | BN, toAddress: PublicKey,
|
|
18
|
+
export declare function compress(rpc: Rpc, payer: Signer, lamports: number | BN, toAddress: PublicKey, outputStateTreeInfo?: StateTreeInfo, confirmOptions?: ConfirmOptions): Promise<TransactionSignature>;
|
|
@@ -1,41 +1,38 @@
|
|
|
1
1
|
import { ConfirmOptions, PublicKey, Signer, TransactionSignature } from '@solana/web3.js';
|
|
2
2
|
import { Rpc } from '../rpc';
|
|
3
|
+
import { AddressTreeInfo, StateTreeInfo } from '../state';
|
|
3
4
|
import BN from 'bn.js';
|
|
4
5
|
/**
|
|
5
6
|
* Create compressed account with address
|
|
6
7
|
*
|
|
7
|
-
* @param rpc
|
|
8
|
-
* @param payer
|
|
9
|
-
* @param seeds
|
|
10
|
-
* @param programId
|
|
11
|
-
* @param
|
|
12
|
-
*
|
|
13
|
-
* @param
|
|
14
|
-
*
|
|
15
|
-
* @param
|
|
16
|
-
* shared state tree.
|
|
17
|
-
* @param confirmOptions Options for confirming the transaction
|
|
8
|
+
* @param rpc RPC to use
|
|
9
|
+
* @param payer Payer of the transaction and initialization fees
|
|
10
|
+
* @param seeds Seeds to derive the new account address
|
|
11
|
+
* @param programId Owner of the new account
|
|
12
|
+
* @param addressTreeInfo Optional address tree info. Defaults to a current
|
|
13
|
+
* shared address tree.
|
|
14
|
+
* @param outputStateTreeInfo Optional output state tree. Defaults to fetching
|
|
15
|
+
* a current shared state tree.
|
|
16
|
+
* @param confirmOptions Options for confirming the transaction
|
|
18
17
|
*
|
|
19
|
-
* @return
|
|
18
|
+
* @return Transaction signature
|
|
20
19
|
*/
|
|
21
|
-
export declare function createAccount(rpc: Rpc, payer: Signer, seeds: Uint8Array[], programId: PublicKey,
|
|
20
|
+
export declare function createAccount(rpc: Rpc, payer: Signer, seeds: Uint8Array[], programId: PublicKey, addressTreeInfo?: AddressTreeInfo, outputStateTreeInfo?: StateTreeInfo, confirmOptions?: ConfirmOptions): Promise<TransactionSignature>;
|
|
22
21
|
/**
|
|
23
22
|
* Create compressed account with address and lamports
|
|
24
23
|
*
|
|
25
|
-
* @param rpc
|
|
26
|
-
* @param payer
|
|
27
|
-
* @param seeds
|
|
28
|
-
* @param lamports
|
|
29
|
-
*
|
|
30
|
-
* @param programId
|
|
31
|
-
* @param
|
|
32
|
-
*
|
|
33
|
-
* @param
|
|
34
|
-
*
|
|
35
|
-
* @param
|
|
36
|
-
* shared state tree.
|
|
37
|
-
* @param confirmOptions Options for confirming the transaction
|
|
24
|
+
* @param rpc RPC to use
|
|
25
|
+
* @param payer Payer of the transaction and initialization fees
|
|
26
|
+
* @param seeds Seeds to derive the new account address
|
|
27
|
+
* @param lamports Number of compressed lamports to initialize the
|
|
28
|
+
* account with
|
|
29
|
+
* @param programId Owner of the new account
|
|
30
|
+
* @param addressTreeInfo Optional address tree info. Defaults to a
|
|
31
|
+
* current shared address tree.
|
|
32
|
+
* @param outputStateTreeInfo Optional output state tree. Defaults to a
|
|
33
|
+
* current shared state tree.
|
|
34
|
+
* @param confirmOptions Options for confirming the transaction
|
|
38
35
|
*
|
|
39
|
-
* @return
|
|
36
|
+
* @return Transaction signature
|
|
40
37
|
*/
|
|
41
|
-
export declare function createAccountWithLamports(rpc: Rpc, payer: Signer, seeds: Uint8Array[], lamports: number | BN, programId: PublicKey,
|
|
38
|
+
export declare function createAccountWithLamports(rpc: Rpc, payer: Signer, seeds: Uint8Array[], lamports: number | BN, programId: PublicKey, addressTreeInfo?: AddressTreeInfo, outputStateTreeInfo?: StateTreeInfo, confirmOptions?: ConfirmOptions): Promise<TransactionSignature>;
|
|
@@ -4,13 +4,12 @@ import BN from 'bn.js';
|
|
|
4
4
|
/**
|
|
5
5
|
* Decompress lamports into a solana account
|
|
6
6
|
*
|
|
7
|
-
* @param rpc
|
|
8
|
-
* @param payer
|
|
9
|
-
* @param lamports
|
|
10
|
-
* @param toAddress
|
|
11
|
-
* @param
|
|
12
|
-
* @param confirmOptions Options for confirming the transaction
|
|
7
|
+
* @param rpc RPC to use
|
|
8
|
+
* @param payer Payer of the transaction and initialization fees
|
|
9
|
+
* @param lamports Amount of lamports to compress
|
|
10
|
+
* @param toAddress Address of the recipient compressed account
|
|
11
|
+
* @param confirmOptions Options for confirming the transaction
|
|
13
12
|
*
|
|
14
13
|
* @return Transaction signature
|
|
15
14
|
*/
|
|
16
|
-
export declare function decompress(rpc: Rpc, payer: Signer, lamports: number | BN, recipient: PublicKey,
|
|
15
|
+
export declare function decompress(rpc: Rpc, payer: Signer, lamports: number | BN, recipient: PublicKey, confirmOptions?: ConfirmOptions): Promise<TransactionSignature>;
|
|
@@ -1,20 +1,17 @@
|
|
|
1
1
|
import { ConfirmOptions, PublicKey, Signer, TransactionSignature } from '@solana/web3.js';
|
|
2
2
|
import BN from 'bn.js';
|
|
3
3
|
import { Rpc } from '../rpc';
|
|
4
|
+
import { StateTreeInfo } from '../state';
|
|
4
5
|
/**
|
|
5
6
|
* Transfer compressed lamports from one owner to another
|
|
6
7
|
*
|
|
7
|
-
* @param rpc
|
|
8
|
-
* @param payer
|
|
9
|
-
* @param lamports
|
|
10
|
-
* @param owner
|
|
11
|
-
* @param toAddress
|
|
12
|
-
* @param
|
|
13
|
-
* inserted into. Defaults to the default state tree account.
|
|
14
|
-
* @param confirmOptions Options for confirming the transaction
|
|
15
|
-
* @param config Configuration for fetching compressed accounts
|
|
16
|
-
*
|
|
8
|
+
* @param rpc Rpc to use
|
|
9
|
+
* @param payer Payer of transaction fees
|
|
10
|
+
* @param lamports Number of lamports to transfer
|
|
11
|
+
* @param owner Owner of the compressed lamports
|
|
12
|
+
* @param toAddress Destination address of the recipient
|
|
13
|
+
* @param confirmOptions Options for confirming the transaction
|
|
17
14
|
*
|
|
18
15
|
* @return Signature of the confirmed transaction
|
|
19
16
|
*/
|
|
20
|
-
export declare function transfer(rpc: Rpc, payer: Signer, lamports: number | BN, owner: Signer, toAddress: PublicKey,
|
|
17
|
+
export declare function transfer(rpc: Rpc, payer: Signer, lamports: number | BN, owner: Signer, toAddress: PublicKey, outputStateTreeInfo?: StateTreeInfo, confirmOptions?: ConfirmOptions): Promise<TransactionSignature>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import BN from 'bn.js';
|
|
2
2
|
import { Buffer } from 'buffer';
|
|
3
3
|
import { ConfirmOptions, PublicKey } from '@solana/web3.js';
|
|
4
|
-
import {
|
|
4
|
+
import { StateTreeInfo, TreeType } from './state/types';
|
|
5
5
|
export declare const FIELD_SIZE: BN;
|
|
6
6
|
export declare const HIGHEST_ADDRESS_PLUS_ONE: BN;
|
|
7
7
|
export declare const COMPUTE_BUDGET_PATTERN: number[];
|
|
@@ -23,7 +23,7 @@ export declare const defaultStaticAccountsStruct: () => {
|
|
|
23
23
|
};
|
|
24
24
|
export type StateTreeLUTPair = {
|
|
25
25
|
stateTreeLookupTable: PublicKey;
|
|
26
|
-
|
|
26
|
+
nullifyLookupTable: PublicKey;
|
|
27
27
|
};
|
|
28
28
|
/**
|
|
29
29
|
* Returns the Default Public State Tree LUTs for Devnet and Mainnet-Beta.
|
|
@@ -39,10 +39,19 @@ export declare const isLocalTest: (url: string) => boolean;
|
|
|
39
39
|
/**
|
|
40
40
|
* @internal
|
|
41
41
|
*/
|
|
42
|
-
export declare const localTestActiveStateTreeInfo: () =>
|
|
42
|
+
export declare const localTestActiveStateTreeInfo: () => StateTreeInfo[];
|
|
43
|
+
export declare const getDefaultAddressTreeInfo: () => {
|
|
44
|
+
tree: PublicKey;
|
|
45
|
+
queue: PublicKey;
|
|
46
|
+
cpiContext: null;
|
|
47
|
+
treeType: TreeType;
|
|
48
|
+
nextTreeInfo: null;
|
|
49
|
+
};
|
|
43
50
|
/**
|
|
51
|
+
* @deprecated use {@link rpc.getStateTreeInfos} and {@link selectStateTreeInfo} instead.
|
|
52
|
+
* for address trees, use {@link getDefaultAddressTreeInfo} instead.
|
|
44
53
|
* Use only with Localnet testing.
|
|
45
|
-
* For public networks, fetch via {@link defaultStateTreeLookupTables} and {@link
|
|
54
|
+
* For public networks, fetch via {@link defaultStateTreeLookupTables} and {@link getAllStateTreeInfos}.
|
|
46
55
|
*/
|
|
47
56
|
export declare const defaultTestStateTreeAccounts: () => {
|
|
48
57
|
nullifierQueue: PublicKey;
|
|
@@ -58,10 +67,11 @@ export declare const defaultTestStateTreeAccounts2: () => {
|
|
|
58
67
|
nullifierQueue2: PublicKey;
|
|
59
68
|
merkleTree2: PublicKey;
|
|
60
69
|
};
|
|
70
|
+
export declare const COMPRESSED_TOKEN_PROGRAM_ID: PublicKey;
|
|
61
71
|
export declare const stateTreeLookupTableMainnet = "7i86eQs3GSqHjN47WdWLTCGMW6gde1q96G2EVnUyK2st";
|
|
62
72
|
export declare const nullifiedStateTreeLookupTableMainnet = "H9QD4u1fG7KmkAzn2tDXhheushxFe1EcrjGGyEFXeMqT";
|
|
63
|
-
export declare const stateTreeLookupTableDevnet = "
|
|
64
|
-
export declare const nullifiedStateTreeLookupTableDevnet = "
|
|
73
|
+
export declare const stateTreeLookupTableDevnet = "Dk9mNkbiZXJZ4By8DfSP6HEE4ojZzRvucwpawLeuwq8q";
|
|
74
|
+
export declare const nullifiedStateTreeLookupTableDevnet = "AXbHzp1NgjLvpfnD6JRTTovXZ7APUCdtWZFCRr5tCxse";
|
|
65
75
|
export declare const nullifierQueuePubkey = "nfq1NvQDJ2GEgnS8zt9prAe8rjjpAW1zFkrvZoBR148";
|
|
66
76
|
export declare const cpiContextPubkey = "cpi1uHzrEhBG733DoEJNgHCyRS3XmmyVNZx5fonubE4";
|
|
67
77
|
export declare const merkletreePubkey = "smt1NamzXdq4AMqS2fS2F1i5KTYPZRhoHgWx38d8WsT";
|