@lightprotocol/stateless.js 0.16.0 → 0.17.1

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/common.d.ts +1 -4
  2. package/dist/cjs/browser/actions/compress.d.ts +2 -14
  3. package/dist/cjs/browser/actions/create-account.d.ts +3 -27
  4. package/dist/cjs/browser/actions/decompress.d.ts +2 -14
  5. package/dist/cjs/browser/actions/transfer.d.ts +2 -15
  6. package/dist/cjs/browser/constants.d.ts +7 -14
  7. package/dist/cjs/browser/errors.d.ts +49 -40
  8. package/dist/cjs/browser/idls/account_compression.d.ts +56 -56
  9. package/dist/cjs/browser/idls/index.d.ts +4 -22
  10. package/dist/cjs/browser/idls/light_compressed_token.d.ts +209 -89
  11. package/dist/cjs/browser/idls/light_registry.d.ts +60 -60
  12. package/dist/cjs/browser/idls/light_system_program.d.ts +55 -55
  13. package/dist/cjs/browser/index.cjs +3223 -4792
  14. package/dist/cjs/browser/index.cjs.map +1 -1
  15. package/dist/cjs/browser/instruction/pack-compressed-accounts.d.ts +5 -24
  16. package/dist/cjs/browser/programs/system.d.ts +10 -61
  17. package/dist/cjs/browser/rpc-interface.d.ts +871 -1127
  18. package/dist/cjs/browser/rpc.d.ts +31 -143
  19. package/dist/cjs/browser/state/BN254.d.ts +2 -9
  20. package/dist/cjs/browser/state/compressed-account.d.ts +6 -23
  21. package/dist/cjs/browser/test-helpers/merkle-tree/indexed-array.d.ts +4 -18
  22. package/dist/cjs/browser/test-helpers/merkle-tree/merkle-tree.d.ts +6 -19
  23. package/dist/cjs/browser/test-helpers/test-rpc/get-compressed-accounts.d.ts +3 -12
  24. package/dist/cjs/browser/test-helpers/test-rpc/get-compressed-token-accounts.d.ts +5 -21
  25. package/dist/cjs/browser/test-helpers/test-rpc/get-parsed-events.d.ts +3 -10
  26. package/dist/cjs/browser/test-helpers/test-rpc/test-rpc.d.ts +31 -135
  27. package/dist/cjs/browser/utils/address.d.ts +3 -12
  28. package/dist/cjs/browser/utils/airdrop.d.ts +2 -14
  29. package/dist/cjs/browser/utils/calculate-compute-unit-price.d.ts +1 -4
  30. package/dist/cjs/browser/utils/conversion.d.ts +3 -9
  31. package/dist/cjs/browser/utils/parse-validity-proof.d.ts +1 -3
  32. package/dist/cjs/browser/utils/pipe.d.ts +1 -4
  33. package/dist/cjs/browser/utils/send-and-confirm.d.ts +11 -42
  34. package/dist/cjs/browser/utils/test-utils.d.ts +1 -5
  35. package/dist/cjs/browser/utils/validation.d.ts +2 -9
  36. package/dist/cjs/browser/wallet/interface.d.ts +4 -15
  37. package/dist/cjs/browser/wallet/use-wallet.d.ts +5 -20
  38. package/dist/cjs/node/actions/common.d.ts +1 -4
  39. package/dist/cjs/node/actions/compress.d.ts +2 -14
  40. package/dist/cjs/node/actions/create-account.d.ts +3 -27
  41. package/dist/cjs/node/actions/decompress.d.ts +2 -14
  42. package/dist/cjs/node/actions/transfer.d.ts +2 -15
  43. package/dist/cjs/node/constants.d.ts +7 -14
  44. package/dist/cjs/node/errors.d.ts +49 -40
  45. package/dist/cjs/node/idls/account_compression.d.ts +56 -56
  46. package/dist/cjs/node/idls/index.d.ts +4 -22
  47. package/dist/cjs/node/idls/light_compressed_token.d.ts +209 -89
  48. package/dist/cjs/node/idls/light_registry.d.ts +60 -60
  49. package/dist/cjs/node/idls/light_system_program.d.ts +55 -55
  50. package/dist/cjs/node/index.cjs +1070 -2329
  51. package/dist/cjs/node/index.cjs.map +1 -1
  52. package/dist/cjs/node/instruction/pack-compressed-accounts.d.ts +5 -24
  53. package/dist/cjs/node/programs/system.d.ts +10 -61
  54. package/dist/cjs/node/rpc-interface.d.ts +871 -1127
  55. package/dist/cjs/node/rpc.d.ts +31 -143
  56. package/dist/cjs/node/state/BN254.d.ts +2 -9
  57. package/dist/cjs/node/state/compressed-account.d.ts +6 -23
  58. package/dist/cjs/node/test-helpers/merkle-tree/indexed-array.d.ts +4 -18
  59. package/dist/cjs/node/test-helpers/merkle-tree/merkle-tree.d.ts +6 -19
  60. package/dist/cjs/node/test-helpers/test-rpc/get-compressed-accounts.d.ts +3 -12
  61. package/dist/cjs/node/test-helpers/test-rpc/get-compressed-token-accounts.d.ts +5 -21
  62. package/dist/cjs/node/test-helpers/test-rpc/get-parsed-events.d.ts +3 -10
  63. package/dist/cjs/node/test-helpers/test-rpc/test-rpc.d.ts +31 -135
  64. package/dist/cjs/node/utils/address.d.ts +3 -12
  65. package/dist/cjs/node/utils/airdrop.d.ts +2 -14
  66. package/dist/cjs/node/utils/calculate-compute-unit-price.d.ts +1 -4
  67. package/dist/cjs/node/utils/conversion.d.ts +3 -9
  68. package/dist/cjs/node/utils/parse-validity-proof.d.ts +1 -3
  69. package/dist/cjs/node/utils/pipe.d.ts +1 -4
  70. package/dist/cjs/node/utils/send-and-confirm.d.ts +11 -42
  71. package/dist/cjs/node/utils/test-utils.d.ts +1 -5
  72. package/dist/cjs/node/utils/validation.d.ts +2 -9
  73. package/dist/cjs/node/wallet/interface.d.ts +4 -15
  74. package/dist/cjs/node/wallet/use-wallet.d.ts +5 -20
  75. package/dist/es/browser/actions/common.d.ts +1 -4
  76. package/dist/es/browser/actions/compress.d.ts +2 -14
  77. package/dist/es/browser/actions/create-account.d.ts +3 -27
  78. package/dist/es/browser/actions/decompress.d.ts +2 -14
  79. package/dist/es/browser/actions/transfer.d.ts +2 -15
  80. package/dist/es/browser/constants.d.ts +7 -14
  81. package/dist/es/browser/errors.d.ts +49 -40
  82. package/dist/es/browser/idls/account_compression.d.ts +56 -56
  83. package/dist/es/browser/idls/index.d.ts +4 -22
  84. package/dist/es/browser/idls/light_compressed_token.d.ts +209 -89
  85. package/dist/es/browser/idls/light_registry.d.ts +60 -60
  86. package/dist/es/browser/idls/light_system_program.d.ts +55 -55
  87. package/dist/es/browser/index.js +3209 -4698
  88. package/dist/es/browser/index.js.map +1 -1
  89. package/dist/es/browser/instruction/pack-compressed-accounts.d.ts +5 -24
  90. package/dist/es/browser/programs/system.d.ts +10 -61
  91. package/dist/es/browser/rpc-interface.d.ts +871 -1127
  92. package/dist/es/browser/rpc.d.ts +31 -143
  93. package/dist/es/browser/state/BN254.d.ts +2 -9
  94. package/dist/es/browser/state/compressed-account.d.ts +6 -23
  95. package/dist/es/browser/test-helpers/merkle-tree/indexed-array.d.ts +4 -18
  96. package/dist/es/browser/test-helpers/merkle-tree/merkle-tree.d.ts +6 -19
  97. package/dist/es/browser/test-helpers/test-rpc/get-compressed-accounts.d.ts +3 -12
  98. package/dist/es/browser/test-helpers/test-rpc/get-compressed-token-accounts.d.ts +5 -21
  99. package/dist/es/browser/test-helpers/test-rpc/get-parsed-events.d.ts +3 -10
  100. package/dist/es/browser/test-helpers/test-rpc/test-rpc.d.ts +31 -135
  101. package/dist/es/browser/utils/address.d.ts +3 -12
  102. package/dist/es/browser/utils/airdrop.d.ts +2 -14
  103. package/dist/es/browser/utils/calculate-compute-unit-price.d.ts +1 -4
  104. package/dist/es/browser/utils/conversion.d.ts +3 -9
  105. package/dist/es/browser/utils/parse-validity-proof.d.ts +1 -3
  106. package/dist/es/browser/utils/pipe.d.ts +1 -4
  107. package/dist/es/browser/utils/send-and-confirm.d.ts +11 -42
  108. package/dist/es/browser/utils/test-utils.d.ts +1 -5
  109. package/dist/es/browser/utils/validation.d.ts +2 -9
  110. package/dist/es/browser/wallet/interface.d.ts +4 -15
  111. package/dist/es/browser/wallet/use-wallet.d.ts +5 -20
  112. package/dist/types/index.d.ts +1433 -2192
  113. package/package.json +1 -1
@@ -1,30 +1,8 @@
1
1
  import { Connection, ConnectionConfig, PublicKey } from '@solana/web3.js';
2
2
  import { BN } from '@coral-xyz/anchor';
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
- CompressedProofWithContext,
18
- CompressionApiInterface,
19
- GetCompressedTokenAccountsByOwnerOrDelegateOptions,
20
- ParsedTokenAccount,
21
- TokenBalance,
22
- } from '../../rpc-interface';
23
- import {
24
- BN254,
25
- CompressedAccountWithMerkleContext,
26
- MerkleContextWithMerkleProof,
27
- } from '../../state';
3
+ import { AddressWithTree, CompressedMintTokenHolders, CompressedTransaction, GetCompressedAccountsByOwnerConfig, PaginatedOptions, HashWithTree, LatestNonVotingSignatures, LatestNonVotingSignaturesPaginated, SignatureWithMetadata, WithContext, WithCursor } from '../../rpc-interface';
4
+ import { CompressedProofWithContext, CompressionApiInterface, GetCompressedTokenAccountsByOwnerOrDelegateOptions, ParsedTokenAccount, TokenBalance } from '../../rpc-interface';
5
+ import { BN254, CompressedAccountWithMerkleContext, MerkleContextWithMerkleProof } from '../../state';
28
6
  import { MerkleContextWithNewAddressProof } from '../../rpc';
29
7
  export interface TestRpcConfig {
30
8
  /**
@@ -75,16 +53,7 @@ export interface LightWasm {
75
53
  * @param depth Depth of the merkle tree.
76
54
  * @param log Log proof generation time.
77
55
  */
78
- export declare function getTestRpc(
79
- lightWasm: LightWasm,
80
- endpoint?: string,
81
- compressionApiEndpoint?: string,
82
- proverEndpoint?: string,
83
- merkleTreeAddress?: PublicKey,
84
- nullifierQueueAddress?: PublicKey,
85
- depth?: number,
86
- log?: boolean,
87
- ): Promise<TestRpc>;
56
+ export declare function getTestRpc(lightWasm: LightWasm, endpoint?: string, compressionApiEndpoint?: string, proverEndpoint?: string, merkleTreeAddress?: PublicKey, nullifierQueueAddress?: PublicKey, depth?: number, log?: boolean): Promise<TestRpc>;
88
57
  /**
89
58
  * Simple mock rpc for unit tests that simulates the compression rpc interface.
90
59
  * Fetches, parses events and builds merkletree on-demand, i.e. it does not persist state.
@@ -94,10 +63,7 @@ export declare function getTestRpc(
94
63
  *
95
64
  * For advanced testing use photon: https://github.com/helius-labs/photon
96
65
  */
97
- export declare class TestRpc
98
- extends Connection
99
- implements CompressionApiInterface
100
- {
66
+ export declare class TestRpc extends Connection implements CompressionApiInterface {
101
67
  compressionApiEndpoint: string;
102
68
  proverEndpoint: string;
103
69
  merkleTreeAddress: PublicKey;
@@ -119,21 +85,11 @@ export declare class TestRpc
119
85
  * @param connectionConfig Optional connection config
120
86
  * @param testRpcConfig Config for the mock rpc
121
87
  */
122
- constructor(
123
- endpoint: string,
124
- hasher: LightWasm,
125
- compressionApiEndpoint: string,
126
- proverEndpoint: string,
127
- connectionConfig?: ConnectionConfig,
128
- testRpcConfig?: TestRpcConfig,
129
- );
88
+ constructor(endpoint: string, hasher: LightWasm, compressionApiEndpoint: string, proverEndpoint: string, connectionConfig?: ConnectionConfig, testRpcConfig?: TestRpcConfig);
130
89
  /**
131
90
  * Fetch the compressed account for the specified account hash
132
91
  */
133
- getCompressedAccount(
134
- address?: BN254,
135
- hash?: BN254,
136
- ): Promise<CompressedAccountWithMerkleContext | null>;
92
+ getCompressedAccount(address?: BN254, hash?: BN254): Promise<CompressedAccountWithMerkleContext | null>;
137
93
  /**
138
94
  * Fetch the compressed balance for the specified account hash
139
95
  */
@@ -146,16 +102,12 @@ export declare class TestRpc
146
102
  * Fetch the latest merkle proof for the specified account hash from the
147
103
  * cluster
148
104
  */
149
- getCompressedAccountProof(
150
- hash: BN254,
151
- ): Promise<MerkleContextWithMerkleProof>;
105
+ getCompressedAccountProof(hash: BN254): Promise<MerkleContextWithMerkleProof>;
152
106
  /**
153
107
  * Fetch all the account info for multiple compressed accounts specified by
154
108
  * an array of account hashes
155
109
  */
156
- getMultipleCompressedAccounts(
157
- hashes: BN254[],
158
- ): Promise<CompressedAccountWithMerkleContext[]>;
110
+ getMultipleCompressedAccounts(hashes: BN254[]): Promise<CompressedAccountWithMerkleContext[]>;
159
111
  /**
160
112
  * Ensure that the Compression Indexer has already indexed the transaction
161
113
  */
@@ -164,47 +116,31 @@ export declare class TestRpc
164
116
  * Fetch the latest merkle proofs for multiple compressed accounts specified
165
117
  * by an array account hashes
166
118
  */
167
- getMultipleCompressedAccountProofs(
168
- hashes: BN254[],
169
- ): Promise<MerkleContextWithMerkleProof[]>;
119
+ getMultipleCompressedAccountProofs(hashes: BN254[]): Promise<MerkleContextWithMerkleProof[]>;
170
120
  /**
171
121
  * Fetch all the compressed accounts owned by the specified public key.
172
122
  * Owner can be a program or user account
173
123
  */
174
- getCompressedAccountsByOwner(
175
- owner: PublicKey,
176
- _config?: GetCompressedAccountsByOwnerConfig,
177
- ): Promise<WithCursor<CompressedAccountWithMerkleContext[]>>;
124
+ getCompressedAccountsByOwner(owner: PublicKey, _config?: GetCompressedAccountsByOwnerConfig): Promise<WithCursor<CompressedAccountWithMerkleContext[]>>;
178
125
  /**
179
126
  * Fetch the latest compression signatures on the cluster. Results are
180
127
  * paginated.
181
128
  */
182
- getLatestCompressionSignatures(
183
- _cursor?: string,
184
- _limit?: number,
185
- ): Promise<LatestNonVotingSignaturesPaginated>;
129
+ getLatestCompressionSignatures(_cursor?: string, _limit?: number): Promise<LatestNonVotingSignaturesPaginated>;
186
130
  /**
187
131
  * Fetch the latest non-voting signatures on the cluster. Results are
188
132
  * not paginated.
189
133
  */
190
- getLatestNonVotingSignatures(
191
- _limit?: number,
192
- ): Promise<LatestNonVotingSignatures>;
134
+ getLatestNonVotingSignatures(_limit?: number): Promise<LatestNonVotingSignatures>;
193
135
  /**
194
136
  * Fetch all the compressed token accounts owned by the specified public
195
137
  * key. Owner can be a program or user account
196
138
  */
197
- getCompressedTokenAccountsByOwner(
198
- owner: PublicKey,
199
- options: GetCompressedTokenAccountsByOwnerOrDelegateOptions,
200
- ): Promise<WithCursor<ParsedTokenAccount[]>>;
139
+ getCompressedTokenAccountsByOwner(owner: PublicKey, options: GetCompressedTokenAccountsByOwnerOrDelegateOptions): Promise<WithCursor<ParsedTokenAccount[]>>;
201
140
  /**
202
141
  * Fetch all the compressed accounts delegated to the specified public key.
203
142
  */
204
- getCompressedTokenAccountsByDelegate(
205
- delegate: PublicKey,
206
- options: GetCompressedTokenAccountsByOwnerOrDelegateOptions,
207
- ): Promise<WithCursor<ParsedTokenAccount[]>>;
143
+ getCompressedTokenAccountsByDelegate(delegate: PublicKey, options: GetCompressedTokenAccountsByOwnerOrDelegateOptions): Promise<WithCursor<ParsedTokenAccount[]>>;
208
144
  /**
209
145
  * Fetch the compressed token balance for the specified account hash
210
146
  */
@@ -216,25 +152,15 @@ export declare class TestRpc
216
152
  * Fetch all the compressed token balances owned by the specified public
217
153
  * key. Can filter by mint.
218
154
  */
219
- getCompressedTokenBalancesByOwner(
220
- publicKey: PublicKey,
221
- options: GetCompressedTokenAccountsByOwnerOrDelegateOptions,
222
- ): Promise<
223
- WithCursor<
224
- {
225
- balance: BN;
226
- mint: PublicKey;
227
- }[]
228
- >
229
- >;
155
+ getCompressedTokenBalancesByOwner(publicKey: PublicKey, options: GetCompressedTokenAccountsByOwnerOrDelegateOptions): Promise<WithCursor<{
156
+ balance: BN;
157
+ mint: PublicKey;
158
+ }[]>>;
230
159
  /**
231
160
  * Fetch all the compressed token balances owned by the specified public
232
161
  * key. Can filter by mint. Uses context.
233
162
  */
234
- getCompressedTokenBalancesByOwnerV2(
235
- publicKey: PublicKey,
236
- options: GetCompressedTokenAccountsByOwnerOrDelegateOptions,
237
- ): Promise<WithContext<WithCursor<TokenBalance[]>>>;
163
+ getCompressedTokenBalancesByOwnerV2(publicKey: PublicKey, options: GetCompressedTokenAccountsByOwnerOrDelegateOptions): Promise<WithContext<WithCursor<TokenBalance[]>>>;
238
164
  /**
239
165
  * Returns confirmed signatures for transactions involving the specified
240
166
  * account hash forward in time from genesis to the most recent confirmed
@@ -242,16 +168,12 @@ export declare class TestRpc
242
168
  *
243
169
  * @param hash queried account hash
244
170
  */
245
- getCompressionSignaturesForAccount(
246
- _hash: BN254,
247
- ): Promise<SignatureWithMetadata[]>;
171
+ getCompressionSignaturesForAccount(_hash: BN254): Promise<SignatureWithMetadata[]>;
248
172
  /**
249
173
  * Fetch a confirmed or finalized transaction from the cluster. Return with
250
174
  * CompressionInfo
251
175
  */
252
- getTransactionWithCompressionInfo(
253
- _signature: string,
254
- ): Promise<CompressedTransaction | null>;
176
+ getTransactionWithCompressionInfo(_signature: string): Promise<CompressedTransaction | null>;
255
177
  /**
256
178
  * Returns confirmed signatures for transactions involving the specified
257
179
  * address forward in time from genesis to the most recent confirmed
@@ -259,10 +181,7 @@ export declare class TestRpc
259
181
  *
260
182
  * @param address queried compressed account address
261
183
  */
262
- getCompressionSignaturesForAddress(
263
- _address: PublicKey,
264
- _options?: PaginatedOptions,
265
- ): Promise<WithCursor<SignatureWithMetadata[]>>;
184
+ getCompressionSignaturesForAddress(_address: PublicKey, _options?: PaginatedOptions): Promise<WithCursor<SignatureWithMetadata[]>>;
266
185
  /**
267
186
  * Returns confirmed signatures for compression transactions involving the
268
187
  * specified account owner forward in time from genesis to the
@@ -270,19 +189,13 @@ export declare class TestRpc
270
189
  *
271
190
  * @param owner queried owner public key
272
191
  */
273
- getCompressionSignaturesForOwner(
274
- _owner: PublicKey,
275
- _options?: PaginatedOptions,
276
- ): Promise<WithCursor<SignatureWithMetadata[]>>;
192
+ getCompressionSignaturesForOwner(_owner: PublicKey, _options?: PaginatedOptions): Promise<WithCursor<SignatureWithMetadata[]>>;
277
193
  /**
278
194
  * Returns confirmed signatures for compression transactions involving the
279
195
  * specified token account owner forward in time from genesis to the most
280
196
  * recent confirmed block
281
197
  */
282
- getCompressionSignaturesForTokenOwner(
283
- _owner: PublicKey,
284
- _options?: PaginatedOptions,
285
- ): Promise<WithCursor<SignatureWithMetadata[]>>;
198
+ getCompressionSignaturesForTokenOwner(_owner: PublicKey, _options?: PaginatedOptions): Promise<WithCursor<SignatureWithMetadata[]>>;
286
199
  /**
287
200
  * Fetch the current indexer health status
288
201
  */
@@ -299,13 +212,8 @@ export declare class TestRpc
299
212
  * @param addresses Array of BN254 new addresses
300
213
  * @returns Array of validity proofs for new addresses
301
214
  */
302
- getMultipleNewAddressProofs(
303
- addresses: BN254[],
304
- ): Promise<MerkleContextWithNewAddressProof[]>;
305
- getCompressedMintTokenHolders(
306
- _mint: PublicKey,
307
- _options?: PaginatedOptions,
308
- ): Promise<WithContext<WithCursor<CompressedMintTokenHolders[]>>>;
215
+ getMultipleNewAddressProofs(addresses: BN254[]): Promise<MerkleContextWithNewAddressProof[]>;
216
+ getCompressedMintTokenHolders(_mint: PublicKey, _options?: PaginatedOptions): Promise<WithContext<WithCursor<CompressedMintTokenHolders[]>>>;
309
217
  /**
310
218
  * Advanced usage of getValidityProof: fetches ZKP directly from a custom
311
219
  * non-rpcprover. Note: This uses the proverEndpoint specified in the
@@ -315,18 +223,12 @@ export declare class TestRpc
315
223
  * Note: Use RPC class for forested trees. TestRpc is only for custom
316
224
  * testing purposes.
317
225
  */
318
- getValidityProofDirect(
319
- hashes?: BN254[],
320
- newAddresses?: BN254[],
321
- ): Promise<CompressedProofWithContext>;
226
+ getValidityProofDirect(hashes?: BN254[], newAddresses?: BN254[]): Promise<CompressedProofWithContext>;
322
227
  /**
323
228
  * @deprecated This method is not available for TestRpc. Please use
324
229
  * {@link getValidityProof} instead.
325
230
  */
326
- getValidityProofAndRpcContext(
327
- hashes?: HashWithTree[],
328
- newAddresses?: AddressWithTree[],
329
- ): Promise<WithContext<CompressedProofWithContext>>;
231
+ getValidityProofAndRpcContext(hashes?: HashWithTree[], newAddresses?: AddressWithTree[]): Promise<WithContext<CompressedProofWithContext>>;
330
232
  /**
331
233
  * Fetch the latest validity proof for (1) compressed accounts specified by
332
234
  * an array of account hashes. (2) new unique addresses specified by an
@@ -341,12 +243,6 @@ export declare class TestRpc
341
243
  * @param newAddresses Array of BN254 new addresses.
342
244
  * @returns validity proof with context
343
245
  */
344
- getValidityProof(
345
- hashes?: BN254[],
346
- newAddresses?: BN254[],
347
- ): Promise<CompressedProofWithContext>;
348
- getValidityProofV0(
349
- hashes?: HashWithTree[],
350
- newAddresses?: AddressWithTree[],
351
- ): Promise<CompressedProofWithContext>;
246
+ getValidityProof(hashes?: BN254[], newAddresses?: BN254[]): Promise<CompressedProofWithContext>;
247
+ getValidityProofV0(hashes?: HashWithTree[], newAddresses?: AddressWithTree[]): Promise<CompressedProofWithContext>;
352
248
  }
@@ -1,8 +1,5 @@
1
1
  import { PublicKey } from '@solana/web3.js';
2
- export declare function deriveAddressSeed(
3
- seeds: Uint8Array[],
4
- programId: PublicKey,
5
- ): Uint8Array;
2
+ export declare function deriveAddressSeed(seeds: Uint8Array[], programId: PublicKey): Uint8Array;
6
3
  /**
7
4
  * Derive an address for a compressed account from a seed and an address Merkle
8
5
  * tree public key.
@@ -12,10 +9,7 @@ export declare function deriveAddressSeed(
12
9
  * defaultTestStateTreeAccounts().addressTree
13
10
  * @returns Derived address
14
11
  */
15
- export declare function deriveAddress(
16
- seed: Uint8Array,
17
- addressMerkleTreePubkey?: PublicKey,
18
- ): PublicKey;
12
+ export declare function deriveAddress(seed: Uint8Array, addressMerkleTreePubkey?: PublicKey): PublicKey;
19
13
  export interface NewAddressParams {
20
14
  /**
21
15
  * Seed for the compressed account. Must be seed used to derive
@@ -63,10 +57,7 @@ export interface NewAddressParamsPacked {
63
57
  * @param remainingAccounts Remaining accounts
64
58
  * @returns Packed new address params
65
59
  */
66
- export declare function packNewAddressParams(
67
- newAddressParams: NewAddressParams[],
68
- remainingAccounts: PublicKey[],
69
- ): {
60
+ export declare function packNewAddressParams(newAddressParams: NewAddressParams[], remainingAccounts: PublicKey[]): {
70
61
  newAddressParamsPacked: NewAddressParamsPacked[];
71
62
  remainingAccounts: PublicKey[];
72
63
  };
@@ -1,19 +1,7 @@
1
1
  import { Commitment, Connection, PublicKey } from '@solana/web3.js';
2
- export declare function airdropSol({
3
- connection,
4
- lamports,
5
- recipientPublicKey,
6
- }: {
2
+ export declare function airdropSol({ connection, lamports, recipientPublicKey, }: {
7
3
  connection: Connection;
8
4
  lamports: number;
9
5
  recipientPublicKey: PublicKey;
10
6
  }): Promise<string>;
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
- >;
7
+ export declare function confirmTransaction(connection: Connection, signature: string, confirmation?: Commitment): Promise<import("@solana/web3.js").RpcResponseAndContext<import("@solana/web3.js").SignatureResult>>;
@@ -4,7 +4,4 @@
4
4
  * @returns microLamports per compute unit (use in
5
5
  * `ComputeBudgetProgram.setComputeUnitPrice`)
6
6
  */
7
- export declare function calculateComputeUnitPrice(
8
- targetLamports: number,
9
- computeUnits: number,
10
- ): number;
7
+ export declare function calculateComputeUnitPrice(targetLamports: number, computeUnits: number): number;
@@ -16,9 +16,7 @@ export declare const bufToDecStr: (buf: Buffer) => string;
16
16
  *
17
17
  * @deprecated Use `hashvToBn254FieldSizeBe` instead.
18
18
  */
19
- export declare function hashToBn254FieldSizeBe(
20
- bytes: Buffer,
21
- ): [Buffer, number] | null;
19
+ export declare function hashToBn254FieldSizeBe(bytes: Buffer): [Buffer, number] | null;
22
20
  /**
23
21
  * Hash the provided `bytes` with Keccak256 and ensure that the result fits in
24
22
  * the BN254 prime field by truncating the resulting hash to 31 bytes.
@@ -27,11 +25,7 @@ export declare function hashToBn254FieldSizeBe(
27
25
  *
28
26
  * @returns Hash digest
29
27
  */
30
- export declare function hashvToBn254FieldSizeBe(
31
- bytes: Uint8Array[],
32
- ): Uint8Array;
28
+ export declare function hashvToBn254FieldSizeBe(bytes: Uint8Array[]): Uint8Array;
33
29
  /** Mutates array in place */
34
30
  export declare function pushUniqueItems<T>(items: T[], map: T[]): void;
35
- export declare function toCamelCase(
36
- obj: Array<any> | unknown | any,
37
- ): Array<any> | unknown | any;
31
+ export declare function toCamelCase(obj: Array<any> | unknown | any): Array<any> | unknown | any;
@@ -16,7 +16,5 @@ export declare const placeholderValidityProof: () => {
16
16
  };
17
17
  export declare const checkValidityProofShape: (proof: CompressedProof) => void;
18
18
  export declare function proofFromJsonStruct(json: GnarkProofJson): ProofABC;
19
- export declare function negateAndCompressProof(
20
- proof: ProofABC,
21
- ): CompressedProof;
19
+ export declare function negateAndCompressProof(proof: ProofABC): CompressedProof;
22
20
  export {};
@@ -1,5 +1,2 @@
1
1
  /** pipe function */
2
- export declare function pipe<T, R>(
3
- initialFunction: (arg: T) => R,
4
- ...functions: ((arg: R) => R)[]
5
- ): (initialValue: T) => R;
2
+ export declare function pipe<T, R>(initialFunction: (arg: T) => R, ...functions: ((arg: R) => R)[]): (initialValue: T) => R;
@@ -1,14 +1,4 @@
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';
1
+ import { VersionedTransaction, SignatureResult, RpcResponseAndContext, Signer, TransactionInstruction, ConfirmOptions, TransactionSignature, PublicKey, AddressLookupTableAccount } from '@solana/web3.js';
12
2
  import { Rpc } from '../rpc';
13
3
  /**
14
4
  * Builds a versioned Transaction from instructions.
@@ -20,12 +10,7 @@ import { Rpc } from '../rpc';
20
10
  *
21
11
  * @return VersionedTransaction
22
12
  */
23
- export declare function buildTx(
24
- instructions: TransactionInstruction[],
25
- payerPublicKey: PublicKey,
26
- blockhash: string,
27
- lookupTableAccounts?: AddressLookupTableAccount[],
28
- ): VersionedTransaction;
13
+ export declare function buildTx(instructions: TransactionInstruction[], payerPublicKey: PublicKey, blockhash: string, lookupTableAccounts?: AddressLookupTableAccount[]): VersionedTransaction;
29
14
  /**
30
15
  * Sends a versioned transaction and confirms it.
31
16
  *
@@ -36,15 +21,10 @@ export declare function buildTx(
36
21
  *
37
22
  * @return TransactionSignature
38
23
  */
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>;
24
+ export declare function sendAndConfirmTx(rpc: Rpc, tx: VersionedTransaction, confirmOptions?: ConfirmOptions, blockHashCtx?: {
25
+ blockhash: string;
26
+ lastValidBlockHeight: number;
27
+ }): Promise<TransactionSignature>;
48
28
  /**
49
29
  * Confirms a transaction with a given txId.
50
30
  *
@@ -54,15 +34,10 @@ export declare function sendAndConfirmTx(
54
34
  * @param blockHashCtx blockhash context for confirmation
55
35
  * @return SignatureResult
56
36
  */
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>>;
37
+ export declare function confirmTx(rpc: Rpc, txId: string, confirmOptions?: ConfirmOptions, blockHashCtx?: {
38
+ blockhash: string;
39
+ lastValidBlockHeight: number;
40
+ }): Promise<RpcResponseAndContext<SignatureResult>>;
66
41
  /**
67
42
  * Builds a versioned Transaction from instructions and signs it.
68
43
  *
@@ -74,10 +49,4 @@ export declare function confirmTx(
74
49
  * @param lookupTableAccounts lookup table accounts to include in the
75
50
  * transaction
76
51
  */
77
- export declare function buildAndSignTx(
78
- instructions: TransactionInstruction[],
79
- payer: Signer,
80
- blockhash: string,
81
- additionalSigners?: Signer[],
82
- lookupTableAccounts?: AddressLookupTableAccount[],
83
- ): VersionedTransaction;
52
+ export declare function buildAndSignTx(instructions: TransactionInstruction[], payer: Signer, blockhash: string, additionalSigners?: Signer[], lookupTableAccounts?: AddressLookupTableAccount[]): VersionedTransaction;
@@ -12,11 +12,7 @@ export declare const DAVE: Keypair;
12
12
  * @param counter counter to use for generating the keypair.
13
13
  * If undefined or >255, generates random keypair.
14
14
  */
15
- export declare function newAccountWithLamports(
16
- rpc: Rpc,
17
- lamports?: number,
18
- counter?: number | undefined,
19
- ): Promise<Signer>;
15
+ export declare function newAccountWithLamports(rpc: Rpc, lamports?: number, counter?: number | undefined): Promise<Signer>;
20
16
  export declare function getConnection(): Connection;
21
17
  /**
22
18
  * For use in tests.
@@ -1,11 +1,4 @@
1
1
  import { BN } from '@coral-xyz/anchor';
2
- import {
3
- CompressedAccount,
4
- CompressedAccountWithMerkleContext,
5
- } from '../state';
2
+ import { CompressedAccount, CompressedAccountWithMerkleContext } from '../state';
6
3
  export declare const validateSufficientBalance: (balance: BN) => void;
7
- export declare const validateSameOwner: (
8
- compressedAccounts:
9
- | CompressedAccount[]
10
- | CompressedAccountWithMerkleContext[],
11
- ) => void;
4
+ export declare const validateSameOwner: (compressedAccounts: CompressedAccount[] | CompressedAccountWithMerkleContext[]) => void;
@@ -1,9 +1,4 @@
1
- import {
2
- Commitment,
3
- Connection,
4
- Keypair,
5
- VersionedTransaction,
6
- } from '@solana/web3.js';
1
+ import { Commitment, Connection, Keypair, VersionedTransaction } from '@solana/web3.js';
7
2
  import { PublicKey, Transaction } from '@solana/web3.js';
8
3
  export type InclusionProofPublicInputs = {
9
4
  root: string;
@@ -14,8 +9,7 @@ export type InclusionProofPrivateInputs = {
14
9
  leaf: string;
15
10
  leafIndex: string;
16
11
  };
17
- export type InclusionProofInputs = (InclusionProofPublicInputs &
18
- InclusionProofPrivateInputs)[];
12
+ export type InclusionProofInputs = (InclusionProofPublicInputs & InclusionProofPrivateInputs)[];
19
13
  export declare class Wallet {
20
14
  _publicKey: PublicKey;
21
15
  _keypair: Keypair;
@@ -25,12 +19,7 @@ export declare class Wallet {
25
19
  constructor(keypair: Keypair, url: string, commitment: Commitment);
26
20
  signTransaction: (tx: any) => Promise<any>;
27
21
  sendTransaction: (transaction: VersionedTransaction) => Promise<string>;
28
- signAllTransactions: <T extends Transaction | VersionedTransaction>(
29
- transactions: T[],
30
- ) => Promise<T[]>;
22
+ signAllTransactions: <T extends Transaction | VersionedTransaction>(transactions: T[]) => Promise<T[]>;
31
23
  signMessage: (message: Uint8Array) => Promise<Uint8Array>;
32
- sendAndConfirmTransaction: (
33
- transaction: Transaction,
34
- signers?: never[],
35
- ) => Promise<any>;
24
+ sendAndConfirmTransaction: (transaction: Transaction, signers?: never[]) => Promise<any>;
36
25
  }
@@ -1,24 +1,9 @@
1
1
  import { Keypair, Commitment } from '@solana/web3.js';
2
- export declare const useWallet: (
3
- keypair: Keypair,
4
- url?: string,
5
- commitment?: Commitment,
6
- ) => {
7
- publicKey: import('@solana/web3.js').PublicKey;
8
- sendAndConfirmTransaction: (
9
- transaction: import('@solana/web3.js').Transaction,
10
- signers?: never[],
11
- ) => Promise<any>;
2
+ export declare const useWallet: (keypair: Keypair, url?: string, commitment?: Commitment) => {
3
+ publicKey: import("@solana/web3.js").PublicKey;
4
+ sendAndConfirmTransaction: (transaction: import("@solana/web3.js").Transaction, signers?: never[]) => Promise<any>;
12
5
  signMessage: (message: Uint8Array) => Promise<Uint8Array>;
13
6
  signTransaction: (tx: any) => Promise<any>;
14
- signAllTransactions: <
15
- T extends
16
- | import('@solana/web3.js').Transaction
17
- | import('@solana/web3.js').VersionedTransaction,
18
- >(
19
- transactions: T[],
20
- ) => Promise<T[]>;
21
- sendTransaction: (
22
- transaction: import('@solana/web3.js').VersionedTransaction,
23
- ) => Promise<string>;
7
+ signAllTransactions: <T extends import("@solana/web3.js").Transaction | import("@solana/web3.js").VersionedTransaction>(transactions: T[]) => Promise<T[]>;
8
+ sendTransaction: (transaction: import("@solana/web3.js").VersionedTransaction) => Promise<string>;
24
9
  };
@@ -1,6 +1,3 @@
1
1
  import { Signer } from '@solana/web3.js';
2
2
  /** @internal remove signer from signers if part of signers */
3
- export declare function dedupeSigner(
4
- signer: Signer,
5
- signers: Signer[],
6
- ): Signer[];
3
+ export declare function dedupeSigner(signer: Signer, signers: Signer[]): Signer[];
@@ -1,9 +1,4 @@
1
- import {
2
- ConfirmOptions,
3
- PublicKey,
4
- Signer,
5
- TransactionSignature,
6
- } from '@solana/web3.js';
1
+ import { ConfirmOptions, PublicKey, Signer, TransactionSignature } from '@solana/web3.js';
7
2
  import { Rpc } from '../rpc';
8
3
  import { BN } from '@coral-xyz/anchor';
9
4
  /**
@@ -18,11 +13,4 @@ import { BN } from '@coral-xyz/anchor';
18
13
  *
19
14
  * @return Transaction signature
20
15
  */
21
- export declare function compress(
22
- rpc: Rpc,
23
- payer: Signer,
24
- lamports: number | BN,
25
- toAddress: PublicKey,
26
- outputStateTree?: PublicKey,
27
- confirmOptions?: ConfirmOptions,
28
- ): Promise<TransactionSignature>;
16
+ export declare function compress(rpc: Rpc, payer: Signer, lamports: number | BN, toAddress: PublicKey, outputStateTree?: PublicKey, confirmOptions?: ConfirmOptions): Promise<TransactionSignature>;
@@ -1,9 +1,4 @@
1
- import {
2
- ConfirmOptions,
3
- PublicKey,
4
- Signer,
5
- TransactionSignature,
6
- } from '@solana/web3.js';
1
+ import { ConfirmOptions, PublicKey, Signer, TransactionSignature } from '@solana/web3.js';
7
2
  import { Rpc } from '../rpc';
8
3
  import { BN } from '@coral-xyz/anchor';
9
4
  /**
@@ -23,16 +18,7 @@ import { BN } from '@coral-xyz/anchor';
23
18
  *
24
19
  * @return Transaction signature
25
20
  */
26
- export declare function createAccount(
27
- rpc: Rpc,
28
- payer: Signer,
29
- seeds: Uint8Array[],
30
- programId: PublicKey,
31
- addressTree?: PublicKey,
32
- addressQueue?: PublicKey,
33
- outputStateTree?: PublicKey,
34
- confirmOptions?: ConfirmOptions,
35
- ): Promise<TransactionSignature>;
21
+ export declare function createAccount(rpc: Rpc, payer: Signer, seeds: Uint8Array[], programId: PublicKey, addressTree?: PublicKey, addressQueue?: PublicKey, outputStateTree?: PublicKey, confirmOptions?: ConfirmOptions): Promise<TransactionSignature>;
36
22
  /**
37
23
  * Create compressed account with address and lamports
38
24
  *
@@ -52,14 +38,4 @@ export declare function createAccount(
52
38
  *
53
39
  * @return Transaction signature
54
40
  */
55
- export declare function createAccountWithLamports(
56
- rpc: Rpc,
57
- payer: Signer,
58
- seeds: Uint8Array[],
59
- lamports: number | BN,
60
- programId: PublicKey,
61
- addressTree?: PublicKey,
62
- addressQueue?: PublicKey,
63
- outputStateTree?: PublicKey,
64
- confirmOptions?: ConfirmOptions,
65
- ): Promise<TransactionSignature>;
41
+ export declare function createAccountWithLamports(rpc: Rpc, payer: Signer, seeds: Uint8Array[], lamports: number | BN, programId: PublicKey, addressTree?: PublicKey, addressQueue?: PublicKey, outputStateTree?: PublicKey, confirmOptions?: ConfirmOptions): Promise<TransactionSignature>;