@lightprotocol/stateless.js 0.23.0-beta.3 → 0.23.0-beta.4
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 +14 -2
- package/dist/cjs/browser/actions/create-account.d.ts +25 -3
- package/dist/cjs/browser/actions/decompress.d.ts +13 -2
- package/dist/cjs/browser/actions/transfer.d.ts +14 -2
- package/dist/cjs/browser/constants.d.ts +67 -35
- package/dist/cjs/browser/errors.d.ts +40 -49
- package/dist/cjs/browser/index.cjs +11151 -1
- package/dist/cjs/browser/index.cjs.map +1 -1
- package/dist/cjs/browser/index.d.ts +0 -1
- package/dist/cjs/browser/programs/system/idl.d.ts +44 -44
- package/dist/cjs/browser/programs/system/layout.d.ts +50 -26
- package/dist/cjs/browser/programs/system/pack.d.ts +36 -7
- package/dist/cjs/browser/programs/system/program.d.ts +56 -9
- package/dist/cjs/browser/programs/system/select-compressed-accounts.d.ts +4 -1
- package/dist/cjs/browser/rpc-interface.d.ts +2918 -2226
- package/dist/cjs/browser/rpc.d.ts +198 -39
- package/dist/cjs/browser/state/BN254.d.ts +4 -1
- package/dist/cjs/browser/state/bn.d.ts +5 -1
- package/dist/cjs/browser/state/compressed-account.d.ts +42 -14
- package/dist/cjs/browser/state/types.d.ts +5 -2
- package/dist/cjs/browser/test-helpers/merkle-tree/indexed-array.d.ts +18 -4
- package/dist/cjs/browser/test-helpers/merkle-tree/merkle-tree.d.ts +19 -6
- package/dist/cjs/browser/test-helpers/test-rpc/get-compressed-accounts.d.ts +12 -3
- package/dist/cjs/browser/test-helpers/test-rpc/get-compressed-token-accounts.d.ts +22 -5
- package/dist/cjs/browser/test-helpers/test-rpc/get-parsed-events.d.ts +14 -4
- package/dist/cjs/browser/test-helpers/test-rpc/test-rpc.d.ts +155 -35
- package/dist/cjs/browser/test-helpers/test-utils.d.ts +5 -1
- package/dist/cjs/browser/utils/address.d.ts +26 -6
- package/dist/cjs/browser/utils/airdrop.d.ts +14 -2
- package/dist/cjs/browser/utils/calculate-compute-unit-price.d.ts +4 -1
- package/dist/cjs/browser/utils/conversion.d.ts +12 -4
- package/dist/cjs/browser/utils/dedupe-signer.d.ts +4 -1
- package/dist/cjs/browser/utils/get-state-tree-infos.d.ts +20 -5
- package/dist/cjs/browser/utils/instruction.d.ts +24 -7
- package/dist/cjs/browser/utils/pack-decompress.d.ts +9 -4
- package/dist/cjs/browser/utils/pipe.d.ts +4 -1
- package/dist/cjs/browser/utils/send-and-confirm.d.ts +42 -11
- package/dist/cjs/browser/utils/state-tree-lookup-table.d.ts +23 -3
- package/dist/cjs/browser/utils/validation.d.ts +24 -6
- package/dist/cjs/node/actions/compress.d.ts +14 -2
- package/dist/cjs/node/actions/create-account.d.ts +25 -3
- package/dist/cjs/node/actions/decompress.d.ts +13 -2
- package/dist/cjs/node/actions/transfer.d.ts +14 -2
- package/dist/cjs/node/constants.d.ts +67 -35
- package/dist/cjs/node/errors.d.ts +40 -49
- package/dist/cjs/node/index.cjs +9853 -1
- package/dist/cjs/node/index.cjs.map +1 -1
- package/dist/cjs/node/index.d.ts +0 -1
- package/dist/cjs/node/programs/system/idl.d.ts +44 -44
- package/dist/cjs/node/programs/system/layout.d.ts +50 -26
- package/dist/cjs/node/programs/system/pack.d.ts +36 -7
- package/dist/cjs/node/programs/system/program.d.ts +56 -9
- package/dist/cjs/node/programs/system/select-compressed-accounts.d.ts +4 -1
- package/dist/cjs/node/rpc-interface.d.ts +2918 -2226
- package/dist/cjs/node/rpc.d.ts +198 -39
- package/dist/cjs/node/state/BN254.d.ts +4 -1
- package/dist/cjs/node/state/bn.d.ts +5 -1
- package/dist/cjs/node/state/compressed-account.d.ts +42 -14
- package/dist/cjs/node/state/types.d.ts +5 -2
- package/dist/cjs/node/test-helpers/merkle-tree/indexed-array.d.ts +18 -4
- package/dist/cjs/node/test-helpers/merkle-tree/merkle-tree.d.ts +19 -6
- package/dist/cjs/node/test-helpers/test-rpc/get-compressed-accounts.d.ts +12 -3
- package/dist/cjs/node/test-helpers/test-rpc/get-compressed-token-accounts.d.ts +22 -5
- package/dist/cjs/node/test-helpers/test-rpc/get-parsed-events.d.ts +14 -4
- package/dist/cjs/node/test-helpers/test-rpc/test-rpc.d.ts +155 -35
- package/dist/cjs/node/test-helpers/test-utils.d.ts +5 -1
- package/dist/cjs/node/utils/address.d.ts +26 -6
- package/dist/cjs/node/utils/airdrop.d.ts +14 -2
- package/dist/cjs/node/utils/calculate-compute-unit-price.d.ts +4 -1
- package/dist/cjs/node/utils/conversion.d.ts +12 -4
- package/dist/cjs/node/utils/dedupe-signer.d.ts +4 -1
- package/dist/cjs/node/utils/get-state-tree-infos.d.ts +20 -5
- package/dist/cjs/node/utils/instruction.d.ts +24 -7
- package/dist/cjs/node/utils/pack-decompress.d.ts +9 -4
- package/dist/cjs/node/utils/pipe.d.ts +4 -1
- package/dist/cjs/node/utils/send-and-confirm.d.ts +42 -11
- package/dist/cjs/node/utils/state-tree-lookup-table.d.ts +23 -3
- package/dist/cjs/node/utils/validation.d.ts +24 -6
- package/dist/es/browser/actions/compress.d.ts +14 -2
- package/dist/es/browser/actions/create-account.d.ts +25 -3
- package/dist/es/browser/actions/decompress.d.ts +13 -2
- package/dist/es/browser/actions/transfer.d.ts +14 -2
- package/dist/es/browser/constants.d.ts +67 -35
- package/dist/es/browser/errors.d.ts +40 -49
- package/dist/es/browser/index.d.ts +0 -1
- package/dist/es/browser/index.js +11159 -1
- package/dist/es/browser/index.js.map +1 -1
- package/dist/es/browser/programs/system/idl.d.ts +44 -44
- package/dist/es/browser/programs/system/layout.d.ts +50 -26
- package/dist/es/browser/programs/system/pack.d.ts +36 -7
- package/dist/es/browser/programs/system/program.d.ts +56 -9
- package/dist/es/browser/programs/system/select-compressed-accounts.d.ts +4 -1
- package/dist/es/browser/rpc-interface.d.ts +2918 -2226
- package/dist/es/browser/rpc.d.ts +198 -39
- package/dist/es/browser/state/BN254.d.ts +4 -1
- package/dist/es/browser/state/bn.d.ts +5 -1
- package/dist/es/browser/state/compressed-account.d.ts +42 -14
- package/dist/es/browser/state/types.d.ts +5 -2
- package/dist/es/browser/test-helpers/merkle-tree/indexed-array.d.ts +18 -4
- package/dist/es/browser/test-helpers/merkle-tree/merkle-tree.d.ts +19 -6
- package/dist/es/browser/test-helpers/test-rpc/get-compressed-accounts.d.ts +12 -3
- package/dist/es/browser/test-helpers/test-rpc/get-compressed-token-accounts.d.ts +22 -5
- package/dist/es/browser/test-helpers/test-rpc/get-parsed-events.d.ts +14 -4
- package/dist/es/browser/test-helpers/test-rpc/test-rpc.d.ts +155 -35
- package/dist/es/browser/test-helpers/test-utils.d.ts +5 -1
- package/dist/es/browser/utils/address.d.ts +26 -6
- package/dist/es/browser/utils/airdrop.d.ts +14 -2
- package/dist/es/browser/utils/calculate-compute-unit-price.d.ts +4 -1
- package/dist/es/browser/utils/conversion.d.ts +12 -4
- package/dist/es/browser/utils/dedupe-signer.d.ts +4 -1
- package/dist/es/browser/utils/get-state-tree-infos.d.ts +20 -5
- package/dist/es/browser/utils/instruction.d.ts +24 -7
- package/dist/es/browser/utils/pack-decompress.d.ts +9 -4
- package/dist/es/browser/utils/pipe.d.ts +4 -1
- package/dist/es/browser/utils/send-and-confirm.d.ts +42 -11
- package/dist/es/browser/utils/state-tree-lookup-table.d.ts +23 -3
- package/dist/es/browser/utils/validation.d.ts +24 -6
- package/dist/types/index.d.ts +4134 -2547
- package/package.json +1 -1
- package/dist/cjs/browser/devnet-compat.d.ts +0 -15
- package/dist/cjs/node/devnet-compat.d.ts +0 -15
- package/dist/es/browser/devnet-compat.d.ts +0 -15
|
@@ -25,7 +25,12 @@ export interface PackedDecompressResult {
|
|
|
25
25
|
* @param addresses - Array of account addresses
|
|
26
26
|
* @returns Packed instruction parameters
|
|
27
27
|
*/
|
|
28
|
-
export declare function packDecompressAccountsIdempotent(
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
export declare function packDecompressAccountsIdempotent(
|
|
29
|
+
programId: PublicKey,
|
|
30
|
+
proof: {
|
|
31
|
+
compressedProof: ValidityProof | null;
|
|
32
|
+
treeInfos: TreeInfo[];
|
|
33
|
+
},
|
|
34
|
+
accountsData: AccountDataWithTreeInfo[],
|
|
35
|
+
addresses: PublicKey[],
|
|
36
|
+
): Promise<PackedDecompressResult>;
|
|
@@ -1,2 +1,5 @@
|
|
|
1
1
|
/** pipe function */
|
|
2
|
-
export declare function pipe<T, R>(
|
|
2
|
+
export declare function pipe<T, R>(
|
|
3
|
+
initialFunction: (arg: T) => R,
|
|
4
|
+
...functions: ((arg: R) => R)[]
|
|
5
|
+
): (initialValue: T) => R;
|
|
@@ -1,4 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
VersionedTransaction,
|
|
3
|
+
SignatureResult,
|
|
4
|
+
RpcResponseAndContext,
|
|
5
|
+
Signer,
|
|
6
|
+
TransactionInstruction,
|
|
7
|
+
ConfirmOptions,
|
|
8
|
+
TransactionSignature,
|
|
9
|
+
PublicKey,
|
|
10
|
+
AddressLookupTableAccount,
|
|
11
|
+
} from '@solana/web3.js';
|
|
2
12
|
import { Rpc } from '../rpc';
|
|
3
13
|
/**
|
|
4
14
|
* Builds a versioned Transaction from instructions.
|
|
@@ -10,7 +20,12 @@ import { Rpc } from '../rpc';
|
|
|
10
20
|
*
|
|
11
21
|
* @return VersionedTransaction
|
|
12
22
|
*/
|
|
13
|
-
export declare function buildTx(
|
|
23
|
+
export declare function buildTx(
|
|
24
|
+
instructions: TransactionInstruction[],
|
|
25
|
+
payerPublicKey: PublicKey,
|
|
26
|
+
blockhash: string,
|
|
27
|
+
lookupTableAccounts?: AddressLookupTableAccount[],
|
|
28
|
+
): VersionedTransaction;
|
|
14
29
|
/**
|
|
15
30
|
* Sends a versioned transaction and confirms it.
|
|
16
31
|
*
|
|
@@ -21,10 +36,15 @@ export declare function buildTx(instructions: TransactionInstruction[], payerPub
|
|
|
21
36
|
*
|
|
22
37
|
* @return TransactionSignature
|
|
23
38
|
*/
|
|
24
|
-
export declare function sendAndConfirmTx(
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
39
|
+
export declare function sendAndConfirmTx(
|
|
40
|
+
rpc: Rpc,
|
|
41
|
+
tx: VersionedTransaction,
|
|
42
|
+
confirmOptions?: ConfirmOptions,
|
|
43
|
+
blockHashCtx?: {
|
|
44
|
+
blockhash: string;
|
|
45
|
+
lastValidBlockHeight: number;
|
|
46
|
+
},
|
|
47
|
+
): Promise<TransactionSignature>;
|
|
28
48
|
/**
|
|
29
49
|
* Confirms a transaction with a given txId.
|
|
30
50
|
*
|
|
@@ -34,10 +54,15 @@ export declare function sendAndConfirmTx(rpc: Rpc, tx: VersionedTransaction, con
|
|
|
34
54
|
* @param blockHashCtx blockhash context for confirmation
|
|
35
55
|
* @return SignatureResult
|
|
36
56
|
*/
|
|
37
|
-
export declare function confirmTx(
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
57
|
+
export declare function confirmTx(
|
|
58
|
+
rpc: Rpc,
|
|
59
|
+
txId: string,
|
|
60
|
+
confirmOptions?: ConfirmOptions,
|
|
61
|
+
_blockHashCtx?: {
|
|
62
|
+
blockhash: string;
|
|
63
|
+
lastValidBlockHeight: number;
|
|
64
|
+
},
|
|
65
|
+
): Promise<RpcResponseAndContext<SignatureResult>>;
|
|
41
66
|
/**
|
|
42
67
|
* Builds a versioned Transaction from instructions and signs it.
|
|
43
68
|
*
|
|
@@ -49,4 +74,10 @@ export declare function confirmTx(rpc: Rpc, txId: string, confirmOptions?: Confi
|
|
|
49
74
|
* @param lookupTableAccounts lookup table accounts to include in the
|
|
50
75
|
* transaction
|
|
51
76
|
*/
|
|
52
|
-
export declare function buildAndSignTx(
|
|
77
|
+
export declare function buildAndSignTx(
|
|
78
|
+
instructions: TransactionInstruction[],
|
|
79
|
+
payer: Signer,
|
|
80
|
+
blockhash: string,
|
|
81
|
+
additionalSigners?: Signer[],
|
|
82
|
+
lookupTableAccounts?: AddressLookupTableAccount[],
|
|
83
|
+
): VersionedTransaction;
|
|
@@ -9,7 +9,12 @@ import { PublicKey, Keypair, Connection } from '@solana/web3.js';
|
|
|
9
9
|
* @param authority Keypair of the authority
|
|
10
10
|
* @param recentSlot Slot of the recent block
|
|
11
11
|
*/
|
|
12
|
-
export declare function createStateTreeLookupTable({
|
|
12
|
+
export declare function createStateTreeLookupTable({
|
|
13
|
+
connection,
|
|
14
|
+
payer,
|
|
15
|
+
authority,
|
|
16
|
+
recentSlot,
|
|
17
|
+
}: {
|
|
13
18
|
connection: Connection;
|
|
14
19
|
payer: Keypair;
|
|
15
20
|
authority: Keypair;
|
|
@@ -30,7 +35,15 @@ export declare function createStateTreeLookupTable({ connection, payer, authorit
|
|
|
30
35
|
* @param payer Keypair of the payer
|
|
31
36
|
* @param authority Keypair of the authority
|
|
32
37
|
*/
|
|
33
|
-
export declare function extendStateTreeLookupTable({
|
|
38
|
+
export declare function extendStateTreeLookupTable({
|
|
39
|
+
connection,
|
|
40
|
+
tableAddress,
|
|
41
|
+
newStateTreeAddresses,
|
|
42
|
+
newQueueAddresses,
|
|
43
|
+
newCpiContextAddresses,
|
|
44
|
+
payer,
|
|
45
|
+
authority,
|
|
46
|
+
}: {
|
|
34
47
|
connection: Connection;
|
|
35
48
|
tableAddress: PublicKey;
|
|
36
49
|
newStateTreeAddresses: PublicKey[];
|
|
@@ -56,7 +69,14 @@ export declare function extendStateTreeLookupTable({ connection, tableAddress, n
|
|
|
56
69
|
* @param payer Keypair of the payer
|
|
57
70
|
* @param authority Keypair of the authority
|
|
58
71
|
*/
|
|
59
|
-
export declare function nullifyLookupTable({
|
|
72
|
+
export declare function nullifyLookupTable({
|
|
73
|
+
connection,
|
|
74
|
+
fullStateTreeAddress,
|
|
75
|
+
nullifyLookupTableAddress,
|
|
76
|
+
stateTreeLookupTableAddress,
|
|
77
|
+
payer,
|
|
78
|
+
authority,
|
|
79
|
+
}: {
|
|
60
80
|
connection: Connection;
|
|
61
81
|
fullStateTreeAddress: PublicKey;
|
|
62
82
|
nullifyLookupTableAddress: PublicKey;
|
|
@@ -1,8 +1,26 @@
|
|
|
1
1
|
import BN from 'bn.js';
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
CompressedAccountLegacy,
|
|
4
|
+
CompressedAccountWithMerkleContext,
|
|
5
|
+
} from '../state';
|
|
3
6
|
export declare const validateSufficientBalance: (balance: BN) => void;
|
|
4
|
-
export declare const validateSameOwner: (
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
export declare const validateSameOwner: (
|
|
8
|
+
compressedAccounts:
|
|
9
|
+
| CompressedAccountLegacy[]
|
|
10
|
+
| CompressedAccountWithMerkleContext[],
|
|
11
|
+
) => void;
|
|
12
|
+
export declare const validateNumbersForProof: (
|
|
13
|
+
hashesLength: number,
|
|
14
|
+
newAddressesLength: number,
|
|
15
|
+
) => void;
|
|
16
|
+
export declare const validateNumbersForInclusionProof: (
|
|
17
|
+
hashesLength: number,
|
|
18
|
+
) => void;
|
|
19
|
+
export declare const validateNumbersForNonInclusionProof: (
|
|
20
|
+
newAddressesLength: number,
|
|
21
|
+
) => void;
|
|
22
|
+
export declare const validateNumbers: (
|
|
23
|
+
length: number,
|
|
24
|
+
allowedNumbers: number[],
|
|
25
|
+
type: string,
|
|
26
|
+
) => void;
|