@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.
Files changed (122) hide show
  1. package/dist/cjs/browser/actions/compress.d.ts +14 -2
  2. package/dist/cjs/browser/actions/create-account.d.ts +25 -3
  3. package/dist/cjs/browser/actions/decompress.d.ts +13 -2
  4. package/dist/cjs/browser/actions/transfer.d.ts +14 -2
  5. package/dist/cjs/browser/constants.d.ts +67 -35
  6. package/dist/cjs/browser/errors.d.ts +40 -49
  7. package/dist/cjs/browser/index.cjs +11151 -1
  8. package/dist/cjs/browser/index.cjs.map +1 -1
  9. package/dist/cjs/browser/index.d.ts +0 -1
  10. package/dist/cjs/browser/programs/system/idl.d.ts +44 -44
  11. package/dist/cjs/browser/programs/system/layout.d.ts +50 -26
  12. package/dist/cjs/browser/programs/system/pack.d.ts +36 -7
  13. package/dist/cjs/browser/programs/system/program.d.ts +56 -9
  14. package/dist/cjs/browser/programs/system/select-compressed-accounts.d.ts +4 -1
  15. package/dist/cjs/browser/rpc-interface.d.ts +2918 -2226
  16. package/dist/cjs/browser/rpc.d.ts +198 -39
  17. package/dist/cjs/browser/state/BN254.d.ts +4 -1
  18. package/dist/cjs/browser/state/bn.d.ts +5 -1
  19. package/dist/cjs/browser/state/compressed-account.d.ts +42 -14
  20. package/dist/cjs/browser/state/types.d.ts +5 -2
  21. package/dist/cjs/browser/test-helpers/merkle-tree/indexed-array.d.ts +18 -4
  22. package/dist/cjs/browser/test-helpers/merkle-tree/merkle-tree.d.ts +19 -6
  23. package/dist/cjs/browser/test-helpers/test-rpc/get-compressed-accounts.d.ts +12 -3
  24. package/dist/cjs/browser/test-helpers/test-rpc/get-compressed-token-accounts.d.ts +22 -5
  25. package/dist/cjs/browser/test-helpers/test-rpc/get-parsed-events.d.ts +14 -4
  26. package/dist/cjs/browser/test-helpers/test-rpc/test-rpc.d.ts +155 -35
  27. package/dist/cjs/browser/test-helpers/test-utils.d.ts +5 -1
  28. package/dist/cjs/browser/utils/address.d.ts +26 -6
  29. package/dist/cjs/browser/utils/airdrop.d.ts +14 -2
  30. package/dist/cjs/browser/utils/calculate-compute-unit-price.d.ts +4 -1
  31. package/dist/cjs/browser/utils/conversion.d.ts +12 -4
  32. package/dist/cjs/browser/utils/dedupe-signer.d.ts +4 -1
  33. package/dist/cjs/browser/utils/get-state-tree-infos.d.ts +20 -5
  34. package/dist/cjs/browser/utils/instruction.d.ts +24 -7
  35. package/dist/cjs/browser/utils/pack-decompress.d.ts +9 -4
  36. package/dist/cjs/browser/utils/pipe.d.ts +4 -1
  37. package/dist/cjs/browser/utils/send-and-confirm.d.ts +42 -11
  38. package/dist/cjs/browser/utils/state-tree-lookup-table.d.ts +23 -3
  39. package/dist/cjs/browser/utils/validation.d.ts +24 -6
  40. package/dist/cjs/node/actions/compress.d.ts +14 -2
  41. package/dist/cjs/node/actions/create-account.d.ts +25 -3
  42. package/dist/cjs/node/actions/decompress.d.ts +13 -2
  43. package/dist/cjs/node/actions/transfer.d.ts +14 -2
  44. package/dist/cjs/node/constants.d.ts +67 -35
  45. package/dist/cjs/node/errors.d.ts +40 -49
  46. package/dist/cjs/node/index.cjs +9853 -1
  47. package/dist/cjs/node/index.cjs.map +1 -1
  48. package/dist/cjs/node/index.d.ts +0 -1
  49. package/dist/cjs/node/programs/system/idl.d.ts +44 -44
  50. package/dist/cjs/node/programs/system/layout.d.ts +50 -26
  51. package/dist/cjs/node/programs/system/pack.d.ts +36 -7
  52. package/dist/cjs/node/programs/system/program.d.ts +56 -9
  53. package/dist/cjs/node/programs/system/select-compressed-accounts.d.ts +4 -1
  54. package/dist/cjs/node/rpc-interface.d.ts +2918 -2226
  55. package/dist/cjs/node/rpc.d.ts +198 -39
  56. package/dist/cjs/node/state/BN254.d.ts +4 -1
  57. package/dist/cjs/node/state/bn.d.ts +5 -1
  58. package/dist/cjs/node/state/compressed-account.d.ts +42 -14
  59. package/dist/cjs/node/state/types.d.ts +5 -2
  60. package/dist/cjs/node/test-helpers/merkle-tree/indexed-array.d.ts +18 -4
  61. package/dist/cjs/node/test-helpers/merkle-tree/merkle-tree.d.ts +19 -6
  62. package/dist/cjs/node/test-helpers/test-rpc/get-compressed-accounts.d.ts +12 -3
  63. package/dist/cjs/node/test-helpers/test-rpc/get-compressed-token-accounts.d.ts +22 -5
  64. package/dist/cjs/node/test-helpers/test-rpc/get-parsed-events.d.ts +14 -4
  65. package/dist/cjs/node/test-helpers/test-rpc/test-rpc.d.ts +155 -35
  66. package/dist/cjs/node/test-helpers/test-utils.d.ts +5 -1
  67. package/dist/cjs/node/utils/address.d.ts +26 -6
  68. package/dist/cjs/node/utils/airdrop.d.ts +14 -2
  69. package/dist/cjs/node/utils/calculate-compute-unit-price.d.ts +4 -1
  70. package/dist/cjs/node/utils/conversion.d.ts +12 -4
  71. package/dist/cjs/node/utils/dedupe-signer.d.ts +4 -1
  72. package/dist/cjs/node/utils/get-state-tree-infos.d.ts +20 -5
  73. package/dist/cjs/node/utils/instruction.d.ts +24 -7
  74. package/dist/cjs/node/utils/pack-decompress.d.ts +9 -4
  75. package/dist/cjs/node/utils/pipe.d.ts +4 -1
  76. package/dist/cjs/node/utils/send-and-confirm.d.ts +42 -11
  77. package/dist/cjs/node/utils/state-tree-lookup-table.d.ts +23 -3
  78. package/dist/cjs/node/utils/validation.d.ts +24 -6
  79. package/dist/es/browser/actions/compress.d.ts +14 -2
  80. package/dist/es/browser/actions/create-account.d.ts +25 -3
  81. package/dist/es/browser/actions/decompress.d.ts +13 -2
  82. package/dist/es/browser/actions/transfer.d.ts +14 -2
  83. package/dist/es/browser/constants.d.ts +67 -35
  84. package/dist/es/browser/errors.d.ts +40 -49
  85. package/dist/es/browser/index.d.ts +0 -1
  86. package/dist/es/browser/index.js +11159 -1
  87. package/dist/es/browser/index.js.map +1 -1
  88. package/dist/es/browser/programs/system/idl.d.ts +44 -44
  89. package/dist/es/browser/programs/system/layout.d.ts +50 -26
  90. package/dist/es/browser/programs/system/pack.d.ts +36 -7
  91. package/dist/es/browser/programs/system/program.d.ts +56 -9
  92. package/dist/es/browser/programs/system/select-compressed-accounts.d.ts +4 -1
  93. package/dist/es/browser/rpc-interface.d.ts +2918 -2226
  94. package/dist/es/browser/rpc.d.ts +198 -39
  95. package/dist/es/browser/state/BN254.d.ts +4 -1
  96. package/dist/es/browser/state/bn.d.ts +5 -1
  97. package/dist/es/browser/state/compressed-account.d.ts +42 -14
  98. package/dist/es/browser/state/types.d.ts +5 -2
  99. package/dist/es/browser/test-helpers/merkle-tree/indexed-array.d.ts +18 -4
  100. package/dist/es/browser/test-helpers/merkle-tree/merkle-tree.d.ts +19 -6
  101. package/dist/es/browser/test-helpers/test-rpc/get-compressed-accounts.d.ts +12 -3
  102. package/dist/es/browser/test-helpers/test-rpc/get-compressed-token-accounts.d.ts +22 -5
  103. package/dist/es/browser/test-helpers/test-rpc/get-parsed-events.d.ts +14 -4
  104. package/dist/es/browser/test-helpers/test-rpc/test-rpc.d.ts +155 -35
  105. package/dist/es/browser/test-helpers/test-utils.d.ts +5 -1
  106. package/dist/es/browser/utils/address.d.ts +26 -6
  107. package/dist/es/browser/utils/airdrop.d.ts +14 -2
  108. package/dist/es/browser/utils/calculate-compute-unit-price.d.ts +4 -1
  109. package/dist/es/browser/utils/conversion.d.ts +12 -4
  110. package/dist/es/browser/utils/dedupe-signer.d.ts +4 -1
  111. package/dist/es/browser/utils/get-state-tree-infos.d.ts +20 -5
  112. package/dist/es/browser/utils/instruction.d.ts +24 -7
  113. package/dist/es/browser/utils/pack-decompress.d.ts +9 -4
  114. package/dist/es/browser/utils/pipe.d.ts +4 -1
  115. package/dist/es/browser/utils/send-and-confirm.d.ts +42 -11
  116. package/dist/es/browser/utils/state-tree-lookup-table.d.ts +23 -3
  117. package/dist/es/browser/utils/validation.d.ts +24 -6
  118. package/dist/types/index.d.ts +4134 -2547
  119. package/package.json +1 -1
  120. package/dist/cjs/browser/devnet-compat.d.ts +0 -15
  121. package/dist/cjs/node/devnet-compat.d.ts +0 -15
  122. package/dist/es/browser/devnet-compat.d.ts +0 -15
@@ -2,6 +2,15 @@ import { PublicKey } from '@solana/web3.js';
2
2
  import BN from 'bn.js';
3
3
  import { Rpc } from '../../rpc';
4
4
  import { CompressedAccountWithMerkleContext } from '../../state';
5
- export declare function getCompressedAccountsByOwnerTest(rpc: Rpc, owner: PublicKey): Promise<CompressedAccountWithMerkleContext[]>;
6
- export declare function getCompressedAccountByHashTest(rpc: Rpc, hash: BN): Promise<CompressedAccountWithMerkleContext | undefined>;
7
- export declare function getMultipleCompressedAccountsByHashTest(rpc: Rpc, hashes: BN[]): Promise<CompressedAccountWithMerkleContext[]>;
5
+ export declare function getCompressedAccountsByOwnerTest(
6
+ rpc: Rpc,
7
+ owner: PublicKey,
8
+ ): Promise<CompressedAccountWithMerkleContext[]>;
9
+ export declare function getCompressedAccountByHashTest(
10
+ rpc: Rpc,
11
+ hash: BN,
12
+ ): Promise<CompressedAccountWithMerkleContext | undefined>;
13
+ export declare function getMultipleCompressedAccountsByHashTest(
14
+ rpc: Rpc,
15
+ hashes: BN[],
16
+ ): Promise<CompressedAccountWithMerkleContext[]>;
@@ -20,7 +20,10 @@ export type EventWithParsedTokenTlvData = {
20
20
  * @param compressedAccount - The compressed account
21
21
  * @returns The parsed token data
22
22
  */
23
- export declare function parseTokenLayoutWithIdl(compressedAccount: CompressedAccountLegacy, programId?: PublicKey): TokenData | null;
23
+ export declare function parseTokenLayoutWithIdl(
24
+ compressedAccount: CompressedAccountLegacy,
25
+ programId?: PublicKey,
26
+ ): TokenData | null;
24
27
  /**
25
28
  * Retrieves all compressed token accounts for a given mint and owner.
26
29
  *
@@ -30,9 +33,23 @@ export declare function parseTokenLayoutWithIdl(compressedAccount: CompressedAcc
30
33
  * @param owner PublicKey of the token owner
31
34
  * @param mint PublicKey of the token mint
32
35
  */
33
- export declare function getCompressedTokenAccounts(events: PublicTransactionEvent[], rpc: Rpc): Promise<ParsedTokenAccount[]>;
36
+ export declare function getCompressedTokenAccounts(
37
+ events: PublicTransactionEvent[],
38
+ rpc: Rpc,
39
+ ): Promise<ParsedTokenAccount[]>;
34
40
  /** @internal */
35
- export declare function getCompressedTokenAccountsByOwnerTest(rpc: Rpc, owner: PublicKey, mint: PublicKey): Promise<WithCursor<ParsedTokenAccount[]>>;
36
- export declare function getCompressedTokenAccountsByDelegateTest(rpc: Rpc, delegate: PublicKey, mint: PublicKey): Promise<WithCursor<ParsedTokenAccount[]>>;
37
- export declare function getCompressedTokenAccountByHashTest(rpc: Rpc, hash: BN): Promise<ParsedTokenAccount>;
41
+ export declare function getCompressedTokenAccountsByOwnerTest(
42
+ rpc: Rpc,
43
+ owner: PublicKey,
44
+ mint: PublicKey,
45
+ ): Promise<WithCursor<ParsedTokenAccount[]>>;
46
+ export declare function getCompressedTokenAccountsByDelegateTest(
47
+ rpc: Rpc,
48
+ delegate: PublicKey,
49
+ mint: PublicKey,
50
+ ): Promise<WithCursor<ParsedTokenAccount[]>>;
51
+ export declare function getCompressedTokenAccountByHashTest(
52
+ rpc: Rpc,
53
+ hash: BN,
54
+ ): Promise<ParsedTokenAccount>;
38
55
  export {};
@@ -8,8 +8,18 @@ type Deserializer<T> = (data: Buffer, tx: ParsedTransactionWithMeta) => T;
8
8
  * Returns newest first.
9
9
  *
10
10
  * */
11
- export declare function getParsedEvents(rpc: Rpc): Promise<PublicTransactionEvent[]>;
12
- export declare const parseEvents: <T>(indexerEventsTransactions: (ParsedTransactionWithMeta | null)[], deserializeFn: Deserializer<T>) => NonNullable<T>[];
13
- export declare const parsePublicTransactionEventWithIdl: (data: Buffer) => PublicTransactionEvent | null;
14
- export declare function parseLightTransaction(dataVec: Uint8Array[], accountKeys: PublicKey[][]): PublicTransactionEvent | null | undefined;
11
+ export declare function getParsedEvents(
12
+ rpc: Rpc,
13
+ ): Promise<PublicTransactionEvent[]>;
14
+ export declare const parseEvents: <T>(
15
+ indexerEventsTransactions: (ParsedTransactionWithMeta | null)[],
16
+ deserializeFn: Deserializer<T>,
17
+ ) => NonNullable<T>[];
18
+ export declare const parsePublicTransactionEventWithIdl: (
19
+ data: Buffer,
20
+ ) => PublicTransactionEvent | null;
21
+ export declare function parseLightTransaction(
22
+ dataVec: Uint8Array[],
23
+ accountKeys: PublicKey[][],
24
+ ): PublicTransactionEvent | null | undefined;
15
25
  export {};
@@ -1,8 +1,30 @@
1
1
  import { Connection, ConnectionConfig, PublicKey } from '@solana/web3.js';
2
2
  import BN from 'bn.js';
3
- import { AddressWithTree, CompressedMintTokenHolders, CompressedTransaction, GetCompressedAccountsByOwnerConfig, PaginatedOptions, HashWithTree, LatestNonVotingSignatures, LatestNonVotingSignaturesPaginated, SignatureWithMetadata, WithContext, WithCursor } from '../../rpc-interface';
4
- import { ValidityProofWithContext, CompressionApiInterface, GetCompressedTokenAccountsByOwnerOrDelegateOptions, ParsedTokenAccount, TokenBalance } from '../../rpc-interface';
5
- import { BN254, CompressedAccountWithMerkleContext, MerkleContextWithMerkleProof } from '../../state';
3
+ import {
4
+ AddressWithTree,
5
+ CompressedMintTokenHolders,
6
+ CompressedTransaction,
7
+ GetCompressedAccountsByOwnerConfig,
8
+ PaginatedOptions,
9
+ HashWithTree,
10
+ LatestNonVotingSignatures,
11
+ LatestNonVotingSignaturesPaginated,
12
+ SignatureWithMetadata,
13
+ WithContext,
14
+ WithCursor,
15
+ } from '../../rpc-interface';
16
+ import {
17
+ ValidityProofWithContext,
18
+ CompressionApiInterface,
19
+ GetCompressedTokenAccountsByOwnerOrDelegateOptions,
20
+ ParsedTokenAccount,
21
+ TokenBalance,
22
+ } from '../../rpc-interface';
23
+ import {
24
+ BN254,
25
+ CompressedAccountWithMerkleContext,
26
+ MerkleContextWithMerkleProof,
27
+ } from '../../state';
6
28
  import { MerkleContextWithNewAddressProof } from '../../rpc';
7
29
  import { TreeInfo } from '../../state/types';
8
30
  export interface TestRpcConfig {
@@ -37,7 +59,14 @@ export interface LightWasm {
37
59
  * @param depth Depth of the merkle tree.
38
60
  * @param log Log proof generation time.
39
61
  */
40
- export declare function getTestRpc(lightWasm: LightWasm, endpoint?: string, compressionApiEndpoint?: string, proverEndpoint?: string, depth?: number, log?: boolean): Promise<TestRpc>;
62
+ export declare function getTestRpc(
63
+ lightWasm: LightWasm,
64
+ endpoint?: string,
65
+ compressionApiEndpoint?: string,
66
+ proverEndpoint?: string,
67
+ depth?: number,
68
+ log?: boolean,
69
+ ): Promise<TestRpc>;
41
70
  /**
42
71
  * Mock RPC for unit tests that simulates the ZK Compression RPC interface.
43
72
  * Parses events and builds merkletree on-demand. It does not persist state.
@@ -47,7 +76,10 @@ export declare function getTestRpc(lightWasm: LightWasm, endpoint?: string, comp
47
76
  * For advanced testing use `Rpc` class which uses photon:
48
77
  * https://github.com/helius-labs/photon
49
78
  */
50
- export declare class TestRpc extends Connection implements CompressionApiInterface {
79
+ export declare class TestRpc
80
+ extends Connection
81
+ implements CompressionApiInterface
82
+ {
51
83
  compressionApiEndpoint: string;
52
84
  proverEndpoint: string;
53
85
  lightWasm: LightWasm;
@@ -69,7 +101,14 @@ export declare class TestRpc extends Connection implements CompressionApiInterfa
69
101
  * @param connectionConfig Optional connection config
70
102
  * @param testRpcConfig Config for the mock rpc
71
103
  */
72
- constructor(endpoint: string, hasher: LightWasm, compressionApiEndpoint: string, proverEndpoint: string, connectionConfig?: ConnectionConfig, testRpcConfig?: TestRpcConfig);
104
+ constructor(
105
+ endpoint: string,
106
+ hasher: LightWasm,
107
+ compressionApiEndpoint: string,
108
+ proverEndpoint: string,
109
+ connectionConfig?: ConnectionConfig,
110
+ testRpcConfig?: TestRpcConfig,
111
+ );
73
112
  /**
74
113
  * @deprecated Use {@link getStateTreeInfos} instead
75
114
  */
@@ -90,7 +129,10 @@ export declare class TestRpc extends Connection implements CompressionApiInterfa
90
129
  /**
91
130
  * Fetch the compressed account for the specified account hash
92
131
  */
93
- getCompressedAccount(address?: BN254, hash?: BN254): Promise<CompressedAccountWithMerkleContext | null>;
132
+ getCompressedAccount(
133
+ address?: BN254,
134
+ hash?: BN254,
135
+ ): Promise<CompressedAccountWithMerkleContext | null>;
94
136
  /**
95
137
  * Fetch the compressed balance for the specified account hash
96
138
  */
@@ -103,12 +145,16 @@ export declare class TestRpc extends Connection implements CompressionApiInterfa
103
145
  * Fetch the latest merkle proof for the specified account hash from the
104
146
  * cluster
105
147
  */
106
- getCompressedAccountProof(hash: BN254): Promise<MerkleContextWithMerkleProof>;
148
+ getCompressedAccountProof(
149
+ hash: BN254,
150
+ ): Promise<MerkleContextWithMerkleProof>;
107
151
  /**
108
152
  * Fetch all the account info for multiple compressed accounts specified by
109
153
  * an array of account hashes
110
154
  */
111
- getMultipleCompressedAccounts(hashes: BN254[]): Promise<CompressedAccountWithMerkleContext[]>;
155
+ getMultipleCompressedAccounts(
156
+ hashes: BN254[],
157
+ ): Promise<CompressedAccountWithMerkleContext[]>;
112
158
  /**
113
159
  * Ensure that the Compression Indexer has already indexed the transaction
114
160
  */
@@ -117,31 +163,47 @@ export declare class TestRpc extends Connection implements CompressionApiInterfa
117
163
  * Fetch the latest merkle proofs for multiple compressed accounts specified
118
164
  * by an array account hashes
119
165
  */
120
- getMultipleCompressedAccountProofs(hashes: BN254[]): Promise<MerkleContextWithMerkleProof[]>;
166
+ getMultipleCompressedAccountProofs(
167
+ hashes: BN254[],
168
+ ): Promise<MerkleContextWithMerkleProof[]>;
121
169
  /**
122
170
  * Fetch all the compressed accounts owned by the specified public key.
123
171
  * Owner can be a program or user account
124
172
  */
125
- getCompressedAccountsByOwner(owner: PublicKey, _config?: GetCompressedAccountsByOwnerConfig): Promise<WithCursor<CompressedAccountWithMerkleContext[]>>;
173
+ getCompressedAccountsByOwner(
174
+ owner: PublicKey,
175
+ _config?: GetCompressedAccountsByOwnerConfig,
176
+ ): Promise<WithCursor<CompressedAccountWithMerkleContext[]>>;
126
177
  /**
127
178
  * Fetch the latest compression signatures on the cluster. Results are
128
179
  * paginated.
129
180
  */
130
- getLatestCompressionSignatures(_cursor?: string, _limit?: number): Promise<LatestNonVotingSignaturesPaginated>;
181
+ getLatestCompressionSignatures(
182
+ _cursor?: string,
183
+ _limit?: number,
184
+ ): Promise<LatestNonVotingSignaturesPaginated>;
131
185
  /**
132
186
  * Fetch the latest non-voting signatures on the cluster. Results are
133
187
  * not paginated.
134
188
  */
135
- getLatestNonVotingSignatures(_limit?: number): Promise<LatestNonVotingSignatures>;
189
+ getLatestNonVotingSignatures(
190
+ _limit?: number,
191
+ ): Promise<LatestNonVotingSignatures>;
136
192
  /**
137
193
  * Fetch all the compressed token accounts owned by the specified public
138
194
  * key. Owner can be a program or user account
139
195
  */
140
- getCompressedTokenAccountsByOwner(owner: PublicKey, options: GetCompressedTokenAccountsByOwnerOrDelegateOptions): Promise<WithCursor<ParsedTokenAccount[]>>;
196
+ getCompressedTokenAccountsByOwner(
197
+ owner: PublicKey,
198
+ options: GetCompressedTokenAccountsByOwnerOrDelegateOptions,
199
+ ): Promise<WithCursor<ParsedTokenAccount[]>>;
141
200
  /**
142
201
  * Fetch all the compressed accounts delegated to the specified public key.
143
202
  */
144
- getCompressedTokenAccountsByDelegate(delegate: PublicKey, options: GetCompressedTokenAccountsByOwnerOrDelegateOptions): Promise<WithCursor<ParsedTokenAccount[]>>;
203
+ getCompressedTokenAccountsByDelegate(
204
+ delegate: PublicKey,
205
+ options: GetCompressedTokenAccountsByOwnerOrDelegateOptions,
206
+ ): Promise<WithCursor<ParsedTokenAccount[]>>;
145
207
  /**
146
208
  * Fetch the compressed token balance for the specified account hash
147
209
  */
@@ -153,15 +215,25 @@ export declare class TestRpc extends Connection implements CompressionApiInterfa
153
215
  * Fetch all the compressed token balances owned by the specified public
154
216
  * key. Can filter by mint.
155
217
  */
156
- getCompressedTokenBalancesByOwner(publicKey: PublicKey, options: GetCompressedTokenAccountsByOwnerOrDelegateOptions): Promise<WithCursor<{
157
- balance: BN;
158
- mint: PublicKey;
159
- }[]>>;
218
+ getCompressedTokenBalancesByOwner(
219
+ publicKey: PublicKey,
220
+ options: GetCompressedTokenAccountsByOwnerOrDelegateOptions,
221
+ ): Promise<
222
+ WithCursor<
223
+ {
224
+ balance: BN;
225
+ mint: PublicKey;
226
+ }[]
227
+ >
228
+ >;
160
229
  /**
161
230
  * Fetch all the compressed token balances owned by the specified public
162
231
  * key. Can filter by mint. Uses context.
163
232
  */
164
- getCompressedTokenBalancesByOwnerV2(publicKey: PublicKey, options: GetCompressedTokenAccountsByOwnerOrDelegateOptions): Promise<WithContext<WithCursor<TokenBalance[]>>>;
233
+ getCompressedTokenBalancesByOwnerV2(
234
+ publicKey: PublicKey,
235
+ options: GetCompressedTokenAccountsByOwnerOrDelegateOptions,
236
+ ): Promise<WithContext<WithCursor<TokenBalance[]>>>;
165
237
  /**
166
238
  * Returns confirmed signatures for transactions involving the specified
167
239
  * account hash forward in time from genesis to the most recent confirmed
@@ -169,12 +241,16 @@ export declare class TestRpc extends Connection implements CompressionApiInterfa
169
241
  *
170
242
  * @param hash queried account hash
171
243
  */
172
- getCompressionSignaturesForAccount(_hash: BN254): Promise<SignatureWithMetadata[]>;
244
+ getCompressionSignaturesForAccount(
245
+ _hash: BN254,
246
+ ): Promise<SignatureWithMetadata[]>;
173
247
  /**
174
248
  * Fetch a confirmed or finalized transaction from the cluster. Return with
175
249
  * CompressionInfo
176
250
  */
177
- getTransactionWithCompressionInfo(_signature: string): Promise<CompressedTransaction>;
251
+ getTransactionWithCompressionInfo(
252
+ _signature: string,
253
+ ): Promise<CompressedTransaction>;
178
254
  /**
179
255
  * Returns confirmed signatures for transactions involving the specified
180
256
  * address forward in time from genesis to the most recent confirmed
@@ -182,7 +258,10 @@ export declare class TestRpc extends Connection implements CompressionApiInterfa
182
258
  *
183
259
  * @param address queried compressed account address
184
260
  */
185
- getCompressionSignaturesForAddress(_address: PublicKey, _options?: PaginatedOptions): Promise<WithCursor<SignatureWithMetadata[]>>;
261
+ getCompressionSignaturesForAddress(
262
+ _address: PublicKey,
263
+ _options?: PaginatedOptions,
264
+ ): Promise<WithCursor<SignatureWithMetadata[]>>;
186
265
  /**
187
266
  * Returns confirmed signatures for compression transactions involving the
188
267
  * specified account owner forward in time from genesis to the
@@ -190,13 +269,19 @@ export declare class TestRpc extends Connection implements CompressionApiInterfa
190
269
  *
191
270
  * @param owner queried owner public key
192
271
  */
193
- getCompressionSignaturesForOwner(_owner: PublicKey, _options?: PaginatedOptions): Promise<WithCursor<SignatureWithMetadata[]>>;
272
+ getCompressionSignaturesForOwner(
273
+ _owner: PublicKey,
274
+ _options?: PaginatedOptions,
275
+ ): Promise<WithCursor<SignatureWithMetadata[]>>;
194
276
  /**
195
277
  * Returns confirmed signatures for compression transactions involving the
196
278
  * specified token account owner forward in time from genesis to the most
197
279
  * recent confirmed block
198
280
  */
199
- getCompressionSignaturesForTokenOwner(_owner: PublicKey, _options?: PaginatedOptions): Promise<WithCursor<SignatureWithMetadata[]>>;
281
+ getCompressionSignaturesForTokenOwner(
282
+ _owner: PublicKey,
283
+ _options?: PaginatedOptions,
284
+ ): Promise<WithCursor<SignatureWithMetadata[]>>;
200
285
  /**
201
286
  * Fetch the current indexer health status
202
287
  */
@@ -213,13 +298,21 @@ export declare class TestRpc extends Connection implements CompressionApiInterfa
213
298
  * @param addresses Array of BN254 new addresses
214
299
  * @returns Array of validity proofs for new addresses
215
300
  */
216
- getMultipleNewAddressProofs(addresses: BN254[]): Promise<MerkleContextWithNewAddressProof[]>;
217
- getCompressedMintTokenHolders(_mint: PublicKey, _options?: PaginatedOptions): Promise<WithContext<WithCursor<CompressedMintTokenHolders[]>>>;
301
+ getMultipleNewAddressProofs(
302
+ addresses: BN254[],
303
+ ): Promise<MerkleContextWithNewAddressProof[]>;
304
+ getCompressedMintTokenHolders(
305
+ _mint: PublicKey,
306
+ _options?: PaginatedOptions,
307
+ ): Promise<WithContext<WithCursor<CompressedMintTokenHolders[]>>>;
218
308
  /**
219
309
  * @deprecated This method is not available for TestRpc. Please use
220
310
  * {@link getValidityProof} instead.
221
311
  */
222
- getValidityProofAndRpcContext(hashes?: HashWithTree[], newAddresses?: AddressWithTree[]): Promise<WithContext<ValidityProofWithContext>>;
312
+ getValidityProofAndRpcContext(
313
+ hashes?: HashWithTree[],
314
+ newAddresses?: AddressWithTree[],
315
+ ): Promise<WithContext<ValidityProofWithContext>>;
223
316
  /**
224
317
  * Fetch the latest validity proof for (1) compressed accounts specified by
225
318
  * an array of account hashes. (2) new unique addresses specified by an
@@ -234,12 +327,39 @@ export declare class TestRpc extends Connection implements CompressionApiInterfa
234
327
  * @param newAddresses Array of BN254 new addresses.
235
328
  * @returns validity proof with context
236
329
  */
237
- getValidityProof(hashes?: BN254[], newAddresses?: BN254[]): Promise<ValidityProofWithContext>;
238
- getValidityProofV0(hashes?: HashWithTree[], newAddresses?: AddressWithTree[]): Promise<ValidityProofWithContext>;
239
- getValidityProofV2(accountMerkleContexts?: any[], newAddresses?: any[], derivationMode?: any): Promise<ValidityProofWithContext>;
240
- getAccountInfoInterface(_address: PublicKey, _programId: PublicKey, _addressSpaceInfo: any): Promise<any>;
241
- getSignaturesForAddressInterface(_address: PublicKey, _options?: any, _compressedOptions?: PaginatedOptions): Promise<any>;
242
- getSignaturesForOwnerInterface(_owner: PublicKey, _options?: any, _compressedOptions?: PaginatedOptions): Promise<any>;
243
- getTokenAccountBalanceInterface(_address: PublicKey, _owner: PublicKey, _mint: PublicKey, _commitment?: any): Promise<any>;
330
+ getValidityProof(
331
+ hashes?: BN254[],
332
+ newAddresses?: BN254[],
333
+ ): Promise<ValidityProofWithContext>;
334
+ getValidityProofV0(
335
+ hashes?: HashWithTree[],
336
+ newAddresses?: AddressWithTree[],
337
+ ): Promise<ValidityProofWithContext>;
338
+ getValidityProofV2(
339
+ accountMerkleContexts?: any[],
340
+ newAddresses?: any[],
341
+ derivationMode?: any,
342
+ ): Promise<ValidityProofWithContext>;
343
+ getAccountInfoInterface(
344
+ _address: PublicKey,
345
+ _programId: PublicKey,
346
+ _addressSpaceInfo: any,
347
+ ): Promise<any>;
348
+ getSignaturesForAddressInterface(
349
+ _address: PublicKey,
350
+ _options?: any,
351
+ _compressedOptions?: PaginatedOptions,
352
+ ): Promise<any>;
353
+ getSignaturesForOwnerInterface(
354
+ _owner: PublicKey,
355
+ _options?: any,
356
+ _compressedOptions?: PaginatedOptions,
357
+ ): Promise<any>;
358
+ getTokenAccountBalanceInterface(
359
+ _address: PublicKey,
360
+ _owner: PublicKey,
361
+ _mint: PublicKey,
362
+ _commitment?: any,
363
+ ): Promise<any>;
244
364
  getBalanceInterface(_address: PublicKey, _commitment?: any): Promise<any>;
245
365
  }
@@ -20,7 +20,11 @@ export declare function deepEqual(ref: any, val: any): boolean;
20
20
  * @param counter counter to use for generating the keypair.
21
21
  * If undefined or >255, generates random keypair.
22
22
  */
23
- export declare function newAccountWithLamports(rpc: Rpc, lamports?: number, counter?: number | undefined): Promise<Signer>;
23
+ export declare function newAccountWithLamports(
24
+ rpc: Rpc,
25
+ lamports?: number,
26
+ counter?: number | undefined,
27
+ ): Promise<Signer>;
24
28
  export declare function getConnection(): Connection;
25
29
  /**
26
30
  * For use in tests.
@@ -3,12 +3,18 @@ import { PublicKey } from '@solana/web3.js';
3
3
  * @deprecated Use deriveAddressSeed (no programId param) for V2.
4
4
  * V1 seed derivation includes programId in hash.
5
5
  */
6
- export declare function deriveAddressSeedLegacy(seeds: Uint8Array[], programId: PublicKey): Uint8Array;
6
+ export declare function deriveAddressSeedLegacy(
7
+ seeds: Uint8Array[],
8
+ programId: PublicKey,
9
+ ): Uint8Array;
7
10
  /**
8
11
  * @deprecated Use deriveAddress with programId param for V2.
9
12
  * V1 address derivation doesn't include programId.
10
13
  */
11
- export declare function deriveAddressLegacy(seed: Uint8Array, addressMerkleTreePubkey?: PublicKey): PublicKey;
14
+ export declare function deriveAddressLegacy(
15
+ seed: Uint8Array,
16
+ addressMerkleTreePubkey?: PublicKey,
17
+ ): PublicKey;
12
18
  /**
13
19
  * Explicit V2 address seed derivation - always uses V2 behavior regardless of feature flag.
14
20
  * Use this when you explicitly want V2 derivation (e.g., in tests).
@@ -24,12 +30,19 @@ export declare function deriveAddressSeedV2(seeds: Uint8Array[]): Uint8Array;
24
30
  * @param programId (V1 only) Program ID - required in V1 mode, must be omitted in V2 mode
25
31
  * @returns 32-byte address seed
26
32
  */
27
- export declare function deriveAddressSeed(seeds: Uint8Array[], programId?: PublicKey): Uint8Array;
33
+ export declare function deriveAddressSeed(
34
+ seeds: Uint8Array[],
35
+ programId?: PublicKey,
36
+ ): Uint8Array;
28
37
  /**
29
38
  * Explicit V2 address derivation - always uses V2 behavior regardless of feature flag.
30
39
  * Use this when you explicitly want V2 derivation (e.g., in tests).
31
40
  */
32
- export declare function deriveAddressV2(addressSeed: Uint8Array, addressMerkleTreePubkey: PublicKey, programId: PublicKey): PublicKey;
41
+ export declare function deriveAddressV2(
42
+ addressSeed: Uint8Array,
43
+ addressMerkleTreePubkey: PublicKey,
44
+ programId: PublicKey,
45
+ ): PublicKey;
33
46
  /**
34
47
  * Derive an address for a compressed account.
35
48
  *
@@ -41,7 +54,11 @@ export declare function deriveAddressV2(addressSeed: Uint8Array, addressMerkleTr
41
54
  * @param programId (V2 only) Program ID - required in V2 mode, must be omitted in V1 mode
42
55
  * @returns Derived address
43
56
  */
44
- export declare function deriveAddress(addressSeed: Uint8Array, addressMerkleTreePubkey: PublicKey, programId?: PublicKey): PublicKey;
57
+ export declare function deriveAddress(
58
+ addressSeed: Uint8Array,
59
+ addressMerkleTreePubkey: PublicKey,
60
+ programId?: PublicKey,
61
+ ): PublicKey;
45
62
  export interface NewAddressParams {
46
63
  /**
47
64
  * Seed for the compressed account. Must be seed used to derive
@@ -89,7 +106,10 @@ export interface NewAddressParamsPacked {
89
106
  * @param remainingAccounts Remaining accounts
90
107
  * @returns Packed new address params
91
108
  */
92
- export declare function packNewAddressParams(newAddressParams: NewAddressParams[], remainingAccounts: PublicKey[]): {
109
+ export declare function packNewAddressParams(
110
+ newAddressParams: NewAddressParams[],
111
+ remainingAccounts: PublicKey[],
112
+ ): {
93
113
  newAddressParamsPacked: NewAddressParamsPacked[];
94
114
  remainingAccounts: PublicKey[];
95
115
  };
@@ -1,7 +1,19 @@
1
1
  import { Commitment, Connection, PublicKey } from '@solana/web3.js';
2
- export declare function airdropSol({ connection, lamports, recipientPublicKey, }: {
2
+ export declare function airdropSol({
3
+ connection,
4
+ lamports,
5
+ recipientPublicKey,
6
+ }: {
3
7
  connection: Connection;
4
8
  lamports: number;
5
9
  recipientPublicKey: PublicKey;
6
10
  }): Promise<string>;
7
- export declare function confirmTransaction(connection: Connection, signature: string, confirmation?: Commitment): Promise<import("@solana/web3.js").RpcResponseAndContext<import("@solana/web3.js").SignatureResult>>;
11
+ export declare function confirmTransaction(
12
+ connection: Connection,
13
+ signature: string,
14
+ confirmation?: Commitment,
15
+ ): Promise<
16
+ import('@solana/web3.js').RpcResponseAndContext<
17
+ import('@solana/web3.js').SignatureResult
18
+ >
19
+ >;
@@ -4,4 +4,7 @@
4
4
  * @returns microLamports per compute unit (use in
5
5
  * {@link https://github.com/solana-foundation/solana-web3.js/blob/maintenance/v1.x/src/programs/compute-budget.ts#L218})
6
6
  */
7
- export declare function calculateComputeUnitPrice(targetLamports: number, computeUnits: number): number;
7
+ export declare function calculateComputeUnitPrice(
8
+ targetLamports: number,
9
+ computeUnits: number,
10
+ ): number;
@@ -20,8 +20,12 @@ export declare const toCamelCase: (object: any) => any;
20
20
  *
21
21
  * @deprecated Use `hashvToBn254FieldSizeBe` instead.
22
22
  */
23
- export declare function hashToBn254FieldSizeBe(bytes: Buffer): [Buffer, number] | null;
24
- export declare function hashvToBn254FieldSizeBeU8Array(bytes: Uint8Array[]): Uint8Array;
23
+ export declare function hashToBn254FieldSizeBe(
24
+ bytes: Buffer,
25
+ ): [Buffer, number] | null;
26
+ export declare function hashvToBn254FieldSizeBeU8Array(
27
+ bytes: Uint8Array[],
28
+ ): Uint8Array;
25
29
  /**
26
30
  * Hash the provided `bytes` with Keccak256 and ensure that the result fits in
27
31
  * the BN254 prime field by truncating the resulting hash to 31 bytes.
@@ -30,7 +34,11 @@ export declare function hashvToBn254FieldSizeBeU8Array(bytes: Uint8Array[]): Uin
30
34
  *
31
35
  * @returns Hash digest
32
36
  */
33
- export declare function hashvToBn254FieldSizeBe(bytes: Uint8Array[]): Uint8Array;
37
+ export declare function hashvToBn254FieldSizeBe(
38
+ bytes: Uint8Array[],
39
+ ): Uint8Array;
34
40
  /** Mutates array in place */
35
41
  export declare function pushUniqueItems<T>(items: T[], map: T[]): void;
36
- export declare function convertInvokeCpiWithReadOnlyToInvoke(data: any): InstructionDataInvoke;
42
+ export declare function convertInvokeCpiWithReadOnlyToInvoke(
43
+ data: any,
44
+ ): InstructionDataInvoke;
@@ -1,3 +1,6 @@
1
1
  import { Signer } from '@solana/web3.js';
2
2
  /** @internal remove signer from signers if part of signers */
3
- export declare function dedupeSigner(signer: Signer, signers: Signer[]): Signer[];
3
+ export declare function dedupeSigner(
4
+ signer: Signer,
5
+ signers: Signer[],
6
+ ): Signer[];
@@ -15,12 +15,20 @@ export declare function getOutputQueue(merkleContext: MerkleContext): PublicKey;
15
15
  * @param merkleContext The merkle context to get the output tree info from
16
16
  * @returns The output tree info
17
17
  */
18
- export declare function getOutputTreeInfo(merkleContext: MerkleContext): TreeInfo;
18
+ export declare function getOutputTreeInfo(
19
+ merkleContext: MerkleContext,
20
+ ): TreeInfo;
19
21
  /**
20
22
  * @deprecated use {@link getTreeInfoByPubkey} instead
21
23
  */
22
- export declare function getStateTreeInfoByPubkey(treeInfos: TreeInfo[], treeOrQueue: PublicKey): TreeInfo;
23
- export declare function getTreeInfoByPubkey(treeInfos: TreeInfo[], treeOrQueue: PublicKey): TreeInfo;
24
+ export declare function getStateTreeInfoByPubkey(
25
+ treeInfos: TreeInfo[],
26
+ treeOrQueue: PublicKey,
27
+ ): TreeInfo;
28
+ export declare function getTreeInfoByPubkey(
29
+ treeInfos: TreeInfo[],
30
+ treeOrQueue: PublicKey,
31
+ ): TreeInfo;
24
32
  /**
25
33
  * @deprecated use {@link selectStateTreeInfo} instead.
26
34
  *
@@ -48,7 +56,11 @@ export declare function pickRandomTreeAndQueue(infos: TreeInfo[]): {
48
56
  *
49
57
  * @returns A pseudo-randomly selected tree info
50
58
  */
51
- export declare function selectStateTreeInfo(infos: TreeInfo[], treeType?: TreeType, useMaxConcurrency?: boolean): TreeInfo;
59
+ export declare function selectStateTreeInfo(
60
+ infos: TreeInfo[],
61
+ treeType?: TreeType,
62
+ useMaxConcurrency?: boolean,
63
+ ): TreeInfo;
52
64
  /**
53
65
  * Get active state tree infos from LUTs.
54
66
  *
@@ -57,7 +69,10 @@ export declare function selectStateTreeInfo(infos: TreeInfo[], treeType?: TreeTy
57
69
  *
58
70
  * @returns The active state tree infos
59
71
  */
60
- export declare function getAllStateTreeInfos({ connection, stateTreeLUTPairs, }: {
72
+ export declare function getAllStateTreeInfos({
73
+ connection,
74
+ stateTreeLUTPairs,
75
+ }: {
61
76
  connection: Connection;
62
77
  stateTreeLUTPairs: StateTreeLUTPair[];
63
78
  }): Promise<TreeInfo[]>;
@@ -8,11 +8,15 @@ export declare class PackedAccounts {
8
8
  * Create PackedAccounts with system accounts pre-added.
9
9
  * Auto-selects V1 or V2 account layout based on featureFlags.
10
10
  */
11
- static newWithSystemAccounts(config: SystemAccountMetaConfig): PackedAccounts;
11
+ static newWithSystemAccounts(
12
+ config: SystemAccountMetaConfig,
13
+ ): PackedAccounts;
12
14
  /**
13
15
  * @deprecated Use newWithSystemAccounts - it auto-selects V2 when appropriate.
14
16
  */
15
- static newWithSystemAccountsV2(config: SystemAccountMetaConfig): PackedAccounts;
17
+ static newWithSystemAccountsV2(
18
+ config: SystemAccountMetaConfig,
19
+ ): PackedAccounts;
16
20
  addPreAccountsSigner(pubkey: PublicKey): void;
17
21
  addPreAccountsSignerMut(pubkey: PublicKey): void;
18
22
  addPreAccountsMeta(accountMeta: AccountMeta): void;
@@ -26,7 +30,11 @@ export declare class PackedAccounts {
26
30
  addSystemAccountsV2(config: SystemAccountMetaConfig): void;
27
31
  insertOrGet(pubkey: PublicKey): number;
28
32
  insertOrGetReadOnly(pubkey: PublicKey): number;
29
- insertOrGetConfig(pubkey: PublicKey, isSigner: boolean, isWritable: boolean): number;
33
+ insertOrGetConfig(
34
+ pubkey: PublicKey,
35
+ isSigner: boolean,
36
+ isWritable: boolean,
37
+ ): number;
30
38
  private hashSetAccountsToMetas;
31
39
  private getOffsets;
32
40
  toAccountMetas(): {
@@ -42,14 +50,23 @@ export declare class SystemAccountMetaConfig {
42
50
  solPoolPda?: PublicKey;
43
51
  private constructor();
44
52
  static new(selfProgram: PublicKey): SystemAccountMetaConfig;
45
- static newWithCpiContext(selfProgram: PublicKey, cpiContext: PublicKey): SystemAccountMetaConfig;
53
+ static newWithCpiContext(
54
+ selfProgram: PublicKey,
55
+ cpiContext: PublicKey,
56
+ ): SystemAccountMetaConfig;
46
57
  }
47
58
  /**
48
59
  * @deprecated V1 system account layout. Use getLightSystemAccountMetas which auto-selects.
49
60
  */
50
- export declare function getLightSystemAccountMetasLegacy(config: SystemAccountMetaConfig): AccountMeta[];
61
+ export declare function getLightSystemAccountMetasLegacy(
62
+ config: SystemAccountMetaConfig,
63
+ ): AccountMeta[];
51
64
  /**
52
65
  * Get Light system account metas. Auto-selects V1 or V2 layout based on featureFlags.
53
66
  */
54
- export declare function getLightSystemAccountMetas(config: SystemAccountMetaConfig): AccountMeta[];
55
- export declare function getLightSystemAccountMetasV2(config: SystemAccountMetaConfig): AccountMeta[];
67
+ export declare function getLightSystemAccountMetas(
68
+ config: SystemAccountMetaConfig,
69
+ ): AccountMeta[];
70
+ export declare function getLightSystemAccountMetasV2(
71
+ config: SystemAccountMetaConfig,
72
+ ): AccountMeta[];