@lightprotocol/stateless.js 0.21.0 → 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 +2 -2
- package/dist/cjs/browser/actions/create-account.d.ts +3 -3
- package/dist/cjs/browser/actions/transfer.d.ts +1 -2
- package/dist/cjs/browser/constants.d.ts +26 -3
- package/dist/cjs/browser/index.cjs +1 -1
- package/dist/cjs/browser/index.cjs.map +1 -1
- package/dist/cjs/browser/index.d.ts +0 -2
- package/dist/cjs/browser/programs/index.d.ts +0 -1
- package/dist/cjs/browser/{idl.d.ts → programs/system/idl.d.ts} +5 -27
- package/dist/cjs/browser/programs/system/index.d.ts +5 -0
- package/dist/cjs/{node/programs → browser/programs/system}/layout.d.ts +10 -1
- package/dist/cjs/{node/instruction/pack-compressed-accounts.d.ts → browser/programs/system/pack.d.ts} +28 -3
- package/dist/cjs/browser/programs/{system.d.ts → system/program.d.ts} +13 -28
- package/dist/cjs/browser/programs/system/select-compressed-accounts.d.ts +10 -0
- package/dist/cjs/browser/rpc-interface.d.ts +1553 -11
- package/dist/cjs/browser/rpc.d.ts +14 -34
- package/dist/cjs/browser/state/compressed-account.d.ts +140 -6
- package/dist/cjs/browser/state/types.d.ts +265 -26
- package/dist/cjs/browser/test-helpers/test-rpc/get-compressed-accounts.d.ts +1 -10
- package/dist/cjs/browser/test-helpers/test-rpc/get-compressed-token-accounts.d.ts +2 -2
- package/dist/cjs/browser/test-helpers/test-rpc/test-rpc.d.ts +14 -38
- 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 +16 -9
- package/dist/cjs/browser/utils/index.d.ts +1 -2
- package/dist/cjs/browser/utils/send-and-confirm.d.ts +1 -1
- package/dist/cjs/browser/utils/validation.d.ts +2 -2
- package/dist/cjs/node/actions/compress.d.ts +2 -2
- package/dist/cjs/node/actions/create-account.d.ts +3 -3
- package/dist/cjs/node/actions/transfer.d.ts +1 -2
- package/dist/cjs/node/constants.d.ts +26 -3
- package/dist/cjs/node/index.cjs +1 -1
- package/dist/cjs/node/index.cjs.map +1 -1
- package/dist/cjs/node/index.d.ts +0 -2
- package/dist/cjs/node/programs/index.d.ts +0 -1
- package/dist/cjs/node/{idl.d.ts → programs/system/idl.d.ts} +5 -27
- package/dist/cjs/node/programs/system/index.d.ts +5 -0
- package/dist/cjs/{browser/programs → node/programs/system}/layout.d.ts +10 -1
- package/dist/cjs/{browser/instruction/pack-compressed-accounts.d.ts → node/programs/system/pack.d.ts} +28 -3
- package/dist/cjs/node/programs/{system.d.ts → system/program.d.ts} +13 -28
- package/dist/cjs/node/programs/system/select-compressed-accounts.d.ts +10 -0
- package/dist/cjs/node/rpc-interface.d.ts +1553 -11
- package/dist/cjs/node/rpc.d.ts +14 -34
- package/dist/cjs/node/state/compressed-account.d.ts +140 -6
- package/dist/cjs/node/state/types.d.ts +265 -26
- package/dist/cjs/node/test-helpers/test-rpc/get-compressed-accounts.d.ts +1 -10
- package/dist/cjs/node/test-helpers/test-rpc/get-compressed-token-accounts.d.ts +2 -2
- package/dist/cjs/node/test-helpers/test-rpc/test-rpc.d.ts +14 -38
- 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 +16 -9
- package/dist/cjs/node/utils/index.d.ts +1 -2
- package/dist/cjs/node/utils/send-and-confirm.d.ts +1 -1
- package/dist/cjs/node/utils/validation.d.ts +2 -2
- package/dist/types/index.d.ts +2784 -877
- package/package.json +13 -6
- package/dist/cjs/browser/instruction/index.d.ts +0 -1
- package/dist/cjs/node/instruction/index.d.ts +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
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 {
|
|
4
|
+
import { TreeInfo } from '../state';
|
|
5
5
|
/**
|
|
6
6
|
* Compress lamports to a solana address
|
|
7
7
|
*
|
|
@@ -15,4 +15,4 @@ import { StateTreeInfo } from '../state';
|
|
|
15
15
|
*
|
|
16
16
|
* @return Transaction signature
|
|
17
17
|
*/
|
|
18
|
-
export declare function compress(rpc: Rpc, payer: Signer, lamports: number | BN, toAddress: PublicKey, outputStateTreeInfo?:
|
|
18
|
+
export declare function compress(rpc: Rpc, payer: Signer, lamports: number | BN, toAddress: PublicKey, outputStateTreeInfo?: TreeInfo, confirmOptions?: ConfirmOptions): Promise<TransactionSignature>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ConfirmOptions, PublicKey, Signer, TransactionSignature } from '@solana/web3.js';
|
|
2
2
|
import { Rpc } from '../rpc';
|
|
3
|
-
import { AddressTreeInfo,
|
|
3
|
+
import { AddressTreeInfo, TreeInfo } from '../state';
|
|
4
4
|
import BN from 'bn.js';
|
|
5
5
|
/**
|
|
6
6
|
* Create compressed account with address
|
|
@@ -17,7 +17,7 @@ import BN from 'bn.js';
|
|
|
17
17
|
*
|
|
18
18
|
* @return Transaction signature
|
|
19
19
|
*/
|
|
20
|
-
export declare function createAccount(rpc: Rpc, payer: Signer, seeds: Uint8Array[], programId: PublicKey, addressTreeInfo?: AddressTreeInfo, outputStateTreeInfo?:
|
|
20
|
+
export declare function createAccount(rpc: Rpc, payer: Signer, seeds: Uint8Array[], programId: PublicKey, addressTreeInfo?: AddressTreeInfo, outputStateTreeInfo?: TreeInfo, confirmOptions?: ConfirmOptions): Promise<TransactionSignature>;
|
|
21
21
|
/**
|
|
22
22
|
* Create compressed account with address and lamports
|
|
23
23
|
*
|
|
@@ -35,4 +35,4 @@ export declare function createAccount(rpc: Rpc, payer: Signer, seeds: Uint8Array
|
|
|
35
35
|
*
|
|
36
36
|
* @return Transaction signature
|
|
37
37
|
*/
|
|
38
|
-
export declare function createAccountWithLamports(rpc: Rpc, payer: Signer, seeds: Uint8Array[], lamports: number | BN, programId: PublicKey, addressTreeInfo?: AddressTreeInfo, outputStateTreeInfo?:
|
|
38
|
+
export declare function createAccountWithLamports(rpc: Rpc, payer: Signer, seeds: Uint8Array[], lamports: number | BN, programId: PublicKey, addressTreeInfo?: AddressTreeInfo, outputStateTreeInfo?: TreeInfo, confirmOptions?: ConfirmOptions): Promise<TransactionSignature>;
|
|
@@ -1,7 +1,6 @@
|
|
|
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';
|
|
5
4
|
/**
|
|
6
5
|
* Transfer compressed lamports from one owner to another
|
|
7
6
|
*
|
|
@@ -14,4 +13,4 @@ import { StateTreeInfo } from '../state';
|
|
|
14
13
|
*
|
|
15
14
|
* @return Signature of the confirmed transaction
|
|
16
15
|
*/
|
|
17
|
-
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;
|
|
@@ -39,7 +60,7 @@ export declare const isLocalTest: (url: string) => boolean;
|
|
|
39
60
|
/**
|
|
40
61
|
* @internal
|
|
41
62
|
*/
|
|
42
|
-
export declare const
|
|
63
|
+
export declare const localTestActiveStateTreeInfos: () => TreeInfo[];
|
|
43
64
|
export declare const getDefaultAddressTreeInfo: () => {
|
|
44
65
|
tree: PublicKey;
|
|
45
66
|
queue: PublicKey;
|
|
@@ -80,6 +101,8 @@ export declare const addressQueue = "aq1S9z4reTSQAdgWHGD2zDaS39sjGrAxbR31vxJ2F4F
|
|
|
80
101
|
export declare const merkleTree2Pubkey = "smt2rJAFdyJJupwMKAqTNAJwvjhmiZ4JYGZmbVRw1Ho";
|
|
81
102
|
export declare const nullifierQueue2Pubkey = "nfq2hgS7NYemXsFaFUCe3EMXSDSfnZnAe27jC6aPP1X";
|
|
82
103
|
export declare const cpiContext2Pubkey = "cpi2cdhkH5roePvcudTgUL8ppEBfTay1desGh8G8QxK";
|
|
104
|
+
export declare const batchMerkleTree = "HLKs5NJ8FXkJg8BrzJt56adFYYuwg5etzDtBbQYTsixu";
|
|
105
|
+
export declare const batchQueue = "6L7SzhYB3anwEQ9cphpJ1U7Scwj57bx2xueReg7R9cKU";
|
|
83
106
|
export declare const confirmConfig: ConfirmOptions;
|
|
84
107
|
export declare const DEFAULT_MERKLE_TREE_HEIGHT = 26;
|
|
85
108
|
export declare const DEFAULT_MERKLE_TREE_ROOTS = 2800;
|