@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.
@@ -5,9 +5,9 @@ require('@solana/wallet-adapter-base');
5
5
  var common = require('@streamflow/common');
6
6
  var solana = require('@streamflow/common/solana');
7
7
  var anchor = require('@coral-xyz/anchor');
8
- var borsh8 = require('@coral-xyz/borsh');
8
+ var borsh7 = require('@coral-xyz/borsh');
9
9
  var buffer = require('buffer');
10
- var BN6 = require('bn.js');
10
+ var BN5 = require('bn.js');
11
11
  var splToken = require('@solana/spl-token');
12
12
  var bs58 = require('bs58');
13
13
 
@@ -31,8 +31,8 @@ function _interopNamespace(e) {
31
31
  return Object.freeze(n);
32
32
  }
33
33
 
34
- var borsh8__namespace = /*#__PURE__*/_interopNamespace(borsh8);
35
- var BN6__default = /*#__PURE__*/_interopDefault(BN6);
34
+ var borsh7__namespace = /*#__PURE__*/_interopNamespace(borsh7);
35
+ var BN5__default = /*#__PURE__*/_interopDefault(BN5);
36
36
  var bs58__default = /*#__PURE__*/_interopDefault(bs58);
37
37
 
38
38
  var __defProp = Object.defineProperty;
@@ -45,7 +45,6 @@ var __export = (target, all) => {
45
45
  var solana_exports = {};
46
46
  __export(solana_exports, {
47
47
  AnchorErrorCode: () => AnchorErrorCode,
48
- ClaimStatus: () => ClaimStatus,
49
48
  ContractErrorCode: () => ContractErrorCode,
50
49
  MerkleDistributor: () => MerkleDistributor,
51
50
  SolanaAlignedDistributorClient: () => SolanaAlignedDistributorClient,
@@ -62,6 +61,7 @@ __export(solana_exports, {
62
61
  getDistributorPda: () => getDistributorPda,
63
62
  getEventAuthorityPda: () => getEventAuthorityPda,
64
63
  getTestOraclePda: () => getTestOraclePda,
64
+ isCompressedClaimStatus: () => isCompressedClaimStatus,
65
65
  newClaim: () => newClaim,
66
66
  newDistributor: () => newDistributor,
67
67
  setAdmin: () => setAdmin,
@@ -153,21 +153,21 @@ var PROGRAM_ID_CLI = new web3_js.PublicKey("MErKy6nZVoVAkryxAejJz2juifQ4ArgLgHma
153
153
  var PROGRAM_ID = PROGRAM_ID_CLI;
154
154
 
155
155
  // solana/generated/instructions/newDistributor.ts
156
- var layout = borsh8__namespace.struct([
157
- borsh8__namespace.u64("version"),
158
- borsh8__namespace.array(borsh8__namespace.u8(), 32, "root"),
159
- borsh8__namespace.u64("maxTotalClaim"),
160
- borsh8__namespace.u64("maxNumNodes"),
161
- borsh8__namespace.u64("unlockPeriod"),
162
- borsh8__namespace.u64("startVestingTs"),
163
- borsh8__namespace.u64("endVestingTs"),
164
- borsh8__namespace.u64("clawbackStartTs"),
165
- borsh8__namespace.bool("claimsClosableByAdmin"),
166
- borsh8__namespace.option(borsh8__namespace.bool(), "canUpdateDuration"),
167
- borsh8__namespace.option(borsh8__namespace.u64(), "totalAmountUnlocked"),
168
- borsh8__namespace.option(borsh8__namespace.u64(), "totalAmountLocked"),
169
- borsh8__namespace.option(borsh8__namespace.bool(), "claimsClosableByClaimant"),
170
- borsh8__namespace.option(borsh8__namespace.u16(), "claimsLimit")
156
+ var layout = borsh7__namespace.struct([
157
+ borsh7__namespace.u64("version"),
158
+ borsh7__namespace.array(borsh7__namespace.u8(), 32, "root"),
159
+ borsh7__namespace.u64("maxTotalClaim"),
160
+ borsh7__namespace.u64("maxNumNodes"),
161
+ borsh7__namespace.u64("unlockPeriod"),
162
+ borsh7__namespace.u64("startVestingTs"),
163
+ borsh7__namespace.u64("endVestingTs"),
164
+ borsh7__namespace.u64("clawbackStartTs"),
165
+ borsh7__namespace.bool("claimsClosableByAdmin"),
166
+ borsh7__namespace.option(borsh7__namespace.bool(), "canUpdateDuration"),
167
+ borsh7__namespace.option(borsh7__namespace.u64(), "totalAmountUnlocked"),
168
+ borsh7__namespace.option(borsh7__namespace.u64(), "totalAmountLocked"),
169
+ borsh7__namespace.option(borsh7__namespace.bool(), "claimsClosableByClaimant"),
170
+ borsh7__namespace.option(borsh7__namespace.u16(), "claimsLimit")
171
171
  ]);
172
172
  function newDistributor(args, accounts, programId = PROGRAM_ID) {
173
173
  const keys = [
@@ -209,10 +209,10 @@ function newDistributor(args, accounts, programId = PROGRAM_ID) {
209
209
  const ix = new web3_js.TransactionInstruction({ keys, programId, data });
210
210
  return ix;
211
211
  }
212
- var layout2 = borsh8__namespace.struct([
213
- borsh8__namespace.u64("amountUnlocked"),
214
- borsh8__namespace.u64("amountLocked"),
215
- borsh8__namespace.vec(borsh8__namespace.array(borsh8__namespace.u8(), 32), "proof")
212
+ var layout2 = borsh7__namespace.struct([
213
+ borsh7__namespace.u64("amountUnlocked"),
214
+ borsh7__namespace.u64("amountLocked"),
215
+ borsh7__namespace.vec(borsh7__namespace.array(borsh7__namespace.u8(), 32), "proof")
216
216
  ]);
217
217
  function newClaim(args, accounts, programId = PROGRAM_ID) {
218
218
  const keys = [
@@ -273,10 +273,10 @@ function clawback(accounts, programId = PROGRAM_ID) {
273
273
  const ix = new web3_js.TransactionInstruction({ keys, programId, data });
274
274
  return ix;
275
275
  }
276
- var layout3 = borsh8__namespace.struct([
277
- borsh8__namespace.option(borsh8__namespace.u64(), "amountUnlocked"),
278
- borsh8__namespace.option(borsh8__namespace.u64(), "amountLocked"),
279
- borsh8__namespace.option(borsh8__namespace.vec(borsh8__namespace.array(borsh8__namespace.u8(), 32)), "proof")
276
+ var layout3 = borsh7__namespace.struct([
277
+ borsh7__namespace.option(borsh7__namespace.u64(), "amountUnlocked"),
278
+ borsh7__namespace.option(borsh7__namespace.u64(), "amountLocked"),
279
+ borsh7__namespace.option(borsh7__namespace.vec(borsh7__namespace.array(borsh7__namespace.u8(), 32)), "proof")
280
280
  ]);
281
281
  function closeClaim(args, accounts, programId = PROGRAM_ID) {
282
282
  const keys = [
@@ -325,6 +325,1316 @@ function setAdmin(accounts, programId = PROGRAM_ID) {
325
325
  return ix;
326
326
  }
327
327
 
328
+ // solana/descriptor/idl/merkle_distributor.json
329
+ var merkle_distributor_default = {
330
+ address: "MErKy6nZVoVAkryxAejJz2juifQ4ArgLgHmaJCQkU7N",
331
+ metadata: {
332
+ name: "merkle_distributor",
333
+ version: "1.5.0",
334
+ spec: "0.1.0",
335
+ description: "A Solana program for distributing tokens according to a Merkle root.",
336
+ repository: "https://github.com/streamflow-finance/distributor"
337
+ },
338
+ instructions: [
339
+ {
340
+ name: "_expose_claim",
341
+ discriminator: [103, 233, 83, 69, 115, 199, 128, 249],
342
+ accounts: [
343
+ {
344
+ name: "distributor",
345
+ docs: ["The [MerkleDistributor]."]
346
+ },
347
+ {
348
+ name: "claim_status",
349
+ docs: ["Claim Status PDA"],
350
+ optional: true,
351
+ pda: {
352
+ seeds: [
353
+ {
354
+ kind: "const",
355
+ value: [67, 108, 97, 105, 109, 83, 116, 97, 116, 117, 115]
356
+ },
357
+ {
358
+ kind: "account",
359
+ path: "claimant"
360
+ },
361
+ {
362
+ kind: "account",
363
+ path: "distributor"
364
+ }
365
+ ]
366
+ }
367
+ },
368
+ {
369
+ name: "compressed_claim_status",
370
+ docs: ["Compress Claim Status PDA"],
371
+ optional: true,
372
+ pda: {
373
+ seeds: [
374
+ {
375
+ kind: "const",
376
+ value: [67, 108, 97, 105, 109, 83, 116, 97, 116, 117, 115]
377
+ },
378
+ {
379
+ kind: "account",
380
+ path: "claimant"
381
+ },
382
+ {
383
+ kind: "account",
384
+ path: "distributor"
385
+ }
386
+ ]
387
+ }
388
+ },
389
+ {
390
+ name: "claimant",
391
+ docs: ["Who is claiming the tokens."],
392
+ signer: true
393
+ }
394
+ ],
395
+ args: []
396
+ },
397
+ {
398
+ name: "claim_locked",
399
+ discriminator: [34, 206, 181, 23, 11, 207, 147, 90],
400
+ accounts: [
401
+ {
402
+ name: "distributor",
403
+ docs: ["The [MerkleDistributor]."],
404
+ writable: true
405
+ },
406
+ {
407
+ name: "claim_status",
408
+ writable: true,
409
+ pda: {
410
+ seeds: [
411
+ {
412
+ kind: "const",
413
+ value: [67, 108, 97, 105, 109, 83, 116, 97, 116, 117, 115]
414
+ },
415
+ {
416
+ kind: "account",
417
+ path: "claimant"
418
+ },
419
+ {
420
+ kind: "account",
421
+ path: "distributor"
422
+ }
423
+ ]
424
+ }
425
+ },
426
+ {
427
+ name: "from",
428
+ docs: ["Distributor ATA containing the tokens to distribute."],
429
+ writable: true,
430
+ pda: {
431
+ seeds: [
432
+ {
433
+ kind: "account",
434
+ path: "distributor"
435
+ },
436
+ {
437
+ kind: "account",
438
+ path: "token_program"
439
+ },
440
+ {
441
+ kind: "account",
442
+ path: "distributor.mint",
443
+ account: "MerkleDistributor"
444
+ }
445
+ ],
446
+ program: {
447
+ kind: "const",
448
+ value: [
449
+ 140,
450
+ 151,
451
+ 37,
452
+ 143,
453
+ 78,
454
+ 36,
455
+ 137,
456
+ 241,
457
+ 187,
458
+ 61,
459
+ 16,
460
+ 41,
461
+ 20,
462
+ 142,
463
+ 13,
464
+ 131,
465
+ 11,
466
+ 90,
467
+ 19,
468
+ 153,
469
+ 218,
470
+ 255,
471
+ 16,
472
+ 132,
473
+ 4,
474
+ 142,
475
+ 123,
476
+ 216,
477
+ 219,
478
+ 233,
479
+ 248,
480
+ 89
481
+ ]
482
+ }
483
+ }
484
+ },
485
+ {
486
+ name: "to",
487
+ docs: [
488
+ "Account to send the claimed tokens to.",
489
+ "Claimant must sign the transaction and can only claim on behalf of themself"
490
+ ],
491
+ writable: true
492
+ },
493
+ {
494
+ name: "claimant",
495
+ docs: ["Who is claiming the tokens."],
496
+ writable: true,
497
+ signer: true
498
+ },
499
+ {
500
+ name: "mint",
501
+ docs: ["The mint to claim."],
502
+ relations: ["distributor"]
503
+ },
504
+ {
505
+ name: "token_program",
506
+ docs: ["SPL [Token] program."]
507
+ },
508
+ {
509
+ name: "event_authority",
510
+ pda: {
511
+ seeds: [
512
+ {
513
+ kind: "const",
514
+ value: [95, 95, 101, 118, 101, 110, 116, 95, 97, 117, 116, 104, 111, 114, 105, 116, 121]
515
+ }
516
+ ]
517
+ }
518
+ },
519
+ {
520
+ name: "program"
521
+ }
522
+ ],
523
+ args: []
524
+ },
525
+ {
526
+ name: "clawback",
527
+ discriminator: [111, 92, 142, 79, 33, 234, 82, 27],
528
+ accounts: [
529
+ {
530
+ name: "distributor",
531
+ docs: ["The [MerkleDistributor]."],
532
+ writable: true
533
+ },
534
+ {
535
+ name: "from",
536
+ docs: ["Distributor ATA containing the tokens to distribute."],
537
+ writable: true
538
+ },
539
+ {
540
+ name: "to",
541
+ docs: ["The Clawback token account."],
542
+ writable: true
543
+ },
544
+ {
545
+ name: "admin",
546
+ docs: ["Only Admin can trigger the clawback of funds"],
547
+ writable: true,
548
+ signer: true
549
+ },
550
+ {
551
+ name: "mint"
552
+ },
553
+ {
554
+ name: "system_program",
555
+ docs: ["The [System] program."],
556
+ address: "11111111111111111111111111111111"
557
+ },
558
+ {
559
+ name: "token_program",
560
+ docs: ["SPL [Token] program."]
561
+ }
562
+ ],
563
+ args: []
564
+ },
565
+ {
566
+ name: "close_claim",
567
+ discriminator: [42, 177, 165, 35, 213, 179, 211, 19],
568
+ accounts: [
569
+ {
570
+ name: "distributor",
571
+ docs: ["The [MerkleDistributor]."],
572
+ writable: true
573
+ },
574
+ {
575
+ name: "admin_or_claimant",
576
+ docs: ["Admin signer"],
577
+ writable: true,
578
+ signer: true
579
+ },
580
+ {
581
+ name: "claimant",
582
+ writable: true
583
+ },
584
+ {
585
+ name: "claim_status",
586
+ writable: true,
587
+ pda: {
588
+ seeds: [
589
+ {
590
+ kind: "const",
591
+ value: [67, 108, 97, 105, 109, 83, 116, 97, 116, 117, 115]
592
+ },
593
+ {
594
+ kind: "account",
595
+ path: "claimant"
596
+ },
597
+ {
598
+ kind: "account",
599
+ path: "distributor"
600
+ }
601
+ ]
602
+ }
603
+ },
604
+ {
605
+ name: "system_program",
606
+ docs: ["The [System] program."],
607
+ address: "11111111111111111111111111111111"
608
+ },
609
+ {
610
+ name: "event_authority",
611
+ pda: {
612
+ seeds: [
613
+ {
614
+ kind: "const",
615
+ value: [95, 95, 101, 118, 101, 110, 116, 95, 97, 117, 116, 104, 111, 114, 105, 116, 121]
616
+ }
617
+ ]
618
+ }
619
+ },
620
+ {
621
+ name: "program"
622
+ }
623
+ ],
624
+ args: [
625
+ {
626
+ name: "amount_unlocked",
627
+ type: {
628
+ option: "u64"
629
+ }
630
+ },
631
+ {
632
+ name: "amount_locked",
633
+ type: {
634
+ option: "u64"
635
+ }
636
+ },
637
+ {
638
+ name: "proof",
639
+ type: {
640
+ option: {
641
+ vec: {
642
+ array: ["u8", 32]
643
+ }
644
+ }
645
+ }
646
+ }
647
+ ]
648
+ },
649
+ {
650
+ name: "compress_claim",
651
+ discriminator: [219, 45, 247, 134, 71, 119, 125, 89],
652
+ accounts: [
653
+ {
654
+ name: "distributor",
655
+ docs: ["The [MerkleDistributor]."],
656
+ writable: true
657
+ },
658
+ {
659
+ name: "claim_status",
660
+ writable: true,
661
+ pda: {
662
+ seeds: [
663
+ {
664
+ kind: "const",
665
+ value: [67, 108, 97, 105, 109, 83, 116, 97, 116, 117, 115]
666
+ },
667
+ {
668
+ kind: "account",
669
+ path: "claimant"
670
+ },
671
+ {
672
+ kind: "account",
673
+ path: "distributor"
674
+ }
675
+ ]
676
+ }
677
+ },
678
+ {
679
+ name: "signer",
680
+ docs: ["Signer account"],
681
+ writable: true,
682
+ signer: true
683
+ },
684
+ {
685
+ name: "claimant"
686
+ },
687
+ {
688
+ name: "system_program",
689
+ docs: ["The [System] program."],
690
+ address: "11111111111111111111111111111111"
691
+ }
692
+ ],
693
+ args: []
694
+ },
695
+ {
696
+ name: "new_claim",
697
+ discriminator: [78, 177, 98, 123, 210, 21, 187, 83],
698
+ accounts: [
699
+ {
700
+ name: "distributor",
701
+ docs: ["The [MerkleDistributor]."],
702
+ writable: true
703
+ },
704
+ {
705
+ name: "claim_status",
706
+ writable: true,
707
+ pda: {
708
+ seeds: [
709
+ {
710
+ kind: "const",
711
+ value: [67, 108, 97, 105, 109, 83, 116, 97, 116, 117, 115]
712
+ },
713
+ {
714
+ kind: "account",
715
+ path: "claimant"
716
+ },
717
+ {
718
+ kind: "account",
719
+ path: "distributor"
720
+ }
721
+ ]
722
+ }
723
+ },
724
+ {
725
+ name: "from",
726
+ docs: ["Distributor ATA containing the tokens to distribute."],
727
+ writable: true,
728
+ pda: {
729
+ seeds: [
730
+ {
731
+ kind: "account",
732
+ path: "distributor"
733
+ },
734
+ {
735
+ kind: "account",
736
+ path: "token_program"
737
+ },
738
+ {
739
+ kind: "account",
740
+ path: "distributor.mint",
741
+ account: "MerkleDistributor"
742
+ }
743
+ ],
744
+ program: {
745
+ kind: "const",
746
+ value: [
747
+ 140,
748
+ 151,
749
+ 37,
750
+ 143,
751
+ 78,
752
+ 36,
753
+ 137,
754
+ 241,
755
+ 187,
756
+ 61,
757
+ 16,
758
+ 41,
759
+ 20,
760
+ 142,
761
+ 13,
762
+ 131,
763
+ 11,
764
+ 90,
765
+ 19,
766
+ 153,
767
+ 218,
768
+ 255,
769
+ 16,
770
+ 132,
771
+ 4,
772
+ 142,
773
+ 123,
774
+ 216,
775
+ 219,
776
+ 233,
777
+ 248,
778
+ 89
779
+ ]
780
+ }
781
+ }
782
+ },
783
+ {
784
+ name: "to",
785
+ docs: ["Account to send the claimed tokens to."],
786
+ writable: true
787
+ },
788
+ {
789
+ name: "claimant",
790
+ docs: ["Who is claiming the tokens."],
791
+ writable: true,
792
+ signer: true
793
+ },
794
+ {
795
+ name: "mint",
796
+ docs: ["The mint to claim."],
797
+ relations: ["distributor"]
798
+ },
799
+ {
800
+ name: "token_program",
801
+ docs: ["SPL [Token] program."]
802
+ },
803
+ {
804
+ name: "system_program",
805
+ docs: ["The [System] program."],
806
+ address: "11111111111111111111111111111111"
807
+ },
808
+ {
809
+ name: "event_authority",
810
+ pda: {
811
+ seeds: [
812
+ {
813
+ kind: "const",
814
+ value: [95, 95, 101, 118, 101, 110, 116, 95, 97, 117, 116, 104, 111, 114, 105, 116, 121]
815
+ }
816
+ ]
817
+ }
818
+ },
819
+ {
820
+ name: "program"
821
+ }
822
+ ],
823
+ args: [
824
+ {
825
+ name: "amount_unlocked",
826
+ type: "u64"
827
+ },
828
+ {
829
+ name: "amount_locked",
830
+ type: "u64"
831
+ },
832
+ {
833
+ name: "proof",
834
+ type: {
835
+ vec: {
836
+ array: ["u8", 32]
837
+ }
838
+ }
839
+ }
840
+ ]
841
+ },
842
+ {
843
+ name: "new_distributor",
844
+ docs: [
845
+ "READ THE FOLLOWING:",
846
+ "",
847
+ "This instruction is susceptible to frontrunning that could result in loss of funds if not handled properly.",
848
+ "",
849
+ "An attack could look like:",
850
+ "- A legitimate user opens a new distributor.",
851
+ "- Someone observes the call to this instruction.",
852
+ "- They replace the clawback_receiver, admin, or time parameters with their own.",
853
+ "",
854
+ "One situation that could happen here is the attacker replaces the admin and clawback_receiver with their own",
855
+ "and sets the clawback_start_ts with the minimal time allowed. After clawback_start_ts has elapsed,",
856
+ "the attacker can steal all funds from the distributor to their own clawback_receiver account.",
857
+ "",
858
+ "HOW TO AVOID:",
859
+ "- When you call into this instruction, ensure your transaction succeeds.",
860
+ "- To be extra safe, after your transaction succeeds, read back the state of the created MerkleDistributor account and",
861
+ "assert the parameters are what you expect, most importantly the clawback_receiver and admin.",
862
+ "- If your transaction fails, double check the value on-chain matches what you expect."
863
+ ],
864
+ discriminator: [32, 139, 112, 171, 0, 2, 225, 155],
865
+ accounts: [
866
+ {
867
+ name: "distributor",
868
+ docs: ["[MerkleDistributor]."],
869
+ writable: true,
870
+ pda: {
871
+ seeds: [
872
+ {
873
+ kind: "const",
874
+ value: [77, 101, 114, 107, 108, 101, 68, 105, 115, 116, 114, 105, 98, 117, 116, 111, 114]
875
+ },
876
+ {
877
+ kind: "account",
878
+ path: "mint"
879
+ },
880
+ {
881
+ kind: "arg",
882
+ path: "version"
883
+ }
884
+ ]
885
+ }
886
+ },
887
+ {
888
+ name: "clawback_receiver",
889
+ docs: ["Clawback receiver token account"],
890
+ writable: true
891
+ },
892
+ {
893
+ name: "mint",
894
+ docs: ["The mint to distribute."]
895
+ },
896
+ {
897
+ name: "token_vault",
898
+ docs: ["Token vault"],
899
+ writable: true,
900
+ pda: {
901
+ seeds: [
902
+ {
903
+ kind: "account",
904
+ path: "distributor"
905
+ },
906
+ {
907
+ kind: "account",
908
+ path: "token_program"
909
+ },
910
+ {
911
+ kind: "account",
912
+ path: "mint"
913
+ }
914
+ ],
915
+ program: {
916
+ kind: "const",
917
+ value: [
918
+ 140,
919
+ 151,
920
+ 37,
921
+ 143,
922
+ 78,
923
+ 36,
924
+ 137,
925
+ 241,
926
+ 187,
927
+ 61,
928
+ 16,
929
+ 41,
930
+ 20,
931
+ 142,
932
+ 13,
933
+ 131,
934
+ 11,
935
+ 90,
936
+ 19,
937
+ 153,
938
+ 218,
939
+ 255,
940
+ 16,
941
+ 132,
942
+ 4,
943
+ 142,
944
+ 123,
945
+ 216,
946
+ 219,
947
+ 233,
948
+ 248,
949
+ 89
950
+ ]
951
+ }
952
+ }
953
+ },
954
+ {
955
+ name: "admin",
956
+ docs: [
957
+ "Admin wallet, responsible for creating the distributor and paying for the transaction.",
958
+ "Also has the authority to set the clawback receiver and change itself."
959
+ ],
960
+ writable: true,
961
+ signer: true
962
+ },
963
+ {
964
+ name: "system_program",
965
+ docs: ["The [System] program."],
966
+ address: "11111111111111111111111111111111"
967
+ },
968
+ {
969
+ name: "associated_token_program",
970
+ docs: ["The [Associated Token] program."],
971
+ address: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"
972
+ },
973
+ {
974
+ name: "token_program",
975
+ docs: ["The [Token] program."]
976
+ }
977
+ ],
978
+ args: [
979
+ {
980
+ name: "version",
981
+ type: "u64"
982
+ },
983
+ {
984
+ name: "root",
985
+ type: {
986
+ array: ["u8", 32]
987
+ }
988
+ },
989
+ {
990
+ name: "max_total_claim",
991
+ type: "u64"
992
+ },
993
+ {
994
+ name: "max_num_nodes",
995
+ type: "u64"
996
+ },
997
+ {
998
+ name: "unlock_period",
999
+ type: "u64"
1000
+ },
1001
+ {
1002
+ name: "start_vesting_ts",
1003
+ type: "u64"
1004
+ },
1005
+ {
1006
+ name: "end_vesting_ts",
1007
+ type: "u64"
1008
+ },
1009
+ {
1010
+ name: "clawback_start_ts",
1011
+ type: "u64"
1012
+ },
1013
+ {
1014
+ name: "claims_closable_by_admin",
1015
+ type: "bool"
1016
+ },
1017
+ {
1018
+ name: "can_update_duration",
1019
+ type: {
1020
+ option: "bool"
1021
+ }
1022
+ },
1023
+ {
1024
+ name: "total_amount_unlocked",
1025
+ type: {
1026
+ option: "u64"
1027
+ }
1028
+ },
1029
+ {
1030
+ name: "total_amount_locked",
1031
+ type: {
1032
+ option: "u64"
1033
+ }
1034
+ },
1035
+ {
1036
+ name: "claims_closable_by_claimant",
1037
+ type: {
1038
+ option: "bool"
1039
+ }
1040
+ },
1041
+ {
1042
+ name: "claims_limit",
1043
+ type: {
1044
+ option: "u16"
1045
+ }
1046
+ }
1047
+ ]
1048
+ },
1049
+ {
1050
+ name: "refund_claim",
1051
+ discriminator: [157, 23, 164, 146, 176, 53, 147, 143],
1052
+ accounts: [
1053
+ {
1054
+ name: "distributor",
1055
+ docs: ["The [MerkleDistributor]."],
1056
+ writable: true
1057
+ },
1058
+ {
1059
+ name: "claim_status",
1060
+ writable: true,
1061
+ pda: {
1062
+ seeds: [
1063
+ {
1064
+ kind: "const",
1065
+ value: [67, 108, 97, 105, 109, 83, 116, 97, 116, 117, 115]
1066
+ },
1067
+ {
1068
+ kind: "account",
1069
+ path: "claimant"
1070
+ },
1071
+ {
1072
+ kind: "account",
1073
+ path: "distributor"
1074
+ }
1075
+ ]
1076
+ }
1077
+ },
1078
+ {
1079
+ name: "signer",
1080
+ docs: ["Signer account"],
1081
+ writable: true,
1082
+ signer: true
1083
+ },
1084
+ {
1085
+ name: "claimant"
1086
+ },
1087
+ {
1088
+ name: "streamflow_treasury",
1089
+ writable: true,
1090
+ address: "5SEpbdjFK5FxwTvfsGMXVQTD2v4M2c5tyRTxhdsPkgDw"
1091
+ },
1092
+ {
1093
+ name: "system_program",
1094
+ docs: ["The [System] program."],
1095
+ address: "11111111111111111111111111111111"
1096
+ }
1097
+ ],
1098
+ args: []
1099
+ },
1100
+ {
1101
+ name: "set_admin",
1102
+ discriminator: [251, 163, 0, 52, 91, 194, 187, 92],
1103
+ accounts: [
1104
+ {
1105
+ name: "distributor",
1106
+ docs: ["The [MerkleDistributor]."],
1107
+ writable: true
1108
+ },
1109
+ {
1110
+ name: "admin",
1111
+ docs: ["Admin signer"],
1112
+ writable: true,
1113
+ signer: true
1114
+ },
1115
+ {
1116
+ name: "new_admin",
1117
+ docs: ["New admin account"],
1118
+ writable: true
1119
+ }
1120
+ ],
1121
+ args: []
1122
+ },
1123
+ {
1124
+ name: "set_clawback_receiver",
1125
+ discriminator: [153, 217, 34, 20, 19, 29, 229, 75],
1126
+ accounts: [
1127
+ {
1128
+ name: "distributor",
1129
+ docs: ["The [MerkleDistributor]."],
1130
+ writable: true
1131
+ },
1132
+ {
1133
+ name: "new_clawback_account",
1134
+ docs: ["New clawback account"]
1135
+ },
1136
+ {
1137
+ name: "admin",
1138
+ docs: ["Admin signer"],
1139
+ writable: true,
1140
+ signer: true
1141
+ }
1142
+ ],
1143
+ args: []
1144
+ },
1145
+ {
1146
+ name: "update",
1147
+ discriminator: [219, 200, 88, 176, 158, 63, 253, 127],
1148
+ accounts: [
1149
+ {
1150
+ name: "distributor",
1151
+ docs: ["The [MerkleDistributor]."],
1152
+ writable: true
1153
+ },
1154
+ {
1155
+ name: "admin",
1156
+ docs: ["Only Admin can trigger the clawback of funds"],
1157
+ writable: true,
1158
+ signer: true
1159
+ },
1160
+ {
1161
+ name: "system_program",
1162
+ docs: ["The [System] program."],
1163
+ address: "11111111111111111111111111111111"
1164
+ }
1165
+ ],
1166
+ args: [
1167
+ {
1168
+ name: "end_ts",
1169
+ type: {
1170
+ option: "u64"
1171
+ }
1172
+ }
1173
+ ]
1174
+ }
1175
+ ],
1176
+ accounts: [
1177
+ {
1178
+ name: "ClaimStatus",
1179
+ discriminator: [22, 183, 249, 157, 247, 95, 150, 96]
1180
+ },
1181
+ {
1182
+ name: "CompressedClaimStatus",
1183
+ discriminator: [53, 68, 161, 131, 212, 106, 98, 48]
1184
+ },
1185
+ {
1186
+ name: "MerkleDistributor",
1187
+ discriminator: [77, 119, 139, 70, 84, 247, 12, 26]
1188
+ }
1189
+ ],
1190
+ events: [
1191
+ {
1192
+ name: "ClaimClosedEvent",
1193
+ discriminator: [139, 166, 215, 195, 184, 233, 26, 217]
1194
+ },
1195
+ {
1196
+ name: "ClaimedEvent",
1197
+ discriminator: [144, 172, 209, 86, 144, 87, 84, 115]
1198
+ },
1199
+ {
1200
+ name: "NewClaimEvent",
1201
+ discriminator: [244, 3, 231, 151, 60, 101, 55, 55]
1202
+ }
1203
+ ],
1204
+ errors: [
1205
+ {
1206
+ code: 6e3,
1207
+ name: "InsufficientUnlockedTokens",
1208
+ msg: "Insufficient unlocked tokens"
1209
+ },
1210
+ {
1211
+ code: 6001,
1212
+ name: "InvalidProof",
1213
+ msg: "Invalid Merkle proof"
1214
+ },
1215
+ {
1216
+ code: 6002,
1217
+ name: "ExceededMaxClaim",
1218
+ msg: "Exceeded maximum claim amount"
1219
+ },
1220
+ {
1221
+ code: 6003,
1222
+ name: "MaxNodesExceeded",
1223
+ msg: "Exceeded maximum node count"
1224
+ },
1225
+ {
1226
+ code: 6004,
1227
+ name: "Unauthorized",
1228
+ msg: "Account is not authorized to execute this instruction"
1229
+ },
1230
+ {
1231
+ code: 6005,
1232
+ name: "OwnerMismatch",
1233
+ msg: "Token account owner did not match intended owner"
1234
+ },
1235
+ {
1236
+ code: 6006,
1237
+ name: "ClawbackBeforeStart",
1238
+ msg: "Attempted clawback before start"
1239
+ },
1240
+ {
1241
+ code: 6007,
1242
+ name: "ClawbackAlreadyClaimed",
1243
+ msg: "Clawback already claimed"
1244
+ },
1245
+ {
1246
+ code: 6008,
1247
+ name: "SameClawbackReceiver",
1248
+ msg: "New and old Clawback receivers are identical"
1249
+ },
1250
+ {
1251
+ code: 6009,
1252
+ name: "ClawbackReceiverIsTokenVault",
1253
+ msg: "Clawback receiver can not be the Token Vault"
1254
+ },
1255
+ {
1256
+ code: 6010,
1257
+ name: "SameAdmin",
1258
+ msg: "New and old admin are identical"
1259
+ },
1260
+ {
1261
+ code: 6011,
1262
+ name: "ClaimExpired",
1263
+ msg: "Claim window expired"
1264
+ },
1265
+ {
1266
+ code: 6012,
1267
+ name: "ArithmeticError",
1268
+ msg: "Arithmetic Error (overflow/underflow)"
1269
+ },
1270
+ {
1271
+ code: 6013,
1272
+ name: "StartTimestampAfterEnd",
1273
+ msg: "Start Timestamp cannot be after end Timestamp"
1274
+ },
1275
+ {
1276
+ code: 6014,
1277
+ name: "TimestampsNotInFuture",
1278
+ msg: "Timestamps cannot be in the past"
1279
+ },
1280
+ {
1281
+ code: 6015,
1282
+ name: "InvalidMint",
1283
+ msg: "Invalid Mint"
1284
+ },
1285
+ {
1286
+ code: 6016,
1287
+ name: "ClaimIsClosed",
1288
+ msg: "Claim is closed"
1289
+ },
1290
+ {
1291
+ code: 6017,
1292
+ name: "ClaimsAreNotClosable",
1293
+ msg: "Claims are not closable"
1294
+ },
1295
+ {
1296
+ code: 6018,
1297
+ name: "InvalidUnlockPeriod",
1298
+ msg: "Invalid unlock period"
1299
+ },
1300
+ {
1301
+ code: 6019,
1302
+ name: "DurationUpdateNotAllowed",
1303
+ msg: "Duration update is not allowed"
1304
+ },
1305
+ {
1306
+ code: 6020,
1307
+ name: "NoVestingAmount",
1308
+ msg: "Vesting amounts are not set"
1309
+ },
1310
+ {
1311
+ code: 6021,
1312
+ name: "VestingAlreadyFinished",
1313
+ msg: "Vesting already finished"
1314
+ },
1315
+ {
1316
+ code: 6022,
1317
+ name: "InvalidAmounts",
1318
+ msg: "Provided amounts are invalid"
1319
+ },
1320
+ {
1321
+ code: 6023,
1322
+ name: "ClaimsLimitReached",
1323
+ msg: "Claims limit has been reached"
1324
+ }
1325
+ ],
1326
+ types: [
1327
+ {
1328
+ name: "ClaimClosedEvent",
1329
+ docs: ["Emitted when a new claim is created."],
1330
+ type: {
1331
+ kind: "struct",
1332
+ fields: [
1333
+ {
1334
+ name: "claimant",
1335
+ docs: ["User that claimed."],
1336
+ type: "pubkey"
1337
+ },
1338
+ {
1339
+ name: "timestamp",
1340
+ docs: ["Timestamp."],
1341
+ type: "u64"
1342
+ }
1343
+ ]
1344
+ }
1345
+ },
1346
+ {
1347
+ name: "ClaimStatus",
1348
+ docs: ["Holds whether or not a claimant has claimed tokens."],
1349
+ type: {
1350
+ kind: "struct",
1351
+ fields: [
1352
+ {
1353
+ name: "claimant",
1354
+ docs: ["Authority that claimed the tokens."],
1355
+ type: "pubkey"
1356
+ },
1357
+ {
1358
+ name: "locked_amount",
1359
+ docs: ["Locked amount"],
1360
+ type: "u64"
1361
+ },
1362
+ {
1363
+ name: "locked_amount_withdrawn",
1364
+ docs: ["Locked amount withdrawn"],
1365
+ type: "u64"
1366
+ },
1367
+ {
1368
+ name: "unlocked_amount",
1369
+ docs: ["Unlocked amount"],
1370
+ type: "u64"
1371
+ },
1372
+ {
1373
+ name: "last_claim_ts",
1374
+ docs: ["Last claim time"],
1375
+ type: "u64"
1376
+ },
1377
+ {
1378
+ name: "last_amount_per_unlock",
1379
+ docs: ["Track amount per unlock, can be useful for non-linear vesting"],
1380
+ type: "u64"
1381
+ },
1382
+ {
1383
+ name: "closed",
1384
+ docs: ["Whether claim is closed"],
1385
+ type: "bool"
1386
+ },
1387
+ {
1388
+ name: "distributor",
1389
+ docs: [
1390
+ "Distributor account for which ClaimStatus was created, useful to filter by in get_program_accounts"
1391
+ ],
1392
+ type: "pubkey"
1393
+ },
1394
+ {
1395
+ name: "claims_count",
1396
+ docs: ["Number of time amount has been claimed"],
1397
+ type: "u16"
1398
+ },
1399
+ {
1400
+ name: "closed_ts",
1401
+ docs: ["Time when claim has been closed"],
1402
+ type: "u64"
1403
+ },
1404
+ {
1405
+ name: "buffer_2",
1406
+ docs: ["Buffer for additional fields"],
1407
+ type: {
1408
+ array: ["u8", 22]
1409
+ }
1410
+ }
1411
+ ]
1412
+ }
1413
+ },
1414
+ {
1415
+ name: "ClaimedEvent",
1416
+ docs: ["Emitted when tokens are claimed."],
1417
+ type: {
1418
+ kind: "struct",
1419
+ fields: [
1420
+ {
1421
+ name: "claimant",
1422
+ docs: ["User that claimed."],
1423
+ type: "pubkey"
1424
+ },
1425
+ {
1426
+ name: "amount",
1427
+ docs: ["Amount of tokens to distribute."],
1428
+ type: "u64"
1429
+ }
1430
+ ]
1431
+ }
1432
+ },
1433
+ {
1434
+ name: "CompressedClaimStatus",
1435
+ docs: ["Holds whether or not a claimant has claimed tokens."],
1436
+ type: {
1437
+ kind: "struct",
1438
+ fields: [
1439
+ {
1440
+ name: "state",
1441
+ type: {
1442
+ defined: {
1443
+ name: "State"
1444
+ }
1445
+ }
1446
+ }
1447
+ ]
1448
+ }
1449
+ },
1450
+ {
1451
+ name: "MerkleDistributor",
1452
+ docs: ["State for the account which distributes tokens."],
1453
+ type: {
1454
+ kind: "struct",
1455
+ fields: [
1456
+ {
1457
+ name: "bump",
1458
+ docs: ["Bump seed."],
1459
+ type: "u8"
1460
+ },
1461
+ {
1462
+ name: "version",
1463
+ docs: ["Version of the airdrop"],
1464
+ type: "u64"
1465
+ },
1466
+ {
1467
+ name: "root",
1468
+ docs: ["The 256-bit merkle root."],
1469
+ type: {
1470
+ array: ["u8", 32]
1471
+ }
1472
+ },
1473
+ {
1474
+ name: "mint",
1475
+ docs: ["[Mint] of the token to be distributed."],
1476
+ type: "pubkey"
1477
+ },
1478
+ {
1479
+ name: "token_vault",
1480
+ docs: ["Token Address of the vault"],
1481
+ type: "pubkey"
1482
+ },
1483
+ {
1484
+ name: "max_total_claim",
1485
+ docs: ["Maximum number of tokens that can ever be claimed from this [MerkleDistributor]."],
1486
+ type: "u64"
1487
+ },
1488
+ {
1489
+ name: "max_num_nodes",
1490
+ docs: ["Maximum number of nodes in [MerkleDistributor]."],
1491
+ type: "u64"
1492
+ },
1493
+ {
1494
+ name: "unlock_period",
1495
+ docs: ["Time step (period) in seconds per which the unlock occurs"],
1496
+ type: "u64"
1497
+ },
1498
+ {
1499
+ name: "total_amount_claimed",
1500
+ docs: ["Total amount of tokens that have been claimed."],
1501
+ type: "u64"
1502
+ },
1503
+ {
1504
+ name: "num_nodes_claimed",
1505
+ docs: ["Number of nodes that have been claimed."],
1506
+ type: "u64"
1507
+ },
1508
+ {
1509
+ name: "start_ts",
1510
+ docs: ["Lockup time start (Unix Timestamp)"],
1511
+ type: "u64"
1512
+ },
1513
+ {
1514
+ name: "end_ts",
1515
+ docs: ["Lockup time end (Unix Timestamp)"],
1516
+ type: "u64"
1517
+ },
1518
+ {
1519
+ name: "clawback_start_ts",
1520
+ docs: ["Clawback start (Unix Timestamp)"],
1521
+ type: "u64"
1522
+ },
1523
+ {
1524
+ name: "clawback_receiver",
1525
+ docs: ["Clawback receiver"],
1526
+ type: "pubkey"
1527
+ },
1528
+ {
1529
+ name: "admin",
1530
+ docs: ["Admin wallet"],
1531
+ type: "pubkey"
1532
+ },
1533
+ {
1534
+ name: "clawed_back",
1535
+ docs: ["Whether or not the distributor has been clawed back"],
1536
+ type: "bool"
1537
+ },
1538
+ {
1539
+ name: "claims_closable_by_admin",
1540
+ docs: ["Whether claims are closable by the admin or not"],
1541
+ type: "bool"
1542
+ },
1543
+ {
1544
+ name: "can_update_duration",
1545
+ docs: ["Whether admin can update vesting duration"],
1546
+ type: "bool"
1547
+ },
1548
+ {
1549
+ name: "total_amount_unlocked",
1550
+ docs: ["Total amount of funds unlocked (cliff/instant)"],
1551
+ type: "u64"
1552
+ },
1553
+ {
1554
+ name: "total_amount_locked",
1555
+ docs: ["Total amount of funds locked (vested)"],
1556
+ type: "u64"
1557
+ },
1558
+ {
1559
+ name: "last_duration_update_ts",
1560
+ docs: ["Timestamp when update was last called"],
1561
+ type: "u64"
1562
+ },
1563
+ {
1564
+ name: "total_claimable_pre_update",
1565
+ docs: [
1566
+ "Total amount of locked amount claimable as of last duration update, ever increasing total, accumulates with each update"
1567
+ ],
1568
+ type: "u64"
1569
+ },
1570
+ {
1571
+ name: "clawed_back_ts",
1572
+ docs: ["Timestamp when funds were clawed back"],
1573
+ type: "u64"
1574
+ },
1575
+ {
1576
+ name: "claims_closable_by_claimant",
1577
+ docs: ["Whether claims are closable by claimant or not"],
1578
+ type: "bool"
1579
+ },
1580
+ {
1581
+ name: "claims_limit",
1582
+ docs: ["Limit number of claims"],
1583
+ type: "u16"
1584
+ },
1585
+ {
1586
+ name: "buffer_2",
1587
+ docs: ["Buffer for additional fields"],
1588
+ type: {
1589
+ array: ["u8", 20]
1590
+ }
1591
+ },
1592
+ {
1593
+ name: "buffer_3",
1594
+ docs: ["Buffer for additional fields"],
1595
+ type: {
1596
+ array: ["u8", 32]
1597
+ }
1598
+ }
1599
+ ]
1600
+ }
1601
+ },
1602
+ {
1603
+ name: "NewClaimEvent",
1604
+ docs: ["Emitted when a new claim is created."],
1605
+ type: {
1606
+ kind: "struct",
1607
+ fields: [
1608
+ {
1609
+ name: "claimant",
1610
+ docs: ["User that claimed."],
1611
+ type: "pubkey"
1612
+ },
1613
+ {
1614
+ name: "timestamp",
1615
+ docs: ["Timestamp."],
1616
+ type: "u64"
1617
+ }
1618
+ ]
1619
+ }
1620
+ },
1621
+ {
1622
+ name: "State",
1623
+ type: {
1624
+ kind: "enum",
1625
+ variants: [
1626
+ {
1627
+ name: "Claimed"
1628
+ },
1629
+ {
1630
+ name: "Closed"
1631
+ }
1632
+ ]
1633
+ }
1634
+ }
1635
+ ]
1636
+ };
1637
+
328
1638
  // solana/constants.ts
329
1639
  var constants_exports = {};
330
1640
  __export(constants_exports, {
@@ -365,107 +1675,6 @@ var DISTRIBUTOR_PROGRAM_ID = {
365
1675
  [common.ICluster.Testnet]: "MErKy6nZVoVAkryxAejJz2juifQ4ArgLgHmaJCQkU7N",
366
1676
  [common.ICluster.Local]: "MErKy6nZVoVAkryxAejJz2juifQ4ArgLgHmaJCQkU7N"
367
1677
  };
368
- var _ClaimStatus = class _ClaimStatus {
369
- constructor(fields) {
370
- this.claimant = fields.claimant;
371
- this.lockedAmount = fields.lockedAmount;
372
- this.lockedAmountWithdrawn = fields.lockedAmountWithdrawn;
373
- this.unlockedAmount = fields.unlockedAmount;
374
- this.lastClaimTs = fields.lastClaimTs;
375
- this.lastAmountPerUnlock = fields.lastAmountPerUnlock;
376
- this.closed = fields.closed;
377
- this.distributor = fields.distributor;
378
- this.claimsCount = fields.claimsCount;
379
- this.closedTs = fields.closedTs;
380
- this.buffer2 = fields.buffer2;
381
- }
382
- static async fetch(c, address, programId = PROGRAM_ID) {
383
- const info = await c.getAccountInfo(address);
384
- if (info === null) {
385
- return null;
386
- }
387
- if (!info.owner.equals(programId)) {
388
- throw new Error("account doesn't belong to this program");
389
- }
390
- return this.decode(info.data);
391
- }
392
- static async fetchMultiple(c, addresses, programId = PROGRAM_ID) {
393
- const infos = await c.getMultipleAccountsInfo(addresses);
394
- return infos.map((info) => {
395
- if (info === null) {
396
- return null;
397
- }
398
- if (!info.owner.equals(programId)) {
399
- throw new Error("account doesn't belong to this program");
400
- }
401
- return this.decode(info.data);
402
- });
403
- }
404
- static decode(data) {
405
- if (!data.slice(0, 8).equals(_ClaimStatus.discriminator)) {
406
- throw new Error("invalid account discriminator");
407
- }
408
- const dec = _ClaimStatus.layout.decode(data.slice(8));
409
- return new _ClaimStatus({
410
- claimant: dec.claimant,
411
- lockedAmount: dec.lockedAmount,
412
- lockedAmountWithdrawn: dec.lockedAmountWithdrawn,
413
- unlockedAmount: dec.unlockedAmount,
414
- lastClaimTs: dec.lastClaimTs,
415
- lastAmountPerUnlock: dec.lastAmountPerUnlock,
416
- closed: dec.closed,
417
- distributor: dec.distributor,
418
- claimsCount: dec.claimsCount,
419
- closedTs: dec.closedTs,
420
- buffer2: dec.buffer2
421
- });
422
- }
423
- toJSON() {
424
- return {
425
- claimant: this.claimant.toString(),
426
- lockedAmount: this.lockedAmount.toString(),
427
- lockedAmountWithdrawn: this.lockedAmountWithdrawn.toString(),
428
- unlockedAmount: this.unlockedAmount.toString(),
429
- lastClaimTs: this.lastClaimTs.toString(),
430
- lastAmountPerUnlock: this.lastAmountPerUnlock.toString(),
431
- closed: this.closed,
432
- distributor: this.distributor.toString(),
433
- claimsCount: this.claimsCount,
434
- closedTs: this.closedTs.toString(),
435
- buffer2: this.buffer2
436
- };
437
- }
438
- static fromJSON(obj) {
439
- return new _ClaimStatus({
440
- claimant: new web3_js.PublicKey(obj.claimant),
441
- lockedAmount: new BN6__default.default(obj.lockedAmount),
442
- lockedAmountWithdrawn: new BN6__default.default(obj.lockedAmountWithdrawn),
443
- unlockedAmount: new BN6__default.default(obj.unlockedAmount),
444
- lastClaimTs: new BN6__default.default(obj.lastClaimTs),
445
- lastAmountPerUnlock: new BN6__default.default(obj.lastAmountPerUnlock),
446
- closed: obj.closed,
447
- distributor: new web3_js.PublicKey(obj.distributor),
448
- claimsCount: obj.claimsCount,
449
- closedTs: new BN6__default.default(obj.closedTs),
450
- buffer2: obj.buffer2
451
- });
452
- }
453
- };
454
- _ClaimStatus.discriminator = Buffer.from([22, 183, 249, 157, 247, 95, 150, 96]);
455
- _ClaimStatus.layout = borsh8__namespace.struct([
456
- borsh8__namespace.publicKey("claimant"),
457
- borsh8__namespace.u64("lockedAmount"),
458
- borsh8__namespace.u64("lockedAmountWithdrawn"),
459
- borsh8__namespace.u64("unlockedAmount"),
460
- borsh8__namespace.u64("lastClaimTs"),
461
- borsh8__namespace.u64("lastAmountPerUnlock"),
462
- borsh8__namespace.bool("closed"),
463
- borsh8__namespace.publicKey("distributor"),
464
- borsh8__namespace.u16("claimsCount"),
465
- borsh8__namespace.u64("closedTs"),
466
- borsh8__namespace.array(borsh8__namespace.u8(), 22, "buffer2")
467
- ]);
468
- var ClaimStatus = _ClaimStatus;
469
1678
  var _MerkleDistributor = class _MerkleDistributor {
470
1679
  constructor(fields) {
471
1680
  this.bump = fields.bump;
@@ -587,28 +1796,28 @@ var _MerkleDistributor = class _MerkleDistributor {
587
1796
  static fromJSON(obj) {
588
1797
  return new _MerkleDistributor({
589
1798
  bump: obj.bump,
590
- version: new BN6__default.default(obj.version),
1799
+ version: new BN5__default.default(obj.version),
591
1800
  root: obj.root,
592
1801
  mint: new web3_js.PublicKey(obj.mint),
593
1802
  tokenVault: new web3_js.PublicKey(obj.tokenVault),
594
- maxTotalClaim: new BN6__default.default(obj.maxTotalClaim),
595
- maxNumNodes: new BN6__default.default(obj.maxNumNodes),
596
- unlockPeriod: new BN6__default.default(obj.unlockPeriod),
597
- totalAmountClaimed: new BN6__default.default(obj.totalAmountClaimed),
598
- numNodesClaimed: new BN6__default.default(obj.numNodesClaimed),
599
- startTs: new BN6__default.default(obj.startTs),
600
- endTs: new BN6__default.default(obj.endTs),
601
- clawbackStartTs: new BN6__default.default(obj.clawbackStartTs),
1803
+ maxTotalClaim: new BN5__default.default(obj.maxTotalClaim),
1804
+ maxNumNodes: new BN5__default.default(obj.maxNumNodes),
1805
+ unlockPeriod: new BN5__default.default(obj.unlockPeriod),
1806
+ totalAmountClaimed: new BN5__default.default(obj.totalAmountClaimed),
1807
+ numNodesClaimed: new BN5__default.default(obj.numNodesClaimed),
1808
+ startTs: new BN5__default.default(obj.startTs),
1809
+ endTs: new BN5__default.default(obj.endTs),
1810
+ clawbackStartTs: new BN5__default.default(obj.clawbackStartTs),
602
1811
  clawbackReceiver: new web3_js.PublicKey(obj.clawbackReceiver),
603
1812
  admin: new web3_js.PublicKey(obj.admin),
604
1813
  clawedBack: obj.clawedBack,
605
1814
  claimsClosableByAdmin: obj.claimsClosableByAdmin,
606
1815
  canUpdateDuration: obj.canUpdateDuration,
607
- totalAmountUnlocked: new BN6__default.default(obj.totalAmountUnlocked),
608
- totalAmountLocked: new BN6__default.default(obj.totalAmountLocked),
609
- lastDurationUpdateTs: new BN6__default.default(obj.lastDurationUpdateTs),
610
- totalClaimablePreUpdate: new BN6__default.default(obj.totalClaimablePreUpdate),
611
- clawedBackTs: new BN6__default.default(obj.clawedBackTs),
1816
+ totalAmountUnlocked: new BN5__default.default(obj.totalAmountUnlocked),
1817
+ totalAmountLocked: new BN5__default.default(obj.totalAmountLocked),
1818
+ lastDurationUpdateTs: new BN5__default.default(obj.lastDurationUpdateTs),
1819
+ totalClaimablePreUpdate: new BN5__default.default(obj.totalClaimablePreUpdate),
1820
+ clawedBackTs: new BN5__default.default(obj.clawedBackTs),
612
1821
  claimsClosableByClaimant: obj.claimsClosableByClaimant,
613
1822
  claimsLimit: obj.claimsLimit,
614
1823
  buffer2: obj.buffer2,
@@ -617,34 +1826,34 @@ var _MerkleDistributor = class _MerkleDistributor {
617
1826
  }
618
1827
  };
619
1828
  _MerkleDistributor.discriminator = Buffer.from([77, 119, 139, 70, 84, 247, 12, 26]);
620
- _MerkleDistributor.layout = borsh8__namespace.struct([
621
- borsh8__namespace.u8("bump"),
622
- borsh8__namespace.u64("version"),
623
- borsh8__namespace.array(borsh8__namespace.u8(), 32, "root"),
624
- borsh8__namespace.publicKey("mint"),
625
- borsh8__namespace.publicKey("tokenVault"),
626
- borsh8__namespace.u64("maxTotalClaim"),
627
- borsh8__namespace.u64("maxNumNodes"),
628
- borsh8__namespace.u64("unlockPeriod"),
629
- borsh8__namespace.u64("totalAmountClaimed"),
630
- borsh8__namespace.u64("numNodesClaimed"),
631
- borsh8__namespace.u64("startTs"),
632
- borsh8__namespace.u64("endTs"),
633
- borsh8__namespace.u64("clawbackStartTs"),
634
- borsh8__namespace.publicKey("clawbackReceiver"),
635
- borsh8__namespace.publicKey("admin"),
636
- borsh8__namespace.bool("clawedBack"),
637
- borsh8__namespace.bool("claimsClosableByAdmin"),
638
- borsh8__namespace.bool("canUpdateDuration"),
639
- borsh8__namespace.u64("totalAmountUnlocked"),
640
- borsh8__namespace.u64("totalAmountLocked"),
641
- borsh8__namespace.u64("lastDurationUpdateTs"),
642
- borsh8__namespace.u64("totalClaimablePreUpdate"),
643
- borsh8__namespace.u64("clawedBackTs"),
644
- borsh8__namespace.bool("claimsClosableByClaimant"),
645
- borsh8__namespace.u16("claimsLimit"),
646
- borsh8__namespace.array(borsh8__namespace.u8(), 20, "buffer2"),
647
- borsh8__namespace.array(borsh8__namespace.u8(), 32, "buffer3")
1829
+ _MerkleDistributor.layout = borsh7__namespace.struct([
1830
+ borsh7__namespace.u8("bump"),
1831
+ borsh7__namespace.u64("version"),
1832
+ borsh7__namespace.array(borsh7__namespace.u8(), 32, "root"),
1833
+ borsh7__namespace.publicKey("mint"),
1834
+ borsh7__namespace.publicKey("tokenVault"),
1835
+ borsh7__namespace.u64("maxTotalClaim"),
1836
+ borsh7__namespace.u64("maxNumNodes"),
1837
+ borsh7__namespace.u64("unlockPeriod"),
1838
+ borsh7__namespace.u64("totalAmountClaimed"),
1839
+ borsh7__namespace.u64("numNodesClaimed"),
1840
+ borsh7__namespace.u64("startTs"),
1841
+ borsh7__namespace.u64("endTs"),
1842
+ borsh7__namespace.u64("clawbackStartTs"),
1843
+ borsh7__namespace.publicKey("clawbackReceiver"),
1844
+ borsh7__namespace.publicKey("admin"),
1845
+ borsh7__namespace.bool("clawedBack"),
1846
+ borsh7__namespace.bool("claimsClosableByAdmin"),
1847
+ borsh7__namespace.bool("canUpdateDuration"),
1848
+ borsh7__namespace.u64("totalAmountUnlocked"),
1849
+ borsh7__namespace.u64("totalAmountLocked"),
1850
+ borsh7__namespace.u64("lastDurationUpdateTs"),
1851
+ borsh7__namespace.u64("totalClaimablePreUpdate"),
1852
+ borsh7__namespace.u64("clawedBackTs"),
1853
+ borsh7__namespace.bool("claimsClosableByClaimant"),
1854
+ borsh7__namespace.u16("claimsLimit"),
1855
+ borsh7__namespace.array(borsh7__namespace.u8(), 20, "buffer2"),
1856
+ borsh7__namespace.array(borsh7__namespace.u8(), 32, "buffer3")
648
1857
  ]);
649
1858
  var MerkleDistributor = _MerkleDistributor;
650
1859
 
@@ -1656,9 +2865,12 @@ function getEventAuthorityPda(programId) {
1656
2865
  const seeds = [buffer.Buffer.from("__event_authority")];
1657
2866
  return web3_js.PublicKey.findProgramAddressSync(seeds, programId)[0];
1658
2867
  }
1659
- async function wrappedSignAndExecuteTransaction(connection, invoker, tx, confirmationParams, throttleParams) {
2868
+ var isCompressedClaimStatus = (status) => {
2869
+ return !!status && "state" in status;
2870
+ };
2871
+ async function wrappedSignAndExecuteTransaction(...args) {
1660
2872
  try {
1661
- return await solana.signAndExecuteTransaction(connection, invoker, tx, confirmationParams, throttleParams);
2873
+ return await solana.signAndExecuteTransaction(...args);
1662
2874
  } catch (err) {
1663
2875
  if (err instanceof Error) {
1664
2876
  const parsed = fromTxError(err);
@@ -1699,6 +2911,10 @@ var BaseDistributorClient = class {
1699
2911
  this.connection = new web3_js.Connection(clusterUrl, this.commitment);
1700
2912
  this.programId = programId !== "" ? new web3_js.PublicKey(programId) : new web3_js.PublicKey(DISTRIBUTOR_PROGRAM_ID[cluster]);
1701
2913
  this.sendThrottler = sendThrottler ?? solana.buildSendThrottler(sendRate);
2914
+ const merkleDistributorProgram = {
2915
+ ...merkle_distributor_default
2916
+ };
2917
+ this.merkleDistributorProgram = new anchor.Program(merkleDistributorProgram, { connection: this.connection });
1702
2918
  }
1703
2919
  getConnection() {
1704
2920
  return this.connection;
@@ -1733,7 +2949,7 @@ var BaseDistributorClient = class {
1733
2949
  };
1734
2950
  if (extParams.isNative) {
1735
2951
  ixs.push(
1736
- ...await solana.prepareWrappedAccount(this.connection, extParams.invoker.publicKey, new BN6__default.default(data.maxTotalClaim))
2952
+ ...await solana.prepareWrappedAccount(this.connection, extParams.invoker.publicKey, new BN5__default.default(data.maxTotalClaim))
1737
2953
  );
1738
2954
  }
1739
2955
  const newDistributorInstruction = await this.getNewDistributorInstruction(data, accounts);
@@ -1774,7 +2990,14 @@ var BaseDistributorClient = class {
1774
2990
  return { distributorPublicKey, ixs };
1775
2991
  }
1776
2992
  async create(data, extParams) {
1777
- const { ixs, distributorPublicKey } = await this.prepareCreateInstructions(data, extParams);
2993
+ const invoker = extParams.invoker.publicKey;
2994
+ common.invariant(invoker, "Invoker's PublicKey is not available, check passed wallet adapter!");
2995
+ const executionParams = this.unwrapExecutionParams(extParams);
2996
+ const { ixs, distributorPublicKey } = await solana.createAndEstimateTransaction(
2997
+ (params) => this.prepareCreateInstructions(data, params),
2998
+ executionParams,
2999
+ (q) => q.ixs
3000
+ );
1778
3001
  const { tx, hash, context } = await solana.prepareTransaction(this.connection, ixs, extParams.invoker.publicKey);
1779
3002
  const signature = await wrappedSignAndExecuteTransaction(
1780
3003
  this.connection,
@@ -1785,7 +3008,7 @@ var BaseDistributorClient = class {
1785
3008
  context,
1786
3009
  commitment: this.getCommitment()
1787
3010
  },
1788
- { sendThrottler: this.sendThrottler }
3011
+ { sendThrottler: this.sendThrottler, skipSimulation: executionParams.skipSimulation }
1789
3012
  );
1790
3013
  return {
1791
3014
  ixs,
@@ -1793,23 +3016,29 @@ var BaseDistributorClient = class {
1793
3016
  metadataId: distributorPublicKey.toBase58()
1794
3017
  };
1795
3018
  }
1796
- async claim(data, extParams) {
1797
- const ixs = await this.prepareClaimInstructions(data, extParams);
1798
- const { tx, hash, context } = await solana.prepareTransaction(this.connection, ixs, extParams.invoker.publicKey);
3019
+ async claim(data, extParams, _serviceTransfer) {
3020
+ const executionParams = this.unwrapExecutionParams(extParams);
3021
+ const invoker = executionParams.invoker.publicKey;
3022
+ common.invariant(invoker, "Invoker's PublicKey is not available, check passed wallet adapter!");
3023
+ const ixs = await solana.createAndEstimateTransaction(
3024
+ (params) => this.prepareClaimInstructions(data, params, _serviceTransfer),
3025
+ executionParams
3026
+ );
3027
+ const { tx, hash, context } = await solana.prepareTransaction(this.connection, ixs, invoker);
1799
3028
  const signature = await wrappedSignAndExecuteTransaction(
1800
3029
  this.connection,
1801
- extParams.invoker,
3030
+ executionParams.invoker,
1802
3031
  tx,
1803
3032
  {
1804
3033
  hash,
1805
3034
  context,
1806
3035
  commitment: this.getCommitment()
1807
3036
  },
1808
- { sendThrottler: this.sendThrottler }
3037
+ { sendThrottler: this.sendThrottler, skipSimulation: executionParams.skipSimulation }
1809
3038
  );
1810
3039
  return { ixs, txId: signature };
1811
3040
  }
1812
- async prepareClaimInstructions(data, extParams) {
3041
+ async prepareClaimInstructions(data, extParams, _serviceTransfer) {
1813
3042
  if (!extParams.invoker.publicKey) {
1814
3043
  throw new Error("Invoker's PublicKey is not available, check passed wallet adapter!");
1815
3044
  }
@@ -1836,7 +3065,7 @@ var BaseDistributorClient = class {
1836
3065
  extParams.invoker.publicKey
1837
3066
  );
1838
3067
  const eventAuthorityPublicKey = getEventAuthorityPda(this.programId);
1839
- const claimStatus = await ClaimStatus.fetch(this.connection, claimStatusPublicKey);
3068
+ const claimStatus = await this.getClaim(claimStatusPublicKey);
1840
3069
  const accounts = {
1841
3070
  distributor: distributorPublicKey,
1842
3071
  claimStatus: claimStatusPublicKey,
@@ -1851,32 +3080,43 @@ var BaseDistributorClient = class {
1851
3080
  };
1852
3081
  if (!claimStatus) {
1853
3082
  const args = {
1854
- amountLocked: new BN6__default.default(data.amountLocked),
1855
- amountUnlocked: new BN6__default.default(data.amountUnlocked),
3083
+ amountLocked: new BN5__default.default(data.amountLocked),
3084
+ amountUnlocked: new BN5__default.default(data.amountUnlocked),
1856
3085
  proof: data.proof
1857
3086
  };
1858
3087
  ixs.push(newClaim(args, accounts, this.programId));
1859
3088
  }
1860
- const nowTs = new BN6__default.default(Math.floor(Date.now() / 1e3));
1861
- if (claimStatus || new BN6__default.default(data.amountLocked).gtn(0) && nowTs.sub(distributor.startTs).gte(distributor.unlockPeriod)) {
3089
+ const nowTs = new BN5__default.default(Math.floor(Date.now() / 1e3));
3090
+ if (claimStatus || new BN5__default.default(data.amountLocked).gtn(0) && nowTs.sub(distributor.startTs).gte(distributor.unlockPeriod)) {
1862
3091
  ixs.push(claimLocked(accounts, this.programId));
1863
3092
  }
1864
- ixs.push(this.prepareClaimFeeInstruction(extParams.invoker.publicKey));
3093
+ ixs.push(
3094
+ this.prepareClaimFeeInstruction(
3095
+ extParams.invoker.publicKey,
3096
+ typeof _serviceTransfer === "bigint" ? _serviceTransfer : void 0
3097
+ )
3098
+ );
1865
3099
  return ixs;
1866
3100
  }
1867
3101
  async closeClaim(data, extParams) {
1868
- const ixs = await this.prepareCloseClaimInstructions(data, extParams);
1869
- const { tx, hash, context } = await solana.prepareTransaction(this.connection, ixs, extParams.invoker.publicKey);
3102
+ const executionParams = this.unwrapExecutionParams(extParams);
3103
+ const invoker = executionParams.invoker.publicKey;
3104
+ common.invariant(invoker, "Invoker's PublicKey is not available, check passed wallet adapter!");
3105
+ const ixs = await solana.createAndEstimateTransaction(
3106
+ (params) => this.prepareCloseClaimInstructions(data, params),
3107
+ executionParams
3108
+ );
3109
+ const { tx, hash, context } = await solana.prepareTransaction(this.connection, ixs, invoker);
1870
3110
  const signature = await wrappedSignAndExecuteTransaction(
1871
3111
  this.connection,
1872
- extParams.invoker,
3112
+ executionParams.invoker,
1873
3113
  tx,
1874
3114
  {
1875
3115
  hash,
1876
3116
  context,
1877
3117
  commitment: this.getCommitment()
1878
3118
  },
1879
- { sendThrottler: this.sendThrottler }
3119
+ { sendThrottler: this.sendThrottler, skipSimulation: executionParams.skipSimulation }
1880
3120
  );
1881
3121
  return { ixs, txId: signature };
1882
3122
  }
@@ -1903,8 +3143,8 @@ var BaseDistributorClient = class {
1903
3143
  program: this.programId
1904
3144
  };
1905
3145
  const closeClaimArgs = {
1906
- amountLocked: data.amountLocked ? new BN6__default.default(data.amountLocked) : void 0,
1907
- amountUnlocked: data.amountUnlocked ? new BN6__default.default(data.amountUnlocked) : void 0,
3146
+ amountLocked: data.amountLocked ? new BN5__default.default(data.amountLocked) : void 0,
3147
+ amountUnlocked: data.amountUnlocked ? new BN5__default.default(data.amountUnlocked) : void 0,
1908
3148
  proof: data.proof
1909
3149
  };
1910
3150
  ixs.push(closeClaim(closeClaimArgs, closeClaimAccounts, this.programId));
@@ -1944,26 +3184,37 @@ var BaseDistributorClient = class {
1944
3184
  return ixs;
1945
3185
  }
1946
3186
  async clawback(data, extParams) {
1947
- const ixs = await this.prepareClawbackInstructions(data, extParams);
1948
- const { tx, hash, context } = await solana.prepareTransaction(this.connection, ixs, extParams.invoker.publicKey);
3187
+ const executionParams = this.unwrapExecutionParams(extParams);
3188
+ const invoker = executionParams.invoker.publicKey;
3189
+ common.invariant(invoker, "Invoker's PublicKey is not available, check passed wallet adapter!");
3190
+ const ixs = await solana.createAndEstimateTransaction(
3191
+ (params) => this.prepareClawbackInstructions(data, params),
3192
+ executionParams
3193
+ );
3194
+ const { tx, hash, context } = await solana.prepareTransaction(this.connection, ixs, invoker);
1949
3195
  const signature = await wrappedSignAndExecuteTransaction(
1950
3196
  this.connection,
1951
- extParams.invoker,
3197
+ executionParams.invoker,
1952
3198
  tx,
1953
3199
  {
1954
3200
  hash,
1955
3201
  context,
1956
3202
  commitment: this.getCommitment()
1957
3203
  },
1958
- { sendThrottler: this.sendThrottler }
3204
+ { sendThrottler: this.sendThrottler, skipSimulation: executionParams.skipSimulation }
1959
3205
  );
1960
3206
  return { ixs, txId: signature };
1961
3207
  }
3208
+ async getClaim(claimStatus) {
3209
+ return this.connection.getAccountInfo(solana.pk(claimStatus)).then((account) => this.decodeClaimStatus(account));
3210
+ }
1962
3211
  async getClaims(data) {
1963
3212
  const claimStatusPublicKeys = data.map(({ id, recipient }) => {
1964
3213
  return getClaimantStatusPda(this.programId, new web3_js.PublicKey(id), new web3_js.PublicKey(recipient));
1965
3214
  });
1966
- return ClaimStatus.fetchMultiple(this.connection, claimStatusPublicKeys, this.programId);
3215
+ return this.connection.getMultipleAccountsInfo(claimStatusPublicKeys).then((accounts) => {
3216
+ return accounts.map((account) => this.decodeClaimStatus(account));
3217
+ });
1967
3218
  }
1968
3219
  async getDistributors(data) {
1969
3220
  const distributorPublicKeys = data.ids.map((distributorId) => new web3_js.PublicKey(distributorId));
@@ -1993,28 +3244,28 @@ var BaseDistributorClient = class {
1993
3244
  account: MerkleDistributor.decode(account.data)
1994
3245
  }));
1995
3246
  }
1996
- prepareClaimFeeInstruction(payer) {
3247
+ prepareClaimFeeInstruction(payer, fee = AIRDROP_CLAIM_FEE) {
1997
3248
  return web3_js.SystemProgram.transfer({
1998
3249
  fromPubkey: payer,
1999
3250
  toPubkey: STREAMFLOW_TREASURY_PUBLIC_KEY,
2000
- lamports: AIRDROP_CLAIM_FEE
3251
+ lamports: fee
2001
3252
  });
2002
3253
  }
2003
3254
  getNewDistributorArgs(data) {
2004
3255
  const args = {
2005
- version: new BN6__default.default(data.version),
3256
+ version: new BN5__default.default(data.version),
2006
3257
  root: data.root,
2007
- maxTotalClaim: new BN6__default.default(data.maxTotalClaim),
2008
- maxNumNodes: new BN6__default.default(data.maxNumNodes),
2009
- unlockPeriod: new BN6__default.default(data.unlockPeriod),
2010
- startVestingTs: new BN6__default.default(data.startVestingTs),
2011
- endVestingTs: new BN6__default.default(data.endVestingTs),
2012
- clawbackStartTs: new BN6__default.default(data.clawbackStartTs),
3258
+ maxTotalClaim: new BN5__default.default(data.maxTotalClaim),
3259
+ maxNumNodes: new BN5__default.default(data.maxNumNodes),
3260
+ unlockPeriod: new BN5__default.default(data.unlockPeriod),
3261
+ startVestingTs: new BN5__default.default(data.startVestingTs),
3262
+ endVestingTs: new BN5__default.default(data.endVestingTs),
3263
+ clawbackStartTs: new BN5__default.default(data.clawbackStartTs),
2013
3264
  claimsClosableByAdmin: data.claimsClosableByAdmin,
2014
3265
  claimsClosableByClaimant: data.claimsClosableByClaimant,
2015
3266
  claimsLimit: data.claimsLimit
2016
3267
  };
2017
- const nowTs = new BN6__default.default(Math.floor(Date.now() / 1e3));
3268
+ const nowTs = new BN5__default.default(Math.floor(Date.now() / 1e3));
2018
3269
  const endVestingTs = args.endVestingTs.isZero() ? nowTs : args.endVestingTs;
2019
3270
  const startVestingTs = args.startVestingTs.isZero() ? nowTs : args.startVestingTs;
2020
3271
  if (endVestingTs.gt(startVestingTs) && endVestingTs.sub(startVestingTs).lt(args.unlockPeriod)) {
@@ -2022,7 +3273,34 @@ var BaseDistributorClient = class {
2022
3273
  }
2023
3274
  return args;
2024
3275
  }
3276
+ unwrapExecutionParams(extParams) {
3277
+ return solana.unwrapExecutionParams(extParams, this.connection);
3278
+ }
3279
+ decodeClaimStatus(account) {
3280
+ if (!account) {
3281
+ return account;
3282
+ }
3283
+ try {
3284
+ return decode(this.merkleDistributorProgram, "claimStatus", account.data);
3285
+ } catch (baseClaimStatusError) {
3286
+ try {
3287
+ return decode(this.merkleDistributorProgram, "compressedClaimStatus", account.data);
3288
+ } catch (compressedClaimStatusError) {
3289
+ throw new Error("Couldn't decode claim status");
3290
+ }
3291
+ }
3292
+ }
2025
3293
  };
3294
+ function decode(program, accountName, accInfo, programKey) {
3295
+ const programId = program.programId?.toBase58() ?? "N/A";
3296
+ common.invariant(program, `Decoding program with key ${programId} is not available`);
3297
+ const accountEntity = program.idl.accounts?.find((acc) => acc.name === accountName);
3298
+ common.invariant(
3299
+ !!accountEntity,
3300
+ `Decoding program with key ${programId} doesn't specify account with name ${String(accountName)}`
3301
+ );
3302
+ return program.coder.accounts.decode(accountName, accInfo);
3303
+ }
2026
3304
 
2027
3305
  // solana/clients/SolanaDistributorClient.ts
2028
3306
  var SolanaDistributorClient = class extends BaseDistributorClient {
@@ -2040,7 +3318,7 @@ var aligned_distributor_default = {
2040
3318
  address: "aMERKpFAWoChCi5oZwPvgsSCoGpZKBiU7fi76bdZjt2",
2041
3319
  metadata: {
2042
3320
  name: "aligned_distributor",
2043
- version: "1.3.2",
3321
+ version: "1.5.0",
2044
3322
  spec: "0.1.0",
2045
3323
  description: "Proxy for merkle distributor that updates Vesting duration according to token market performance."
2046
3324
  },
@@ -2184,6 +3462,48 @@ var aligned_distributor_default = {
2184
3462
  }
2185
3463
  ]
2186
3464
  },
3465
+ {
3466
+ name: "migrate_test_oracle",
3467
+ discriminator: [203, 254, 19, 3, 172, 185, 85, 190],
3468
+ accounts: [
3469
+ {
3470
+ name: "payer",
3471
+ writable: true,
3472
+ signer: true
3473
+ },
3474
+ {
3475
+ name: "mint"
3476
+ },
3477
+ {
3478
+ name: "creator"
3479
+ },
3480
+ {
3481
+ name: "test_oracle",
3482
+ writable: true,
3483
+ pda: {
3484
+ seeds: [
3485
+ {
3486
+ kind: "const",
3487
+ value: [116, 101, 115, 116, 45, 111, 114, 97, 99, 108, 101]
3488
+ },
3489
+ {
3490
+ kind: "account",
3491
+ path: "mint"
3492
+ },
3493
+ {
3494
+ kind: "account",
3495
+ path: "creator"
3496
+ }
3497
+ ]
3498
+ }
3499
+ },
3500
+ {
3501
+ name: "system_program",
3502
+ address: "11111111111111111111111111111111"
3503
+ }
3504
+ ],
3505
+ args: []
3506
+ },
2187
3507
  {
2188
3508
  name: "new_distributor",
2189
3509
  discriminator: [32, 139, 112, 171, 0, 2, 225, 155],
@@ -2269,6 +3589,48 @@ var aligned_distributor_default = {
2269
3589
  }
2270
3590
  ]
2271
3591
  },
3592
+ {
3593
+ name: "realloc_test_oracle",
3594
+ discriminator: [234, 221, 116, 4, 198, 251, 244, 206],
3595
+ accounts: [
3596
+ {
3597
+ name: "payer",
3598
+ writable: true,
3599
+ signer: true
3600
+ },
3601
+ {
3602
+ name: "mint"
3603
+ },
3604
+ {
3605
+ name: "creator"
3606
+ },
3607
+ {
3608
+ name: "test_oracle",
3609
+ writable: true,
3610
+ pda: {
3611
+ seeds: [
3612
+ {
3613
+ kind: "const",
3614
+ value: [116, 101, 115, 116, 45, 111, 114, 97, 99, 108, 101]
3615
+ },
3616
+ {
3617
+ kind: "account",
3618
+ path: "mint"
3619
+ },
3620
+ {
3621
+ kind: "account",
3622
+ path: "creator"
3623
+ }
3624
+ ]
3625
+ }
3626
+ },
3627
+ {
3628
+ name: "system_program",
3629
+ address: "11111111111111111111111111111111"
3630
+ }
3631
+ ],
3632
+ args: []
3633
+ },
2272
3634
  {
2273
3635
  name: "set_admin",
2274
3636
  discriminator: [251, 163, 0, 52, 91, 194, 187, 92],
@@ -3054,16 +4416,16 @@ var SolanaAlignedDistributorClient = class extends BaseDistributorClient {
3054
4416
  unlockPeriod
3055
4417
  } = data;
3056
4418
  return {
3057
- totalAmountLocked: new BN6__default.default(totalAmountLocked),
3058
- totalAmountUnlocked: new BN6__default.default(totalAmountUnlocked),
4419
+ totalAmountLocked: new BN5__default.default(totalAmountLocked),
4420
+ totalAmountUnlocked: new BN5__default.default(totalAmountUnlocked),
3059
4421
  oracleType: !!oracleType ? { [oracleType]: {} } : { none: {} },
3060
4422
  minPrice: common.getBN(minPrice, ALIGNED_PRECISION_FACTOR_POW),
3061
4423
  maxPrice: common.getBN(maxPrice, ALIGNED_PRECISION_FACTOR_POW),
3062
4424
  minPercentage: common.getBN(minPercentage, ALIGNED_PRECISION_FACTOR_POW),
3063
4425
  maxPercentage: common.getBN(maxPercentage, ALIGNED_PRECISION_FACTOR_POW),
3064
- tickSize: new BN6__default.default(tickSize || 1),
4426
+ tickSize: new BN5__default.default(tickSize || 1),
3065
4427
  skipInitial: skipInitial ?? false,
3066
- updatePeriod: unlockPeriod < 30 ? new BN6__default.default(30) : new BN6__default.default(unlockPeriod)
4428
+ updatePeriod: unlockPeriod < 30 ? new BN5__default.default(30) : new BN5__default.default(unlockPeriod)
3067
4429
  };
3068
4430
  }
3069
4431
  };