@morpho-org/midnight-sdk 1.7.0-next.0 → 1.8.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.
Files changed (92) hide show
  1. package/README.md +61 -61
  2. package/lib/cjs/abis.d.ts +794 -0
  3. package/lib/cjs/abis.js +502 -1
  4. package/lib/cjs/api/version.generated.d.ts +1 -1
  5. package/lib/cjs/api/version.generated.js +2 -2
  6. package/lib/cjs/constants.d.ts +34 -0
  7. package/lib/cjs/constants.js +35 -1
  8. package/lib/cjs/errors.d.ts +107 -0
  9. package/lib/cjs/errors.js +139 -1
  10. package/lib/cjs/fetch/Ratifier.d.ts +4 -3
  11. package/lib/cjs/fetch/Ratifier.js +5 -4
  12. package/lib/cjs/index.d.ts +7 -0
  13. package/lib/cjs/index.js +16 -1
  14. package/lib/cjs/offers/Offer.d.ts +10 -0
  15. package/lib/cjs/offers/Offer.js +15 -1
  16. package/lib/cjs/offers/OfferUtils.d.ts +3 -0
  17. package/lib/cjs/offers/OfferUtils.js +3 -0
  18. package/lib/cjs/signatures/{EcrecoverRatifierUtils.d.ts → EcrecoverRatifier.d.ts} +118 -2
  19. package/lib/cjs/signatures/{EcrecoverRatifierUtils.js → EcrecoverRatifier.js} +146 -9
  20. package/lib/cjs/signatures/GroupUtils.d.ts +55 -2
  21. package/lib/cjs/signatures/GroupUtils.js +64 -5
  22. package/lib/cjs/signatures/Payload.d.ts +3 -3
  23. package/lib/cjs/signatures/PriceRatifierV1.d.ts +472 -0
  24. package/lib/cjs/signatures/PriceRatifierV1.js +521 -0
  25. package/lib/cjs/signatures/RateRatifierV1.d.ts +581 -0
  26. package/lib/cjs/signatures/RateRatifierV1.js +696 -0
  27. package/lib/{esm/signatures/RatifierUtils.d.ts → cjs/signatures/Ratifier.d.ts} +14 -12
  28. package/lib/cjs/signatures/{RatifierUtils.js → Ratifier.js} +29 -29
  29. package/lib/cjs/signatures/{SetterRatifierUtils.d.ts → SetterRatifier.d.ts} +50 -3
  30. package/lib/cjs/signatures/{SetterRatifierUtils.js → SetterRatifier.js} +65 -7
  31. package/lib/cjs/signatures/Tree.d.ts +94 -17
  32. package/lib/cjs/signatures/Tree.js +146 -111
  33. package/lib/cjs/signatures/TreeUtils.d.ts +191 -21
  34. package/lib/cjs/signatures/TreeUtils.js +320 -134
  35. package/lib/cjs/signatures/index.d.ts +7 -3
  36. package/lib/cjs/signatures/index.js +5 -3
  37. package/lib/cjs/signatures/ratifierRequests.d.ts +55 -0
  38. package/lib/cjs/signatures/ratifierRequests.js +2 -0
  39. package/lib/cjs/signatures/ratifierV1Internal.d.ts +57 -0
  40. package/lib/cjs/signatures/ratifierV1Internal.js +183 -0
  41. package/lib/cjs/signatures/standardRatifierInternal.d.ts +4 -0
  42. package/lib/cjs/signatures/standardRatifierInternal.js +12 -0
  43. package/lib/cjs/signatures/treeMathInternal.d.ts +4 -0
  44. package/lib/cjs/signatures/treeMathInternal.js +12 -0
  45. package/lib/cjs/signatures/treeTypes.d.ts +109 -0
  46. package/lib/cjs/signatures/treeTypes.js +2 -0
  47. package/lib/esm/abis.d.ts +794 -0
  48. package/lib/esm/abis.js +501 -0
  49. package/lib/esm/api/version.generated.d.ts +1 -1
  50. package/lib/esm/api/version.generated.js +2 -2
  51. package/lib/esm/constants.d.ts +34 -0
  52. package/lib/esm/constants.js +34 -0
  53. package/lib/esm/errors.d.ts +107 -0
  54. package/lib/esm/errors.js +132 -0
  55. package/lib/esm/fetch/Ratifier.d.ts +4 -3
  56. package/lib/esm/fetch/Ratifier.js +5 -4
  57. package/lib/esm/index.d.ts +7 -0
  58. package/lib/esm/index.js +5 -0
  59. package/lib/esm/offers/Offer.d.ts +10 -0
  60. package/lib/esm/offers/Offer.js +15 -1
  61. package/lib/esm/offers/OfferUtils.d.ts +3 -0
  62. package/lib/esm/offers/OfferUtils.js +3 -0
  63. package/lib/esm/signatures/{EcrecoverRatifierUtils.d.ts → EcrecoverRatifier.d.ts} +118 -2
  64. package/lib/esm/signatures/{EcrecoverRatifierUtils.js → EcrecoverRatifier.js} +146 -9
  65. package/lib/esm/signatures/GroupUtils.d.ts +55 -2
  66. package/lib/esm/signatures/GroupUtils.js +64 -5
  67. package/lib/esm/signatures/Payload.d.ts +3 -3
  68. package/lib/esm/signatures/PriceRatifierV1.d.ts +472 -0
  69. package/lib/esm/signatures/PriceRatifierV1.js +520 -0
  70. package/lib/esm/signatures/RateRatifierV1.d.ts +581 -0
  71. package/lib/esm/signatures/RateRatifierV1.js +695 -0
  72. package/lib/{cjs/signatures/RatifierUtils.d.ts → esm/signatures/Ratifier.d.ts} +14 -12
  73. package/lib/esm/signatures/{RatifierUtils.js → Ratifier.js} +31 -29
  74. package/lib/esm/signatures/{SetterRatifierUtils.d.ts → SetterRatifier.d.ts} +50 -3
  75. package/lib/esm/signatures/{SetterRatifierUtils.js → SetterRatifier.js} +65 -7
  76. package/lib/esm/signatures/Tree.d.ts +94 -17
  77. package/lib/esm/signatures/Tree.js +147 -112
  78. package/lib/esm/signatures/TreeUtils.d.ts +191 -21
  79. package/lib/esm/signatures/TreeUtils.js +318 -132
  80. package/lib/esm/signatures/index.d.ts +7 -3
  81. package/lib/esm/signatures/index.js +5 -3
  82. package/lib/esm/signatures/ratifierRequests.d.ts +55 -0
  83. package/lib/esm/signatures/ratifierRequests.js +1 -0
  84. package/lib/esm/signatures/ratifierV1Internal.d.ts +57 -0
  85. package/lib/esm/signatures/ratifierV1Internal.js +176 -0
  86. package/lib/esm/signatures/standardRatifierInternal.d.ts +4 -0
  87. package/lib/esm/signatures/standardRatifierInternal.js +9 -0
  88. package/lib/esm/signatures/treeMathInternal.d.ts +4 -0
  89. package/lib/esm/signatures/treeMathInternal.js +8 -0
  90. package/lib/esm/signatures/treeTypes.d.ts +109 -0
  91. package/lib/esm/signatures/treeTypes.js +1 -0
  92. package/package.json +4 -4
package/lib/cjs/abis.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.setterRatifierAbi = exports.ecrecoverRatifierAbi = exports.midnightBundlesAbi = exports.midnightAbi = void 0;
3
+ exports.rateRatifierV1Abi = exports.priceRatifierV1Abi = exports.setterRatifierAbi = exports.ecrecoverRatifierAbi = exports.midnightBundlesAbi = exports.midnightAbi = void 0;
4
4
  /**
5
5
  * Pinned ABI JSON for the core Midnight contract.
6
6
  *
@@ -4305,3 +4305,504 @@ exports.setterRatifierAbi = [
4305
4305
  inputs: [],
4306
4306
  },
4307
4307
  ];
4308
+ /**
4309
+ * Pinned ABI JSON for the PriceRatifierV1.
4310
+ *
4311
+ * Source: `morpho-org/midnight` commit `11f3d984b53286fd9137eb89e5d1385e23fe1b30`,
4312
+ * `src/ratifiers/interfaces/IPriceRatifierV1.sol`, Forge artifact `out/IPriceRatifierV1.sol/IPriceRatifierV1.json`.
4313
+ *
4314
+ * @example
4315
+ * ```ts
4316
+ * import { priceRatifierV1Abi } from "@morpho-org/midnight-sdk";
4317
+ *
4318
+ * console.log(priceRatifierV1Abi.length);
4319
+ * ```
4320
+ */
4321
+ exports.priceRatifierV1Abi = [
4322
+ {
4323
+ type: "function",
4324
+ name: "DOMAIN_SEPARATOR",
4325
+ inputs: [],
4326
+ outputs: [{ name: "", type: "bytes32", internalType: "bytes32" }],
4327
+ stateMutability: "view",
4328
+ },
4329
+ {
4330
+ type: "function",
4331
+ name: "MIDNIGHT",
4332
+ inputs: [],
4333
+ outputs: [{ name: "", type: "address", internalType: "address" }],
4334
+ stateMutability: "view",
4335
+ },
4336
+ {
4337
+ type: "function",
4338
+ name: "isRatified",
4339
+ inputs: [
4340
+ {
4341
+ name: "offer",
4342
+ type: "tuple",
4343
+ internalType: "struct Offer",
4344
+ components: [
4345
+ {
4346
+ name: "market",
4347
+ type: "tuple",
4348
+ internalType: "struct Market",
4349
+ components: [
4350
+ { name: "chainId", type: "uint256", internalType: "uint256" },
4351
+ { name: "midnight", type: "address", internalType: "address" },
4352
+ { name: "loanToken", type: "address", internalType: "address" },
4353
+ {
4354
+ name: "collateralParams",
4355
+ type: "tuple[]",
4356
+ internalType: "struct CollateralParams[]",
4357
+ components: [
4358
+ { name: "token", type: "address", internalType: "address" },
4359
+ { name: "lltv", type: "uint256", internalType: "uint256" },
4360
+ {
4361
+ name: "liquidationCursor",
4362
+ type: "uint256",
4363
+ internalType: "uint256",
4364
+ },
4365
+ { name: "oracle", type: "address", internalType: "address" },
4366
+ ],
4367
+ },
4368
+ { name: "maturity", type: "uint256", internalType: "uint256" },
4369
+ {
4370
+ name: "rcfThreshold",
4371
+ type: "uint256",
4372
+ internalType: "uint256",
4373
+ },
4374
+ { name: "enterGate", type: "address", internalType: "address" },
4375
+ {
4376
+ name: "liquidatorGate",
4377
+ type: "address",
4378
+ internalType: "address",
4379
+ },
4380
+ ],
4381
+ },
4382
+ { name: "buy", type: "bool", internalType: "bool" },
4383
+ { name: "maker", type: "address", internalType: "address" },
4384
+ { name: "start", type: "uint256", internalType: "uint256" },
4385
+ { name: "expiry", type: "uint256", internalType: "uint256" },
4386
+ { name: "tick", type: "uint256", internalType: "uint256" },
4387
+ { name: "group", type: "bytes32", internalType: "bytes32" },
4388
+ { name: "callback", type: "address", internalType: "address" },
4389
+ { name: "callbackData", type: "bytes", internalType: "bytes" },
4390
+ {
4391
+ name: "receiverIfMakerIsSeller",
4392
+ type: "address",
4393
+ internalType: "address",
4394
+ },
4395
+ { name: "ratifier", type: "address", internalType: "address" },
4396
+ { name: "reduceOnly", type: "bool", internalType: "bool" },
4397
+ { name: "maxUnits", type: "uint128", internalType: "uint128" },
4398
+ { name: "maxAssets", type: "uint128", internalType: "uint128" },
4399
+ {
4400
+ name: "continuousFeeCap",
4401
+ type: "uint256",
4402
+ internalType: "uint256",
4403
+ },
4404
+ ],
4405
+ },
4406
+ { name: "ratifierData", type: "bytes", internalType: "bytes" },
4407
+ { name: "taker", type: "address", internalType: "address" },
4408
+ ],
4409
+ outputs: [{ name: "", type: "bytes32", internalType: "bytes32" }],
4410
+ stateMutability: "view",
4411
+ },
4412
+ {
4413
+ type: "function",
4414
+ name: "isRootRatified",
4415
+ inputs: [
4416
+ { name: "maker", type: "address", internalType: "address" },
4417
+ { name: "root", type: "bytes32", internalType: "bytes32" },
4418
+ ],
4419
+ outputs: [{ name: "", type: "bool", internalType: "bool" }],
4420
+ stateMutability: "view",
4421
+ },
4422
+ {
4423
+ type: "function",
4424
+ name: "ratification",
4425
+ inputs: [
4426
+ { name: "maker", type: "address", internalType: "address" },
4427
+ { name: "root", type: "bytes32", internalType: "bytes32" },
4428
+ ],
4429
+ outputs: [
4430
+ { name: "isRootRatified", type: "bool", internalType: "bool" },
4431
+ { name: "rootNonce", type: "uint128", internalType: "uint128" },
4432
+ ],
4433
+ stateMutability: "view",
4434
+ },
4435
+ {
4436
+ type: "function",
4437
+ name: "rootNonce",
4438
+ inputs: [
4439
+ { name: "maker", type: "address", internalType: "address" },
4440
+ { name: "root", type: "bytes32", internalType: "bytes32" },
4441
+ ],
4442
+ outputs: [{ name: "", type: "uint128", internalType: "uint128" }],
4443
+ stateMutability: "view",
4444
+ },
4445
+ {
4446
+ type: "function",
4447
+ name: "setIsRootRatified",
4448
+ inputs: [
4449
+ { name: "maker", type: "address", internalType: "address" },
4450
+ { name: "root", type: "bytes32", internalType: "bytes32" },
4451
+ { name: "newIsRootRatified", type: "bool", internalType: "bool" },
4452
+ ],
4453
+ outputs: [{ name: "", type: "bytes32", internalType: "bytes32" }],
4454
+ stateMutability: "nonpayable",
4455
+ },
4456
+ {
4457
+ type: "function",
4458
+ name: "setIsRootRatifiedWithSig",
4459
+ inputs: [
4460
+ { name: "maker", type: "address", internalType: "address" },
4461
+ { name: "root", type: "bytes32", internalType: "bytes32" },
4462
+ { name: "height", type: "uint256", internalType: "uint256" },
4463
+ { name: "newIsRootRatified", type: "bool", internalType: "bool" },
4464
+ { name: "nonce", type: "uint128", internalType: "uint128" },
4465
+ { name: "deadline", type: "uint256", internalType: "uint256" },
4466
+ { name: "v", type: "uint8", internalType: "uint8" },
4467
+ { name: "r", type: "bytes32", internalType: "bytes32" },
4468
+ { name: "s", type: "bytes32", internalType: "bytes32" },
4469
+ ],
4470
+ outputs: [{ name: "", type: "bytes32", internalType: "bytes32" }],
4471
+ stateMutability: "nonpayable",
4472
+ },
4473
+ {
4474
+ type: "event",
4475
+ name: "SetIsRootRatified",
4476
+ inputs: [
4477
+ {
4478
+ name: "caller",
4479
+ type: "address",
4480
+ indexed: true,
4481
+ internalType: "address",
4482
+ },
4483
+ {
4484
+ name: "maker",
4485
+ type: "address",
4486
+ indexed: true,
4487
+ internalType: "address",
4488
+ },
4489
+ { name: "root", type: "bytes32", indexed: true, internalType: "bytes32" },
4490
+ {
4491
+ name: "newIsRootRatified",
4492
+ type: "bool",
4493
+ indexed: false,
4494
+ internalType: "bool",
4495
+ },
4496
+ ],
4497
+ anonymous: false,
4498
+ },
4499
+ {
4500
+ type: "event",
4501
+ name: "SetIsRootRatifiedWithSig",
4502
+ inputs: [
4503
+ {
4504
+ name: "caller",
4505
+ type: "address",
4506
+ indexed: false,
4507
+ internalType: "address",
4508
+ },
4509
+ {
4510
+ name: "signer",
4511
+ type: "address",
4512
+ indexed: true,
4513
+ internalType: "address",
4514
+ },
4515
+ {
4516
+ name: "maker",
4517
+ type: "address",
4518
+ indexed: true,
4519
+ internalType: "address",
4520
+ },
4521
+ { name: "root", type: "bytes32", indexed: true, internalType: "bytes32" },
4522
+ {
4523
+ name: "height",
4524
+ type: "uint256",
4525
+ indexed: false,
4526
+ internalType: "uint256",
4527
+ },
4528
+ {
4529
+ name: "newIsRootRatified",
4530
+ type: "bool",
4531
+ indexed: false,
4532
+ internalType: "bool",
4533
+ },
4534
+ {
4535
+ name: "signatureNonce",
4536
+ type: "uint128",
4537
+ indexed: false,
4538
+ internalType: "uint128",
4539
+ },
4540
+ {
4541
+ name: "previousNonce",
4542
+ type: "uint128",
4543
+ indexed: false,
4544
+ internalType: "uint128",
4545
+ },
4546
+ ],
4547
+ anonymous: false,
4548
+ },
4549
+ { type: "error", name: "DeadlineExpired", inputs: [] },
4550
+ { type: "error", name: "InvalidNonce", inputs: [] },
4551
+ { type: "error", name: "InvalidProof", inputs: [] },
4552
+ { type: "error", name: "InvalidSignature", inputs: [] },
4553
+ { type: "error", name: "NotRatified", inputs: [] },
4554
+ { type: "error", name: "RatifiedStatusChanged", inputs: [] },
4555
+ { type: "error", name: "Unauthorized", inputs: [] },
4556
+ { type: "error", name: "UnauthorizedTaker", inputs: [] },
4557
+ ];
4558
+ /**
4559
+ * Pinned ABI JSON for the RateRatifierV1.
4560
+ *
4561
+ * Source: `morpho-org/midnight` commit `11f3d984b53286fd9137eb89e5d1385e23fe1b30`,
4562
+ * `src/ratifiers/interfaces/IRateRatifierV1.sol`, Forge artifact `out/IRateRatifierV1.sol/IRateRatifierV1.json`.
4563
+ *
4564
+ * @example
4565
+ * ```ts
4566
+ * import { rateRatifierV1Abi } from "@morpho-org/midnight-sdk";
4567
+ *
4568
+ * console.log(rateRatifierV1Abi.length);
4569
+ * ```
4570
+ */
4571
+ exports.rateRatifierV1Abi = [
4572
+ {
4573
+ type: "function",
4574
+ name: "DOMAIN_SEPARATOR",
4575
+ inputs: [],
4576
+ outputs: [{ name: "", type: "bytes32", internalType: "bytes32" }],
4577
+ stateMutability: "view",
4578
+ },
4579
+ {
4580
+ type: "function",
4581
+ name: "MIDNIGHT",
4582
+ inputs: [],
4583
+ outputs: [{ name: "", type: "address", internalType: "address" }],
4584
+ stateMutability: "view",
4585
+ },
4586
+ {
4587
+ type: "function",
4588
+ name: "isRatified",
4589
+ inputs: [
4590
+ {
4591
+ name: "offer",
4592
+ type: "tuple",
4593
+ internalType: "struct Offer",
4594
+ components: [
4595
+ {
4596
+ name: "market",
4597
+ type: "tuple",
4598
+ internalType: "struct Market",
4599
+ components: [
4600
+ { name: "chainId", type: "uint256", internalType: "uint256" },
4601
+ { name: "midnight", type: "address", internalType: "address" },
4602
+ { name: "loanToken", type: "address", internalType: "address" },
4603
+ {
4604
+ name: "collateralParams",
4605
+ type: "tuple[]",
4606
+ internalType: "struct CollateralParams[]",
4607
+ components: [
4608
+ { name: "token", type: "address", internalType: "address" },
4609
+ { name: "lltv", type: "uint256", internalType: "uint256" },
4610
+ {
4611
+ name: "liquidationCursor",
4612
+ type: "uint256",
4613
+ internalType: "uint256",
4614
+ },
4615
+ { name: "oracle", type: "address", internalType: "address" },
4616
+ ],
4617
+ },
4618
+ { name: "maturity", type: "uint256", internalType: "uint256" },
4619
+ {
4620
+ name: "rcfThreshold",
4621
+ type: "uint256",
4622
+ internalType: "uint256",
4623
+ },
4624
+ { name: "enterGate", type: "address", internalType: "address" },
4625
+ {
4626
+ name: "liquidatorGate",
4627
+ type: "address",
4628
+ internalType: "address",
4629
+ },
4630
+ ],
4631
+ },
4632
+ { name: "buy", type: "bool", internalType: "bool" },
4633
+ { name: "maker", type: "address", internalType: "address" },
4634
+ { name: "start", type: "uint256", internalType: "uint256" },
4635
+ { name: "expiry", type: "uint256", internalType: "uint256" },
4636
+ { name: "tick", type: "uint256", internalType: "uint256" },
4637
+ { name: "group", type: "bytes32", internalType: "bytes32" },
4638
+ { name: "callback", type: "address", internalType: "address" },
4639
+ { name: "callbackData", type: "bytes", internalType: "bytes" },
4640
+ {
4641
+ name: "receiverIfMakerIsSeller",
4642
+ type: "address",
4643
+ internalType: "address",
4644
+ },
4645
+ { name: "ratifier", type: "address", internalType: "address" },
4646
+ { name: "reduceOnly", type: "bool", internalType: "bool" },
4647
+ { name: "maxUnits", type: "uint128", internalType: "uint128" },
4648
+ { name: "maxAssets", type: "uint128", internalType: "uint128" },
4649
+ {
4650
+ name: "continuousFeeCap",
4651
+ type: "uint256",
4652
+ internalType: "uint256",
4653
+ },
4654
+ ],
4655
+ },
4656
+ { name: "ratifierData", type: "bytes", internalType: "bytes" },
4657
+ { name: "taker", type: "address", internalType: "address" },
4658
+ ],
4659
+ outputs: [{ name: "", type: "bytes32", internalType: "bytes32" }],
4660
+ stateMutability: "view",
4661
+ },
4662
+ {
4663
+ type: "function",
4664
+ name: "isRootRatified",
4665
+ inputs: [
4666
+ { name: "maker", type: "address", internalType: "address" },
4667
+ { name: "root", type: "bytes32", internalType: "bytes32" },
4668
+ ],
4669
+ outputs: [{ name: "", type: "bool", internalType: "bool" }],
4670
+ stateMutability: "view",
4671
+ },
4672
+ {
4673
+ type: "function",
4674
+ name: "ratification",
4675
+ inputs: [
4676
+ { name: "maker", type: "address", internalType: "address" },
4677
+ { name: "root", type: "bytes32", internalType: "bytes32" },
4678
+ ],
4679
+ outputs: [
4680
+ { name: "isRootRatified", type: "bool", internalType: "bool" },
4681
+ { name: "rootNonce", type: "uint128", internalType: "uint128" },
4682
+ ],
4683
+ stateMutability: "view",
4684
+ },
4685
+ {
4686
+ type: "function",
4687
+ name: "rootNonce",
4688
+ inputs: [
4689
+ { name: "maker", type: "address", internalType: "address" },
4690
+ { name: "root", type: "bytes32", internalType: "bytes32" },
4691
+ ],
4692
+ outputs: [{ name: "", type: "uint128", internalType: "uint128" }],
4693
+ stateMutability: "view",
4694
+ },
4695
+ {
4696
+ type: "function",
4697
+ name: "setIsRootRatified",
4698
+ inputs: [
4699
+ { name: "maker", type: "address", internalType: "address" },
4700
+ { name: "root", type: "bytes32", internalType: "bytes32" },
4701
+ { name: "newIsRootRatified", type: "bool", internalType: "bool" },
4702
+ ],
4703
+ outputs: [{ name: "", type: "bytes32", internalType: "bytes32" }],
4704
+ stateMutability: "nonpayable",
4705
+ },
4706
+ {
4707
+ type: "function",
4708
+ name: "setIsRootRatifiedWithSig",
4709
+ inputs: [
4710
+ { name: "maker", type: "address", internalType: "address" },
4711
+ { name: "root", type: "bytes32", internalType: "bytes32" },
4712
+ { name: "height", type: "uint256", internalType: "uint256" },
4713
+ { name: "newIsRootRatified", type: "bool", internalType: "bool" },
4714
+ { name: "nonce", type: "uint128", internalType: "uint128" },
4715
+ { name: "deadline", type: "uint256", internalType: "uint256" },
4716
+ { name: "v", type: "uint8", internalType: "uint8" },
4717
+ { name: "r", type: "bytes32", internalType: "bytes32" },
4718
+ { name: "s", type: "bytes32", internalType: "bytes32" },
4719
+ ],
4720
+ outputs: [{ name: "", type: "bytes32", internalType: "bytes32" }],
4721
+ stateMutability: "nonpayable",
4722
+ },
4723
+ {
4724
+ type: "event",
4725
+ name: "SetIsRootRatified",
4726
+ inputs: [
4727
+ {
4728
+ name: "caller",
4729
+ type: "address",
4730
+ indexed: true,
4731
+ internalType: "address",
4732
+ },
4733
+ {
4734
+ name: "maker",
4735
+ type: "address",
4736
+ indexed: true,
4737
+ internalType: "address",
4738
+ },
4739
+ { name: "root", type: "bytes32", indexed: true, internalType: "bytes32" },
4740
+ {
4741
+ name: "newIsRootRatified",
4742
+ type: "bool",
4743
+ indexed: false,
4744
+ internalType: "bool",
4745
+ },
4746
+ ],
4747
+ anonymous: false,
4748
+ },
4749
+ {
4750
+ type: "event",
4751
+ name: "SetIsRootRatifiedWithSig",
4752
+ inputs: [
4753
+ {
4754
+ name: "caller",
4755
+ type: "address",
4756
+ indexed: false,
4757
+ internalType: "address",
4758
+ },
4759
+ {
4760
+ name: "signer",
4761
+ type: "address",
4762
+ indexed: true,
4763
+ internalType: "address",
4764
+ },
4765
+ {
4766
+ name: "maker",
4767
+ type: "address",
4768
+ indexed: true,
4769
+ internalType: "address",
4770
+ },
4771
+ { name: "root", type: "bytes32", indexed: true, internalType: "bytes32" },
4772
+ {
4773
+ name: "height",
4774
+ type: "uint256",
4775
+ indexed: false,
4776
+ internalType: "uint256",
4777
+ },
4778
+ {
4779
+ name: "newIsRootRatified",
4780
+ type: "bool",
4781
+ indexed: false,
4782
+ internalType: "bool",
4783
+ },
4784
+ {
4785
+ name: "signatureNonce",
4786
+ type: "uint128",
4787
+ indexed: false,
4788
+ internalType: "uint128",
4789
+ },
4790
+ {
4791
+ name: "previousNonce",
4792
+ type: "uint128",
4793
+ indexed: false,
4794
+ internalType: "uint128",
4795
+ },
4796
+ ],
4797
+ anonymous: false,
4798
+ },
4799
+ { type: "error", name: "DeadlineExpired", inputs: [] },
4800
+ { type: "error", name: "InvalidNonce", inputs: [] },
4801
+ { type: "error", name: "InvalidProof", inputs: [] },
4802
+ { type: "error", name: "InvalidSignature", inputs: [] },
4803
+ { type: "error", name: "NotRatified", inputs: [] },
4804
+ { type: "error", name: "RatifiedStatusChanged", inputs: [] },
4805
+ { type: "error", name: "Unauthorized", inputs: [] },
4806
+ { type: "error", name: "UnauthorizedTaker", inputs: [] },
4807
+ { type: "error", name: "WorsePrice", inputs: [] },
4808
+ ];
@@ -1,2 +1,2 @@
1
1
  /** @internal Installed Midnight SDK package version. */
2
- export declare const MIDNIGHT_SDK_VERSION = "1.7.0-next.0";
2
+ export declare const MIDNIGHT_SDK_VERSION = "1.8.0";
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
- // Generated by scripts/release/generate-midnight-package-version.mjs. Do not edit.
2
+ // Generated by scripts/release/generate-midnight-package-version.ts. Do not edit.
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.MIDNIGHT_SDK_VERSION = void 0;
5
5
  /** @internal Installed Midnight SDK package version. */
6
- exports.MIDNIGHT_SDK_VERSION = "1.7.0-next.0";
6
+ exports.MIDNIGHT_SDK_VERSION = "1.8.0";
@@ -111,6 +111,18 @@ export declare const MAX_CONTINUOUS_FEE = 317097919n;
111
111
  * ```
112
112
  */
113
113
  export declare const MAX_OFFER_CAP: bigint;
114
+ /**
115
+ * Maximum Merkle tree height supported by the Midnight offer-tree typehash
116
+ * tables, enforced by every ratifier tree helper (Ecrecover, Setter, and V1).
117
+ *
118
+ * @example
119
+ * ```ts
120
+ * import { MAX_TREE_HEIGHT } from "@morpho-org/midnight-sdk";
121
+ *
122
+ * console.log(MAX_TREE_HEIGHT);
123
+ * ```
124
+ */
125
+ export declare const MAX_TREE_HEIGHT = 20;
114
126
  /**
115
127
  * Seconds after maturity over which post-maturity LIF reaches the computed
116
128
  * maximum liquidation incentive factor.
@@ -156,6 +168,28 @@ export declare const MARKET_TYPEHASH = "0x510b3862f3816a109c9340b76972e8a3098424
156
168
  * ```
157
169
  */
158
170
  export declare const OFFER_TYPEHASH = "0x9905214264a9fb7b6cc1b0e33db7a04687c6e4185a84755d29914314aa9d8906";
171
+ /**
172
+ * HashLib PriceRatifierV1 offer typehash.
173
+ *
174
+ * @example
175
+ * ```ts
176
+ * import { PRICE_RATIFIER_V1_OFFER_TYPEHASH } from "@morpho-org/midnight-sdk";
177
+ *
178
+ * console.log(PRICE_RATIFIER_V1_OFFER_TYPEHASH);
179
+ * ```
180
+ */
181
+ export declare const PRICE_RATIFIER_V1_OFFER_TYPEHASH = "0x62a94097fbcb9b56e3cf7b4f7bb075b49540b1364815434ff4b16bc4decb303d";
182
+ /**
183
+ * HashLib RateRatifierV1 offer typehash.
184
+ *
185
+ * @example
186
+ * ```ts
187
+ * import { RATE_RATIFIER_V1_OFFER_TYPEHASH } from "@morpho-org/midnight-sdk";
188
+ *
189
+ * console.log(RATE_RATIFIER_V1_OFFER_TYPEHASH);
190
+ * ```
191
+ */
192
+ export declare const RATE_RATIFIER_V1_OFFER_TYPEHASH = "0x8e0f9c17bf7e919b5f22e8c6c4e787905f45864a4be441067bbd2e65b35c3de1";
159
193
  /**
160
194
  * EcrecoverRatifier EIP-712 domain typehash.
161
195
  *
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.EIP712_DOMAIN_TYPEHASH = exports.OFFER_TYPEHASH = exports.MARKET_TYPEHASH = exports.COLLATERAL_PARAMS_TYPEHASH = exports.TIME_TO_MAX_LIF = exports.MAX_OFFER_CAP = exports.MAX_CONTINUOUS_FEE = exports.MAX_SETTLEMENT_FEES = exports.MAX_COLLATERALS_PER_BORROWER = exports.MAX_COLLATERALS = exports.DEFAULT_TICK_SPACING = exports.PRICE_ROUNDING_STEP = exports.MAX_TICK = exports.SETTLEMENT_FEE_BREAKPOINTS = exports.CBP = void 0;
3
+ exports.EIP712_DOMAIN_TYPEHASH = exports.RATE_RATIFIER_V1_OFFER_TYPEHASH = exports.PRICE_RATIFIER_V1_OFFER_TYPEHASH = exports.OFFER_TYPEHASH = exports.MARKET_TYPEHASH = exports.COLLATERAL_PARAMS_TYPEHASH = exports.TIME_TO_MAX_LIF = exports.MAX_TREE_HEIGHT = exports.MAX_OFFER_CAP = exports.MAX_CONTINUOUS_FEE = exports.MAX_SETTLEMENT_FEES = exports.MAX_COLLATERALS_PER_BORROWER = exports.MAX_COLLATERALS = exports.DEFAULT_TICK_SPACING = exports.PRICE_ROUNDING_STEP = exports.MAX_TICK = exports.SETTLEMENT_FEE_BREAKPOINTS = exports.CBP = void 0;
4
4
  const viem_1 = require("viem");
5
5
  /**
6
6
  * Centibip scale used by settlement fees.
@@ -131,6 +131,18 @@ exports.MAX_CONTINUOUS_FEE = 317097919n;
131
131
  * ```
132
132
  */
133
133
  exports.MAX_OFFER_CAP = viem_1.maxUint128;
134
+ /**
135
+ * Maximum Merkle tree height supported by the Midnight offer-tree typehash
136
+ * tables, enforced by every ratifier tree helper (Ecrecover, Setter, and V1).
137
+ *
138
+ * @example
139
+ * ```ts
140
+ * import { MAX_TREE_HEIGHT } from "@morpho-org/midnight-sdk";
141
+ *
142
+ * console.log(MAX_TREE_HEIGHT);
143
+ * ```
144
+ */
145
+ exports.MAX_TREE_HEIGHT = 20;
134
146
  /**
135
147
  * Seconds after maturity over which post-maturity LIF reaches the computed
136
148
  * maximum liquidation incentive factor.
@@ -176,6 +188,28 @@ exports.MARKET_TYPEHASH = "0x510b3862f3816a109c9340b76972e8a30984246be06e034ae12
176
188
  * ```
177
189
  */
178
190
  exports.OFFER_TYPEHASH = "0x9905214264a9fb7b6cc1b0e33db7a04687c6e4185a84755d29914314aa9d8906";
191
+ /**
192
+ * HashLib PriceRatifierV1 offer typehash.
193
+ *
194
+ * @example
195
+ * ```ts
196
+ * import { PRICE_RATIFIER_V1_OFFER_TYPEHASH } from "@morpho-org/midnight-sdk";
197
+ *
198
+ * console.log(PRICE_RATIFIER_V1_OFFER_TYPEHASH);
199
+ * ```
200
+ */
201
+ exports.PRICE_RATIFIER_V1_OFFER_TYPEHASH = "0x62a94097fbcb9b56e3cf7b4f7bb075b49540b1364815434ff4b16bc4decb303d";
202
+ /**
203
+ * HashLib RateRatifierV1 offer typehash.
204
+ *
205
+ * @example
206
+ * ```ts
207
+ * import { RATE_RATIFIER_V1_OFFER_TYPEHASH } from "@morpho-org/midnight-sdk";
208
+ *
209
+ * console.log(RATE_RATIFIER_V1_OFFER_TYPEHASH);
210
+ * ```
211
+ */
212
+ exports.RATE_RATIFIER_V1_OFFER_TYPEHASH = "0x8e0f9c17bf7e919b5f22e8c6c4e787905f45864a4be441067bbd2e65b35c3de1";
179
213
  /**
180
214
  * EcrecoverRatifier EIP-712 domain typehash.
181
215
  *