@cascade-fyi/compression-kit 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1033 @@
1
+ import { AccountMeta, Address } from "@solana/kit";
2
+
3
+ //#region src/state/types.d.ts
4
+
5
+ /**
6
+ * Tree type enum matching the on-chain representation.
7
+ */
8
+ declare enum TreeType {
9
+ /** v1 state merkle tree */
10
+ StateV1 = 1,
11
+ /** v1 address merkle tree */
12
+ AddressV1 = 2,
13
+ /** v2 state merkle tree */
14
+ StateV2 = 3,
15
+ /** v2 address merkle tree */
16
+ AddressV2 = 4,
17
+ }
18
+ /**
19
+ * Tree info - metadata about a state or address tree.
20
+ *
21
+ * Used for:
22
+ * - State trees: store compressed accounts
23
+ * - Address trees: store PDAs
24
+ */
25
+ interface TreeInfo {
26
+ /** Pubkey of the tree account */
27
+ tree: Address;
28
+ /** Pubkey of the queue account associated with the tree */
29
+ queue: Address;
30
+ /** The type of tree */
31
+ treeType: TreeType;
32
+ /** Optional compressed CPI context account */
33
+ cpiContext?: Address;
34
+ /** Next tree info if this tree is full/rolled over */
35
+ nextTreeInfo: TreeInfo | null;
36
+ }
37
+ /**
38
+ * @deprecated Use TreeInfo instead.
39
+ */
40
+ type StateTreeInfo = TreeInfo;
41
+ /**
42
+ * @deprecated Use TreeInfo instead.
43
+ */
44
+ type AddressTreeInfo = Omit<TreeInfo, "cpiContext" | "nextTreeInfo"> & {
45
+ nextTreeInfo: AddressTreeInfo | null;
46
+ };
47
+ /**
48
+ * Packed merkle context for instruction data.
49
+ */
50
+ interface PackedMerkleContext {
51
+ /** Merkle tree pubkey index in remaining accounts */
52
+ merkleTreePubkeyIndex: number;
53
+ /** Queue pubkey index in remaining accounts */
54
+ queuePubkeyIndex: number;
55
+ /** Leaf index in the tree */
56
+ leafIndex: number;
57
+ /** Whether to prove by index or validity proof */
58
+ proveByIndex: boolean;
59
+ }
60
+ /**
61
+ * Packed state tree info for compressed accounts.
62
+ */
63
+ interface PackedStateTreeInfo {
64
+ /** Recent valid root index */
65
+ rootIndex: number;
66
+ /** Whether the account can be proven by index */
67
+ proveByIndex: boolean;
68
+ /** Index of the merkle tree in remaining accounts */
69
+ merkleTreePubkeyIndex: number;
70
+ /** Index of the queue in remaining accounts */
71
+ queuePubkeyIndex: number;
72
+ /** Index of the leaf in the state tree */
73
+ leafIndex: number;
74
+ }
75
+ /**
76
+ * Packed address tree info for new PDAs.
77
+ */
78
+ interface PackedAddressTreeInfo {
79
+ /** Index of the address tree in remaining accounts */
80
+ addressMerkleTreePubkeyIndex: number;
81
+ /** Index of the address queue in remaining accounts */
82
+ addressQueuePubkeyIndex: number;
83
+ /** Recent valid root index */
84
+ rootIndex: number;
85
+ }
86
+ /**
87
+ * Data attached to a compressed account.
88
+ */
89
+ interface CompressedAccountData {
90
+ /** 8-byte discriminator */
91
+ discriminator: Uint8Array;
92
+ /** Account data */
93
+ data: Uint8Array;
94
+ /** 32-byte hash of the data */
95
+ dataHash: Uint8Array;
96
+ }
97
+ /**
98
+ * Merkle context for a compressed account.
99
+ */
100
+ interface MerkleContext {
101
+ /** Tree info */
102
+ treeInfo: TreeInfo;
103
+ /** Poseidon hash of the account (stored as leaf) */
104
+ hash: bigint;
105
+ /** Position in the state tree */
106
+ leafIndex: number;
107
+ /** Whether the account can be proven by index */
108
+ proveByIndex: boolean;
109
+ }
110
+ /**
111
+ * Merkle context with full merkle proof.
112
+ */
113
+ interface MerkleContextWithProof extends MerkleContext {
114
+ /** Merkle proof path */
115
+ merkleProof: bigint[];
116
+ /** Root index the proof is valid for */
117
+ rootIndex: number;
118
+ /** Current root */
119
+ root: bigint;
120
+ }
121
+ /**
122
+ * Compressed account with merkle context.
123
+ */
124
+ interface CompressedAccount extends MerkleContext {
125
+ /** Owner program or user */
126
+ owner: Address;
127
+ /** Lamports attached to the account */
128
+ lamports: bigint;
129
+ /** Optional persistent address */
130
+ address: Uint8Array | null;
131
+ /** Optional account data */
132
+ data: CompressedAccountData | null;
133
+ /** Whether this account is read-only in the transaction */
134
+ readOnly: boolean;
135
+ }
136
+ /**
137
+ * Compressed account meta for instruction data.
138
+ */
139
+ interface CompressedAccountMeta {
140
+ /** Packed tree info */
141
+ treeInfo: PackedStateTreeInfo;
142
+ /** Address (32 bytes or null) */
143
+ address: Uint8Array | null;
144
+ /** Lamports or null */
145
+ lamports: bigint | null;
146
+ /** Output state tree index */
147
+ outputStateTreeIndex: number;
148
+ }
149
+ /**
150
+ * Validity proof for compressed accounts.
151
+ *
152
+ * Proves existence of N compressed accounts or uniqueness of N PDAs.
153
+ */
154
+ interface ValidityProof {
155
+ /** 32 bytes - G1 point x */
156
+ a: Uint8Array;
157
+ /** 64 bytes - G2 point */
158
+ b: Uint8Array;
159
+ /** 32 bytes - G1 point y */
160
+ c: Uint8Array;
161
+ }
162
+ /**
163
+ * Validity proof with context information.
164
+ */
165
+ interface ValidityProofWithContext {
166
+ /** The proof (null if prove-by-index for all accounts) */
167
+ compressedProof: ValidityProof | null;
168
+ /** State roots */
169
+ roots: bigint[];
170
+ /** Root indices */
171
+ rootIndices: number[];
172
+ /** Leaf indices */
173
+ leafIndices: number[];
174
+ /** Leaf hashes */
175
+ leaves: bigint[];
176
+ /** Tree infos */
177
+ treeInfos: TreeInfo[];
178
+ /** Whether to prove by index for each account */
179
+ proveByIndices: boolean[];
180
+ }
181
+ /**
182
+ * Account proof input for validity proof request.
183
+ */
184
+ interface AccountProofInput {
185
+ /** Account hash */
186
+ hash: bigint;
187
+ /** Tree info */
188
+ treeInfo: TreeInfo;
189
+ /** Leaf index */
190
+ leafIndex: number;
191
+ /** Root index */
192
+ rootIndex: number;
193
+ /** Whether to prove by index */
194
+ proveByIndex: boolean;
195
+ }
196
+ /**
197
+ * New address proof input for validity proof request.
198
+ */
199
+ interface NewAddressProofInput {
200
+ /** Tree info */
201
+ treeInfo: TreeInfo;
202
+ /** Address bytes (32) */
203
+ address: Uint8Array;
204
+ /** Root index */
205
+ rootIndex: number;
206
+ /** Current root */
207
+ root: bigint;
208
+ }
209
+ /**
210
+ * Compressed token data.
211
+ */
212
+ interface TokenData {
213
+ /** Token mint */
214
+ mint: Address;
215
+ /** Token owner */
216
+ owner: Address;
217
+ /** Token amount */
218
+ amount: bigint;
219
+ /** Delegate (if any) */
220
+ delegate: Address | null;
221
+ /** Account state (0=uninitialized, 1=initialized, 2=frozen) */
222
+ state: number;
223
+ /** Token extension TLV data */
224
+ tlv: Uint8Array | null;
225
+ }
226
+ /**
227
+ * Parsed token account combining compressed account and token data.
228
+ */
229
+ interface ParsedTokenAccount {
230
+ /** Compressed account */
231
+ compressedAccount: CompressedAccount;
232
+ /** Parsed token data */
233
+ parsed: TokenData;
234
+ }
235
+ /**
236
+ * Compressed CPI context for multi-program transactions.
237
+ */
238
+ interface CompressedCpiContext {
239
+ /** Whether to set the CPI context */
240
+ setContext: boolean;
241
+ /** Whether this is the first context set (wipes previous) */
242
+ firstSetContext: boolean;
243
+ /** Index of CPI context account in remaining accounts */
244
+ cpiContextAccountIndex: number;
245
+ }
246
+ /**
247
+ * New address parameters for creating PDAs.
248
+ */
249
+ interface NewAddressParams {
250
+ /** Seed for address derivation */
251
+ seed: Uint8Array;
252
+ /** Root index for address tree */
253
+ addressMerkleTreeRootIndex: number;
254
+ /** Address tree pubkey */
255
+ addressMerkleTreePubkey: Address;
256
+ /** Address queue pubkey */
257
+ addressQueuePubkey: Address;
258
+ }
259
+ /**
260
+ * Packed new address parameters for instruction data.
261
+ */
262
+ interface NewAddressParamsPacked {
263
+ /** Seed bytes */
264
+ seed: Uint8Array;
265
+ /** Address tree root index */
266
+ addressMerkleTreeRootIndex: number;
267
+ /** Index of address tree in remaining accounts */
268
+ addressMerkleTreeAccountIndex: number;
269
+ /** Index of address queue in remaining accounts */
270
+ addressQueueAccountIndex: number;
271
+ }
272
+ //#endregion
273
+ //#region src/state/bn254.d.ts
274
+ /**
275
+ * BN254 field element utilities using native bigint.
276
+ *
277
+ * BN254 is the elliptic curve used by Light Protocol's ZK proofs.
278
+ * All hashes must be less than the field modulus (~2^254) for circuit compatibility.
279
+ *
280
+ * This module replaces BN.js with native bigint for:
281
+ * - Better performance
282
+ * - No Node.js Buffer dependency
283
+ * - Edge/browser compatibility
284
+ */
285
+ /**
286
+ * BN254 field element type.
287
+ *
288
+ * This is a bigint that is guaranteed to be less than the BN254 field modulus.
289
+ * While we can't enforce this at the type level with branded types (since bigint
290
+ * operations return plain bigint), we validate at creation time.
291
+ */
292
+ type BN254 = bigint;
293
+ /**
294
+ * Check if a bigint is within the BN254 field.
295
+ */
296
+ declare function isBN254(value: bigint): boolean;
297
+ /**
298
+ * Assert that a bigint is within the BN254 field.
299
+ * @throws BN254Error if value is out of range
300
+ */
301
+ declare function assertIsBN254(value: bigint): asserts value is BN254;
302
+ /**
303
+ * Create a BN254 field element from various input types.
304
+ *
305
+ * @param input - Number, string, bigint, or byte array
306
+ * @param base - Optional base for string parsing: 10, 16, 'hex', or 'base58'
307
+ * @returns BN254 field element
308
+ * @throws BN254Error if value exceeds field size
309
+ */
310
+ declare function createBN254(input: string | number | bigint | Uint8Array | number[], base?: number | "hex" | "base58"): BN254;
311
+ /**
312
+ * Create a BN254 from a 32-byte array (big-endian).
313
+ */
314
+ declare function bn254FromBytes(bytes: Uint8Array): BN254;
315
+ /**
316
+ * Convert a BN254 field element to a base58 string.
317
+ */
318
+ declare function encodeBN254toBase58(value: BN254): string;
319
+ /**
320
+ * Convert a BN254 field element to a hex string (with 0x prefix).
321
+ */
322
+ declare function encodeBN254toHex(value: BN254): string;
323
+ /**
324
+ * Convert a BN254 field element to a 32-byte array (big-endian).
325
+ */
326
+ declare function bn254ToBytes(value: BN254): Uint8Array;
327
+ /**
328
+ * Convert a BN254 field element to a decimal string.
329
+ */
330
+ declare function bn254ToDecimalString(value: BN254): string;
331
+ /**
332
+ * Convert bytes to bigint (big-endian).
333
+ */
334
+ declare function bytesToBigIntBE(bytes: Uint8Array): bigint;
335
+ /**
336
+ * Convert bytes to bigint (little-endian).
337
+ */
338
+ declare function bytesToBigIntLE(bytes: Uint8Array): bigint;
339
+ /**
340
+ * Convert bigint to bytes (big-endian).
341
+ */
342
+ declare function bigIntToBytesBE(value: bigint, length: number): Uint8Array;
343
+ /**
344
+ * Convert bigint to bytes (little-endian).
345
+ */
346
+ declare function bigIntToBytesLE(value: bigint, length: number): Uint8Array;
347
+ /**
348
+ * Add two BN254 values with modular reduction.
349
+ */
350
+ declare function bn254Add(a: BN254, b: BN254): BN254;
351
+ /**
352
+ * Subtract two BN254 values with modular reduction.
353
+ */
354
+ declare function bn254Sub(a: BN254, b: BN254): BN254;
355
+ /**
356
+ * Multiply two BN254 values with modular reduction.
357
+ */
358
+ declare function bn254Mul(a: BN254, b: BN254): BN254;
359
+ /**
360
+ * Check if a value is smaller than the BN254 field size (big-endian bytes).
361
+ */
362
+ declare function isSmallerThanFieldSize(bytes: Uint8Array): boolean;
363
+ //#endregion
364
+ //#region src/constants.d.ts
365
+ declare enum VERSION {
366
+ V1 = "V1",
367
+ V2 = "V2",
368
+ }
369
+ /**
370
+ * Feature flags for protocol versioning.
371
+ * @internal
372
+ */
373
+ declare const featureFlags: {
374
+ version: VERSION;
375
+ isV2: () => boolean;
376
+ };
377
+ /**
378
+ * Returns versioned endpoint name.
379
+ * @example versionedEndpoint('getCompressedAccount') -> 'getCompressedAccountV2' (if V2)
380
+ */
381
+ declare const versionedEndpoint: (base: string) => string;
382
+ /**
383
+ * BN254 prime field size.
384
+ * All hashes must be less than this value for ZK circuit compatibility.
385
+ */
386
+ declare const FIELD_SIZE = 21888242871839275222246405745257275088548364400416034343698204186575808495617n;
387
+ /**
388
+ * Highest address plus one (used for address validation).
389
+ */
390
+ declare const HIGHEST_ADDRESS_PLUS_ONE = 452312848583266388373324160190187140051835877600158453279131187530910662655n;
391
+ /** Light System Program ID */
392
+ declare const LIGHT_SYSTEM_PROGRAM: Address<"SySTEM1eSU2p4BGQfQpimFEWWSC1XDFeun3Nqzz3rT7">;
393
+ /** Account Compression Program ID */
394
+ declare const ACCOUNT_COMPRESSION_PROGRAM: Address<"compr6CUsB5m2jS4Y3831ztGSTnDpnKJTKS95d64XVq">;
395
+ /** Noop Program ID (for logging) */
396
+ declare const NOOP_PROGRAM: Address<"noopb9bkMVfRPU8AsbpTUg8AQkHtKwMYZiFUjNRtMmV">;
397
+ /** Compressed Token Program ID */
398
+ declare const COMPRESSED_TOKEN_PROGRAM: Address<"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m">;
399
+ /** Registered Program PDA (constant) */
400
+ declare const REGISTERED_PROGRAM_PDA: Address<"35hkDgaAKwMCaxRz2ocSZ6NaUrtKkyNqU6c4RV3tYJRh">;
401
+ declare const INVOKE_DISCRIMINATOR: Uint8Array<ArrayBuffer>;
402
+ declare const INVOKE_CPI_DISCRIMINATOR: Uint8Array<ArrayBuffer>;
403
+ declare const INVOKE_CPI_WITH_READ_ONLY_DISCRIMINATOR: Uint8Array<ArrayBuffer>;
404
+ declare const INVOKE_CPI_WITH_ACCOUNT_INFO_DISCRIMINATOR: Uint8Array<ArrayBuffer>;
405
+ declare const INSERT_INTO_QUEUES_DISCRIMINATOR: Uint8Array<ArrayBuffer>;
406
+ declare const COMPUTE_BUDGET_PATTERN: Uint8Array<ArrayBuffer>;
407
+ /** Mainnet state tree lookup table */
408
+ declare const STATE_TREE_LOOKUP_TABLE_MAINNET: Address<"7i86eQs3GSqHjN47WdWLTCGMW6gde1q96G2EVnUyK2st">;
409
+ /** Mainnet nullified state tree lookup table */
410
+ declare const NULLIFIED_STATE_TREE_LOOKUP_TABLE_MAINNET: Address<"H9QD4u1fG7KmkAzn2tDXhheushxFe1EcrjGGyEFXeMqT">;
411
+ /** Devnet state tree lookup table */
412
+ declare const STATE_TREE_LOOKUP_TABLE_DEVNET: Address<"Dk9mNkbiZXJZ4By8DfSP6HEE4ojZzRvucwpawLeuwq8q">;
413
+ /** Devnet nullified state tree lookup table */
414
+ declare const NULLIFIED_STATE_TREE_LOOKUP_TABLE_DEVNET: Address<"AXbHzp1NgjLvpfnD6JRTTovXZ7APUCdtWZFCRr5tCxse">;
415
+ interface StateTreeLUTPair {
416
+ stateTreeLookupTable: Address;
417
+ nullifyLookupTable: Address;
418
+ }
419
+ /**
420
+ * Returns default state tree lookup tables for each network.
421
+ */
422
+ declare function defaultStateTreeLookupTables(): {
423
+ mainnet: StateTreeLUTPair[];
424
+ devnet: StateTreeLUTPair[];
425
+ };
426
+ declare const MERKLE_TREE_PUBKEY: Address<"smt1NamzXdq4AMqS2fS2F1i5KTYPZRhoHgWx38d8WsT">;
427
+ declare const NULLIFIER_QUEUE_PUBKEY: Address<"nfq1NvQDJ2GEgnS8zt9prAe8rjjpAW1zFkrvZoBR148">;
428
+ declare const CPI_CONTEXT_PUBKEY: Address<"cpi1uHzrEhBG733DoEJNgHCyRS3XmmyVNZx5fonubE4">;
429
+ declare const MERKLE_TREE_2_PUBKEY: Address<"smt2rJAFdyJJupwMKAqTNAJwvjhmiZ4JYGZmbVRw1Ho">;
430
+ declare const NULLIFIER_QUEUE_2_PUBKEY: Address<"nfq2hgS7NYemXsFaFUCe3EMXSDSfnZnAe27jC6aPP1X">;
431
+ declare const CPI_CONTEXT_2_PUBKEY: Address<"cpi2cdhkH5roePvcudTgUL8ppEBfTay1desGh8G8QxK">;
432
+ declare const ADDRESS_TREE: Address<"amt1Ayt45jfbdw5YSo7iz6WZxUmnZsQTYXy82hVwyC2">;
433
+ declare const ADDRESS_QUEUE: Address<"aq1S9z4reTSQAdgWHGD2zDaS39sjGrAxbR31vxJ2F4F">;
434
+ declare const BATCH_MERKLE_TREE_1: Address<"bmt1LryLZUMmF7ZtqESaw7wifBXLfXHQYoE4GAmrahU">;
435
+ declare const BATCH_QUEUE_1: Address<"oq1na8gojfdUhsfCpyjNt6h4JaDWtHf1yQj4koBWfto">;
436
+ declare const BATCH_CPI_CONTEXT_1: Address<"cpi15BoVPKgEPw5o8wc2T816GE7b378nMXnhH3Xbq4y">;
437
+ declare const BATCH_MERKLE_TREE_2: Address<"bmt2UxoBxB9xWev4BkLvkGdapsz6sZGkzViPNph7VFi">;
438
+ declare const BATCH_QUEUE_2: Address<"oq2UkeMsJLfXt2QHzim242SUi3nvjJs8Pn7Eac9H9vg">;
439
+ declare const BATCH_CPI_CONTEXT_2: Address<"cpi2yGapXUR3As5SjnHBAVvmApNiLsbeZpF3euWnW6B">;
440
+ declare const BATCH_ADDRESS_TREE: Address<"amt2kaJA14v3urZbZvnc5v2np8jqvc4Z8zDep5wbtzx">;
441
+ declare const TEST_BATCH_ADDRESS_TREE: Address<"EzKE84aVTkCUhDHLELqyJaq1Y7UVVmqxXqZjVHwHY3rK">;
442
+ declare const DEFAULT_MERKLE_TREE_HEIGHT = 26;
443
+ declare const DEFAULT_MERKLE_TREE_ROOTS = 2800;
444
+ /** Threshold for UTXO merging (per asset) */
445
+ declare const UTXO_MERGE_THRESHOLD = 20;
446
+ declare const UTXO_MERGE_MAXIMUM = 10;
447
+ /** Tree rollover threshold (95% capacity) */
448
+ declare const TRANSACTION_MERKLE_TREE_ROLLOVER_THRESHOLD: bigint;
449
+ /** Fee per output compressed account (for tree rollover) */
450
+ declare const STATE_MERKLE_TREE_ROLLOVER_FEE: bigint;
451
+ /** Fee per new address (for address tree rollover) */
452
+ declare const ADDRESS_QUEUE_ROLLOVER_FEE = 392n;
453
+ /** Network fee for nullifying compressed accounts */
454
+ declare const STATE_MERKLE_TREE_NETWORK_FEE = 5000n;
455
+ /** V1 network fee per new address */
456
+ declare const ADDRESS_TREE_NETWORK_FEE_V1 = 5000n;
457
+ /** V2 network fee per new address */
458
+ declare const ADDRESS_TREE_NETWORK_FEE_V2 = 10000n;
459
+ /**
460
+ * Derives the account compression authority PDA.
461
+ */
462
+ declare function getAccountCompressionAuthority(): Promise<Address>;
463
+ /**
464
+ * Returns static accounts needed for Light System Program calls.
465
+ */
466
+ declare function defaultStaticAccounts(): Promise<Address[]>;
467
+ /**
468
+ * Check if URL is localhost/localnet.
469
+ * @internal
470
+ */
471
+ declare function isLocalTest(url: string): boolean;
472
+ /**
473
+ * Returns default test state tree accounts for localnet.
474
+ */
475
+ declare function defaultTestStateTreeAccounts(): {
476
+ nullifierQueue: Address;
477
+ merkleTree: Address;
478
+ merkleTreeHeight: number;
479
+ addressTree: Address;
480
+ addressQueue: Address;
481
+ };
482
+ /**
483
+ * Returns active state tree infos for localnet testing.
484
+ * @internal
485
+ */
486
+ declare function localTestActiveStateTreeInfos(): TreeInfo[];
487
+ /**
488
+ * Returns default address tree info.
489
+ */
490
+ declare function getDefaultAddressTreeInfo(): TreeInfo;
491
+ //#endregion
492
+ //#region src/errors.d.ts
493
+ /**
494
+ * Error types for Light Protocol stateless operations.
495
+ */
496
+ declare enum UtxoErrorCode {
497
+ NEGATIVE_LAMPORTS = "NEGATIVE_LAMPORTS",
498
+ NOT_U64 = "NOT_U64",
499
+ BLINDING_EXCEEDS_FIELD_SIZE = "BLINDING_EXCEEDS_FIELD_SIZE",
500
+ }
501
+ declare enum SelectInUtxosErrorCode {
502
+ FAILED_TO_FIND_UTXO_COMBINATION = "FAILED_TO_FIND_UTXO_COMBINATION",
503
+ INVALID_NUMBER_OF_IN_UTXOS = "INVALID_NUMBER_OF_IN_UTXOS",
504
+ }
505
+ declare enum CreateUtxoErrorCode {
506
+ OWNER_UNDEFINED = "OWNER_UNDEFINED",
507
+ INVALID_OUTPUT_UTXO_LENGTH = "INVALID_OUTPUT_UTXO_LENGTH",
508
+ UTXO_DATA_UNDEFINED = "UTXO_DATA_UNDEFINED",
509
+ }
510
+ declare enum RpcErrorCode {
511
+ CONNECTION_UNDEFINED = "CONNECTION_UNDEFINED",
512
+ RPC_PUBKEY_UNDEFINED = "RPC_PUBKEY_UNDEFINED",
513
+ RPC_METHOD_NOT_IMPLEMENTED = "RPC_METHOD_NOT_IMPLEMENTED",
514
+ RPC_INVALID = "RPC_INVALID",
515
+ }
516
+ declare enum LookupTableErrorCode {
517
+ LOOK_UP_TABLE_UNDEFINED = "LOOK_UP_TABLE_UNDEFINED",
518
+ LOOK_UP_TABLE_NOT_INITIALIZED = "LOOK_UP_TABLE_NOT_INITIALIZED",
519
+ }
520
+ declare enum HashErrorCode {
521
+ NO_POSEIDON_HASHER_PROVIDED = "NO_POSEIDON_HASHER_PROVIDED",
522
+ }
523
+ declare enum ProofErrorCode {
524
+ INVALID_PROOF = "INVALID_PROOF",
525
+ PROOF_INPUT_UNDEFINED = "PROOF_INPUT_UNDEFINED",
526
+ PROOF_GENERATION_FAILED = "PROOF_GENERATION_FAILED",
527
+ }
528
+ declare enum MerkleTreeErrorCode {
529
+ MERKLE_TREE_NOT_INITIALIZED = "MERKLE_TREE_NOT_INITIALIZED",
530
+ SOL_MERKLE_TREE_UNDEFINED = "SOL_MERKLE_TREE_UNDEFINED",
531
+ MERKLE_TREE_UNDEFINED = "MERKLE_TREE_UNDEFINED",
532
+ INPUT_UTXO_NOT_INSERTED_IN_MERKLE_TREE = "INPUT_UTXO_NOT_INSERTED_IN_MERKLE_TREE",
533
+ MERKLE_TREE_INDEX_UNDEFINED = "MERKLE_TREE_INDEX_UNDEFINED",
534
+ MERKLE_TREE_SET_SPACE_UNDEFINED = "MERKLE_TREE_SET_SPACE_UNDEFINED",
535
+ }
536
+ declare enum UtilsErrorCode {
537
+ ACCOUNT_NAME_UNDEFINED_IN_IDL = "ACCOUNT_NAME_UNDEFINED_IN_IDL",
538
+ PROPERTY_UNDEFINED = "PROPERTY_UNDEFINED",
539
+ LOOK_UP_TABLE_CREATION_FAILED = "LOOK_UP_TABLE_CREATION_FAILED",
540
+ UNSUPPORTED_ARCHITECTURE = "UNSUPPORTED_ARCHITECTURE",
541
+ UNSUPPORTED_PLATFORM = "UNSUPPORTED_PLATFORM",
542
+ ACCOUNTS_UNDEFINED = "ACCOUNTS_UNDEFINED",
543
+ INVALID_NUMBER = "INVALID_NUMBER",
544
+ }
545
+ declare enum BN254ErrorCode {
546
+ VALUE_TOO_LARGE = "VALUE_TOO_LARGE",
547
+ INVALID_BASE58 = "INVALID_BASE58",
548
+ }
549
+ /**
550
+ * Base error class for Light Protocol errors.
551
+ */
552
+ declare class LightError extends Error {
553
+ readonly code: string;
554
+ readonly functionName: string;
555
+ readonly codeMessage?: string;
556
+ constructor(code: string, functionName: string, codeMessage?: string);
557
+ }
558
+ declare class UtxoError extends LightError {}
559
+ declare class SelectInUtxosError extends LightError {}
560
+ declare class CreateUtxoError extends LightError {}
561
+ declare class RpcError extends LightError {}
562
+ declare class LookupTableError extends LightError {}
563
+ declare class HashError extends LightError {}
564
+ declare class ProofError extends LightError {}
565
+ declare class MerkleTreeError extends LightError {}
566
+ declare class UtilsError extends LightError {}
567
+ declare class BN254Error extends LightError {}
568
+ declare function createUtxoError(code: UtxoErrorCode, functionName: string, message?: string): UtxoError;
569
+ declare function createRpcError(code: RpcErrorCode, functionName: string, message?: string): RpcError;
570
+ declare function createProofError(code: ProofErrorCode, functionName: string, message?: string): ProofError;
571
+ declare function createBN254Error(code: BN254ErrorCode, functionName: string, message?: string): BN254Error;
572
+ //#endregion
573
+ //#region src/utils/conversion.d.ts
574
+ /**
575
+ * Conversion and hashing utilities for Light Protocol.
576
+ *
577
+ * Uses @noble/hashes for Keccak256 - pure JS, works in all environments.
578
+ */
579
+ /**
580
+ * Hash multiple byte arrays with Keccak256 and truncate to BN254 field size.
581
+ *
582
+ * This is the primary hash function used by Light Protocol. It:
583
+ * 1. Concatenates all input arrays
584
+ * 2. Hashes with Keccak256
585
+ * 3. Sets the first byte to 0 to ensure the result fits in BN254 field
586
+ *
587
+ * @param inputs - Array of byte arrays to hash
588
+ * @returns 32-byte hash that fits in BN254 field
589
+ */
590
+ declare function hashvToBn254FieldSizeBe(inputs: Uint8Array[]): Uint8Array;
591
+ /**
592
+ * Hash multiple byte arrays with Keccak256, appending 0xFF bump seed.
593
+ *
594
+ * This variant appends a 255 bump seed before hashing, matching the
595
+ * on-chain behavior for certain hash derivations.
596
+ *
597
+ * @param inputs - Array of byte arrays to hash
598
+ * @returns 32-byte hash that fits in BN254 field
599
+ */
600
+ declare function hashvToBn254FieldSizeBeWithBump(inputs: Uint8Array[]): Uint8Array;
601
+ /**
602
+ * Hash bytes with Keccak256 and find a valid bump seed.
603
+ *
604
+ * @deprecated Use hashvToBn254FieldSizeBe instead.
605
+ *
606
+ * This function iterates through bump seeds (255 down to 0) to find one
607
+ * that produces a hash smaller than the BN254 field size. This is the
608
+ * legacy approach - the simpler truncation method is now preferred.
609
+ *
610
+ * @param bytes - Bytes to hash
611
+ * @returns Tuple of [hash, bumpSeed] or null if no valid bump found
612
+ */
613
+ declare function hashToBn254FieldSizeBe(bytes: Uint8Array): [Uint8Array, number] | null;
614
+ /**
615
+ * Convert hex string to bytes.
616
+ */
617
+ declare function hexToBytes(hex: string): Uint8Array;
618
+ /**
619
+ * Convert bytes to hex string (no 0x prefix).
620
+ */
621
+ declare function bytesToHex(bytes: Uint8Array): string;
622
+ /**
623
+ * Convert bigint to hex string with 0x prefix.
624
+ */
625
+ declare function toHex(value: bigint): string;
626
+ /**
627
+ * Ensure value is an array.
628
+ */
629
+ declare function toArray<T>(value: T | T[]): T[];
630
+ /**
631
+ * Merge bytes arrays into one.
632
+ */
633
+ declare function mergeBytes(arrays: Uint8Array[]): Uint8Array;
634
+ /**
635
+ * Compare two byte arrays for equality.
636
+ */
637
+ declare function bytesEqual(a: Uint8Array, b: Uint8Array): boolean;
638
+ /**
639
+ * Pad bytes to a fixed length (right-pad with zeros).
640
+ */
641
+ declare function padBytes(bytes: Uint8Array, length: number): Uint8Array;
642
+ /**
643
+ * Push unique items to an array.
644
+ * Mutates the array in place.
645
+ */
646
+ declare function pushUniqueItems<T>(items: T[], target: T[]): void;
647
+ /**
648
+ * Convert bytes to decimal string (for ZK circuit compatibility).
649
+ */
650
+ declare function bytesToDecimalString(bytes: Uint8Array): string;
651
+ /**
652
+ * Validate that a hash value is within BN254 field size.
653
+ */
654
+ declare function validateBN254Hash(hash: Uint8Array): boolean;
655
+ /**
656
+ * Assert hash is valid BN254 field element.
657
+ */
658
+ declare function assertValidBN254Hash(hash: Uint8Array): void;
659
+ //#endregion
660
+ //#region src/utils/address.d.ts
661
+ /**
662
+ * Derive an address seed from seeds and program ID.
663
+ *
664
+ * This combines the program ID with user-provided seeds and hashes
665
+ * them to produce a 32-byte seed suitable for address derivation.
666
+ *
667
+ * @param seeds - User-provided seed bytes
668
+ * @param programId - The program ID that "owns" this address
669
+ * @returns 32-byte address seed
670
+ */
671
+ declare function deriveAddressSeed(seeds: Uint8Array[], programId: Address): Uint8Array;
672
+ /**
673
+ * Derive a compressed account address from a seed and address tree.
674
+ *
675
+ * @param seed - 32-byte seed (typically from deriveAddressSeed)
676
+ * @param addressMerkleTreePubkey - The address tree to derive from
677
+ * @returns Derived address as a Solana Address
678
+ *
679
+ * @example
680
+ * ```typescript
681
+ * import { deriveAddressSeed, deriveAddress } from '@cascade-fyi/compression-kit';
682
+ * import { address } from '@solana/kit';
683
+ *
684
+ * const programId = address('YourProgramId...');
685
+ * const seed = deriveAddressSeed([new TextEncoder().encode('my-seed')], programId);
686
+ * const compressedAddress = deriveAddress(seed);
687
+ * ```
688
+ */
689
+ declare function deriveAddress(seed: Uint8Array, addressMerkleTreePubkey?: Address): Address;
690
+ /**
691
+ * Derive address seed using V2 method (no program ID in combined seeds).
692
+ *
693
+ * @param seeds - Seeds to hash together
694
+ * @returns 32-byte address seed
695
+ */
696
+ declare function deriveAddressSeedV2(seeds: Uint8Array[]): Uint8Array;
697
+ /**
698
+ * Derive address using V2 method (matches Rust derive_address_from_seed).
699
+ *
700
+ * @param addressSeed - 32-byte address seed
701
+ * @param addressMerkleTreePubkey - Address tree pubkey
702
+ * @param programId - Program ID
703
+ * @returns Derived address
704
+ */
705
+ declare function deriveAddressV2(addressSeed: Uint8Array, addressMerkleTreePubkey: Address, programId: Address): Address;
706
+ /**
707
+ * Get the index of an address in an array, adding it if not present.
708
+ */
709
+ declare function getIndexOrAdd(accounts: Address[], pubkey: Address): number;
710
+ /**
711
+ * Pack new address params for instruction data.
712
+ *
713
+ * Converts NewAddressParams to NewAddressParamsPacked by replacing
714
+ * pubkeys with their indices in the remaining accounts array.
715
+ *
716
+ * @param newAddressParams - Array of new address parameters
717
+ * @param remainingAccounts - Existing remaining accounts (will be modified)
718
+ * @returns Packed params and updated remaining accounts
719
+ */
720
+ declare function packNewAddressParams(newAddressParams: NewAddressParams[], remainingAccounts: Address[]): {
721
+ newAddressParamsPacked: NewAddressParamsPacked[];
722
+ remainingAccounts: Address[];
723
+ };
724
+ /**
725
+ * Convert an address to bytes.
726
+ */
727
+ declare function addressToBytes(addr: Address): Uint8Array;
728
+ /**
729
+ * Convert bytes to an address.
730
+ *
731
+ * Note: This performs base58 encoding on the bytes. The bytes should
732
+ * be a valid 32-byte representation of an address.
733
+ */
734
+ declare function bytesToAddress(bytes: Uint8Array): Address;
735
+ //#endregion
736
+ //#region src/utils/instruction.d.ts
737
+ /**
738
+ * Configuration for Light System Program account metas.
739
+ */
740
+ interface SystemAccountMetaConfig {
741
+ /** The program making the CPI call */
742
+ selfProgram: Address;
743
+ /** Optional CPI context account */
744
+ cpiContext?: Address;
745
+ /** Optional SOL compression recipient */
746
+ solCompressionRecipient?: Address;
747
+ /** Optional SOL pool PDA */
748
+ solPoolPda?: Address;
749
+ }
750
+ /**
751
+ * Create a basic system account config.
752
+ */
753
+ declare function createSystemAccountConfig(selfProgram: Address): SystemAccountMetaConfig;
754
+ /**
755
+ * Create a system account config with CPI context.
756
+ */
757
+ declare function createSystemAccountConfigWithCpi(selfProgram: Address, cpiContext: Address): SystemAccountMetaConfig;
758
+ /**
759
+ * Derive the CPI signer PDA for a program.
760
+ */
761
+ declare function getCpiSignerPda(selfProgram: Address): Promise<Address>;
762
+ /**
763
+ * Derive the account compression authority PDA.
764
+ */
765
+ declare function getAccountCompressionAuthority$1(): Promise<Address>;
766
+ /**
767
+ * Get the system program address.
768
+ */
769
+ declare function getSystemProgram(): Address;
770
+ /**
771
+ * Build Light System account metas (V1 layout).
772
+ *
773
+ * @param config - System account configuration
774
+ * @returns Array of account metas for Light System Program
775
+ *
776
+ * @example
777
+ * ```typescript
778
+ * import { getLightSystemAccountMetas, createSystemAccountConfig } from '@cascade-fyi/compression-kit';
779
+ * import { address } from '@solana/kit';
780
+ *
781
+ * const programId = address('YourProgramId...');
782
+ * const config = createSystemAccountConfig(programId);
783
+ * const metas = await getLightSystemAccountMetas(config);
784
+ * ```
785
+ */
786
+ declare function getLightSystemAccountMetas(config: SystemAccountMetaConfig): Promise<AccountMeta[]>;
787
+ /**
788
+ * Build Light System account metas (V2 layout - no noop program).
789
+ */
790
+ declare function getLightSystemAccountMetasV2(config: SystemAccountMetaConfig): Promise<AccountMeta[]>;
791
+ /**
792
+ * Helper class for building remaining accounts for Light Protocol instructions.
793
+ *
794
+ * Manages three categories of accounts:
795
+ * 1. Pre-accounts: Signers and other accounts that come first
796
+ * 2. System accounts: Light System Program static accounts
797
+ * 3. Packed accounts: Dynamic accounts indexed by pubkey
798
+ */
799
+ declare class PackedAccounts {
800
+ private preAccounts;
801
+ private systemAccounts;
802
+ private nextIndex;
803
+ private accountMap;
804
+ /**
805
+ * Create a new PackedAccounts with system accounts (V1 layout).
806
+ */
807
+ static newWithSystemAccounts(config: SystemAccountMetaConfig): Promise<PackedAccounts>;
808
+ /**
809
+ * Create a new PackedAccounts with system accounts (V2 layout).
810
+ */
811
+ static newWithSystemAccountsV2(config: SystemAccountMetaConfig): Promise<PackedAccounts>;
812
+ /**
813
+ * Add a signer to pre-accounts (readonly).
814
+ */
815
+ addPreAccountsSigner(pubkey: Address): void;
816
+ /**
817
+ * Add a writable signer to pre-accounts.
818
+ */
819
+ addPreAccountsSignerMut(pubkey: Address): void;
820
+ /**
821
+ * Add an account meta to pre-accounts.
822
+ */
823
+ addPreAccountsMeta(accountMeta: AccountMeta): void;
824
+ /**
825
+ * Add system accounts (V1 layout).
826
+ */
827
+ addSystemAccounts(config: SystemAccountMetaConfig): Promise<void>;
828
+ /**
829
+ * Add system accounts (V2 layout).
830
+ */
831
+ addSystemAccountsV2(config: SystemAccountMetaConfig): Promise<void>;
832
+ /**
833
+ * Insert or get index for a writable account.
834
+ */
835
+ insertOrGet(pubkey: Address): number;
836
+ /**
837
+ * Insert or get index for a readonly account.
838
+ */
839
+ insertOrGetReadOnly(pubkey: Address): number;
840
+ /**
841
+ * Insert or get index with full configuration.
842
+ */
843
+ insertOrGetConfig(pubkey: Address, isSigner: boolean, isWritable: boolean): number;
844
+ /**
845
+ * Get packed accounts sorted by insertion order.
846
+ */
847
+ private getPackedAccountMetas;
848
+ /**
849
+ * Get offsets for system and packed accounts.
850
+ */
851
+ private getOffsets;
852
+ /**
853
+ * Build final remaining accounts array with offsets.
854
+ */
855
+ toAccountMetas(): {
856
+ remainingAccounts: AccountMeta[];
857
+ systemStart: number;
858
+ packedStart: number;
859
+ };
860
+ }
861
+ //#endregion
862
+ //#region src/rpc.d.ts
863
+ /**
864
+ * Context wrapper for RPC responses.
865
+ */
866
+ interface WithContext<T> {
867
+ context: {
868
+ slot: number;
869
+ };
870
+ value: T;
871
+ }
872
+ /**
873
+ * Cursor-based pagination wrapper.
874
+ */
875
+ interface WithCursor<T> {
876
+ cursor: string | null;
877
+ items: T;
878
+ }
879
+ /**
880
+ * Options for paginated requests.
881
+ */
882
+ interface PaginatedOptions {
883
+ cursor?: string;
884
+ limit?: number;
885
+ }
886
+ /**
887
+ * Options for getCompressedAccountsByOwner.
888
+ */
889
+ interface GetCompressedAccountsByOwnerConfig {
890
+ cursor?: string;
891
+ limit?: number;
892
+ }
893
+ /**
894
+ * Options for getCompressedTokenAccountsByOwner.
895
+ */
896
+ interface GetCompressedTokenAccountsConfig {
897
+ mint?: Address;
898
+ cursor?: string;
899
+ limit?: number;
900
+ }
901
+ /**
902
+ * Hash with tree info for proof requests.
903
+ */
904
+ interface HashWithTreeInfo {
905
+ hash: BN254;
906
+ stateTreeInfo: TreeInfo;
907
+ }
908
+ /**
909
+ * Address with tree info for proof requests.
910
+ */
911
+ interface AddressWithTreeInfo {
912
+ address: BN254;
913
+ addressTreeInfo: TreeInfo;
914
+ }
915
+ /**
916
+ * Signature metadata from compression indexer.
917
+ */
918
+ interface SignatureWithMetadata {
919
+ blockTime: number;
920
+ signature: string;
921
+ slot: number;
922
+ }
923
+ /**
924
+ * Token balance info.
925
+ */
926
+ interface TokenBalance {
927
+ balance: bigint;
928
+ mint: Address;
929
+ }
930
+ /**
931
+ * Light Protocol Photon RPC client.
932
+ *
933
+ * Provides methods for querying compressed accounts, requesting validity proofs,
934
+ * and other indexer operations.
935
+ */
936
+ declare class PhotonRpc {
937
+ readonly endpoint: string;
938
+ private readonly headers;
939
+ constructor(endpoint: string, headers?: Record<string, string>);
940
+ /**
941
+ * Make a JSON-RPC request to the Photon indexer.
942
+ */
943
+ private request;
944
+ /**
945
+ * Request with context wrapper.
946
+ */
947
+ private requestWithContext;
948
+ /**
949
+ * Get indexer health status.
950
+ */
951
+ getIndexerHealth(): Promise<string>;
952
+ /**
953
+ * Get current indexer slot.
954
+ */
955
+ getIndexerSlot(): Promise<number>;
956
+ /**
957
+ * Get a single compressed account by address or hash.
958
+ */
959
+ getCompressedAccount(addressOrHash: {
960
+ address?: Address;
961
+ hash?: BN254;
962
+ }): Promise<CompressedAccount | null>;
963
+ /**
964
+ * Get multiple compressed accounts by hashes.
965
+ */
966
+ getMultipleCompressedAccounts(hashes: BN254[]): Promise<CompressedAccount[]>;
967
+ /**
968
+ * Get compressed accounts by owner.
969
+ */
970
+ getCompressedAccountsByOwner(owner: Address, config?: GetCompressedAccountsByOwnerConfig): Promise<WithCursor<CompressedAccount[]>>;
971
+ /**
972
+ * Get compressed SOL balance by owner.
973
+ */
974
+ getCompressedBalanceByOwner(owner: Address): Promise<bigint>;
975
+ /**
976
+ * Get merkle proof for a compressed account.
977
+ */
978
+ getCompressedAccountProof(hash: BN254): Promise<MerkleContextWithProof>;
979
+ /**
980
+ * Get merkle proofs for multiple compressed accounts.
981
+ */
982
+ getMultipleCompressedAccountProofs(hashes: BN254[]): Promise<MerkleContextWithProof[]>;
983
+ /**
984
+ * Get validity proof for compressed accounts and/or new addresses.
985
+ *
986
+ * This is the main method for obtaining ZK proofs needed to use
987
+ * compressed accounts in transactions.
988
+ */
989
+ getValidityProof(hashes: HashWithTreeInfo[], newAddresses: AddressWithTreeInfo[]): Promise<ValidityProofWithContext>;
990
+ /**
991
+ * Get compressed token accounts by owner.
992
+ */
993
+ getCompressedTokenAccountsByOwner(owner: Address, config?: GetCompressedTokenAccountsConfig): Promise<WithCursor<ParsedTokenAccount[]>>;
994
+ /**
995
+ * Get compressed token balances by owner.
996
+ */
997
+ getCompressedTokenBalancesByOwner(owner: Address, config?: GetCompressedTokenAccountsConfig): Promise<WithCursor<TokenBalance[]>>;
998
+ /**
999
+ * Get compression signatures for an account hash.
1000
+ */
1001
+ getCompressionSignaturesForAccount(hash: BN254): Promise<SignatureWithMetadata[]>;
1002
+ /**
1003
+ * Get compression signatures for an address.
1004
+ */
1005
+ getCompressionSignaturesForAddress(addr: Address, options?: PaginatedOptions): Promise<WithCursor<SignatureWithMetadata[]>>;
1006
+ /**
1007
+ * Get compression signatures for an owner.
1008
+ */
1009
+ getCompressionSignaturesForOwner(owner: Address, options?: PaginatedOptions): Promise<WithCursor<SignatureWithMetadata[]>>;
1010
+ /**
1011
+ * Get latest non-voting signatures (compression transactions).
1012
+ */
1013
+ getLatestCompressionSignatures(cursor?: string, limit?: number): Promise<WithCursor<SignatureWithMetadata[]>>;
1014
+ }
1015
+ /**
1016
+ * Create a Photon RPC client.
1017
+ *
1018
+ * @param endpoint - Photon indexer URL (e.g., "https://zk-testnet.helius.dev:8784")
1019
+ * @param headers - Optional additional headers
1020
+ * @returns PhotonRpc instance
1021
+ *
1022
+ * @example
1023
+ * ```typescript
1024
+ * import { createPhotonRpc } from '@cascade-fyi/compression-kit';
1025
+ *
1026
+ * const rpc = createPhotonRpc('https://mainnet.helius-rpc.com/?api-key=YOUR_KEY');
1027
+ * const accounts = await rpc.getCompressedAccountsByOwner(ownerAddress);
1028
+ * ```
1029
+ */
1030
+ declare function createPhotonRpc(endpoint: string, headers?: Record<string, string>): PhotonRpc;
1031
+ //#endregion
1032
+ export { ACCOUNT_COMPRESSION_PROGRAM, ADDRESS_QUEUE, ADDRESS_QUEUE_ROLLOVER_FEE, ADDRESS_TREE, ADDRESS_TREE_NETWORK_FEE_V1, ADDRESS_TREE_NETWORK_FEE_V2, type AccountProofInput, type AddressTreeInfo, type AddressWithTreeInfo, BATCH_ADDRESS_TREE, BATCH_CPI_CONTEXT_1, BATCH_CPI_CONTEXT_2, BATCH_MERKLE_TREE_1, BATCH_MERKLE_TREE_2, BATCH_QUEUE_1, BATCH_QUEUE_2, type BN254, BN254Error, BN254ErrorCode, COMPRESSED_TOKEN_PROGRAM, COMPUTE_BUDGET_PATTERN, CPI_CONTEXT_2_PUBKEY, CPI_CONTEXT_PUBKEY, type CompressedAccount, type CompressedAccountData, type CompressedAccountMeta, type CompressedCpiContext, CreateUtxoError, CreateUtxoErrorCode, DEFAULT_MERKLE_TREE_HEIGHT, DEFAULT_MERKLE_TREE_ROOTS, FIELD_SIZE, type GetCompressedAccountsByOwnerConfig, type GetCompressedTokenAccountsConfig, HIGHEST_ADDRESS_PLUS_ONE, HashError, HashErrorCode, type HashWithTreeInfo, INSERT_INTO_QUEUES_DISCRIMINATOR, INVOKE_CPI_DISCRIMINATOR, INVOKE_CPI_WITH_ACCOUNT_INFO_DISCRIMINATOR, INVOKE_CPI_WITH_READ_ONLY_DISCRIMINATOR, INVOKE_DISCRIMINATOR, LIGHT_SYSTEM_PROGRAM, LookupTableError, LookupTableErrorCode, MERKLE_TREE_2_PUBKEY, MERKLE_TREE_PUBKEY, type MerkleContext, type MerkleContextWithProof, MerkleTreeError, MerkleTreeErrorCode, NOOP_PROGRAM, NULLIFIED_STATE_TREE_LOOKUP_TABLE_DEVNET, NULLIFIED_STATE_TREE_LOOKUP_TABLE_MAINNET, NULLIFIER_QUEUE_2_PUBKEY, NULLIFIER_QUEUE_PUBKEY, type NewAddressParams, type NewAddressParamsPacked, type NewAddressProofInput, PackedAccounts, type PackedAddressTreeInfo, type PackedMerkleContext, type PackedStateTreeInfo, type PaginatedOptions, type ParsedTokenAccount, PhotonRpc, ProofError, ProofErrorCode, REGISTERED_PROGRAM_PDA, RpcError, RpcErrorCode, STATE_MERKLE_TREE_NETWORK_FEE, STATE_MERKLE_TREE_ROLLOVER_FEE, STATE_TREE_LOOKUP_TABLE_DEVNET, STATE_TREE_LOOKUP_TABLE_MAINNET, SelectInUtxosError, SelectInUtxosErrorCode, type SignatureWithMetadata, type StateTreeInfo, type StateTreeLUTPair, type SystemAccountMetaConfig, TEST_BATCH_ADDRESS_TREE, TRANSACTION_MERKLE_TREE_ROLLOVER_THRESHOLD, type TokenBalance, type TokenData, type TreeInfo, TreeType, UTXO_MERGE_MAXIMUM, UTXO_MERGE_THRESHOLD, UtilsError, UtilsErrorCode, UtxoError, UtxoErrorCode, VERSION, type ValidityProof, type ValidityProofWithContext, type WithContext, type WithCursor, addressToBytes, assertIsBN254, assertValidBN254Hash, bigIntToBytesBE, bigIntToBytesLE, bn254Add, bn254FromBytes, bn254Mul, bn254Sub, bn254ToBytes, bn254ToDecimalString, bytesEqual, bytesToAddress, bytesToBigIntBE, bytesToBigIntLE, bytesToDecimalString, bytesToHex, createBN254, createBN254Error, createPhotonRpc, createProofError, createRpcError, createSystemAccountConfig, createSystemAccountConfigWithCpi, createUtxoError, defaultStateTreeLookupTables, defaultStaticAccounts, defaultTestStateTreeAccounts, deriveAddress, deriveAddressSeed, deriveAddressSeedV2, deriveAddressV2, encodeBN254toBase58, encodeBN254toHex, featureFlags, getAccountCompressionAuthority, getAccountCompressionAuthority$1 as getCompressionAuthority, getCpiSignerPda, getDefaultAddressTreeInfo, getIndexOrAdd, getLightSystemAccountMetas, getLightSystemAccountMetasV2, getSystemProgram, hashToBn254FieldSizeBe, hashvToBn254FieldSizeBe, hashvToBn254FieldSizeBeWithBump, hexToBytes, isBN254, isLocalTest, isSmallerThanFieldSize, localTestActiveStateTreeInfos, mergeBytes, packNewAddressParams, padBytes, pushUniqueItems, toArray, toHex, validateBN254Hash, versionedEndpoint };
1033
+ //# sourceMappingURL=index.d.cts.map