@morpho-org/midnight-sdk 1.8.0 → 2.1.0-next.0

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/lib/cjs/abis.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.rateRatifierV1Abi = exports.priceRatifierV1Abi = exports.setterRatifierAbi = exports.ecrecoverRatifierAbi = exports.midnightBundlesAbi = exports.midnightAbi = void 0;
3
+ exports.blueBuyCallbackFactoryAbi = exports.midnightBundlesV2Abi = exports.rateRatifierV1Abi = exports.priceRatifierV1Abi = exports.setterRatifierAbi = exports.ecrecoverRatifierAbi = exports.midnightAbi = void 0;
4
4
  /**
5
5
  * Pinned ABI JSON for the core Midnight contract.
6
6
  *
@@ -2505,2304 +2505,2829 @@ exports.midnightAbi = [
2505
2505
  },
2506
2506
  ];
2507
2507
  /**
2508
- * ABI JSON for the Midnight Bundles periphery used by app-compatible taker and repay flows.
2508
+ * Pinned ABI JSON for the EcrecoverRatifier.
2509
2509
  *
2510
- * Source: `morpho-org/bundles` commit `34a12c68c2e638ae872f525a8226dbc92ccd1a30`,
2511
- * `src/midnight/interfaces/IMidnightBundlesV1.sol`, adapted to the current
2512
- * `morpho-org/midnight` `Market` and `Offer` struct fields exported by this package.
2510
+ * Source: `morpho-org/midnight` commit `336b924a2bb378d810ef6d35b6dd3486759af8bd`,
2511
+ * `src/ratifiers/interfaces/IEcrecoverRatifier.sol`, Forge artifact `out/IEcrecoverRatifier.sol/IEcrecoverRatifier.json`.
2513
2512
  *
2514
2513
  * @example
2515
2514
  * ```ts
2516
- * import { midnightBundlesAbi } from "@morpho-org/midnight-sdk";
2515
+ * import { ecrecoverRatifierAbi } from "@morpho-org/midnight-sdk";
2517
2516
  *
2518
- * console.log(midnightBundlesAbi.length);
2517
+ * console.log(ecrecoverRatifierAbi.length);
2519
2518
  * ```
2520
2519
  */
2521
- exports.midnightBundlesAbi = [
2522
- {
2523
- inputs: [],
2524
- name: "ContinuousFeeAboveMax",
2525
- type: "error",
2526
- },
2527
- {
2528
- inputs: [],
2529
- name: "DeadlinePassed",
2530
- type: "error",
2531
- },
2532
- {
2533
- inputs: [],
2534
- name: "InconsistentMarket",
2535
- type: "error",
2536
- },
2537
- {
2538
- inputs: [],
2539
- name: "InconsistentSide",
2540
- type: "error",
2541
- },
2542
- {
2543
- inputs: [],
2544
- name: "NotReduceOnly",
2545
- type: "error",
2546
- },
2547
- {
2548
- inputs: [],
2549
- name: "OutOfOffers",
2550
- type: "error",
2551
- },
2552
- {
2553
- inputs: [],
2554
- name: "PctExceeded",
2555
- type: "error",
2556
- },
2557
- {
2558
- inputs: [],
2559
- name: "SellerAssetsTooLow",
2560
- type: "error",
2561
- },
2562
- {
2563
- inputs: [],
2564
- name: "Unauthorized",
2565
- type: "error",
2566
- },
2567
- {
2568
- inputs: [],
2569
- name: "UnitsTooHigh",
2570
- type: "error",
2571
- },
2572
- {
2573
- inputs: [],
2574
- name: "UnitsTooLow",
2575
- type: "error",
2576
- },
2520
+ exports.ecrecoverRatifierAbi = [
2577
2521
  {
2578
- inputs: [],
2522
+ type: "function",
2579
2523
  name: "MIDNIGHT",
2524
+ inputs: [],
2580
2525
  outputs: [
2581
2526
  {
2582
- internalType: "address",
2583
2527
  name: "",
2584
2528
  type: "address",
2529
+ internalType: "address",
2585
2530
  },
2586
2531
  ],
2587
2532
  stateMutability: "view",
2588
- type: "function",
2589
2533
  },
2590
2534
  {
2535
+ type: "function",
2536
+ name: "cancelRoot",
2591
2537
  inputs: [
2592
2538
  {
2593
- internalType: "uint256",
2594
- name: "targetBuyerAssets",
2595
- type: "uint256",
2596
- },
2597
- {
2598
- internalType: "uint256",
2599
- name: "minUnits",
2600
- type: "uint256",
2601
- },
2602
- {
2603
- internalType: "address",
2604
- name: "taker",
2539
+ name: "maker",
2605
2540
  type: "address",
2541
+ internalType: "address",
2606
2542
  },
2607
2543
  {
2608
- internalType: "bool",
2609
- name: "reduceOnly",
2610
- type: "bool",
2544
+ name: "root",
2545
+ type: "bytes32",
2546
+ internalType: "bytes32",
2611
2547
  },
2548
+ ],
2549
+ outputs: [],
2550
+ stateMutability: "nonpayable",
2551
+ },
2552
+ {
2553
+ type: "function",
2554
+ name: "isRatified",
2555
+ inputs: [
2612
2556
  {
2613
- components: [
2614
- {
2615
- internalType: "enum PermitKind",
2616
- name: "kind",
2617
- type: "uint8",
2618
- },
2619
- {
2620
- internalType: "bytes",
2621
- name: "data",
2622
- type: "bytes",
2623
- },
2624
- ],
2625
- internalType: "struct TokenPermit",
2626
- name: "loanTokenPermit",
2557
+ name: "offer",
2627
2558
  type: "tuple",
2628
- },
2629
- {
2559
+ internalType: "struct Offer",
2630
2560
  components: [
2631
2561
  {
2562
+ name: "market",
2563
+ type: "tuple",
2564
+ internalType: "struct Market",
2632
2565
  components: [
2633
2566
  {
2567
+ name: "chainId",
2568
+ type: "uint256",
2569
+ internalType: "uint256",
2570
+ },
2571
+ {
2572
+ name: "midnight",
2573
+ type: "address",
2574
+ internalType: "address",
2575
+ },
2576
+ {
2577
+ name: "loanToken",
2578
+ type: "address",
2579
+ internalType: "address",
2580
+ },
2581
+ {
2582
+ name: "collateralParams",
2583
+ type: "tuple[]",
2584
+ internalType: "struct CollateralParams[]",
2634
2585
  components: [
2635
2586
  {
2636
- internalType: "uint256",
2637
- name: "chainId",
2638
- type: "uint256",
2639
- },
2640
- {
2641
- internalType: "address",
2642
- name: "midnight",
2587
+ name: "token",
2643
2588
  type: "address",
2644
- },
2645
- {
2646
2589
  internalType: "address",
2647
- name: "loanToken",
2648
- type: "address",
2649
- },
2650
- {
2651
- components: [
2652
- {
2653
- internalType: "address",
2654
- name: "token",
2655
- type: "address",
2656
- },
2657
- {
2658
- internalType: "uint256",
2659
- name: "lltv",
2660
- type: "uint256",
2661
- },
2662
- {
2663
- internalType: "uint256",
2664
- name: "liquidationCursor",
2665
- type: "uint256",
2666
- },
2667
- {
2668
- internalType: "address",
2669
- name: "oracle",
2670
- type: "address",
2671
- },
2672
- ],
2673
- internalType: "struct CollateralParams[]",
2674
- name: "collateralParams",
2675
- type: "tuple[]",
2676
2590
  },
2677
2591
  {
2678
- internalType: "uint256",
2679
- name: "maturity",
2592
+ name: "lltv",
2680
2593
  type: "uint256",
2594
+ internalType: "uint256",
2681
2595
  },
2682
2596
  {
2683
- internalType: "uint256",
2684
- name: "rcfThreshold",
2597
+ name: "liquidationCursor",
2685
2598
  type: "uint256",
2599
+ internalType: "uint256",
2686
2600
  },
2687
2601
  {
2688
- internalType: "address",
2689
- name: "enterGate",
2602
+ name: "oracle",
2690
2603
  type: "address",
2691
- },
2692
- {
2693
2604
  internalType: "address",
2694
- name: "liquidatorGate",
2695
- type: "address",
2696
2605
  },
2697
2606
  ],
2698
- internalType: "struct Market",
2699
- name: "market",
2700
- type: "tuple",
2701
- },
2702
- {
2703
- internalType: "bool",
2704
- name: "buy",
2705
- type: "bool",
2706
2607
  },
2707
2608
  {
2708
- internalType: "address",
2709
- name: "maker",
2710
- type: "address",
2711
- },
2712
- {
2713
- internalType: "uint256",
2714
- name: "start",
2609
+ name: "maturity",
2715
2610
  type: "uint256",
2716
- },
2717
- {
2718
2611
  internalType: "uint256",
2719
- name: "expiry",
2720
- type: "uint256",
2721
2612
  },
2722
2613
  {
2723
- internalType: "uint256",
2724
- name: "tick",
2614
+ name: "rcfThreshold",
2725
2615
  type: "uint256",
2616
+ internalType: "uint256",
2726
2617
  },
2727
2618
  {
2728
- internalType: "bytes32",
2729
- name: "group",
2730
- type: "bytes32",
2731
- },
2732
- {
2733
- internalType: "address",
2734
- name: "callback",
2619
+ name: "enterGate",
2735
2620
  type: "address",
2736
- },
2737
- {
2738
- internalType: "bytes",
2739
- name: "callbackData",
2740
- type: "bytes",
2741
- },
2742
- {
2743
2621
  internalType: "address",
2744
- name: "receiverIfMakerIsSeller",
2745
- type: "address",
2746
2622
  },
2747
2623
  {
2748
- internalType: "address",
2749
- name: "ratifier",
2624
+ name: "liquidatorGate",
2750
2625
  type: "address",
2751
- },
2752
- {
2753
- internalType: "bool",
2754
- name: "reduceOnly",
2755
- type: "bool",
2756
- },
2757
- {
2758
- internalType: "uint128",
2759
- name: "maxUnits",
2760
- type: "uint128",
2761
- },
2762
- {
2763
- internalType: "uint128",
2764
- name: "maxAssets",
2765
- type: "uint128",
2766
- },
2767
- {
2768
- internalType: "uint256",
2769
- name: "continuousFeeCap",
2770
- type: "uint256",
2626
+ internalType: "address",
2771
2627
  },
2772
2628
  ],
2773
- internalType: "struct Offer",
2774
- name: "offer",
2775
- type: "tuple",
2776
2629
  },
2777
2630
  {
2778
- internalType: "bytes",
2779
- name: "ratifierData",
2780
- type: "bytes",
2781
- },
2631
+ name: "buy",
2632
+ type: "bool",
2633
+ internalType: "bool",
2634
+ },
2782
2635
  {
2783
- internalType: "uint256",
2784
- name: "units",
2785
- type: "uint256",
2636
+ name: "maker",
2637
+ type: "address",
2638
+ internalType: "address",
2786
2639
  },
2787
- ],
2788
- internalType: "struct OfferFill[]",
2789
- name: "offerFills",
2790
- type: "tuple[]",
2791
- },
2792
- {
2793
- components: [
2794
2640
  {
2641
+ name: "start",
2642
+ type: "uint256",
2795
2643
  internalType: "uint256",
2796
- name: "collateralIndex",
2644
+ },
2645
+ {
2646
+ name: "expiry",
2797
2647
  type: "uint256",
2648
+ internalType: "uint256",
2798
2649
  },
2799
2650
  {
2651
+ name: "tick",
2652
+ type: "uint256",
2800
2653
  internalType: "uint256",
2801
- name: "assets",
2654
+ },
2655
+ {
2656
+ name: "group",
2657
+ type: "bytes32",
2658
+ internalType: "bytes32",
2659
+ },
2660
+ {
2661
+ name: "callback",
2662
+ type: "address",
2663
+ internalType: "address",
2664
+ },
2665
+ {
2666
+ name: "callbackData",
2667
+ type: "bytes",
2668
+ internalType: "bytes",
2669
+ },
2670
+ {
2671
+ name: "receiverIfMakerIsSeller",
2672
+ type: "address",
2673
+ internalType: "address",
2674
+ },
2675
+ {
2676
+ name: "ratifier",
2677
+ type: "address",
2678
+ internalType: "address",
2679
+ },
2680
+ {
2681
+ name: "reduceOnly",
2682
+ type: "bool",
2683
+ internalType: "bool",
2684
+ },
2685
+ {
2686
+ name: "maxUnits",
2687
+ type: "uint128",
2688
+ internalType: "uint128",
2689
+ },
2690
+ {
2691
+ name: "maxAssets",
2692
+ type: "uint128",
2693
+ internalType: "uint128",
2694
+ },
2695
+ {
2696
+ name: "continuousFeeCap",
2802
2697
  type: "uint256",
2698
+ internalType: "uint256",
2803
2699
  },
2804
2700
  ],
2805
- internalType: "struct CollateralWithdrawal[]",
2806
- name: "collateralWithdrawals",
2807
- type: "tuple[]",
2808
2701
  },
2809
2702
  {
2810
- internalType: "address",
2811
- name: "collateralReceiver",
2703
+ name: "ratifierData",
2704
+ type: "bytes",
2705
+ internalType: "bytes",
2706
+ },
2707
+ {
2708
+ name: "taker",
2812
2709
  type: "address",
2710
+ internalType: "address",
2813
2711
  },
2712
+ ],
2713
+ outputs: [
2814
2714
  {
2815
- internalType: "uint256",
2816
- name: "referralFeePct",
2817
- type: "uint256",
2715
+ name: "",
2716
+ type: "bytes32",
2717
+ internalType: "bytes32",
2818
2718
  },
2719
+ ],
2720
+ stateMutability: "view",
2721
+ },
2722
+ {
2723
+ type: "function",
2724
+ name: "isRootCanceled",
2725
+ inputs: [
2819
2726
  {
2820
- internalType: "address",
2821
- name: "referralFeeRecipient",
2727
+ name: "maker",
2822
2728
  type: "address",
2729
+ internalType: "address",
2823
2730
  },
2824
2731
  {
2825
- internalType: "uint256",
2826
- name: "maxContinuousFee",
2827
- type: "uint256",
2732
+ name: "root",
2733
+ type: "bytes32",
2734
+ internalType: "bytes32",
2828
2735
  },
2736
+ ],
2737
+ outputs: [
2829
2738
  {
2830
- internalType: "uint256",
2831
- name: "deadline",
2832
- type: "uint256",
2739
+ name: "",
2740
+ type: "bool",
2741
+ internalType: "bool",
2833
2742
  },
2834
2743
  ],
2835
- name: "midnightBundlesV1BuyWithAssetsTargetAndWithdrawCollateral",
2836
- outputs: [],
2837
- stateMutability: "nonpayable",
2838
- type: "function",
2744
+ stateMutability: "view",
2839
2745
  },
2840
2746
  {
2747
+ type: "event",
2748
+ name: "CancelRoot",
2841
2749
  inputs: [
2842
2750
  {
2843
- internalType: "uint256",
2844
- name: "targetUnits",
2845
- type: "uint256",
2846
- },
2847
- {
2848
- internalType: "uint256",
2849
- name: "maxBuyerAssets",
2850
- type: "uint256",
2751
+ name: "caller",
2752
+ type: "address",
2753
+ indexed: true,
2754
+ internalType: "address",
2851
2755
  },
2852
2756
  {
2853
- internalType: "address",
2854
- name: "taker",
2757
+ name: "maker",
2855
2758
  type: "address",
2759
+ indexed: true,
2760
+ internalType: "address",
2856
2761
  },
2857
2762
  {
2858
- internalType: "bool",
2859
- name: "reduceOnly",
2860
- type: "bool",
2763
+ name: "root",
2764
+ type: "bytes32",
2765
+ indexed: true,
2766
+ internalType: "bytes32",
2861
2767
  },
2768
+ ],
2769
+ anonymous: false,
2770
+ },
2771
+ {
2772
+ type: "error",
2773
+ name: "InvalidProof",
2774
+ inputs: [],
2775
+ },
2776
+ {
2777
+ type: "error",
2778
+ name: "InvalidSignature",
2779
+ inputs: [],
2780
+ },
2781
+ {
2782
+ type: "error",
2783
+ name: "RootCanceled",
2784
+ inputs: [],
2785
+ },
2786
+ {
2787
+ type: "error",
2788
+ name: "Unauthorized",
2789
+ inputs: [],
2790
+ },
2791
+ ];
2792
+ /**
2793
+ * Pinned ABI JSON for the SetterRatifier.
2794
+ *
2795
+ * Source: `morpho-org/midnight` commit `336b924a2bb378d810ef6d35b6dd3486759af8bd`,
2796
+ * `src/ratifiers/interfaces/ISetterRatifier.sol`, Forge artifact `out/ISetterRatifier.sol/ISetterRatifier.json`.
2797
+ *
2798
+ * @example
2799
+ * ```ts
2800
+ * import { setterRatifierAbi } from "@morpho-org/midnight-sdk";
2801
+ *
2802
+ * console.log(setterRatifierAbi.length);
2803
+ * ```
2804
+ */
2805
+ exports.setterRatifierAbi = [
2806
+ {
2807
+ type: "function",
2808
+ name: "MIDNIGHT",
2809
+ inputs: [],
2810
+ outputs: [
2862
2811
  {
2863
- components: [
2864
- {
2865
- internalType: "enum PermitKind",
2866
- name: "kind",
2867
- type: "uint8",
2868
- },
2869
- {
2870
- internalType: "bytes",
2871
- name: "data",
2872
- type: "bytes",
2873
- },
2874
- ],
2875
- internalType: "struct TokenPermit",
2876
- name: "loanTokenPermit",
2877
- type: "tuple",
2812
+ name: "",
2813
+ type: "address",
2814
+ internalType: "address",
2878
2815
  },
2816
+ ],
2817
+ stateMutability: "view",
2818
+ },
2819
+ {
2820
+ type: "function",
2821
+ name: "isRatified",
2822
+ inputs: [
2879
2823
  {
2824
+ name: "offer",
2825
+ type: "tuple",
2826
+ internalType: "struct Offer",
2880
2827
  components: [
2881
2828
  {
2829
+ name: "market",
2830
+ type: "tuple",
2831
+ internalType: "struct Market",
2882
2832
  components: [
2883
2833
  {
2834
+ name: "chainId",
2835
+ type: "uint256",
2836
+ internalType: "uint256",
2837
+ },
2838
+ {
2839
+ name: "midnight",
2840
+ type: "address",
2841
+ internalType: "address",
2842
+ },
2843
+ {
2844
+ name: "loanToken",
2845
+ type: "address",
2846
+ internalType: "address",
2847
+ },
2848
+ {
2849
+ name: "collateralParams",
2850
+ type: "tuple[]",
2851
+ internalType: "struct CollateralParams[]",
2884
2852
  components: [
2885
2853
  {
2886
- internalType: "uint256",
2887
- name: "chainId",
2854
+ name: "token",
2855
+ type: "address",
2856
+ internalType: "address",
2857
+ },
2858
+ {
2859
+ name: "lltv",
2888
2860
  type: "uint256",
2861
+ internalType: "uint256",
2889
2862
  },
2890
2863
  {
2891
- internalType: "address",
2892
- name: "midnight",
2893
- type: "address",
2864
+ name: "liquidationCursor",
2865
+ type: "uint256",
2866
+ internalType: "uint256",
2894
2867
  },
2895
2868
  {
2896
- internalType: "address",
2897
- name: "loanToken",
2898
- type: "address",
2899
- },
2900
- {
2901
- components: [
2902
- {
2903
- internalType: "address",
2904
- name: "token",
2905
- type: "address",
2906
- },
2907
- {
2908
- internalType: "uint256",
2909
- name: "lltv",
2910
- type: "uint256",
2911
- },
2912
- {
2913
- internalType: "uint256",
2914
- name: "liquidationCursor",
2915
- type: "uint256",
2916
- },
2917
- {
2918
- internalType: "address",
2919
- name: "oracle",
2920
- type: "address",
2921
- },
2922
- ],
2923
- internalType: "struct CollateralParams[]",
2924
- name: "collateralParams",
2925
- type: "tuple[]",
2926
- },
2927
- {
2928
- internalType: "uint256",
2929
- name: "maturity",
2930
- type: "uint256",
2931
- },
2932
- {
2933
- internalType: "uint256",
2934
- name: "rcfThreshold",
2935
- type: "uint256",
2936
- },
2937
- {
2938
- internalType: "address",
2939
- name: "enterGate",
2940
- type: "address",
2941
- },
2942
- {
2943
- internalType: "address",
2944
- name: "liquidatorGate",
2869
+ name: "oracle",
2945
2870
  type: "address",
2871
+ internalType: "address",
2946
2872
  },
2947
2873
  ],
2948
- internalType: "struct Market",
2949
- name: "market",
2950
- type: "tuple",
2951
- },
2952
- {
2953
- internalType: "bool",
2954
- name: "buy",
2955
- type: "bool",
2956
- },
2957
- {
2958
- internalType: "address",
2959
- name: "maker",
2960
- type: "address",
2961
2874
  },
2962
2875
  {
2963
- internalType: "uint256",
2964
- name: "start",
2876
+ name: "maturity",
2965
2877
  type: "uint256",
2966
- },
2967
- {
2968
2878
  internalType: "uint256",
2969
- name: "expiry",
2970
- type: "uint256",
2971
2879
  },
2972
2880
  {
2973
- internalType: "uint256",
2974
- name: "tick",
2881
+ name: "rcfThreshold",
2975
2882
  type: "uint256",
2883
+ internalType: "uint256",
2976
2884
  },
2977
2885
  {
2978
- internalType: "bytes32",
2979
- name: "group",
2980
- type: "bytes32",
2981
- },
2982
- {
2983
- internalType: "address",
2984
- name: "callback",
2886
+ name: "enterGate",
2985
2887
  type: "address",
2986
- },
2987
- {
2988
- internalType: "bytes",
2989
- name: "callbackData",
2990
- type: "bytes",
2991
- },
2992
- {
2993
2888
  internalType: "address",
2994
- name: "receiverIfMakerIsSeller",
2995
- type: "address",
2996
2889
  },
2997
2890
  {
2998
- internalType: "address",
2999
- name: "ratifier",
2891
+ name: "liquidatorGate",
3000
2892
  type: "address",
3001
- },
3002
- {
3003
- internalType: "bool",
3004
- name: "reduceOnly",
3005
- type: "bool",
3006
- },
3007
- {
3008
- internalType: "uint128",
3009
- name: "maxUnits",
3010
- type: "uint128",
3011
- },
3012
- {
3013
- internalType: "uint128",
3014
- name: "maxAssets",
3015
- type: "uint128",
3016
- },
3017
- {
3018
- internalType: "uint256",
3019
- name: "continuousFeeCap",
3020
- type: "uint256",
2893
+ internalType: "address",
3021
2894
  },
3022
2895
  ],
3023
- internalType: "struct Offer",
3024
- name: "offer",
3025
- type: "tuple",
3026
2896
  },
3027
2897
  {
3028
- internalType: "bytes",
3029
- name: "ratifierData",
3030
- type: "bytes",
2898
+ name: "buy",
2899
+ type: "bool",
2900
+ internalType: "bool",
3031
2901
  },
3032
2902
  {
3033
- internalType: "uint256",
3034
- name: "units",
3035
- type: "uint256",
2903
+ name: "maker",
2904
+ type: "address",
2905
+ internalType: "address",
3036
2906
  },
3037
- ],
3038
- internalType: "struct OfferFill[]",
3039
- name: "offerFills",
3040
- type: "tuple[]",
3041
- },
3042
- {
3043
- components: [
3044
2907
  {
2908
+ name: "start",
2909
+ type: "uint256",
3045
2910
  internalType: "uint256",
3046
- name: "collateralIndex",
2911
+ },
2912
+ {
2913
+ name: "expiry",
3047
2914
  type: "uint256",
2915
+ internalType: "uint256",
3048
2916
  },
3049
2917
  {
2918
+ name: "tick",
2919
+ type: "uint256",
3050
2920
  internalType: "uint256",
3051
- name: "assets",
2921
+ },
2922
+ {
2923
+ name: "group",
2924
+ type: "bytes32",
2925
+ internalType: "bytes32",
2926
+ },
2927
+ {
2928
+ name: "callback",
2929
+ type: "address",
2930
+ internalType: "address",
2931
+ },
2932
+ {
2933
+ name: "callbackData",
2934
+ type: "bytes",
2935
+ internalType: "bytes",
2936
+ },
2937
+ {
2938
+ name: "receiverIfMakerIsSeller",
2939
+ type: "address",
2940
+ internalType: "address",
2941
+ },
2942
+ {
2943
+ name: "ratifier",
2944
+ type: "address",
2945
+ internalType: "address",
2946
+ },
2947
+ {
2948
+ name: "reduceOnly",
2949
+ type: "bool",
2950
+ internalType: "bool",
2951
+ },
2952
+ {
2953
+ name: "maxUnits",
2954
+ type: "uint128",
2955
+ internalType: "uint128",
2956
+ },
2957
+ {
2958
+ name: "maxAssets",
2959
+ type: "uint128",
2960
+ internalType: "uint128",
2961
+ },
2962
+ {
2963
+ name: "continuousFeeCap",
3052
2964
  type: "uint256",
2965
+ internalType: "uint256",
3053
2966
  },
3054
2967
  ],
3055
- internalType: "struct CollateralWithdrawal[]",
3056
- name: "collateralWithdrawals",
3057
- type: "tuple[]",
3058
2968
  },
3059
2969
  {
3060
- internalType: "address",
3061
- name: "collateralReceiver",
2970
+ name: "ratifierData",
2971
+ type: "bytes",
2972
+ internalType: "bytes",
2973
+ },
2974
+ {
2975
+ name: "taker",
3062
2976
  type: "address",
2977
+ internalType: "address",
3063
2978
  },
2979
+ ],
2980
+ outputs: [
3064
2981
  {
3065
- internalType: "uint256",
3066
- name: "referralFeePct",
3067
- type: "uint256",
2982
+ name: "",
2983
+ type: "bytes32",
2984
+ internalType: "bytes32",
3068
2985
  },
2986
+ ],
2987
+ stateMutability: "view",
2988
+ },
2989
+ {
2990
+ type: "function",
2991
+ name: "isRootRatified",
2992
+ inputs: [
3069
2993
  {
2994
+ name: "maker",
2995
+ type: "address",
3070
2996
  internalType: "address",
3071
- name: "referralFeeRecipient",
2997
+ },
2998
+ {
2999
+ name: "root",
3000
+ type: "bytes32",
3001
+ internalType: "bytes32",
3002
+ },
3003
+ ],
3004
+ outputs: [
3005
+ {
3006
+ name: "",
3007
+ type: "bool",
3008
+ internalType: "bool",
3009
+ },
3010
+ ],
3011
+ stateMutability: "view",
3012
+ },
3013
+ {
3014
+ type: "function",
3015
+ name: "setIsRootRatified",
3016
+ inputs: [
3017
+ {
3018
+ name: "maker",
3072
3019
  type: "address",
3020
+ internalType: "address",
3073
3021
  },
3074
3022
  {
3075
- internalType: "uint256",
3076
- name: "maxContinuousFee",
3077
- type: "uint256",
3023
+ name: "root",
3024
+ type: "bytes32",
3025
+ internalType: "bytes32",
3078
3026
  },
3079
3027
  {
3080
- internalType: "uint256",
3081
- name: "deadline",
3082
- type: "uint256",
3028
+ name: "newIsRootRatified",
3029
+ type: "bool",
3030
+ internalType: "bool",
3083
3031
  },
3084
3032
  ],
3085
- name: "midnightBundlesV1BuyWithUnitsTargetAndWithdrawCollateral",
3086
3033
  outputs: [],
3087
3034
  stateMutability: "nonpayable",
3088
- type: "function",
3089
3035
  },
3090
3036
  {
3037
+ type: "event",
3038
+ name: "SetIsRootRatified",
3091
3039
  inputs: [
3092
3040
  {
3093
- components: [
3094
- {
3095
- internalType: "uint256",
3096
- name: "chainId",
3097
- type: "uint256",
3098
- },
3099
- {
3041
+ name: "caller",
3042
+ type: "address",
3043
+ indexed: true,
3044
+ internalType: "address",
3045
+ },
3046
+ {
3047
+ name: "maker",
3048
+ type: "address",
3049
+ indexed: true,
3050
+ internalType: "address",
3051
+ },
3052
+ {
3053
+ name: "root",
3054
+ type: "bytes32",
3055
+ indexed: true,
3056
+ internalType: "bytes32",
3057
+ },
3058
+ {
3059
+ name: "newIsRootRatified",
3060
+ type: "bool",
3061
+ indexed: false,
3062
+ internalType: "bool",
3063
+ },
3064
+ ],
3065
+ anonymous: false,
3066
+ },
3067
+ {
3068
+ type: "error",
3069
+ name: "InvalidProof",
3070
+ inputs: [],
3071
+ },
3072
+ {
3073
+ type: "error",
3074
+ name: "NotRatified",
3075
+ inputs: [],
3076
+ },
3077
+ {
3078
+ type: "error",
3079
+ name: "Unauthorized",
3080
+ inputs: [],
3081
+ },
3082
+ ];
3083
+ /**
3084
+ * Pinned ABI JSON for the PriceRatifierV1.
3085
+ *
3086
+ * Source: `morpho-org/midnight` commit `11f3d984b53286fd9137eb89e5d1385e23fe1b30`,
3087
+ * `src/ratifiers/interfaces/IPriceRatifierV1.sol`, Forge artifact `out/IPriceRatifierV1.sol/IPriceRatifierV1.json`.
3088
+ *
3089
+ * @example
3090
+ * ```ts
3091
+ * import { priceRatifierV1Abi } from "@morpho-org/midnight-sdk";
3092
+ *
3093
+ * console.log(priceRatifierV1Abi.length);
3094
+ * ```
3095
+ */
3096
+ exports.priceRatifierV1Abi = [
3097
+ {
3098
+ type: "function",
3099
+ name: "DOMAIN_SEPARATOR",
3100
+ inputs: [],
3101
+ outputs: [{ name: "", type: "bytes32", internalType: "bytes32" }],
3102
+ stateMutability: "view",
3103
+ },
3104
+ {
3105
+ type: "function",
3106
+ name: "MIDNIGHT",
3107
+ inputs: [],
3108
+ outputs: [{ name: "", type: "address", internalType: "address" }],
3109
+ stateMutability: "view",
3110
+ },
3111
+ {
3112
+ type: "function",
3113
+ name: "isRatified",
3114
+ inputs: [
3115
+ {
3116
+ name: "offer",
3117
+ type: "tuple",
3118
+ internalType: "struct Offer",
3119
+ components: [
3120
+ {
3121
+ name: "market",
3122
+ type: "tuple",
3123
+ internalType: "struct Market",
3124
+ components: [
3125
+ { name: "chainId", type: "uint256", internalType: "uint256" },
3126
+ { name: "midnight", type: "address", internalType: "address" },
3127
+ { name: "loanToken", type: "address", internalType: "address" },
3128
+ {
3129
+ name: "collateralParams",
3130
+ type: "tuple[]",
3131
+ internalType: "struct CollateralParams[]",
3132
+ components: [
3133
+ { name: "token", type: "address", internalType: "address" },
3134
+ { name: "lltv", type: "uint256", internalType: "uint256" },
3135
+ {
3136
+ name: "liquidationCursor",
3137
+ type: "uint256",
3138
+ internalType: "uint256",
3139
+ },
3140
+ { name: "oracle", type: "address", internalType: "address" },
3141
+ ],
3142
+ },
3143
+ { name: "maturity", type: "uint256", internalType: "uint256" },
3144
+ {
3145
+ name: "rcfThreshold",
3146
+ type: "uint256",
3147
+ internalType: "uint256",
3148
+ },
3149
+ { name: "enterGate", type: "address", internalType: "address" },
3150
+ {
3151
+ name: "liquidatorGate",
3152
+ type: "address",
3153
+ internalType: "address",
3154
+ },
3155
+ ],
3156
+ },
3157
+ { name: "buy", type: "bool", internalType: "bool" },
3158
+ { name: "maker", type: "address", internalType: "address" },
3159
+ { name: "start", type: "uint256", internalType: "uint256" },
3160
+ { name: "expiry", type: "uint256", internalType: "uint256" },
3161
+ { name: "tick", type: "uint256", internalType: "uint256" },
3162
+ { name: "group", type: "bytes32", internalType: "bytes32" },
3163
+ { name: "callback", type: "address", internalType: "address" },
3164
+ { name: "callbackData", type: "bytes", internalType: "bytes" },
3165
+ {
3166
+ name: "receiverIfMakerIsSeller",
3167
+ type: "address",
3168
+ internalType: "address",
3169
+ },
3170
+ { name: "ratifier", type: "address", internalType: "address" },
3171
+ { name: "reduceOnly", type: "bool", internalType: "bool" },
3172
+ { name: "maxUnits", type: "uint128", internalType: "uint128" },
3173
+ { name: "maxAssets", type: "uint128", internalType: "uint128" },
3174
+ {
3175
+ name: "continuousFeeCap",
3176
+ type: "uint256",
3177
+ internalType: "uint256",
3178
+ },
3179
+ ],
3180
+ },
3181
+ { name: "ratifierData", type: "bytes", internalType: "bytes" },
3182
+ { name: "taker", type: "address", internalType: "address" },
3183
+ ],
3184
+ outputs: [{ name: "", type: "bytes32", internalType: "bytes32" }],
3185
+ stateMutability: "view",
3186
+ },
3187
+ {
3188
+ type: "function",
3189
+ name: "isRootRatified",
3190
+ inputs: [
3191
+ { name: "maker", type: "address", internalType: "address" },
3192
+ { name: "root", type: "bytes32", internalType: "bytes32" },
3193
+ ],
3194
+ outputs: [{ name: "", type: "bool", internalType: "bool" }],
3195
+ stateMutability: "view",
3196
+ },
3197
+ {
3198
+ type: "function",
3199
+ name: "ratification",
3200
+ inputs: [
3201
+ { name: "maker", type: "address", internalType: "address" },
3202
+ { name: "root", type: "bytes32", internalType: "bytes32" },
3203
+ ],
3204
+ outputs: [
3205
+ { name: "isRootRatified", type: "bool", internalType: "bool" },
3206
+ { name: "rootNonce", type: "uint128", internalType: "uint128" },
3207
+ ],
3208
+ stateMutability: "view",
3209
+ },
3210
+ {
3211
+ type: "function",
3212
+ name: "rootNonce",
3213
+ inputs: [
3214
+ { name: "maker", type: "address", internalType: "address" },
3215
+ { name: "root", type: "bytes32", internalType: "bytes32" },
3216
+ ],
3217
+ outputs: [{ name: "", type: "uint128", internalType: "uint128" }],
3218
+ stateMutability: "view",
3219
+ },
3220
+ {
3221
+ type: "function",
3222
+ name: "setIsRootRatified",
3223
+ inputs: [
3224
+ { name: "maker", type: "address", internalType: "address" },
3225
+ { name: "root", type: "bytes32", internalType: "bytes32" },
3226
+ { name: "newIsRootRatified", type: "bool", internalType: "bool" },
3227
+ ],
3228
+ outputs: [{ name: "", type: "bytes32", internalType: "bytes32" }],
3229
+ stateMutability: "nonpayable",
3230
+ },
3231
+ {
3232
+ type: "function",
3233
+ name: "setIsRootRatifiedWithSig",
3234
+ inputs: [
3235
+ { name: "maker", type: "address", internalType: "address" },
3236
+ { name: "root", type: "bytes32", internalType: "bytes32" },
3237
+ { name: "height", type: "uint256", internalType: "uint256" },
3238
+ { name: "newIsRootRatified", type: "bool", internalType: "bool" },
3239
+ { name: "nonce", type: "uint128", internalType: "uint128" },
3240
+ { name: "deadline", type: "uint256", internalType: "uint256" },
3241
+ { name: "v", type: "uint8", internalType: "uint8" },
3242
+ { name: "r", type: "bytes32", internalType: "bytes32" },
3243
+ { name: "s", type: "bytes32", internalType: "bytes32" },
3244
+ ],
3245
+ outputs: [{ name: "", type: "bytes32", internalType: "bytes32" }],
3246
+ stateMutability: "nonpayable",
3247
+ },
3248
+ {
3249
+ type: "event",
3250
+ name: "SetIsRootRatified",
3251
+ inputs: [
3252
+ {
3253
+ name: "caller",
3254
+ type: "address",
3255
+ indexed: true,
3256
+ internalType: "address",
3257
+ },
3258
+ {
3259
+ name: "maker",
3260
+ type: "address",
3261
+ indexed: true,
3262
+ internalType: "address",
3263
+ },
3264
+ { name: "root", type: "bytes32", indexed: true, internalType: "bytes32" },
3265
+ {
3266
+ name: "newIsRootRatified",
3267
+ type: "bool",
3268
+ indexed: false,
3269
+ internalType: "bool",
3270
+ },
3271
+ ],
3272
+ anonymous: false,
3273
+ },
3274
+ {
3275
+ type: "event",
3276
+ name: "SetIsRootRatifiedWithSig",
3277
+ inputs: [
3278
+ {
3279
+ name: "caller",
3280
+ type: "address",
3281
+ indexed: false,
3282
+ internalType: "address",
3283
+ },
3284
+ {
3285
+ name: "signer",
3286
+ type: "address",
3287
+ indexed: true,
3288
+ internalType: "address",
3289
+ },
3290
+ {
3291
+ name: "maker",
3292
+ type: "address",
3293
+ indexed: true,
3294
+ internalType: "address",
3295
+ },
3296
+ { name: "root", type: "bytes32", indexed: true, internalType: "bytes32" },
3297
+ {
3298
+ name: "height",
3299
+ type: "uint256",
3300
+ indexed: false,
3301
+ internalType: "uint256",
3302
+ },
3303
+ {
3304
+ name: "newIsRootRatified",
3305
+ type: "bool",
3306
+ indexed: false,
3307
+ internalType: "bool",
3308
+ },
3309
+ {
3310
+ name: "signatureNonce",
3311
+ type: "uint128",
3312
+ indexed: false,
3313
+ internalType: "uint128",
3314
+ },
3315
+ {
3316
+ name: "previousNonce",
3317
+ type: "uint128",
3318
+ indexed: false,
3319
+ internalType: "uint128",
3320
+ },
3321
+ ],
3322
+ anonymous: false,
3323
+ },
3324
+ { type: "error", name: "DeadlineExpired", inputs: [] },
3325
+ { type: "error", name: "InvalidNonce", inputs: [] },
3326
+ { type: "error", name: "InvalidProof", inputs: [] },
3327
+ { type: "error", name: "InvalidSignature", inputs: [] },
3328
+ { type: "error", name: "NotRatified", inputs: [] },
3329
+ { type: "error", name: "RatifiedStatusChanged", inputs: [] },
3330
+ { type: "error", name: "Unauthorized", inputs: [] },
3331
+ { type: "error", name: "UnauthorizedTaker", inputs: [] },
3332
+ ];
3333
+ /**
3334
+ * Pinned ABI JSON for the RateRatifierV1.
3335
+ *
3336
+ * Source: `morpho-org/midnight` commit `11f3d984b53286fd9137eb89e5d1385e23fe1b30`,
3337
+ * `src/ratifiers/interfaces/IRateRatifierV1.sol`, Forge artifact `out/IRateRatifierV1.sol/IRateRatifierV1.json`.
3338
+ *
3339
+ * @example
3340
+ * ```ts
3341
+ * import { rateRatifierV1Abi } from "@morpho-org/midnight-sdk";
3342
+ *
3343
+ * console.log(rateRatifierV1Abi.length);
3344
+ * ```
3345
+ */
3346
+ exports.rateRatifierV1Abi = [
3347
+ {
3348
+ type: "function",
3349
+ name: "DOMAIN_SEPARATOR",
3350
+ inputs: [],
3351
+ outputs: [{ name: "", type: "bytes32", internalType: "bytes32" }],
3352
+ stateMutability: "view",
3353
+ },
3354
+ {
3355
+ type: "function",
3356
+ name: "MIDNIGHT",
3357
+ inputs: [],
3358
+ outputs: [{ name: "", type: "address", internalType: "address" }],
3359
+ stateMutability: "view",
3360
+ },
3361
+ {
3362
+ type: "function",
3363
+ name: "isRatified",
3364
+ inputs: [
3365
+ {
3366
+ name: "offer",
3367
+ type: "tuple",
3368
+ internalType: "struct Offer",
3369
+ components: [
3370
+ {
3371
+ name: "market",
3372
+ type: "tuple",
3373
+ internalType: "struct Market",
3374
+ components: [
3375
+ { name: "chainId", type: "uint256", internalType: "uint256" },
3376
+ { name: "midnight", type: "address", internalType: "address" },
3377
+ { name: "loanToken", type: "address", internalType: "address" },
3378
+ {
3379
+ name: "collateralParams",
3380
+ type: "tuple[]",
3381
+ internalType: "struct CollateralParams[]",
3382
+ components: [
3383
+ { name: "token", type: "address", internalType: "address" },
3384
+ { name: "lltv", type: "uint256", internalType: "uint256" },
3385
+ {
3386
+ name: "liquidationCursor",
3387
+ type: "uint256",
3388
+ internalType: "uint256",
3389
+ },
3390
+ { name: "oracle", type: "address", internalType: "address" },
3391
+ ],
3392
+ },
3393
+ { name: "maturity", type: "uint256", internalType: "uint256" },
3394
+ {
3395
+ name: "rcfThreshold",
3396
+ type: "uint256",
3397
+ internalType: "uint256",
3398
+ },
3399
+ { name: "enterGate", type: "address", internalType: "address" },
3400
+ {
3401
+ name: "liquidatorGate",
3402
+ type: "address",
3403
+ internalType: "address",
3404
+ },
3405
+ ],
3406
+ },
3407
+ { name: "buy", type: "bool", internalType: "bool" },
3408
+ { name: "maker", type: "address", internalType: "address" },
3409
+ { name: "start", type: "uint256", internalType: "uint256" },
3410
+ { name: "expiry", type: "uint256", internalType: "uint256" },
3411
+ { name: "tick", type: "uint256", internalType: "uint256" },
3412
+ { name: "group", type: "bytes32", internalType: "bytes32" },
3413
+ { name: "callback", type: "address", internalType: "address" },
3414
+ { name: "callbackData", type: "bytes", internalType: "bytes" },
3415
+ {
3416
+ name: "receiverIfMakerIsSeller",
3417
+ type: "address",
3418
+ internalType: "address",
3419
+ },
3420
+ { name: "ratifier", type: "address", internalType: "address" },
3421
+ { name: "reduceOnly", type: "bool", internalType: "bool" },
3422
+ { name: "maxUnits", type: "uint128", internalType: "uint128" },
3423
+ { name: "maxAssets", type: "uint128", internalType: "uint128" },
3424
+ {
3425
+ name: "continuousFeeCap",
3426
+ type: "uint256",
3427
+ internalType: "uint256",
3428
+ },
3429
+ ],
3430
+ },
3431
+ { name: "ratifierData", type: "bytes", internalType: "bytes" },
3432
+ { name: "taker", type: "address", internalType: "address" },
3433
+ ],
3434
+ outputs: [{ name: "", type: "bytes32", internalType: "bytes32" }],
3435
+ stateMutability: "view",
3436
+ },
3437
+ {
3438
+ type: "function",
3439
+ name: "isRootRatified",
3440
+ inputs: [
3441
+ { name: "maker", type: "address", internalType: "address" },
3442
+ { name: "root", type: "bytes32", internalType: "bytes32" },
3443
+ ],
3444
+ outputs: [{ name: "", type: "bool", internalType: "bool" }],
3445
+ stateMutability: "view",
3446
+ },
3447
+ {
3448
+ type: "function",
3449
+ name: "ratification",
3450
+ inputs: [
3451
+ { name: "maker", type: "address", internalType: "address" },
3452
+ { name: "root", type: "bytes32", internalType: "bytes32" },
3453
+ ],
3454
+ outputs: [
3455
+ { name: "isRootRatified", type: "bool", internalType: "bool" },
3456
+ { name: "rootNonce", type: "uint128", internalType: "uint128" },
3457
+ ],
3458
+ stateMutability: "view",
3459
+ },
3460
+ {
3461
+ type: "function",
3462
+ name: "rootNonce",
3463
+ inputs: [
3464
+ { name: "maker", type: "address", internalType: "address" },
3465
+ { name: "root", type: "bytes32", internalType: "bytes32" },
3466
+ ],
3467
+ outputs: [{ name: "", type: "uint128", internalType: "uint128" }],
3468
+ stateMutability: "view",
3469
+ },
3470
+ {
3471
+ type: "function",
3472
+ name: "setIsRootRatified",
3473
+ inputs: [
3474
+ { name: "maker", type: "address", internalType: "address" },
3475
+ { name: "root", type: "bytes32", internalType: "bytes32" },
3476
+ { name: "newIsRootRatified", type: "bool", internalType: "bool" },
3477
+ ],
3478
+ outputs: [{ name: "", type: "bytes32", internalType: "bytes32" }],
3479
+ stateMutability: "nonpayable",
3480
+ },
3481
+ {
3482
+ type: "function",
3483
+ name: "setIsRootRatifiedWithSig",
3484
+ inputs: [
3485
+ { name: "maker", type: "address", internalType: "address" },
3486
+ { name: "root", type: "bytes32", internalType: "bytes32" },
3487
+ { name: "height", type: "uint256", internalType: "uint256" },
3488
+ { name: "newIsRootRatified", type: "bool", internalType: "bool" },
3489
+ { name: "nonce", type: "uint128", internalType: "uint128" },
3490
+ { name: "deadline", type: "uint256", internalType: "uint256" },
3491
+ { name: "v", type: "uint8", internalType: "uint8" },
3492
+ { name: "r", type: "bytes32", internalType: "bytes32" },
3493
+ { name: "s", type: "bytes32", internalType: "bytes32" },
3494
+ ],
3495
+ outputs: [{ name: "", type: "bytes32", internalType: "bytes32" }],
3496
+ stateMutability: "nonpayable",
3497
+ },
3498
+ {
3499
+ type: "event",
3500
+ name: "SetIsRootRatified",
3501
+ inputs: [
3502
+ {
3503
+ name: "caller",
3504
+ type: "address",
3505
+ indexed: true,
3506
+ internalType: "address",
3507
+ },
3508
+ {
3509
+ name: "maker",
3510
+ type: "address",
3511
+ indexed: true,
3512
+ internalType: "address",
3513
+ },
3514
+ { name: "root", type: "bytes32", indexed: true, internalType: "bytes32" },
3515
+ {
3516
+ name: "newIsRootRatified",
3517
+ type: "bool",
3518
+ indexed: false,
3519
+ internalType: "bool",
3520
+ },
3521
+ ],
3522
+ anonymous: false,
3523
+ },
3524
+ {
3525
+ type: "event",
3526
+ name: "SetIsRootRatifiedWithSig",
3527
+ inputs: [
3528
+ {
3529
+ name: "caller",
3530
+ type: "address",
3531
+ indexed: false,
3532
+ internalType: "address",
3533
+ },
3534
+ {
3535
+ name: "signer",
3536
+ type: "address",
3537
+ indexed: true,
3538
+ internalType: "address",
3539
+ },
3540
+ {
3541
+ name: "maker",
3542
+ type: "address",
3543
+ indexed: true,
3544
+ internalType: "address",
3545
+ },
3546
+ { name: "root", type: "bytes32", indexed: true, internalType: "bytes32" },
3547
+ {
3548
+ name: "height",
3549
+ type: "uint256",
3550
+ indexed: false,
3551
+ internalType: "uint256",
3552
+ },
3553
+ {
3554
+ name: "newIsRootRatified",
3555
+ type: "bool",
3556
+ indexed: false,
3557
+ internalType: "bool",
3558
+ },
3559
+ {
3560
+ name: "signatureNonce",
3561
+ type: "uint128",
3562
+ indexed: false,
3563
+ internalType: "uint128",
3564
+ },
3565
+ {
3566
+ name: "previousNonce",
3567
+ type: "uint128",
3568
+ indexed: false,
3569
+ internalType: "uint128",
3570
+ },
3571
+ ],
3572
+ anonymous: false,
3573
+ },
3574
+ { type: "error", name: "DeadlineExpired", inputs: [] },
3575
+ { type: "error", name: "InvalidNonce", inputs: [] },
3576
+ { type: "error", name: "InvalidProof", inputs: [] },
3577
+ { type: "error", name: "InvalidSignature", inputs: [] },
3578
+ { type: "error", name: "NotRatified", inputs: [] },
3579
+ { type: "error", name: "RatifiedStatusChanged", inputs: [] },
3580
+ { type: "error", name: "Unauthorized", inputs: [] },
3581
+ { type: "error", name: "UnauthorizedTaker", inputs: [] },
3582
+ { type: "error", name: "WorsePrice", inputs: [] },
3583
+ ];
3584
+ /**
3585
+ * ABI JSON for the Midnight Bundles V2 periphery used by maker cancel-and-make and taker flows.
3586
+ *
3587
+ * Source: `morpho-org/bundles` commit `07f293b383824b35adc745454ac2622a27eb0502`,
3588
+ * `src/midnight/MidnightBundlesV2.sol` (compiled with `forge inspect ... abi`).
3589
+ * V2 acts on `msg.sender` only and does not accept inline token permits.
3590
+ *
3591
+ * @example
3592
+ * ```ts
3593
+ * import { midnightBundlesV2Abi } from "@morpho-org/midnight-sdk";
3594
+ *
3595
+ * console.log(midnightBundlesV2Abi.length);
3596
+ * ```
3597
+ */
3598
+ exports.midnightBundlesV2Abi = [
3599
+ {
3600
+ type: "constructor",
3601
+ inputs: [
3602
+ {
3603
+ name: "_midnight",
3604
+ type: "address",
3605
+ internalType: "address",
3606
+ },
3607
+ {
3608
+ name: "_blue",
3609
+ type: "address",
3610
+ internalType: "address",
3611
+ },
3612
+ {
3613
+ name: "_blueBuyCallbackFactory",
3614
+ type: "address",
3615
+ internalType: "address",
3616
+ },
3617
+ {
3618
+ name: "_log",
3619
+ type: "address",
3620
+ internalType: "address",
3621
+ },
3622
+ ],
3623
+ stateMutability: "nonpayable",
3624
+ },
3625
+ {
3626
+ type: "function",
3627
+ name: "BLUE",
3628
+ inputs: [],
3629
+ outputs: [
3630
+ {
3631
+ name: "",
3632
+ type: "address",
3633
+ internalType: "address",
3634
+ },
3635
+ ],
3636
+ stateMutability: "view",
3637
+ },
3638
+ {
3639
+ type: "function",
3640
+ name: "BLUE_BUY_CALLBACK_FACTORY",
3641
+ inputs: [],
3642
+ outputs: [
3643
+ {
3644
+ name: "",
3645
+ type: "address",
3646
+ internalType: "address",
3647
+ },
3648
+ ],
3649
+ stateMutability: "view",
3650
+ },
3651
+ {
3652
+ type: "function",
3653
+ name: "LOG",
3654
+ inputs: [],
3655
+ outputs: [
3656
+ {
3657
+ name: "",
3658
+ type: "address",
3659
+ internalType: "address",
3660
+ },
3661
+ ],
3662
+ stateMutability: "view",
3663
+ },
3664
+ {
3665
+ type: "function",
3666
+ name: "MIDNIGHT",
3667
+ inputs: [],
3668
+ outputs: [
3669
+ {
3670
+ name: "",
3671
+ type: "address",
3672
+ internalType: "address",
3673
+ },
3674
+ ],
3675
+ stateMutability: "view",
3676
+ },
3677
+ {
3678
+ type: "function",
3679
+ name: "midnightBundlesV2BuyWithAssetsTargetAndWithdrawCollateral",
3680
+ inputs: [
3681
+ {
3682
+ name: "market",
3683
+ type: "tuple",
3684
+ internalType: "struct Market",
3685
+ components: [
3686
+ {
3687
+ name: "chainId",
3688
+ type: "uint256",
3689
+ internalType: "uint256",
3690
+ },
3691
+ {
3692
+ name: "midnight",
3693
+ type: "address",
3694
+ internalType: "address",
3695
+ },
3696
+ {
3697
+ name: "loanToken",
3698
+ type: "address",
3699
+ internalType: "address",
3700
+ },
3701
+ {
3702
+ name: "collateralParams",
3703
+ type: "tuple[]",
3704
+ internalType: "struct CollateralParams[]",
3705
+ components: [
3706
+ {
3707
+ name: "token",
3708
+ type: "address",
3709
+ internalType: "address",
3710
+ },
3711
+ {
3712
+ name: "lltv",
3713
+ type: "uint256",
3714
+ internalType: "uint256",
3715
+ },
3716
+ {
3717
+ name: "liquidationCursor",
3718
+ type: "uint256",
3719
+ internalType: "uint256",
3720
+ },
3721
+ {
3722
+ name: "oracle",
3723
+ type: "address",
3724
+ internalType: "address",
3725
+ },
3726
+ ],
3727
+ },
3728
+ {
3729
+ name: "maturity",
3730
+ type: "uint256",
3731
+ internalType: "uint256",
3732
+ },
3733
+ {
3734
+ name: "rcfThreshold",
3735
+ type: "uint256",
3736
+ internalType: "uint256",
3737
+ },
3738
+ {
3739
+ name: "enterGate",
3740
+ type: "address",
3741
+ internalType: "address",
3742
+ },
3743
+ {
3744
+ name: "liquidatorGate",
3745
+ type: "address",
3746
+ internalType: "address",
3747
+ },
3748
+ ],
3749
+ },
3750
+ {
3751
+ name: "targetBuyerAssets",
3752
+ type: "uint256",
3753
+ internalType: "uint256",
3754
+ },
3755
+ {
3756
+ name: "minUnits",
3757
+ type: "uint256",
3758
+ internalType: "uint256",
3759
+ },
3760
+ {
3761
+ name: "reduceOnly",
3762
+ type: "bool",
3763
+ internalType: "bool",
3764
+ },
3765
+ {
3766
+ name: "repayEnabled",
3767
+ type: "bool",
3768
+ internalType: "bool",
3769
+ },
3770
+ {
3771
+ name: "offerFills",
3772
+ type: "tuple[]",
3773
+ internalType: "struct OfferFill[]",
3774
+ components: [
3775
+ {
3776
+ name: "offer",
3777
+ type: "tuple",
3778
+ internalType: "struct Offer",
3779
+ components: [
3780
+ {
3781
+ name: "market",
3782
+ type: "tuple",
3783
+ internalType: "struct Market",
3784
+ components: [
3785
+ {
3786
+ name: "chainId",
3787
+ type: "uint256",
3788
+ internalType: "uint256",
3789
+ },
3790
+ {
3791
+ name: "midnight",
3792
+ type: "address",
3793
+ internalType: "address",
3794
+ },
3795
+ {
3796
+ name: "loanToken",
3797
+ type: "address",
3798
+ internalType: "address",
3799
+ },
3800
+ {
3801
+ name: "collateralParams",
3802
+ type: "tuple[]",
3803
+ internalType: "struct CollateralParams[]",
3804
+ components: [
3805
+ {
3806
+ name: "token",
3807
+ type: "address",
3808
+ internalType: "address",
3809
+ },
3810
+ {
3811
+ name: "lltv",
3812
+ type: "uint256",
3813
+ internalType: "uint256",
3814
+ },
3815
+ {
3816
+ name: "liquidationCursor",
3817
+ type: "uint256",
3818
+ internalType: "uint256",
3819
+ },
3820
+ {
3821
+ name: "oracle",
3822
+ type: "address",
3823
+ internalType: "address",
3824
+ },
3825
+ ],
3826
+ },
3827
+ {
3828
+ name: "maturity",
3829
+ type: "uint256",
3830
+ internalType: "uint256",
3831
+ },
3832
+ {
3833
+ name: "rcfThreshold",
3834
+ type: "uint256",
3835
+ internalType: "uint256",
3836
+ },
3837
+ {
3838
+ name: "enterGate",
3839
+ type: "address",
3840
+ internalType: "address",
3841
+ },
3842
+ {
3843
+ name: "liquidatorGate",
3844
+ type: "address",
3845
+ internalType: "address",
3846
+ },
3847
+ ],
3848
+ },
3849
+ {
3850
+ name: "buy",
3851
+ type: "bool",
3852
+ internalType: "bool",
3853
+ },
3854
+ {
3855
+ name: "maker",
3856
+ type: "address",
3857
+ internalType: "address",
3858
+ },
3859
+ {
3860
+ name: "start",
3861
+ type: "uint256",
3862
+ internalType: "uint256",
3863
+ },
3864
+ {
3865
+ name: "expiry",
3866
+ type: "uint256",
3867
+ internalType: "uint256",
3868
+ },
3869
+ {
3870
+ name: "tick",
3871
+ type: "uint256",
3872
+ internalType: "uint256",
3873
+ },
3874
+ {
3875
+ name: "group",
3876
+ type: "bytes32",
3877
+ internalType: "bytes32",
3878
+ },
3879
+ {
3880
+ name: "callback",
3881
+ type: "address",
3882
+ internalType: "address",
3883
+ },
3884
+ {
3885
+ name: "callbackData",
3886
+ type: "bytes",
3887
+ internalType: "bytes",
3888
+ },
3889
+ {
3890
+ name: "receiverIfMakerIsSeller",
3891
+ type: "address",
3892
+ internalType: "address",
3893
+ },
3894
+ {
3895
+ name: "ratifier",
3896
+ type: "address",
3897
+ internalType: "address",
3898
+ },
3899
+ {
3900
+ name: "reduceOnly",
3901
+ type: "bool",
3902
+ internalType: "bool",
3903
+ },
3904
+ {
3905
+ name: "maxUnits",
3906
+ type: "uint128",
3907
+ internalType: "uint128",
3908
+ },
3909
+ {
3910
+ name: "maxAssets",
3911
+ type: "uint128",
3912
+ internalType: "uint128",
3913
+ },
3914
+ {
3915
+ name: "continuousFeeCap",
3916
+ type: "uint256",
3917
+ internalType: "uint256",
3918
+ },
3919
+ ],
3920
+ },
3921
+ {
3922
+ name: "ratifierData",
3923
+ type: "bytes",
3924
+ internalType: "bytes",
3925
+ },
3926
+ {
3927
+ name: "units",
3928
+ type: "uint256",
3929
+ internalType: "uint256",
3930
+ },
3931
+ ],
3932
+ },
3933
+ {
3934
+ name: "collateralWithdrawals",
3935
+ type: "tuple[]",
3936
+ internalType: "struct CollateralTransfer[]",
3937
+ components: [
3938
+ {
3939
+ name: "collateralIndex",
3940
+ type: "uint256",
3941
+ internalType: "uint256",
3942
+ },
3943
+ {
3944
+ name: "assets",
3945
+ type: "uint256",
3946
+ internalType: "uint256",
3947
+ },
3948
+ ],
3949
+ },
3950
+ {
3951
+ name: "collateralReceiver",
3952
+ type: "address",
3953
+ internalType: "address",
3954
+ },
3955
+ {
3956
+ name: "referralFeePct",
3957
+ type: "uint256",
3958
+ internalType: "uint256",
3959
+ },
3960
+ {
3961
+ name: "referralFeeRecipient",
3962
+ type: "address",
3963
+ internalType: "address",
3964
+ },
3965
+ {
3966
+ name: "maxContinuousFee",
3967
+ type: "uint256",
3968
+ internalType: "uint256",
3969
+ },
3970
+ {
3971
+ name: "deadline",
3972
+ type: "uint256",
3973
+ internalType: "uint256",
3974
+ },
3975
+ {
3976
+ name: "wrappedNative",
3977
+ type: "address",
3978
+ internalType: "address",
3979
+ },
3980
+ ],
3981
+ outputs: [],
3982
+ stateMutability: "payable",
3983
+ },
3984
+ {
3985
+ type: "function",
3986
+ name: "midnightBundlesV2BuyWithUnitsTargetAndWithdrawCollateral",
3987
+ inputs: [
3988
+ {
3989
+ name: "market",
3990
+ type: "tuple",
3991
+ internalType: "struct Market",
3992
+ components: [
3993
+ {
3994
+ name: "chainId",
3995
+ type: "uint256",
3996
+ internalType: "uint256",
3997
+ },
3998
+ {
3999
+ name: "midnight",
4000
+ type: "address",
4001
+ internalType: "address",
4002
+ },
4003
+ {
4004
+ name: "loanToken",
4005
+ type: "address",
4006
+ internalType: "address",
4007
+ },
4008
+ {
4009
+ name: "collateralParams",
4010
+ type: "tuple[]",
4011
+ internalType: "struct CollateralParams[]",
4012
+ components: [
4013
+ {
4014
+ name: "token",
4015
+ type: "address",
4016
+ internalType: "address",
4017
+ },
4018
+ {
4019
+ name: "lltv",
4020
+ type: "uint256",
4021
+ internalType: "uint256",
4022
+ },
4023
+ {
4024
+ name: "liquidationCursor",
4025
+ type: "uint256",
4026
+ internalType: "uint256",
4027
+ },
4028
+ {
4029
+ name: "oracle",
4030
+ type: "address",
4031
+ internalType: "address",
4032
+ },
4033
+ ],
4034
+ },
4035
+ {
4036
+ name: "maturity",
4037
+ type: "uint256",
4038
+ internalType: "uint256",
4039
+ },
4040
+ {
4041
+ name: "rcfThreshold",
4042
+ type: "uint256",
4043
+ internalType: "uint256",
4044
+ },
4045
+ {
4046
+ name: "enterGate",
4047
+ type: "address",
4048
+ internalType: "address",
4049
+ },
4050
+ {
4051
+ name: "liquidatorGate",
4052
+ type: "address",
4053
+ internalType: "address",
4054
+ },
4055
+ ],
4056
+ },
4057
+ {
4058
+ name: "targetUnits",
4059
+ type: "uint256",
4060
+ internalType: "uint256",
4061
+ },
4062
+ {
4063
+ name: "maxBuyerAssets",
4064
+ type: "uint256",
4065
+ internalType: "uint256",
4066
+ },
4067
+ {
4068
+ name: "reduceOnly",
4069
+ type: "bool",
4070
+ internalType: "bool",
4071
+ },
4072
+ {
4073
+ name: "repayEnabled",
4074
+ type: "bool",
4075
+ internalType: "bool",
4076
+ },
4077
+ {
4078
+ name: "offerFills",
4079
+ type: "tuple[]",
4080
+ internalType: "struct OfferFill[]",
4081
+ components: [
4082
+ {
4083
+ name: "offer",
4084
+ type: "tuple",
4085
+ internalType: "struct Offer",
4086
+ components: [
4087
+ {
4088
+ name: "market",
4089
+ type: "tuple",
4090
+ internalType: "struct Market",
4091
+ components: [
4092
+ {
4093
+ name: "chainId",
4094
+ type: "uint256",
4095
+ internalType: "uint256",
4096
+ },
4097
+ {
4098
+ name: "midnight",
4099
+ type: "address",
4100
+ internalType: "address",
4101
+ },
4102
+ {
4103
+ name: "loanToken",
4104
+ type: "address",
4105
+ internalType: "address",
4106
+ },
4107
+ {
4108
+ name: "collateralParams",
4109
+ type: "tuple[]",
4110
+ internalType: "struct CollateralParams[]",
4111
+ components: [
4112
+ {
4113
+ name: "token",
4114
+ type: "address",
4115
+ internalType: "address",
4116
+ },
4117
+ {
4118
+ name: "lltv",
4119
+ type: "uint256",
4120
+ internalType: "uint256",
4121
+ },
4122
+ {
4123
+ name: "liquidationCursor",
4124
+ type: "uint256",
4125
+ internalType: "uint256",
4126
+ },
4127
+ {
4128
+ name: "oracle",
4129
+ type: "address",
4130
+ internalType: "address",
4131
+ },
4132
+ ],
4133
+ },
4134
+ {
4135
+ name: "maturity",
4136
+ type: "uint256",
4137
+ internalType: "uint256",
4138
+ },
4139
+ {
4140
+ name: "rcfThreshold",
4141
+ type: "uint256",
4142
+ internalType: "uint256",
4143
+ },
4144
+ {
4145
+ name: "enterGate",
4146
+ type: "address",
4147
+ internalType: "address",
4148
+ },
4149
+ {
4150
+ name: "liquidatorGate",
4151
+ type: "address",
4152
+ internalType: "address",
4153
+ },
4154
+ ],
4155
+ },
4156
+ {
4157
+ name: "buy",
4158
+ type: "bool",
4159
+ internalType: "bool",
4160
+ },
4161
+ {
4162
+ name: "maker",
4163
+ type: "address",
4164
+ internalType: "address",
4165
+ },
4166
+ {
4167
+ name: "start",
4168
+ type: "uint256",
4169
+ internalType: "uint256",
4170
+ },
4171
+ {
4172
+ name: "expiry",
4173
+ type: "uint256",
4174
+ internalType: "uint256",
4175
+ },
4176
+ {
4177
+ name: "tick",
4178
+ type: "uint256",
4179
+ internalType: "uint256",
4180
+ },
4181
+ {
4182
+ name: "group",
4183
+ type: "bytes32",
4184
+ internalType: "bytes32",
4185
+ },
4186
+ {
4187
+ name: "callback",
4188
+ type: "address",
4189
+ internalType: "address",
4190
+ },
4191
+ {
4192
+ name: "callbackData",
4193
+ type: "bytes",
4194
+ internalType: "bytes",
4195
+ },
4196
+ {
4197
+ name: "receiverIfMakerIsSeller",
4198
+ type: "address",
4199
+ internalType: "address",
4200
+ },
4201
+ {
4202
+ name: "ratifier",
4203
+ type: "address",
4204
+ internalType: "address",
4205
+ },
4206
+ {
4207
+ name: "reduceOnly",
4208
+ type: "bool",
4209
+ internalType: "bool",
4210
+ },
4211
+ {
4212
+ name: "maxUnits",
4213
+ type: "uint128",
4214
+ internalType: "uint128",
4215
+ },
4216
+ {
4217
+ name: "maxAssets",
4218
+ type: "uint128",
4219
+ internalType: "uint128",
4220
+ },
4221
+ {
4222
+ name: "continuousFeeCap",
4223
+ type: "uint256",
4224
+ internalType: "uint256",
4225
+ },
4226
+ ],
4227
+ },
4228
+ {
4229
+ name: "ratifierData",
4230
+ type: "bytes",
4231
+ internalType: "bytes",
4232
+ },
4233
+ {
4234
+ name: "units",
4235
+ type: "uint256",
4236
+ internalType: "uint256",
4237
+ },
4238
+ ],
4239
+ },
4240
+ {
4241
+ name: "collateralWithdrawals",
4242
+ type: "tuple[]",
4243
+ internalType: "struct CollateralTransfer[]",
4244
+ components: [
4245
+ {
4246
+ name: "collateralIndex",
4247
+ type: "uint256",
4248
+ internalType: "uint256",
4249
+ },
4250
+ {
4251
+ name: "assets",
4252
+ type: "uint256",
4253
+ internalType: "uint256",
4254
+ },
4255
+ ],
4256
+ },
4257
+ {
4258
+ name: "collateralReceiver",
4259
+ type: "address",
4260
+ internalType: "address",
4261
+ },
4262
+ {
4263
+ name: "referralFeePct",
4264
+ type: "uint256",
4265
+ internalType: "uint256",
4266
+ },
4267
+ {
4268
+ name: "referralFeeRecipient",
4269
+ type: "address",
4270
+ internalType: "address",
4271
+ },
4272
+ {
4273
+ name: "maxContinuousFee",
4274
+ type: "uint256",
4275
+ internalType: "uint256",
4276
+ },
4277
+ {
4278
+ name: "deadline",
4279
+ type: "uint256",
4280
+ internalType: "uint256",
4281
+ },
4282
+ {
4283
+ name: "wrappedNative",
4284
+ type: "address",
4285
+ internalType: "address",
4286
+ },
4287
+ ],
4288
+ outputs: [],
4289
+ stateMutability: "payable",
4290
+ },
4291
+ {
4292
+ type: "function",
4293
+ name: "midnightBundlesV2CancelAndMake",
4294
+ inputs: [
4295
+ {
4296
+ name: "blueMarket",
4297
+ type: "tuple",
4298
+ internalType: "struct MarketParams",
4299
+ components: [
4300
+ {
4301
+ name: "loanToken",
4302
+ type: "address",
3100
4303
  internalType: "address",
3101
- name: "midnight",
4304
+ },
4305
+ {
4306
+ name: "collateralToken",
4307
+ type: "address",
4308
+ internalType: "address",
4309
+ },
4310
+ {
4311
+ name: "oracle",
3102
4312
  type: "address",
4313
+ internalType: "address",
4314
+ },
4315
+ {
4316
+ name: "irm",
4317
+ type: "address",
4318
+ internalType: "address",
4319
+ },
4320
+ {
4321
+ name: "lltv",
4322
+ type: "uint256",
4323
+ internalType: "uint256",
4324
+ },
4325
+ ],
4326
+ },
4327
+ {
4328
+ name: "assetsToPark",
4329
+ type: "uint256",
4330
+ internalType: "uint256",
4331
+ },
4332
+ {
4333
+ name: "callbackSalt",
4334
+ type: "bytes32",
4335
+ internalType: "bytes32",
4336
+ },
4337
+ {
4338
+ name: "market",
4339
+ type: "tuple",
4340
+ internalType: "struct Market",
4341
+ components: [
4342
+ {
4343
+ name: "chainId",
4344
+ type: "uint256",
4345
+ internalType: "uint256",
3103
4346
  },
3104
4347
  {
4348
+ name: "midnight",
4349
+ type: "address",
3105
4350
  internalType: "address",
4351
+ },
4352
+ {
3106
4353
  name: "loanToken",
3107
4354
  type: "address",
4355
+ internalType: "address",
3108
4356
  },
3109
4357
  {
4358
+ name: "collateralParams",
4359
+ type: "tuple[]",
4360
+ internalType: "struct CollateralParams[]",
3110
4361
  components: [
3111
4362
  {
3112
- internalType: "address",
3113
4363
  name: "token",
3114
4364
  type: "address",
4365
+ internalType: "address",
3115
4366
  },
3116
4367
  {
3117
- internalType: "uint256",
3118
4368
  name: "lltv",
3119
4369
  type: "uint256",
4370
+ internalType: "uint256",
3120
4371
  },
3121
4372
  {
3122
- internalType: "uint256",
3123
4373
  name: "liquidationCursor",
3124
4374
  type: "uint256",
4375
+ internalType: "uint256",
3125
4376
  },
3126
4377
  {
3127
- internalType: "address",
3128
4378
  name: "oracle",
3129
4379
  type: "address",
4380
+ internalType: "address",
3130
4381
  },
3131
4382
  ],
3132
- internalType: "struct CollateralParams[]",
3133
- name: "collateralParams",
3134
- type: "tuple[]",
3135
4383
  },
3136
4384
  {
3137
- internalType: "uint256",
3138
4385
  name: "maturity",
3139
4386
  type: "uint256",
4387
+ internalType: "uint256",
3140
4388
  },
3141
4389
  {
3142
- internalType: "uint256",
3143
4390
  name: "rcfThreshold",
3144
4391
  type: "uint256",
4392
+ internalType: "uint256",
3145
4393
  },
3146
4394
  {
3147
- internalType: "address",
3148
4395
  name: "enterGate",
3149
4396
  type: "address",
4397
+ internalType: "address",
3150
4398
  },
3151
4399
  {
3152
- internalType: "address",
3153
4400
  name: "liquidatorGate",
3154
4401
  type: "address",
4402
+ internalType: "address",
3155
4403
  },
3156
4404
  ],
3157
- internalType: "struct Market",
3158
- name: "market",
3159
- type: "tuple",
3160
4405
  },
3161
4406
  {
4407
+ name: "collateralSupplies",
4408
+ type: "tuple[]",
4409
+ internalType: "struct CollateralTransfer[]",
4410
+ components: [
4411
+ {
4412
+ name: "collateralIndex",
4413
+ type: "uint256",
4414
+ internalType: "uint256",
4415
+ },
4416
+ {
4417
+ name: "assets",
4418
+ type: "uint256",
4419
+ internalType: "uint256",
4420
+ },
4421
+ ],
4422
+ },
4423
+ {
4424
+ name: "ratifier",
4425
+ type: "address",
4426
+ internalType: "address",
4427
+ },
4428
+ {
4429
+ name: "newRoot",
4430
+ type: "bytes32",
4431
+ internalType: "bytes32",
4432
+ },
4433
+ {
4434
+ name: "signatureHeight",
4435
+ type: "uint256",
3162
4436
  internalType: "uint256",
3163
- name: "assets",
4437
+ },
4438
+ {
4439
+ name: "signatureNonce",
4440
+ type: "uint128",
4441
+ internalType: "uint128",
4442
+ },
4443
+ {
4444
+ name: "signatureDeadline",
3164
4445
  type: "uint256",
4446
+ internalType: "uint256",
4447
+ },
4448
+ {
4449
+ name: "v",
4450
+ type: "uint8",
4451
+ internalType: "uint8",
3165
4452
  },
3166
4453
  {
3167
- internalType: "address",
3168
- name: "onBehalf",
3169
- type: "address",
4454
+ name: "r",
4455
+ type: "bytes32",
4456
+ internalType: "bytes32",
3170
4457
  },
3171
4458
  {
3172
- components: [
3173
- {
3174
- internalType: "enum PermitKind",
3175
- name: "kind",
3176
- type: "uint8",
3177
- },
3178
- {
3179
- internalType: "bytes",
3180
- name: "data",
3181
- type: "bytes",
3182
- },
3183
- ],
3184
- internalType: "struct TokenPermit",
3185
- name: "loanTokenPermit",
3186
- type: "tuple",
4459
+ name: "s",
4460
+ type: "bytes32",
4461
+ internalType: "bytes32",
3187
4462
  },
3188
4463
  {
4464
+ name: "groupsToCancel",
4465
+ type: "tuple[]",
4466
+ internalType: "struct GroupCancellation[]",
3189
4467
  components: [
3190
4468
  {
3191
- internalType: "uint256",
3192
- name: "collateralIndex",
3193
- type: "uint256",
4469
+ name: "group",
4470
+ type: "bytes32",
4471
+ internalType: "bytes32",
3194
4472
  },
3195
4473
  {
3196
- internalType: "uint256",
3197
- name: "assets",
3198
- type: "uint256",
4474
+ name: "maxConsumed",
4475
+ type: "uint128",
4476
+ internalType: "uint128",
3199
4477
  },
3200
4478
  ],
3201
- internalType: "struct CollateralWithdrawal[]",
3202
- name: "collateralWithdrawals",
3203
- type: "tuple[]",
3204
4479
  },
3205
4480
  {
3206
- internalType: "address",
3207
- name: "collateralReceiver",
3208
- type: "address",
4481
+ name: "payload",
4482
+ type: "bytes",
4483
+ internalType: "bytes",
3209
4484
  },
3210
4485
  {
3211
- internalType: "uint256",
3212
- name: "referralFeePct",
4486
+ name: "deadline",
3213
4487
  type: "uint256",
4488
+ internalType: "uint256",
3214
4489
  },
3215
4490
  {
3216
- internalType: "address",
3217
- name: "referralFeeRecipient",
4491
+ name: "wrappedNative",
3218
4492
  type: "address",
3219
- },
3220
- {
3221
- internalType: "uint256",
3222
- name: "deadline",
3223
- type: "uint256",
4493
+ internalType: "address",
3224
4494
  },
3225
4495
  ],
3226
- name: "midnightBundlesV1RepayAndWithdrawCollateral",
3227
4496
  outputs: [],
3228
- stateMutability: "nonpayable",
3229
- type: "function",
4497
+ stateMutability: "payable",
3230
4498
  },
3231
4499
  {
4500
+ type: "function",
4501
+ name: "midnightBundlesV2SupplyCollateralAndSellWithAssetsTarget",
3232
4502
  inputs: [
3233
4503
  {
3234
- internalType: "uint256",
3235
- name: "targetSellerAssets",
3236
- type: "uint256",
3237
- },
3238
- {
3239
- internalType: "uint256",
3240
- name: "maxUnits",
3241
- type: "uint256",
3242
- },
3243
- {
3244
- internalType: "address",
3245
- name: "taker",
3246
- type: "address",
3247
- },
3248
- {
3249
- internalType: "bool",
3250
- name: "reduceOnly",
3251
- type: "bool",
3252
- },
3253
- {
3254
- internalType: "address",
3255
- name: "receiver",
3256
- type: "address",
3257
- },
3258
- {
4504
+ name: "market",
4505
+ type: "tuple",
4506
+ internalType: "struct Market",
3259
4507
  components: [
3260
4508
  {
3261
- internalType: "uint256",
3262
- name: "collateralIndex",
4509
+ name: "chainId",
3263
4510
  type: "uint256",
4511
+ internalType: "uint256",
3264
4512
  },
3265
4513
  {
3266
- internalType: "uint256",
3267
- name: "assets",
3268
- type: "uint256",
4514
+ name: "midnight",
4515
+ type: "address",
4516
+ internalType: "address",
3269
4517
  },
3270
4518
  {
3271
- components: [
3272
- {
3273
- internalType: "enum PermitKind",
3274
- name: "kind",
3275
- type: "uint8",
3276
- },
3277
- {
3278
- internalType: "bytes",
3279
- name: "data",
3280
- type: "bytes",
3281
- },
3282
- ],
3283
- internalType: "struct TokenPermit",
3284
- name: "permit",
3285
- type: "tuple",
4519
+ name: "loanToken",
4520
+ type: "address",
4521
+ internalType: "address",
3286
4522
  },
3287
- ],
3288
- internalType: "struct CollateralSupply[]",
3289
- name: "collateralSupplies",
3290
- type: "tuple[]",
3291
- },
3292
- {
3293
- components: [
3294
4523
  {
4524
+ name: "collateralParams",
4525
+ type: "tuple[]",
4526
+ internalType: "struct CollateralParams[]",
3295
4527
  components: [
3296
4528
  {
3297
- components: [
3298
- {
3299
- internalType: "uint256",
3300
- name: "chainId",
3301
- type: "uint256",
3302
- },
3303
- {
3304
- internalType: "address",
3305
- name: "midnight",
3306
- type: "address",
3307
- },
3308
- {
3309
- internalType: "address",
3310
- name: "loanToken",
3311
- type: "address",
3312
- },
3313
- {
3314
- components: [
3315
- {
3316
- internalType: "address",
3317
- name: "token",
3318
- type: "address",
3319
- },
3320
- {
3321
- internalType: "uint256",
3322
- name: "lltv",
3323
- type: "uint256",
3324
- },
3325
- {
3326
- internalType: "uint256",
3327
- name: "liquidationCursor",
3328
- type: "uint256",
3329
- },
3330
- {
3331
- internalType: "address",
3332
- name: "oracle",
3333
- type: "address",
3334
- },
3335
- ],
3336
- internalType: "struct CollateralParams[]",
3337
- name: "collateralParams",
3338
- type: "tuple[]",
3339
- },
3340
- {
3341
- internalType: "uint256",
3342
- name: "maturity",
3343
- type: "uint256",
3344
- },
3345
- {
3346
- internalType: "uint256",
3347
- name: "rcfThreshold",
3348
- type: "uint256",
3349
- },
3350
- {
3351
- internalType: "address",
3352
- name: "enterGate",
3353
- type: "address",
3354
- },
3355
- {
3356
- internalType: "address",
3357
- name: "liquidatorGate",
3358
- type: "address",
3359
- },
3360
- ],
3361
- internalType: "struct Market",
3362
- name: "market",
3363
- type: "tuple",
3364
- },
3365
- {
3366
- internalType: "bool",
3367
- name: "buy",
3368
- type: "bool",
3369
- },
3370
- {
3371
- internalType: "address",
3372
- name: "maker",
4529
+ name: "token",
3373
4530
  type: "address",
4531
+ internalType: "address",
3374
4532
  },
3375
4533
  {
3376
- internalType: "uint256",
3377
- name: "start",
4534
+ name: "lltv",
3378
4535
  type: "uint256",
3379
- },
3380
- {
3381
4536
  internalType: "uint256",
3382
- name: "expiry",
3383
- type: "uint256",
3384
4537
  },
3385
4538
  {
3386
- internalType: "uint256",
3387
- name: "tick",
4539
+ name: "liquidationCursor",
3388
4540
  type: "uint256",
4541
+ internalType: "uint256",
3389
4542
  },
3390
4543
  {
3391
- internalType: "bytes32",
3392
- name: "group",
3393
- type: "bytes32",
3394
- },
3395
- {
3396
- internalType: "address",
3397
- name: "callback",
3398
- type: "address",
3399
- },
3400
- {
3401
- internalType: "bytes",
3402
- name: "callbackData",
3403
- type: "bytes",
3404
- },
3405
- {
3406
- internalType: "address",
3407
- name: "receiverIfMakerIsSeller",
4544
+ name: "oracle",
3408
4545
  type: "address",
3409
- },
3410
- {
3411
4546
  internalType: "address",
3412
- name: "ratifier",
3413
- type: "address",
3414
- },
3415
- {
3416
- internalType: "bool",
3417
- name: "reduceOnly",
3418
- type: "bool",
3419
- },
3420
- {
3421
- internalType: "uint128",
3422
- name: "maxUnits",
3423
- type: "uint128",
3424
- },
3425
- {
3426
- internalType: "uint128",
3427
- name: "maxAssets",
3428
- type: "uint128",
3429
- },
3430
- {
3431
- internalType: "uint256",
3432
- name: "continuousFeeCap",
3433
- type: "uint256",
3434
4547
  },
3435
4548
  ],
3436
- internalType: "struct Offer",
3437
- name: "offer",
3438
- type: "tuple",
3439
4549
  },
3440
4550
  {
3441
- internalType: "bytes",
3442
- name: "ratifierData",
3443
- type: "bytes",
4551
+ name: "maturity",
4552
+ type: "uint256",
4553
+ internalType: "uint256",
4554
+ },
4555
+ {
4556
+ name: "rcfThreshold",
4557
+ type: "uint256",
4558
+ internalType: "uint256",
4559
+ },
4560
+ {
4561
+ name: "enterGate",
4562
+ type: "address",
4563
+ internalType: "address",
3444
4564
  },
3445
4565
  {
3446
- internalType: "uint256",
3447
- name: "units",
3448
- type: "uint256",
4566
+ name: "liquidatorGate",
4567
+ type: "address",
4568
+ internalType: "address",
3449
4569
  },
3450
4570
  ],
3451
- internalType: "struct OfferFill[]",
3452
- name: "offerFills",
3453
- type: "tuple[]",
3454
- },
3455
- {
3456
- internalType: "uint256",
3457
- name: "referralFeePct",
3458
- type: "uint256",
3459
- },
3460
- {
3461
- internalType: "address",
3462
- name: "referralFeeRecipient",
3463
- type: "address",
3464
4571
  },
3465
4572
  {
3466
- internalType: "uint256",
3467
- name: "maxContinuousFee",
4573
+ name: "targetSellerAssets",
3468
4574
  type: "uint256",
3469
- },
3470
- {
3471
4575
  internalType: "uint256",
3472
- name: "deadline",
3473
- type: "uint256",
3474
4576
  },
3475
- ],
3476
- name: "midnightBundlesV1SupplyCollateralAndSellWithAssetsTarget",
3477
- outputs: [],
3478
- stateMutability: "nonpayable",
3479
- type: "function",
3480
- },
3481
- {
3482
- inputs: [
3483
4577
  {
3484
- internalType: "uint256",
3485
- name: "targetUnits",
4578
+ name: "maxUnits",
3486
4579
  type: "uint256",
3487
- },
3488
- {
3489
4580
  internalType: "uint256",
3490
- name: "minSellerAssets",
3491
- type: "uint256",
3492
- },
3493
- {
3494
- internalType: "address",
3495
- name: "taker",
3496
- type: "address",
3497
4581
  },
3498
4582
  {
3499
- internalType: "bool",
3500
4583
  name: "reduceOnly",
3501
4584
  type: "bool",
4585
+ internalType: "bool",
3502
4586
  },
3503
4587
  {
3504
- internalType: "address",
3505
4588
  name: "receiver",
3506
4589
  type: "address",
4590
+ internalType: "address",
3507
4591
  },
3508
4592
  {
4593
+ name: "collateralSupplies",
4594
+ type: "tuple[]",
4595
+ internalType: "struct CollateralTransfer[]",
3509
4596
  components: [
3510
4597
  {
3511
- internalType: "uint256",
3512
4598
  name: "collateralIndex",
3513
4599
  type: "uint256",
4600
+ internalType: "uint256",
3514
4601
  },
3515
4602
  {
3516
- internalType: "uint256",
3517
4603
  name: "assets",
3518
4604
  type: "uint256",
3519
- },
3520
- {
3521
- components: [
3522
- {
3523
- internalType: "enum PermitKind",
3524
- name: "kind",
3525
- type: "uint8",
3526
- },
3527
- {
3528
- internalType: "bytes",
3529
- name: "data",
3530
- type: "bytes",
3531
- },
3532
- ],
3533
- internalType: "struct TokenPermit",
3534
- name: "permit",
3535
- type: "tuple",
4605
+ internalType: "uint256",
3536
4606
  },
3537
4607
  ],
3538
- internalType: "struct CollateralSupply[]",
3539
- name: "collateralSupplies",
3540
- type: "tuple[]",
3541
4608
  },
3542
4609
  {
4610
+ name: "offerFills",
4611
+ type: "tuple[]",
4612
+ internalType: "struct OfferFill[]",
3543
4613
  components: [
3544
4614
  {
4615
+ name: "offer",
4616
+ type: "tuple",
4617
+ internalType: "struct Offer",
3545
4618
  components: [
3546
4619
  {
4620
+ name: "market",
4621
+ type: "tuple",
4622
+ internalType: "struct Market",
3547
4623
  components: [
3548
4624
  {
3549
- internalType: "uint256",
3550
4625
  name: "chainId",
3551
4626
  type: "uint256",
4627
+ internalType: "uint256",
3552
4628
  },
3553
4629
  {
3554
- internalType: "address",
3555
4630
  name: "midnight",
3556
4631
  type: "address",
4632
+ internalType: "address",
3557
4633
  },
3558
4634
  {
3559
- internalType: "address",
3560
4635
  name: "loanToken",
3561
4636
  type: "address",
4637
+ internalType: "address",
3562
4638
  },
3563
4639
  {
4640
+ name: "collateralParams",
4641
+ type: "tuple[]",
4642
+ internalType: "struct CollateralParams[]",
3564
4643
  components: [
3565
4644
  {
3566
- internalType: "address",
3567
4645
  name: "token",
3568
4646
  type: "address",
4647
+ internalType: "address",
3569
4648
  },
3570
4649
  {
3571
- internalType: "uint256",
3572
4650
  name: "lltv",
3573
4651
  type: "uint256",
4652
+ internalType: "uint256",
3574
4653
  },
3575
4654
  {
3576
- internalType: "uint256",
3577
4655
  name: "liquidationCursor",
3578
4656
  type: "uint256",
4657
+ internalType: "uint256",
3579
4658
  },
3580
4659
  {
3581
- internalType: "address",
3582
4660
  name: "oracle",
3583
4661
  type: "address",
4662
+ internalType: "address",
3584
4663
  },
3585
4664
  ],
3586
- internalType: "struct CollateralParams[]",
3587
- name: "collateralParams",
3588
- type: "tuple[]",
3589
4665
  },
3590
4666
  {
3591
- internalType: "uint256",
3592
4667
  name: "maturity",
3593
4668
  type: "uint256",
4669
+ internalType: "uint256",
3594
4670
  },
3595
4671
  {
3596
- internalType: "uint256",
3597
4672
  name: "rcfThreshold",
3598
4673
  type: "uint256",
4674
+ internalType: "uint256",
3599
4675
  },
3600
4676
  {
3601
- internalType: "address",
3602
4677
  name: "enterGate",
3603
4678
  type: "address",
4679
+ internalType: "address",
3604
4680
  },
3605
4681
  {
3606
- internalType: "address",
3607
4682
  name: "liquidatorGate",
3608
4683
  type: "address",
4684
+ internalType: "address",
3609
4685
  },
3610
4686
  ],
3611
- internalType: "struct Market",
3612
- name: "market",
3613
- type: "tuple",
3614
4687
  },
3615
4688
  {
3616
- internalType: "bool",
3617
4689
  name: "buy",
3618
4690
  type: "bool",
4691
+ internalType: "bool",
3619
4692
  },
3620
4693
  {
3621
- internalType: "address",
3622
4694
  name: "maker",
3623
4695
  type: "address",
4696
+ internalType: "address",
3624
4697
  },
3625
4698
  {
3626
- internalType: "uint256",
3627
4699
  name: "start",
3628
4700
  type: "uint256",
4701
+ internalType: "uint256",
3629
4702
  },
3630
4703
  {
3631
- internalType: "uint256",
3632
4704
  name: "expiry",
3633
4705
  type: "uint256",
4706
+ internalType: "uint256",
3634
4707
  },
3635
4708
  {
3636
- internalType: "uint256",
3637
4709
  name: "tick",
3638
4710
  type: "uint256",
4711
+ internalType: "uint256",
3639
4712
  },
3640
4713
  {
3641
- internalType: "bytes32",
3642
4714
  name: "group",
3643
4715
  type: "bytes32",
4716
+ internalType: "bytes32",
3644
4717
  },
3645
4718
  {
3646
- internalType: "address",
3647
4719
  name: "callback",
3648
4720
  type: "address",
4721
+ internalType: "address",
3649
4722
  },
3650
4723
  {
3651
- internalType: "bytes",
3652
4724
  name: "callbackData",
3653
4725
  type: "bytes",
4726
+ internalType: "bytes",
3654
4727
  },
3655
4728
  {
3656
- internalType: "address",
3657
4729
  name: "receiverIfMakerIsSeller",
3658
4730
  type: "address",
4731
+ internalType: "address",
3659
4732
  },
3660
4733
  {
3661
- internalType: "address",
3662
4734
  name: "ratifier",
3663
4735
  type: "address",
4736
+ internalType: "address",
3664
4737
  },
3665
4738
  {
3666
- internalType: "bool",
3667
4739
  name: "reduceOnly",
3668
4740
  type: "bool",
4741
+ internalType: "bool",
3669
4742
  },
3670
4743
  {
3671
- internalType: "uint128",
3672
4744
  name: "maxUnits",
3673
4745
  type: "uint128",
4746
+ internalType: "uint128",
3674
4747
  },
3675
4748
  {
3676
- internalType: "uint128",
3677
4749
  name: "maxAssets",
3678
4750
  type: "uint128",
4751
+ internalType: "uint128",
3679
4752
  },
3680
4753
  {
3681
- internalType: "uint256",
3682
4754
  name: "continuousFeeCap",
3683
4755
  type: "uint256",
4756
+ internalType: "uint256",
3684
4757
  },
3685
4758
  ],
3686
- internalType: "struct Offer",
3687
- name: "offer",
3688
- type: "tuple",
3689
4759
  },
3690
4760
  {
3691
- internalType: "bytes",
3692
4761
  name: "ratifierData",
3693
4762
  type: "bytes",
4763
+ internalType: "bytes",
3694
4764
  },
3695
4765
  {
3696
- internalType: "uint256",
3697
4766
  name: "units",
3698
4767
  type: "uint256",
4768
+ internalType: "uint256",
3699
4769
  },
3700
4770
  ],
3701
- internalType: "struct OfferFill[]",
3702
- name: "offerFills",
3703
- type: "tuple[]",
3704
4771
  },
3705
4772
  {
3706
- internalType: "uint256",
3707
4773
  name: "referralFeePct",
3708
4774
  type: "uint256",
4775
+ internalType: "uint256",
3709
4776
  },
3710
4777
  {
3711
- internalType: "address",
3712
4778
  name: "referralFeeRecipient",
3713
4779
  type: "address",
4780
+ internalType: "address",
3714
4781
  },
3715
4782
  {
3716
- internalType: "uint256",
3717
- name: "maxContinuousFee",
3718
- type: "uint256",
3719
- },
3720
- {
3721
- internalType: "uint256",
3722
4783
  name: "deadline",
3723
4784
  type: "uint256",
4785
+ internalType: "uint256",
3724
4786
  },
3725
- ],
3726
- name: "midnightBundlesV1SupplyCollateralAndSellWithUnitsTarget",
3727
- outputs: [],
3728
- stateMutability: "nonpayable",
3729
- type: "function",
3730
- },
3731
- ];
3732
- /**
3733
- * Pinned ABI JSON for the EcrecoverRatifier.
3734
- *
3735
- * Source: `morpho-org/midnight` commit `336b924a2bb378d810ef6d35b6dd3486759af8bd`,
3736
- * `src/ratifiers/interfaces/IEcrecoverRatifier.sol`, Forge artifact `out/IEcrecoverRatifier.sol/IEcrecoverRatifier.json`.
3737
- *
3738
- * @example
3739
- * ```ts
3740
- * import { ecrecoverRatifierAbi } from "@morpho-org/midnight-sdk";
3741
- *
3742
- * console.log(ecrecoverRatifierAbi.length);
3743
- * ```
3744
- */
3745
- exports.ecrecoverRatifierAbi = [
3746
- {
3747
- type: "function",
3748
- name: "MIDNIGHT",
3749
- inputs: [],
3750
- outputs: [
3751
- {
3752
- name: "",
3753
- type: "address",
3754
- internalType: "address",
3755
- },
3756
- ],
3757
- stateMutability: "view",
3758
- },
3759
- {
3760
- type: "function",
3761
- name: "cancelRoot",
3762
- inputs: [
3763
4787
  {
3764
- name: "maker",
4788
+ name: "wrappedNative",
3765
4789
  type: "address",
3766
4790
  internalType: "address",
3767
4791
  },
3768
- {
3769
- name: "root",
3770
- type: "bytes32",
3771
- internalType: "bytes32",
3772
- },
3773
4792
  ],
3774
4793
  outputs: [],
3775
- stateMutability: "nonpayable",
4794
+ stateMutability: "payable",
3776
4795
  },
3777
4796
  {
3778
4797
  type: "function",
3779
- name: "isRatified",
4798
+ name: "midnightBundlesV2SupplyCollateralAndSellWithUnitsTarget",
3780
4799
  inputs: [
3781
4800
  {
3782
- name: "offer",
4801
+ name: "market",
3783
4802
  type: "tuple",
3784
- internalType: "struct Offer",
4803
+ internalType: "struct Market",
3785
4804
  components: [
3786
4805
  {
3787
- name: "market",
3788
- type: "tuple",
3789
- internalType: "struct Market",
3790
- components: [
3791
- {
3792
- name: "chainId",
3793
- type: "uint256",
3794
- internalType: "uint256",
3795
- },
3796
- {
3797
- name: "midnight",
3798
- type: "address",
3799
- internalType: "address",
3800
- },
3801
- {
3802
- name: "loanToken",
3803
- type: "address",
3804
- internalType: "address",
3805
- },
3806
- {
3807
- name: "collateralParams",
3808
- type: "tuple[]",
3809
- internalType: "struct CollateralParams[]",
3810
- components: [
3811
- {
3812
- name: "token",
3813
- type: "address",
3814
- internalType: "address",
3815
- },
3816
- {
3817
- name: "lltv",
3818
- type: "uint256",
3819
- internalType: "uint256",
3820
- },
3821
- {
3822
- name: "liquidationCursor",
3823
- type: "uint256",
3824
- internalType: "uint256",
3825
- },
3826
- {
3827
- name: "oracle",
3828
- type: "address",
3829
- internalType: "address",
3830
- },
3831
- ],
4806
+ name: "chainId",
4807
+ type: "uint256",
4808
+ internalType: "uint256",
4809
+ },
4810
+ {
4811
+ name: "midnight",
4812
+ type: "address",
4813
+ internalType: "address",
4814
+ },
4815
+ {
4816
+ name: "loanToken",
4817
+ type: "address",
4818
+ internalType: "address",
4819
+ },
4820
+ {
4821
+ name: "collateralParams",
4822
+ type: "tuple[]",
4823
+ internalType: "struct CollateralParams[]",
4824
+ components: [
4825
+ {
4826
+ name: "token",
4827
+ type: "address",
4828
+ internalType: "address",
3832
4829
  },
3833
4830
  {
3834
- name: "maturity",
4831
+ name: "lltv",
3835
4832
  type: "uint256",
3836
4833
  internalType: "uint256",
3837
4834
  },
3838
4835
  {
3839
- name: "rcfThreshold",
4836
+ name: "liquidationCursor",
3840
4837
  type: "uint256",
3841
4838
  internalType: "uint256",
3842
4839
  },
3843
4840
  {
3844
- name: "enterGate",
3845
- type: "address",
3846
- internalType: "address",
3847
- },
3848
- {
3849
- name: "liquidatorGate",
4841
+ name: "oracle",
3850
4842
  type: "address",
3851
4843
  internalType: "address",
3852
4844
  },
3853
4845
  ],
3854
4846
  },
3855
4847
  {
3856
- name: "buy",
3857
- type: "bool",
3858
- internalType: "bool",
3859
- },
3860
- {
3861
- name: "maker",
3862
- type: "address",
3863
- internalType: "address",
3864
- },
3865
- {
3866
- name: "start",
3867
- type: "uint256",
3868
- internalType: "uint256",
3869
- },
3870
- {
3871
- name: "expiry",
4848
+ name: "maturity",
3872
4849
  type: "uint256",
3873
4850
  internalType: "uint256",
3874
4851
  },
3875
4852
  {
3876
- name: "tick",
4853
+ name: "rcfThreshold",
3877
4854
  type: "uint256",
3878
4855
  internalType: "uint256",
3879
4856
  },
3880
4857
  {
3881
- name: "group",
3882
- type: "bytes32",
3883
- internalType: "bytes32",
3884
- },
3885
- {
3886
- name: "callback",
3887
- type: "address",
3888
- internalType: "address",
3889
- },
3890
- {
3891
- name: "callbackData",
3892
- type: "bytes",
3893
- internalType: "bytes",
3894
- },
3895
- {
3896
- name: "receiverIfMakerIsSeller",
4858
+ name: "enterGate",
3897
4859
  type: "address",
3898
4860
  internalType: "address",
3899
4861
  },
3900
4862
  {
3901
- name: "ratifier",
4863
+ name: "liquidatorGate",
3902
4864
  type: "address",
3903
4865
  internalType: "address",
3904
4866
  },
3905
- {
3906
- name: "reduceOnly",
3907
- type: "bool",
3908
- internalType: "bool",
3909
- },
3910
- {
3911
- name: "maxUnits",
3912
- type: "uint128",
3913
- internalType: "uint128",
3914
- },
3915
- {
3916
- name: "maxAssets",
3917
- type: "uint128",
3918
- internalType: "uint128",
3919
- },
3920
- {
3921
- name: "continuousFeeCap",
3922
- type: "uint256",
3923
- internalType: "uint256",
3924
- },
3925
4867
  ],
3926
4868
  },
3927
4869
  {
3928
- name: "ratifierData",
3929
- type: "bytes",
3930
- internalType: "bytes",
3931
- },
3932
- {
3933
- name: "taker",
3934
- type: "address",
3935
- internalType: "address",
3936
- },
3937
- ],
3938
- outputs: [
3939
- {
3940
- name: "",
3941
- type: "bytes32",
3942
- internalType: "bytes32",
3943
- },
3944
- ],
3945
- stateMutability: "view",
3946
- },
3947
- {
3948
- type: "function",
3949
- name: "isRootCanceled",
3950
- inputs: [
3951
- {
3952
- name: "maker",
3953
- type: "address",
3954
- internalType: "address",
4870
+ name: "targetUnits",
4871
+ type: "uint256",
4872
+ internalType: "uint256",
3955
4873
  },
3956
4874
  {
3957
- name: "root",
3958
- type: "bytes32",
3959
- internalType: "bytes32",
4875
+ name: "minSellerAssets",
4876
+ type: "uint256",
4877
+ internalType: "uint256",
3960
4878
  },
3961
- ],
3962
- outputs: [
3963
4879
  {
3964
- name: "",
4880
+ name: "reduceOnly",
3965
4881
  type: "bool",
3966
4882
  internalType: "bool",
3967
4883
  },
3968
- ],
3969
- stateMutability: "view",
3970
- },
3971
- {
3972
- type: "event",
3973
- name: "CancelRoot",
3974
- inputs: [
3975
- {
3976
- name: "caller",
3977
- type: "address",
3978
- indexed: true,
3979
- internalType: "address",
3980
- },
3981
4884
  {
3982
- name: "maker",
4885
+ name: "receiver",
3983
4886
  type: "address",
3984
- indexed: true,
3985
4887
  internalType: "address",
3986
4888
  },
3987
4889
  {
3988
- name: "root",
3989
- type: "bytes32",
3990
- indexed: true,
3991
- internalType: "bytes32",
3992
- },
3993
- ],
3994
- anonymous: false,
3995
- },
3996
- {
3997
- type: "error",
3998
- name: "InvalidProof",
3999
- inputs: [],
4000
- },
4001
- {
4002
- type: "error",
4003
- name: "InvalidSignature",
4004
- inputs: [],
4005
- },
4006
- {
4007
- type: "error",
4008
- name: "RootCanceled",
4009
- inputs: [],
4010
- },
4011
- {
4012
- type: "error",
4013
- name: "Unauthorized",
4014
- inputs: [],
4015
- },
4016
- ];
4017
- /**
4018
- * Pinned ABI JSON for the SetterRatifier.
4019
- *
4020
- * Source: `morpho-org/midnight` commit `336b924a2bb378d810ef6d35b6dd3486759af8bd`,
4021
- * `src/ratifiers/interfaces/ISetterRatifier.sol`, Forge artifact `out/ISetterRatifier.sol/ISetterRatifier.json`.
4022
- *
4023
- * @example
4024
- * ```ts
4025
- * import { setterRatifierAbi } from "@morpho-org/midnight-sdk";
4026
- *
4027
- * console.log(setterRatifierAbi.length);
4028
- * ```
4029
- */
4030
- exports.setterRatifierAbi = [
4031
- {
4032
- type: "function",
4033
- name: "MIDNIGHT",
4034
- inputs: [],
4035
- outputs: [
4036
- {
4037
- name: "",
4038
- type: "address",
4039
- internalType: "address",
4890
+ name: "collateralSupplies",
4891
+ type: "tuple[]",
4892
+ internalType: "struct CollateralTransfer[]",
4893
+ components: [
4894
+ {
4895
+ name: "collateralIndex",
4896
+ type: "uint256",
4897
+ internalType: "uint256",
4898
+ },
4899
+ {
4900
+ name: "assets",
4901
+ type: "uint256",
4902
+ internalType: "uint256",
4903
+ },
4904
+ ],
4040
4905
  },
4041
- ],
4042
- stateMutability: "view",
4043
- },
4044
- {
4045
- type: "function",
4046
- name: "isRatified",
4047
- inputs: [
4048
4906
  {
4049
- name: "offer",
4050
- type: "tuple",
4051
- internalType: "struct Offer",
4907
+ name: "offerFills",
4908
+ type: "tuple[]",
4909
+ internalType: "struct OfferFill[]",
4052
4910
  components: [
4053
4911
  {
4054
- name: "market",
4912
+ name: "offer",
4055
4913
  type: "tuple",
4056
- internalType: "struct Market",
4914
+ internalType: "struct Offer",
4057
4915
  components: [
4058
4916
  {
4059
- name: "chainId",
4060
- type: "uint256",
4061
- internalType: "uint256",
4062
- },
4063
- {
4064
- name: "midnight",
4065
- type: "address",
4066
- internalType: "address",
4067
- },
4068
- {
4069
- name: "loanToken",
4070
- type: "address",
4071
- internalType: "address",
4072
- },
4073
- {
4074
- name: "collateralParams",
4075
- type: "tuple[]",
4076
- internalType: "struct CollateralParams[]",
4917
+ name: "market",
4918
+ type: "tuple",
4919
+ internalType: "struct Market",
4077
4920
  components: [
4078
4921
  {
4079
- name: "token",
4922
+ name: "chainId",
4923
+ type: "uint256",
4924
+ internalType: "uint256",
4925
+ },
4926
+ {
4927
+ name: "midnight",
4080
4928
  type: "address",
4081
4929
  internalType: "address",
4082
4930
  },
4083
4931
  {
4084
- name: "lltv",
4932
+ name: "loanToken",
4933
+ type: "address",
4934
+ internalType: "address",
4935
+ },
4936
+ {
4937
+ name: "collateralParams",
4938
+ type: "tuple[]",
4939
+ internalType: "struct CollateralParams[]",
4940
+ components: [
4941
+ {
4942
+ name: "token",
4943
+ type: "address",
4944
+ internalType: "address",
4945
+ },
4946
+ {
4947
+ name: "lltv",
4948
+ type: "uint256",
4949
+ internalType: "uint256",
4950
+ },
4951
+ {
4952
+ name: "liquidationCursor",
4953
+ type: "uint256",
4954
+ internalType: "uint256",
4955
+ },
4956
+ {
4957
+ name: "oracle",
4958
+ type: "address",
4959
+ internalType: "address",
4960
+ },
4961
+ ],
4962
+ },
4963
+ {
4964
+ name: "maturity",
4085
4965
  type: "uint256",
4086
4966
  internalType: "uint256",
4087
4967
  },
4088
4968
  {
4089
- name: "liquidationCursor",
4969
+ name: "rcfThreshold",
4090
4970
  type: "uint256",
4091
4971
  internalType: "uint256",
4092
4972
  },
4093
4973
  {
4094
- name: "oracle",
4974
+ name: "enterGate",
4975
+ type: "address",
4976
+ internalType: "address",
4977
+ },
4978
+ {
4979
+ name: "liquidatorGate",
4095
4980
  type: "address",
4096
4981
  internalType: "address",
4097
4982
  },
4098
4983
  ],
4099
4984
  },
4100
4985
  {
4101
- name: "maturity",
4986
+ name: "buy",
4987
+ type: "bool",
4988
+ internalType: "bool",
4989
+ },
4990
+ {
4991
+ name: "maker",
4992
+ type: "address",
4993
+ internalType: "address",
4994
+ },
4995
+ {
4996
+ name: "start",
4102
4997
  type: "uint256",
4103
4998
  internalType: "uint256",
4104
4999
  },
4105
5000
  {
4106
- name: "rcfThreshold",
5001
+ name: "expiry",
4107
5002
  type: "uint256",
4108
5003
  internalType: "uint256",
4109
5004
  },
4110
5005
  {
4111
- name: "enterGate",
5006
+ name: "tick",
5007
+ type: "uint256",
5008
+ internalType: "uint256",
5009
+ },
5010
+ {
5011
+ name: "group",
5012
+ type: "bytes32",
5013
+ internalType: "bytes32",
5014
+ },
5015
+ {
5016
+ name: "callback",
4112
5017
  type: "address",
4113
5018
  internalType: "address",
4114
5019
  },
4115
5020
  {
4116
- name: "liquidatorGate",
5021
+ name: "callbackData",
5022
+ type: "bytes",
5023
+ internalType: "bytes",
5024
+ },
5025
+ {
5026
+ name: "receiverIfMakerIsSeller",
5027
+ type: "address",
5028
+ internalType: "address",
5029
+ },
5030
+ {
5031
+ name: "ratifier",
4117
5032
  type: "address",
4118
5033
  internalType: "address",
4119
5034
  },
5035
+ {
5036
+ name: "reduceOnly",
5037
+ type: "bool",
5038
+ internalType: "bool",
5039
+ },
5040
+ {
5041
+ name: "maxUnits",
5042
+ type: "uint128",
5043
+ internalType: "uint128",
5044
+ },
5045
+ {
5046
+ name: "maxAssets",
5047
+ type: "uint128",
5048
+ internalType: "uint128",
5049
+ },
5050
+ {
5051
+ name: "continuousFeeCap",
5052
+ type: "uint256",
5053
+ internalType: "uint256",
5054
+ },
4120
5055
  ],
4121
5056
  },
4122
5057
  {
4123
- name: "buy",
4124
- type: "bool",
4125
- internalType: "bool",
4126
- },
4127
- {
4128
- name: "maker",
4129
- type: "address",
4130
- internalType: "address",
4131
- },
4132
- {
4133
- name: "start",
4134
- type: "uint256",
4135
- internalType: "uint256",
4136
- },
4137
- {
4138
- name: "expiry",
4139
- type: "uint256",
4140
- internalType: "uint256",
4141
- },
4142
- {
4143
- name: "tick",
4144
- type: "uint256",
4145
- internalType: "uint256",
4146
- },
4147
- {
4148
- name: "group",
4149
- type: "bytes32",
4150
- internalType: "bytes32",
4151
- },
4152
- {
4153
- name: "callback",
4154
- type: "address",
4155
- internalType: "address",
4156
- },
4157
- {
4158
- name: "callbackData",
5058
+ name: "ratifierData",
4159
5059
  type: "bytes",
4160
5060
  internalType: "bytes",
4161
5061
  },
4162
5062
  {
4163
- name: "receiverIfMakerIsSeller",
4164
- type: "address",
4165
- internalType: "address",
4166
- },
4167
- {
4168
- name: "ratifier",
4169
- type: "address",
4170
- internalType: "address",
4171
- },
4172
- {
4173
- name: "reduceOnly",
4174
- type: "bool",
4175
- internalType: "bool",
4176
- },
4177
- {
4178
- name: "maxUnits",
4179
- type: "uint128",
4180
- internalType: "uint128",
4181
- },
4182
- {
4183
- name: "maxAssets",
4184
- type: "uint128",
4185
- internalType: "uint128",
4186
- },
4187
- {
4188
- name: "continuousFeeCap",
5063
+ name: "units",
4189
5064
  type: "uint256",
4190
5065
  internalType: "uint256",
4191
5066
  },
4192
5067
  ],
4193
5068
  },
4194
5069
  {
4195
- name: "ratifierData",
4196
- type: "bytes",
4197
- internalType: "bytes",
4198
- },
4199
- {
4200
- name: "taker",
4201
- type: "address",
4202
- internalType: "address",
4203
- },
4204
- ],
4205
- outputs: [
4206
- {
4207
- name: "",
4208
- type: "bytes32",
4209
- internalType: "bytes32",
5070
+ name: "referralFeePct",
5071
+ type: "uint256",
5072
+ internalType: "uint256",
4210
5073
  },
4211
- ],
4212
- stateMutability: "view",
4213
- },
4214
- {
4215
- type: "function",
4216
- name: "isRootRatified",
4217
- inputs: [
4218
5074
  {
4219
- name: "maker",
5075
+ name: "referralFeeRecipient",
4220
5076
  type: "address",
4221
5077
  internalType: "address",
4222
5078
  },
4223
5079
  {
4224
- name: "root",
4225
- type: "bytes32",
4226
- internalType: "bytes32",
4227
- },
4228
- ],
4229
- outputs: [
4230
- {
4231
- name: "",
4232
- type: "bool",
4233
- internalType: "bool",
5080
+ name: "deadline",
5081
+ type: "uint256",
5082
+ internalType: "uint256",
4234
5083
  },
4235
- ],
4236
- stateMutability: "view",
4237
- },
4238
- {
4239
- type: "function",
4240
- name: "setIsRootRatified",
4241
- inputs: [
4242
5084
  {
4243
- name: "maker",
5085
+ name: "wrappedNative",
4244
5086
  type: "address",
4245
5087
  internalType: "address",
4246
5088
  },
4247
- {
4248
- name: "root",
4249
- type: "bytes32",
4250
- internalType: "bytes32",
4251
- },
4252
- {
4253
- name: "newIsRootRatified",
4254
- type: "bool",
4255
- internalType: "bool",
4256
- },
4257
5089
  ],
4258
5090
  outputs: [],
4259
- stateMutability: "nonpayable",
5091
+ stateMutability: "payable",
4260
5092
  },
4261
5093
  {
4262
- type: "event",
4263
- name: "SetIsRootRatified",
4264
- inputs: [
4265
- {
4266
- name: "caller",
4267
- type: "address",
4268
- indexed: true,
4269
- internalType: "address",
4270
- },
4271
- {
4272
- name: "maker",
4273
- type: "address",
4274
- indexed: true,
4275
- internalType: "address",
4276
- },
4277
- {
4278
- name: "root",
4279
- type: "bytes32",
4280
- indexed: true,
4281
- internalType: "bytes32",
4282
- },
4283
- {
4284
- name: "newIsRootRatified",
4285
- type: "bool",
4286
- indexed: false,
4287
- internalType: "bool",
4288
- },
4289
- ],
4290
- anonymous: false,
5094
+ type: "error",
5095
+ name: "ApproveReturnedFalse",
5096
+ inputs: [],
4291
5097
  },
4292
5098
  {
4293
5099
  type: "error",
4294
- name: "InvalidProof",
5100
+ name: "ConsumedAboveMax",
4295
5101
  inputs: [],
4296
5102
  },
4297
5103
  {
4298
5104
  type: "error",
4299
- name: "NotRatified",
5105
+ name: "ContinuousFeeAboveMax",
4300
5106
  inputs: [],
4301
5107
  },
4302
5108
  {
4303
5109
  type: "error",
4304
- name: "Unauthorized",
5110
+ name: "DeadlinePassed",
4305
5111
  inputs: [],
4306
5112
  },
4307
- ];
4308
- /**
4309
- * Pinned ABI JSON for the PriceRatifierV1.
4310
- *
4311
- * Source: `morpho-org/midnight` commit `11f3d984b53286fd9137eb89e5d1385e23fe1b30`,
4312
- * `src/ratifiers/interfaces/IPriceRatifierV1.sol`, Forge artifact `out/IPriceRatifierV1.sol/IPriceRatifierV1.json`.
4313
- *
4314
- * @example
4315
- * ```ts
4316
- * import { priceRatifierV1Abi } from "@morpho-org/midnight-sdk";
4317
- *
4318
- * console.log(priceRatifierV1Abi.length);
4319
- * ```
4320
- */
4321
- exports.priceRatifierV1Abi = [
4322
5113
  {
4323
- type: "function",
4324
- name: "DOMAIN_SEPARATOR",
5114
+ type: "error",
5115
+ name: "InconsistentBlue",
4325
5116
  inputs: [],
4326
- outputs: [{ name: "", type: "bytes32", internalType: "bytes32" }],
4327
- stateMutability: "view",
4328
5117
  },
4329
5118
  {
4330
- type: "function",
4331
- name: "MIDNIGHT",
5119
+ type: "error",
5120
+ name: "InconsistentMarket",
4332
5121
  inputs: [],
4333
- outputs: [{ name: "", type: "address", internalType: "address" }],
4334
- stateMutability: "view",
4335
5122
  },
4336
5123
  {
4337
- type: "function",
4338
- name: "isRatified",
4339
- inputs: [
4340
- {
4341
- name: "offer",
4342
- type: "tuple",
4343
- internalType: "struct Offer",
4344
- components: [
4345
- {
4346
- name: "market",
4347
- type: "tuple",
4348
- internalType: "struct Market",
4349
- components: [
4350
- { name: "chainId", type: "uint256", internalType: "uint256" },
4351
- { name: "midnight", type: "address", internalType: "address" },
4352
- { name: "loanToken", type: "address", internalType: "address" },
4353
- {
4354
- name: "collateralParams",
4355
- type: "tuple[]",
4356
- internalType: "struct CollateralParams[]",
4357
- components: [
4358
- { name: "token", type: "address", internalType: "address" },
4359
- { name: "lltv", type: "uint256", internalType: "uint256" },
4360
- {
4361
- name: "liquidationCursor",
4362
- type: "uint256",
4363
- internalType: "uint256",
4364
- },
4365
- { name: "oracle", type: "address", internalType: "address" },
4366
- ],
4367
- },
4368
- { name: "maturity", type: "uint256", internalType: "uint256" },
4369
- {
4370
- name: "rcfThreshold",
4371
- type: "uint256",
4372
- internalType: "uint256",
4373
- },
4374
- { name: "enterGate", type: "address", internalType: "address" },
4375
- {
4376
- name: "liquidatorGate",
4377
- type: "address",
4378
- internalType: "address",
4379
- },
4380
- ],
4381
- },
4382
- { name: "buy", type: "bool", internalType: "bool" },
4383
- { name: "maker", type: "address", internalType: "address" },
4384
- { name: "start", type: "uint256", internalType: "uint256" },
4385
- { name: "expiry", type: "uint256", internalType: "uint256" },
4386
- { name: "tick", type: "uint256", internalType: "uint256" },
4387
- { name: "group", type: "bytes32", internalType: "bytes32" },
4388
- { name: "callback", type: "address", internalType: "address" },
4389
- { name: "callbackData", type: "bytes", internalType: "bytes" },
4390
- {
4391
- name: "receiverIfMakerIsSeller",
4392
- type: "address",
4393
- internalType: "address",
4394
- },
4395
- { name: "ratifier", type: "address", internalType: "address" },
4396
- { name: "reduceOnly", type: "bool", internalType: "bool" },
4397
- { name: "maxUnits", type: "uint128", internalType: "uint128" },
4398
- { name: "maxAssets", type: "uint128", internalType: "uint128" },
4399
- {
4400
- name: "continuousFeeCap",
4401
- type: "uint256",
4402
- internalType: "uint256",
4403
- },
4404
- ],
4405
- },
4406
- { name: "ratifierData", type: "bytes", internalType: "bytes" },
4407
- { name: "taker", type: "address", internalType: "address" },
4408
- ],
4409
- outputs: [{ name: "", type: "bytes32", internalType: "bytes32" }],
4410
- stateMutability: "view",
5124
+ type: "error",
5125
+ name: "InconsistentMidnight",
5126
+ inputs: [],
4411
5127
  },
4412
5128
  {
4413
- type: "function",
4414
- name: "isRootRatified",
4415
- inputs: [
4416
- { name: "maker", type: "address", internalType: "address" },
4417
- { name: "root", type: "bytes32", internalType: "bytes32" },
4418
- ],
4419
- outputs: [{ name: "", type: "bool", internalType: "bool" }],
4420
- stateMutability: "view",
5129
+ type: "error",
5130
+ name: "InconsistentSide",
5131
+ inputs: [],
4421
5132
  },
4422
5133
  {
4423
- type: "function",
4424
- name: "ratification",
4425
- inputs: [
4426
- { name: "maker", type: "address", internalType: "address" },
4427
- { name: "root", type: "bytes32", internalType: "bytes32" },
4428
- ],
4429
- outputs: [
4430
- { name: "isRootRatified", type: "bool", internalType: "bool" },
4431
- { name: "rootNonce", type: "uint128", internalType: "uint128" },
4432
- ],
4433
- stateMutability: "view",
5134
+ type: "error",
5135
+ name: "InvalidRatifierResponse",
5136
+ inputs: [],
4434
5137
  },
4435
5138
  {
4436
- type: "function",
4437
- name: "rootNonce",
4438
- inputs: [
4439
- { name: "maker", type: "address", internalType: "address" },
4440
- { name: "root", type: "bytes32", internalType: "bytes32" },
4441
- ],
4442
- outputs: [{ name: "", type: "uint128", internalType: "uint128" }],
4443
- stateMutability: "view",
5139
+ type: "error",
5140
+ name: "NoCode",
5141
+ inputs: [],
4444
5142
  },
4445
5143
  {
4446
- type: "function",
4447
- name: "setIsRootRatified",
4448
- inputs: [
4449
- { name: "maker", type: "address", internalType: "address" },
4450
- { name: "root", type: "bytes32", internalType: "bytes32" },
4451
- { name: "newIsRootRatified", type: "bool", internalType: "bool" },
4452
- ],
4453
- outputs: [{ name: "", type: "bytes32", internalType: "bytes32" }],
4454
- stateMutability: "nonpayable",
5144
+ type: "error",
5145
+ name: "NotReduceOnly",
5146
+ inputs: [],
4455
5147
  },
4456
5148
  {
4457
- type: "function",
4458
- name: "setIsRootRatifiedWithSig",
4459
- inputs: [
4460
- { name: "maker", type: "address", internalType: "address" },
4461
- { name: "root", type: "bytes32", internalType: "bytes32" },
4462
- { name: "height", type: "uint256", internalType: "uint256" },
4463
- { name: "newIsRootRatified", type: "bool", internalType: "bool" },
4464
- { name: "nonce", type: "uint128", internalType: "uint128" },
4465
- { name: "deadline", type: "uint256", internalType: "uint256" },
4466
- { name: "v", type: "uint8", internalType: "uint8" },
4467
- { name: "r", type: "bytes32", internalType: "bytes32" },
4468
- { name: "s", type: "bytes32", internalType: "bytes32" },
4469
- ],
4470
- outputs: [{ name: "", type: "bytes32", internalType: "bytes32" }],
4471
- stateMutability: "nonpayable",
5149
+ type: "error",
5150
+ name: "OutOfOffers",
5151
+ inputs: [],
4472
5152
  },
4473
5153
  {
4474
- type: "event",
4475
- name: "SetIsRootRatified",
4476
- inputs: [
4477
- {
4478
- name: "caller",
4479
- type: "address",
4480
- indexed: true,
4481
- internalType: "address",
4482
- },
4483
- {
4484
- name: "maker",
4485
- type: "address",
4486
- indexed: true,
4487
- internalType: "address",
4488
- },
4489
- { name: "root", type: "bytes32", indexed: true, internalType: "bytes32" },
4490
- {
4491
- name: "newIsRootRatified",
4492
- type: "bool",
4493
- indexed: false,
4494
- internalType: "bool",
4495
- },
4496
- ],
4497
- anonymous: false,
5154
+ type: "error",
5155
+ name: "PctExceeded",
5156
+ inputs: [],
4498
5157
  },
4499
5158
  {
4500
- type: "event",
4501
- name: "SetIsRootRatifiedWithSig",
4502
- inputs: [
4503
- {
4504
- name: "caller",
4505
- type: "address",
4506
- indexed: false,
4507
- internalType: "address",
4508
- },
4509
- {
4510
- name: "signer",
4511
- type: "address",
4512
- indexed: true,
4513
- internalType: "address",
4514
- },
4515
- {
4516
- name: "maker",
4517
- type: "address",
4518
- indexed: true,
4519
- internalType: "address",
4520
- },
4521
- { name: "root", type: "bytes32", indexed: true, internalType: "bytes32" },
4522
- {
4523
- name: "height",
4524
- type: "uint256",
4525
- indexed: false,
4526
- internalType: "uint256",
4527
- },
4528
- {
4529
- name: "newIsRootRatified",
4530
- type: "bool",
4531
- indexed: false,
4532
- internalType: "bool",
4533
- },
4534
- {
4535
- name: "signatureNonce",
4536
- type: "uint128",
4537
- indexed: false,
4538
- internalType: "uint128",
4539
- },
4540
- {
4541
- name: "previousNonce",
4542
- type: "uint128",
4543
- indexed: false,
4544
- internalType: "uint128",
4545
- },
4546
- ],
4547
- anonymous: false,
5159
+ type: "error",
5160
+ name: "PriceGreaterThanOne",
5161
+ inputs: [],
5162
+ },
5163
+ {
5164
+ type: "error",
5165
+ name: "SellerAssetsTooLow",
5166
+ inputs: [],
5167
+ },
5168
+ {
5169
+ type: "error",
5170
+ name: "TickOutOfRange",
5171
+ inputs: [],
5172
+ },
5173
+ {
5174
+ type: "error",
5175
+ name: "TransferFromReturnedFalse",
5176
+ inputs: [],
5177
+ },
5178
+ {
5179
+ type: "error",
5180
+ name: "TransferReturnedFalse",
5181
+ inputs: [],
5182
+ },
5183
+ {
5184
+ type: "error",
5185
+ name: "UnitsTooHigh",
5186
+ inputs: [],
5187
+ },
5188
+ {
5189
+ type: "error",
5190
+ name: "UnitsTooLow",
5191
+ inputs: [],
4548
5192
  },
4549
- { type: "error", name: "DeadlineExpired", inputs: [] },
4550
- { type: "error", name: "InvalidNonce", inputs: [] },
4551
- { type: "error", name: "InvalidProof", inputs: [] },
4552
- { type: "error", name: "InvalidSignature", inputs: [] },
4553
- { type: "error", name: "NotRatified", inputs: [] },
4554
- { type: "error", name: "RatifiedStatusChanged", inputs: [] },
4555
- { type: "error", name: "Unauthorized", inputs: [] },
4556
- { type: "error", name: "UnauthorizedTaker", inputs: [] },
4557
5193
  ];
4558
5194
  /**
4559
- * Pinned ABI JSON for the RateRatifierV1.
5195
+ * ABI JSON for the BlueBuyCallback factory that deploys per-owner callbacks funding Midnight buy
5196
+ * offers from Morpho Blue supply.
4560
5197
  *
4561
- * Source: `morpho-org/midnight` commit `11f3d984b53286fd9137eb89e5d1385e23fe1b30`,
4562
- * `src/ratifiers/interfaces/IRateRatifierV1.sol`, Forge artifact `out/IRateRatifierV1.sol/IRateRatifierV1.json`.
5198
+ * Source: `morpho-org/midnight` commit `4603969e80d6f911c33586c6b971e8edd7821bbc`,
5199
+ * `src/periphery/blue-buy-callback/BlueBuyCallbackFactory.sol` (compiled with `forge inspect ... abi`).
4563
5200
  *
4564
5201
  * @example
4565
5202
  * ```ts
4566
- * import { rateRatifierV1Abi } from "@morpho-org/midnight-sdk";
5203
+ * import { blueBuyCallbackFactoryAbi } from "@morpho-org/midnight-sdk";
4567
5204
  *
4568
- * console.log(rateRatifierV1Abi.length);
5205
+ * console.log(blueBuyCallbackFactoryAbi.length);
4569
5206
  * ```
4570
5207
  */
4571
- exports.rateRatifierV1Abi = [
5208
+ exports.blueBuyCallbackFactoryAbi = [
4572
5209
  {
4573
- type: "function",
4574
- name: "DOMAIN_SEPARATOR",
4575
- inputs: [],
4576
- outputs: [{ name: "", type: "bytes32", internalType: "bytes32" }],
4577
- stateMutability: "view",
5210
+ type: "constructor",
5211
+ inputs: [
5212
+ {
5213
+ name: "_midnight",
5214
+ type: "address",
5215
+ },
5216
+ {
5217
+ name: "_blue",
5218
+ type: "address",
5219
+ },
5220
+ ],
5221
+ stateMutability: "nonpayable",
4578
5222
  },
4579
5223
  {
4580
5224
  type: "function",
4581
- name: "MIDNIGHT",
5225
+ name: "BLUE",
4582
5226
  inputs: [],
4583
- outputs: [{ name: "", type: "address", internalType: "address" }],
4584
- stateMutability: "view",
4585
- },
4586
- {
4587
- type: "function",
4588
- name: "isRatified",
4589
- inputs: [
5227
+ outputs: [
4590
5228
  {
4591
- name: "offer",
4592
- type: "tuple",
4593
- internalType: "struct Offer",
4594
- components: [
4595
- {
4596
- name: "market",
4597
- type: "tuple",
4598
- internalType: "struct Market",
4599
- components: [
4600
- { name: "chainId", type: "uint256", internalType: "uint256" },
4601
- { name: "midnight", type: "address", internalType: "address" },
4602
- { name: "loanToken", type: "address", internalType: "address" },
4603
- {
4604
- name: "collateralParams",
4605
- type: "tuple[]",
4606
- internalType: "struct CollateralParams[]",
4607
- components: [
4608
- { name: "token", type: "address", internalType: "address" },
4609
- { name: "lltv", type: "uint256", internalType: "uint256" },
4610
- {
4611
- name: "liquidationCursor",
4612
- type: "uint256",
4613
- internalType: "uint256",
4614
- },
4615
- { name: "oracle", type: "address", internalType: "address" },
4616
- ],
4617
- },
4618
- { name: "maturity", type: "uint256", internalType: "uint256" },
4619
- {
4620
- name: "rcfThreshold",
4621
- type: "uint256",
4622
- internalType: "uint256",
4623
- },
4624
- { name: "enterGate", type: "address", internalType: "address" },
4625
- {
4626
- name: "liquidatorGate",
4627
- type: "address",
4628
- internalType: "address",
4629
- },
4630
- ],
4631
- },
4632
- { name: "buy", type: "bool", internalType: "bool" },
4633
- { name: "maker", type: "address", internalType: "address" },
4634
- { name: "start", type: "uint256", internalType: "uint256" },
4635
- { name: "expiry", type: "uint256", internalType: "uint256" },
4636
- { name: "tick", type: "uint256", internalType: "uint256" },
4637
- { name: "group", type: "bytes32", internalType: "bytes32" },
4638
- { name: "callback", type: "address", internalType: "address" },
4639
- { name: "callbackData", type: "bytes", internalType: "bytes" },
4640
- {
4641
- name: "receiverIfMakerIsSeller",
4642
- type: "address",
4643
- internalType: "address",
4644
- },
4645
- { name: "ratifier", type: "address", internalType: "address" },
4646
- { name: "reduceOnly", type: "bool", internalType: "bool" },
4647
- { name: "maxUnits", type: "uint128", internalType: "uint128" },
4648
- { name: "maxAssets", type: "uint128", internalType: "uint128" },
4649
- {
4650
- name: "continuousFeeCap",
4651
- type: "uint256",
4652
- internalType: "uint256",
4653
- },
4654
- ],
5229
+ name: "",
5230
+ type: "address",
4655
5231
  },
4656
- { name: "ratifierData", type: "bytes", internalType: "bytes" },
4657
- { name: "taker", type: "address", internalType: "address" },
4658
5232
  ],
4659
- outputs: [{ name: "", type: "bytes32", internalType: "bytes32" }],
4660
5233
  stateMutability: "view",
4661
5234
  },
4662
5235
  {
4663
5236
  type: "function",
4664
- name: "isRootRatified",
4665
- inputs: [
4666
- { name: "maker", type: "address", internalType: "address" },
4667
- { name: "root", type: "bytes32", internalType: "bytes32" },
5237
+ name: "MIDNIGHT",
5238
+ inputs: [],
5239
+ outputs: [
5240
+ {
5241
+ name: "",
5242
+ type: "address",
5243
+ },
4668
5244
  ],
4669
- outputs: [{ name: "", type: "bool", internalType: "bool" }],
4670
5245
  stateMutability: "view",
4671
5246
  },
4672
5247
  {
4673
5248
  type: "function",
4674
- name: "ratification",
5249
+ name: "callbackOf",
4675
5250
  inputs: [
4676
- { name: "maker", type: "address", internalType: "address" },
4677
- { name: "root", type: "bytes32", internalType: "bytes32" },
5251
+ {
5252
+ name: "owner",
5253
+ type: "address",
5254
+ },
5255
+ {
5256
+ name: "salt",
5257
+ type: "bytes32",
5258
+ },
4678
5259
  ],
4679
5260
  outputs: [
4680
- { name: "isRootRatified", type: "bool", internalType: "bool" },
4681
- { name: "rootNonce", type: "uint128", internalType: "uint128" },
5261
+ {
5262
+ name: "",
5263
+ type: "address",
5264
+ },
4682
5265
  ],
4683
5266
  stateMutability: "view",
4684
5267
  },
4685
5268
  {
4686
5269
  type: "function",
4687
- name: "rootNonce",
5270
+ name: "createBlueBuyCallback",
4688
5271
  inputs: [
4689
- { name: "maker", type: "address", internalType: "address" },
4690
- { name: "root", type: "bytes32", internalType: "bytes32" },
5272
+ {
5273
+ name: "owner",
5274
+ type: "address",
5275
+ },
5276
+ {
5277
+ name: "salt",
5278
+ type: "bytes32",
5279
+ },
4691
5280
  ],
4692
- outputs: [{ name: "", type: "uint128", internalType: "uint128" }],
4693
- stateMutability: "view",
4694
- },
4695
- {
4696
- type: "function",
4697
- name: "setIsRootRatified",
4698
- inputs: [
4699
- { name: "maker", type: "address", internalType: "address" },
4700
- { name: "root", type: "bytes32", internalType: "bytes32" },
4701
- { name: "newIsRootRatified", type: "bool", internalType: "bool" },
5281
+ outputs: [
5282
+ {
5283
+ name: "",
5284
+ type: "address",
5285
+ },
4702
5286
  ],
4703
- outputs: [{ name: "", type: "bytes32", internalType: "bytes32" }],
4704
5287
  stateMutability: "nonpayable",
4705
5288
  },
4706
5289
  {
4707
5290
  type: "function",
4708
- name: "setIsRootRatifiedWithSig",
4709
- inputs: [
4710
- { name: "maker", type: "address", internalType: "address" },
4711
- { name: "root", type: "bytes32", internalType: "bytes32" },
4712
- { name: "height", type: "uint256", internalType: "uint256" },
4713
- { name: "newIsRootRatified", type: "bool", internalType: "bool" },
4714
- { name: "nonce", type: "uint128", internalType: "uint128" },
4715
- { name: "deadline", type: "uint256", internalType: "uint256" },
4716
- { name: "v", type: "uint8", internalType: "uint8" },
4717
- { name: "r", type: "bytes32", internalType: "bytes32" },
4718
- { name: "s", type: "bytes32", internalType: "bytes32" },
4719
- ],
4720
- outputs: [{ name: "", type: "bytes32", internalType: "bytes32" }],
4721
- stateMutability: "nonpayable",
4722
- },
4723
- {
4724
- type: "event",
4725
- name: "SetIsRootRatified",
5291
+ name: "isBlueBuyCallback",
4726
5292
  inputs: [
4727
5293
  {
4728
- name: "caller",
4729
- type: "address",
4730
- indexed: true,
4731
- internalType: "address",
4732
- },
4733
- {
4734
- name: "maker",
5294
+ name: "callback",
4735
5295
  type: "address",
4736
- indexed: true,
4737
- internalType: "address",
4738
5296
  },
4739
- { name: "root", type: "bytes32", indexed: true, internalType: "bytes32" },
5297
+ ],
5298
+ outputs: [
4740
5299
  {
4741
- name: "newIsRootRatified",
5300
+ name: "",
4742
5301
  type: "bool",
4743
- indexed: false,
4744
- internalType: "bool",
4745
5302
  },
4746
5303
  ],
4747
- anonymous: false,
5304
+ stateMutability: "view",
4748
5305
  },
4749
5306
  {
4750
5307
  type: "event",
4751
- name: "SetIsRootRatifiedWithSig",
5308
+ name: "CreateBlueBuyCallback",
4752
5309
  inputs: [
4753
5310
  {
4754
5311
  name: "caller",
4755
5312
  type: "address",
4756
- indexed: false,
4757
- internalType: "address",
4758
- },
4759
- {
4760
- name: "signer",
4761
- type: "address",
4762
5313
  indexed: true,
4763
- internalType: "address",
4764
5314
  },
4765
5315
  {
4766
- name: "maker",
5316
+ name: "owner",
4767
5317
  type: "address",
4768
5318
  indexed: true,
4769
- internalType: "address",
4770
- },
4771
- { name: "root", type: "bytes32", indexed: true, internalType: "bytes32" },
4772
- {
4773
- name: "height",
4774
- type: "uint256",
4775
- indexed: false,
4776
- internalType: "uint256",
4777
5319
  },
4778
5320
  {
4779
- name: "newIsRootRatified",
4780
- type: "bool",
4781
- indexed: false,
4782
- internalType: "bool",
4783
- },
4784
- {
4785
- name: "signatureNonce",
4786
- type: "uint128",
5321
+ name: "salt",
5322
+ type: "bytes32",
4787
5323
  indexed: false,
4788
- internalType: "uint128",
4789
5324
  },
4790
5325
  {
4791
- name: "previousNonce",
4792
- type: "uint128",
5326
+ name: "callback",
5327
+ type: "address",
4793
5328
  indexed: false,
4794
- internalType: "uint128",
4795
5329
  },
4796
5330
  ],
4797
5331
  anonymous: false,
4798
5332
  },
4799
- { type: "error", name: "DeadlineExpired", inputs: [] },
4800
- { type: "error", name: "InvalidNonce", inputs: [] },
4801
- { type: "error", name: "InvalidProof", inputs: [] },
4802
- { type: "error", name: "InvalidSignature", inputs: [] },
4803
- { type: "error", name: "NotRatified", inputs: [] },
4804
- { type: "error", name: "RatifiedStatusChanged", inputs: [] },
4805
- { type: "error", name: "Unauthorized", inputs: [] },
4806
- { type: "error", name: "UnauthorizedTaker", inputs: [] },
4807
- { type: "error", name: "WorsePrice", inputs: [] },
4808
5333
  ];