@streamflow/distributor 8.0.1-alpha.p287.54fe41f → 8.0.1

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