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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (113) hide show
  1. package/dist/cjs/browser/actions/compress.d.ts +2 -14
  2. package/dist/cjs/browser/actions/create-account.d.ts +3 -25
  3. package/dist/cjs/browser/actions/decompress.d.ts +2 -13
  4. package/dist/cjs/browser/actions/transfer.d.ts +2 -14
  5. package/dist/cjs/browser/constants.d.ts +35 -67
  6. package/dist/cjs/browser/errors.d.ts +49 -40
  7. package/dist/cjs/browser/index.cjs +1 -11151
  8. package/dist/cjs/browser/programs/system/idl.d.ts +44 -44
  9. package/dist/cjs/browser/programs/system/layout.d.ts +26 -50
  10. package/dist/cjs/browser/programs/system/pack.d.ts +7 -36
  11. package/dist/cjs/browser/programs/system/program.d.ts +9 -56
  12. package/dist/cjs/browser/programs/system/select-compressed-accounts.d.ts +1 -4
  13. package/dist/cjs/browser/rpc-interface.d.ts +2246 -2938
  14. package/dist/cjs/browser/rpc.d.ts +39 -198
  15. package/dist/cjs/browser/state/BN254.d.ts +1 -4
  16. package/dist/cjs/browser/state/bn.d.ts +1 -5
  17. package/dist/cjs/browser/state/compressed-account.d.ts +14 -42
  18. package/dist/cjs/browser/state/types.d.ts +2 -5
  19. package/dist/cjs/browser/test-helpers/merkle-tree/indexed-array.d.ts +4 -18
  20. package/dist/cjs/browser/test-helpers/merkle-tree/merkle-tree.d.ts +6 -19
  21. package/dist/cjs/browser/test-helpers/test-rpc/get-compressed-accounts.d.ts +3 -12
  22. package/dist/cjs/browser/test-helpers/test-rpc/get-compressed-token-accounts.d.ts +5 -22
  23. package/dist/cjs/browser/test-helpers/test-rpc/get-parsed-events.d.ts +4 -14
  24. package/dist/cjs/browser/test-helpers/test-rpc/test-rpc.d.ts +35 -155
  25. package/dist/cjs/browser/test-helpers/test-utils.d.ts +1 -5
  26. package/dist/cjs/browser/utils/address.d.ts +6 -26
  27. package/dist/cjs/browser/utils/airdrop.d.ts +2 -14
  28. package/dist/cjs/browser/utils/calculate-compute-unit-price.d.ts +1 -4
  29. package/dist/cjs/browser/utils/conversion.d.ts +4 -12
  30. package/dist/cjs/browser/utils/dedupe-signer.d.ts +1 -4
  31. package/dist/cjs/browser/utils/get-state-tree-infos.d.ts +5 -20
  32. package/dist/cjs/browser/utils/instruction.d.ts +7 -24
  33. package/dist/cjs/browser/utils/pack-decompress.d.ts +4 -9
  34. package/dist/cjs/browser/utils/pipe.d.ts +1 -4
  35. package/dist/cjs/browser/utils/send-and-confirm.d.ts +11 -42
  36. package/dist/cjs/browser/utils/state-tree-lookup-table.d.ts +3 -23
  37. package/dist/cjs/browser/utils/validation.d.ts +6 -24
  38. package/dist/cjs/node/actions/compress.d.ts +2 -14
  39. package/dist/cjs/node/actions/create-account.d.ts +3 -25
  40. package/dist/cjs/node/actions/decompress.d.ts +2 -13
  41. package/dist/cjs/node/actions/transfer.d.ts +2 -14
  42. package/dist/cjs/node/constants.d.ts +35 -67
  43. package/dist/cjs/node/errors.d.ts +49 -40
  44. package/dist/cjs/node/index.cjs +1 -9853
  45. package/dist/cjs/node/programs/system/idl.d.ts +44 -44
  46. package/dist/cjs/node/programs/system/layout.d.ts +26 -50
  47. package/dist/cjs/node/programs/system/pack.d.ts +7 -36
  48. package/dist/cjs/node/programs/system/program.d.ts +9 -56
  49. package/dist/cjs/node/programs/system/select-compressed-accounts.d.ts +1 -4
  50. package/dist/cjs/node/rpc-interface.d.ts +2246 -2938
  51. package/dist/cjs/node/rpc.d.ts +39 -198
  52. package/dist/cjs/node/state/BN254.d.ts +1 -4
  53. package/dist/cjs/node/state/bn.d.ts +1 -5
  54. package/dist/cjs/node/state/compressed-account.d.ts +14 -42
  55. package/dist/cjs/node/state/types.d.ts +2 -5
  56. package/dist/cjs/node/test-helpers/merkle-tree/indexed-array.d.ts +4 -18
  57. package/dist/cjs/node/test-helpers/merkle-tree/merkle-tree.d.ts +6 -19
  58. package/dist/cjs/node/test-helpers/test-rpc/get-compressed-accounts.d.ts +3 -12
  59. package/dist/cjs/node/test-helpers/test-rpc/get-compressed-token-accounts.d.ts +5 -22
  60. package/dist/cjs/node/test-helpers/test-rpc/get-parsed-events.d.ts +4 -14
  61. package/dist/cjs/node/test-helpers/test-rpc/test-rpc.d.ts +35 -155
  62. package/dist/cjs/node/test-helpers/test-utils.d.ts +1 -5
  63. package/dist/cjs/node/utils/address.d.ts +6 -26
  64. package/dist/cjs/node/utils/airdrop.d.ts +2 -14
  65. package/dist/cjs/node/utils/calculate-compute-unit-price.d.ts +1 -4
  66. package/dist/cjs/node/utils/conversion.d.ts +4 -12
  67. package/dist/cjs/node/utils/dedupe-signer.d.ts +1 -4
  68. package/dist/cjs/node/utils/get-state-tree-infos.d.ts +5 -20
  69. package/dist/cjs/node/utils/instruction.d.ts +7 -24
  70. package/dist/cjs/node/utils/pack-decompress.d.ts +4 -9
  71. package/dist/cjs/node/utils/pipe.d.ts +1 -4
  72. package/dist/cjs/node/utils/send-and-confirm.d.ts +11 -42
  73. package/dist/cjs/node/utils/state-tree-lookup-table.d.ts +3 -23
  74. package/dist/cjs/node/utils/validation.d.ts +6 -24
  75. package/dist/es/browser/actions/compress.d.ts +2 -14
  76. package/dist/es/browser/actions/create-account.d.ts +3 -25
  77. package/dist/es/browser/actions/decompress.d.ts +2 -13
  78. package/dist/es/browser/actions/transfer.d.ts +2 -14
  79. package/dist/es/browser/constants.d.ts +35 -67
  80. package/dist/es/browser/errors.d.ts +49 -40
  81. package/dist/es/browser/index.js +1 -11159
  82. package/dist/es/browser/programs/system/idl.d.ts +44 -44
  83. package/dist/es/browser/programs/system/layout.d.ts +26 -50
  84. package/dist/es/browser/programs/system/pack.d.ts +7 -36
  85. package/dist/es/browser/programs/system/program.d.ts +9 -56
  86. package/dist/es/browser/programs/system/select-compressed-accounts.d.ts +1 -4
  87. package/dist/es/browser/rpc-interface.d.ts +2246 -2938
  88. package/dist/es/browser/rpc.d.ts +39 -198
  89. package/dist/es/browser/state/BN254.d.ts +1 -4
  90. package/dist/es/browser/state/bn.d.ts +1 -5
  91. package/dist/es/browser/state/compressed-account.d.ts +14 -42
  92. package/dist/es/browser/state/types.d.ts +2 -5
  93. package/dist/es/browser/test-helpers/merkle-tree/indexed-array.d.ts +4 -18
  94. package/dist/es/browser/test-helpers/merkle-tree/merkle-tree.d.ts +6 -19
  95. package/dist/es/browser/test-helpers/test-rpc/get-compressed-accounts.d.ts +3 -12
  96. package/dist/es/browser/test-helpers/test-rpc/get-compressed-token-accounts.d.ts +5 -22
  97. package/dist/es/browser/test-helpers/test-rpc/get-parsed-events.d.ts +4 -14
  98. package/dist/es/browser/test-helpers/test-rpc/test-rpc.d.ts +35 -155
  99. package/dist/es/browser/test-helpers/test-utils.d.ts +1 -5
  100. package/dist/es/browser/utils/address.d.ts +6 -26
  101. package/dist/es/browser/utils/airdrop.d.ts +2 -14
  102. package/dist/es/browser/utils/calculate-compute-unit-price.d.ts +1 -4
  103. package/dist/es/browser/utils/conversion.d.ts +4 -12
  104. package/dist/es/browser/utils/dedupe-signer.d.ts +1 -4
  105. package/dist/es/browser/utils/get-state-tree-infos.d.ts +5 -20
  106. package/dist/es/browser/utils/instruction.d.ts +7 -24
  107. package/dist/es/browser/utils/pack-decompress.d.ts +4 -9
  108. package/dist/es/browser/utils/pipe.d.ts +1 -4
  109. package/dist/es/browser/utils/send-and-confirm.d.ts +11 -42
  110. package/dist/es/browser/utils/state-tree-lookup-table.d.ts +3 -23
  111. package/dist/es/browser/utils/validation.d.ts +6 -24
  112. package/dist/types/index.d.ts +2546 -4139
  113. package/package.json +1 -1
@@ -6,7 +6,7 @@ export type LightSystemProgram = {
6
6
  name: 'SOL_POOL_PDA_SEED';
7
7
  type: 'bytes';
8
8
  value: '[115, 111, 108, 95, 112, 111, 111, 108, 95, 112, 100, 97]';
9
- },
9
+ }
10
10
  ];
11
11
  instructions: [
12
12
  {
@@ -26,7 +26,7 @@ export type LightSystemProgram = {
26
26
  name: 'associatedMerkleTree';
27
27
  isMut: false;
28
28
  isSigner: false;
29
- },
29
+ }
30
30
  ];
31
31
  args: [];
32
32
  },
@@ -38,7 +38,7 @@ export type LightSystemProgram = {
38
38
  isMut: true;
39
39
  isSigner: true;
40
40
  docs: [
41
- 'Fee payer needs to be mutable to pay rollover and protocol fees.',
41
+ 'Fee payer needs to be mutable to pay rollover and protocol fees.'
42
42
  ];
43
43
  },
44
44
  {
@@ -61,7 +61,7 @@ export type LightSystemProgram = {
61
61
  isMut: false;
62
62
  isSigner: false;
63
63
  docs: [
64
- 'This pda is used to invoke the account compression program.',
64
+ 'This pda is used to invoke the account compression program.'
65
65
  ];
66
66
  },
67
67
  {
@@ -77,7 +77,7 @@ export type LightSystemProgram = {
77
77
  isOptional: true;
78
78
  docs: [
79
79
  'Sol pool pda is used to store the native sol that has been compressed.',
80
- "It's only required when compressing or decompressing sol.",
80
+ "It's only required when compressing or decompressing sol."
81
81
  ];
82
82
  },
83
83
  {
@@ -88,20 +88,20 @@ export type LightSystemProgram = {
88
88
  docs: [
89
89
  'Only needs to be provided for decompression as a recipient for the',
90
90
  'decompressed sol.',
91
- 'Compressed sol originate from authority.',
91
+ 'Compressed sol originate from authority.'
92
92
  ];
93
93
  },
94
94
  {
95
95
  name: 'systemProgram';
96
96
  isMut: false;
97
97
  isSigner: false;
98
- },
98
+ }
99
99
  ];
100
100
  args: [
101
101
  {
102
102
  name: 'inputs';
103
103
  type: 'bytes';
104
- },
104
+ }
105
105
  ];
106
106
  },
107
107
  {
@@ -112,7 +112,7 @@ export type LightSystemProgram = {
112
112
  isMut: true;
113
113
  isSigner: true;
114
114
  docs: [
115
- 'Fee payer needs to be mutable to pay rollover and protocol fees.',
115
+ 'Fee payer needs to be mutable to pay rollover and protocol fees.'
116
116
  ];
117
117
  },
118
118
  {
@@ -167,13 +167,13 @@ export type LightSystemProgram = {
167
167
  isMut: true;
168
168
  isSigner: false;
169
169
  isOptional: true;
170
- },
170
+ }
171
171
  ];
172
172
  args: [
173
173
  {
174
174
  name: 'inputs';
175
175
  type: 'bytes';
176
- },
176
+ }
177
177
  ];
178
178
  },
179
179
  {
@@ -184,7 +184,7 @@ export type LightSystemProgram = {
184
184
  isMut: true;
185
185
  isSigner: true;
186
186
  docs: [
187
- 'Fee payer needs to be mutable to pay rollover and protocol fees.',
187
+ 'Fee payer needs to be mutable to pay rollover and protocol fees.'
188
188
  ];
189
189
  },
190
190
  {
@@ -239,13 +239,13 @@ export type LightSystemProgram = {
239
239
  isMut: true;
240
240
  isSigner: false;
241
241
  isOptional: true;
242
- },
242
+ }
243
243
  ];
244
244
  args: [
245
245
  {
246
246
  name: 'inputs';
247
247
  type: 'bytes';
248
- },
248
+ }
249
249
  ];
250
250
  },
251
251
  {
@@ -253,7 +253,7 @@ export type LightSystemProgram = {
253
253
  docs: [
254
254
  'This function is a stub to allow Anchor to include the input types in',
255
255
  'the IDL. It should not be included in production builds nor be called in',
256
- 'practice.',
256
+ 'practice.'
257
257
  ];
258
258
  accounts: [
259
259
  {
@@ -261,7 +261,7 @@ export type LightSystemProgram = {
261
261
  isMut: true;
262
262
  isSigner: true;
263
263
  docs: [
264
- 'Fee payer needs to be mutable to pay rollover and protocol fees.',
264
+ 'Fee payer needs to be mutable to pay rollover and protocol fees.'
265
265
  ];
266
266
  },
267
267
  {
@@ -284,7 +284,7 @@ export type LightSystemProgram = {
284
284
  isMut: false;
285
285
  isSigner: false;
286
286
  docs: [
287
- 'This pda is used to invoke the account compression program.',
287
+ 'This pda is used to invoke the account compression program.'
288
288
  ];
289
289
  },
290
290
  {
@@ -300,7 +300,7 @@ export type LightSystemProgram = {
300
300
  isOptional: true;
301
301
  docs: [
302
302
  'Sol pool pda is used to store the native sol that has been compressed.',
303
- "It's only required when compressing or decompressing sol.",
303
+ "It's only required when compressing or decompressing sol."
304
304
  ];
305
305
  },
306
306
  {
@@ -311,14 +311,14 @@ export type LightSystemProgram = {
311
311
  docs: [
312
312
  'Only needs to be provided for decompression as a recipient for the',
313
313
  'decompressed sol.',
314
- 'Compressed sol originate from authority.',
314
+ 'Compressed sol originate from authority.'
315
315
  ];
316
316
  },
317
317
  {
318
318
  name: 'systemProgram';
319
319
  isMut: false;
320
320
  isSigner: false;
321
- },
321
+ }
322
322
  ];
323
323
  args: [
324
324
  {
@@ -338,9 +338,9 @@ export type LightSystemProgram = {
338
338
  type: {
339
339
  defined: 'PublicTransactionEvent';
340
340
  };
341
- },
341
+ }
342
342
  ];
343
- },
343
+ }
344
344
  ];
345
345
  accounts: [
346
346
  {
@@ -351,7 +351,7 @@ export type LightSystemProgram = {
351
351
  'Collected instruction data is combined with the instruction data of the executing cpi,',
352
352
  'and executed as a single transaction.',
353
353
  'This enables to use input compressed accounts that are owned by multiple programs,',
354
- 'with one zero-knowledge proof.',
354
+ 'with one zero-knowledge proof.'
355
355
  ];
356
356
  type: {
357
357
  kind: 'struct';
@@ -371,10 +371,10 @@ export type LightSystemProgram = {
371
371
  defined: 'InstructionDataInvokeCpi';
372
372
  };
373
373
  };
374
- },
374
+ }
375
375
  ];
376
376
  };
377
- },
377
+ }
378
378
  ];
379
379
  types: [
380
380
  {
@@ -429,7 +429,7 @@ export type LightSystemProgram = {
429
429
  {
430
430
  name: 'isCompress';
431
431
  type: 'bool';
432
- },
432
+ }
433
433
  ];
434
434
  };
435
435
  },
@@ -455,7 +455,7 @@ export type LightSystemProgram = {
455
455
  {
456
456
  name: 'addressMerkleTreeRootIndex';
457
457
  type: 'u16';
458
- },
458
+ }
459
459
  ];
460
460
  };
461
461
  },
@@ -473,7 +473,7 @@ export type LightSystemProgram = {
473
473
  {
474
474
  name: 'merkleTreeIndex';
475
475
  type: 'u8';
476
- },
476
+ }
477
477
  ];
478
478
  };
479
479
  },
@@ -499,7 +499,7 @@ export type LightSystemProgram = {
499
499
  type: {
500
500
  array: ['u8', 32];
501
501
  };
502
- },
502
+ }
503
503
  ];
504
504
  };
505
505
  },
@@ -563,7 +563,7 @@ export type LightSystemProgram = {
563
563
  defined: 'CompressedCpiContext';
564
564
  };
565
565
  };
566
- },
566
+ }
567
567
  ];
568
568
  };
569
569
  },
@@ -576,7 +576,7 @@ export type LightSystemProgram = {
576
576
  name: 'setContext';
577
577
  docs: [
578
578
  'Is set by the program that is invoking the CPI to signal that is should',
579
- 'set the cpi context.',
579
+ 'set the cpi context.'
580
580
  ];
581
581
  type: 'bool';
582
582
  },
@@ -584,17 +584,17 @@ export type LightSystemProgram = {
584
584
  name: 'firstSetContext';
585
585
  docs: [
586
586
  'Is set to wipe the cpi context since someone could have set it before',
587
- 'with unrelated data.',
587
+ 'with unrelated data.'
588
588
  ];
589
589
  type: 'bool';
590
590
  },
591
591
  {
592
592
  name: 'cpiContextAccountIndex';
593
593
  docs: [
594
- 'Index of cpi context account in remaining accounts.',
594
+ 'Index of cpi context account in remaining accounts.'
595
595
  ];
596
596
  type: 'u8';
597
- },
597
+ }
598
598
  ];
599
599
  };
600
600
  },
@@ -626,7 +626,7 @@ export type LightSystemProgram = {
626
626
  defined: 'CompressedAccountData';
627
627
  };
628
628
  };
629
- },
629
+ }
630
630
  ];
631
631
  };
632
632
  },
@@ -650,7 +650,7 @@ export type LightSystemProgram = {
650
650
  type: {
651
651
  array: ['u8', 32];
652
652
  };
653
- },
653
+ }
654
654
  ];
655
655
  };
656
656
  },
@@ -674,17 +674,17 @@ export type LightSystemProgram = {
674
674
  {
675
675
  name: 'rootIndex';
676
676
  docs: [
677
- 'Index of root used in inclusion validity proof.',
677
+ 'Index of root used in inclusion validity proof.'
678
678
  ];
679
679
  type: 'u16';
680
680
  },
681
681
  {
682
682
  name: 'readOnly';
683
683
  docs: [
684
- 'Placeholder to mark accounts read-only unimplemented set to false.',
684
+ 'Placeholder to mark accounts read-only unimplemented set to false.'
685
685
  ];
686
686
  type: 'bool';
687
- },
687
+ }
688
688
  ];
689
689
  };
690
690
  },
@@ -708,7 +708,7 @@ export type LightSystemProgram = {
708
708
  {
709
709
  name: 'proveByIndex';
710
710
  type: 'bool';
711
- },
711
+ }
712
712
  ];
713
713
  };
714
714
  },
@@ -724,7 +724,7 @@ export type LightSystemProgram = {
724
724
  {
725
725
  name: 'seq';
726
726
  type: 'u64';
727
- },
727
+ }
728
728
  ];
729
729
  };
730
730
  },
@@ -798,10 +798,10 @@ export type LightSystemProgram = {
798
798
  type: {
799
799
  option: 'bytes';
800
800
  };
801
- },
801
+ }
802
802
  ];
803
803
  };
804
- },
804
+ }
805
805
  ];
806
806
  errors: [
807
807
  {
@@ -991,7 +991,7 @@ export type LightSystemProgram = {
991
991
  {
992
992
  code: 6038;
993
993
  name: 'InvalidStateTreeHeight';
994
- },
994
+ }
995
995
  ];
996
996
  };
997
997
  export declare const IDL: LightSystemProgram;
@@ -1,36 +1,24 @@
1
1
  import { Buffer } from 'buffer';
2
2
  import { PublicKey, AccountMeta } from '@solana/web3.js';
3
3
  import { Layout } from '@coral-xyz/borsh';
4
- import {
5
- InstructionDataInvoke,
6
- InstructionDataInvokeCpi,
7
- PublicTransactionEvent,
8
- } from '../../state';
9
- export declare const CompressedAccountLayout: import('buffer-layout').Layout<unknown>;
10
- export declare const MerkleContextLayout: import('buffer-layout').Layout<unknown>;
11
- export declare const NewAddressParamsLayout: import('buffer-layout').Layout<unknown>;
4
+ import { InstructionDataInvoke, InstructionDataInvokeCpi, PublicTransactionEvent } from '../../state';
5
+ export declare const CompressedAccountLayout: import("buffer-layout").Layout<unknown>;
6
+ export declare const MerkleContextLayout: import("buffer-layout").Layout<unknown>;
7
+ export declare const NewAddressParamsLayout: import("buffer-layout").Layout<unknown>;
12
8
  export declare const InstructionDataInvokeLayout: Layout<InstructionDataInvoke>;
13
- export declare function encodeInstructionDataInvoke(
14
- data: InstructionDataInvoke,
15
- ): Buffer;
9
+ export declare function encodeInstructionDataInvoke(data: InstructionDataInvoke): Buffer;
16
10
  export declare const InstructionDataInvokeCpiLayout: Layout<InstructionDataInvokeCpi>;
17
- export declare const CompressedProofLayout: import('buffer-layout').Layout<unknown>;
18
- export declare const CompressedCpiContextLayout: import('buffer-layout').Layout<unknown>;
19
- export declare const NewAddressParamsAssignedPackedLayout: import('buffer-layout').Layout<unknown>;
20
- export declare const PackedMerkleContextLayout: import('buffer-layout').Layout<unknown>;
21
- export declare const InAccountLayout: import('buffer-layout').Layout<unknown>;
22
- export declare const PackedReadOnlyAddressLayout: import('buffer-layout').Layout<unknown>;
23
- export declare const PackedReadOnlyCompressedAccountLayout: import('buffer-layout').Layout<unknown>;
24
- export declare const InstructionDataInvokeCpiWithReadOnlyLayout: import('buffer-layout').Layout<unknown>;
25
- export declare function decodeInstructionDataInvokeCpiWithReadOnly(
26
- buffer: Buffer,
27
- ): unknown;
28
- export declare function decodeInstructionDataInvoke(
29
- buffer: Buffer,
30
- ): InstructionDataInvoke;
31
- export declare function decodeInstructionDataInvokeCpi(
32
- buffer: Buffer,
33
- ): InstructionDataInvokeCpi;
11
+ export declare const CompressedProofLayout: import("buffer-layout").Layout<unknown>;
12
+ export declare const CompressedCpiContextLayout: import("buffer-layout").Layout<unknown>;
13
+ export declare const NewAddressParamsAssignedPackedLayout: import("buffer-layout").Layout<unknown>;
14
+ export declare const PackedMerkleContextLayout: import("buffer-layout").Layout<unknown>;
15
+ export declare const InAccountLayout: import("buffer-layout").Layout<unknown>;
16
+ export declare const PackedReadOnlyAddressLayout: import("buffer-layout").Layout<unknown>;
17
+ export declare const PackedReadOnlyCompressedAccountLayout: import("buffer-layout").Layout<unknown>;
18
+ export declare const InstructionDataInvokeCpiWithReadOnlyLayout: import("buffer-layout").Layout<unknown>;
19
+ export declare function decodeInstructionDataInvokeCpiWithReadOnly(buffer: Buffer): unknown;
20
+ export declare function decodeInstructionDataInvoke(buffer: Buffer): InstructionDataInvoke;
21
+ export declare function decodeInstructionDataInvokeCpi(buffer: Buffer): InstructionDataInvokeCpi;
34
22
  export type invokeAccountsLayoutParams = {
35
23
  /**
36
24
  * Fee payer.
@@ -69,24 +57,16 @@ export type invokeAccountsLayoutParams = {
69
57
  */
70
58
  systemProgram: PublicKey;
71
59
  };
72
- export declare const invokeAccountsLayout: (
73
- accounts: invokeAccountsLayoutParams,
74
- ) => AccountMeta[];
60
+ export declare const invokeAccountsLayout: (accounts: invokeAccountsLayoutParams) => AccountMeta[];
75
61
  export declare const PublicTransactionEventLayout: Layout<PublicTransactionEvent>;
76
- export declare function encodePublicTransactionEvent(
77
- data: PublicTransactionEvent,
78
- ): Buffer;
79
- export declare function decodePublicTransactionEvent(
80
- buffer: Buffer,
81
- ): PublicTransactionEvent;
82
- export declare const AppendNullifyCreateAddressInputsMetaLayout: import('buffer-layout').Layout<unknown>;
83
- export declare const AppendLeavesInputLayout: import('buffer-layout').Layout<unknown>;
84
- export declare const InsertNullifierInputLayout: import('buffer-layout').Layout<unknown>;
85
- export declare const InsertAddressInputLayout: import('buffer-layout').Layout<unknown>;
86
- export declare const MerkleTreeSequenceNumberLayout: import('buffer-layout').Layout<unknown>;
87
- export declare function deserializeAppendNullifyCreateAddressInputsIndexer(
88
- buffer: Buffer,
89
- ): {
62
+ export declare function encodePublicTransactionEvent(data: PublicTransactionEvent): Buffer;
63
+ export declare function decodePublicTransactionEvent(buffer: Buffer): PublicTransactionEvent;
64
+ export declare const AppendNullifyCreateAddressInputsMetaLayout: import("buffer-layout").Layout<unknown>;
65
+ export declare const AppendLeavesInputLayout: import("buffer-layout").Layout<unknown>;
66
+ export declare const InsertNullifierInputLayout: import("buffer-layout").Layout<unknown>;
67
+ export declare const InsertAddressInputLayout: import("buffer-layout").Layout<unknown>;
68
+ export declare const MerkleTreeSequenceNumberLayout: import("buffer-layout").Layout<unknown>;
69
+ export declare function deserializeAppendNullifyCreateAddressInputsIndexer(buffer: Buffer): {
90
70
  meta: unknown;
91
71
  leaves: unknown[];
92
72
  nullifiers: unknown[];
@@ -94,8 +74,4 @@ export declare function deserializeAppendNullifyCreateAddressInputsIndexer(
94
74
  sequence_numbers: unknown[];
95
75
  output_leaf_indices: number[];
96
76
  };
97
- export declare function convertToPublicTransactionEvent(
98
- decoded: any,
99
- remainingAccounts: PublicKey[],
100
- invokeData: InstructionDataInvoke,
101
- ): PublicTransactionEvent;
77
+ export declare function convertToPublicTransactionEvent(decoded: any, remainingAccounts: PublicKey[], invokeData: InstructionDataInvoke): PublicTransactionEvent;
@@ -1,25 +1,11 @@
1
1
  import { AccountMeta, PublicKey } from '@solana/web3.js';
2
- import {
3
- AccountProofInput,
4
- CompressedAccountLegacy,
5
- NewAddressProofInput,
6
- OutputCompressedAccountWithPackedContext,
7
- PackedCompressedAccountWithMerkleContext,
8
- TreeInfo,
9
- } from '../../state';
10
- import {
11
- CompressedAccountWithMerkleContextLegacy,
12
- PackedAddressTreeInfo,
13
- PackedStateTreeInfo,
14
- } from '../../state/compressed-account';
2
+ import { AccountProofInput, CompressedAccountLegacy, NewAddressProofInput, OutputCompressedAccountWithPackedContext, PackedCompressedAccountWithMerkleContext, TreeInfo } from '../../state';
3
+ import { CompressedAccountWithMerkleContextLegacy, PackedAddressTreeInfo, PackedStateTreeInfo } from '../../state/compressed-account';
15
4
  /**
16
5
  * @internal Finds the index of a PublicKey in an array, or adds it if not
17
6
  * present
18
7
  * */
19
- export declare function getIndexOrAdd(
20
- accountsArray: PublicKey[],
21
- key: PublicKey,
22
- ): number;
8
+ export declare function getIndexOrAdd(accountsArray: PublicKey[], key: PublicKey): number;
23
9
  /**
24
10
  * @internal
25
11
  * Pads output state trees with the 0th state tree of the input state.
@@ -36,13 +22,8 @@ export declare function getIndexOrAdd(
36
22
  *
37
23
  * @returns Padded output state trees.
38
24
  */
39
- export declare function padOutputStateMerkleTrees(
40
- outputStateMerkleTrees: PublicKey,
41
- numberOfOutputCompressedAccounts: number,
42
- ): PublicKey[];
43
- export declare function toAccountMetas(
44
- remainingAccounts: PublicKey[],
45
- ): AccountMeta[];
25
+ export declare function padOutputStateMerkleTrees(outputStateMerkleTrees: PublicKey, numberOfOutputCompressedAccounts: number): PublicKey[];
26
+ export declare function toAccountMetas(remainingAccounts: PublicKey[]): AccountMeta[];
46
27
  export interface PackedStateTreeInfos {
47
28
  packedTreeInfos: PackedStateTreeInfo[];
48
29
  outputTreeIndex: number;
@@ -67,11 +48,7 @@ export interface PackedTreeInfos {
67
48
  * @returns Remaining accounts, packed state and address tree infos, state tree
68
49
  * output index and address tree infos.
69
50
  */
70
- export declare function packTreeInfos(
71
- remainingAccounts: PublicKey[],
72
- accountProofInputs: AccountProofInput[],
73
- newAddressProofInputs: NewAddressProofInput[],
74
- ): PackedTreeInfos;
51
+ export declare function packTreeInfos(remainingAccounts: PublicKey[], accountProofInputs: AccountProofInput[], newAddressProofInputs: NewAddressProofInput[]): PackedTreeInfos;
75
52
  /**
76
53
  * Packs Compressed Accounts.
77
54
  *
@@ -90,13 +67,7 @@ export declare function packTreeInfos(
90
67
  * @param remainingAccounts Optional existing array of accounts
91
68
  * to append to.
92
69
  **/
93
- export declare function packCompressedAccounts(
94
- inputCompressedAccounts: CompressedAccountWithMerkleContextLegacy[],
95
- inputStateRootIndices: number[],
96
- outputCompressedAccounts: CompressedAccountLegacy[],
97
- outputStateTreeInfo?: TreeInfo,
98
- remainingAccounts?: PublicKey[],
99
- ): {
70
+ export declare function packCompressedAccounts(inputCompressedAccounts: CompressedAccountWithMerkleContextLegacy[], inputStateRootIndices: number[], outputCompressedAccounts: CompressedAccountLegacy[], outputStateTreeInfo?: TreeInfo, remainingAccounts?: PublicKey[]): {
100
71
  packedInputCompressedAccounts: PackedCompressedAccountWithMerkleContext[];
101
72
  packedOutputCompressedAccounts: OutputCompressedAccountWithPackedContext[];
102
73
  remainingAccounts: PublicKey[];
@@ -1,15 +1,8 @@
1
1
  import BN from 'bn.js';
2
2
  import { PublicKey, TransactionInstruction } from '@solana/web3.js';
3
- import {
4
- CompressedAccountWithMerkleContext,
5
- ValidityProof,
6
- TreeInfo,
7
- CompressedAccountLegacy,
8
- } from '../../state';
3
+ import { CompressedAccountWithMerkleContext, ValidityProof, TreeInfo, CompressedAccountLegacy } from '../../state';
9
4
  import { NewAddressParams } from '../../utils';
10
- export declare const sumUpLamports: (
11
- accounts: CompressedAccountWithMerkleContext[],
12
- ) => BN;
5
+ export declare const sumUpLamports: (accounts: CompressedAccountWithMerkleContext[]) => BN;
13
6
  /**
14
7
  * Create compressed account system transaction params
15
8
  */
@@ -152,71 +145,31 @@ export declare class LightSystemProgram {
152
145
  *
153
146
  */
154
147
  static deriveCompressedSolPda(): PublicKey;
155
- static createTransferOutputState(
156
- inputCompressedAccounts: CompressedAccountWithMerkleContext[],
157
- toAddress: PublicKey,
158
- lamports: number | BN,
159
- ): CompressedAccountLegacy[];
160
- static createDecompressOutputState(
161
- inputCompressedAccounts: CompressedAccountWithMerkleContext[],
162
- lamports: number | BN,
163
- ): CompressedAccountLegacy[];
148
+ static createTransferOutputState(inputCompressedAccounts: CompressedAccountWithMerkleContext[], toAddress: PublicKey, lamports: number | BN): CompressedAccountLegacy[];
149
+ static createDecompressOutputState(inputCompressedAccounts: CompressedAccountWithMerkleContext[], lamports: number | BN): CompressedAccountLegacy[];
164
150
  /**
165
151
  * No data by default
166
152
  */
167
- static createNewAddressOutputState(
168
- address: number[],
169
- owner: PublicKey,
170
- lamports?: BN | number,
171
- inputCompressedAccounts?: CompressedAccountWithMerkleContext[],
172
- ): CompressedAccountLegacy[];
153
+ static createNewAddressOutputState(address: number[], owner: PublicKey, lamports?: BN | number, inputCompressedAccounts?: CompressedAccountWithMerkleContext[]): CompressedAccountLegacy[];
173
154
  /**
174
155
  * Creates instruction to create compressed account with PDA.
175
156
  * Cannot write data.
176
157
  */
177
- static createAccount({
178
- payer,
179
- newAddressParams,
180
- newAddress,
181
- recentValidityProof,
182
- outputStateTreeInfo,
183
- inputCompressedAccounts,
184
- inputStateRootIndices,
185
- lamports,
186
- }: CreateAccountWithSeedParams): Promise<TransactionInstruction>;
158
+ static createAccount({ payer, newAddressParams, newAddress, recentValidityProof, outputStateTreeInfo, inputCompressedAccounts, inputStateRootIndices, lamports, }: CreateAccountWithSeedParams): Promise<TransactionInstruction>;
187
159
  /**
188
160
  * Creates a transaction instruction that transfers compressed lamports from
189
161
  * one owner to another.
190
162
  */
191
- static transfer({
192
- payer,
193
- inputCompressedAccounts,
194
- toAddress,
195
- lamports,
196
- recentInputStateRootIndices,
197
- recentValidityProof,
198
- }: TransferParams): Promise<TransactionInstruction>;
163
+ static transfer({ payer, inputCompressedAccounts, toAddress, lamports, recentInputStateRootIndices, recentValidityProof, }: TransferParams): Promise<TransactionInstruction>;
199
164
  /**
200
165
  * Creates a transaction instruction that transfers compressed lamports from
201
166
  * one owner to another.
202
167
  */
203
- static compress({
204
- payer,
205
- toAddress,
206
- lamports,
207
- outputStateTreeInfo,
208
- }: CompressParams): Promise<TransactionInstruction>;
168
+ static compress({ payer, toAddress, lamports, outputStateTreeInfo, }: CompressParams): Promise<TransactionInstruction>;
209
169
  /**
210
170
  * Creates a transaction instruction that transfers compressed lamports from
211
171
  * one owner to another.
212
172
  */
213
- static decompress({
214
- payer,
215
- inputCompressedAccounts,
216
- toAddress,
217
- lamports,
218
- recentInputStateRootIndices,
219
- recentValidityProof,
220
- }: DecompressParams): Promise<TransactionInstruction>;
173
+ static decompress({ payer, inputCompressedAccounts, toAddress, lamports, recentInputStateRootIndices, recentValidityProof, }: DecompressParams): Promise<TransactionInstruction>;
221
174
  }
222
175
  export {};
@@ -7,7 +7,4 @@ import { CompressedAccountWithMerkleContext } from '../../state';
7
7
  * 2. Accumulates the amount until it is greater than or equal to the transfer
8
8
  * amount
9
9
  */
10
- export declare function selectMinCompressedSolAccountsForTransfer(
11
- accounts: CompressedAccountWithMerkleContext[],
12
- transferLamports: BN | number,
13
- ): [selectedAccounts: CompressedAccountWithMerkleContext[], total: BN];
10
+ export declare function selectMinCompressedSolAccountsForTransfer(accounts: CompressedAccountWithMerkleContext[], transferLamports: BN | number): [selectedAccounts: CompressedAccountWithMerkleContext[], total: BN];