@lightprotocol/stateless.js 0.20.9 → 0.22.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 +7 -11
- package/dist/cjs/browser/constants.d.ts +40 -7
- 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 -3
- package/dist/cjs/browser/programs/index.d.ts +0 -1
- package/dist/cjs/{node → browser/programs/system}/idl.d.ts +5 -27
- package/dist/cjs/browser/programs/system/index.d.ts +5 -0
- package/dist/cjs/browser/programs/{layout.d.ts → system/layout.d.ts} +37 -1
- package/dist/cjs/browser/programs/system/pack.d.ts +74 -0
- package/dist/cjs/browser/programs/{system.d.ts → system/program.d.ts} +25 -49
- package/dist/cjs/browser/programs/system/select-compressed-accounts.d.ts +10 -0
- package/dist/cjs/browser/rpc-interface.d.ts +1689 -82
- package/dist/cjs/browser/rpc.d.ts +27 -67
- 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 +189 -15
- package/dist/cjs/browser/state/index.d.ts +1 -0
- package/dist/cjs/browser/state/types.d.ts +345 -31
- package/dist/cjs/browser/test-helpers/test-rpc/get-compressed-token-accounts.d.ts +3 -3
- package/dist/cjs/browser/test-helpers/test-rpc/test-rpc.d.ts +21 -49
- package/dist/cjs/browser/utils/calculate-compute-unit-price.d.ts +1 -1
- package/dist/cjs/browser/utils/conversion.d.ts +2 -0
- package/dist/cjs/browser/utils/get-state-tree-infos.d.ts +48 -0
- package/dist/cjs/browser/utils/index.d.ts +4 -2
- package/dist/cjs/browser/utils/parse-validity-proof.d.ts +3 -3
- package/dist/cjs/browser/utils/send-and-confirm.d.ts +1 -1
- package/dist/cjs/browser/utils/state-tree-lookup-table.d.ts +68 -0
- package/dist/cjs/browser/utils/validation.d.ts +2 -2
- 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 +7 -11
- package/dist/cjs/node/constants.d.ts +40 -7
- 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 -3
- package/dist/cjs/node/programs/index.d.ts +0 -1
- package/dist/cjs/{browser → node/programs/system}/idl.d.ts +5 -27
- package/dist/cjs/node/programs/system/index.d.ts +5 -0
- package/dist/cjs/node/programs/{layout.d.ts → system/layout.d.ts} +37 -1
- package/dist/cjs/node/programs/system/pack.d.ts +74 -0
- package/dist/cjs/node/programs/{system.d.ts → system/program.d.ts} +25 -49
- package/dist/cjs/node/programs/system/select-compressed-accounts.d.ts +10 -0
- package/dist/cjs/node/rpc-interface.d.ts +1689 -82
- package/dist/cjs/node/rpc.d.ts +27 -67
- 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 +189 -15
- package/dist/cjs/node/state/index.d.ts +1 -0
- package/dist/cjs/node/state/types.d.ts +345 -31
- package/dist/cjs/node/test-helpers/test-rpc/get-compressed-token-accounts.d.ts +3 -3
- package/dist/cjs/node/test-helpers/test-rpc/test-rpc.d.ts +21 -49
- package/dist/cjs/node/utils/calculate-compute-unit-price.d.ts +1 -1
- package/dist/cjs/node/utils/conversion.d.ts +2 -0
- package/dist/cjs/node/utils/get-state-tree-infos.d.ts +48 -0
- package/dist/cjs/node/utils/index.d.ts +4 -2
- package/dist/cjs/node/utils/parse-validity-proof.d.ts +3 -3
- package/dist/cjs/node/utils/send-and-confirm.d.ts +1 -1
- package/dist/cjs/node/utils/state-tree-lookup-table.d.ts +68 -0
- package/dist/cjs/node/utils/validation.d.ts +2 -2
- package/dist/types/index.d.ts +3177 -1063
- package/package.json +16 -8
- package/dist/cjs/browser/instruction/index.d.ts +0 -1
- package/dist/cjs/browser/instruction/pack-compressed-accounts.d.ts +0 -51
- package/dist/cjs/browser/utils/get-light-state-tree-info.d.ts +0 -76
- package/dist/cjs/node/instruction/index.d.ts +0 -1
- package/dist/cjs/node/instruction/pack-compressed-accounts.d.ts +0 -51
- 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
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { Connection, PublicKey } from '@solana/web3.js';
|
|
2
|
+
import { TreeInfo, TreeType } from '../state/types';
|
|
3
|
+
import { StateTreeLUTPair } from '../constants';
|
|
4
|
+
/**
|
|
5
|
+
* @deprecated use {@link getTreeInfoByPubkey} instead
|
|
6
|
+
*/
|
|
7
|
+
export declare function getStateTreeInfoByPubkey(treeInfos: TreeInfo[], treeOrQueue: PublicKey): TreeInfo;
|
|
8
|
+
export declare function getTreeInfoByPubkey(treeInfos: TreeInfo[], treeOrQueue: PublicKey): TreeInfo;
|
|
9
|
+
/**
|
|
10
|
+
* @deprecated use {@link selectStateTreeInfo} instead.
|
|
11
|
+
*
|
|
12
|
+
* Get a random tree and queue from a set of provided state tree infos.
|
|
13
|
+
*
|
|
14
|
+
* @param infos Set of state tree infos
|
|
15
|
+
* @returns A random tree and queue
|
|
16
|
+
*/
|
|
17
|
+
export declare function pickRandomTreeAndQueue(infos: TreeInfo[]): {
|
|
18
|
+
tree: PublicKey;
|
|
19
|
+
queue: PublicKey;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Select a pseudo-random active state tree info from the set of provided state
|
|
23
|
+
* tree infos.
|
|
24
|
+
*
|
|
25
|
+
* Using this reduces write-lock contention on state trees.
|
|
26
|
+
*
|
|
27
|
+
* @param infos Set of state tree infos
|
|
28
|
+
*
|
|
29
|
+
* @param treeType Optional: Only use if you know what you are
|
|
30
|
+
* doing. The type of tree.
|
|
31
|
+
* @param useMaxConcurrency Optional: Only use if you know what you are
|
|
32
|
+
* doing. If true, select from all infos.
|
|
33
|
+
*
|
|
34
|
+
* @returns A pseudo-randomly selected tree info
|
|
35
|
+
*/
|
|
36
|
+
export declare function selectStateTreeInfo(infos: TreeInfo[], treeType?: TreeType, useMaxConcurrency?: boolean): TreeInfo;
|
|
37
|
+
/**
|
|
38
|
+
* Get active state tree infos from LUTs.
|
|
39
|
+
*
|
|
40
|
+
* @param connection The connection to the cluster
|
|
41
|
+
* @param stateTreeLUTPairs The state tree lookup table pairs
|
|
42
|
+
*
|
|
43
|
+
* @returns The active state tree infos
|
|
44
|
+
*/
|
|
45
|
+
export declare function getAllStateTreeInfos({ connection, stateTreeLUTPairs, }: {
|
|
46
|
+
connection: Connection;
|
|
47
|
+
stateTreeLUTPairs: StateTreeLUTPair[];
|
|
48
|
+
}): Promise<TreeInfo[]>;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
export * from './address';
|
|
2
2
|
export * from './airdrop';
|
|
3
|
+
export * from './calculate-compute-unit-price';
|
|
3
4
|
export * from './conversion';
|
|
5
|
+
export * from './dedupe-signer';
|
|
4
6
|
export * from './parse-validity-proof';
|
|
5
7
|
export * from './pipe';
|
|
6
8
|
export * from './send-and-confirm';
|
|
7
9
|
export * from './sleep';
|
|
8
10
|
export * from './validation';
|
|
9
|
-
export * from './
|
|
10
|
-
export * from './get-
|
|
11
|
+
export * from './state-tree-lookup-table';
|
|
12
|
+
export * from './get-state-tree-infos';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ValidityProof } from '../state';
|
|
2
2
|
interface GnarkProofJson {
|
|
3
3
|
ar: string[];
|
|
4
4
|
bs: string[][];
|
|
@@ -14,7 +14,7 @@ export declare const placeholderValidityProof: () => {
|
|
|
14
14
|
b: number[];
|
|
15
15
|
c: number[];
|
|
16
16
|
};
|
|
17
|
-
export declare const checkValidityProofShape: (proof:
|
|
17
|
+
export declare const checkValidityProofShape: (proof: ValidityProof) => void;
|
|
18
18
|
export declare function proofFromJsonStruct(json: GnarkProofJson): ProofABC;
|
|
19
|
-
export declare function negateAndCompressProof(proof: ProofABC):
|
|
19
|
+
export declare function negateAndCompressProof(proof: ProofABC): ValidityProof;
|
|
20
20
|
export {};
|
|
@@ -34,7 +34,7 @@ export declare function sendAndConfirmTx(rpc: Rpc, tx: VersionedTransaction, con
|
|
|
34
34
|
* @param blockHashCtx blockhash context for confirmation
|
|
35
35
|
* @return SignatureResult
|
|
36
36
|
*/
|
|
37
|
-
export declare function confirmTx(rpc: Rpc, txId: string, confirmOptions?: ConfirmOptions,
|
|
37
|
+
export declare function confirmTx(rpc: Rpc, txId: string, confirmOptions?: ConfirmOptions, _blockHashCtx?: {
|
|
38
38
|
blockhash: string;
|
|
39
39
|
lastValidBlockHeight: number;
|
|
40
40
|
}): Promise<RpcResponseAndContext<SignatureResult>>;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { PublicKey, Keypair, Connection } from '@solana/web3.js';
|
|
2
|
+
/**
|
|
3
|
+
* Create two lookup tables storing all public state tree and queue addresses
|
|
4
|
+
* returns lookup table addresses and txId
|
|
5
|
+
*
|
|
6
|
+
* @internal
|
|
7
|
+
* @param connection Connection to the Solana network
|
|
8
|
+
* @param payer Keypair of the payer
|
|
9
|
+
* @param authority Keypair of the authority
|
|
10
|
+
* @param recentSlot Slot of the recent block
|
|
11
|
+
*/
|
|
12
|
+
export declare function createStateTreeLookupTable({ connection, payer, authority, recentSlot, }: {
|
|
13
|
+
connection: Connection;
|
|
14
|
+
payer: Keypair;
|
|
15
|
+
authority: Keypair;
|
|
16
|
+
recentSlot: number;
|
|
17
|
+
}): Promise<{
|
|
18
|
+
address: PublicKey;
|
|
19
|
+
txId: string;
|
|
20
|
+
}>;
|
|
21
|
+
/**
|
|
22
|
+
* Extend state tree lookup table with new state tree and queue addresses
|
|
23
|
+
*
|
|
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
|
+
*
|
|
49
|
+
* @internal
|
|
50
|
+
* @param connection Connection to the Solana network
|
|
51
|
+
* @param stateTreeAddress Address of the state tree to nullify
|
|
52
|
+
* @param nullifyLookupTableAddress Address of the nullifier lookup table to
|
|
53
|
+
* store address in
|
|
54
|
+
* @param stateTreeLookupTableAddress lookup table storing all state tree
|
|
55
|
+
* addresses
|
|
56
|
+
* @param payer Keypair of the payer
|
|
57
|
+
* @param authority Keypair of the authority
|
|
58
|
+
*/
|
|
59
|
+
export declare function nullifyLookupTable({ connection, fullStateTreeAddress, nullifyLookupTableAddress, stateTreeLookupTableAddress, payer, authority, }: {
|
|
60
|
+
connection: Connection;
|
|
61
|
+
fullStateTreeAddress: PublicKey;
|
|
62
|
+
nullifyLookupTableAddress: PublicKey;
|
|
63
|
+
stateTreeLookupTableAddress: PublicKey;
|
|
64
|
+
payer: Keypair;
|
|
65
|
+
authority: Keypair;
|
|
66
|
+
}): Promise<{
|
|
67
|
+
txId: string;
|
|
68
|
+
}>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import BN from 'bn.js';
|
|
2
|
-
import {
|
|
2
|
+
import { CompressedAccountLegacy, CompressedAccountWithMerkleContext } from '../state';
|
|
3
3
|
export declare const validateSufficientBalance: (balance: BN) => void;
|
|
4
|
-
export declare const validateSameOwner: (compressedAccounts:
|
|
4
|
+
export declare const validateSameOwner: (compressedAccounts: CompressedAccountLegacy[] | CompressedAccountWithMerkleContext[]) => void;
|
|
5
5
|
export declare const validateNumbersForProof: (hashesLength: number, newAddressesLength: number) => void;
|
|
6
6
|
export declare const validateNumbersForInclusionProof: (hashesLength: number) => void;
|
|
7
7
|
export declare const validateNumbersForNonInclusionProof: (newAddressesLength: number) => void;
|
|
@@ -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 { TreeInfo } 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?: TreeInfo, 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, TreeInfo } 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?: TreeInfo, 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?: TreeInfo, 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>;
|
|
@@ -4,17 +4,13 @@ import { Rpc } from '../rpc';
|
|
|
4
4
|
/**
|
|
5
5
|
* Transfer compressed lamports from one owner to another
|
|
6
6
|
*
|
|
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
|
-
*
|
|
7
|
+
* @param rpc Rpc to use
|
|
8
|
+
* @param payer Payer of transaction fees
|
|
9
|
+
* @param lamports Number of lamports to transfer
|
|
10
|
+
* @param owner Owner of the compressed lamports
|
|
11
|
+
* @param toAddress Destination address of the recipient
|
|
12
|
+
* @param confirmOptions Options for confirming the transaction
|
|
17
13
|
*
|
|
18
14
|
* @return Signature of the confirmed transaction
|
|
19
15
|
*/
|
|
20
|
-
export declare function transfer(rpc: Rpc, payer: Signer, lamports: number | BN, owner: Signer, toAddress: PublicKey,
|
|
16
|
+
export declare function transfer(rpc: Rpc, payer: Signer, lamports: number | BN, owner: Signer, toAddress: PublicKey, confirmOptions?: ConfirmOptions): Promise<TransactionSignature>;
|
|
@@ -1,15 +1,36 @@
|
|
|
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 { TreeInfo, TreeType } from './state/types';
|
|
5
|
+
export declare enum VERSION {
|
|
6
|
+
V1 = "V1",
|
|
7
|
+
V2 = "V2"
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
/**
|
|
11
|
+
* @internal
|
|
12
|
+
* Feature flags. Only use if you know what you are doing.
|
|
13
|
+
*/
|
|
14
|
+
export declare const featureFlags: {
|
|
15
|
+
version: VERSION;
|
|
16
|
+
isV2: () => boolean;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Returns the correct endpoint name for the current API version. E.g.
|
|
20
|
+
* versionedEndpoint('getCompressedAccount') -> 'getCompressedAccount' (V1)
|
|
21
|
+
* or 'getCompressedAccountV2' (V2)
|
|
22
|
+
*/
|
|
23
|
+
export declare const versionedEndpoint: (base: string) => string;
|
|
5
24
|
export declare const FIELD_SIZE: BN;
|
|
6
25
|
export declare const HIGHEST_ADDRESS_PLUS_ONE: BN;
|
|
7
26
|
export declare const COMPUTE_BUDGET_PATTERN: number[];
|
|
8
27
|
export declare const INVOKE_DISCRIMINATOR: Buffer;
|
|
9
28
|
export declare const INVOKE_CPI_DISCRIMINATOR: Buffer;
|
|
29
|
+
export declare const INVOKE_CPI_WITH_READ_ONLY_DISCRIMINATOR: Buffer;
|
|
30
|
+
export declare const INVOKE_CPI_WITH_ACCOUNT_INFO_DISCRIMINATOR: Buffer;
|
|
10
31
|
export declare const INSERT_INTO_QUEUES_DISCRIMINATOR: Buffer;
|
|
11
32
|
export declare const noopProgram = "noopb9bkMVfRPU8AsbpTUg8AQkHtKwMYZiFUjNRtMmV";
|
|
12
|
-
export declare const
|
|
33
|
+
export declare const lightSystemProgram = "SySTEM1eSU2p4BGQfQpimFEWWSC1XDFeun3Nqzz3rT7";
|
|
13
34
|
export declare const accountCompressionProgram = "compr6CUsB5m2jS4Y3831ztGSTnDpnKJTKS95d64XVq";
|
|
14
35
|
export declare const getRegisteredProgramPda: () => PublicKey;
|
|
15
36
|
export declare const getAccountCompressionAuthority: () => PublicKey;
|
|
@@ -23,7 +44,7 @@ export declare const defaultStaticAccountsStruct: () => {
|
|
|
23
44
|
};
|
|
24
45
|
export type StateTreeLUTPair = {
|
|
25
46
|
stateTreeLookupTable: PublicKey;
|
|
26
|
-
|
|
47
|
+
nullifyLookupTable: PublicKey;
|
|
27
48
|
};
|
|
28
49
|
/**
|
|
29
50
|
* Returns the Default Public State Tree LUTs for Devnet and Mainnet-Beta.
|
|
@@ -39,10 +60,19 @@ export declare const isLocalTest: (url: string) => boolean;
|
|
|
39
60
|
/**
|
|
40
61
|
* @internal
|
|
41
62
|
*/
|
|
42
|
-
export declare const
|
|
63
|
+
export declare const localTestActiveStateTreeInfos: () => TreeInfo[];
|
|
64
|
+
export declare const getDefaultAddressTreeInfo: () => {
|
|
65
|
+
tree: PublicKey;
|
|
66
|
+
queue: PublicKey;
|
|
67
|
+
cpiContext: null;
|
|
68
|
+
treeType: TreeType;
|
|
69
|
+
nextTreeInfo: null;
|
|
70
|
+
};
|
|
43
71
|
/**
|
|
72
|
+
* @deprecated use {@link rpc.getStateTreeInfos} and {@link selectStateTreeInfo} instead.
|
|
73
|
+
* for address trees, use {@link getDefaultAddressTreeInfo} instead.
|
|
44
74
|
* Use only with Localnet testing.
|
|
45
|
-
* For public networks, fetch via {@link defaultStateTreeLookupTables} and {@link
|
|
75
|
+
* For public networks, fetch via {@link defaultStateTreeLookupTables} and {@link getAllStateTreeInfos}.
|
|
46
76
|
*/
|
|
47
77
|
export declare const defaultTestStateTreeAccounts: () => {
|
|
48
78
|
nullifierQueue: PublicKey;
|
|
@@ -58,10 +88,11 @@ export declare const defaultTestStateTreeAccounts2: () => {
|
|
|
58
88
|
nullifierQueue2: PublicKey;
|
|
59
89
|
merkleTree2: PublicKey;
|
|
60
90
|
};
|
|
91
|
+
export declare const COMPRESSED_TOKEN_PROGRAM_ID: PublicKey;
|
|
61
92
|
export declare const stateTreeLookupTableMainnet = "7i86eQs3GSqHjN47WdWLTCGMW6gde1q96G2EVnUyK2st";
|
|
62
93
|
export declare const nullifiedStateTreeLookupTableMainnet = "H9QD4u1fG7KmkAzn2tDXhheushxFe1EcrjGGyEFXeMqT";
|
|
63
|
-
export declare const stateTreeLookupTableDevnet = "
|
|
64
|
-
export declare const nullifiedStateTreeLookupTableDevnet = "
|
|
94
|
+
export declare const stateTreeLookupTableDevnet = "Dk9mNkbiZXJZ4By8DfSP6HEE4ojZzRvucwpawLeuwq8q";
|
|
95
|
+
export declare const nullifiedStateTreeLookupTableDevnet = "AXbHzp1NgjLvpfnD6JRTTovXZ7APUCdtWZFCRr5tCxse";
|
|
65
96
|
export declare const nullifierQueuePubkey = "nfq1NvQDJ2GEgnS8zt9prAe8rjjpAW1zFkrvZoBR148";
|
|
66
97
|
export declare const cpiContextPubkey = "cpi1uHzrEhBG733DoEJNgHCyRS3XmmyVNZx5fonubE4";
|
|
67
98
|
export declare const merkletreePubkey = "smt1NamzXdq4AMqS2fS2F1i5KTYPZRhoHgWx38d8WsT";
|
|
@@ -70,6 +101,8 @@ export declare const addressQueue = "aq1S9z4reTSQAdgWHGD2zDaS39sjGrAxbR31vxJ2F4F
|
|
|
70
101
|
export declare const merkleTree2Pubkey = "smt2rJAFdyJJupwMKAqTNAJwvjhmiZ4JYGZmbVRw1Ho";
|
|
71
102
|
export declare const nullifierQueue2Pubkey = "nfq2hgS7NYemXsFaFUCe3EMXSDSfnZnAe27jC6aPP1X";
|
|
72
103
|
export declare const cpiContext2Pubkey = "cpi2cdhkH5roePvcudTgUL8ppEBfTay1desGh8G8QxK";
|
|
104
|
+
export declare const batchMerkleTree = "HLKs5NJ8FXkJg8BrzJt56adFYYuwg5etzDtBbQYTsixu";
|
|
105
|
+
export declare const batchQueue = "6L7SzhYB3anwEQ9cphpJ1U7Scwj57bx2xueReg7R9cKU";
|
|
73
106
|
export declare const confirmConfig: ConfirmOptions;
|
|
74
107
|
export declare const DEFAULT_MERKLE_TREE_HEIGHT = 26;
|
|
75
108
|
export declare const DEFAULT_MERKLE_TREE_ROOTS = 2800;
|