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