@lightprotocol/stateless.js 0.17.2-alpha.1 → 0.18.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.
Files changed (60) hide show
  1. package/dist/cjs/browser/constants.d.ts +2 -0
  2. package/dist/cjs/browser/idl.d.ts +1015 -0
  3. package/dist/cjs/browser/index.cjs +1 -1
  4. package/dist/cjs/browser/index.cjs.map +1 -1
  5. package/dist/cjs/browser/index.d.ts +1 -0
  6. package/dist/cjs/browser/rpc-interface.d.ts +107 -114
  7. package/dist/cjs/browser/state/types.d.ts +5 -0
  8. package/dist/cjs/browser/utils/test-utils.d.ts +8 -0
  9. package/dist/cjs/node/constants.d.ts +2 -0
  10. package/dist/cjs/node/idl.d.ts +1015 -0
  11. package/dist/cjs/node/index.cjs +1 -1
  12. package/dist/cjs/node/index.cjs.map +1 -1
  13. package/dist/cjs/node/index.d.ts +1 -0
  14. package/dist/cjs/node/rpc-interface.d.ts +107 -114
  15. package/dist/cjs/node/state/types.d.ts +5 -0
  16. package/dist/cjs/node/utils/test-utils.d.ts +8 -0
  17. package/dist/types/index.d.ts +1032 -9
  18. package/package.json +6 -5
  19. package/dist/es/browser/actions/common.d.ts +0 -3
  20. package/dist/es/browser/actions/compress.d.ts +0 -16
  21. package/dist/es/browser/actions/create-account.d.ts +0 -41
  22. package/dist/es/browser/actions/decompress.d.ts +0 -16
  23. package/dist/es/browser/actions/index.d.ts +0 -5
  24. package/dist/es/browser/actions/transfer.d.ts +0 -20
  25. package/dist/es/browser/constants.d.ts +0 -63
  26. package/dist/es/browser/errors.d.ts +0 -74
  27. package/dist/es/browser/index.d.ts +0 -10
  28. package/dist/es/browser/index.js +0 -2
  29. package/dist/es/browser/index.js.map +0 -1
  30. package/dist/es/browser/instruction/index.d.ts +0 -1
  31. package/dist/es/browser/instruction/pack-compressed-accounts.d.ts +0 -35
  32. package/dist/es/browser/programs/index.d.ts +0 -2
  33. package/dist/es/browser/programs/layout.d.ts +0 -25
  34. package/dist/es/browser/programs/system.d.ts +0 -199
  35. package/dist/es/browser/rpc-interface.d.ts +0 -1179
  36. package/dist/es/browser/rpc.d.ts +0 -275
  37. package/dist/es/browser/state/BN254.d.ts +0 -14
  38. package/dist/es/browser/state/compressed-account.d.ts +0 -31
  39. package/dist/es/browser/state/index.d.ts +0 -3
  40. package/dist/es/browser/state/types.d.ts +0 -91
  41. package/dist/es/browser/test-helpers/index.d.ts +0 -2
  42. package/dist/es/browser/test-helpers/merkle-tree/index.d.ts +0 -2
  43. package/dist/es/browser/test-helpers/merkle-tree/indexed-array.d.ts +0 -85
  44. package/dist/es/browser/test-helpers/merkle-tree/merkle-tree.d.ts +0 -92
  45. package/dist/es/browser/test-helpers/test-rpc/get-compressed-accounts.d.ts +0 -7
  46. package/dist/es/browser/test-helpers/test-rpc/get-compressed-token-accounts.d.ts +0 -40
  47. package/dist/es/browser/test-helpers/test-rpc/get-parsed-events.d.ts +0 -13
  48. package/dist/es/browser/test-helpers/test-rpc/index.d.ts +0 -3
  49. package/dist/es/browser/test-helpers/test-rpc/test-rpc.d.ts +0 -249
  50. package/dist/es/browser/utils/address.d.ts +0 -63
  51. package/dist/es/browser/utils/airdrop.d.ts +0 -7
  52. package/dist/es/browser/utils/calculate-compute-unit-price.d.ts +0 -7
  53. package/dist/es/browser/utils/conversion.d.ts +0 -31
  54. package/dist/es/browser/utils/index.d.ts +0 -10
  55. package/dist/es/browser/utils/parse-validity-proof.d.ts +0 -20
  56. package/dist/es/browser/utils/pipe.d.ts +0 -2
  57. package/dist/es/browser/utils/send-and-confirm.d.ts +0 -52
  58. package/dist/es/browser/utils/sleep.d.ts +0 -1
  59. package/dist/es/browser/utils/test-utils.d.ts +0 -23
  60. package/dist/es/browser/utils/validation.d.ts +0 -4
@@ -1,1179 +0,0 @@
1
- import { PublicKey, MemcmpFilter, DataSlice } from '@solana/web3.js';
2
- import { Struct } from 'superstruct';
3
- import { BN254, CompressedProof, CompressedAccountWithMerkleContext, MerkleContextWithMerkleProof, TokenData } from './state';
4
- import BN from 'bn.js';
5
- export declare class BaseRpc {
6
- private getCancellationPromise;
7
- private getTransactionConfirmationPromise;
8
- private confirmTransactionUsingBlockHeightExceedanceStrategy;
9
- private confirmTransactionUsingDurableNonceStrategy;
10
- private confirmTransactionUsingLegacyTimeoutStrategy;
11
- }
12
- export interface LatestNonVotingSignatures {
13
- context: {
14
- slot: number;
15
- };
16
- value: {
17
- items: {
18
- signature: string;
19
- slot: number;
20
- blockTime: number;
21
- error: string | null;
22
- }[];
23
- };
24
- }
25
- export interface GetCompressedAccountsByOwnerConfig {
26
- filters?: GetCompressedAccountsFilter[];
27
- dataSlice?: DataSlice;
28
- cursor?: string;
29
- limit?: BN;
30
- }
31
- export interface CompressedMintTokenHolders {
32
- balance: BN;
33
- owner: PublicKey;
34
- }
35
- export interface LatestNonVotingSignaturesPaginated {
36
- context: {
37
- slot: number;
38
- };
39
- value: {
40
- items: {
41
- signature: string;
42
- slot: number;
43
- blockTime: number;
44
- }[];
45
- cursor: string | null;
46
- };
47
- }
48
- export interface SignatureWithMetadata {
49
- blockTime: number;
50
- signature: string;
51
- slot: number;
52
- }
53
- export interface HashWithTree {
54
- hash: BN254;
55
- tree: PublicKey;
56
- queue: PublicKey;
57
- }
58
- export interface AddressWithTree {
59
- address: BN254;
60
- tree: PublicKey;
61
- queue: PublicKey;
62
- }
63
- export interface CompressedTransaction {
64
- compressionInfo: {
65
- closedAccounts: {
66
- account: CompressedAccountWithMerkleContext;
67
- maybeTokenData: TokenData | null;
68
- }[];
69
- openedAccounts: {
70
- account: CompressedAccountWithMerkleContext;
71
- maybeTokenData: TokenData | null;
72
- }[];
73
- preTokenBalances?: {
74
- owner: PublicKey;
75
- mint: PublicKey;
76
- amount: BN;
77
- }[];
78
- postTokenBalances?: {
79
- owner: PublicKey;
80
- mint: PublicKey;
81
- amount: BN;
82
- }[];
83
- };
84
- transaction: any;
85
- }
86
- export interface HexBatchInputsForProver {
87
- 'input-compressed-accounts': HexInputsForProver[];
88
- }
89
- export interface HexInputsForProver {
90
- root: string;
91
- pathIndex: number;
92
- pathElements: string[];
93
- leaf: string;
94
- }
95
- export type CompressedProofWithContext = {
96
- compressedProof: CompressedProof;
97
- roots: BN[];
98
- rootIndices: number[];
99
- leafIndices: number[];
100
- leaves: BN[];
101
- merkleTrees: PublicKey[];
102
- nullifierQueues: PublicKey[];
103
- };
104
- export interface GetCompressedTokenAccountsByOwnerOrDelegateOptions {
105
- mint?: PublicKey;
106
- cursor?: string;
107
- limit?: BN;
108
- }
109
- export type TokenBalance = {
110
- balance: BN;
111
- mint: PublicKey;
112
- };
113
- /**
114
- * **Cursor** is a unique identifier for a page of results by which the next page can be fetched.
115
- *
116
- * **Limit** is the maximum number of results to return per page.
117
- */
118
- export interface PaginatedOptions {
119
- cursor?: string;
120
- limit?: BN;
121
- }
122
- /**
123
- * Note, DataSizeFilter is currently not available.
124
- */
125
- export type GetCompressedAccountsFilter = MemcmpFilter;
126
- export type GetCompressedAccountConfig = {
127
- encoding?: string;
128
- };
129
- export type GetCompressedAccountsConfig = {
130
- dataSlice: DataSlice;
131
- filters?: GetCompressedAccountsFilter[];
132
- };
133
- export interface ParsedTokenAccount {
134
- compressedAccount: CompressedAccountWithMerkleContext;
135
- parsed: TokenData;
136
- }
137
- export type WithContext<T> = {
138
- /** context */
139
- context: {
140
- slot: number;
141
- };
142
- /** response value */
143
- value: T;
144
- };
145
- export type WithCursor<T> = {
146
- /** context */
147
- cursor: string | null;
148
- /** response value */
149
- items: T;
150
- };
151
- /**
152
- * @internal
153
- */
154
- export declare function createRpcResult<T, U>(result: Struct<T, U>): Struct<RpcResult<T>, null>;
155
- /**
156
- * @internal
157
- */
158
- export declare function jsonRpcResult<T, U>(schema: Struct<T, U>): Struct<RpcResult<T>, null>;
159
- export type WithRpcContext<T> = {
160
- context: {
161
- slot: number;
162
- };
163
- value: T;
164
- };
165
- /**
166
- * @internal
167
- */
168
- export declare function jsonRpcResultAndContext<T, U>(value: Struct<T, U>): Struct<RpcResult<WithRpcContext<T>>, null>;
169
- /**
170
- * @internal
171
- */
172
- export declare const CompressedAccountResult: Struct<{
173
- data: {
174
- data: string;
175
- dataHash: BN;
176
- discriminator: BN;
177
- } | null;
178
- lamports: BN;
179
- address: number[] | null;
180
- hash: BN;
181
- owner: PublicKey;
182
- leafIndex: number;
183
- tree: PublicKey;
184
- seq: BN | null;
185
- slotCreated: BN;
186
- }, {
187
- address: Struct<number[] | null, null>;
188
- hash: Struct<BN, null>;
189
- data: Struct<{
190
- data: string;
191
- dataHash: BN;
192
- discriminator: BN;
193
- } | null, {
194
- data: Struct<string, null>;
195
- dataHash: Struct<BN, null>;
196
- discriminator: Struct<BN, null>;
197
- }>;
198
- lamports: Struct<BN, null>;
199
- owner: Struct<PublicKey, null>;
200
- leafIndex: Struct<number, null>;
201
- tree: Struct<PublicKey, null>;
202
- seq: Struct<BN | null, null>;
203
- slotCreated: Struct<BN, null>;
204
- }>;
205
- export declare const TokenDataResult: Struct<{
206
- owner: PublicKey;
207
- mint: PublicKey;
208
- amount: BN;
209
- delegate: PublicKey | null;
210
- state: string;
211
- }, {
212
- mint: Struct<PublicKey, null>;
213
- owner: Struct<PublicKey, null>;
214
- amount: Struct<BN, null>;
215
- delegate: Struct<PublicKey | null, null>;
216
- state: Struct<string, null>;
217
- }>;
218
- /**
219
- * @internal
220
- */
221
- export declare const CompressedTokenAccountResult: Struct<{
222
- tokenData: {
223
- owner: PublicKey;
224
- mint: PublicKey;
225
- amount: BN;
226
- delegate: PublicKey | null;
227
- state: string;
228
- };
229
- account: {
230
- data: {
231
- data: string;
232
- dataHash: BN;
233
- discriminator: BN;
234
- } | null;
235
- lamports: BN;
236
- address: number[] | null;
237
- hash: BN;
238
- owner: PublicKey;
239
- leafIndex: number;
240
- tree: PublicKey;
241
- seq: BN | null;
242
- slotCreated: BN;
243
- };
244
- }, {
245
- tokenData: Struct<{
246
- owner: PublicKey;
247
- mint: PublicKey;
248
- amount: BN;
249
- delegate: PublicKey | null;
250
- state: string;
251
- }, {
252
- mint: Struct<PublicKey, null>;
253
- owner: Struct<PublicKey, null>;
254
- amount: Struct<BN, null>;
255
- delegate: Struct<PublicKey | null, null>;
256
- state: Struct<string, null>;
257
- }>;
258
- account: Struct<{
259
- data: {
260
- data: string;
261
- dataHash: BN;
262
- discriminator: BN;
263
- } | null;
264
- lamports: BN;
265
- address: number[] | null;
266
- hash: BN;
267
- owner: PublicKey;
268
- leafIndex: number;
269
- tree: PublicKey;
270
- seq: BN | null;
271
- slotCreated: BN;
272
- }, {
273
- address: Struct<number[] | null, null>;
274
- hash: Struct<BN, null>;
275
- data: Struct<{
276
- data: string;
277
- dataHash: BN;
278
- discriminator: BN;
279
- } | null, {
280
- data: Struct<string, null>;
281
- dataHash: Struct<BN, null>;
282
- discriminator: Struct<BN, null>;
283
- }>;
284
- lamports: Struct<BN, null>;
285
- owner: Struct<PublicKey, null>;
286
- leafIndex: Struct<number, null>;
287
- tree: Struct<PublicKey, null>;
288
- seq: Struct<BN | null, null>;
289
- slotCreated: Struct<BN, null>;
290
- }>;
291
- }>;
292
- /**
293
- * @internal
294
- */
295
- export declare const MultipleCompressedAccountsResult: Struct<{
296
- items: {
297
- data: {
298
- data: string;
299
- dataHash: BN;
300
- discriminator: BN;
301
- } | null;
302
- lamports: BN;
303
- address: number[] | null;
304
- hash: BN;
305
- owner: PublicKey;
306
- leafIndex: number;
307
- tree: PublicKey;
308
- seq: BN | null;
309
- slotCreated: BN;
310
- }[];
311
- }, {
312
- items: Struct<{
313
- data: {
314
- data: string;
315
- dataHash: BN;
316
- discriminator: BN;
317
- } | null;
318
- lamports: BN;
319
- address: number[] | null;
320
- hash: BN;
321
- owner: PublicKey;
322
- leafIndex: number;
323
- tree: PublicKey;
324
- seq: BN | null;
325
- slotCreated: BN;
326
- }[], Struct<{
327
- data: {
328
- data: string;
329
- dataHash: BN;
330
- discriminator: BN;
331
- } | null;
332
- lamports: BN;
333
- address: number[] | null;
334
- hash: BN;
335
- owner: PublicKey;
336
- leafIndex: number;
337
- tree: PublicKey;
338
- seq: BN | null;
339
- slotCreated: BN;
340
- }, {
341
- address: Struct<number[] | null, null>;
342
- hash: Struct<BN, null>;
343
- data: Struct<{
344
- data: string;
345
- dataHash: BN;
346
- discriminator: BN;
347
- } | null, {
348
- data: Struct<string, null>;
349
- dataHash: Struct<BN, null>;
350
- discriminator: Struct<BN, null>;
351
- }>;
352
- lamports: Struct<BN, null>;
353
- owner: Struct<PublicKey, null>;
354
- leafIndex: Struct<number, null>;
355
- tree: Struct<PublicKey, null>;
356
- seq: Struct<BN | null, null>;
357
- slotCreated: Struct<BN, null>;
358
- }>>;
359
- }>;
360
- /**
361
- * @internal
362
- */
363
- export declare const CompressedAccountsByOwnerResult: Struct<{
364
- items: {
365
- data: {
366
- data: string;
367
- dataHash: BN;
368
- discriminator: BN;
369
- } | null;
370
- lamports: BN;
371
- address: number[] | null;
372
- hash: BN;
373
- owner: PublicKey;
374
- leafIndex: number;
375
- tree: PublicKey;
376
- seq: BN | null;
377
- slotCreated: BN;
378
- }[];
379
- cursor: string | null;
380
- }, {
381
- items: Struct<{
382
- data: {
383
- data: string;
384
- dataHash: BN;
385
- discriminator: BN;
386
- } | null;
387
- lamports: BN;
388
- address: number[] | null;
389
- hash: BN;
390
- owner: PublicKey;
391
- leafIndex: number;
392
- tree: PublicKey;
393
- seq: BN | null;
394
- slotCreated: BN;
395
- }[], Struct<{
396
- data: {
397
- data: string;
398
- dataHash: BN;
399
- discriminator: BN;
400
- } | null;
401
- lamports: BN;
402
- address: number[] | null;
403
- hash: BN;
404
- owner: PublicKey;
405
- leafIndex: number;
406
- tree: PublicKey;
407
- seq: BN | null;
408
- slotCreated: BN;
409
- }, {
410
- address: Struct<number[] | null, null>;
411
- hash: Struct<BN, null>;
412
- data: Struct<{
413
- data: string;
414
- dataHash: BN;
415
- discriminator: BN;
416
- } | null, {
417
- data: Struct<string, null>;
418
- dataHash: Struct<BN, null>;
419
- discriminator: Struct<BN, null>;
420
- }>;
421
- lamports: Struct<BN, null>;
422
- owner: Struct<PublicKey, null>;
423
- leafIndex: Struct<number, null>;
424
- tree: Struct<PublicKey, null>;
425
- seq: Struct<BN | null, null>;
426
- slotCreated: Struct<BN, null>;
427
- }>>;
428
- cursor: Struct<string | null, null>;
429
- }>;
430
- /**
431
- * @internal
432
- */
433
- export declare const CompressedTokenAccountsByOwnerOrDelegateResult: Struct<{
434
- items: {
435
- tokenData: {
436
- owner: PublicKey;
437
- mint: PublicKey;
438
- amount: BN;
439
- delegate: PublicKey | null;
440
- state: string;
441
- };
442
- account: {
443
- data: {
444
- data: string;
445
- dataHash: BN;
446
- discriminator: BN;
447
- } | null;
448
- lamports: BN;
449
- address: number[] | null;
450
- hash: BN;
451
- owner: PublicKey;
452
- leafIndex: number;
453
- tree: PublicKey;
454
- seq: BN | null;
455
- slotCreated: BN;
456
- };
457
- }[];
458
- cursor: string | null;
459
- }, {
460
- items: Struct<{
461
- tokenData: {
462
- owner: PublicKey;
463
- mint: PublicKey;
464
- amount: BN;
465
- delegate: PublicKey | null;
466
- state: string;
467
- };
468
- account: {
469
- data: {
470
- data: string;
471
- dataHash: BN;
472
- discriminator: BN;
473
- } | null;
474
- lamports: BN;
475
- address: number[] | null;
476
- hash: BN;
477
- owner: PublicKey;
478
- leafIndex: number;
479
- tree: PublicKey;
480
- seq: BN | null;
481
- slotCreated: BN;
482
- };
483
- }[], Struct<{
484
- tokenData: {
485
- owner: PublicKey;
486
- mint: PublicKey;
487
- amount: BN;
488
- delegate: PublicKey | null;
489
- state: string;
490
- };
491
- account: {
492
- data: {
493
- data: string;
494
- dataHash: BN;
495
- discriminator: BN;
496
- } | null;
497
- lamports: BN;
498
- address: number[] | null;
499
- hash: BN;
500
- owner: PublicKey;
501
- leafIndex: number;
502
- tree: PublicKey;
503
- seq: BN | null;
504
- slotCreated: BN;
505
- };
506
- }, {
507
- tokenData: Struct<{
508
- owner: PublicKey;
509
- mint: PublicKey;
510
- amount: BN;
511
- delegate: PublicKey | null;
512
- state: string;
513
- }, {
514
- mint: Struct<PublicKey, null>;
515
- owner: Struct<PublicKey, null>;
516
- amount: Struct<BN, null>;
517
- delegate: Struct<PublicKey | null, null>;
518
- state: Struct<string, null>;
519
- }>;
520
- account: Struct<{
521
- data: {
522
- data: string;
523
- dataHash: BN;
524
- discriminator: BN;
525
- } | null;
526
- lamports: BN;
527
- address: number[] | null;
528
- hash: BN;
529
- owner: PublicKey;
530
- leafIndex: number;
531
- tree: PublicKey;
532
- seq: BN | null;
533
- slotCreated: BN;
534
- }, {
535
- address: Struct<number[] | null, null>;
536
- hash: Struct<BN, null>;
537
- data: Struct<{
538
- data: string;
539
- dataHash: BN;
540
- discriminator: BN;
541
- } | null, {
542
- data: Struct<string, null>;
543
- dataHash: Struct<BN, null>;
544
- discriminator: Struct<BN, null>;
545
- }>;
546
- lamports: Struct<BN, null>;
547
- owner: Struct<PublicKey, null>;
548
- leafIndex: Struct<number, null>;
549
- tree: Struct<PublicKey, null>;
550
- seq: Struct<BN | null, null>;
551
- slotCreated: Struct<BN, null>;
552
- }>;
553
- }>>;
554
- cursor: Struct<string | null, null>;
555
- }>;
556
- /**
557
- * @internal
558
- */
559
- export declare const SlotResult: Struct<number, null>;
560
- /**
561
- * @internal
562
- */
563
- export declare const HealthResult: Struct<string, null>;
564
- /**
565
- * @internal
566
- */
567
- export declare const LatestNonVotingSignaturesResult: Struct<{
568
- items: {
569
- error: string | null;
570
- blockTime: number;
571
- signature: string;
572
- slot: number;
573
- }[];
574
- }, {
575
- items: Struct<{
576
- error: string | null;
577
- blockTime: number;
578
- signature: string;
579
- slot: number;
580
- }[], Struct<{
581
- error: string | null;
582
- blockTime: number;
583
- signature: string;
584
- slot: number;
585
- }, {
586
- signature: Struct<string, null>;
587
- slot: Struct<number, null>;
588
- blockTime: Struct<number, null>;
589
- error: Struct<string | null, null>;
590
- }>>;
591
- }>;
592
- /**
593
- * @internal
594
- */
595
- export declare const LatestNonVotingSignaturesResultPaginated: Struct<{
596
- items: {
597
- blockTime: number;
598
- signature: string;
599
- slot: number;
600
- }[];
601
- cursor: string | null;
602
- }, {
603
- items: Struct<{
604
- blockTime: number;
605
- signature: string;
606
- slot: number;
607
- }[], Struct<{
608
- blockTime: number;
609
- signature: string;
610
- slot: number;
611
- }, {
612
- signature: Struct<string, null>;
613
- slot: Struct<number, null>;
614
- blockTime: Struct<number, null>;
615
- }>>;
616
- cursor: Struct<string | null, null>;
617
- }>;
618
- /**
619
- * @internal
620
- */
621
- export declare const MerkeProofResult: Struct<{
622
- root: BN;
623
- hash: BN;
624
- leafIndex: number;
625
- merkleTree: PublicKey;
626
- proof: BN[];
627
- rootSeq: number;
628
- }, {
629
- hash: Struct<BN, null>;
630
- leafIndex: Struct<number, null>;
631
- merkleTree: Struct<PublicKey, null>;
632
- proof: Struct<BN[], Struct<BN, null>>;
633
- rootSeq: Struct<number, null>;
634
- root: Struct<BN, null>;
635
- }>;
636
- /**
637
- * @internal
638
- */
639
- export declare const NewAddressProofResult: Struct<{
640
- root: BN;
641
- address: BN;
642
- merkleTree: PublicKey;
643
- proof: BN[];
644
- rootSeq: number;
645
- nextIndex: number;
646
- lowerRangeAddress: BN;
647
- higherRangeAddress: BN;
648
- lowElementLeafIndex: number;
649
- }, {
650
- address: Struct<BN, null>;
651
- nextIndex: Struct<number, null>;
652
- merkleTree: Struct<PublicKey, null>;
653
- proof: Struct<BN[], Struct<BN, null>>;
654
- rootSeq: Struct<number, null>;
655
- root: Struct<BN, null>;
656
- lowerRangeAddress: Struct<BN, null>;
657
- higherRangeAddress: Struct<BN, null>;
658
- lowElementLeafIndex: Struct<number, null>;
659
- }>;
660
- /**
661
- * @internal
662
- */
663
- export declare const ValidityProofResult: Struct<{
664
- compressedProof: {
665
- a: number[];
666
- b: number[];
667
- c: number[];
668
- };
669
- leafIndices: number[];
670
- leaves: BN[];
671
- rootIndices: number[];
672
- roots: BN[];
673
- merkleTrees: PublicKey[];
674
- }, {
675
- compressedProof: Struct<{
676
- a: number[];
677
- b: number[];
678
- c: number[];
679
- }, {
680
- a: Struct<number[], Struct<number, null>>;
681
- b: Struct<number[], Struct<number, null>>;
682
- c: Struct<number[], Struct<number, null>>;
683
- }>;
684
- leafIndices: Struct<number[], Struct<number, null>>;
685
- leaves: Struct<BN[], Struct<BN, null>>;
686
- rootIndices: Struct<number[], Struct<number, null>>;
687
- roots: Struct<BN[], Struct<BN, null>>;
688
- merkleTrees: Struct<PublicKey[], Struct<PublicKey, null>>;
689
- }>;
690
- /**
691
- * @internal
692
- */
693
- export declare const MultipleMerkleProofsResult: Struct<{
694
- root: BN;
695
- hash: BN;
696
- leafIndex: number;
697
- merkleTree: PublicKey;
698
- proof: BN[];
699
- rootSeq: number;
700
- }[], Struct<{
701
- root: BN;
702
- hash: BN;
703
- leafIndex: number;
704
- merkleTree: PublicKey;
705
- proof: BN[];
706
- rootSeq: number;
707
- }, {
708
- hash: Struct<BN, null>;
709
- leafIndex: Struct<number, null>;
710
- merkleTree: Struct<PublicKey, null>;
711
- proof: Struct<BN[], Struct<BN, null>>;
712
- rootSeq: Struct<number, null>;
713
- root: Struct<BN, null>;
714
- }>>;
715
- /**
716
- * @internal
717
- */
718
- export declare const BalanceResult: Struct<{
719
- amount: BN;
720
- }, {
721
- amount: Struct<BN, null>;
722
- }>;
723
- export declare const NativeBalanceResult: Struct<BN, null>;
724
- export declare const TokenBalanceResult: Struct<{
725
- mint: PublicKey;
726
- balance: BN;
727
- }, {
728
- balance: Struct<BN, null>;
729
- mint: Struct<PublicKey, null>;
730
- }>;
731
- export declare const TokenBalanceListResult: Struct<{
732
- cursor: string | null;
733
- tokenBalances: {
734
- mint: PublicKey;
735
- balance: BN;
736
- }[];
737
- }, {
738
- tokenBalances: Struct<{
739
- mint: PublicKey;
740
- balance: BN;
741
- }[], Struct<{
742
- mint: PublicKey;
743
- balance: BN;
744
- }, {
745
- balance: Struct<BN, null>;
746
- mint: Struct<PublicKey, null>;
747
- }>>;
748
- cursor: Struct<string | null, null>;
749
- }>;
750
- export declare const TokenBalanceListResultV2: Struct<{
751
- items: {
752
- mint: PublicKey;
753
- balance: BN;
754
- }[];
755
- cursor: string | null;
756
- }, {
757
- items: Struct<{
758
- mint: PublicKey;
759
- balance: BN;
760
- }[], Struct<{
761
- mint: PublicKey;
762
- balance: BN;
763
- }, {
764
- balance: Struct<BN, null>;
765
- mint: Struct<PublicKey, null>;
766
- }>>;
767
- cursor: Struct<string | null, null>;
768
- }>;
769
- export declare const CompressedMintTokenHoldersResult: Struct<{
770
- items: {
771
- owner: PublicKey;
772
- balance: BN;
773
- }[];
774
- cursor: string | null;
775
- }, {
776
- cursor: Struct<string | null, null>;
777
- items: Struct<{
778
- owner: PublicKey;
779
- balance: BN;
780
- }[], Struct<{
781
- owner: PublicKey;
782
- balance: BN;
783
- }, {
784
- balance: Struct<BN, null>;
785
- owner: Struct<PublicKey, null>;
786
- }>>;
787
- }>;
788
- export declare const AccountProofResult: Struct<{
789
- root: number[];
790
- hash: number[];
791
- proof: number[][];
792
- }, {
793
- hash: Struct<number[], Struct<number, null>>;
794
- root: Struct<number[], Struct<number, null>>;
795
- proof: Struct<number[][], Struct<number[], Struct<number, null>>>;
796
- }>;
797
- export declare const toUnixTimestamp: (blockTime: string) => number;
798
- export declare const SignatureListResult: Struct<{
799
- items: {
800
- blockTime: number;
801
- signature: string;
802
- slot: number;
803
- }[];
804
- }, {
805
- items: Struct<{
806
- blockTime: number;
807
- signature: string;
808
- slot: number;
809
- }[], Struct<{
810
- blockTime: number;
811
- signature: string;
812
- slot: number;
813
- }, {
814
- blockTime: Struct<number, null>;
815
- signature: Struct<string, null>;
816
- slot: Struct<number, null>;
817
- }>>;
818
- }>;
819
- export declare const SignatureListWithCursorResult: Struct<{
820
- items: {
821
- blockTime: number;
822
- signature: string;
823
- slot: number;
824
- }[];
825
- cursor: string | null;
826
- }, {
827
- items: Struct<{
828
- blockTime: number;
829
- signature: string;
830
- slot: number;
831
- }[], Struct<{
832
- blockTime: number;
833
- signature: string;
834
- slot: number;
835
- }, {
836
- blockTime: Struct<number, null>;
837
- signature: Struct<string, null>;
838
- slot: Struct<number, null>;
839
- }>>;
840
- cursor: Struct<string | null, null>;
841
- }>;
842
- export declare const CompressedTransactionResult: Struct<{
843
- compressionInfo: {
844
- closedAccounts: {
845
- account: {
846
- data: {
847
- data: string;
848
- dataHash: BN;
849
- discriminator: BN;
850
- } | null;
851
- lamports: BN;
852
- address: number[] | null;
853
- hash: BN;
854
- owner: PublicKey;
855
- leafIndex: number;
856
- tree: PublicKey;
857
- seq: BN | null;
858
- slotCreated: BN;
859
- };
860
- optionalTokenData: {
861
- owner: PublicKey;
862
- mint: PublicKey;
863
- amount: BN;
864
- delegate: PublicKey | null;
865
- state: string;
866
- } | null;
867
- }[];
868
- openedAccounts: {
869
- account: {
870
- data: {
871
- data: string;
872
- dataHash: BN;
873
- discriminator: BN;
874
- } | null;
875
- lamports: BN;
876
- address: number[] | null;
877
- hash: BN;
878
- owner: PublicKey;
879
- leafIndex: number;
880
- tree: PublicKey;
881
- seq: BN | null;
882
- slotCreated: BN;
883
- };
884
- optionalTokenData: {
885
- owner: PublicKey;
886
- mint: PublicKey;
887
- amount: BN;
888
- delegate: PublicKey | null;
889
- state: string;
890
- } | null;
891
- }[];
892
- };
893
- transaction?: any;
894
- }, {
895
- compressionInfo: Struct<{
896
- closedAccounts: {
897
- account: {
898
- data: {
899
- data: string;
900
- dataHash: BN;
901
- discriminator: BN;
902
- } | null;
903
- lamports: BN;
904
- address: number[] | null;
905
- hash: BN;
906
- owner: PublicKey;
907
- leafIndex: number;
908
- tree: PublicKey;
909
- seq: BN | null;
910
- slotCreated: BN;
911
- };
912
- optionalTokenData: {
913
- owner: PublicKey;
914
- mint: PublicKey;
915
- amount: BN;
916
- delegate: PublicKey | null;
917
- state: string;
918
- } | null;
919
- }[];
920
- openedAccounts: {
921
- account: {
922
- data: {
923
- data: string;
924
- dataHash: BN;
925
- discriminator: BN;
926
- } | null;
927
- lamports: BN;
928
- address: number[] | null;
929
- hash: BN;
930
- owner: PublicKey;
931
- leafIndex: number;
932
- tree: PublicKey;
933
- seq: BN | null;
934
- slotCreated: BN;
935
- };
936
- optionalTokenData: {
937
- owner: PublicKey;
938
- mint: PublicKey;
939
- amount: BN;
940
- delegate: PublicKey | null;
941
- state: string;
942
- } | null;
943
- }[];
944
- }, {
945
- closedAccounts: Struct<{
946
- account: {
947
- data: {
948
- data: string;
949
- dataHash: BN;
950
- discriminator: BN;
951
- } | null;
952
- lamports: BN;
953
- address: number[] | null;
954
- hash: BN;
955
- owner: PublicKey;
956
- leafIndex: number;
957
- tree: PublicKey;
958
- seq: BN | null;
959
- slotCreated: BN;
960
- };
961
- optionalTokenData: {
962
- owner: PublicKey;
963
- mint: PublicKey;
964
- amount: BN;
965
- delegate: PublicKey | null;
966
- state: string;
967
- } | null;
968
- }[], Struct<{
969
- account: {
970
- data: {
971
- data: string;
972
- dataHash: BN;
973
- discriminator: BN;
974
- } | null;
975
- lamports: BN;
976
- address: number[] | null;
977
- hash: BN;
978
- owner: PublicKey;
979
- leafIndex: number;
980
- tree: PublicKey;
981
- seq: BN | null;
982
- slotCreated: BN;
983
- };
984
- optionalTokenData: {
985
- owner: PublicKey;
986
- mint: PublicKey;
987
- amount: BN;
988
- delegate: PublicKey | null;
989
- state: string;
990
- } | null;
991
- }, {
992
- account: Struct<{
993
- data: {
994
- data: string;
995
- dataHash: BN;
996
- discriminator: BN;
997
- } | null;
998
- lamports: BN;
999
- address: number[] | null;
1000
- hash: BN;
1001
- owner: PublicKey;
1002
- leafIndex: number;
1003
- tree: PublicKey;
1004
- seq: BN | null;
1005
- slotCreated: BN;
1006
- }, {
1007
- address: Struct<number[] | null, null>;
1008
- hash: Struct<BN, null>;
1009
- data: Struct<{
1010
- data: string;
1011
- dataHash: BN;
1012
- discriminator: BN;
1013
- } | null, {
1014
- data: Struct<string, null>;
1015
- dataHash: Struct<BN, null>;
1016
- discriminator: Struct<BN, null>;
1017
- }>;
1018
- lamports: Struct<BN, null>;
1019
- owner: Struct<PublicKey, null>;
1020
- leafIndex: Struct<number, null>;
1021
- tree: Struct<PublicKey, null>;
1022
- seq: Struct<BN | null, null>;
1023
- slotCreated: Struct<BN, null>;
1024
- }>;
1025
- optionalTokenData: Struct<{
1026
- owner: PublicKey;
1027
- mint: PublicKey;
1028
- amount: BN;
1029
- delegate: PublicKey | null;
1030
- state: string;
1031
- } | null, {
1032
- mint: Struct<PublicKey, null>;
1033
- owner: Struct<PublicKey, null>;
1034
- amount: Struct<BN, null>;
1035
- delegate: Struct<PublicKey | null, null>;
1036
- state: Struct<string, null>;
1037
- }>;
1038
- }>>;
1039
- openedAccounts: Struct<{
1040
- account: {
1041
- data: {
1042
- data: string;
1043
- dataHash: BN;
1044
- discriminator: BN;
1045
- } | null;
1046
- lamports: BN;
1047
- address: number[] | null;
1048
- hash: BN;
1049
- owner: PublicKey;
1050
- leafIndex: number;
1051
- tree: PublicKey;
1052
- seq: BN | null;
1053
- slotCreated: BN;
1054
- };
1055
- optionalTokenData: {
1056
- owner: PublicKey;
1057
- mint: PublicKey;
1058
- amount: BN;
1059
- delegate: PublicKey | null;
1060
- state: string;
1061
- } | null;
1062
- }[], Struct<{
1063
- account: {
1064
- data: {
1065
- data: string;
1066
- dataHash: BN;
1067
- discriminator: BN;
1068
- } | null;
1069
- lamports: BN;
1070
- address: number[] | null;
1071
- hash: BN;
1072
- owner: PublicKey;
1073
- leafIndex: number;
1074
- tree: PublicKey;
1075
- seq: BN | null;
1076
- slotCreated: BN;
1077
- };
1078
- optionalTokenData: {
1079
- owner: PublicKey;
1080
- mint: PublicKey;
1081
- amount: BN;
1082
- delegate: PublicKey | null;
1083
- state: string;
1084
- } | null;
1085
- }, {
1086
- account: Struct<{
1087
- data: {
1088
- data: string;
1089
- dataHash: BN;
1090
- discriminator: BN;
1091
- } | null;
1092
- lamports: BN;
1093
- address: number[] | null;
1094
- hash: BN;
1095
- owner: PublicKey;
1096
- leafIndex: number;
1097
- tree: PublicKey;
1098
- seq: BN | null;
1099
- slotCreated: BN;
1100
- }, {
1101
- address: Struct<number[] | null, null>;
1102
- hash: Struct<BN, null>;
1103
- data: Struct<{
1104
- data: string;
1105
- dataHash: BN;
1106
- discriminator: BN;
1107
- } | null, {
1108
- data: Struct<string, null>;
1109
- dataHash: Struct<BN, null>;
1110
- discriminator: Struct<BN, null>;
1111
- }>;
1112
- lamports: Struct<BN, null>;
1113
- owner: Struct<PublicKey, null>;
1114
- leafIndex: Struct<number, null>;
1115
- tree: Struct<PublicKey, null>;
1116
- seq: Struct<BN | null, null>;
1117
- slotCreated: Struct<BN, null>;
1118
- }>;
1119
- optionalTokenData: Struct<{
1120
- owner: PublicKey;
1121
- mint: PublicKey;
1122
- amount: BN;
1123
- delegate: PublicKey | null;
1124
- state: string;
1125
- } | null, {
1126
- mint: Struct<PublicKey, null>;
1127
- owner: Struct<PublicKey, null>;
1128
- amount: Struct<BN, null>;
1129
- delegate: Struct<PublicKey | null, null>;
1130
- state: Struct<string, null>;
1131
- }>;
1132
- }>>;
1133
- }>;
1134
- transaction: Struct<any, null>;
1135
- }>;
1136
- export interface CompressionApiInterface {
1137
- getCompressedAccount(address?: BN254, hash?: BN254): Promise<CompressedAccountWithMerkleContext | null>;
1138
- getCompressedBalance(address?: BN254, hash?: BN254): Promise<BN | null>;
1139
- getCompressedBalanceByOwner(owner: PublicKey): Promise<BN>;
1140
- getCompressedAccountProof(hash: BN254): Promise<MerkleContextWithMerkleProof>;
1141
- getMultipleCompressedAccounts(hashes: BN254[]): Promise<CompressedAccountWithMerkleContext[]>;
1142
- getMultipleCompressedAccountProofs(hashes: BN254[]): Promise<MerkleContextWithMerkleProof[]>;
1143
- getValidityProof(hashes: BN254[], newAddresses: BN254[]): Promise<CompressedProofWithContext>;
1144
- getValidityProofV0(hashes: HashWithTree[], newAddresses: AddressWithTree[]): Promise<CompressedProofWithContext>;
1145
- getValidityProofAndRpcContext(hashes: HashWithTree[], newAddresses: AddressWithTree[]): Promise<WithContext<CompressedProofWithContext>>;
1146
- getCompressedAccountsByOwner(owner: PublicKey, config?: GetCompressedAccountsByOwnerConfig): Promise<WithCursor<CompressedAccountWithMerkleContext[]>>;
1147
- getCompressedMintTokenHolders(mint: PublicKey, options?: PaginatedOptions): Promise<WithContext<WithCursor<CompressedMintTokenHolders[]>>>;
1148
- getCompressedTokenAccountsByOwner(publicKey: PublicKey, options: GetCompressedTokenAccountsByOwnerOrDelegateOptions): Promise<WithCursor<ParsedTokenAccount[]>>;
1149
- getCompressedTokenAccountsByDelegate(delegate: PublicKey, options: GetCompressedTokenAccountsByOwnerOrDelegateOptions): Promise<WithCursor<ParsedTokenAccount[]>>;
1150
- getCompressedTokenAccountBalance(hash: BN254): Promise<{
1151
- amount: BN;
1152
- }>;
1153
- getCompressedTokenBalancesByOwner(publicKey: PublicKey, options: GetCompressedTokenAccountsByOwnerOrDelegateOptions): Promise<WithCursor<TokenBalance[]>>;
1154
- getCompressedTokenBalancesByOwnerV2(publicKey: PublicKey, options: GetCompressedTokenAccountsByOwnerOrDelegateOptions): Promise<WithContext<WithCursor<TokenBalance[]>>>;
1155
- getTransactionWithCompressionInfo(signature: string): Promise<CompressedTransaction | null>;
1156
- getCompressionSignaturesForAccount(hash: BN254): Promise<SignatureWithMetadata[]>;
1157
- getCompressionSignaturesForAddress(address: PublicKey, options?: PaginatedOptions): Promise<WithCursor<SignatureWithMetadata[]>>;
1158
- getCompressionSignaturesForOwner(owner: PublicKey, options?: PaginatedOptions): Promise<WithCursor<SignatureWithMetadata[]>>;
1159
- getCompressionSignaturesForTokenOwner(owner: PublicKey, options?: PaginatedOptions): Promise<WithCursor<SignatureWithMetadata[]>>;
1160
- getLatestNonVotingSignatures(limit?: number, cursor?: string): Promise<LatestNonVotingSignatures>;
1161
- getLatestCompressionSignatures(cursor?: string, limit?: number): Promise<LatestNonVotingSignaturesPaginated>;
1162
- getIndexerHealth(): Promise<string>;
1163
- getIndexerSlot(): Promise<number>;
1164
- }
1165
- export type RpcResultSuccess<T> = {
1166
- jsonrpc: '2.0';
1167
- id: string;
1168
- result: T;
1169
- };
1170
- export type RpcResultError = {
1171
- jsonrpc: '2.0';
1172
- id: string;
1173
- error: {
1174
- code: unknown;
1175
- message: string;
1176
- data?: any;
1177
- };
1178
- };
1179
- export type RpcResult<T> = RpcResultSuccess<T> | RpcResultError;