@optimex-xyz/market-maker-sdk 0.9.0-dev-df6089b → 0.9.0-dev-6069ee6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -14,7 +14,7 @@ var environments = {
14
14
  ethereum_sepolia: "0x1d8b58438D5Ccc8Fcb4b738C89078f7b4168C9c0"
15
15
  },
16
16
  liquidationAddressMap: {
17
- ethereum_sepolia: "0xf9dbdC0C4ADcb2A33a25a5F01893c54533D77B49"
17
+ ethereum_sepolia: "0xeEeD356dCa26e6F0957c55FCa46451814cCF134f"
18
18
  }
19
19
  },
20
20
  staging: {
@@ -129,7 +129,7 @@ var sdk = new SDK();
129
129
  var factories_exports = {};
130
130
  __export(factories_exports, {
131
131
  ERC20__factory: () => ERC20__factory,
132
- LendingLiquidation__factory: () => LendingLiquidation__factory,
132
+ MorphoLiquidator__factory: () => MorphoLiquidator__factory,
133
133
  Payment__factory: () => Payment__factory,
134
134
  ProtocolFetcherProxy__factory: () => ProtocolFetcherProxy__factory,
135
135
  Router__factory: () => Router__factory,
@@ -1536,24 +1536,14 @@ var ERC20__factory = class {
1536
1536
  };
1537
1537
  ERC20__factory.abi = _abi;
1538
1538
 
1539
- // src/contracts/contracts/factories/LendingLiquidation__factory.ts
1539
+ // src/contracts/contracts/factories/MorphoLiquidator__factory.ts
1540
1540
  import { Contract as Contract2, Interface as Interface2 } from "ethers";
1541
1541
  var _abi2 = [
1542
1542
  {
1543
1543
  inputs: [
1544
1544
  {
1545
1545
  internalType: "address",
1546
- name: "_owBtc",
1547
- type: "address"
1548
- },
1549
- {
1550
- internalType: "address",
1551
- name: "_morpho",
1552
- type: "address"
1553
- },
1554
- {
1555
- internalType: "address",
1556
- name: "_lendingManagement",
1546
+ name: "morphoManagement",
1557
1547
  type: "address"
1558
1548
  },
1559
1549
  {
@@ -1618,6 +1608,17 @@ var _abi2 = [
1618
1608
  name: "InvalidMorpho",
1619
1609
  type: "error"
1620
1610
  },
1611
+ {
1612
+ inputs: [
1613
+ {
1614
+ internalType: "bytes32",
1615
+ name: "positionId",
1616
+ type: "bytes32"
1617
+ }
1618
+ ],
1619
+ name: "InvalidPositionId",
1620
+ type: "error"
1621
+ },
1621
1622
  {
1622
1623
  inputs: [],
1623
1624
  name: "InvalidShortString",
@@ -1644,6 +1645,27 @@ var _abi2 = [
1644
1645
  name: "ReentrancyGuardReentrantCall",
1645
1646
  type: "error"
1646
1647
  },
1648
+ {
1649
+ inputs: [
1650
+ {
1651
+ internalType: "address",
1652
+ name: "spender",
1653
+ type: "address"
1654
+ },
1655
+ {
1656
+ internalType: "uint256",
1657
+ name: "currentAllowance",
1658
+ type: "uint256"
1659
+ },
1660
+ {
1661
+ internalType: "uint256",
1662
+ name: "requestedDecrease",
1663
+ type: "uint256"
1664
+ }
1665
+ ],
1666
+ name: "SafeERC20FailedDecreaseAllowance",
1667
+ type: "error"
1668
+ },
1647
1669
  {
1648
1670
  inputs: [
1649
1671
  {
@@ -1666,6 +1688,16 @@ var _abi2 = [
1666
1688
  name: "StringTooLong",
1667
1689
  type: "error"
1668
1690
  },
1691
+ {
1692
+ inputs: [],
1693
+ name: "ZeroAddress",
1694
+ type: "error"
1695
+ },
1696
+ {
1697
+ inputs: [],
1698
+ name: "ZeroAmount",
1699
+ type: "error"
1700
+ },
1669
1701
  {
1670
1702
  anonymous: false,
1671
1703
  inputs: [],
@@ -1688,27 +1720,27 @@ var _abi2 = [
1688
1720
  type: "bytes32"
1689
1721
  },
1690
1722
  {
1691
- indexed: true,
1723
+ indexed: false,
1692
1724
  internalType: "bytes32",
1693
- name: "tradeId",
1725
+ name: "marketId",
1694
1726
  type: "bytes32"
1695
1727
  },
1696
1728
  {
1697
1729
  indexed: false,
1698
- internalType: "bytes32",
1699
- name: "marketId",
1700
- type: "bytes32"
1730
+ internalType: "uint256",
1731
+ name: "totalCollateral",
1732
+ type: "uint256"
1701
1733
  },
1702
1734
  {
1703
1735
  indexed: false,
1704
1736
  internalType: "uint256",
1705
- name: "repaidLoan",
1737
+ name: "totalPayment",
1706
1738
  type: "uint256"
1707
1739
  },
1708
1740
  {
1709
1741
  indexed: false,
1710
1742
  internalType: "uint256",
1711
- name: "userRefund",
1743
+ name: "repaidDebt",
1712
1744
  type: "uint256"
1713
1745
  }
1714
1746
  ],
@@ -1731,22 +1763,16 @@ var _abi2 = [
1731
1763
  type: "bytes32"
1732
1764
  },
1733
1765
  {
1734
- indexed: true,
1766
+ indexed: false,
1735
1767
  internalType: "bytes32",
1736
- name: "tradeId",
1768
+ name: "marketId",
1737
1769
  type: "bytes32"
1738
1770
  },
1739
1771
  {
1740
1772
  indexed: false,
1741
- internalType: "address",
1742
- name: "sender",
1743
- type: "address"
1744
- },
1745
- {
1746
- indexed: false,
1747
- internalType: "bytes32",
1748
- name: "marketId",
1749
- type: "bytes32"
1773
+ internalType: "uint256",
1774
+ name: "totalCollateral",
1775
+ type: "uint256"
1750
1776
  },
1751
1777
  {
1752
1778
  indexed: false,
@@ -1757,23 +1783,42 @@ var _abi2 = [
1757
1783
  {
1758
1784
  indexed: false,
1759
1785
  internalType: "uint256",
1760
- name: "remainingCollateral",
1786
+ name: "totalPayment",
1761
1787
  type: "uint256"
1762
1788
  },
1763
1789
  {
1764
1790
  indexed: false,
1765
1791
  internalType: "uint256",
1766
- name: "repaidLoan",
1792
+ name: "repaidDebt",
1767
1793
  type: "uint256"
1794
+ }
1795
+ ],
1796
+ name: "Liquidate",
1797
+ type: "event"
1798
+ },
1799
+ {
1800
+ anonymous: false,
1801
+ inputs: [
1802
+ {
1803
+ indexed: true,
1804
+ internalType: "address",
1805
+ name: "positionManager",
1806
+ type: "address"
1768
1807
  },
1769
1808
  {
1770
1809
  indexed: false,
1771
1810
  internalType: "uint256",
1772
- name: "bonusLoan",
1811
+ name: "repaidAssets",
1773
1812
  type: "uint256"
1813
+ },
1814
+ {
1815
+ indexed: false,
1816
+ internalType: "bytes",
1817
+ name: "data",
1818
+ type: "bytes"
1774
1819
  }
1775
1820
  ],
1776
- name: "Liquidate",
1821
+ name: "OnMorphoLiquidate",
1777
1822
  type: "event"
1778
1823
  },
1779
1824
  {
@@ -1785,16 +1830,41 @@ var _abi2 = [
1785
1830
  name: "positionManager",
1786
1831
  type: "address"
1787
1832
  },
1833
+ {
1834
+ indexed: false,
1835
+ internalType: "uint256",
1836
+ name: "repaidAssets",
1837
+ type: "uint256"
1838
+ },
1839
+ {
1840
+ indexed: false,
1841
+ internalType: "bytes",
1842
+ name: "data",
1843
+ type: "bytes"
1844
+ }
1845
+ ],
1846
+ name: "OnMorphoRepay",
1847
+ type: "event"
1848
+ },
1849
+ {
1850
+ anonymous: false,
1851
+ inputs: [
1788
1852
  {
1789
1853
  indexed: true,
1790
1854
  internalType: "bytes32",
1791
- name: "positionId",
1855
+ name: "tradeId",
1792
1856
  type: "bytes32"
1793
1857
  },
1858
+ {
1859
+ indexed: true,
1860
+ internalType: "address",
1861
+ name: "positionManager",
1862
+ type: "address"
1863
+ },
1794
1864
  {
1795
1865
  indexed: true,
1796
1866
  internalType: "bytes32",
1797
- name: "tradeId",
1867
+ name: "positionId",
1798
1868
  type: "bytes32"
1799
1869
  },
1800
1870
  {
@@ -1826,39 +1896,75 @@ var _abi2 = [
1826
1896
  type: "event"
1827
1897
  },
1828
1898
  {
1829
- inputs: [],
1830
- name: "LENDING_MANAGEMENT",
1831
- outputs: [
1899
+ anonymous: false,
1900
+ inputs: [
1832
1901
  {
1833
- internalType: "contract ILendingManagement",
1834
- name: "",
1902
+ indexed: true,
1903
+ internalType: "bytes32",
1904
+ name: "positionId",
1905
+ type: "bytes32"
1906
+ },
1907
+ {
1908
+ indexed: true,
1909
+ internalType: "address",
1910
+ name: "token",
1835
1911
  type: "address"
1912
+ },
1913
+ {
1914
+ indexed: true,
1915
+ internalType: "address",
1916
+ name: "pFeeReceiver",
1917
+ type: "address"
1918
+ },
1919
+ {
1920
+ indexed: false,
1921
+ internalType: "uint256",
1922
+ name: "amount",
1923
+ type: "uint256"
1836
1924
  }
1837
1925
  ],
1838
- stateMutability: "view",
1839
- type: "function"
1926
+ name: "ProfitTaken",
1927
+ type: "event"
1840
1928
  },
1841
1929
  {
1842
- inputs: [],
1843
- name: "MORPHO",
1844
- outputs: [
1930
+ anonymous: false,
1931
+ inputs: [
1845
1932
  {
1846
- internalType: "contract IMorpho",
1847
- name: "",
1933
+ indexed: true,
1934
+ internalType: "bytes32",
1935
+ name: "positionId",
1936
+ type: "bytes32"
1937
+ },
1938
+ {
1939
+ indexed: true,
1940
+ internalType: "address",
1941
+ name: "token",
1942
+ type: "address"
1943
+ },
1944
+ {
1945
+ indexed: true,
1946
+ internalType: "address",
1947
+ name: "recipient",
1848
1948
  type: "address"
1949
+ },
1950
+ {
1951
+ indexed: false,
1952
+ internalType: "uint256",
1953
+ name: "refundedAmount",
1954
+ type: "uint256"
1849
1955
  }
1850
1956
  ],
1851
- stateMutability: "view",
1852
- type: "function"
1957
+ name: "Refunded",
1958
+ type: "event"
1853
1959
  },
1854
1960
  {
1855
1961
  inputs: [],
1856
- name: "VALIDATOR_FORCE_CLOSE_TYPEHASH",
1962
+ name: "MORPHO_MANAGEMENT",
1857
1963
  outputs: [
1858
1964
  {
1859
- internalType: "bytes32",
1965
+ internalType: "contract IMorphoManagement",
1860
1966
  name: "",
1861
- type: "bytes32"
1967
+ type: "address"
1862
1968
  }
1863
1969
  ],
1864
1970
  stateMutability: "view",
@@ -1961,19 +2067,6 @@ var _abi2 = [
1961
2067
  stateMutability: "view",
1962
2068
  type: "function"
1963
2069
  },
1964
- {
1965
- inputs: [],
1966
- name: "owBtc",
1967
- outputs: [
1968
- {
1969
- internalType: "contract OW_BTC",
1970
- name: "",
1971
- type: "address"
1972
- }
1973
- ],
1974
- stateMutability: "view",
1975
- type: "function"
1976
- },
1977
2070
  {
1978
2071
  inputs: [
1979
2072
  {
@@ -2013,7 +2106,7 @@ var _abi2 = [
2013
2106
  type: "function"
2014
2107
  }
2015
2108
  ];
2016
- var LendingLiquidation__factory = class {
2109
+ var MorphoLiquidator__factory = class {
2017
2110
  static createInterface() {
2018
2111
  return new Interface2(_abi2);
2019
2112
  }
@@ -2021,7 +2114,7 @@ var LendingLiquidation__factory = class {
2021
2114
  return new Contract2(address, _abi2, runner);
2022
2115
  }
2023
2116
  };
2024
- LendingLiquidation__factory.abi = _abi2;
2117
+ MorphoLiquidator__factory.abi = _abi2;
2025
2118
 
2026
2119
  // src/contracts/contracts/factories/Payment__factory.ts
2027
2120
  import { Contract as Contract3, Interface as Interface3 } from "ethers";
@@ -5206,7 +5299,7 @@ async function getSignature(Signer2, provider, signerHelper, tradeId, infoHash,
5206
5299
  }
5207
5300
  export {
5208
5301
  ERC20__factory,
5209
- LendingLiquidation__factory,
5302
+ MorphoLiquidator__factory,
5210
5303
  Payment__factory,
5211
5304
  ProtocolFetcherProxy__factory,
5212
5305
  ProtocolService,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@optimex-xyz/market-maker-sdk",
3
- "version": "0.9.0-dev-df6089b",
3
+ "version": "0.9.0-dev-6069ee6",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -33,7 +33,7 @@
33
33
  "license": "MIT",
34
34
  "scripts": {
35
35
  "build": "tsup src/index.ts --format cjs,esm --dts",
36
- "typechain": "typechain --target=ethers-v6 ./abi/**/**.json --out-dir ./src/contracts/contracts",
36
+ "typechain": "rm -rf ./src/contracts/contracts && typechain --target=ethers-v6 ./abi/**/**.json --out-dir ./src/contracts/contracts",
37
37
  "prepare": "simple-git-hooks",
38
38
  "lint": "eslint --ext .js,.ts,.tsx src/",
39
39
  "format": "prettier --write \"src/**/*.{js,ts,tsx}\"",