@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.
package/dist/esm/index.js CHANGED
@@ -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
 
@@ -19,7 +19,6 @@ var __export = (target, all) => {
19
19
  var solana_exports = {};
20
20
  __export(solana_exports, {
21
21
  AnchorErrorCode: () => AnchorErrorCode,
22
- ClaimStatus: () => ClaimStatus,
23
22
  ContractErrorCode: () => ContractErrorCode,
24
23
  MerkleDistributor: () => MerkleDistributor,
25
24
  SolanaAlignedDistributorClient: () => SolanaAlignedDistributorClient,
@@ -36,6 +35,7 @@ __export(solana_exports, {
36
35
  getDistributorPda: () => getDistributorPda,
37
36
  getEventAuthorityPda: () => getEventAuthorityPda,
38
37
  getTestOraclePda: () => getTestOraclePda,
38
+ isCompressedClaimStatus: () => isCompressedClaimStatus,
39
39
  newClaim: () => newClaim,
40
40
  newDistributor: () => newDistributor,
41
41
  setAdmin: () => setAdmin,
@@ -127,21 +127,21 @@ var PROGRAM_ID_CLI = new PublicKey("MErKy6nZVoVAkryxAejJz2juifQ4ArgLgHmaJCQkU7N"
127
127
  var PROGRAM_ID = PROGRAM_ID_CLI;
128
128
 
129
129
  // solana/generated/instructions/newDistributor.ts
130
- var layout = borsh8.struct([
131
- borsh8.u64("version"),
132
- borsh8.array(borsh8.u8(), 32, "root"),
133
- borsh8.u64("maxTotalClaim"),
134
- borsh8.u64("maxNumNodes"),
135
- borsh8.u64("unlockPeriod"),
136
- borsh8.u64("startVestingTs"),
137
- borsh8.u64("endVestingTs"),
138
- borsh8.u64("clawbackStartTs"),
139
- borsh8.bool("claimsClosableByAdmin"),
140
- borsh8.option(borsh8.bool(), "canUpdateDuration"),
141
- borsh8.option(borsh8.u64(), "totalAmountUnlocked"),
142
- borsh8.option(borsh8.u64(), "totalAmountLocked"),
143
- borsh8.option(borsh8.bool(), "claimsClosableByClaimant"),
144
- borsh8.option(borsh8.u16(), "claimsLimit")
130
+ var layout = borsh7.struct([
131
+ borsh7.u64("version"),
132
+ borsh7.array(borsh7.u8(), 32, "root"),
133
+ borsh7.u64("maxTotalClaim"),
134
+ borsh7.u64("maxNumNodes"),
135
+ borsh7.u64("unlockPeriod"),
136
+ borsh7.u64("startVestingTs"),
137
+ borsh7.u64("endVestingTs"),
138
+ borsh7.u64("clawbackStartTs"),
139
+ borsh7.bool("claimsClosableByAdmin"),
140
+ borsh7.option(borsh7.bool(), "canUpdateDuration"),
141
+ borsh7.option(borsh7.u64(), "totalAmountUnlocked"),
142
+ borsh7.option(borsh7.u64(), "totalAmountLocked"),
143
+ borsh7.option(borsh7.bool(), "claimsClosableByClaimant"),
144
+ borsh7.option(borsh7.u16(), "claimsLimit")
145
145
  ]);
146
146
  function newDistributor(args, accounts, programId = PROGRAM_ID) {
147
147
  const keys = [
@@ -183,10 +183,10 @@ function newDistributor(args, accounts, programId = PROGRAM_ID) {
183
183
  const ix = new TransactionInstruction({ keys, programId, data });
184
184
  return ix;
185
185
  }
186
- var layout2 = borsh8.struct([
187
- borsh8.u64("amountUnlocked"),
188
- borsh8.u64("amountLocked"),
189
- borsh8.vec(borsh8.array(borsh8.u8(), 32), "proof")
186
+ var layout2 = borsh7.struct([
187
+ borsh7.u64("amountUnlocked"),
188
+ borsh7.u64("amountLocked"),
189
+ borsh7.vec(borsh7.array(borsh7.u8(), 32), "proof")
190
190
  ]);
191
191
  function newClaim(args, accounts, programId = PROGRAM_ID) {
192
192
  const keys = [
@@ -247,10 +247,10 @@ function clawback(accounts, programId = PROGRAM_ID) {
247
247
  const ix = new TransactionInstruction({ keys, programId, data });
248
248
  return ix;
249
249
  }
250
- var layout3 = borsh8.struct([
251
- borsh8.option(borsh8.u64(), "amountUnlocked"),
252
- borsh8.option(borsh8.u64(), "amountLocked"),
253
- borsh8.option(borsh8.vec(borsh8.array(borsh8.u8(), 32)), "proof")
250
+ var layout3 = borsh7.struct([
251
+ borsh7.option(borsh7.u64(), "amountUnlocked"),
252
+ borsh7.option(borsh7.u64(), "amountLocked"),
253
+ borsh7.option(borsh7.vec(borsh7.array(borsh7.u8(), 32)), "proof")
254
254
  ]);
255
255
  function closeClaim(args, accounts, programId = PROGRAM_ID) {
256
256
  const keys = [
@@ -299,6 +299,1316 @@ function setAdmin(accounts, programId = PROGRAM_ID) {
299
299
  return ix;
300
300
  }
301
301
 
302
+ // solana/descriptor/idl/merkle_distributor.json
303
+ var merkle_distributor_default = {
304
+ address: "MErKy6nZVoVAkryxAejJz2juifQ4ArgLgHmaJCQkU7N",
305
+ metadata: {
306
+ name: "merkle_distributor",
307
+ version: "1.5.0",
308
+ spec: "0.1.0",
309
+ description: "A Solana program for distributing tokens according to a Merkle root.",
310
+ repository: "https://github.com/streamflow-finance/distributor"
311
+ },
312
+ instructions: [
313
+ {
314
+ name: "_expose_claim",
315
+ discriminator: [103, 233, 83, 69, 115, 199, 128, 249],
316
+ accounts: [
317
+ {
318
+ name: "distributor",
319
+ docs: ["The [MerkleDistributor]."]
320
+ },
321
+ {
322
+ name: "claim_status",
323
+ docs: ["Claim Status PDA"],
324
+ optional: true,
325
+ pda: {
326
+ seeds: [
327
+ {
328
+ kind: "const",
329
+ value: [67, 108, 97, 105, 109, 83, 116, 97, 116, 117, 115]
330
+ },
331
+ {
332
+ kind: "account",
333
+ path: "claimant"
334
+ },
335
+ {
336
+ kind: "account",
337
+ path: "distributor"
338
+ }
339
+ ]
340
+ }
341
+ },
342
+ {
343
+ name: "compressed_claim_status",
344
+ docs: ["Compress Claim Status PDA"],
345
+ optional: true,
346
+ pda: {
347
+ seeds: [
348
+ {
349
+ kind: "const",
350
+ value: [67, 108, 97, 105, 109, 83, 116, 97, 116, 117, 115]
351
+ },
352
+ {
353
+ kind: "account",
354
+ path: "claimant"
355
+ },
356
+ {
357
+ kind: "account",
358
+ path: "distributor"
359
+ }
360
+ ]
361
+ }
362
+ },
363
+ {
364
+ name: "claimant",
365
+ docs: ["Who is claiming the tokens."],
366
+ signer: true
367
+ }
368
+ ],
369
+ args: []
370
+ },
371
+ {
372
+ name: "claim_locked",
373
+ discriminator: [34, 206, 181, 23, 11, 207, 147, 90],
374
+ accounts: [
375
+ {
376
+ name: "distributor",
377
+ docs: ["The [MerkleDistributor]."],
378
+ writable: true
379
+ },
380
+ {
381
+ name: "claim_status",
382
+ writable: true,
383
+ pda: {
384
+ seeds: [
385
+ {
386
+ kind: "const",
387
+ value: [67, 108, 97, 105, 109, 83, 116, 97, 116, 117, 115]
388
+ },
389
+ {
390
+ kind: "account",
391
+ path: "claimant"
392
+ },
393
+ {
394
+ kind: "account",
395
+ path: "distributor"
396
+ }
397
+ ]
398
+ }
399
+ },
400
+ {
401
+ name: "from",
402
+ docs: ["Distributor ATA containing the tokens to distribute."],
403
+ writable: true,
404
+ pda: {
405
+ seeds: [
406
+ {
407
+ kind: "account",
408
+ path: "distributor"
409
+ },
410
+ {
411
+ kind: "account",
412
+ path: "token_program"
413
+ },
414
+ {
415
+ kind: "account",
416
+ path: "distributor.mint",
417
+ account: "MerkleDistributor"
418
+ }
419
+ ],
420
+ program: {
421
+ kind: "const",
422
+ value: [
423
+ 140,
424
+ 151,
425
+ 37,
426
+ 143,
427
+ 78,
428
+ 36,
429
+ 137,
430
+ 241,
431
+ 187,
432
+ 61,
433
+ 16,
434
+ 41,
435
+ 20,
436
+ 142,
437
+ 13,
438
+ 131,
439
+ 11,
440
+ 90,
441
+ 19,
442
+ 153,
443
+ 218,
444
+ 255,
445
+ 16,
446
+ 132,
447
+ 4,
448
+ 142,
449
+ 123,
450
+ 216,
451
+ 219,
452
+ 233,
453
+ 248,
454
+ 89
455
+ ]
456
+ }
457
+ }
458
+ },
459
+ {
460
+ name: "to",
461
+ docs: [
462
+ "Account to send the claimed tokens to.",
463
+ "Claimant must sign the transaction and can only claim on behalf of themself"
464
+ ],
465
+ writable: true
466
+ },
467
+ {
468
+ name: "claimant",
469
+ docs: ["Who is claiming the tokens."],
470
+ writable: true,
471
+ signer: true
472
+ },
473
+ {
474
+ name: "mint",
475
+ docs: ["The mint to claim."],
476
+ relations: ["distributor"]
477
+ },
478
+ {
479
+ name: "token_program",
480
+ docs: ["SPL [Token] program."]
481
+ },
482
+ {
483
+ name: "event_authority",
484
+ pda: {
485
+ seeds: [
486
+ {
487
+ kind: "const",
488
+ value: [95, 95, 101, 118, 101, 110, 116, 95, 97, 117, 116, 104, 111, 114, 105, 116, 121]
489
+ }
490
+ ]
491
+ }
492
+ },
493
+ {
494
+ name: "program"
495
+ }
496
+ ],
497
+ args: []
498
+ },
499
+ {
500
+ name: "clawback",
501
+ discriminator: [111, 92, 142, 79, 33, 234, 82, 27],
502
+ accounts: [
503
+ {
504
+ name: "distributor",
505
+ docs: ["The [MerkleDistributor]."],
506
+ writable: true
507
+ },
508
+ {
509
+ name: "from",
510
+ docs: ["Distributor ATA containing the tokens to distribute."],
511
+ writable: true
512
+ },
513
+ {
514
+ name: "to",
515
+ docs: ["The Clawback token account."],
516
+ writable: true
517
+ },
518
+ {
519
+ name: "admin",
520
+ docs: ["Only Admin can trigger the clawback of funds"],
521
+ writable: true,
522
+ signer: true
523
+ },
524
+ {
525
+ name: "mint"
526
+ },
527
+ {
528
+ name: "system_program",
529
+ docs: ["The [System] program."],
530
+ address: "11111111111111111111111111111111"
531
+ },
532
+ {
533
+ name: "token_program",
534
+ docs: ["SPL [Token] program."]
535
+ }
536
+ ],
537
+ args: []
538
+ },
539
+ {
540
+ name: "close_claim",
541
+ discriminator: [42, 177, 165, 35, 213, 179, 211, 19],
542
+ accounts: [
543
+ {
544
+ name: "distributor",
545
+ docs: ["The [MerkleDistributor]."],
546
+ writable: true
547
+ },
548
+ {
549
+ name: "admin_or_claimant",
550
+ docs: ["Admin signer"],
551
+ writable: true,
552
+ signer: true
553
+ },
554
+ {
555
+ name: "claimant",
556
+ writable: true
557
+ },
558
+ {
559
+ name: "claim_status",
560
+ writable: true,
561
+ pda: {
562
+ seeds: [
563
+ {
564
+ kind: "const",
565
+ value: [67, 108, 97, 105, 109, 83, 116, 97, 116, 117, 115]
566
+ },
567
+ {
568
+ kind: "account",
569
+ path: "claimant"
570
+ },
571
+ {
572
+ kind: "account",
573
+ path: "distributor"
574
+ }
575
+ ]
576
+ }
577
+ },
578
+ {
579
+ name: "system_program",
580
+ docs: ["The [System] program."],
581
+ address: "11111111111111111111111111111111"
582
+ },
583
+ {
584
+ name: "event_authority",
585
+ pda: {
586
+ seeds: [
587
+ {
588
+ kind: "const",
589
+ value: [95, 95, 101, 118, 101, 110, 116, 95, 97, 117, 116, 104, 111, 114, 105, 116, 121]
590
+ }
591
+ ]
592
+ }
593
+ },
594
+ {
595
+ name: "program"
596
+ }
597
+ ],
598
+ args: [
599
+ {
600
+ name: "amount_unlocked",
601
+ type: {
602
+ option: "u64"
603
+ }
604
+ },
605
+ {
606
+ name: "amount_locked",
607
+ type: {
608
+ option: "u64"
609
+ }
610
+ },
611
+ {
612
+ name: "proof",
613
+ type: {
614
+ option: {
615
+ vec: {
616
+ array: ["u8", 32]
617
+ }
618
+ }
619
+ }
620
+ }
621
+ ]
622
+ },
623
+ {
624
+ name: "compress_claim",
625
+ discriminator: [219, 45, 247, 134, 71, 119, 125, 89],
626
+ accounts: [
627
+ {
628
+ name: "distributor",
629
+ docs: ["The [MerkleDistributor]."],
630
+ writable: true
631
+ },
632
+ {
633
+ name: "claim_status",
634
+ writable: true,
635
+ pda: {
636
+ seeds: [
637
+ {
638
+ kind: "const",
639
+ value: [67, 108, 97, 105, 109, 83, 116, 97, 116, 117, 115]
640
+ },
641
+ {
642
+ kind: "account",
643
+ path: "claimant"
644
+ },
645
+ {
646
+ kind: "account",
647
+ path: "distributor"
648
+ }
649
+ ]
650
+ }
651
+ },
652
+ {
653
+ name: "signer",
654
+ docs: ["Signer account"],
655
+ writable: true,
656
+ signer: true
657
+ },
658
+ {
659
+ name: "claimant"
660
+ },
661
+ {
662
+ name: "system_program",
663
+ docs: ["The [System] program."],
664
+ address: "11111111111111111111111111111111"
665
+ }
666
+ ],
667
+ args: []
668
+ },
669
+ {
670
+ name: "new_claim",
671
+ discriminator: [78, 177, 98, 123, 210, 21, 187, 83],
672
+ accounts: [
673
+ {
674
+ name: "distributor",
675
+ docs: ["The [MerkleDistributor]."],
676
+ writable: true
677
+ },
678
+ {
679
+ name: "claim_status",
680
+ writable: true,
681
+ pda: {
682
+ seeds: [
683
+ {
684
+ kind: "const",
685
+ value: [67, 108, 97, 105, 109, 83, 116, 97, 116, 117, 115]
686
+ },
687
+ {
688
+ kind: "account",
689
+ path: "claimant"
690
+ },
691
+ {
692
+ kind: "account",
693
+ path: "distributor"
694
+ }
695
+ ]
696
+ }
697
+ },
698
+ {
699
+ name: "from",
700
+ docs: ["Distributor ATA containing the tokens to distribute."],
701
+ writable: true,
702
+ pda: {
703
+ seeds: [
704
+ {
705
+ kind: "account",
706
+ path: "distributor"
707
+ },
708
+ {
709
+ kind: "account",
710
+ path: "token_program"
711
+ },
712
+ {
713
+ kind: "account",
714
+ path: "distributor.mint",
715
+ account: "MerkleDistributor"
716
+ }
717
+ ],
718
+ program: {
719
+ kind: "const",
720
+ value: [
721
+ 140,
722
+ 151,
723
+ 37,
724
+ 143,
725
+ 78,
726
+ 36,
727
+ 137,
728
+ 241,
729
+ 187,
730
+ 61,
731
+ 16,
732
+ 41,
733
+ 20,
734
+ 142,
735
+ 13,
736
+ 131,
737
+ 11,
738
+ 90,
739
+ 19,
740
+ 153,
741
+ 218,
742
+ 255,
743
+ 16,
744
+ 132,
745
+ 4,
746
+ 142,
747
+ 123,
748
+ 216,
749
+ 219,
750
+ 233,
751
+ 248,
752
+ 89
753
+ ]
754
+ }
755
+ }
756
+ },
757
+ {
758
+ name: "to",
759
+ docs: ["Account to send the claimed tokens to."],
760
+ writable: true
761
+ },
762
+ {
763
+ name: "claimant",
764
+ docs: ["Who is claiming the tokens."],
765
+ writable: true,
766
+ signer: true
767
+ },
768
+ {
769
+ name: "mint",
770
+ docs: ["The mint to claim."],
771
+ relations: ["distributor"]
772
+ },
773
+ {
774
+ name: "token_program",
775
+ docs: ["SPL [Token] program."]
776
+ },
777
+ {
778
+ name: "system_program",
779
+ docs: ["The [System] program."],
780
+ address: "11111111111111111111111111111111"
781
+ },
782
+ {
783
+ name: "event_authority",
784
+ pda: {
785
+ seeds: [
786
+ {
787
+ kind: "const",
788
+ value: [95, 95, 101, 118, 101, 110, 116, 95, 97, 117, 116, 104, 111, 114, 105, 116, 121]
789
+ }
790
+ ]
791
+ }
792
+ },
793
+ {
794
+ name: "program"
795
+ }
796
+ ],
797
+ args: [
798
+ {
799
+ name: "amount_unlocked",
800
+ type: "u64"
801
+ },
802
+ {
803
+ name: "amount_locked",
804
+ type: "u64"
805
+ },
806
+ {
807
+ name: "proof",
808
+ type: {
809
+ vec: {
810
+ array: ["u8", 32]
811
+ }
812
+ }
813
+ }
814
+ ]
815
+ },
816
+ {
817
+ name: "new_distributor",
818
+ docs: [
819
+ "READ THE FOLLOWING:",
820
+ "",
821
+ "This instruction is susceptible to frontrunning that could result in loss of funds if not handled properly.",
822
+ "",
823
+ "An attack could look like:",
824
+ "- A legitimate user opens a new distributor.",
825
+ "- Someone observes the call to this instruction.",
826
+ "- They replace the clawback_receiver, admin, or time parameters with their own.",
827
+ "",
828
+ "One situation that could happen here is the attacker replaces the admin and clawback_receiver with their own",
829
+ "and sets the clawback_start_ts with the minimal time allowed. After clawback_start_ts has elapsed,",
830
+ "the attacker can steal all funds from the distributor to their own clawback_receiver account.",
831
+ "",
832
+ "HOW TO AVOID:",
833
+ "- When you call into this instruction, ensure your transaction succeeds.",
834
+ "- To be extra safe, after your transaction succeeds, read back the state of the created MerkleDistributor account and",
835
+ "assert the parameters are what you expect, most importantly the clawback_receiver and admin.",
836
+ "- If your transaction fails, double check the value on-chain matches what you expect."
837
+ ],
838
+ discriminator: [32, 139, 112, 171, 0, 2, 225, 155],
839
+ accounts: [
840
+ {
841
+ name: "distributor",
842
+ docs: ["[MerkleDistributor]."],
843
+ writable: true,
844
+ pda: {
845
+ seeds: [
846
+ {
847
+ kind: "const",
848
+ value: [77, 101, 114, 107, 108, 101, 68, 105, 115, 116, 114, 105, 98, 117, 116, 111, 114]
849
+ },
850
+ {
851
+ kind: "account",
852
+ path: "mint"
853
+ },
854
+ {
855
+ kind: "arg",
856
+ path: "version"
857
+ }
858
+ ]
859
+ }
860
+ },
861
+ {
862
+ name: "clawback_receiver",
863
+ docs: ["Clawback receiver token account"],
864
+ writable: true
865
+ },
866
+ {
867
+ name: "mint",
868
+ docs: ["The mint to distribute."]
869
+ },
870
+ {
871
+ name: "token_vault",
872
+ docs: ["Token vault"],
873
+ writable: true,
874
+ pda: {
875
+ seeds: [
876
+ {
877
+ kind: "account",
878
+ path: "distributor"
879
+ },
880
+ {
881
+ kind: "account",
882
+ path: "token_program"
883
+ },
884
+ {
885
+ kind: "account",
886
+ path: "mint"
887
+ }
888
+ ],
889
+ program: {
890
+ kind: "const",
891
+ value: [
892
+ 140,
893
+ 151,
894
+ 37,
895
+ 143,
896
+ 78,
897
+ 36,
898
+ 137,
899
+ 241,
900
+ 187,
901
+ 61,
902
+ 16,
903
+ 41,
904
+ 20,
905
+ 142,
906
+ 13,
907
+ 131,
908
+ 11,
909
+ 90,
910
+ 19,
911
+ 153,
912
+ 218,
913
+ 255,
914
+ 16,
915
+ 132,
916
+ 4,
917
+ 142,
918
+ 123,
919
+ 216,
920
+ 219,
921
+ 233,
922
+ 248,
923
+ 89
924
+ ]
925
+ }
926
+ }
927
+ },
928
+ {
929
+ name: "admin",
930
+ docs: [
931
+ "Admin wallet, responsible for creating the distributor and paying for the transaction.",
932
+ "Also has the authority to set the clawback receiver and change itself."
933
+ ],
934
+ writable: true,
935
+ signer: true
936
+ },
937
+ {
938
+ name: "system_program",
939
+ docs: ["The [System] program."],
940
+ address: "11111111111111111111111111111111"
941
+ },
942
+ {
943
+ name: "associated_token_program",
944
+ docs: ["The [Associated Token] program."],
945
+ address: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"
946
+ },
947
+ {
948
+ name: "token_program",
949
+ docs: ["The [Token] program."]
950
+ }
951
+ ],
952
+ args: [
953
+ {
954
+ name: "version",
955
+ type: "u64"
956
+ },
957
+ {
958
+ name: "root",
959
+ type: {
960
+ array: ["u8", 32]
961
+ }
962
+ },
963
+ {
964
+ name: "max_total_claim",
965
+ type: "u64"
966
+ },
967
+ {
968
+ name: "max_num_nodes",
969
+ type: "u64"
970
+ },
971
+ {
972
+ name: "unlock_period",
973
+ type: "u64"
974
+ },
975
+ {
976
+ name: "start_vesting_ts",
977
+ type: "u64"
978
+ },
979
+ {
980
+ name: "end_vesting_ts",
981
+ type: "u64"
982
+ },
983
+ {
984
+ name: "clawback_start_ts",
985
+ type: "u64"
986
+ },
987
+ {
988
+ name: "claims_closable_by_admin",
989
+ type: "bool"
990
+ },
991
+ {
992
+ name: "can_update_duration",
993
+ type: {
994
+ option: "bool"
995
+ }
996
+ },
997
+ {
998
+ name: "total_amount_unlocked",
999
+ type: {
1000
+ option: "u64"
1001
+ }
1002
+ },
1003
+ {
1004
+ name: "total_amount_locked",
1005
+ type: {
1006
+ option: "u64"
1007
+ }
1008
+ },
1009
+ {
1010
+ name: "claims_closable_by_claimant",
1011
+ type: {
1012
+ option: "bool"
1013
+ }
1014
+ },
1015
+ {
1016
+ name: "claims_limit",
1017
+ type: {
1018
+ option: "u16"
1019
+ }
1020
+ }
1021
+ ]
1022
+ },
1023
+ {
1024
+ name: "refund_claim",
1025
+ discriminator: [157, 23, 164, 146, 176, 53, 147, 143],
1026
+ accounts: [
1027
+ {
1028
+ name: "distributor",
1029
+ docs: ["The [MerkleDistributor]."],
1030
+ writable: true
1031
+ },
1032
+ {
1033
+ name: "claim_status",
1034
+ writable: true,
1035
+ pda: {
1036
+ seeds: [
1037
+ {
1038
+ kind: "const",
1039
+ value: [67, 108, 97, 105, 109, 83, 116, 97, 116, 117, 115]
1040
+ },
1041
+ {
1042
+ kind: "account",
1043
+ path: "claimant"
1044
+ },
1045
+ {
1046
+ kind: "account",
1047
+ path: "distributor"
1048
+ }
1049
+ ]
1050
+ }
1051
+ },
1052
+ {
1053
+ name: "signer",
1054
+ docs: ["Signer account"],
1055
+ writable: true,
1056
+ signer: true
1057
+ },
1058
+ {
1059
+ name: "claimant"
1060
+ },
1061
+ {
1062
+ name: "streamflow_treasury",
1063
+ writable: true,
1064
+ address: "5SEpbdjFK5FxwTvfsGMXVQTD2v4M2c5tyRTxhdsPkgDw"
1065
+ },
1066
+ {
1067
+ name: "system_program",
1068
+ docs: ["The [System] program."],
1069
+ address: "11111111111111111111111111111111"
1070
+ }
1071
+ ],
1072
+ args: []
1073
+ },
1074
+ {
1075
+ name: "set_admin",
1076
+ discriminator: [251, 163, 0, 52, 91, 194, 187, 92],
1077
+ accounts: [
1078
+ {
1079
+ name: "distributor",
1080
+ docs: ["The [MerkleDistributor]."],
1081
+ writable: true
1082
+ },
1083
+ {
1084
+ name: "admin",
1085
+ docs: ["Admin signer"],
1086
+ writable: true,
1087
+ signer: true
1088
+ },
1089
+ {
1090
+ name: "new_admin",
1091
+ docs: ["New admin account"],
1092
+ writable: true
1093
+ }
1094
+ ],
1095
+ args: []
1096
+ },
1097
+ {
1098
+ name: "set_clawback_receiver",
1099
+ discriminator: [153, 217, 34, 20, 19, 29, 229, 75],
1100
+ accounts: [
1101
+ {
1102
+ name: "distributor",
1103
+ docs: ["The [MerkleDistributor]."],
1104
+ writable: true
1105
+ },
1106
+ {
1107
+ name: "new_clawback_account",
1108
+ docs: ["New clawback account"]
1109
+ },
1110
+ {
1111
+ name: "admin",
1112
+ docs: ["Admin signer"],
1113
+ writable: true,
1114
+ signer: true
1115
+ }
1116
+ ],
1117
+ args: []
1118
+ },
1119
+ {
1120
+ name: "update",
1121
+ discriminator: [219, 200, 88, 176, 158, 63, 253, 127],
1122
+ accounts: [
1123
+ {
1124
+ name: "distributor",
1125
+ docs: ["The [MerkleDistributor]."],
1126
+ writable: true
1127
+ },
1128
+ {
1129
+ name: "admin",
1130
+ docs: ["Only Admin can trigger the clawback of funds"],
1131
+ writable: true,
1132
+ signer: true
1133
+ },
1134
+ {
1135
+ name: "system_program",
1136
+ docs: ["The [System] program."],
1137
+ address: "11111111111111111111111111111111"
1138
+ }
1139
+ ],
1140
+ args: [
1141
+ {
1142
+ name: "end_ts",
1143
+ type: {
1144
+ option: "u64"
1145
+ }
1146
+ }
1147
+ ]
1148
+ }
1149
+ ],
1150
+ accounts: [
1151
+ {
1152
+ name: "ClaimStatus",
1153
+ discriminator: [22, 183, 249, 157, 247, 95, 150, 96]
1154
+ },
1155
+ {
1156
+ name: "CompressedClaimStatus",
1157
+ discriminator: [53, 68, 161, 131, 212, 106, 98, 48]
1158
+ },
1159
+ {
1160
+ name: "MerkleDistributor",
1161
+ discriminator: [77, 119, 139, 70, 84, 247, 12, 26]
1162
+ }
1163
+ ],
1164
+ events: [
1165
+ {
1166
+ name: "ClaimClosedEvent",
1167
+ discriminator: [139, 166, 215, 195, 184, 233, 26, 217]
1168
+ },
1169
+ {
1170
+ name: "ClaimedEvent",
1171
+ discriminator: [144, 172, 209, 86, 144, 87, 84, 115]
1172
+ },
1173
+ {
1174
+ name: "NewClaimEvent",
1175
+ discriminator: [244, 3, 231, 151, 60, 101, 55, 55]
1176
+ }
1177
+ ],
1178
+ errors: [
1179
+ {
1180
+ code: 6e3,
1181
+ name: "InsufficientUnlockedTokens",
1182
+ msg: "Insufficient unlocked tokens"
1183
+ },
1184
+ {
1185
+ code: 6001,
1186
+ name: "InvalidProof",
1187
+ msg: "Invalid Merkle proof"
1188
+ },
1189
+ {
1190
+ code: 6002,
1191
+ name: "ExceededMaxClaim",
1192
+ msg: "Exceeded maximum claim amount"
1193
+ },
1194
+ {
1195
+ code: 6003,
1196
+ name: "MaxNodesExceeded",
1197
+ msg: "Exceeded maximum node count"
1198
+ },
1199
+ {
1200
+ code: 6004,
1201
+ name: "Unauthorized",
1202
+ msg: "Account is not authorized to execute this instruction"
1203
+ },
1204
+ {
1205
+ code: 6005,
1206
+ name: "OwnerMismatch",
1207
+ msg: "Token account owner did not match intended owner"
1208
+ },
1209
+ {
1210
+ code: 6006,
1211
+ name: "ClawbackBeforeStart",
1212
+ msg: "Attempted clawback before start"
1213
+ },
1214
+ {
1215
+ code: 6007,
1216
+ name: "ClawbackAlreadyClaimed",
1217
+ msg: "Clawback already claimed"
1218
+ },
1219
+ {
1220
+ code: 6008,
1221
+ name: "SameClawbackReceiver",
1222
+ msg: "New and old Clawback receivers are identical"
1223
+ },
1224
+ {
1225
+ code: 6009,
1226
+ name: "ClawbackReceiverIsTokenVault",
1227
+ msg: "Clawback receiver can not be the Token Vault"
1228
+ },
1229
+ {
1230
+ code: 6010,
1231
+ name: "SameAdmin",
1232
+ msg: "New and old admin are identical"
1233
+ },
1234
+ {
1235
+ code: 6011,
1236
+ name: "ClaimExpired",
1237
+ msg: "Claim window expired"
1238
+ },
1239
+ {
1240
+ code: 6012,
1241
+ name: "ArithmeticError",
1242
+ msg: "Arithmetic Error (overflow/underflow)"
1243
+ },
1244
+ {
1245
+ code: 6013,
1246
+ name: "StartTimestampAfterEnd",
1247
+ msg: "Start Timestamp cannot be after end Timestamp"
1248
+ },
1249
+ {
1250
+ code: 6014,
1251
+ name: "TimestampsNotInFuture",
1252
+ msg: "Timestamps cannot be in the past"
1253
+ },
1254
+ {
1255
+ code: 6015,
1256
+ name: "InvalidMint",
1257
+ msg: "Invalid Mint"
1258
+ },
1259
+ {
1260
+ code: 6016,
1261
+ name: "ClaimIsClosed",
1262
+ msg: "Claim is closed"
1263
+ },
1264
+ {
1265
+ code: 6017,
1266
+ name: "ClaimsAreNotClosable",
1267
+ msg: "Claims are not closable"
1268
+ },
1269
+ {
1270
+ code: 6018,
1271
+ name: "InvalidUnlockPeriod",
1272
+ msg: "Invalid unlock period"
1273
+ },
1274
+ {
1275
+ code: 6019,
1276
+ name: "DurationUpdateNotAllowed",
1277
+ msg: "Duration update is not allowed"
1278
+ },
1279
+ {
1280
+ code: 6020,
1281
+ name: "NoVestingAmount",
1282
+ msg: "Vesting amounts are not set"
1283
+ },
1284
+ {
1285
+ code: 6021,
1286
+ name: "VestingAlreadyFinished",
1287
+ msg: "Vesting already finished"
1288
+ },
1289
+ {
1290
+ code: 6022,
1291
+ name: "InvalidAmounts",
1292
+ msg: "Provided amounts are invalid"
1293
+ },
1294
+ {
1295
+ code: 6023,
1296
+ name: "ClaimsLimitReached",
1297
+ msg: "Claims limit has been reached"
1298
+ }
1299
+ ],
1300
+ types: [
1301
+ {
1302
+ name: "ClaimClosedEvent",
1303
+ docs: ["Emitted when a new claim is created."],
1304
+ type: {
1305
+ kind: "struct",
1306
+ fields: [
1307
+ {
1308
+ name: "claimant",
1309
+ docs: ["User that claimed."],
1310
+ type: "pubkey"
1311
+ },
1312
+ {
1313
+ name: "timestamp",
1314
+ docs: ["Timestamp."],
1315
+ type: "u64"
1316
+ }
1317
+ ]
1318
+ }
1319
+ },
1320
+ {
1321
+ name: "ClaimStatus",
1322
+ docs: ["Holds whether or not a claimant has claimed tokens."],
1323
+ type: {
1324
+ kind: "struct",
1325
+ fields: [
1326
+ {
1327
+ name: "claimant",
1328
+ docs: ["Authority that claimed the tokens."],
1329
+ type: "pubkey"
1330
+ },
1331
+ {
1332
+ name: "locked_amount",
1333
+ docs: ["Locked amount"],
1334
+ type: "u64"
1335
+ },
1336
+ {
1337
+ name: "locked_amount_withdrawn",
1338
+ docs: ["Locked amount withdrawn"],
1339
+ type: "u64"
1340
+ },
1341
+ {
1342
+ name: "unlocked_amount",
1343
+ docs: ["Unlocked amount"],
1344
+ type: "u64"
1345
+ },
1346
+ {
1347
+ name: "last_claim_ts",
1348
+ docs: ["Last claim time"],
1349
+ type: "u64"
1350
+ },
1351
+ {
1352
+ name: "last_amount_per_unlock",
1353
+ docs: ["Track amount per unlock, can be useful for non-linear vesting"],
1354
+ type: "u64"
1355
+ },
1356
+ {
1357
+ name: "closed",
1358
+ docs: ["Whether claim is closed"],
1359
+ type: "bool"
1360
+ },
1361
+ {
1362
+ name: "distributor",
1363
+ docs: [
1364
+ "Distributor account for which ClaimStatus was created, useful to filter by in get_program_accounts"
1365
+ ],
1366
+ type: "pubkey"
1367
+ },
1368
+ {
1369
+ name: "claims_count",
1370
+ docs: ["Number of time amount has been claimed"],
1371
+ type: "u16"
1372
+ },
1373
+ {
1374
+ name: "closed_ts",
1375
+ docs: ["Time when claim has been closed"],
1376
+ type: "u64"
1377
+ },
1378
+ {
1379
+ name: "buffer_2",
1380
+ docs: ["Buffer for additional fields"],
1381
+ type: {
1382
+ array: ["u8", 22]
1383
+ }
1384
+ }
1385
+ ]
1386
+ }
1387
+ },
1388
+ {
1389
+ name: "ClaimedEvent",
1390
+ docs: ["Emitted when tokens are claimed."],
1391
+ type: {
1392
+ kind: "struct",
1393
+ fields: [
1394
+ {
1395
+ name: "claimant",
1396
+ docs: ["User that claimed."],
1397
+ type: "pubkey"
1398
+ },
1399
+ {
1400
+ name: "amount",
1401
+ docs: ["Amount of tokens to distribute."],
1402
+ type: "u64"
1403
+ }
1404
+ ]
1405
+ }
1406
+ },
1407
+ {
1408
+ name: "CompressedClaimStatus",
1409
+ docs: ["Holds whether or not a claimant has claimed tokens."],
1410
+ type: {
1411
+ kind: "struct",
1412
+ fields: [
1413
+ {
1414
+ name: "state",
1415
+ type: {
1416
+ defined: {
1417
+ name: "State"
1418
+ }
1419
+ }
1420
+ }
1421
+ ]
1422
+ }
1423
+ },
1424
+ {
1425
+ name: "MerkleDistributor",
1426
+ docs: ["State for the account which distributes tokens."],
1427
+ type: {
1428
+ kind: "struct",
1429
+ fields: [
1430
+ {
1431
+ name: "bump",
1432
+ docs: ["Bump seed."],
1433
+ type: "u8"
1434
+ },
1435
+ {
1436
+ name: "version",
1437
+ docs: ["Version of the airdrop"],
1438
+ type: "u64"
1439
+ },
1440
+ {
1441
+ name: "root",
1442
+ docs: ["The 256-bit merkle root."],
1443
+ type: {
1444
+ array: ["u8", 32]
1445
+ }
1446
+ },
1447
+ {
1448
+ name: "mint",
1449
+ docs: ["[Mint] of the token to be distributed."],
1450
+ type: "pubkey"
1451
+ },
1452
+ {
1453
+ name: "token_vault",
1454
+ docs: ["Token Address of the vault"],
1455
+ type: "pubkey"
1456
+ },
1457
+ {
1458
+ name: "max_total_claim",
1459
+ docs: ["Maximum number of tokens that can ever be claimed from this [MerkleDistributor]."],
1460
+ type: "u64"
1461
+ },
1462
+ {
1463
+ name: "max_num_nodes",
1464
+ docs: ["Maximum number of nodes in [MerkleDistributor]."],
1465
+ type: "u64"
1466
+ },
1467
+ {
1468
+ name: "unlock_period",
1469
+ docs: ["Time step (period) in seconds per which the unlock occurs"],
1470
+ type: "u64"
1471
+ },
1472
+ {
1473
+ name: "total_amount_claimed",
1474
+ docs: ["Total amount of tokens that have been claimed."],
1475
+ type: "u64"
1476
+ },
1477
+ {
1478
+ name: "num_nodes_claimed",
1479
+ docs: ["Number of nodes that have been claimed."],
1480
+ type: "u64"
1481
+ },
1482
+ {
1483
+ name: "start_ts",
1484
+ docs: ["Lockup time start (Unix Timestamp)"],
1485
+ type: "u64"
1486
+ },
1487
+ {
1488
+ name: "end_ts",
1489
+ docs: ["Lockup time end (Unix Timestamp)"],
1490
+ type: "u64"
1491
+ },
1492
+ {
1493
+ name: "clawback_start_ts",
1494
+ docs: ["Clawback start (Unix Timestamp)"],
1495
+ type: "u64"
1496
+ },
1497
+ {
1498
+ name: "clawback_receiver",
1499
+ docs: ["Clawback receiver"],
1500
+ type: "pubkey"
1501
+ },
1502
+ {
1503
+ name: "admin",
1504
+ docs: ["Admin wallet"],
1505
+ type: "pubkey"
1506
+ },
1507
+ {
1508
+ name: "clawed_back",
1509
+ docs: ["Whether or not the distributor has been clawed back"],
1510
+ type: "bool"
1511
+ },
1512
+ {
1513
+ name: "claims_closable_by_admin",
1514
+ docs: ["Whether claims are closable by the admin or not"],
1515
+ type: "bool"
1516
+ },
1517
+ {
1518
+ name: "can_update_duration",
1519
+ docs: ["Whether admin can update vesting duration"],
1520
+ type: "bool"
1521
+ },
1522
+ {
1523
+ name: "total_amount_unlocked",
1524
+ docs: ["Total amount of funds unlocked (cliff/instant)"],
1525
+ type: "u64"
1526
+ },
1527
+ {
1528
+ name: "total_amount_locked",
1529
+ docs: ["Total amount of funds locked (vested)"],
1530
+ type: "u64"
1531
+ },
1532
+ {
1533
+ name: "last_duration_update_ts",
1534
+ docs: ["Timestamp when update was last called"],
1535
+ type: "u64"
1536
+ },
1537
+ {
1538
+ name: "total_claimable_pre_update",
1539
+ docs: [
1540
+ "Total amount of locked amount claimable as of last duration update, ever increasing total, accumulates with each update"
1541
+ ],
1542
+ type: "u64"
1543
+ },
1544
+ {
1545
+ name: "clawed_back_ts",
1546
+ docs: ["Timestamp when funds were clawed back"],
1547
+ type: "u64"
1548
+ },
1549
+ {
1550
+ name: "claims_closable_by_claimant",
1551
+ docs: ["Whether claims are closable by claimant or not"],
1552
+ type: "bool"
1553
+ },
1554
+ {
1555
+ name: "claims_limit",
1556
+ docs: ["Limit number of claims"],
1557
+ type: "u16"
1558
+ },
1559
+ {
1560
+ name: "buffer_2",
1561
+ docs: ["Buffer for additional fields"],
1562
+ type: {
1563
+ array: ["u8", 20]
1564
+ }
1565
+ },
1566
+ {
1567
+ name: "buffer_3",
1568
+ docs: ["Buffer for additional fields"],
1569
+ type: {
1570
+ array: ["u8", 32]
1571
+ }
1572
+ }
1573
+ ]
1574
+ }
1575
+ },
1576
+ {
1577
+ name: "NewClaimEvent",
1578
+ docs: ["Emitted when a new claim is created."],
1579
+ type: {
1580
+ kind: "struct",
1581
+ fields: [
1582
+ {
1583
+ name: "claimant",
1584
+ docs: ["User that claimed."],
1585
+ type: "pubkey"
1586
+ },
1587
+ {
1588
+ name: "timestamp",
1589
+ docs: ["Timestamp."],
1590
+ type: "u64"
1591
+ }
1592
+ ]
1593
+ }
1594
+ },
1595
+ {
1596
+ name: "State",
1597
+ type: {
1598
+ kind: "enum",
1599
+ variants: [
1600
+ {
1601
+ name: "Claimed"
1602
+ },
1603
+ {
1604
+ name: "Closed"
1605
+ }
1606
+ ]
1607
+ }
1608
+ }
1609
+ ]
1610
+ };
1611
+
302
1612
  // solana/constants.ts
303
1613
  var constants_exports = {};
304
1614
  __export(constants_exports, {
@@ -339,107 +1649,6 @@ var DISTRIBUTOR_PROGRAM_ID = {
339
1649
  [ICluster.Testnet]: "MErKy6nZVoVAkryxAejJz2juifQ4ArgLgHmaJCQkU7N",
340
1650
  [ICluster.Local]: "MErKy6nZVoVAkryxAejJz2juifQ4ArgLgHmaJCQkU7N"
341
1651
  };
342
- var _ClaimStatus = class _ClaimStatus {
343
- constructor(fields) {
344
- this.claimant = fields.claimant;
345
- this.lockedAmount = fields.lockedAmount;
346
- this.lockedAmountWithdrawn = fields.lockedAmountWithdrawn;
347
- this.unlockedAmount = fields.unlockedAmount;
348
- this.lastClaimTs = fields.lastClaimTs;
349
- this.lastAmountPerUnlock = fields.lastAmountPerUnlock;
350
- this.closed = fields.closed;
351
- this.distributor = fields.distributor;
352
- this.claimsCount = fields.claimsCount;
353
- this.closedTs = fields.closedTs;
354
- this.buffer2 = fields.buffer2;
355
- }
356
- static async fetch(c, address, programId = PROGRAM_ID) {
357
- const info = await c.getAccountInfo(address);
358
- if (info === null) {
359
- return null;
360
- }
361
- if (!info.owner.equals(programId)) {
362
- throw new Error("account doesn't belong to this program");
363
- }
364
- return this.decode(info.data);
365
- }
366
- static async fetchMultiple(c, addresses, programId = PROGRAM_ID) {
367
- const infos = await c.getMultipleAccountsInfo(addresses);
368
- return infos.map((info) => {
369
- if (info === null) {
370
- return null;
371
- }
372
- if (!info.owner.equals(programId)) {
373
- throw new Error("account doesn't belong to this program");
374
- }
375
- return this.decode(info.data);
376
- });
377
- }
378
- static decode(data) {
379
- if (!data.slice(0, 8).equals(_ClaimStatus.discriminator)) {
380
- throw new Error("invalid account discriminator");
381
- }
382
- const dec = _ClaimStatus.layout.decode(data.slice(8));
383
- return new _ClaimStatus({
384
- claimant: dec.claimant,
385
- lockedAmount: dec.lockedAmount,
386
- lockedAmountWithdrawn: dec.lockedAmountWithdrawn,
387
- unlockedAmount: dec.unlockedAmount,
388
- lastClaimTs: dec.lastClaimTs,
389
- lastAmountPerUnlock: dec.lastAmountPerUnlock,
390
- closed: dec.closed,
391
- distributor: dec.distributor,
392
- claimsCount: dec.claimsCount,
393
- closedTs: dec.closedTs,
394
- buffer2: dec.buffer2
395
- });
396
- }
397
- toJSON() {
398
- return {
399
- claimant: this.claimant.toString(),
400
- lockedAmount: this.lockedAmount.toString(),
401
- lockedAmountWithdrawn: this.lockedAmountWithdrawn.toString(),
402
- unlockedAmount: this.unlockedAmount.toString(),
403
- lastClaimTs: this.lastClaimTs.toString(),
404
- lastAmountPerUnlock: this.lastAmountPerUnlock.toString(),
405
- closed: this.closed,
406
- distributor: this.distributor.toString(),
407
- claimsCount: this.claimsCount,
408
- closedTs: this.closedTs.toString(),
409
- buffer2: this.buffer2
410
- };
411
- }
412
- static fromJSON(obj) {
413
- return new _ClaimStatus({
414
- claimant: new PublicKey(obj.claimant),
415
- lockedAmount: new BN6(obj.lockedAmount),
416
- lockedAmountWithdrawn: new BN6(obj.lockedAmountWithdrawn),
417
- unlockedAmount: new BN6(obj.unlockedAmount),
418
- lastClaimTs: new BN6(obj.lastClaimTs),
419
- lastAmountPerUnlock: new BN6(obj.lastAmountPerUnlock),
420
- closed: obj.closed,
421
- distributor: new PublicKey(obj.distributor),
422
- claimsCount: obj.claimsCount,
423
- closedTs: new BN6(obj.closedTs),
424
- buffer2: obj.buffer2
425
- });
426
- }
427
- };
428
- _ClaimStatus.discriminator = Buffer.from([22, 183, 249, 157, 247, 95, 150, 96]);
429
- _ClaimStatus.layout = borsh8.struct([
430
- borsh8.publicKey("claimant"),
431
- borsh8.u64("lockedAmount"),
432
- borsh8.u64("lockedAmountWithdrawn"),
433
- borsh8.u64("unlockedAmount"),
434
- borsh8.u64("lastClaimTs"),
435
- borsh8.u64("lastAmountPerUnlock"),
436
- borsh8.bool("closed"),
437
- borsh8.publicKey("distributor"),
438
- borsh8.u16("claimsCount"),
439
- borsh8.u64("closedTs"),
440
- borsh8.array(borsh8.u8(), 22, "buffer2")
441
- ]);
442
- var ClaimStatus = _ClaimStatus;
443
1652
  var _MerkleDistributor = class _MerkleDistributor {
444
1653
  constructor(fields) {
445
1654
  this.bump = fields.bump;
@@ -561,28 +1770,28 @@ var _MerkleDistributor = class _MerkleDistributor {
561
1770
  static fromJSON(obj) {
562
1771
  return new _MerkleDistributor({
563
1772
  bump: obj.bump,
564
- version: new BN6(obj.version),
1773
+ version: new BN5(obj.version),
565
1774
  root: obj.root,
566
1775
  mint: new PublicKey(obj.mint),
567
1776
  tokenVault: new PublicKey(obj.tokenVault),
568
- maxTotalClaim: new BN6(obj.maxTotalClaim),
569
- maxNumNodes: new BN6(obj.maxNumNodes),
570
- unlockPeriod: new BN6(obj.unlockPeriod),
571
- totalAmountClaimed: new BN6(obj.totalAmountClaimed),
572
- numNodesClaimed: new BN6(obj.numNodesClaimed),
573
- startTs: new BN6(obj.startTs),
574
- endTs: new BN6(obj.endTs),
575
- clawbackStartTs: new BN6(obj.clawbackStartTs),
1777
+ maxTotalClaim: new BN5(obj.maxTotalClaim),
1778
+ maxNumNodes: new BN5(obj.maxNumNodes),
1779
+ unlockPeriod: new BN5(obj.unlockPeriod),
1780
+ totalAmountClaimed: new BN5(obj.totalAmountClaimed),
1781
+ numNodesClaimed: new BN5(obj.numNodesClaimed),
1782
+ startTs: new BN5(obj.startTs),
1783
+ endTs: new BN5(obj.endTs),
1784
+ clawbackStartTs: new BN5(obj.clawbackStartTs),
576
1785
  clawbackReceiver: new PublicKey(obj.clawbackReceiver),
577
1786
  admin: new PublicKey(obj.admin),
578
1787
  clawedBack: obj.clawedBack,
579
1788
  claimsClosableByAdmin: obj.claimsClosableByAdmin,
580
1789
  canUpdateDuration: obj.canUpdateDuration,
581
- totalAmountUnlocked: new BN6(obj.totalAmountUnlocked),
582
- totalAmountLocked: new BN6(obj.totalAmountLocked),
583
- lastDurationUpdateTs: new BN6(obj.lastDurationUpdateTs),
584
- totalClaimablePreUpdate: new BN6(obj.totalClaimablePreUpdate),
585
- clawedBackTs: new BN6(obj.clawedBackTs),
1790
+ totalAmountUnlocked: new BN5(obj.totalAmountUnlocked),
1791
+ totalAmountLocked: new BN5(obj.totalAmountLocked),
1792
+ lastDurationUpdateTs: new BN5(obj.lastDurationUpdateTs),
1793
+ totalClaimablePreUpdate: new BN5(obj.totalClaimablePreUpdate),
1794
+ clawedBackTs: new BN5(obj.clawedBackTs),
586
1795
  claimsClosableByClaimant: obj.claimsClosableByClaimant,
587
1796
  claimsLimit: obj.claimsLimit,
588
1797
  buffer2: obj.buffer2,
@@ -591,34 +1800,34 @@ var _MerkleDistributor = class _MerkleDistributor {
591
1800
  }
592
1801
  };
593
1802
  _MerkleDistributor.discriminator = Buffer.from([77, 119, 139, 70, 84, 247, 12, 26]);
594
- _MerkleDistributor.layout = borsh8.struct([
595
- borsh8.u8("bump"),
596
- borsh8.u64("version"),
597
- borsh8.array(borsh8.u8(), 32, "root"),
598
- borsh8.publicKey("mint"),
599
- borsh8.publicKey("tokenVault"),
600
- borsh8.u64("maxTotalClaim"),
601
- borsh8.u64("maxNumNodes"),
602
- borsh8.u64("unlockPeriod"),
603
- borsh8.u64("totalAmountClaimed"),
604
- borsh8.u64("numNodesClaimed"),
605
- borsh8.u64("startTs"),
606
- borsh8.u64("endTs"),
607
- borsh8.u64("clawbackStartTs"),
608
- borsh8.publicKey("clawbackReceiver"),
609
- borsh8.publicKey("admin"),
610
- borsh8.bool("clawedBack"),
611
- borsh8.bool("claimsClosableByAdmin"),
612
- borsh8.bool("canUpdateDuration"),
613
- borsh8.u64("totalAmountUnlocked"),
614
- borsh8.u64("totalAmountLocked"),
615
- borsh8.u64("lastDurationUpdateTs"),
616
- borsh8.u64("totalClaimablePreUpdate"),
617
- borsh8.u64("clawedBackTs"),
618
- borsh8.bool("claimsClosableByClaimant"),
619
- borsh8.u16("claimsLimit"),
620
- borsh8.array(borsh8.u8(), 20, "buffer2"),
621
- borsh8.array(borsh8.u8(), 32, "buffer3")
1803
+ _MerkleDistributor.layout = borsh7.struct([
1804
+ borsh7.u8("bump"),
1805
+ borsh7.u64("version"),
1806
+ borsh7.array(borsh7.u8(), 32, "root"),
1807
+ borsh7.publicKey("mint"),
1808
+ borsh7.publicKey("tokenVault"),
1809
+ borsh7.u64("maxTotalClaim"),
1810
+ borsh7.u64("maxNumNodes"),
1811
+ borsh7.u64("unlockPeriod"),
1812
+ borsh7.u64("totalAmountClaimed"),
1813
+ borsh7.u64("numNodesClaimed"),
1814
+ borsh7.u64("startTs"),
1815
+ borsh7.u64("endTs"),
1816
+ borsh7.u64("clawbackStartTs"),
1817
+ borsh7.publicKey("clawbackReceiver"),
1818
+ borsh7.publicKey("admin"),
1819
+ borsh7.bool("clawedBack"),
1820
+ borsh7.bool("claimsClosableByAdmin"),
1821
+ borsh7.bool("canUpdateDuration"),
1822
+ borsh7.u64("totalAmountUnlocked"),
1823
+ borsh7.u64("totalAmountLocked"),
1824
+ borsh7.u64("lastDurationUpdateTs"),
1825
+ borsh7.u64("totalClaimablePreUpdate"),
1826
+ borsh7.u64("clawedBackTs"),
1827
+ borsh7.bool("claimsClosableByClaimant"),
1828
+ borsh7.u16("claimsLimit"),
1829
+ borsh7.array(borsh7.u8(), 20, "buffer2"),
1830
+ borsh7.array(borsh7.u8(), 32, "buffer3")
622
1831
  ]);
623
1832
  var MerkleDistributor = _MerkleDistributor;
624
1833
 
@@ -1630,9 +2839,12 @@ function getEventAuthorityPda(programId) {
1630
2839
  const seeds = [Buffer$1.from("__event_authority")];
1631
2840
  return PublicKey.findProgramAddressSync(seeds, programId)[0];
1632
2841
  }
1633
- async function wrappedSignAndExecuteTransaction(connection, invoker, tx, confirmationParams, throttleParams) {
2842
+ var isCompressedClaimStatus = (status) => {
2843
+ return !!status && "state" in status;
2844
+ };
2845
+ async function wrappedSignAndExecuteTransaction(...args) {
1634
2846
  try {
1635
- return await signAndExecuteTransaction(connection, invoker, tx, confirmationParams, throttleParams);
2847
+ return await signAndExecuteTransaction(...args);
1636
2848
  } catch (err) {
1637
2849
  if (err instanceof Error) {
1638
2850
  const parsed = fromTxError(err);
@@ -1673,6 +2885,10 @@ var BaseDistributorClient = class {
1673
2885
  this.connection = new Connection(clusterUrl, this.commitment);
1674
2886
  this.programId = programId !== "" ? new PublicKey(programId) : new PublicKey(DISTRIBUTOR_PROGRAM_ID[cluster]);
1675
2887
  this.sendThrottler = sendThrottler ?? buildSendThrottler(sendRate);
2888
+ const merkleDistributorProgram = {
2889
+ ...merkle_distributor_default
2890
+ };
2891
+ this.merkleDistributorProgram = new Program(merkleDistributorProgram, { connection: this.connection });
1676
2892
  }
1677
2893
  getConnection() {
1678
2894
  return this.connection;
@@ -1707,7 +2923,7 @@ var BaseDistributorClient = class {
1707
2923
  };
1708
2924
  if (extParams.isNative) {
1709
2925
  ixs.push(
1710
- ...await prepareWrappedAccount(this.connection, extParams.invoker.publicKey, new BN6(data.maxTotalClaim))
2926
+ ...await prepareWrappedAccount(this.connection, extParams.invoker.publicKey, new BN5(data.maxTotalClaim))
1711
2927
  );
1712
2928
  }
1713
2929
  const newDistributorInstruction = await this.getNewDistributorInstruction(data, accounts);
@@ -1748,7 +2964,14 @@ var BaseDistributorClient = class {
1748
2964
  return { distributorPublicKey, ixs };
1749
2965
  }
1750
2966
  async create(data, extParams) {
1751
- const { ixs, distributorPublicKey } = await this.prepareCreateInstructions(data, extParams);
2967
+ const invoker = extParams.invoker.publicKey;
2968
+ invariant(invoker, "Invoker's PublicKey is not available, check passed wallet adapter!");
2969
+ const executionParams = this.unwrapExecutionParams(extParams);
2970
+ const { ixs, distributorPublicKey } = await createAndEstimateTransaction(
2971
+ (params) => this.prepareCreateInstructions(data, params),
2972
+ executionParams,
2973
+ (q) => q.ixs
2974
+ );
1752
2975
  const { tx, hash, context } = await prepareTransaction(this.connection, ixs, extParams.invoker.publicKey);
1753
2976
  const signature = await wrappedSignAndExecuteTransaction(
1754
2977
  this.connection,
@@ -1759,7 +2982,7 @@ var BaseDistributorClient = class {
1759
2982
  context,
1760
2983
  commitment: this.getCommitment()
1761
2984
  },
1762
- { sendThrottler: this.sendThrottler }
2985
+ { sendThrottler: this.sendThrottler, skipSimulation: executionParams.skipSimulation }
1763
2986
  );
1764
2987
  return {
1765
2988
  ixs,
@@ -1767,23 +2990,29 @@ var BaseDistributorClient = class {
1767
2990
  metadataId: distributorPublicKey.toBase58()
1768
2991
  };
1769
2992
  }
1770
- async claim(data, extParams) {
1771
- const ixs = await this.prepareClaimInstructions(data, extParams);
1772
- const { tx, hash, context } = await prepareTransaction(this.connection, ixs, extParams.invoker.publicKey);
2993
+ async claim(data, extParams, _serviceTransfer) {
2994
+ const executionParams = this.unwrapExecutionParams(extParams);
2995
+ const invoker = executionParams.invoker.publicKey;
2996
+ invariant(invoker, "Invoker's PublicKey is not available, check passed wallet adapter!");
2997
+ const ixs = await createAndEstimateTransaction(
2998
+ (params) => this.prepareClaimInstructions(data, params, _serviceTransfer),
2999
+ executionParams
3000
+ );
3001
+ const { tx, hash, context } = await prepareTransaction(this.connection, ixs, invoker);
1773
3002
  const signature = await wrappedSignAndExecuteTransaction(
1774
3003
  this.connection,
1775
- extParams.invoker,
3004
+ executionParams.invoker,
1776
3005
  tx,
1777
3006
  {
1778
3007
  hash,
1779
3008
  context,
1780
3009
  commitment: this.getCommitment()
1781
3010
  },
1782
- { sendThrottler: this.sendThrottler }
3011
+ { sendThrottler: this.sendThrottler, skipSimulation: executionParams.skipSimulation }
1783
3012
  );
1784
3013
  return { ixs, txId: signature };
1785
3014
  }
1786
- async prepareClaimInstructions(data, extParams) {
3015
+ async prepareClaimInstructions(data, extParams, _serviceTransfer) {
1787
3016
  if (!extParams.invoker.publicKey) {
1788
3017
  throw new Error("Invoker's PublicKey is not available, check passed wallet adapter!");
1789
3018
  }
@@ -1810,7 +3039,7 @@ var BaseDistributorClient = class {
1810
3039
  extParams.invoker.publicKey
1811
3040
  );
1812
3041
  const eventAuthorityPublicKey = getEventAuthorityPda(this.programId);
1813
- const claimStatus = await ClaimStatus.fetch(this.connection, claimStatusPublicKey);
3042
+ const claimStatus = await this.getClaim(claimStatusPublicKey);
1814
3043
  const accounts = {
1815
3044
  distributor: distributorPublicKey,
1816
3045
  claimStatus: claimStatusPublicKey,
@@ -1825,32 +3054,43 @@ var BaseDistributorClient = class {
1825
3054
  };
1826
3055
  if (!claimStatus) {
1827
3056
  const args = {
1828
- amountLocked: new BN6(data.amountLocked),
1829
- amountUnlocked: new BN6(data.amountUnlocked),
3057
+ amountLocked: new BN5(data.amountLocked),
3058
+ amountUnlocked: new BN5(data.amountUnlocked),
1830
3059
  proof: data.proof
1831
3060
  };
1832
3061
  ixs.push(newClaim(args, accounts, this.programId));
1833
3062
  }
1834
- const nowTs = new BN6(Math.floor(Date.now() / 1e3));
1835
- if (claimStatus || new BN6(data.amountLocked).gtn(0) && nowTs.sub(distributor.startTs).gte(distributor.unlockPeriod)) {
3063
+ const nowTs = new BN5(Math.floor(Date.now() / 1e3));
3064
+ if (claimStatus || new BN5(data.amountLocked).gtn(0) && nowTs.sub(distributor.startTs).gte(distributor.unlockPeriod)) {
1836
3065
  ixs.push(claimLocked(accounts, this.programId));
1837
3066
  }
1838
- ixs.push(this.prepareClaimFeeInstruction(extParams.invoker.publicKey));
3067
+ ixs.push(
3068
+ this.prepareClaimFeeInstruction(
3069
+ extParams.invoker.publicKey,
3070
+ typeof _serviceTransfer === "bigint" ? _serviceTransfer : void 0
3071
+ )
3072
+ );
1839
3073
  return ixs;
1840
3074
  }
1841
3075
  async closeClaim(data, extParams) {
1842
- const ixs = await this.prepareCloseClaimInstructions(data, extParams);
1843
- const { tx, hash, context } = await prepareTransaction(this.connection, ixs, extParams.invoker.publicKey);
3076
+ const executionParams = this.unwrapExecutionParams(extParams);
3077
+ const invoker = executionParams.invoker.publicKey;
3078
+ invariant(invoker, "Invoker's PublicKey is not available, check passed wallet adapter!");
3079
+ const ixs = await createAndEstimateTransaction(
3080
+ (params) => this.prepareCloseClaimInstructions(data, params),
3081
+ executionParams
3082
+ );
3083
+ const { tx, hash, context } = await prepareTransaction(this.connection, ixs, invoker);
1844
3084
  const signature = await wrappedSignAndExecuteTransaction(
1845
3085
  this.connection,
1846
- extParams.invoker,
3086
+ executionParams.invoker,
1847
3087
  tx,
1848
3088
  {
1849
3089
  hash,
1850
3090
  context,
1851
3091
  commitment: this.getCommitment()
1852
3092
  },
1853
- { sendThrottler: this.sendThrottler }
3093
+ { sendThrottler: this.sendThrottler, skipSimulation: executionParams.skipSimulation }
1854
3094
  );
1855
3095
  return { ixs, txId: signature };
1856
3096
  }
@@ -1877,8 +3117,8 @@ var BaseDistributorClient = class {
1877
3117
  program: this.programId
1878
3118
  };
1879
3119
  const closeClaimArgs = {
1880
- amountLocked: data.amountLocked ? new BN6(data.amountLocked) : void 0,
1881
- amountUnlocked: data.amountUnlocked ? new BN6(data.amountUnlocked) : void 0,
3120
+ amountLocked: data.amountLocked ? new BN5(data.amountLocked) : void 0,
3121
+ amountUnlocked: data.amountUnlocked ? new BN5(data.amountUnlocked) : void 0,
1882
3122
  proof: data.proof
1883
3123
  };
1884
3124
  ixs.push(closeClaim(closeClaimArgs, closeClaimAccounts, this.programId));
@@ -1918,26 +3158,37 @@ var BaseDistributorClient = class {
1918
3158
  return ixs;
1919
3159
  }
1920
3160
  async clawback(data, extParams) {
1921
- const ixs = await this.prepareClawbackInstructions(data, extParams);
1922
- const { tx, hash, context } = await prepareTransaction(this.connection, ixs, extParams.invoker.publicKey);
3161
+ const executionParams = this.unwrapExecutionParams(extParams);
3162
+ const invoker = executionParams.invoker.publicKey;
3163
+ invariant(invoker, "Invoker's PublicKey is not available, check passed wallet adapter!");
3164
+ const ixs = await createAndEstimateTransaction(
3165
+ (params) => this.prepareClawbackInstructions(data, params),
3166
+ executionParams
3167
+ );
3168
+ const { tx, hash, context } = await prepareTransaction(this.connection, ixs, invoker);
1923
3169
  const signature = await wrappedSignAndExecuteTransaction(
1924
3170
  this.connection,
1925
- extParams.invoker,
3171
+ executionParams.invoker,
1926
3172
  tx,
1927
3173
  {
1928
3174
  hash,
1929
3175
  context,
1930
3176
  commitment: this.getCommitment()
1931
3177
  },
1932
- { sendThrottler: this.sendThrottler }
3178
+ { sendThrottler: this.sendThrottler, skipSimulation: executionParams.skipSimulation }
1933
3179
  );
1934
3180
  return { ixs, txId: signature };
1935
3181
  }
3182
+ async getClaim(claimStatus) {
3183
+ return this.connection.getAccountInfo(pk(claimStatus)).then((account) => this.decodeClaimStatus(account));
3184
+ }
1936
3185
  async getClaims(data) {
1937
3186
  const claimStatusPublicKeys = data.map(({ id, recipient }) => {
1938
3187
  return getClaimantStatusPda(this.programId, new PublicKey(id), new PublicKey(recipient));
1939
3188
  });
1940
- return ClaimStatus.fetchMultiple(this.connection, claimStatusPublicKeys, this.programId);
3189
+ return this.connection.getMultipleAccountsInfo(claimStatusPublicKeys).then((accounts) => {
3190
+ return accounts.map((account) => this.decodeClaimStatus(account));
3191
+ });
1941
3192
  }
1942
3193
  async getDistributors(data) {
1943
3194
  const distributorPublicKeys = data.ids.map((distributorId) => new PublicKey(distributorId));
@@ -1967,28 +3218,28 @@ var BaseDistributorClient = class {
1967
3218
  account: MerkleDistributor.decode(account.data)
1968
3219
  }));
1969
3220
  }
1970
- prepareClaimFeeInstruction(payer) {
3221
+ prepareClaimFeeInstruction(payer, fee = AIRDROP_CLAIM_FEE) {
1971
3222
  return SystemProgram.transfer({
1972
3223
  fromPubkey: payer,
1973
3224
  toPubkey: STREAMFLOW_TREASURY_PUBLIC_KEY,
1974
- lamports: AIRDROP_CLAIM_FEE
3225
+ lamports: fee
1975
3226
  });
1976
3227
  }
1977
3228
  getNewDistributorArgs(data) {
1978
3229
  const args = {
1979
- version: new BN6(data.version),
3230
+ version: new BN5(data.version),
1980
3231
  root: data.root,
1981
- maxTotalClaim: new BN6(data.maxTotalClaim),
1982
- maxNumNodes: new BN6(data.maxNumNodes),
1983
- unlockPeriod: new BN6(data.unlockPeriod),
1984
- startVestingTs: new BN6(data.startVestingTs),
1985
- endVestingTs: new BN6(data.endVestingTs),
1986
- clawbackStartTs: new BN6(data.clawbackStartTs),
3232
+ maxTotalClaim: new BN5(data.maxTotalClaim),
3233
+ maxNumNodes: new BN5(data.maxNumNodes),
3234
+ unlockPeriod: new BN5(data.unlockPeriod),
3235
+ startVestingTs: new BN5(data.startVestingTs),
3236
+ endVestingTs: new BN5(data.endVestingTs),
3237
+ clawbackStartTs: new BN5(data.clawbackStartTs),
1987
3238
  claimsClosableByAdmin: data.claimsClosableByAdmin,
1988
3239
  claimsClosableByClaimant: data.claimsClosableByClaimant,
1989
3240
  claimsLimit: data.claimsLimit
1990
3241
  };
1991
- const nowTs = new BN6(Math.floor(Date.now() / 1e3));
3242
+ const nowTs = new BN5(Math.floor(Date.now() / 1e3));
1992
3243
  const endVestingTs = args.endVestingTs.isZero() ? nowTs : args.endVestingTs;
1993
3244
  const startVestingTs = args.startVestingTs.isZero() ? nowTs : args.startVestingTs;
1994
3245
  if (endVestingTs.gt(startVestingTs) && endVestingTs.sub(startVestingTs).lt(args.unlockPeriod)) {
@@ -1996,7 +3247,34 @@ var BaseDistributorClient = class {
1996
3247
  }
1997
3248
  return args;
1998
3249
  }
3250
+ unwrapExecutionParams(extParams) {
3251
+ return unwrapExecutionParams(extParams, this.connection);
3252
+ }
3253
+ decodeClaimStatus(account) {
3254
+ if (!account) {
3255
+ return account;
3256
+ }
3257
+ try {
3258
+ return decode(this.merkleDistributorProgram, "claimStatus", account.data);
3259
+ } catch (baseClaimStatusError) {
3260
+ try {
3261
+ return decode(this.merkleDistributorProgram, "compressedClaimStatus", account.data);
3262
+ } catch (compressedClaimStatusError) {
3263
+ throw new Error("Couldn't decode claim status");
3264
+ }
3265
+ }
3266
+ }
1999
3267
  };
3268
+ function decode(program, accountName, accInfo, programKey) {
3269
+ const programId = program.programId?.toBase58() ?? "N/A";
3270
+ invariant(program, `Decoding program with key ${programId} is not available`);
3271
+ const accountEntity = program.idl.accounts?.find((acc) => acc.name === accountName);
3272
+ invariant(
3273
+ !!accountEntity,
3274
+ `Decoding program with key ${programId} doesn't specify account with name ${String(accountName)}`
3275
+ );
3276
+ return program.coder.accounts.decode(accountName, accInfo);
3277
+ }
2000
3278
 
2001
3279
  // solana/clients/SolanaDistributorClient.ts
2002
3280
  var SolanaDistributorClient = class extends BaseDistributorClient {
@@ -2014,7 +3292,7 @@ var aligned_distributor_default = {
2014
3292
  address: "aMERKpFAWoChCi5oZwPvgsSCoGpZKBiU7fi76bdZjt2",
2015
3293
  metadata: {
2016
3294
  name: "aligned_distributor",
2017
- version: "1.3.2",
3295
+ version: "1.5.0",
2018
3296
  spec: "0.1.0",
2019
3297
  description: "Proxy for merkle distributor that updates Vesting duration according to token market performance."
2020
3298
  },
@@ -2158,6 +3436,48 @@ var aligned_distributor_default = {
2158
3436
  }
2159
3437
  ]
2160
3438
  },
3439
+ {
3440
+ name: "migrate_test_oracle",
3441
+ discriminator: [203, 254, 19, 3, 172, 185, 85, 190],
3442
+ accounts: [
3443
+ {
3444
+ name: "payer",
3445
+ writable: true,
3446
+ signer: true
3447
+ },
3448
+ {
3449
+ name: "mint"
3450
+ },
3451
+ {
3452
+ name: "creator"
3453
+ },
3454
+ {
3455
+ name: "test_oracle",
3456
+ writable: true,
3457
+ pda: {
3458
+ seeds: [
3459
+ {
3460
+ kind: "const",
3461
+ value: [116, 101, 115, 116, 45, 111, 114, 97, 99, 108, 101]
3462
+ },
3463
+ {
3464
+ kind: "account",
3465
+ path: "mint"
3466
+ },
3467
+ {
3468
+ kind: "account",
3469
+ path: "creator"
3470
+ }
3471
+ ]
3472
+ }
3473
+ },
3474
+ {
3475
+ name: "system_program",
3476
+ address: "11111111111111111111111111111111"
3477
+ }
3478
+ ],
3479
+ args: []
3480
+ },
2161
3481
  {
2162
3482
  name: "new_distributor",
2163
3483
  discriminator: [32, 139, 112, 171, 0, 2, 225, 155],
@@ -2243,6 +3563,48 @@ var aligned_distributor_default = {
2243
3563
  }
2244
3564
  ]
2245
3565
  },
3566
+ {
3567
+ name: "realloc_test_oracle",
3568
+ discriminator: [234, 221, 116, 4, 198, 251, 244, 206],
3569
+ accounts: [
3570
+ {
3571
+ name: "payer",
3572
+ writable: true,
3573
+ signer: true
3574
+ },
3575
+ {
3576
+ name: "mint"
3577
+ },
3578
+ {
3579
+ name: "creator"
3580
+ },
3581
+ {
3582
+ name: "test_oracle",
3583
+ writable: true,
3584
+ pda: {
3585
+ seeds: [
3586
+ {
3587
+ kind: "const",
3588
+ value: [116, 101, 115, 116, 45, 111, 114, 97, 99, 108, 101]
3589
+ },
3590
+ {
3591
+ kind: "account",
3592
+ path: "mint"
3593
+ },
3594
+ {
3595
+ kind: "account",
3596
+ path: "creator"
3597
+ }
3598
+ ]
3599
+ }
3600
+ },
3601
+ {
3602
+ name: "system_program",
3603
+ address: "11111111111111111111111111111111"
3604
+ }
3605
+ ],
3606
+ args: []
3607
+ },
2246
3608
  {
2247
3609
  name: "set_admin",
2248
3610
  discriminator: [251, 163, 0, 52, 91, 194, 187, 92],
@@ -3028,16 +4390,16 @@ var SolanaAlignedDistributorClient = class extends BaseDistributorClient {
3028
4390
  unlockPeriod
3029
4391
  } = data;
3030
4392
  return {
3031
- totalAmountLocked: new BN6(totalAmountLocked),
3032
- totalAmountUnlocked: new BN6(totalAmountUnlocked),
4393
+ totalAmountLocked: new BN5(totalAmountLocked),
4394
+ totalAmountUnlocked: new BN5(totalAmountUnlocked),
3033
4395
  oracleType: !!oracleType ? { [oracleType]: {} } : { none: {} },
3034
4396
  minPrice: getBN(minPrice, ALIGNED_PRECISION_FACTOR_POW),
3035
4397
  maxPrice: getBN(maxPrice, ALIGNED_PRECISION_FACTOR_POW),
3036
4398
  minPercentage: getBN(minPercentage, ALIGNED_PRECISION_FACTOR_POW),
3037
4399
  maxPercentage: getBN(maxPercentage, ALIGNED_PRECISION_FACTOR_POW),
3038
- tickSize: new BN6(tickSize || 1),
4400
+ tickSize: new BN5(tickSize || 1),
3039
4401
  skipInitial: skipInitial ?? false,
3040
- updatePeriod: unlockPeriod < 30 ? new BN6(30) : new BN6(unlockPeriod)
4402
+ updatePeriod: unlockPeriod < 30 ? new BN5(30) : new BN5(unlockPeriod)
3041
4403
  };
3042
4404
  }
3043
4405
  };