@streamflow/distributor 8.0.1 → 8.0.2-alpha.p287.46f7492

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.
@@ -1,11 +1,11 @@
1
1
  import { PublicKey, TransactionInstruction, Connection, SystemProgram } from '@solana/web3.js';
2
2
  import '@solana/wallet-adapter-base';
3
3
  import { ICluster, ContractError, divCeilN, invariant, getNumberFromBN, getBN } from '@streamflow/common';
4
- import { signAndExecuteTransaction, buildSendThrottler, prepareBaseInstructions, getMintAndProgram, ata, prepareWrappedAccount, prepareTransaction, checkOrCreateAtaBatch, pk } from '@streamflow/common/solana';
4
+ import { signAndExecuteTransaction, buildSendThrottler, prepareBaseInstructions, getMintAndProgram, ata, prepareWrappedAccount, createAndEstimateTransaction, prepareTransaction, checkOrCreateAtaBatch, pk, unwrapExecutionParams } from '@streamflow/common/solana';
5
5
  import { Program } from '@coral-xyz/anchor';
6
- import * as borsh8 from '@coral-xyz/borsh';
6
+ import * as borsh7 from '@coral-xyz/borsh';
7
7
  import { Buffer as Buffer$1 } from 'buffer';
8
- import BN6 from 'bn.js';
8
+ import BN5 from 'bn.js';
9
9
  import { NATIVE_MINT, getTransferFeeConfig, ASSOCIATED_TOKEN_PROGRAM_ID, createTransferCheckedWithFeeInstruction, createTransferCheckedInstruction } from '@solana/spl-token';
10
10
  import bs58 from 'bs58';
11
11
 
@@ -99,21 +99,21 @@ var PROGRAM_ID_CLI = new PublicKey("MErKy6nZVoVAkryxAejJz2juifQ4ArgLgHmaJCQkU7N"
99
99
  var PROGRAM_ID = PROGRAM_ID_CLI;
100
100
 
101
101
  // solana/generated/instructions/newDistributor.ts
102
- var layout = borsh8.struct([
103
- borsh8.u64("version"),
104
- borsh8.array(borsh8.u8(), 32, "root"),
105
- borsh8.u64("maxTotalClaim"),
106
- borsh8.u64("maxNumNodes"),
107
- borsh8.u64("unlockPeriod"),
108
- borsh8.u64("startVestingTs"),
109
- borsh8.u64("endVestingTs"),
110
- borsh8.u64("clawbackStartTs"),
111
- borsh8.bool("claimsClosableByAdmin"),
112
- borsh8.option(borsh8.bool(), "canUpdateDuration"),
113
- borsh8.option(borsh8.u64(), "totalAmountUnlocked"),
114
- borsh8.option(borsh8.u64(), "totalAmountLocked"),
115
- borsh8.option(borsh8.bool(), "claimsClosableByClaimant"),
116
- borsh8.option(borsh8.u16(), "claimsLimit")
102
+ var layout = borsh7.struct([
103
+ borsh7.u64("version"),
104
+ borsh7.array(borsh7.u8(), 32, "root"),
105
+ borsh7.u64("maxTotalClaim"),
106
+ borsh7.u64("maxNumNodes"),
107
+ borsh7.u64("unlockPeriod"),
108
+ borsh7.u64("startVestingTs"),
109
+ borsh7.u64("endVestingTs"),
110
+ borsh7.u64("clawbackStartTs"),
111
+ borsh7.bool("claimsClosableByAdmin"),
112
+ borsh7.option(borsh7.bool(), "canUpdateDuration"),
113
+ borsh7.option(borsh7.u64(), "totalAmountUnlocked"),
114
+ borsh7.option(borsh7.u64(), "totalAmountLocked"),
115
+ borsh7.option(borsh7.bool(), "claimsClosableByClaimant"),
116
+ borsh7.option(borsh7.u16(), "claimsLimit")
117
117
  ]);
118
118
  function newDistributor(args, accounts, programId = PROGRAM_ID) {
119
119
  const keys = [
@@ -155,10 +155,10 @@ function newDistributor(args, accounts, programId = PROGRAM_ID) {
155
155
  const ix = new TransactionInstruction({ keys, programId, data });
156
156
  return ix;
157
157
  }
158
- var layout2 = borsh8.struct([
159
- borsh8.u64("amountUnlocked"),
160
- borsh8.u64("amountLocked"),
161
- borsh8.vec(borsh8.array(borsh8.u8(), 32), "proof")
158
+ var layout2 = borsh7.struct([
159
+ borsh7.u64("amountUnlocked"),
160
+ borsh7.u64("amountLocked"),
161
+ borsh7.vec(borsh7.array(borsh7.u8(), 32), "proof")
162
162
  ]);
163
163
  function newClaim(args, accounts, programId = PROGRAM_ID) {
164
164
  const keys = [
@@ -219,10 +219,10 @@ function clawback(accounts, programId = PROGRAM_ID) {
219
219
  const ix = new TransactionInstruction({ keys, programId, data });
220
220
  return ix;
221
221
  }
222
- var layout3 = borsh8.struct([
223
- borsh8.option(borsh8.u64(), "amountUnlocked"),
224
- borsh8.option(borsh8.u64(), "amountLocked"),
225
- borsh8.option(borsh8.vec(borsh8.array(borsh8.u8(), 32)), "proof")
222
+ var layout3 = borsh7.struct([
223
+ borsh7.option(borsh7.u64(), "amountUnlocked"),
224
+ borsh7.option(borsh7.u64(), "amountLocked"),
225
+ borsh7.option(borsh7.vec(borsh7.array(borsh7.u8(), 32)), "proof")
226
226
  ]);
227
227
  function closeClaim(args, accounts, programId = PROGRAM_ID) {
228
228
  const keys = [
@@ -271,6 +271,1316 @@ function setAdmin(accounts, programId = PROGRAM_ID) {
271
271
  return ix;
272
272
  }
273
273
 
274
+ // solana/descriptor/idl/merkle_distributor.json
275
+ var merkle_distributor_default = {
276
+ address: "MErKy6nZVoVAkryxAejJz2juifQ4ArgLgHmaJCQkU7N",
277
+ metadata: {
278
+ name: "merkle_distributor",
279
+ version: "1.5.0",
280
+ spec: "0.1.0",
281
+ description: "A Solana program for distributing tokens according to a Merkle root.",
282
+ repository: "https://github.com/streamflow-finance/distributor"
283
+ },
284
+ instructions: [
285
+ {
286
+ name: "_expose_claim",
287
+ discriminator: [103, 233, 83, 69, 115, 199, 128, 249],
288
+ accounts: [
289
+ {
290
+ name: "distributor",
291
+ docs: ["The [MerkleDistributor]."]
292
+ },
293
+ {
294
+ name: "claim_status",
295
+ docs: ["Claim Status PDA"],
296
+ optional: true,
297
+ pda: {
298
+ seeds: [
299
+ {
300
+ kind: "const",
301
+ value: [67, 108, 97, 105, 109, 83, 116, 97, 116, 117, 115]
302
+ },
303
+ {
304
+ kind: "account",
305
+ path: "claimant"
306
+ },
307
+ {
308
+ kind: "account",
309
+ path: "distributor"
310
+ }
311
+ ]
312
+ }
313
+ },
314
+ {
315
+ name: "compressed_claim_status",
316
+ docs: ["Compress Claim Status PDA"],
317
+ optional: true,
318
+ pda: {
319
+ seeds: [
320
+ {
321
+ kind: "const",
322
+ value: [67, 108, 97, 105, 109, 83, 116, 97, 116, 117, 115]
323
+ },
324
+ {
325
+ kind: "account",
326
+ path: "claimant"
327
+ },
328
+ {
329
+ kind: "account",
330
+ path: "distributor"
331
+ }
332
+ ]
333
+ }
334
+ },
335
+ {
336
+ name: "claimant",
337
+ docs: ["Who is claiming the tokens."],
338
+ signer: true
339
+ }
340
+ ],
341
+ args: []
342
+ },
343
+ {
344
+ name: "claim_locked",
345
+ discriminator: [34, 206, 181, 23, 11, 207, 147, 90],
346
+ accounts: [
347
+ {
348
+ name: "distributor",
349
+ docs: ["The [MerkleDistributor]."],
350
+ writable: true
351
+ },
352
+ {
353
+ name: "claim_status",
354
+ writable: true,
355
+ pda: {
356
+ seeds: [
357
+ {
358
+ kind: "const",
359
+ value: [67, 108, 97, 105, 109, 83, 116, 97, 116, 117, 115]
360
+ },
361
+ {
362
+ kind: "account",
363
+ path: "claimant"
364
+ },
365
+ {
366
+ kind: "account",
367
+ path: "distributor"
368
+ }
369
+ ]
370
+ }
371
+ },
372
+ {
373
+ name: "from",
374
+ docs: ["Distributor ATA containing the tokens to distribute."],
375
+ writable: true,
376
+ pda: {
377
+ seeds: [
378
+ {
379
+ kind: "account",
380
+ path: "distributor"
381
+ },
382
+ {
383
+ kind: "account",
384
+ path: "token_program"
385
+ },
386
+ {
387
+ kind: "account",
388
+ path: "distributor.mint",
389
+ account: "MerkleDistributor"
390
+ }
391
+ ],
392
+ program: {
393
+ kind: "const",
394
+ value: [
395
+ 140,
396
+ 151,
397
+ 37,
398
+ 143,
399
+ 78,
400
+ 36,
401
+ 137,
402
+ 241,
403
+ 187,
404
+ 61,
405
+ 16,
406
+ 41,
407
+ 20,
408
+ 142,
409
+ 13,
410
+ 131,
411
+ 11,
412
+ 90,
413
+ 19,
414
+ 153,
415
+ 218,
416
+ 255,
417
+ 16,
418
+ 132,
419
+ 4,
420
+ 142,
421
+ 123,
422
+ 216,
423
+ 219,
424
+ 233,
425
+ 248,
426
+ 89
427
+ ]
428
+ }
429
+ }
430
+ },
431
+ {
432
+ name: "to",
433
+ docs: [
434
+ "Account to send the claimed tokens to.",
435
+ "Claimant must sign the transaction and can only claim on behalf of themself"
436
+ ],
437
+ writable: true
438
+ },
439
+ {
440
+ name: "claimant",
441
+ docs: ["Who is claiming the tokens."],
442
+ writable: true,
443
+ signer: true
444
+ },
445
+ {
446
+ name: "mint",
447
+ docs: ["The mint to claim."],
448
+ relations: ["distributor"]
449
+ },
450
+ {
451
+ name: "token_program",
452
+ docs: ["SPL [Token] program."]
453
+ },
454
+ {
455
+ name: "event_authority",
456
+ pda: {
457
+ seeds: [
458
+ {
459
+ kind: "const",
460
+ value: [95, 95, 101, 118, 101, 110, 116, 95, 97, 117, 116, 104, 111, 114, 105, 116, 121]
461
+ }
462
+ ]
463
+ }
464
+ },
465
+ {
466
+ name: "program"
467
+ }
468
+ ],
469
+ args: []
470
+ },
471
+ {
472
+ name: "clawback",
473
+ discriminator: [111, 92, 142, 79, 33, 234, 82, 27],
474
+ accounts: [
475
+ {
476
+ name: "distributor",
477
+ docs: ["The [MerkleDistributor]."],
478
+ writable: true
479
+ },
480
+ {
481
+ name: "from",
482
+ docs: ["Distributor ATA containing the tokens to distribute."],
483
+ writable: true
484
+ },
485
+ {
486
+ name: "to",
487
+ docs: ["The Clawback token account."],
488
+ writable: true
489
+ },
490
+ {
491
+ name: "admin",
492
+ docs: ["Only Admin can trigger the clawback of funds"],
493
+ writable: true,
494
+ signer: true
495
+ },
496
+ {
497
+ name: "mint"
498
+ },
499
+ {
500
+ name: "system_program",
501
+ docs: ["The [System] program."],
502
+ address: "11111111111111111111111111111111"
503
+ },
504
+ {
505
+ name: "token_program",
506
+ docs: ["SPL [Token] program."]
507
+ }
508
+ ],
509
+ args: []
510
+ },
511
+ {
512
+ name: "close_claim",
513
+ discriminator: [42, 177, 165, 35, 213, 179, 211, 19],
514
+ accounts: [
515
+ {
516
+ name: "distributor",
517
+ docs: ["The [MerkleDistributor]."],
518
+ writable: true
519
+ },
520
+ {
521
+ name: "admin_or_claimant",
522
+ docs: ["Admin signer"],
523
+ writable: true,
524
+ signer: true
525
+ },
526
+ {
527
+ name: "claimant",
528
+ writable: true
529
+ },
530
+ {
531
+ name: "claim_status",
532
+ writable: true,
533
+ pda: {
534
+ seeds: [
535
+ {
536
+ kind: "const",
537
+ value: [67, 108, 97, 105, 109, 83, 116, 97, 116, 117, 115]
538
+ },
539
+ {
540
+ kind: "account",
541
+ path: "claimant"
542
+ },
543
+ {
544
+ kind: "account",
545
+ path: "distributor"
546
+ }
547
+ ]
548
+ }
549
+ },
550
+ {
551
+ name: "system_program",
552
+ docs: ["The [System] program."],
553
+ address: "11111111111111111111111111111111"
554
+ },
555
+ {
556
+ name: "event_authority",
557
+ pda: {
558
+ seeds: [
559
+ {
560
+ kind: "const",
561
+ value: [95, 95, 101, 118, 101, 110, 116, 95, 97, 117, 116, 104, 111, 114, 105, 116, 121]
562
+ }
563
+ ]
564
+ }
565
+ },
566
+ {
567
+ name: "program"
568
+ }
569
+ ],
570
+ args: [
571
+ {
572
+ name: "amount_unlocked",
573
+ type: {
574
+ option: "u64"
575
+ }
576
+ },
577
+ {
578
+ name: "amount_locked",
579
+ type: {
580
+ option: "u64"
581
+ }
582
+ },
583
+ {
584
+ name: "proof",
585
+ type: {
586
+ option: {
587
+ vec: {
588
+ array: ["u8", 32]
589
+ }
590
+ }
591
+ }
592
+ }
593
+ ]
594
+ },
595
+ {
596
+ name: "compress_claim",
597
+ discriminator: [219, 45, 247, 134, 71, 119, 125, 89],
598
+ accounts: [
599
+ {
600
+ name: "distributor",
601
+ docs: ["The [MerkleDistributor]."],
602
+ writable: true
603
+ },
604
+ {
605
+ name: "claim_status",
606
+ writable: true,
607
+ pda: {
608
+ seeds: [
609
+ {
610
+ kind: "const",
611
+ value: [67, 108, 97, 105, 109, 83, 116, 97, 116, 117, 115]
612
+ },
613
+ {
614
+ kind: "account",
615
+ path: "claimant"
616
+ },
617
+ {
618
+ kind: "account",
619
+ path: "distributor"
620
+ }
621
+ ]
622
+ }
623
+ },
624
+ {
625
+ name: "signer",
626
+ docs: ["Signer account"],
627
+ writable: true,
628
+ signer: true
629
+ },
630
+ {
631
+ name: "claimant"
632
+ },
633
+ {
634
+ name: "system_program",
635
+ docs: ["The [System] program."],
636
+ address: "11111111111111111111111111111111"
637
+ }
638
+ ],
639
+ args: []
640
+ },
641
+ {
642
+ name: "new_claim",
643
+ discriminator: [78, 177, 98, 123, 210, 21, 187, 83],
644
+ accounts: [
645
+ {
646
+ name: "distributor",
647
+ docs: ["The [MerkleDistributor]."],
648
+ writable: true
649
+ },
650
+ {
651
+ name: "claim_status",
652
+ writable: true,
653
+ pda: {
654
+ seeds: [
655
+ {
656
+ kind: "const",
657
+ value: [67, 108, 97, 105, 109, 83, 116, 97, 116, 117, 115]
658
+ },
659
+ {
660
+ kind: "account",
661
+ path: "claimant"
662
+ },
663
+ {
664
+ kind: "account",
665
+ path: "distributor"
666
+ }
667
+ ]
668
+ }
669
+ },
670
+ {
671
+ name: "from",
672
+ docs: ["Distributor ATA containing the tokens to distribute."],
673
+ writable: true,
674
+ pda: {
675
+ seeds: [
676
+ {
677
+ kind: "account",
678
+ path: "distributor"
679
+ },
680
+ {
681
+ kind: "account",
682
+ path: "token_program"
683
+ },
684
+ {
685
+ kind: "account",
686
+ path: "distributor.mint",
687
+ account: "MerkleDistributor"
688
+ }
689
+ ],
690
+ program: {
691
+ kind: "const",
692
+ value: [
693
+ 140,
694
+ 151,
695
+ 37,
696
+ 143,
697
+ 78,
698
+ 36,
699
+ 137,
700
+ 241,
701
+ 187,
702
+ 61,
703
+ 16,
704
+ 41,
705
+ 20,
706
+ 142,
707
+ 13,
708
+ 131,
709
+ 11,
710
+ 90,
711
+ 19,
712
+ 153,
713
+ 218,
714
+ 255,
715
+ 16,
716
+ 132,
717
+ 4,
718
+ 142,
719
+ 123,
720
+ 216,
721
+ 219,
722
+ 233,
723
+ 248,
724
+ 89
725
+ ]
726
+ }
727
+ }
728
+ },
729
+ {
730
+ name: "to",
731
+ docs: ["Account to send the claimed tokens to."],
732
+ writable: true
733
+ },
734
+ {
735
+ name: "claimant",
736
+ docs: ["Who is claiming the tokens."],
737
+ writable: true,
738
+ signer: true
739
+ },
740
+ {
741
+ name: "mint",
742
+ docs: ["The mint to claim."],
743
+ relations: ["distributor"]
744
+ },
745
+ {
746
+ name: "token_program",
747
+ docs: ["SPL [Token] program."]
748
+ },
749
+ {
750
+ name: "system_program",
751
+ docs: ["The [System] program."],
752
+ address: "11111111111111111111111111111111"
753
+ },
754
+ {
755
+ name: "event_authority",
756
+ pda: {
757
+ seeds: [
758
+ {
759
+ kind: "const",
760
+ value: [95, 95, 101, 118, 101, 110, 116, 95, 97, 117, 116, 104, 111, 114, 105, 116, 121]
761
+ }
762
+ ]
763
+ }
764
+ },
765
+ {
766
+ name: "program"
767
+ }
768
+ ],
769
+ args: [
770
+ {
771
+ name: "amount_unlocked",
772
+ type: "u64"
773
+ },
774
+ {
775
+ name: "amount_locked",
776
+ type: "u64"
777
+ },
778
+ {
779
+ name: "proof",
780
+ type: {
781
+ vec: {
782
+ array: ["u8", 32]
783
+ }
784
+ }
785
+ }
786
+ ]
787
+ },
788
+ {
789
+ name: "new_distributor",
790
+ docs: [
791
+ "READ THE FOLLOWING:",
792
+ "",
793
+ "This instruction is susceptible to frontrunning that could result in loss of funds if not handled properly.",
794
+ "",
795
+ "An attack could look like:",
796
+ "- A legitimate user opens a new distributor.",
797
+ "- Someone observes the call to this instruction.",
798
+ "- They replace the clawback_receiver, admin, or time parameters with their own.",
799
+ "",
800
+ "One situation that could happen here is the attacker replaces the admin and clawback_receiver with their own",
801
+ "and sets the clawback_start_ts with the minimal time allowed. After clawback_start_ts has elapsed,",
802
+ "the attacker can steal all funds from the distributor to their own clawback_receiver account.",
803
+ "",
804
+ "HOW TO AVOID:",
805
+ "- When you call into this instruction, ensure your transaction succeeds.",
806
+ "- To be extra safe, after your transaction succeeds, read back the state of the created MerkleDistributor account and",
807
+ "assert the parameters are what you expect, most importantly the clawback_receiver and admin.",
808
+ "- If your transaction fails, double check the value on-chain matches what you expect."
809
+ ],
810
+ discriminator: [32, 139, 112, 171, 0, 2, 225, 155],
811
+ accounts: [
812
+ {
813
+ name: "distributor",
814
+ docs: ["[MerkleDistributor]."],
815
+ writable: true,
816
+ pda: {
817
+ seeds: [
818
+ {
819
+ kind: "const",
820
+ value: [77, 101, 114, 107, 108, 101, 68, 105, 115, 116, 114, 105, 98, 117, 116, 111, 114]
821
+ },
822
+ {
823
+ kind: "account",
824
+ path: "mint"
825
+ },
826
+ {
827
+ kind: "arg",
828
+ path: "version"
829
+ }
830
+ ]
831
+ }
832
+ },
833
+ {
834
+ name: "clawback_receiver",
835
+ docs: ["Clawback receiver token account"],
836
+ writable: true
837
+ },
838
+ {
839
+ name: "mint",
840
+ docs: ["The mint to distribute."]
841
+ },
842
+ {
843
+ name: "token_vault",
844
+ docs: ["Token vault"],
845
+ writable: true,
846
+ pda: {
847
+ seeds: [
848
+ {
849
+ kind: "account",
850
+ path: "distributor"
851
+ },
852
+ {
853
+ kind: "account",
854
+ path: "token_program"
855
+ },
856
+ {
857
+ kind: "account",
858
+ path: "mint"
859
+ }
860
+ ],
861
+ program: {
862
+ kind: "const",
863
+ value: [
864
+ 140,
865
+ 151,
866
+ 37,
867
+ 143,
868
+ 78,
869
+ 36,
870
+ 137,
871
+ 241,
872
+ 187,
873
+ 61,
874
+ 16,
875
+ 41,
876
+ 20,
877
+ 142,
878
+ 13,
879
+ 131,
880
+ 11,
881
+ 90,
882
+ 19,
883
+ 153,
884
+ 218,
885
+ 255,
886
+ 16,
887
+ 132,
888
+ 4,
889
+ 142,
890
+ 123,
891
+ 216,
892
+ 219,
893
+ 233,
894
+ 248,
895
+ 89
896
+ ]
897
+ }
898
+ }
899
+ },
900
+ {
901
+ name: "admin",
902
+ docs: [
903
+ "Admin wallet, responsible for creating the distributor and paying for the transaction.",
904
+ "Also has the authority to set the clawback receiver and change itself."
905
+ ],
906
+ writable: true,
907
+ signer: true
908
+ },
909
+ {
910
+ name: "system_program",
911
+ docs: ["The [System] program."],
912
+ address: "11111111111111111111111111111111"
913
+ },
914
+ {
915
+ name: "associated_token_program",
916
+ docs: ["The [Associated Token] program."],
917
+ address: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"
918
+ },
919
+ {
920
+ name: "token_program",
921
+ docs: ["The [Token] program."]
922
+ }
923
+ ],
924
+ args: [
925
+ {
926
+ name: "version",
927
+ type: "u64"
928
+ },
929
+ {
930
+ name: "root",
931
+ type: {
932
+ array: ["u8", 32]
933
+ }
934
+ },
935
+ {
936
+ name: "max_total_claim",
937
+ type: "u64"
938
+ },
939
+ {
940
+ name: "max_num_nodes",
941
+ type: "u64"
942
+ },
943
+ {
944
+ name: "unlock_period",
945
+ type: "u64"
946
+ },
947
+ {
948
+ name: "start_vesting_ts",
949
+ type: "u64"
950
+ },
951
+ {
952
+ name: "end_vesting_ts",
953
+ type: "u64"
954
+ },
955
+ {
956
+ name: "clawback_start_ts",
957
+ type: "u64"
958
+ },
959
+ {
960
+ name: "claims_closable_by_admin",
961
+ type: "bool"
962
+ },
963
+ {
964
+ name: "can_update_duration",
965
+ type: {
966
+ option: "bool"
967
+ }
968
+ },
969
+ {
970
+ name: "total_amount_unlocked",
971
+ type: {
972
+ option: "u64"
973
+ }
974
+ },
975
+ {
976
+ name: "total_amount_locked",
977
+ type: {
978
+ option: "u64"
979
+ }
980
+ },
981
+ {
982
+ name: "claims_closable_by_claimant",
983
+ type: {
984
+ option: "bool"
985
+ }
986
+ },
987
+ {
988
+ name: "claims_limit",
989
+ type: {
990
+ option: "u16"
991
+ }
992
+ }
993
+ ]
994
+ },
995
+ {
996
+ name: "refund_claim",
997
+ discriminator: [157, 23, 164, 146, 176, 53, 147, 143],
998
+ accounts: [
999
+ {
1000
+ name: "distributor",
1001
+ docs: ["The [MerkleDistributor]."],
1002
+ writable: true
1003
+ },
1004
+ {
1005
+ name: "claim_status",
1006
+ writable: true,
1007
+ pda: {
1008
+ seeds: [
1009
+ {
1010
+ kind: "const",
1011
+ value: [67, 108, 97, 105, 109, 83, 116, 97, 116, 117, 115]
1012
+ },
1013
+ {
1014
+ kind: "account",
1015
+ path: "claimant"
1016
+ },
1017
+ {
1018
+ kind: "account",
1019
+ path: "distributor"
1020
+ }
1021
+ ]
1022
+ }
1023
+ },
1024
+ {
1025
+ name: "signer",
1026
+ docs: ["Signer account"],
1027
+ writable: true,
1028
+ signer: true
1029
+ },
1030
+ {
1031
+ name: "claimant"
1032
+ },
1033
+ {
1034
+ name: "streamflow_treasury",
1035
+ writable: true,
1036
+ address: "5SEpbdjFK5FxwTvfsGMXVQTD2v4M2c5tyRTxhdsPkgDw"
1037
+ },
1038
+ {
1039
+ name: "system_program",
1040
+ docs: ["The [System] program."],
1041
+ address: "11111111111111111111111111111111"
1042
+ }
1043
+ ],
1044
+ args: []
1045
+ },
1046
+ {
1047
+ name: "set_admin",
1048
+ discriminator: [251, 163, 0, 52, 91, 194, 187, 92],
1049
+ accounts: [
1050
+ {
1051
+ name: "distributor",
1052
+ docs: ["The [MerkleDistributor]."],
1053
+ writable: true
1054
+ },
1055
+ {
1056
+ name: "admin",
1057
+ docs: ["Admin signer"],
1058
+ writable: true,
1059
+ signer: true
1060
+ },
1061
+ {
1062
+ name: "new_admin",
1063
+ docs: ["New admin account"],
1064
+ writable: true
1065
+ }
1066
+ ],
1067
+ args: []
1068
+ },
1069
+ {
1070
+ name: "set_clawback_receiver",
1071
+ discriminator: [153, 217, 34, 20, 19, 29, 229, 75],
1072
+ accounts: [
1073
+ {
1074
+ name: "distributor",
1075
+ docs: ["The [MerkleDistributor]."],
1076
+ writable: true
1077
+ },
1078
+ {
1079
+ name: "new_clawback_account",
1080
+ docs: ["New clawback account"]
1081
+ },
1082
+ {
1083
+ name: "admin",
1084
+ docs: ["Admin signer"],
1085
+ writable: true,
1086
+ signer: true
1087
+ }
1088
+ ],
1089
+ args: []
1090
+ },
1091
+ {
1092
+ name: "update",
1093
+ discriminator: [219, 200, 88, 176, 158, 63, 253, 127],
1094
+ accounts: [
1095
+ {
1096
+ name: "distributor",
1097
+ docs: ["The [MerkleDistributor]."],
1098
+ writable: true
1099
+ },
1100
+ {
1101
+ name: "admin",
1102
+ docs: ["Only Admin can trigger the clawback of funds"],
1103
+ writable: true,
1104
+ signer: true
1105
+ },
1106
+ {
1107
+ name: "system_program",
1108
+ docs: ["The [System] program."],
1109
+ address: "11111111111111111111111111111111"
1110
+ }
1111
+ ],
1112
+ args: [
1113
+ {
1114
+ name: "end_ts",
1115
+ type: {
1116
+ option: "u64"
1117
+ }
1118
+ }
1119
+ ]
1120
+ }
1121
+ ],
1122
+ accounts: [
1123
+ {
1124
+ name: "ClaimStatus",
1125
+ discriminator: [22, 183, 249, 157, 247, 95, 150, 96]
1126
+ },
1127
+ {
1128
+ name: "CompressedClaimStatus",
1129
+ discriminator: [53, 68, 161, 131, 212, 106, 98, 48]
1130
+ },
1131
+ {
1132
+ name: "MerkleDistributor",
1133
+ discriminator: [77, 119, 139, 70, 84, 247, 12, 26]
1134
+ }
1135
+ ],
1136
+ events: [
1137
+ {
1138
+ name: "ClaimClosedEvent",
1139
+ discriminator: [139, 166, 215, 195, 184, 233, 26, 217]
1140
+ },
1141
+ {
1142
+ name: "ClaimedEvent",
1143
+ discriminator: [144, 172, 209, 86, 144, 87, 84, 115]
1144
+ },
1145
+ {
1146
+ name: "NewClaimEvent",
1147
+ discriminator: [244, 3, 231, 151, 60, 101, 55, 55]
1148
+ }
1149
+ ],
1150
+ errors: [
1151
+ {
1152
+ code: 6e3,
1153
+ name: "InsufficientUnlockedTokens",
1154
+ msg: "Insufficient unlocked tokens"
1155
+ },
1156
+ {
1157
+ code: 6001,
1158
+ name: "InvalidProof",
1159
+ msg: "Invalid Merkle proof"
1160
+ },
1161
+ {
1162
+ code: 6002,
1163
+ name: "ExceededMaxClaim",
1164
+ msg: "Exceeded maximum claim amount"
1165
+ },
1166
+ {
1167
+ code: 6003,
1168
+ name: "MaxNodesExceeded",
1169
+ msg: "Exceeded maximum node count"
1170
+ },
1171
+ {
1172
+ code: 6004,
1173
+ name: "Unauthorized",
1174
+ msg: "Account is not authorized to execute this instruction"
1175
+ },
1176
+ {
1177
+ code: 6005,
1178
+ name: "OwnerMismatch",
1179
+ msg: "Token account owner did not match intended owner"
1180
+ },
1181
+ {
1182
+ code: 6006,
1183
+ name: "ClawbackBeforeStart",
1184
+ msg: "Attempted clawback before start"
1185
+ },
1186
+ {
1187
+ code: 6007,
1188
+ name: "ClawbackAlreadyClaimed",
1189
+ msg: "Clawback already claimed"
1190
+ },
1191
+ {
1192
+ code: 6008,
1193
+ name: "SameClawbackReceiver",
1194
+ msg: "New and old Clawback receivers are identical"
1195
+ },
1196
+ {
1197
+ code: 6009,
1198
+ name: "ClawbackReceiverIsTokenVault",
1199
+ msg: "Clawback receiver can not be the Token Vault"
1200
+ },
1201
+ {
1202
+ code: 6010,
1203
+ name: "SameAdmin",
1204
+ msg: "New and old admin are identical"
1205
+ },
1206
+ {
1207
+ code: 6011,
1208
+ name: "ClaimExpired",
1209
+ msg: "Claim window expired"
1210
+ },
1211
+ {
1212
+ code: 6012,
1213
+ name: "ArithmeticError",
1214
+ msg: "Arithmetic Error (overflow/underflow)"
1215
+ },
1216
+ {
1217
+ code: 6013,
1218
+ name: "StartTimestampAfterEnd",
1219
+ msg: "Start Timestamp cannot be after end Timestamp"
1220
+ },
1221
+ {
1222
+ code: 6014,
1223
+ name: "TimestampsNotInFuture",
1224
+ msg: "Timestamps cannot be in the past"
1225
+ },
1226
+ {
1227
+ code: 6015,
1228
+ name: "InvalidMint",
1229
+ msg: "Invalid Mint"
1230
+ },
1231
+ {
1232
+ code: 6016,
1233
+ name: "ClaimIsClosed",
1234
+ msg: "Claim is closed"
1235
+ },
1236
+ {
1237
+ code: 6017,
1238
+ name: "ClaimsAreNotClosable",
1239
+ msg: "Claims are not closable"
1240
+ },
1241
+ {
1242
+ code: 6018,
1243
+ name: "InvalidUnlockPeriod",
1244
+ msg: "Invalid unlock period"
1245
+ },
1246
+ {
1247
+ code: 6019,
1248
+ name: "DurationUpdateNotAllowed",
1249
+ msg: "Duration update is not allowed"
1250
+ },
1251
+ {
1252
+ code: 6020,
1253
+ name: "NoVestingAmount",
1254
+ msg: "Vesting amounts are not set"
1255
+ },
1256
+ {
1257
+ code: 6021,
1258
+ name: "VestingAlreadyFinished",
1259
+ msg: "Vesting already finished"
1260
+ },
1261
+ {
1262
+ code: 6022,
1263
+ name: "InvalidAmounts",
1264
+ msg: "Provided amounts are invalid"
1265
+ },
1266
+ {
1267
+ code: 6023,
1268
+ name: "ClaimsLimitReached",
1269
+ msg: "Claims limit has been reached"
1270
+ }
1271
+ ],
1272
+ types: [
1273
+ {
1274
+ name: "ClaimClosedEvent",
1275
+ docs: ["Emitted when a new claim is created."],
1276
+ type: {
1277
+ kind: "struct",
1278
+ fields: [
1279
+ {
1280
+ name: "claimant",
1281
+ docs: ["User that claimed."],
1282
+ type: "pubkey"
1283
+ },
1284
+ {
1285
+ name: "timestamp",
1286
+ docs: ["Timestamp."],
1287
+ type: "u64"
1288
+ }
1289
+ ]
1290
+ }
1291
+ },
1292
+ {
1293
+ name: "ClaimStatus",
1294
+ docs: ["Holds whether or not a claimant has claimed tokens."],
1295
+ type: {
1296
+ kind: "struct",
1297
+ fields: [
1298
+ {
1299
+ name: "claimant",
1300
+ docs: ["Authority that claimed the tokens."],
1301
+ type: "pubkey"
1302
+ },
1303
+ {
1304
+ name: "locked_amount",
1305
+ docs: ["Locked amount"],
1306
+ type: "u64"
1307
+ },
1308
+ {
1309
+ name: "locked_amount_withdrawn",
1310
+ docs: ["Locked amount withdrawn"],
1311
+ type: "u64"
1312
+ },
1313
+ {
1314
+ name: "unlocked_amount",
1315
+ docs: ["Unlocked amount"],
1316
+ type: "u64"
1317
+ },
1318
+ {
1319
+ name: "last_claim_ts",
1320
+ docs: ["Last claim time"],
1321
+ type: "u64"
1322
+ },
1323
+ {
1324
+ name: "last_amount_per_unlock",
1325
+ docs: ["Track amount per unlock, can be useful for non-linear vesting"],
1326
+ type: "u64"
1327
+ },
1328
+ {
1329
+ name: "closed",
1330
+ docs: ["Whether claim is closed"],
1331
+ type: "bool"
1332
+ },
1333
+ {
1334
+ name: "distributor",
1335
+ docs: [
1336
+ "Distributor account for which ClaimStatus was created, useful to filter by in get_program_accounts"
1337
+ ],
1338
+ type: "pubkey"
1339
+ },
1340
+ {
1341
+ name: "claims_count",
1342
+ docs: ["Number of time amount has been claimed"],
1343
+ type: "u16"
1344
+ },
1345
+ {
1346
+ name: "closed_ts",
1347
+ docs: ["Time when claim has been closed"],
1348
+ type: "u64"
1349
+ },
1350
+ {
1351
+ name: "buffer_2",
1352
+ docs: ["Buffer for additional fields"],
1353
+ type: {
1354
+ array: ["u8", 22]
1355
+ }
1356
+ }
1357
+ ]
1358
+ }
1359
+ },
1360
+ {
1361
+ name: "ClaimedEvent",
1362
+ docs: ["Emitted when tokens are claimed."],
1363
+ type: {
1364
+ kind: "struct",
1365
+ fields: [
1366
+ {
1367
+ name: "claimant",
1368
+ docs: ["User that claimed."],
1369
+ type: "pubkey"
1370
+ },
1371
+ {
1372
+ name: "amount",
1373
+ docs: ["Amount of tokens to distribute."],
1374
+ type: "u64"
1375
+ }
1376
+ ]
1377
+ }
1378
+ },
1379
+ {
1380
+ name: "CompressedClaimStatus",
1381
+ docs: ["Holds whether or not a claimant has claimed tokens."],
1382
+ type: {
1383
+ kind: "struct",
1384
+ fields: [
1385
+ {
1386
+ name: "state",
1387
+ type: {
1388
+ defined: {
1389
+ name: "State"
1390
+ }
1391
+ }
1392
+ }
1393
+ ]
1394
+ }
1395
+ },
1396
+ {
1397
+ name: "MerkleDistributor",
1398
+ docs: ["State for the account which distributes tokens."],
1399
+ type: {
1400
+ kind: "struct",
1401
+ fields: [
1402
+ {
1403
+ name: "bump",
1404
+ docs: ["Bump seed."],
1405
+ type: "u8"
1406
+ },
1407
+ {
1408
+ name: "version",
1409
+ docs: ["Version of the airdrop"],
1410
+ type: "u64"
1411
+ },
1412
+ {
1413
+ name: "root",
1414
+ docs: ["The 256-bit merkle root."],
1415
+ type: {
1416
+ array: ["u8", 32]
1417
+ }
1418
+ },
1419
+ {
1420
+ name: "mint",
1421
+ docs: ["[Mint] of the token to be distributed."],
1422
+ type: "pubkey"
1423
+ },
1424
+ {
1425
+ name: "token_vault",
1426
+ docs: ["Token Address of the vault"],
1427
+ type: "pubkey"
1428
+ },
1429
+ {
1430
+ name: "max_total_claim",
1431
+ docs: ["Maximum number of tokens that can ever be claimed from this [MerkleDistributor]."],
1432
+ type: "u64"
1433
+ },
1434
+ {
1435
+ name: "max_num_nodes",
1436
+ docs: ["Maximum number of nodes in [MerkleDistributor]."],
1437
+ type: "u64"
1438
+ },
1439
+ {
1440
+ name: "unlock_period",
1441
+ docs: ["Time step (period) in seconds per which the unlock occurs"],
1442
+ type: "u64"
1443
+ },
1444
+ {
1445
+ name: "total_amount_claimed",
1446
+ docs: ["Total amount of tokens that have been claimed."],
1447
+ type: "u64"
1448
+ },
1449
+ {
1450
+ name: "num_nodes_claimed",
1451
+ docs: ["Number of nodes that have been claimed."],
1452
+ type: "u64"
1453
+ },
1454
+ {
1455
+ name: "start_ts",
1456
+ docs: ["Lockup time start (Unix Timestamp)"],
1457
+ type: "u64"
1458
+ },
1459
+ {
1460
+ name: "end_ts",
1461
+ docs: ["Lockup time end (Unix Timestamp)"],
1462
+ type: "u64"
1463
+ },
1464
+ {
1465
+ name: "clawback_start_ts",
1466
+ docs: ["Clawback start (Unix Timestamp)"],
1467
+ type: "u64"
1468
+ },
1469
+ {
1470
+ name: "clawback_receiver",
1471
+ docs: ["Clawback receiver"],
1472
+ type: "pubkey"
1473
+ },
1474
+ {
1475
+ name: "admin",
1476
+ docs: ["Admin wallet"],
1477
+ type: "pubkey"
1478
+ },
1479
+ {
1480
+ name: "clawed_back",
1481
+ docs: ["Whether or not the distributor has been clawed back"],
1482
+ type: "bool"
1483
+ },
1484
+ {
1485
+ name: "claims_closable_by_admin",
1486
+ docs: ["Whether claims are closable by the admin or not"],
1487
+ type: "bool"
1488
+ },
1489
+ {
1490
+ name: "can_update_duration",
1491
+ docs: ["Whether admin can update vesting duration"],
1492
+ type: "bool"
1493
+ },
1494
+ {
1495
+ name: "total_amount_unlocked",
1496
+ docs: ["Total amount of funds unlocked (cliff/instant)"],
1497
+ type: "u64"
1498
+ },
1499
+ {
1500
+ name: "total_amount_locked",
1501
+ docs: ["Total amount of funds locked (vested)"],
1502
+ type: "u64"
1503
+ },
1504
+ {
1505
+ name: "last_duration_update_ts",
1506
+ docs: ["Timestamp when update was last called"],
1507
+ type: "u64"
1508
+ },
1509
+ {
1510
+ name: "total_claimable_pre_update",
1511
+ docs: [
1512
+ "Total amount of locked amount claimable as of last duration update, ever increasing total, accumulates with each update"
1513
+ ],
1514
+ type: "u64"
1515
+ },
1516
+ {
1517
+ name: "clawed_back_ts",
1518
+ docs: ["Timestamp when funds were clawed back"],
1519
+ type: "u64"
1520
+ },
1521
+ {
1522
+ name: "claims_closable_by_claimant",
1523
+ docs: ["Whether claims are closable by claimant or not"],
1524
+ type: "bool"
1525
+ },
1526
+ {
1527
+ name: "claims_limit",
1528
+ docs: ["Limit number of claims"],
1529
+ type: "u16"
1530
+ },
1531
+ {
1532
+ name: "buffer_2",
1533
+ docs: ["Buffer for additional fields"],
1534
+ type: {
1535
+ array: ["u8", 20]
1536
+ }
1537
+ },
1538
+ {
1539
+ name: "buffer_3",
1540
+ docs: ["Buffer for additional fields"],
1541
+ type: {
1542
+ array: ["u8", 32]
1543
+ }
1544
+ }
1545
+ ]
1546
+ }
1547
+ },
1548
+ {
1549
+ name: "NewClaimEvent",
1550
+ docs: ["Emitted when a new claim is created."],
1551
+ type: {
1552
+ kind: "struct",
1553
+ fields: [
1554
+ {
1555
+ name: "claimant",
1556
+ docs: ["User that claimed."],
1557
+ type: "pubkey"
1558
+ },
1559
+ {
1560
+ name: "timestamp",
1561
+ docs: ["Timestamp."],
1562
+ type: "u64"
1563
+ }
1564
+ ]
1565
+ }
1566
+ },
1567
+ {
1568
+ name: "State",
1569
+ type: {
1570
+ kind: "enum",
1571
+ variants: [
1572
+ {
1573
+ name: "Claimed"
1574
+ },
1575
+ {
1576
+ name: "Closed"
1577
+ }
1578
+ ]
1579
+ }
1580
+ }
1581
+ ]
1582
+ };
1583
+
274
1584
  // solana/constants.ts
275
1585
  var constants_exports = {};
276
1586
  __export(constants_exports, {
@@ -311,107 +1621,6 @@ var DISTRIBUTOR_PROGRAM_ID = {
311
1621
  [ICluster.Testnet]: "MErKy6nZVoVAkryxAejJz2juifQ4ArgLgHmaJCQkU7N",
312
1622
  [ICluster.Local]: "MErKy6nZVoVAkryxAejJz2juifQ4ArgLgHmaJCQkU7N"
313
1623
  };
314
- var _ClaimStatus = class _ClaimStatus {
315
- constructor(fields) {
316
- this.claimant = fields.claimant;
317
- this.lockedAmount = fields.lockedAmount;
318
- this.lockedAmountWithdrawn = fields.lockedAmountWithdrawn;
319
- this.unlockedAmount = fields.unlockedAmount;
320
- this.lastClaimTs = fields.lastClaimTs;
321
- this.lastAmountPerUnlock = fields.lastAmountPerUnlock;
322
- this.closed = fields.closed;
323
- this.distributor = fields.distributor;
324
- this.claimsCount = fields.claimsCount;
325
- this.closedTs = fields.closedTs;
326
- this.buffer2 = fields.buffer2;
327
- }
328
- static async fetch(c, address, programId = PROGRAM_ID) {
329
- const info = await c.getAccountInfo(address);
330
- if (info === null) {
331
- return null;
332
- }
333
- if (!info.owner.equals(programId)) {
334
- throw new Error("account doesn't belong to this program");
335
- }
336
- return this.decode(info.data);
337
- }
338
- static async fetchMultiple(c, addresses, programId = PROGRAM_ID) {
339
- const infos = await c.getMultipleAccountsInfo(addresses);
340
- return infos.map((info) => {
341
- if (info === null) {
342
- return null;
343
- }
344
- if (!info.owner.equals(programId)) {
345
- throw new Error("account doesn't belong to this program");
346
- }
347
- return this.decode(info.data);
348
- });
349
- }
350
- static decode(data) {
351
- if (!data.slice(0, 8).equals(_ClaimStatus.discriminator)) {
352
- throw new Error("invalid account discriminator");
353
- }
354
- const dec = _ClaimStatus.layout.decode(data.slice(8));
355
- return new _ClaimStatus({
356
- claimant: dec.claimant,
357
- lockedAmount: dec.lockedAmount,
358
- lockedAmountWithdrawn: dec.lockedAmountWithdrawn,
359
- unlockedAmount: dec.unlockedAmount,
360
- lastClaimTs: dec.lastClaimTs,
361
- lastAmountPerUnlock: dec.lastAmountPerUnlock,
362
- closed: dec.closed,
363
- distributor: dec.distributor,
364
- claimsCount: dec.claimsCount,
365
- closedTs: dec.closedTs,
366
- buffer2: dec.buffer2
367
- });
368
- }
369
- toJSON() {
370
- return {
371
- claimant: this.claimant.toString(),
372
- lockedAmount: this.lockedAmount.toString(),
373
- lockedAmountWithdrawn: this.lockedAmountWithdrawn.toString(),
374
- unlockedAmount: this.unlockedAmount.toString(),
375
- lastClaimTs: this.lastClaimTs.toString(),
376
- lastAmountPerUnlock: this.lastAmountPerUnlock.toString(),
377
- closed: this.closed,
378
- distributor: this.distributor.toString(),
379
- claimsCount: this.claimsCount,
380
- closedTs: this.closedTs.toString(),
381
- buffer2: this.buffer2
382
- };
383
- }
384
- static fromJSON(obj) {
385
- return new _ClaimStatus({
386
- claimant: new PublicKey(obj.claimant),
387
- lockedAmount: new BN6(obj.lockedAmount),
388
- lockedAmountWithdrawn: new BN6(obj.lockedAmountWithdrawn),
389
- unlockedAmount: new BN6(obj.unlockedAmount),
390
- lastClaimTs: new BN6(obj.lastClaimTs),
391
- lastAmountPerUnlock: new BN6(obj.lastAmountPerUnlock),
392
- closed: obj.closed,
393
- distributor: new PublicKey(obj.distributor),
394
- claimsCount: obj.claimsCount,
395
- closedTs: new BN6(obj.closedTs),
396
- buffer2: obj.buffer2
397
- });
398
- }
399
- };
400
- _ClaimStatus.discriminator = Buffer.from([22, 183, 249, 157, 247, 95, 150, 96]);
401
- _ClaimStatus.layout = borsh8.struct([
402
- borsh8.publicKey("claimant"),
403
- borsh8.u64("lockedAmount"),
404
- borsh8.u64("lockedAmountWithdrawn"),
405
- borsh8.u64("unlockedAmount"),
406
- borsh8.u64("lastClaimTs"),
407
- borsh8.u64("lastAmountPerUnlock"),
408
- borsh8.bool("closed"),
409
- borsh8.publicKey("distributor"),
410
- borsh8.u16("claimsCount"),
411
- borsh8.u64("closedTs"),
412
- borsh8.array(borsh8.u8(), 22, "buffer2")
413
- ]);
414
- var ClaimStatus = _ClaimStatus;
415
1624
  var _MerkleDistributor = class _MerkleDistributor {
416
1625
  constructor(fields) {
417
1626
  this.bump = fields.bump;
@@ -533,28 +1742,28 @@ var _MerkleDistributor = class _MerkleDistributor {
533
1742
  static fromJSON(obj) {
534
1743
  return new _MerkleDistributor({
535
1744
  bump: obj.bump,
536
- version: new BN6(obj.version),
1745
+ version: new BN5(obj.version),
537
1746
  root: obj.root,
538
1747
  mint: new PublicKey(obj.mint),
539
1748
  tokenVault: new PublicKey(obj.tokenVault),
540
- maxTotalClaim: new BN6(obj.maxTotalClaim),
541
- maxNumNodes: new BN6(obj.maxNumNodes),
542
- unlockPeriod: new BN6(obj.unlockPeriod),
543
- totalAmountClaimed: new BN6(obj.totalAmountClaimed),
544
- numNodesClaimed: new BN6(obj.numNodesClaimed),
545
- startTs: new BN6(obj.startTs),
546
- endTs: new BN6(obj.endTs),
547
- clawbackStartTs: new BN6(obj.clawbackStartTs),
1749
+ maxTotalClaim: new BN5(obj.maxTotalClaim),
1750
+ maxNumNodes: new BN5(obj.maxNumNodes),
1751
+ unlockPeriod: new BN5(obj.unlockPeriod),
1752
+ totalAmountClaimed: new BN5(obj.totalAmountClaimed),
1753
+ numNodesClaimed: new BN5(obj.numNodesClaimed),
1754
+ startTs: new BN5(obj.startTs),
1755
+ endTs: new BN5(obj.endTs),
1756
+ clawbackStartTs: new BN5(obj.clawbackStartTs),
548
1757
  clawbackReceiver: new PublicKey(obj.clawbackReceiver),
549
1758
  admin: new PublicKey(obj.admin),
550
1759
  clawedBack: obj.clawedBack,
551
1760
  claimsClosableByAdmin: obj.claimsClosableByAdmin,
552
1761
  canUpdateDuration: obj.canUpdateDuration,
553
- totalAmountUnlocked: new BN6(obj.totalAmountUnlocked),
554
- totalAmountLocked: new BN6(obj.totalAmountLocked),
555
- lastDurationUpdateTs: new BN6(obj.lastDurationUpdateTs),
556
- totalClaimablePreUpdate: new BN6(obj.totalClaimablePreUpdate),
557
- clawedBackTs: new BN6(obj.clawedBackTs),
1762
+ totalAmountUnlocked: new BN5(obj.totalAmountUnlocked),
1763
+ totalAmountLocked: new BN5(obj.totalAmountLocked),
1764
+ lastDurationUpdateTs: new BN5(obj.lastDurationUpdateTs),
1765
+ totalClaimablePreUpdate: new BN5(obj.totalClaimablePreUpdate),
1766
+ clawedBackTs: new BN5(obj.clawedBackTs),
558
1767
  claimsClosableByClaimant: obj.claimsClosableByClaimant,
559
1768
  claimsLimit: obj.claimsLimit,
560
1769
  buffer2: obj.buffer2,
@@ -563,34 +1772,34 @@ var _MerkleDistributor = class _MerkleDistributor {
563
1772
  }
564
1773
  };
565
1774
  _MerkleDistributor.discriminator = Buffer.from([77, 119, 139, 70, 84, 247, 12, 26]);
566
- _MerkleDistributor.layout = borsh8.struct([
567
- borsh8.u8("bump"),
568
- borsh8.u64("version"),
569
- borsh8.array(borsh8.u8(), 32, "root"),
570
- borsh8.publicKey("mint"),
571
- borsh8.publicKey("tokenVault"),
572
- borsh8.u64("maxTotalClaim"),
573
- borsh8.u64("maxNumNodes"),
574
- borsh8.u64("unlockPeriod"),
575
- borsh8.u64("totalAmountClaimed"),
576
- borsh8.u64("numNodesClaimed"),
577
- borsh8.u64("startTs"),
578
- borsh8.u64("endTs"),
579
- borsh8.u64("clawbackStartTs"),
580
- borsh8.publicKey("clawbackReceiver"),
581
- borsh8.publicKey("admin"),
582
- borsh8.bool("clawedBack"),
583
- borsh8.bool("claimsClosableByAdmin"),
584
- borsh8.bool("canUpdateDuration"),
585
- borsh8.u64("totalAmountUnlocked"),
586
- borsh8.u64("totalAmountLocked"),
587
- borsh8.u64("lastDurationUpdateTs"),
588
- borsh8.u64("totalClaimablePreUpdate"),
589
- borsh8.u64("clawedBackTs"),
590
- borsh8.bool("claimsClosableByClaimant"),
591
- borsh8.u16("claimsLimit"),
592
- borsh8.array(borsh8.u8(), 20, "buffer2"),
593
- borsh8.array(borsh8.u8(), 32, "buffer3")
1775
+ _MerkleDistributor.layout = borsh7.struct([
1776
+ borsh7.u8("bump"),
1777
+ borsh7.u64("version"),
1778
+ borsh7.array(borsh7.u8(), 32, "root"),
1779
+ borsh7.publicKey("mint"),
1780
+ borsh7.publicKey("tokenVault"),
1781
+ borsh7.u64("maxTotalClaim"),
1782
+ borsh7.u64("maxNumNodes"),
1783
+ borsh7.u64("unlockPeriod"),
1784
+ borsh7.u64("totalAmountClaimed"),
1785
+ borsh7.u64("numNodesClaimed"),
1786
+ borsh7.u64("startTs"),
1787
+ borsh7.u64("endTs"),
1788
+ borsh7.u64("clawbackStartTs"),
1789
+ borsh7.publicKey("clawbackReceiver"),
1790
+ borsh7.publicKey("admin"),
1791
+ borsh7.bool("clawedBack"),
1792
+ borsh7.bool("claimsClosableByAdmin"),
1793
+ borsh7.bool("canUpdateDuration"),
1794
+ borsh7.u64("totalAmountUnlocked"),
1795
+ borsh7.u64("totalAmountLocked"),
1796
+ borsh7.u64("lastDurationUpdateTs"),
1797
+ borsh7.u64("totalClaimablePreUpdate"),
1798
+ borsh7.u64("clawedBackTs"),
1799
+ borsh7.bool("claimsClosableByClaimant"),
1800
+ borsh7.u16("claimsLimit"),
1801
+ borsh7.array(borsh7.u8(), 20, "buffer2"),
1802
+ borsh7.array(borsh7.u8(), 32, "buffer3")
594
1803
  ]);
595
1804
  var MerkleDistributor = _MerkleDistributor;
596
1805
 
@@ -1602,9 +2811,12 @@ function getEventAuthorityPda(programId) {
1602
2811
  const seeds = [Buffer$1.from("__event_authority")];
1603
2812
  return PublicKey.findProgramAddressSync(seeds, programId)[0];
1604
2813
  }
1605
- async function wrappedSignAndExecuteTransaction(connection, invoker, tx, confirmationParams, throttleParams) {
2814
+ var isCompressedClaimStatus = (status) => {
2815
+ return !!status && "state" in status;
2816
+ };
2817
+ async function wrappedSignAndExecuteTransaction(...args) {
1606
2818
  try {
1607
- return await signAndExecuteTransaction(connection, invoker, tx, confirmationParams, throttleParams);
2819
+ return await signAndExecuteTransaction(...args);
1608
2820
  } catch (err) {
1609
2821
  if (err instanceof Error) {
1610
2822
  const parsed = fromTxError(err);
@@ -1645,6 +2857,10 @@ var BaseDistributorClient = class {
1645
2857
  this.connection = new Connection(clusterUrl, this.commitment);
1646
2858
  this.programId = programId !== "" ? new PublicKey(programId) : new PublicKey(DISTRIBUTOR_PROGRAM_ID[cluster]);
1647
2859
  this.sendThrottler = sendThrottler ?? buildSendThrottler(sendRate);
2860
+ const merkleDistributorProgram = {
2861
+ ...merkle_distributor_default
2862
+ };
2863
+ this.merkleDistributorProgram = new Program(merkleDistributorProgram, { connection: this.connection });
1648
2864
  }
1649
2865
  getConnection() {
1650
2866
  return this.connection;
@@ -1679,7 +2895,7 @@ var BaseDistributorClient = class {
1679
2895
  };
1680
2896
  if (extParams.isNative) {
1681
2897
  ixs.push(
1682
- ...await prepareWrappedAccount(this.connection, extParams.invoker.publicKey, new BN6(data.maxTotalClaim))
2898
+ ...await prepareWrappedAccount(this.connection, extParams.invoker.publicKey, new BN5(data.maxTotalClaim))
1683
2899
  );
1684
2900
  }
1685
2901
  const newDistributorInstruction = await this.getNewDistributorInstruction(data, accounts);
@@ -1720,7 +2936,14 @@ var BaseDistributorClient = class {
1720
2936
  return { distributorPublicKey, ixs };
1721
2937
  }
1722
2938
  async create(data, extParams) {
1723
- const { ixs, distributorPublicKey } = await this.prepareCreateInstructions(data, extParams);
2939
+ const invoker = extParams.invoker.publicKey;
2940
+ invariant(invoker, "Invoker's PublicKey is not available, check passed wallet adapter!");
2941
+ const executionParams = this.unwrapExecutionParams(extParams);
2942
+ const { ixs, distributorPublicKey } = await createAndEstimateTransaction(
2943
+ (params) => this.prepareCreateInstructions(data, params),
2944
+ executionParams,
2945
+ (q) => q.ixs
2946
+ );
1724
2947
  const { tx, hash, context } = await prepareTransaction(this.connection, ixs, extParams.invoker.publicKey);
1725
2948
  const signature = await wrappedSignAndExecuteTransaction(
1726
2949
  this.connection,
@@ -1731,7 +2954,7 @@ var BaseDistributorClient = class {
1731
2954
  context,
1732
2955
  commitment: this.getCommitment()
1733
2956
  },
1734
- { sendThrottler: this.sendThrottler }
2957
+ { sendThrottler: this.sendThrottler, skipSimulation: executionParams.skipSimulation }
1735
2958
  );
1736
2959
  return {
1737
2960
  ixs,
@@ -1739,23 +2962,29 @@ var BaseDistributorClient = class {
1739
2962
  metadataId: distributorPublicKey.toBase58()
1740
2963
  };
1741
2964
  }
1742
- async claim(data, extParams) {
1743
- const ixs = await this.prepareClaimInstructions(data, extParams);
1744
- const { tx, hash, context } = await prepareTransaction(this.connection, ixs, extParams.invoker.publicKey);
2965
+ async claim(data, extParams, _serviceTransfer) {
2966
+ const executionParams = this.unwrapExecutionParams(extParams);
2967
+ const invoker = executionParams.invoker.publicKey;
2968
+ invariant(invoker, "Invoker's PublicKey is not available, check passed wallet adapter!");
2969
+ const ixs = await createAndEstimateTransaction(
2970
+ (params) => this.prepareClaimInstructions(data, params, _serviceTransfer),
2971
+ executionParams
2972
+ );
2973
+ const { tx, hash, context } = await prepareTransaction(this.connection, ixs, invoker);
1745
2974
  const signature = await wrappedSignAndExecuteTransaction(
1746
2975
  this.connection,
1747
- extParams.invoker,
2976
+ executionParams.invoker,
1748
2977
  tx,
1749
2978
  {
1750
2979
  hash,
1751
2980
  context,
1752
2981
  commitment: this.getCommitment()
1753
2982
  },
1754
- { sendThrottler: this.sendThrottler }
2983
+ { sendThrottler: this.sendThrottler, skipSimulation: executionParams.skipSimulation }
1755
2984
  );
1756
2985
  return { ixs, txId: signature };
1757
2986
  }
1758
- async prepareClaimInstructions(data, extParams) {
2987
+ async prepareClaimInstructions(data, extParams, _serviceTransfer) {
1759
2988
  if (!extParams.invoker.publicKey) {
1760
2989
  throw new Error("Invoker's PublicKey is not available, check passed wallet adapter!");
1761
2990
  }
@@ -1782,7 +3011,7 @@ var BaseDistributorClient = class {
1782
3011
  extParams.invoker.publicKey
1783
3012
  );
1784
3013
  const eventAuthorityPublicKey = getEventAuthorityPda(this.programId);
1785
- const claimStatus = await ClaimStatus.fetch(this.connection, claimStatusPublicKey);
3014
+ const claimStatus = await this.getClaim(claimStatusPublicKey);
1786
3015
  const accounts = {
1787
3016
  distributor: distributorPublicKey,
1788
3017
  claimStatus: claimStatusPublicKey,
@@ -1797,32 +3026,43 @@ var BaseDistributorClient = class {
1797
3026
  };
1798
3027
  if (!claimStatus) {
1799
3028
  const args = {
1800
- amountLocked: new BN6(data.amountLocked),
1801
- amountUnlocked: new BN6(data.amountUnlocked),
3029
+ amountLocked: new BN5(data.amountLocked),
3030
+ amountUnlocked: new BN5(data.amountUnlocked),
1802
3031
  proof: data.proof
1803
3032
  };
1804
3033
  ixs.push(newClaim(args, accounts, this.programId));
1805
3034
  }
1806
- const nowTs = new BN6(Math.floor(Date.now() / 1e3));
1807
- if (claimStatus || new BN6(data.amountLocked).gtn(0) && nowTs.sub(distributor.startTs).gte(distributor.unlockPeriod)) {
3035
+ const nowTs = new BN5(Math.floor(Date.now() / 1e3));
3036
+ if (claimStatus || new BN5(data.amountLocked).gtn(0) && nowTs.sub(distributor.startTs).gte(distributor.unlockPeriod)) {
1808
3037
  ixs.push(claimLocked(accounts, this.programId));
1809
3038
  }
1810
- ixs.push(this.prepareClaimFeeInstruction(extParams.invoker.publicKey));
3039
+ ixs.push(
3040
+ this.prepareClaimFeeInstruction(
3041
+ extParams.invoker.publicKey,
3042
+ typeof _serviceTransfer === "bigint" ? _serviceTransfer : void 0
3043
+ )
3044
+ );
1811
3045
  return ixs;
1812
3046
  }
1813
3047
  async closeClaim(data, extParams) {
1814
- const ixs = await this.prepareCloseClaimInstructions(data, extParams);
1815
- const { tx, hash, context } = await prepareTransaction(this.connection, ixs, extParams.invoker.publicKey);
3048
+ const executionParams = this.unwrapExecutionParams(extParams);
3049
+ const invoker = executionParams.invoker.publicKey;
3050
+ invariant(invoker, "Invoker's PublicKey is not available, check passed wallet adapter!");
3051
+ const ixs = await createAndEstimateTransaction(
3052
+ (params) => this.prepareCloseClaimInstructions(data, params),
3053
+ executionParams
3054
+ );
3055
+ const { tx, hash, context } = await prepareTransaction(this.connection, ixs, invoker);
1816
3056
  const signature = await wrappedSignAndExecuteTransaction(
1817
3057
  this.connection,
1818
- extParams.invoker,
3058
+ executionParams.invoker,
1819
3059
  tx,
1820
3060
  {
1821
3061
  hash,
1822
3062
  context,
1823
3063
  commitment: this.getCommitment()
1824
3064
  },
1825
- { sendThrottler: this.sendThrottler }
3065
+ { sendThrottler: this.sendThrottler, skipSimulation: executionParams.skipSimulation }
1826
3066
  );
1827
3067
  return { ixs, txId: signature };
1828
3068
  }
@@ -1849,8 +3089,8 @@ var BaseDistributorClient = class {
1849
3089
  program: this.programId
1850
3090
  };
1851
3091
  const closeClaimArgs = {
1852
- amountLocked: data.amountLocked ? new BN6(data.amountLocked) : void 0,
1853
- amountUnlocked: data.amountUnlocked ? new BN6(data.amountUnlocked) : void 0,
3092
+ amountLocked: data.amountLocked ? new BN5(data.amountLocked) : void 0,
3093
+ amountUnlocked: data.amountUnlocked ? new BN5(data.amountUnlocked) : void 0,
1854
3094
  proof: data.proof
1855
3095
  };
1856
3096
  ixs.push(closeClaim(closeClaimArgs, closeClaimAccounts, this.programId));
@@ -1890,26 +3130,37 @@ var BaseDistributorClient = class {
1890
3130
  return ixs;
1891
3131
  }
1892
3132
  async clawback(data, extParams) {
1893
- const ixs = await this.prepareClawbackInstructions(data, extParams);
1894
- const { tx, hash, context } = await prepareTransaction(this.connection, ixs, extParams.invoker.publicKey);
3133
+ const executionParams = this.unwrapExecutionParams(extParams);
3134
+ const invoker = executionParams.invoker.publicKey;
3135
+ invariant(invoker, "Invoker's PublicKey is not available, check passed wallet adapter!");
3136
+ const ixs = await createAndEstimateTransaction(
3137
+ (params) => this.prepareClawbackInstructions(data, params),
3138
+ executionParams
3139
+ );
3140
+ const { tx, hash, context } = await prepareTransaction(this.connection, ixs, invoker);
1895
3141
  const signature = await wrappedSignAndExecuteTransaction(
1896
3142
  this.connection,
1897
- extParams.invoker,
3143
+ executionParams.invoker,
1898
3144
  tx,
1899
3145
  {
1900
3146
  hash,
1901
3147
  context,
1902
3148
  commitment: this.getCommitment()
1903
3149
  },
1904
- { sendThrottler: this.sendThrottler }
3150
+ { sendThrottler: this.sendThrottler, skipSimulation: executionParams.skipSimulation }
1905
3151
  );
1906
3152
  return { ixs, txId: signature };
1907
3153
  }
3154
+ async getClaim(claimStatus) {
3155
+ return this.connection.getAccountInfo(pk(claimStatus)).then((account) => this.decodeClaimStatus(account));
3156
+ }
1908
3157
  async getClaims(data) {
1909
3158
  const claimStatusPublicKeys = data.map(({ id, recipient }) => {
1910
3159
  return getClaimantStatusPda(this.programId, new PublicKey(id), new PublicKey(recipient));
1911
3160
  });
1912
- return ClaimStatus.fetchMultiple(this.connection, claimStatusPublicKeys, this.programId);
3161
+ return this.connection.getMultipleAccountsInfo(claimStatusPublicKeys).then((accounts) => {
3162
+ return accounts.map((account) => this.decodeClaimStatus(account));
3163
+ });
1913
3164
  }
1914
3165
  async getDistributors(data) {
1915
3166
  const distributorPublicKeys = data.ids.map((distributorId) => new PublicKey(distributorId));
@@ -1939,28 +3190,28 @@ var BaseDistributorClient = class {
1939
3190
  account: MerkleDistributor.decode(account.data)
1940
3191
  }));
1941
3192
  }
1942
- prepareClaimFeeInstruction(payer) {
3193
+ prepareClaimFeeInstruction(payer, fee = AIRDROP_CLAIM_FEE) {
1943
3194
  return SystemProgram.transfer({
1944
3195
  fromPubkey: payer,
1945
3196
  toPubkey: STREAMFLOW_TREASURY_PUBLIC_KEY,
1946
- lamports: AIRDROP_CLAIM_FEE
3197
+ lamports: fee
1947
3198
  });
1948
3199
  }
1949
3200
  getNewDistributorArgs(data) {
1950
3201
  const args = {
1951
- version: new BN6(data.version),
3202
+ version: new BN5(data.version),
1952
3203
  root: data.root,
1953
- maxTotalClaim: new BN6(data.maxTotalClaim),
1954
- maxNumNodes: new BN6(data.maxNumNodes),
1955
- unlockPeriod: new BN6(data.unlockPeriod),
1956
- startVestingTs: new BN6(data.startVestingTs),
1957
- endVestingTs: new BN6(data.endVestingTs),
1958
- clawbackStartTs: new BN6(data.clawbackStartTs),
3204
+ maxTotalClaim: new BN5(data.maxTotalClaim),
3205
+ maxNumNodes: new BN5(data.maxNumNodes),
3206
+ unlockPeriod: new BN5(data.unlockPeriod),
3207
+ startVestingTs: new BN5(data.startVestingTs),
3208
+ endVestingTs: new BN5(data.endVestingTs),
3209
+ clawbackStartTs: new BN5(data.clawbackStartTs),
1959
3210
  claimsClosableByAdmin: data.claimsClosableByAdmin,
1960
3211
  claimsClosableByClaimant: data.claimsClosableByClaimant,
1961
3212
  claimsLimit: data.claimsLimit
1962
3213
  };
1963
- const nowTs = new BN6(Math.floor(Date.now() / 1e3));
3214
+ const nowTs = new BN5(Math.floor(Date.now() / 1e3));
1964
3215
  const endVestingTs = args.endVestingTs.isZero() ? nowTs : args.endVestingTs;
1965
3216
  const startVestingTs = args.startVestingTs.isZero() ? nowTs : args.startVestingTs;
1966
3217
  if (endVestingTs.gt(startVestingTs) && endVestingTs.sub(startVestingTs).lt(args.unlockPeriod)) {
@@ -1968,7 +3219,34 @@ var BaseDistributorClient = class {
1968
3219
  }
1969
3220
  return args;
1970
3221
  }
3222
+ unwrapExecutionParams(extParams) {
3223
+ return unwrapExecutionParams(extParams, this.connection);
3224
+ }
3225
+ decodeClaimStatus(account) {
3226
+ if (!account) {
3227
+ return account;
3228
+ }
3229
+ try {
3230
+ return decode(this.merkleDistributorProgram, "claimStatus", account.data);
3231
+ } catch (baseClaimStatusError) {
3232
+ try {
3233
+ return decode(this.merkleDistributorProgram, "compressedClaimStatus", account.data);
3234
+ } catch (compressedClaimStatusError) {
3235
+ throw new Error("Couldn't decode claim status");
3236
+ }
3237
+ }
3238
+ }
1971
3239
  };
3240
+ function decode(program, accountName, accInfo, programKey) {
3241
+ const programId = program.programId?.toBase58() ?? "N/A";
3242
+ invariant(program, `Decoding program with key ${programId} is not available`);
3243
+ const accountEntity = program.idl.accounts?.find((acc) => acc.name === accountName);
3244
+ invariant(
3245
+ !!accountEntity,
3246
+ `Decoding program with key ${programId} doesn't specify account with name ${String(accountName)}`
3247
+ );
3248
+ return program.coder.accounts.decode(accountName, accInfo);
3249
+ }
1972
3250
 
1973
3251
  // solana/clients/SolanaDistributorClient.ts
1974
3252
  var SolanaDistributorClient = class extends BaseDistributorClient {
@@ -1986,7 +3264,7 @@ var aligned_distributor_default = {
1986
3264
  address: "aMERKpFAWoChCi5oZwPvgsSCoGpZKBiU7fi76bdZjt2",
1987
3265
  metadata: {
1988
3266
  name: "aligned_distributor",
1989
- version: "1.3.2",
3267
+ version: "1.5.0",
1990
3268
  spec: "0.1.0",
1991
3269
  description: "Proxy for merkle distributor that updates Vesting duration according to token market performance."
1992
3270
  },
@@ -2130,6 +3408,48 @@ var aligned_distributor_default = {
2130
3408
  }
2131
3409
  ]
2132
3410
  },
3411
+ {
3412
+ name: "migrate_test_oracle",
3413
+ discriminator: [203, 254, 19, 3, 172, 185, 85, 190],
3414
+ accounts: [
3415
+ {
3416
+ name: "payer",
3417
+ writable: true,
3418
+ signer: true
3419
+ },
3420
+ {
3421
+ name: "mint"
3422
+ },
3423
+ {
3424
+ name: "creator"
3425
+ },
3426
+ {
3427
+ name: "test_oracle",
3428
+ writable: true,
3429
+ pda: {
3430
+ seeds: [
3431
+ {
3432
+ kind: "const",
3433
+ value: [116, 101, 115, 116, 45, 111, 114, 97, 99, 108, 101]
3434
+ },
3435
+ {
3436
+ kind: "account",
3437
+ path: "mint"
3438
+ },
3439
+ {
3440
+ kind: "account",
3441
+ path: "creator"
3442
+ }
3443
+ ]
3444
+ }
3445
+ },
3446
+ {
3447
+ name: "system_program",
3448
+ address: "11111111111111111111111111111111"
3449
+ }
3450
+ ],
3451
+ args: []
3452
+ },
2133
3453
  {
2134
3454
  name: "new_distributor",
2135
3455
  discriminator: [32, 139, 112, 171, 0, 2, 225, 155],
@@ -2215,6 +3535,48 @@ var aligned_distributor_default = {
2215
3535
  }
2216
3536
  ]
2217
3537
  },
3538
+ {
3539
+ name: "realloc_test_oracle",
3540
+ discriminator: [234, 221, 116, 4, 198, 251, 244, 206],
3541
+ accounts: [
3542
+ {
3543
+ name: "payer",
3544
+ writable: true,
3545
+ signer: true
3546
+ },
3547
+ {
3548
+ name: "mint"
3549
+ },
3550
+ {
3551
+ name: "creator"
3552
+ },
3553
+ {
3554
+ name: "test_oracle",
3555
+ writable: true,
3556
+ pda: {
3557
+ seeds: [
3558
+ {
3559
+ kind: "const",
3560
+ value: [116, 101, 115, 116, 45, 111, 114, 97, 99, 108, 101]
3561
+ },
3562
+ {
3563
+ kind: "account",
3564
+ path: "mint"
3565
+ },
3566
+ {
3567
+ kind: "account",
3568
+ path: "creator"
3569
+ }
3570
+ ]
3571
+ }
3572
+ },
3573
+ {
3574
+ name: "system_program",
3575
+ address: "11111111111111111111111111111111"
3576
+ }
3577
+ ],
3578
+ args: []
3579
+ },
2218
3580
  {
2219
3581
  name: "set_admin",
2220
3582
  discriminator: [251, 163, 0, 52, 91, 194, 187, 92],
@@ -3000,20 +4362,20 @@ var SolanaAlignedDistributorClient = class extends BaseDistributorClient {
3000
4362
  unlockPeriod
3001
4363
  } = data;
3002
4364
  return {
3003
- totalAmountLocked: new BN6(totalAmountLocked),
3004
- totalAmountUnlocked: new BN6(totalAmountUnlocked),
4365
+ totalAmountLocked: new BN5(totalAmountLocked),
4366
+ totalAmountUnlocked: new BN5(totalAmountUnlocked),
3005
4367
  oracleType: !!oracleType ? { [oracleType]: {} } : { none: {} },
3006
4368
  minPrice: getBN(minPrice, ALIGNED_PRECISION_FACTOR_POW),
3007
4369
  maxPrice: getBN(maxPrice, ALIGNED_PRECISION_FACTOR_POW),
3008
4370
  minPercentage: getBN(minPercentage, ALIGNED_PRECISION_FACTOR_POW),
3009
4371
  maxPercentage: getBN(maxPercentage, ALIGNED_PRECISION_FACTOR_POW),
3010
- tickSize: new BN6(tickSize || 1),
4372
+ tickSize: new BN5(tickSize || 1),
3011
4373
  skipInitial: skipInitial ?? false,
3012
- updatePeriod: unlockPeriod < 30 ? new BN6(30) : new BN6(unlockPeriod)
4374
+ updatePeriod: unlockPeriod < 30 ? new BN5(30) : new BN5(unlockPeriod)
3013
4375
  };
3014
4376
  }
3015
4377
  };
3016
4378
 
3017
- export { AnchorErrorCode, ClaimStatus, ContractErrorCode, MerkleDistributor, SolanaAlignedDistributorClient, SolanaDistributorClient, calculateAmountWithTransferFees, claimLocked, clawback, closeClaim, constants_exports as constants, fromCode3 as fromCode, fromTxError, getAlignedDistributorPda, getClaimantStatusPda, getDistributorPda, getEventAuthorityPda, getTestOraclePda, newClaim, newDistributor, setAdmin, setClawbackReceiver, wrappedSignAndExecuteTransaction };
4379
+ export { AnchorErrorCode, ContractErrorCode, MerkleDistributor, SolanaAlignedDistributorClient, SolanaDistributorClient, calculateAmountWithTransferFees, claimLocked, clawback, closeClaim, constants_exports as constants, fromCode3 as fromCode, fromTxError, getAlignedDistributorPda, getClaimantStatusPda, getDistributorPda, getEventAuthorityPda, getTestOraclePda, isCompressedClaimStatus, newClaim, newDistributor, setAdmin, setClawbackReceiver, wrappedSignAndExecuteTransaction };
3018
4380
  //# sourceMappingURL=index.js.map
3019
4381
  //# sourceMappingURL=index.js.map