@lightprotocol/stateless.js 0.23.0-beta.4 → 0.23.0-beta.5

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 (113) hide show
  1. package/dist/cjs/browser/actions/compress.d.ts +2 -14
  2. package/dist/cjs/browser/actions/create-account.d.ts +3 -25
  3. package/dist/cjs/browser/actions/decompress.d.ts +2 -13
  4. package/dist/cjs/browser/actions/transfer.d.ts +2 -14
  5. package/dist/cjs/browser/constants.d.ts +35 -67
  6. package/dist/cjs/browser/errors.d.ts +49 -40
  7. package/dist/cjs/browser/index.cjs +1 -11151
  8. package/dist/cjs/browser/programs/system/idl.d.ts +44 -44
  9. package/dist/cjs/browser/programs/system/layout.d.ts +26 -50
  10. package/dist/cjs/browser/programs/system/pack.d.ts +7 -36
  11. package/dist/cjs/browser/programs/system/program.d.ts +9 -56
  12. package/dist/cjs/browser/programs/system/select-compressed-accounts.d.ts +1 -4
  13. package/dist/cjs/browser/rpc-interface.d.ts +2246 -2938
  14. package/dist/cjs/browser/rpc.d.ts +39 -198
  15. package/dist/cjs/browser/state/BN254.d.ts +1 -4
  16. package/dist/cjs/browser/state/bn.d.ts +1 -5
  17. package/dist/cjs/browser/state/compressed-account.d.ts +14 -42
  18. package/dist/cjs/browser/state/types.d.ts +2 -5
  19. package/dist/cjs/browser/test-helpers/merkle-tree/indexed-array.d.ts +4 -18
  20. package/dist/cjs/browser/test-helpers/merkle-tree/merkle-tree.d.ts +6 -19
  21. package/dist/cjs/browser/test-helpers/test-rpc/get-compressed-accounts.d.ts +3 -12
  22. package/dist/cjs/browser/test-helpers/test-rpc/get-compressed-token-accounts.d.ts +5 -22
  23. package/dist/cjs/browser/test-helpers/test-rpc/get-parsed-events.d.ts +4 -14
  24. package/dist/cjs/browser/test-helpers/test-rpc/test-rpc.d.ts +35 -155
  25. package/dist/cjs/browser/test-helpers/test-utils.d.ts +1 -5
  26. package/dist/cjs/browser/utils/address.d.ts +6 -26
  27. package/dist/cjs/browser/utils/airdrop.d.ts +2 -14
  28. package/dist/cjs/browser/utils/calculate-compute-unit-price.d.ts +1 -4
  29. package/dist/cjs/browser/utils/conversion.d.ts +4 -12
  30. package/dist/cjs/browser/utils/dedupe-signer.d.ts +1 -4
  31. package/dist/cjs/browser/utils/get-state-tree-infos.d.ts +5 -20
  32. package/dist/cjs/browser/utils/instruction.d.ts +7 -24
  33. package/dist/cjs/browser/utils/pack-decompress.d.ts +4 -9
  34. package/dist/cjs/browser/utils/pipe.d.ts +1 -4
  35. package/dist/cjs/browser/utils/send-and-confirm.d.ts +11 -42
  36. package/dist/cjs/browser/utils/state-tree-lookup-table.d.ts +3 -23
  37. package/dist/cjs/browser/utils/validation.d.ts +6 -24
  38. package/dist/cjs/node/actions/compress.d.ts +2 -14
  39. package/dist/cjs/node/actions/create-account.d.ts +3 -25
  40. package/dist/cjs/node/actions/decompress.d.ts +2 -13
  41. package/dist/cjs/node/actions/transfer.d.ts +2 -14
  42. package/dist/cjs/node/constants.d.ts +35 -67
  43. package/dist/cjs/node/errors.d.ts +49 -40
  44. package/dist/cjs/node/index.cjs +1 -9853
  45. package/dist/cjs/node/programs/system/idl.d.ts +44 -44
  46. package/dist/cjs/node/programs/system/layout.d.ts +26 -50
  47. package/dist/cjs/node/programs/system/pack.d.ts +7 -36
  48. package/dist/cjs/node/programs/system/program.d.ts +9 -56
  49. package/dist/cjs/node/programs/system/select-compressed-accounts.d.ts +1 -4
  50. package/dist/cjs/node/rpc-interface.d.ts +2246 -2938
  51. package/dist/cjs/node/rpc.d.ts +39 -198
  52. package/dist/cjs/node/state/BN254.d.ts +1 -4
  53. package/dist/cjs/node/state/bn.d.ts +1 -5
  54. package/dist/cjs/node/state/compressed-account.d.ts +14 -42
  55. package/dist/cjs/node/state/types.d.ts +2 -5
  56. package/dist/cjs/node/test-helpers/merkle-tree/indexed-array.d.ts +4 -18
  57. package/dist/cjs/node/test-helpers/merkle-tree/merkle-tree.d.ts +6 -19
  58. package/dist/cjs/node/test-helpers/test-rpc/get-compressed-accounts.d.ts +3 -12
  59. package/dist/cjs/node/test-helpers/test-rpc/get-compressed-token-accounts.d.ts +5 -22
  60. package/dist/cjs/node/test-helpers/test-rpc/get-parsed-events.d.ts +4 -14
  61. package/dist/cjs/node/test-helpers/test-rpc/test-rpc.d.ts +35 -155
  62. package/dist/cjs/node/test-helpers/test-utils.d.ts +1 -5
  63. package/dist/cjs/node/utils/address.d.ts +6 -26
  64. package/dist/cjs/node/utils/airdrop.d.ts +2 -14
  65. package/dist/cjs/node/utils/calculate-compute-unit-price.d.ts +1 -4
  66. package/dist/cjs/node/utils/conversion.d.ts +4 -12
  67. package/dist/cjs/node/utils/dedupe-signer.d.ts +1 -4
  68. package/dist/cjs/node/utils/get-state-tree-infos.d.ts +5 -20
  69. package/dist/cjs/node/utils/instruction.d.ts +7 -24
  70. package/dist/cjs/node/utils/pack-decompress.d.ts +4 -9
  71. package/dist/cjs/node/utils/pipe.d.ts +1 -4
  72. package/dist/cjs/node/utils/send-and-confirm.d.ts +11 -42
  73. package/dist/cjs/node/utils/state-tree-lookup-table.d.ts +3 -23
  74. package/dist/cjs/node/utils/validation.d.ts +6 -24
  75. package/dist/es/browser/actions/compress.d.ts +2 -14
  76. package/dist/es/browser/actions/create-account.d.ts +3 -25
  77. package/dist/es/browser/actions/decompress.d.ts +2 -13
  78. package/dist/es/browser/actions/transfer.d.ts +2 -14
  79. package/dist/es/browser/constants.d.ts +35 -67
  80. package/dist/es/browser/errors.d.ts +49 -40
  81. package/dist/es/browser/index.js +1 -11159
  82. package/dist/es/browser/programs/system/idl.d.ts +44 -44
  83. package/dist/es/browser/programs/system/layout.d.ts +26 -50
  84. package/dist/es/browser/programs/system/pack.d.ts +7 -36
  85. package/dist/es/browser/programs/system/program.d.ts +9 -56
  86. package/dist/es/browser/programs/system/select-compressed-accounts.d.ts +1 -4
  87. package/dist/es/browser/rpc-interface.d.ts +2246 -2938
  88. package/dist/es/browser/rpc.d.ts +39 -198
  89. package/dist/es/browser/state/BN254.d.ts +1 -4
  90. package/dist/es/browser/state/bn.d.ts +1 -5
  91. package/dist/es/browser/state/compressed-account.d.ts +14 -42
  92. package/dist/es/browser/state/types.d.ts +2 -5
  93. package/dist/es/browser/test-helpers/merkle-tree/indexed-array.d.ts +4 -18
  94. package/dist/es/browser/test-helpers/merkle-tree/merkle-tree.d.ts +6 -19
  95. package/dist/es/browser/test-helpers/test-rpc/get-compressed-accounts.d.ts +3 -12
  96. package/dist/es/browser/test-helpers/test-rpc/get-compressed-token-accounts.d.ts +5 -22
  97. package/dist/es/browser/test-helpers/test-rpc/get-parsed-events.d.ts +4 -14
  98. package/dist/es/browser/test-helpers/test-rpc/test-rpc.d.ts +35 -155
  99. package/dist/es/browser/test-helpers/test-utils.d.ts +1 -5
  100. package/dist/es/browser/utils/address.d.ts +6 -26
  101. package/dist/es/browser/utils/airdrop.d.ts +2 -14
  102. package/dist/es/browser/utils/calculate-compute-unit-price.d.ts +1 -4
  103. package/dist/es/browser/utils/conversion.d.ts +4 -12
  104. package/dist/es/browser/utils/dedupe-signer.d.ts +1 -4
  105. package/dist/es/browser/utils/get-state-tree-infos.d.ts +5 -20
  106. package/dist/es/browser/utils/instruction.d.ts +7 -24
  107. package/dist/es/browser/utils/pack-decompress.d.ts +4 -9
  108. package/dist/es/browser/utils/pipe.d.ts +1 -4
  109. package/dist/es/browser/utils/send-and-confirm.d.ts +11 -42
  110. package/dist/es/browser/utils/state-tree-lookup-table.d.ts +3 -23
  111. package/dist/es/browser/utils/validation.d.ts +6 -24
  112. package/dist/types/index.d.ts +2546 -4139
  113. package/package.json +1 -1
@@ -1,56 +1,13 @@
1
- import {
2
- AccountInfo,
3
- Commitment,
4
- Connection,
5
- ConnectionConfig,
6
- GetAccountInfoConfig,
7
- PublicKey,
8
- SignaturesForAddressOptions,
9
- } from '@solana/web3.js';
1
+ import { AccountInfo, Commitment, Connection, ConnectionConfig, GetAccountInfoConfig, PublicKey, SignaturesForAddressOptions } from '@solana/web3.js';
10
2
  import { Buffer } from 'buffer';
11
- import {
12
- ValidityProofWithContext,
13
- CompressedTransaction,
14
- CompressionApiInterface,
15
- GetCompressedTokenAccountsByOwnerOrDelegateOptions,
16
- HexInputsForProver,
17
- ParsedTokenAccount,
18
- SignatureWithMetadata,
19
- LatestNonVotingSignatures,
20
- LatestNonVotingSignaturesPaginated,
21
- WithContext,
22
- GetCompressedAccountsByOwnerConfig,
23
- WithCursor,
24
- AddressWithTree,
25
- HashWithTree,
26
- CompressedMintTokenHolders,
27
- TokenBalance,
28
- PaginatedOptions,
29
- DerivationMode,
30
- AddressWithTreeInfoV2,
31
- SignaturesForAddressInterfaceResult,
32
- UnifiedSignatureInfo,
33
- UnifiedTokenBalance,
34
- UnifiedBalance,
35
- } from './rpc-interface';
36
- import {
37
- MerkleContextWithMerkleProof,
38
- BN254,
39
- CompressedAccountWithMerkleContext,
40
- ValidityProof,
41
- AddressTreeInfo,
42
- MerkleContext,
43
- } from './state';
3
+ import { ValidityProofWithContext, CompressedTransaction, CompressionApiInterface, GetCompressedTokenAccountsByOwnerOrDelegateOptions, HexInputsForProver, ParsedTokenAccount, SignatureWithMetadata, LatestNonVotingSignatures, LatestNonVotingSignaturesPaginated, WithContext, GetCompressedAccountsByOwnerConfig, WithCursor, AddressWithTree, HashWithTree, CompressedMintTokenHolders, TokenBalance, PaginatedOptions, DerivationMode, AddressWithTreeInfoV2, SignaturesForAddressInterfaceResult, UnifiedSignatureInfo, UnifiedTokenBalance, UnifiedBalance } from './rpc-interface';
4
+ import { MerkleContextWithMerkleProof, BN254, CompressedAccountWithMerkleContext, ValidityProof, AddressTreeInfo, MerkleContext } from './state';
44
5
  import BN from 'bn.js';
45
6
  import { ConfirmedSignatureInfo } from '@solana/web3.js';
46
7
  import { LightWasm } from './test-helpers';
47
8
  import { TreeInfo } from './state/types';
48
9
  /** @internal */
49
- export declare function parseAccountData({
50
- discriminator,
51
- data,
52
- dataHash,
53
- }: {
10
+ export declare function parseAccountData({ discriminator, data, dataHash, }: {
54
11
  discriminator: BN;
55
12
  data: string;
56
13
  dataHash: BN;
@@ -69,12 +26,7 @@ export declare function parseAccountData({
69
26
  * to endpoint
70
27
  * @param connectionConfig Optional connection config
71
28
  */
72
- export declare function createRpc(
73
- endpointOrWeb3JsConnection?: string | Connection,
74
- compressionApiEndpoint?: string,
75
- proverEndpoint?: string,
76
- config?: ConnectionConfig,
77
- ): Rpc;
29
+ export declare function createRpc(endpointOrWeb3JsConnection?: string | Connection, compressionApiEndpoint?: string, proverEndpoint?: string, config?: ConnectionConfig): Rpc;
78
30
  /**
79
31
  * Helper function to preprocess the response to wrap numbers as strings
80
32
  * @param {string} text - The JSON string to preprocess
@@ -82,21 +34,9 @@ export declare function createRpc(
82
34
  */
83
35
  export declare function wrapBigNumbersAsStrings(text: string): string;
84
36
  /** @internal */
85
- export declare const rpcRequest: (
86
- rpcEndpoint: string,
87
- method: string,
88
- params?: any,
89
- convertToCamelCase?: boolean,
90
- debug?: boolean,
91
- ) => Promise<any>;
37
+ export declare const rpcRequest: (rpcEndpoint: string, method: string, params?: any, convertToCamelCase?: boolean, debug?: boolean) => Promise<any>;
92
38
  /** @internal */
93
- export declare const proverRequest: (
94
- proverEndpoint: string,
95
- method: 'inclusion' | 'new-address' | 'combined',
96
- params?: any,
97
- log?: boolean,
98
- _publicInputHash?: BN | undefined,
99
- ) => Promise<ValidityProof>;
39
+ export declare const proverRequest: (proverEndpoint: string, method: "inclusion" | "new-address" | "combined", params?: any, log?: boolean, _publicInputHash?: BN | undefined) => Promise<ValidityProof>;
100
40
  export type NonInclusionMerkleProofInputs = {
101
41
  root: BN;
102
42
  value: BN;
@@ -126,18 +66,9 @@ export type NonInclusionJsonStruct = {
126
66
  leafHigherRangeValue: string;
127
67
  nextIndex: number;
128
68
  };
129
- export declare function convertMerkleProofsWithContextToHex(
130
- merkleProofsWithContext: MerkleContextWithMerkleProof[],
131
- ): HexInputsForProver[];
132
- export declare function convertNonInclusionMerkleProofInputsToHex(
133
- nonInclusionMerkleProofInputs: MerkleContextWithNewAddressProof[],
134
- ): NonInclusionJsonStruct[];
135
- export declare function getPublicInputHash(
136
- accountProofs: MerkleContextWithMerkleProof[],
137
- accountHashes: BN254[],
138
- newAddressProofs: MerkleContextWithNewAddressProof[],
139
- lightWasm: LightWasm,
140
- ): BN;
69
+ export declare function convertMerkleProofsWithContextToHex(merkleProofsWithContext: MerkleContextWithMerkleProof[]): HexInputsForProver[];
70
+ export declare function convertNonInclusionMerkleProofInputsToHex(nonInclusionMerkleProofInputs: MerkleContextWithNewAddressProof[]): NonInclusionJsonStruct[];
71
+ export declare function getPublicInputHash(accountProofs: MerkleContextWithMerkleProof[], accountHashes: BN254[], newAddressProofs: MerkleContextWithNewAddressProof[], lightWasm: LightWasm): BN;
141
72
  export interface NullifierMetadata {
142
73
  nullifier: BN254;
143
74
  txHash: BN254;
@@ -147,10 +78,7 @@ export interface NullifierMetadata {
147
78
  * Deduplicates by signature, tracking sources in the `sources` array.
148
79
  * When a signature exists in both, uses Solana data (richer) but marks both sources.
149
80
  */
150
- export declare function mergeSignatures(
151
- solanaSignatures: ConfirmedSignatureInfo[],
152
- compressedSignatures: SignatureWithMetadata[],
153
- ): UnifiedSignatureInfo[];
81
+ export declare function mergeSignatures(solanaSignatures: ConfirmedSignatureInfo[], compressedSignatures: SignatureWithMetadata[]): UnifiedSignatureInfo[];
154
82
  /**
155
83
  *
156
84
  */
@@ -161,12 +89,7 @@ export declare class Rpc extends Connection implements CompressionApiInterface {
161
89
  lastStateTreeFetchTime: number | null;
162
90
  CACHE_TTL: number;
163
91
  fetchPromise: Promise<TreeInfo[]> | null;
164
- constructor(
165
- endpoint: string,
166
- compressionApiEndpoint: string,
167
- proverEndpoint: string,
168
- config?: ConnectionConfig,
169
- );
92
+ constructor(endpoint: string, compressionApiEndpoint: string, proverEndpoint: string, config?: ConnectionConfig);
170
93
  /**
171
94
  * @deprecated Use {@link getStateTreeInfos} instead
172
95
  */
@@ -192,10 +115,7 @@ export declare class Rpc extends Connection implements CompressionApiInterface {
192
115
  /**
193
116
  * Fetch the compressed account for the specified account address or hash
194
117
  */
195
- getCompressedAccount(
196
- address?: BN254,
197
- hash?: BN254,
198
- ): Promise<CompressedAccountWithMerkleContext | null>;
118
+ getCompressedAccount(address?: BN254, hash?: BN254): Promise<CompressedAccountWithMerkleContext | null>;
199
119
  /**
200
120
  * Fetch the compressed balance for the specified account address or hash
201
121
  */
@@ -208,46 +128,31 @@ export declare class Rpc extends Connection implements CompressionApiInterface {
208
128
  * Fetch the latest merkle proof for the specified account hash from the
209
129
  * cluster
210
130
  */
211
- getCompressedAccountProof(
212
- hash: BN254,
213
- ): Promise<MerkleContextWithMerkleProof>;
131
+ getCompressedAccountProof(hash: BN254): Promise<MerkleContextWithMerkleProof>;
214
132
  /**
215
133
  * Fetch all the account info for multiple compressed accounts specified by
216
134
  * an array of account hashes
217
135
  */
218
- getMultipleCompressedAccounts(
219
- hashes: BN254[],
220
- ): Promise<CompressedAccountWithMerkleContext[]>;
136
+ getMultipleCompressedAccounts(hashes: BN254[]): Promise<CompressedAccountWithMerkleContext[]>;
221
137
  /**
222
138
  * Fetch the latest merkle proofs for multiple compressed accounts specified
223
139
  * by an array account hashes
224
140
  */
225
- getMultipleCompressedAccountProofs(
226
- hashes: BN254[],
227
- ): Promise<MerkleContextWithMerkleProof[]>;
141
+ getMultipleCompressedAccountProofs(hashes: BN254[]): Promise<MerkleContextWithMerkleProof[]>;
228
142
  /**
229
143
  * Fetch all the compressed accounts owned by the specified public key.
230
144
  * Owner can be a program or user account
231
145
  */
232
- getCompressedAccountsByOwner(
233
- owner: PublicKey,
234
- config?: GetCompressedAccountsByOwnerConfig | undefined,
235
- ): Promise<WithCursor<CompressedAccountWithMerkleContext[]>>;
146
+ getCompressedAccountsByOwner(owner: PublicKey, config?: GetCompressedAccountsByOwnerConfig | undefined): Promise<WithCursor<CompressedAccountWithMerkleContext[]>>;
236
147
  /**
237
148
  * Fetch all the compressed token accounts owned by the specified public
238
149
  * key. Owner can be a program or user account
239
150
  */
240
- getCompressedTokenAccountsByOwner(
241
- owner: PublicKey,
242
- options?: GetCompressedTokenAccountsByOwnerOrDelegateOptions,
243
- ): Promise<WithCursor<ParsedTokenAccount[]>>;
151
+ getCompressedTokenAccountsByOwner(owner: PublicKey, options?: GetCompressedTokenAccountsByOwnerOrDelegateOptions): Promise<WithCursor<ParsedTokenAccount[]>>;
244
152
  /**
245
153
  * Fetch all the compressed accounts delegated to the specified public key.
246
154
  */
247
- getCompressedTokenAccountsByDelegate(
248
- delegate: PublicKey,
249
- options?: GetCompressedTokenAccountsByOwnerOrDelegateOptions,
250
- ): Promise<WithCursor<ParsedTokenAccount[]>>;
155
+ getCompressedTokenAccountsByDelegate(delegate: PublicKey, options?: GetCompressedTokenAccountsByOwnerOrDelegateOptions): Promise<WithCursor<ParsedTokenAccount[]>>;
251
156
  /**
252
157
  * Fetch the compressed token balance for the specified account hash
253
158
  */
@@ -260,18 +165,12 @@ export declare class Rpc extends Connection implements CompressionApiInterface {
260
165
  * Fetch all the compressed token balances owned by the specified public
261
166
  * key. Can filter by mint. Returns without context.
262
167
  */
263
- getCompressedTokenBalancesByOwner(
264
- owner: PublicKey,
265
- options?: GetCompressedTokenAccountsByOwnerOrDelegateOptions,
266
- ): Promise<WithCursor<TokenBalance[]>>;
168
+ getCompressedTokenBalancesByOwner(owner: PublicKey, options?: GetCompressedTokenAccountsByOwnerOrDelegateOptions): Promise<WithCursor<TokenBalance[]>>;
267
169
  /**
268
170
  * Fetch the compressed token balances owned by the specified public
269
171
  * key. Paginated. Can filter by mint. Returns with context.
270
172
  */
271
- getCompressedTokenBalancesByOwnerV2(
272
- owner: PublicKey,
273
- options?: GetCompressedTokenAccountsByOwnerOrDelegateOptions,
274
- ): Promise<WithContext<WithCursor<TokenBalance[]>>>;
173
+ getCompressedTokenBalancesByOwnerV2(owner: PublicKey, options?: GetCompressedTokenAccountsByOwnerOrDelegateOptions): Promise<WithContext<WithCursor<TokenBalance[]>>>;
275
174
  /**
276
175
  * Returns confirmed compression signatures for transactions involving the specified
277
176
  * account hash forward in time from genesis to the most recent confirmed
@@ -279,26 +178,19 @@ export declare class Rpc extends Connection implements CompressionApiInterface {
279
178
  *
280
179
  * @param hash queried account hash
281
180
  */
282
- getCompressionSignaturesForAccount(
283
- hash: BN254,
284
- ): Promise<SignatureWithMetadata[]>;
181
+ getCompressionSignaturesForAccount(hash: BN254): Promise<SignatureWithMetadata[]>;
285
182
  /**
286
183
  * Fetch a confirmed or finalized transaction from the cluster. Return with
287
184
  * CompressionInfo
288
185
  */
289
- getTransactionWithCompressionInfo(
290
- signature: string,
291
- ): Promise<CompressedTransaction | null>;
186
+ getTransactionWithCompressionInfo(signature: string): Promise<CompressedTransaction | null>;
292
187
  /**
293
188
  * Returns confirmed signatures for transactions involving the specified
294
189
  * address forward in time from genesis to the most recent confirmed block
295
190
  *
296
191
  * @param address queried compressed account address
297
192
  */
298
- getCompressionSignaturesForAddress(
299
- address: PublicKey,
300
- options?: PaginatedOptions,
301
- ): Promise<WithCursor<SignatureWithMetadata[]>>;
193
+ getCompressionSignaturesForAddress(address: PublicKey, options?: PaginatedOptions): Promise<WithCursor<SignatureWithMetadata[]>>;
302
194
  /**
303
195
  * Returns confirmed signatures for compression transactions involving the
304
196
  * specified account owner forward in time from genesis to the
@@ -306,19 +198,13 @@ export declare class Rpc extends Connection implements CompressionApiInterface {
306
198
  *
307
199
  * @param owner queried owner public key
308
200
  */
309
- getCompressionSignaturesForOwner(
310
- owner: PublicKey,
311
- options?: PaginatedOptions,
312
- ): Promise<WithCursor<SignatureWithMetadata[]>>;
201
+ getCompressionSignaturesForOwner(owner: PublicKey, options?: PaginatedOptions): Promise<WithCursor<SignatureWithMetadata[]>>;
313
202
  /**
314
203
  * Returns confirmed signatures for compression transactions involving the
315
204
  * specified token account owner forward in time from genesis to the most
316
205
  * recent confirmed block
317
206
  */
318
- getCompressionSignaturesForTokenOwner(
319
- owner: PublicKey,
320
- options?: PaginatedOptions,
321
- ): Promise<WithCursor<SignatureWithMetadata[]>>;
207
+ getCompressionSignaturesForTokenOwner(owner: PublicKey, options?: PaginatedOptions): Promise<WithCursor<SignatureWithMetadata[]>>;
322
208
  /**
323
209
  * Fetch the current indexer health status
324
210
  */
@@ -334,25 +220,16 @@ export declare class Rpc extends Connection implements CompressionApiInterface {
334
220
  /**
335
221
  * Fetch all the compressed token holders for a given mint. Paginated.
336
222
  */
337
- getCompressedMintTokenHolders(
338
- mint: PublicKey,
339
- options?: PaginatedOptions,
340
- ): Promise<WithContext<WithCursor<CompressedMintTokenHolders[]>>>;
223
+ getCompressedMintTokenHolders(mint: PublicKey, options?: PaginatedOptions): Promise<WithContext<WithCursor<CompressedMintTokenHolders[]>>>;
341
224
  /**
342
225
  * Fetch the latest compression signatures on the cluster. Results are
343
226
  * paginated.
344
227
  */
345
- getLatestCompressionSignatures(
346
- cursor?: string,
347
- limit?: number,
348
- ): Promise<LatestNonVotingSignaturesPaginated>;
228
+ getLatestCompressionSignatures(cursor?: string, limit?: number): Promise<LatestNonVotingSignaturesPaginated>;
349
229
  /**
350
230
  * Fetch all non-voting signatures
351
231
  */
352
- getLatestNonVotingSignatures(
353
- limit?: number,
354
- cursor?: string,
355
- ): Promise<LatestNonVotingSignatures>;
232
+ getLatestNonVotingSignatures(limit?: number, cursor?: string): Promise<LatestNonVotingSignatures>;
356
233
  /**
357
234
  * Fetch the latest address proofs for new unique addresses specified by an
358
235
  * array of addresses.
@@ -362,9 +239,7 @@ export declare class Rpc extends Connection implements CompressionApiInterface {
362
239
  * @param addresses Array of BN254 new addresses
363
240
  * @returns Array of validity proofs for new addresses
364
241
  */
365
- getMultipleNewAddressProofs(
366
- addresses: BN254[],
367
- ): Promise<MerkleContextWithNewAddressProof[]>;
242
+ getMultipleNewAddressProofs(addresses: BN254[]): Promise<MerkleContextWithNewAddressProof[]>;
368
243
  /**
369
244
  * @deprecated use {@link getValidityProofV0} instead.
370
245
  *
@@ -381,10 +256,7 @@ export declare class Rpc extends Connection implements CompressionApiInterface {
381
256
  * @param newAddresses Array of BN254 new addresses.
382
257
  * @returns validity proof with context
383
258
  */
384
- getValidityProof(
385
- hashes?: BN254[],
386
- newAddresses?: BN254[],
387
- ): Promise<ValidityProofWithContext>;
259
+ getValidityProof(hashes?: BN254[], newAddresses?: BN254[]): Promise<ValidityProofWithContext>;
388
260
  /**
389
261
  * Fetch the latest validity proof for (1) compressed accounts specified by
390
262
  * an array of account hashes. (2) new unique addresses specified by an
@@ -399,10 +271,7 @@ export declare class Rpc extends Connection implements CompressionApiInterface {
399
271
  * @param newAddresses Array of { address: BN254, tree: PublicKey, queue: PublicKey }.
400
272
  * @returns validity proof with context
401
273
  */
402
- getValidityProofV0(
403
- hashes?: HashWithTree[],
404
- newAddresses?: AddressWithTree[],
405
- ): Promise<ValidityProofWithContext>;
274
+ getValidityProofV0(hashes?: HashWithTree[], newAddresses?: AddressWithTree[]): Promise<ValidityProofWithContext>;
406
275
  /**
407
276
  * Fetch the latest validity proof for (1) compressed accounts specified by
408
277
  * an array of account Merkle contexts, and (2) new unique addresses specified by
@@ -413,11 +282,7 @@ export declare class Rpc extends Connection implements CompressionApiInterface {
413
282
  * enable verification without recomputing the merkle proof path, thus
414
283
  * lowering verification and data costs.
415
284
  */
416
- getValidityProofV2(
417
- accountMerkleContexts?: (MerkleContext | undefined)[],
418
- newAddresses?: AddressWithTreeInfoV2[],
419
- derivationMode?: DerivationMode,
420
- ): Promise<ValidityProofWithContext>;
285
+ getValidityProofV2(accountMerkleContexts?: (MerkleContext | undefined)[], newAddresses?: AddressWithTreeInfoV2[], derivationMode?: DerivationMode): Promise<ValidityProofWithContext>;
421
286
  /**
422
287
  * Fetch the latest validity proof for (1) compressed accounts specified by
423
288
  * an array of account hashes. (2) new unique addresses specified by an
@@ -434,10 +299,7 @@ export declare class Rpc extends Connection implements CompressionApiInterface {
434
299
  * state tree/queue.
435
300
  * @returns validity proof with context
436
301
  */
437
- getValidityProofAndRpcContext(
438
- hashes?: HashWithTree[],
439
- newAddresses?: AddressWithTree[],
440
- ): Promise<WithContext<ValidityProofWithContext>>;
302
+ getValidityProofAndRpcContext(hashes?: HashWithTree[], newAddresses?: AddressWithTree[]): Promise<WithContext<ValidityProofWithContext>>;
441
303
  /**
442
304
  * Fetch the account info for the specified public key. Returns metadata
443
305
  * to load in case the account is cold.
@@ -455,12 +317,7 @@ export declare class Rpc extends Connection implements CompressionApiInterface {
455
317
  * if true the account must referenced in a
456
318
  * load instruction before use.
457
319
  */
458
- getAccountInfoInterface(
459
- address: PublicKey,
460
- programId: PublicKey,
461
- commitmentOrConfig?: Commitment | GetAccountInfoConfig,
462
- addressSpace?: TreeInfo,
463
- ): Promise<{
320
+ getAccountInfoInterface(address: PublicKey, programId: PublicKey, commitmentOrConfig?: Commitment | GetAccountInfoConfig, addressSpace?: TreeInfo): Promise<{
464
321
  accountInfo: AccountInfo<Buffer>;
465
322
  isCold: boolean;
466
323
  loadContext?: MerkleContext;
@@ -473,11 +330,7 @@ export declare class Rpc extends Connection implements CompressionApiInterface {
473
330
  * @param compressedOptions Options for the compression getCompressionSignaturesForAddress call.
474
331
  * @returns Unified signatures from both sources.
475
332
  */
476
- getSignaturesForAddressInterface(
477
- address: PublicKey,
478
- options?: SignaturesForAddressOptions,
479
- compressedOptions?: PaginatedOptions,
480
- ): Promise<SignaturesForAddressInterfaceResult>;
333
+ getSignaturesForAddressInterface(address: PublicKey, options?: SignaturesForAddressOptions, compressedOptions?: PaginatedOptions): Promise<SignaturesForAddressInterfaceResult>;
481
334
  /**
482
335
  * Get signatures for an owner from both Solana and compression indexer.
483
336
  *
@@ -486,11 +339,7 @@ export declare class Rpc extends Connection implements CompressionApiInterface {
486
339
  * @param compressedOptions Options for the compression getCompressionSignaturesForOwner call.
487
340
  * @returns Unified signatures from both sources.
488
341
  */
489
- getSignaturesForOwnerInterface(
490
- owner: PublicKey,
491
- options?: SignaturesForAddressOptions,
492
- compressedOptions?: PaginatedOptions,
493
- ): Promise<SignaturesForAddressInterfaceResult>;
342
+ getSignaturesForOwnerInterface(owner: PublicKey, options?: SignaturesForAddressOptions, compressedOptions?: PaginatedOptions): Promise<SignaturesForAddressInterfaceResult>;
494
343
  /**
495
344
  * Get token account balance for an address, regardless of whether the token
496
345
  * account is hot or cold.
@@ -501,12 +350,7 @@ export declare class Rpc extends Connection implements CompressionApiInterface {
501
350
  * @param commitment Commitment level for on-chain query.
502
351
  * @returns Unified token balance from both sources.
503
352
  */
504
- getTokenAccountBalanceInterface(
505
- address: PublicKey,
506
- owner: PublicKey,
507
- mint: PublicKey,
508
- commitment?: Commitment,
509
- ): Promise<UnifiedTokenBalance>;
353
+ getTokenAccountBalanceInterface(address: PublicKey, owner: PublicKey, mint: PublicKey, commitment?: Commitment): Promise<UnifiedTokenBalance>;
510
354
  /**
511
355
  * Get SOL balance for an address, regardless of whether the account is hot or cold.
512
356
  *
@@ -514,8 +358,5 @@ export declare class Rpc extends Connection implements CompressionApiInterface {
514
358
  * @param commitment Commitment level for on-chain query.
515
359
  * @returns Unified SOL balance.
516
360
  */
517
- getBalanceInterface(
518
- address: PublicKey,
519
- commitment?: Commitment,
520
- ): Promise<UnifiedBalance>;
361
+ getBalanceInterface(address: PublicKey, commitment?: Commitment): Promise<UnifiedBalance>;
521
362
  }
@@ -8,9 +8,6 @@ import { Buffer } from 'buffer';
8
8
  */
9
9
  export type BN254 = BN;
10
10
  /** Create a bigint instance with <254-bit max size and base58 capabilities */
11
- export declare const createBN254: (
12
- number: string | number | BN | Buffer | Uint8Array | number[],
13
- base?: number | 'hex' | 'base58' | undefined,
14
- ) => BN254;
11
+ export declare const createBN254: (number: string | number | BN | Buffer | Uint8Array | number[], base?: number | "hex" | "base58" | undefined) => BN254;
15
12
  /** Convert <254-bit bigint to Base58 string. */
16
13
  export declare function encodeBN254toBase58(bigintNumber: BN): string;
@@ -1,7 +1,3 @@
1
1
  import BN from 'bn.js';
2
2
  import { Buffer } from 'buffer';
3
- export declare const bn: (
4
- number: string | number | BN | Buffer | Uint8Array | number[],
5
- base?: number | 'hex' | undefined,
6
- endian?: BN.Endianness | undefined,
7
- ) => BN;
3
+ export declare const bn: (number: string | number | BN | Buffer | Uint8Array | number[], base?: number | "hex" | undefined, endian?: BN.Endianness | undefined) => BN;
@@ -1,24 +1,17 @@
1
1
  import { PublicKey } from '@solana/web3.js';
2
- import {
3
- CompressedAccountData,
4
- CompressedAccountLegacy,
5
- PackedMerkleContextLegacy,
6
- TreeInfo,
7
- } from './types';
2
+ import { CompressedAccountData, CompressedAccountLegacy, PackedMerkleContextLegacy, TreeInfo } from './types';
8
3
  import BN from 'bn.js';
9
4
  import { BN254 } from './BN254';
10
5
  /**
11
6
  * @deprecated use {@link CompressedAccount} instead
12
7
  */
13
- export type CompressedAccountWithMerkleContext = CompressedAccount &
14
- MerkleContext & {
15
- readOnly: boolean;
16
- };
8
+ export type CompressedAccountWithMerkleContext = CompressedAccount & MerkleContext & {
9
+ readOnly: boolean;
10
+ };
17
11
  /**
18
12
  * @deprecated use {@link CompressedAccount} instead
19
13
  */
20
- export type CompressedAccountWithMerkleContextLegacy = CompressedAccount &
21
- MerkleContext;
14
+ export type CompressedAccountWithMerkleContextLegacy = CompressedAccount & MerkleContext;
22
15
  /**
23
16
  * Compressed account + metadata about the state tree in which the account is
24
17
  * stored.
@@ -41,11 +34,11 @@ export type CompressedAccount = {
41
34
  */
42
35
  data: CompressedAccountData | null;
43
36
  } & MerkleContext & {
44
- /**
45
- * Read only.
46
- */
47
- readOnly: boolean;
48
- };
37
+ /**
38
+ * Read only.
39
+ */
40
+ readOnly: boolean;
41
+ };
49
42
  /**
50
43
  * @deprecated use {@link MerkleContext} instead.
51
44
  *
@@ -175,12 +168,7 @@ export type CompressedAccountMeta = {
175
168
  * Create an output compressed account meta for a new account.
176
169
  * Client-side only.
177
170
  */
178
- export declare const createCompressedAccountMeta: (
179
- treeInfo: PackedStateTreeInfo,
180
- outputStateTreeIndex: number,
181
- address?: number[],
182
- lamports?: BN,
183
- ) => CompressedAccountMeta;
171
+ export declare const createCompressedAccountMeta: (treeInfo: PackedStateTreeInfo, outputStateTreeIndex: number, address?: number[], lamports?: BN) => CompressedAccountMeta;
184
172
  /**
185
173
  * @deprecated Use {@link PackedStateTreeInfo} instead.
186
174
  * Packed compressed account with merkle context.
@@ -206,28 +194,12 @@ export interface PackedCompressedAccountWithMerkleContext {
206
194
  /**
207
195
  * @deprecated use {@link createCompressedAccountMeta} instead.
208
196
  */
209
- export declare const createCompressedAccountLegacy: (
210
- owner: PublicKey,
211
- lamports?: BN,
212
- data?: CompressedAccountData,
213
- address?: number[],
214
- ) => CompressedAccountLegacy;
197
+ export declare const createCompressedAccountLegacy: (owner: PublicKey, lamports?: BN, data?: CompressedAccountData, address?: number[]) => CompressedAccountLegacy;
215
198
  /**
216
199
  * @deprecated.
217
200
  */
218
- export declare const createCompressedAccountWithMerkleContextLegacy: (
219
- merkleContext: MerkleContext,
220
- owner: PublicKey,
221
- lamports?: BN,
222
- data?: CompressedAccountData,
223
- address?: number[],
224
- ) => CompressedAccountWithMerkleContext;
201
+ export declare const createCompressedAccountWithMerkleContextLegacy: (merkleContext: MerkleContext, owner: PublicKey, lamports?: BN, data?: CompressedAccountData, address?: number[]) => CompressedAccountWithMerkleContext;
225
202
  /**
226
203
  * @deprecated use {@link createCompressedAccountMeta} instead.
227
204
  */
228
- export declare const createMerkleContextLegacy: (
229
- treeInfo: TreeInfo,
230
- hash: BN254,
231
- leafIndex: number,
232
- proveByIndex?: boolean,
233
- ) => MerkleContext;
205
+ export declare const createMerkleContextLegacy: (treeInfo: TreeInfo, hash: BN254, leafIndex: number, proveByIndex?: boolean) => MerkleContext;
@@ -19,7 +19,7 @@ export declare enum TreeType {
19
19
  /**
20
20
  * v2 address merkle tree
21
21
  */
22
- AddressV2 = 4,
22
+ AddressV2 = 4
23
23
  }
24
24
  /**
25
25
  * @deprecated Use {@link TreeInfo} instead.
@@ -99,10 +99,7 @@ export type TreeInfo = {
99
99
  * Address tree info, versioned via {@link TreeType}. The protocol
100
100
  * stores PDAs in address trees.
101
101
  */
102
- export type AddressTreeInfo = Omit<
103
- StateTreeInfo,
104
- 'cpiContext' | 'nextTreeInfo'
105
- > & {
102
+ export type AddressTreeInfo = Omit<StateTreeInfo, 'cpiContext' | 'nextTreeInfo'> & {
106
103
  /**
107
104
  * Next tree info.
108
105
  */
@@ -13,11 +13,7 @@ export declare class IndexedElementBundle {
13
13
  newLowElement: IndexedElement;
14
14
  newElement: IndexedElement;
15
15
  newElementNextValue: BN;
16
- constructor(
17
- newLowElement: IndexedElement,
18
- newElement: IndexedElement,
19
- newElementNextValue: BN,
20
- );
16
+ constructor(newLowElement: IndexedElement, newElement: IndexedElement, newElementNextValue: BN);
21
17
  }
22
18
  /**
23
19
  * This indexed array implementation mirrors the rust implementation of the
@@ -27,11 +23,7 @@ export declare class IndexedArray {
27
23
  elements: Array<IndexedElement>;
28
24
  currentNodeIndex: number;
29
25
  highestElementIndex: number;
30
- constructor(
31
- elements: Array<IndexedElement>,
32
- currentNodeIndex: number,
33
- highestElementIndex: number,
34
- );
26
+ constructor(elements: Array<IndexedElement>, currentNodeIndex: number, highestElementIndex: number);
35
27
  static default(): IndexedArray;
36
28
  get(index: number): IndexedElement | undefined;
37
29
  length(): number;
@@ -71,10 +63,7 @@ export declare class IndexedArray {
71
63
  * @param value The value of the new element to append.
72
64
  * @returns The new element and its updated low element.
73
65
  */
74
- appendWithLowElementIndex(
75
- lowElementIndex: number,
76
- value: BN,
77
- ): IndexedElementBundle;
66
+ appendWithLowElementIndex(lowElementIndex: number, value: BN): IndexedElementBundle;
78
67
  /**
79
68
  * Finds the lowest element in the array.
80
69
  * @returns The lowest element or undefined if the array is empty.
@@ -86,10 +75,7 @@ export declare class IndexedArray {
86
75
  * @param value The value for the new element.
87
76
  * @returns A bundle containing the new element, the updated low element, and the value of the next element.
88
77
  */
89
- newElementWithLowElementIndex(
90
- lowElementIndex: number,
91
- value: BN,
92
- ): IndexedElementBundle;
78
+ newElementWithLowElementIndex(lowElementIndex: number, value: BN): IndexedElementBundle;
93
79
  /**
94
80
  * Creates a new element with the specified value by first finding the appropriate low element index.
95
81
  * @param value The value for the new element.
@@ -1,5 +1,5 @@
1
1
  import { LightWasm } from '../test-rpc/test-rpc';
2
- export declare const DEFAULT_ZERO = '0';
2
+ export declare const DEFAULT_ZERO = "0";
3
3
  /**
4
4
  * @callback hashFunction
5
5
  * @param left Left leaf
@@ -23,16 +23,9 @@ export declare class MerkleTree {
23
23
  _zeros: string[];
24
24
  _layers: string[][];
25
25
  _lightWasm: LightWasm;
26
- constructor(
27
- levels: number,
28
- lightWasm: LightWasm,
29
- elements?: string[],
30
- {
31
- zeroElement,
32
- }?: {
33
- zeroElement?: string | undefined;
34
- },
35
- );
26
+ constructor(levels: number, lightWasm: LightWasm, elements?: string[], { zeroElement }?: {
27
+ zeroElement?: string | undefined;
28
+ });
36
29
  _rebuild(): void;
37
30
  /**
38
31
  * Get tree root
@@ -70,10 +63,7 @@ export declare class MerkleTree {
70
63
  * @param comparator A function that checks leaf value equality
71
64
  * @returns {number} Index if element is found, otherwise -1
72
65
  */
73
- indexOf(
74
- element: string,
75
- comparator?: ((element: string, el: string) => boolean) | null,
76
- ): number;
66
+ indexOf(element: string, comparator?: ((element: string, el: string) => boolean) | null): number;
77
67
  /**
78
68
  * Returns a copy of non-zero tree elements
79
69
  * @returns {Object[]}
@@ -98,8 +88,5 @@ export declare class MerkleTree {
98
88
  * @param hashFunction
99
89
  * @returns {MerkleTree}
100
90
  */
101
- static deserialize(
102
- data: any,
103
- hashFunction: (left: string, right: string) => string,
104
- ): any;
91
+ static deserialize(data: any, hashFunction: (left: string, right: string) => string): any;
105
92
  }