@underscore-finance/sdk 0.3.5 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (244) hide show
  1. package/dist/contracts/AaveV3.d.ts +2120 -0
  2. package/dist/contracts/AaveV3.d.ts.map +1 -0
  3. package/dist/contracts/AaveV3.js +2714 -0
  4. package/dist/contracts/AeroClassic.d.ts +2017 -0
  5. package/dist/contracts/AeroClassic.d.ts.map +1 -0
  6. package/dist/contracts/AeroClassic.js +2567 -0
  7. package/dist/contracts/AeroSlipstream.d.ts +2113 -0
  8. package/dist/contracts/AeroSlipstream.d.ts.map +1 -0
  9. package/dist/contracts/AeroSlipstream.js +2692 -0
  10. package/dist/contracts/Agent.d.ts +2189 -1138
  11. package/dist/contracts/Agent.d.ts.map +1 -1
  12. package/dist/contracts/Agent.js +2807 -1343
  13. package/dist/contracts/AgentWrapper.d.ts +3760 -0
  14. package/dist/contracts/AgentWrapper.d.ts.map +1 -0
  15. package/dist/contracts/AgentWrapper.js +4922 -0
  16. package/dist/contracts/Appraiser.d.ts +997 -0
  17. package/dist/contracts/Appraiser.d.ts.map +1 -0
  18. package/dist/contracts/Appraiser.js +1285 -0
  19. package/dist/contracts/Billing.d.ts +420 -0
  20. package/dist/contracts/Billing.d.ts.map +1 -0
  21. package/dist/contracts/Billing.js +506 -0
  22. package/dist/contracts/ChequeBook.d.ts +1184 -0
  23. package/dist/contracts/ChequeBook.d.ts.map +1 -0
  24. package/dist/contracts/ChequeBook.js +1352 -0
  25. package/dist/contracts/CompoundV3.d.ts +2158 -0
  26. package/dist/contracts/CompoundV3.d.ts.map +1 -0
  27. package/dist/contracts/CompoundV3.js +2764 -0
  28. package/dist/contracts/Curve.d.ts +1077 -0
  29. package/dist/contracts/Curve.d.ts.map +1 -0
  30. package/dist/contracts/Curve.js +1357 -0
  31. package/dist/contracts/DefaultsBase.d.ts +290 -0
  32. package/dist/contracts/DefaultsBase.d.ts.map +1 -0
  33. package/dist/contracts/DefaultsBase.js +316 -0
  34. package/dist/contracts/Euler.d.ts +2172 -0
  35. package/dist/contracts/Euler.d.ts.map +1 -0
  36. package/dist/contracts/Euler.js +2782 -0
  37. package/dist/contracts/Fluid.d.ts +2106 -0
  38. package/dist/contracts/Fluid.d.ts.map +1 -0
  39. package/dist/contracts/Fluid.js +2696 -0
  40. package/dist/contracts/Hatchery.d.ts +541 -0
  41. package/dist/contracts/Hatchery.d.ts.map +1 -0
  42. package/dist/contracts/Hatchery.js +671 -0
  43. package/dist/contracts/HighCommand.d.ts +1868 -0
  44. package/dist/contracts/HighCommand.d.ts.map +1 -0
  45. package/dist/contracts/HighCommand.js +2149 -0
  46. package/dist/contracts/Kernel.d.ts +354 -0
  47. package/dist/contracts/Kernel.d.ts.map +1 -0
  48. package/dist/contracts/Kernel.js +412 -0
  49. package/dist/contracts/Ledger.d.ts +694 -0
  50. package/dist/contracts/Ledger.d.ts.map +1 -0
  51. package/dist/contracts/Ledger.js +834 -0
  52. package/dist/contracts/LegoBook.d.ts +1424 -0
  53. package/dist/contracts/LegoBook.d.ts.map +1 -0
  54. package/dist/contracts/LegoBook.js +1783 -0
  55. package/dist/contracts/LegoTools.d.ts +1898 -0
  56. package/dist/contracts/LegoTools.d.ts.map +1 -0
  57. package/dist/contracts/LegoTools.js +2378 -0
  58. package/dist/contracts/LegoUniswapV0_2.d.ts +1204 -0
  59. package/dist/contracts/LegoUniswapV0_2.d.ts.map +1 -0
  60. package/dist/contracts/LegoUniswapV0_2.js +1546 -0
  61. package/dist/contracts/LootDistributor.d.ts +996 -0
  62. package/dist/contracts/LootDistributor.d.ts.map +1 -0
  63. package/dist/contracts/LootDistributor.js +1255 -0
  64. package/dist/contracts/Migrator.d.ts +268 -0
  65. package/dist/contracts/Migrator.d.ts.map +1 -0
  66. package/dist/contracts/Migrator.js +324 -0
  67. package/dist/contracts/MissionControl.d.ts +1331 -0
  68. package/dist/contracts/MissionControl.d.ts.map +1 -0
  69. package/dist/contracts/MissionControl.js +1485 -0
  70. package/dist/contracts/Moonwell.d.ts +2137 -0
  71. package/dist/contracts/Moonwell.d.ts.map +1 -0
  72. package/dist/contracts/Moonwell.js +2737 -0
  73. package/dist/contracts/Morpho.d.ts +2172 -0
  74. package/dist/contracts/Morpho.d.ts.map +1 -0
  75. package/dist/contracts/Morpho.js +2782 -0
  76. package/dist/contracts/Paymaster.d.ts +1679 -0
  77. package/dist/contracts/Paymaster.d.ts.map +1 -0
  78. package/dist/contracts/Paymaster.js +2077 -0
  79. package/dist/contracts/RipeLego.d.ts +2263 -0
  80. package/dist/contracts/RipeLego.d.ts.map +1 -0
  81. package/dist/contracts/RipeLego.js +2891 -0
  82. package/dist/contracts/Sentinel.d.ts +1804 -0
  83. package/dist/contracts/Sentinel.d.ts.map +1 -0
  84. package/dist/contracts/Sentinel.js +2152 -0
  85. package/dist/contracts/Switchboard.d.ts +1395 -0
  86. package/dist/contracts/Switchboard.d.ts.map +1 -0
  87. package/dist/contracts/Switchboard.js +1746 -0
  88. package/dist/contracts/SwitchboardAlpha.d.ts +2228 -0
  89. package/dist/contracts/SwitchboardAlpha.d.ts.map +1 -0
  90. package/dist/contracts/SwitchboardAlpha.js +2743 -0
  91. package/dist/contracts/SwitchboardBravo.d.ts +1498 -0
  92. package/dist/contracts/SwitchboardBravo.d.ts.map +1 -0
  93. package/dist/contracts/SwitchboardBravo.js +1855 -0
  94. package/dist/contracts/UndyHq.d.ts +1580 -0
  95. package/dist/contracts/UndyHq.d.ts.map +1 -0
  96. package/dist/contracts/UndyHq.js +1986 -0
  97. package/dist/contracts/UniswapV2.d.ts +2017 -0
  98. package/dist/contracts/UniswapV2.d.ts.map +1 -0
  99. package/dist/contracts/UniswapV2.js +2567 -0
  100. package/dist/contracts/UniswapV3.d.ts +2113 -0
  101. package/dist/contracts/UniswapV3.d.ts.map +1 -0
  102. package/dist/contracts/UniswapV3.js +2692 -0
  103. package/dist/contracts/UserWallet.d.ts +1438 -784
  104. package/dist/contracts/UserWallet.d.ts.map +1 -1
  105. package/dist/contracts/UserWallet.js +1854 -935
  106. package/dist/contracts/UserWalletConfig.d.ts +3034 -1231
  107. package/dist/contracts/UserWalletConfig.d.ts.map +1 -1
  108. package/dist/contracts/UserWalletConfig.js +3395 -1407
  109. package/dist/contracts/WalletBackpack.d.ts +1183 -0
  110. package/dist/contracts/WalletBackpack.d.ts.map +1 -0
  111. package/dist/contracts/WalletBackpack.js +1484 -0
  112. package/dist/contracts/index.d.ts +72 -36
  113. package/dist/contracts/index.d.ts.map +1 -1
  114. package/dist/contracts/index.js +72 -36
  115. package/dist/contracts/sdk.d.ts +146 -72
  116. package/dist/contracts/sdk.d.ts.map +1 -1
  117. package/dist/contracts/sdk.js +146 -72
  118. package/dist/contracts/v0_1_AddyRegistry.d.ts +473 -0
  119. package/dist/contracts/v0_1_AddyRegistry.d.ts.map +1 -0
  120. package/dist/contracts/v0_1_AddyRegistry.js +594 -0
  121. package/dist/contracts/v0_1_Agent.d.ts +2631 -0
  122. package/dist/contracts/v0_1_Agent.d.ts.map +1 -0
  123. package/dist/contracts/v0_1_Agent.js +3372 -0
  124. package/dist/contracts/v0_1_AgentFactory.d.ts +1054 -0
  125. package/dist/contracts/v0_1_AgentFactory.d.ts.map +1 -0
  126. package/dist/contracts/v0_1_AgentFactory.js +1336 -0
  127. package/dist/contracts/v0_1_UserWallet.d.ts +1980 -0
  128. package/dist/contracts/v0_1_UserWallet.d.ts.map +1 -0
  129. package/dist/contracts/v0_1_UserWallet.js +2581 -0
  130. package/dist/contracts/v0_1_UserWalletConfig.d.ts +1400 -0
  131. package/dist/contracts/v0_1_UserWalletConfig.d.ts.map +1 -0
  132. package/dist/contracts/v0_1_UserWalletConfig.js +1676 -0
  133. package/dist/contracts/v0_2_AddyRegistry.d.ts +1050 -0
  134. package/dist/contracts/v0_2_AddyRegistry.d.ts.map +1 -0
  135. package/dist/contracts/v0_2_AddyRegistry.js +1313 -0
  136. package/dist/contracts/v0_2_Agent.d.ts +2709 -0
  137. package/dist/contracts/v0_2_Agent.d.ts.map +1 -0
  138. package/dist/contracts/v0_2_Agent.js +3458 -0
  139. package/dist/contracts/v0_2_AgentFactory.d.ts +1275 -0
  140. package/dist/contracts/v0_2_AgentFactory.d.ts.map +1 -0
  141. package/dist/contracts/v0_2_AgentFactory.js +1609 -0
  142. package/dist/contracts/v0_2_UserWallet.d.ts +1958 -0
  143. package/dist/contracts/v0_2_UserWallet.d.ts.map +1 -0
  144. package/dist/contracts/v0_2_UserWallet.js +2553 -0
  145. package/dist/contracts/v0_2_UserWalletConfig.d.ts +1468 -0
  146. package/dist/contracts/v0_2_UserWalletConfig.d.ts.map +1 -0
  147. package/dist/contracts/v0_2_UserWalletConfig.js +1764 -0
  148. package/dist/contracts/v0_3_AddyRegistry.d.ts +1109 -0
  149. package/dist/contracts/v0_3_AddyRegistry.d.ts.map +1 -0
  150. package/dist/contracts/v0_3_AddyRegistry.js +1392 -0
  151. package/dist/contracts/v0_3_Agent.d.ts +2709 -0
  152. package/dist/contracts/v0_3_Agent.d.ts.map +1 -0
  153. package/dist/contracts/v0_3_Agent.js +3458 -0
  154. package/dist/contracts/v0_3_AgentFactory.d.ts +1665 -0
  155. package/dist/contracts/v0_3_AgentFactory.d.ts.map +1 -0
  156. package/dist/contracts/v0_3_AgentFactory.js +2078 -0
  157. package/dist/contracts/v0_3_ChainlinkFeeds.d.ts +706 -0
  158. package/dist/contracts/v0_3_ChainlinkFeeds.d.ts.map +1 -0
  159. package/dist/contracts/v0_3_ChainlinkFeeds.js +900 -0
  160. package/dist/contracts/v0_3_LegoAaveV3.d.ts +1033 -0
  161. package/dist/contracts/v0_3_LegoAaveV3.d.ts.map +1 -0
  162. package/dist/contracts/v0_3_LegoAaveV3.js +1330 -0
  163. package/dist/contracts/v0_3_LegoAeroClassic.d.ts +1204 -0
  164. package/dist/contracts/v0_3_LegoAeroClassic.d.ts.map +1 -0
  165. package/dist/contracts/v0_3_LegoAeroClassic.js +1546 -0
  166. package/dist/contracts/v0_3_LegoAeroSlipstream.d.ts +1300 -0
  167. package/dist/contracts/v0_3_LegoAeroSlipstream.d.ts.map +1 -0
  168. package/dist/contracts/v0_3_LegoAeroSlipstream.js +1671 -0
  169. package/dist/contracts/v0_3_LegoCommon.d.ts +164 -0
  170. package/dist/contracts/v0_3_LegoCommon.d.ts.map +1 -0
  171. package/dist/contracts/v0_3_LegoCommon.js +202 -0
  172. package/dist/contracts/v0_3_LegoCompoundV3.d.ts +1060 -0
  173. package/dist/contracts/v0_3_LegoCompoundV3.d.ts.map +1 -0
  174. package/dist/contracts/v0_3_LegoCompoundV3.js +1365 -0
  175. package/dist/contracts/v0_3_LegoCredit.d.ts +140 -0
  176. package/dist/contracts/v0_3_LegoCredit.d.ts.map +1 -0
  177. package/dist/contracts/v0_3_LegoCredit.js +179 -0
  178. package/dist/contracts/v0_3_LegoCurve.d.ts +1189 -0
  179. package/dist/contracts/v0_3_LegoCurve.d.ts.map +1 -0
  180. package/dist/contracts/v0_3_LegoCurve.js +1519 -0
  181. package/dist/contracts/v0_3_LegoDex.d.ts +587 -0
  182. package/dist/contracts/v0_3_LegoDex.d.ts.map +1 -0
  183. package/dist/contracts/v0_3_LegoDex.js +774 -0
  184. package/dist/contracts/v0_3_LegoEuler.d.ts +1074 -0
  185. package/dist/contracts/v0_3_LegoEuler.d.ts.map +1 -0
  186. package/dist/contracts/v0_3_LegoEuler.js +1383 -0
  187. package/dist/contracts/v0_3_LegoFluid.d.ts +1025 -0
  188. package/dist/contracts/v0_3_LegoFluid.d.ts.map +1 -0
  189. package/dist/contracts/v0_3_LegoFluid.js +1320 -0
  190. package/dist/contracts/v0_3_LegoHelper.d.ts +1563 -0
  191. package/dist/contracts/v0_3_LegoHelper.d.ts.map +1 -0
  192. package/dist/contracts/v0_3_LegoHelper.js +1947 -0
  193. package/dist/contracts/v0_3_LegoMoonwell.d.ts +1042 -0
  194. package/dist/contracts/v0_3_LegoMoonwell.d.ts.map +1 -0
  195. package/dist/contracts/v0_3_LegoMoonwell.js +1342 -0
  196. package/dist/contracts/v0_3_LegoMorpho.d.ts +1074 -0
  197. package/dist/contracts/v0_3_LegoMorpho.d.ts.map +1 -0
  198. package/dist/contracts/v0_3_LegoMorpho.js +1383 -0
  199. package/dist/contracts/v0_3_LegoRegistry.d.ts +1079 -0
  200. package/dist/contracts/v0_3_LegoRegistry.d.ts.map +1 -0
  201. package/dist/contracts/v0_3_LegoRegistry.js +1368 -0
  202. package/dist/contracts/v0_3_LegoSky.d.ts +923 -0
  203. package/dist/contracts/v0_3_LegoSky.d.ts.map +1 -0
  204. package/dist/contracts/v0_3_LegoSky.js +1180 -0
  205. package/dist/contracts/v0_3_LegoUniswapV3.d.ts +1338 -0
  206. package/dist/contracts/v0_3_LegoUniswapV3.d.ts.map +1 -0
  207. package/dist/contracts/v0_3_LegoUniswapV3.js +1718 -0
  208. package/dist/contracts/v0_3_LegoYield.d.ts +390 -0
  209. package/dist/contracts/v0_3_LegoYield.d.ts.map +1 -0
  210. package/dist/contracts/v0_3_LegoYield.js +511 -0
  211. package/dist/contracts/v0_3_OracleParser.d.ts +207 -0
  212. package/dist/contracts/v0_3_OracleParser.d.ts.map +1 -0
  213. package/dist/contracts/v0_3_OracleParser.js +264 -0
  214. package/dist/contracts/v0_3_OracleRegistry.d.ts +1221 -0
  215. package/dist/contracts/v0_3_OracleRegistry.d.ts.map +1 -0
  216. package/dist/contracts/v0_3_OracleRegistry.js +1562 -0
  217. package/dist/contracts/v0_3_PriceSheets.d.ts +1127 -0
  218. package/dist/contracts/v0_3_PriceSheets.d.ts.map +1 -0
  219. package/dist/contracts/v0_3_PriceSheets.js +1383 -0
  220. package/dist/contracts/v0_3_PythFeeds.d.ts +640 -0
  221. package/dist/contracts/v0_3_PythFeeds.d.ts.map +1 -0
  222. package/dist/contracts/v0_3_PythFeeds.js +813 -0
  223. package/dist/contracts/v0_3_StorkFeeds.d.ts +640 -0
  224. package/dist/contracts/v0_3_StorkFeeds.d.ts.map +1 -0
  225. package/dist/contracts/v0_3_StorkFeeds.js +813 -0
  226. package/dist/contracts/v0_3_UserWallet.d.ts +1975 -0
  227. package/dist/contracts/v0_3_UserWallet.d.ts.map +1 -0
  228. package/dist/contracts/v0_3_UserWallet.js +2577 -0
  229. package/dist/contracts/v0_3_UserWalletConfig.d.ts +1852 -0
  230. package/dist/contracts/v0_3_UserWalletConfig.d.ts.map +1 -0
  231. package/dist/contracts/v0_3_UserWalletConfig.js +2263 -0
  232. package/dist/getContracts.d.ts +77 -0
  233. package/dist/getContracts.d.ts.map +1 -0
  234. package/dist/getContracts.js +67 -0
  235. package/dist/getLegacyContracts.d.ts +69 -0
  236. package/dist/getLegacyContracts.d.ts.map +1 -0
  237. package/dist/getLegacyContracts.js +55 -0
  238. package/dist/getSwapInstructions.d.ts +60 -0
  239. package/dist/getSwapInstructions.d.ts.map +1 -0
  240. package/dist/getSwapInstructions.js +41 -0
  241. package/dist/index.d.ts +3 -475
  242. package/dist/index.d.ts.map +1 -1
  243. package/dist/index.js +8 -182
  244. package/package.json +2 -2
@@ -0,0 +1,774 @@
1
+ /* Autogenerated file. Do not edit manually. */
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /* @ts-nocheck */
5
+ import { singleQuery, mutate } from '@dappql/async';
6
+ export const abi = [
7
+ {
8
+ stateMutability: 'nonpayable',
9
+ type: 'function',
10
+ name: 'swapTokens',
11
+ inputs: [
12
+ {
13
+ name: '_amountIn',
14
+ type: 'uint256',
15
+ },
16
+ {
17
+ name: '_minAmountOut',
18
+ type: 'uint256',
19
+ },
20
+ {
21
+ name: '_tokenPath',
22
+ type: 'address[]',
23
+ },
24
+ {
25
+ name: '_poolPath',
26
+ type: 'address[]',
27
+ },
28
+ {
29
+ name: '_recipient',
30
+ type: 'address',
31
+ },
32
+ ],
33
+ outputs: [
34
+ {
35
+ name: '',
36
+ type: 'uint256',
37
+ },
38
+ {
39
+ name: '',
40
+ type: 'uint256',
41
+ },
42
+ {
43
+ name: '',
44
+ type: 'uint256',
45
+ },
46
+ {
47
+ name: '',
48
+ type: 'uint256',
49
+ },
50
+ ],
51
+ },
52
+ {
53
+ stateMutability: 'nonpayable',
54
+ type: 'function',
55
+ name: 'swapTokens',
56
+ inputs: [
57
+ {
58
+ name: '_amountIn',
59
+ type: 'uint256',
60
+ },
61
+ {
62
+ name: '_minAmountOut',
63
+ type: 'uint256',
64
+ },
65
+ {
66
+ name: '_tokenPath',
67
+ type: 'address[]',
68
+ },
69
+ {
70
+ name: '_poolPath',
71
+ type: 'address[]',
72
+ },
73
+ {
74
+ name: '_recipient',
75
+ type: 'address',
76
+ },
77
+ {
78
+ name: '_oracleRegistry',
79
+ type: 'address',
80
+ },
81
+ ],
82
+ outputs: [
83
+ {
84
+ name: '',
85
+ type: 'uint256',
86
+ },
87
+ {
88
+ name: '',
89
+ type: 'uint256',
90
+ },
91
+ {
92
+ name: '',
93
+ type: 'uint256',
94
+ },
95
+ {
96
+ name: '',
97
+ type: 'uint256',
98
+ },
99
+ ],
100
+ },
101
+ {
102
+ stateMutability: 'nonpayable',
103
+ type: 'function',
104
+ name: 'addLiquidity',
105
+ inputs: [
106
+ {
107
+ name: '_nftTokenId',
108
+ type: 'uint256',
109
+ },
110
+ {
111
+ name: '_pool',
112
+ type: 'address',
113
+ },
114
+ {
115
+ name: '_tokenA',
116
+ type: 'address',
117
+ },
118
+ {
119
+ name: '_tokenB',
120
+ type: 'address',
121
+ },
122
+ {
123
+ name: '_tickLower',
124
+ type: 'int24',
125
+ },
126
+ {
127
+ name: '_tickUpper',
128
+ type: 'int24',
129
+ },
130
+ {
131
+ name: '_amountA',
132
+ type: 'uint256',
133
+ },
134
+ {
135
+ name: '_amountB',
136
+ type: 'uint256',
137
+ },
138
+ {
139
+ name: '_minAmountA',
140
+ type: 'uint256',
141
+ },
142
+ {
143
+ name: '_minAmountB',
144
+ type: 'uint256',
145
+ },
146
+ {
147
+ name: '_minLpAmount',
148
+ type: 'uint256',
149
+ },
150
+ {
151
+ name: '_recipient',
152
+ type: 'address',
153
+ },
154
+ ],
155
+ outputs: [
156
+ {
157
+ name: '',
158
+ type: 'uint256',
159
+ },
160
+ {
161
+ name: '',
162
+ type: 'uint256',
163
+ },
164
+ {
165
+ name: '',
166
+ type: 'uint256',
167
+ },
168
+ {
169
+ name: '',
170
+ type: 'uint256',
171
+ },
172
+ {
173
+ name: '',
174
+ type: 'uint256',
175
+ },
176
+ {
177
+ name: '',
178
+ type: 'uint256',
179
+ },
180
+ {
181
+ name: '',
182
+ type: 'uint256',
183
+ },
184
+ ],
185
+ },
186
+ {
187
+ stateMutability: 'nonpayable',
188
+ type: 'function',
189
+ name: 'addLiquidity',
190
+ inputs: [
191
+ {
192
+ name: '_nftTokenId',
193
+ type: 'uint256',
194
+ },
195
+ {
196
+ name: '_pool',
197
+ type: 'address',
198
+ },
199
+ {
200
+ name: '_tokenA',
201
+ type: 'address',
202
+ },
203
+ {
204
+ name: '_tokenB',
205
+ type: 'address',
206
+ },
207
+ {
208
+ name: '_tickLower',
209
+ type: 'int24',
210
+ },
211
+ {
212
+ name: '_tickUpper',
213
+ type: 'int24',
214
+ },
215
+ {
216
+ name: '_amountA',
217
+ type: 'uint256',
218
+ },
219
+ {
220
+ name: '_amountB',
221
+ type: 'uint256',
222
+ },
223
+ {
224
+ name: '_minAmountA',
225
+ type: 'uint256',
226
+ },
227
+ {
228
+ name: '_minAmountB',
229
+ type: 'uint256',
230
+ },
231
+ {
232
+ name: '_minLpAmount',
233
+ type: 'uint256',
234
+ },
235
+ {
236
+ name: '_recipient',
237
+ type: 'address',
238
+ },
239
+ {
240
+ name: '_oracleRegistry',
241
+ type: 'address',
242
+ },
243
+ ],
244
+ outputs: [
245
+ {
246
+ name: '',
247
+ type: 'uint256',
248
+ },
249
+ {
250
+ name: '',
251
+ type: 'uint256',
252
+ },
253
+ {
254
+ name: '',
255
+ type: 'uint256',
256
+ },
257
+ {
258
+ name: '',
259
+ type: 'uint256',
260
+ },
261
+ {
262
+ name: '',
263
+ type: 'uint256',
264
+ },
265
+ {
266
+ name: '',
267
+ type: 'uint256',
268
+ },
269
+ {
270
+ name: '',
271
+ type: 'uint256',
272
+ },
273
+ ],
274
+ },
275
+ {
276
+ stateMutability: 'nonpayable',
277
+ type: 'function',
278
+ name: 'removeLiquidity',
279
+ inputs: [
280
+ {
281
+ name: '_nftTokenId',
282
+ type: 'uint256',
283
+ },
284
+ {
285
+ name: '_pool',
286
+ type: 'address',
287
+ },
288
+ {
289
+ name: '_tokenA',
290
+ type: 'address',
291
+ },
292
+ {
293
+ name: '_tokenB',
294
+ type: 'address',
295
+ },
296
+ {
297
+ name: '_lpToken',
298
+ type: 'address',
299
+ },
300
+ {
301
+ name: '_liqToRemove',
302
+ type: 'uint256',
303
+ },
304
+ {
305
+ name: '_minAmountA',
306
+ type: 'uint256',
307
+ },
308
+ {
309
+ name: '_minAmountB',
310
+ type: 'uint256',
311
+ },
312
+ {
313
+ name: '_recipient',
314
+ type: 'address',
315
+ },
316
+ ],
317
+ outputs: [
318
+ {
319
+ name: '',
320
+ type: 'uint256',
321
+ },
322
+ {
323
+ name: '',
324
+ type: 'uint256',
325
+ },
326
+ {
327
+ name: '',
328
+ type: 'uint256',
329
+ },
330
+ {
331
+ name: '',
332
+ type: 'uint256',
333
+ },
334
+ {
335
+ name: '',
336
+ type: 'uint256',
337
+ },
338
+ {
339
+ name: '',
340
+ type: 'bool',
341
+ },
342
+ ],
343
+ },
344
+ {
345
+ stateMutability: 'nonpayable',
346
+ type: 'function',
347
+ name: 'removeLiquidity',
348
+ inputs: [
349
+ {
350
+ name: '_nftTokenId',
351
+ type: 'uint256',
352
+ },
353
+ {
354
+ name: '_pool',
355
+ type: 'address',
356
+ },
357
+ {
358
+ name: '_tokenA',
359
+ type: 'address',
360
+ },
361
+ {
362
+ name: '_tokenB',
363
+ type: 'address',
364
+ },
365
+ {
366
+ name: '_lpToken',
367
+ type: 'address',
368
+ },
369
+ {
370
+ name: '_liqToRemove',
371
+ type: 'uint256',
372
+ },
373
+ {
374
+ name: '_minAmountA',
375
+ type: 'uint256',
376
+ },
377
+ {
378
+ name: '_minAmountB',
379
+ type: 'uint256',
380
+ },
381
+ {
382
+ name: '_recipient',
383
+ type: 'address',
384
+ },
385
+ {
386
+ name: '_oracleRegistry',
387
+ type: 'address',
388
+ },
389
+ ],
390
+ outputs: [
391
+ {
392
+ name: '',
393
+ type: 'uint256',
394
+ },
395
+ {
396
+ name: '',
397
+ type: 'uint256',
398
+ },
399
+ {
400
+ name: '',
401
+ type: 'uint256',
402
+ },
403
+ {
404
+ name: '',
405
+ type: 'uint256',
406
+ },
407
+ {
408
+ name: '',
409
+ type: 'uint256',
410
+ },
411
+ {
412
+ name: '',
413
+ type: 'bool',
414
+ },
415
+ ],
416
+ },
417
+ {
418
+ stateMutability: 'view',
419
+ type: 'function',
420
+ name: 'getLpToken',
421
+ inputs: [
422
+ {
423
+ name: '_pool',
424
+ type: 'address',
425
+ },
426
+ ],
427
+ outputs: [
428
+ {
429
+ name: '',
430
+ type: 'address',
431
+ },
432
+ ],
433
+ },
434
+ {
435
+ stateMutability: 'view',
436
+ type: 'function',
437
+ name: 'getPoolForLpToken',
438
+ inputs: [
439
+ {
440
+ name: '_lpToken',
441
+ type: 'address',
442
+ },
443
+ ],
444
+ outputs: [
445
+ {
446
+ name: '',
447
+ type: 'address',
448
+ },
449
+ ],
450
+ },
451
+ {
452
+ stateMutability: 'view',
453
+ type: 'function',
454
+ name: 'getSwapAmountOut',
455
+ inputs: [
456
+ {
457
+ name: '_pool',
458
+ type: 'address',
459
+ },
460
+ {
461
+ name: '_tokenIn',
462
+ type: 'address',
463
+ },
464
+ {
465
+ name: '_tokenOut',
466
+ type: 'address',
467
+ },
468
+ {
469
+ name: '_amountIn',
470
+ type: 'uint256',
471
+ },
472
+ ],
473
+ outputs: [
474
+ {
475
+ name: '',
476
+ type: 'uint256',
477
+ },
478
+ ],
479
+ },
480
+ {
481
+ stateMutability: 'view',
482
+ type: 'function',
483
+ name: 'getSwapAmountIn',
484
+ inputs: [
485
+ {
486
+ name: '_pool',
487
+ type: 'address',
488
+ },
489
+ {
490
+ name: '_tokenIn',
491
+ type: 'address',
492
+ },
493
+ {
494
+ name: '_tokenOut',
495
+ type: 'address',
496
+ },
497
+ {
498
+ name: '_amountOut',
499
+ type: 'uint256',
500
+ },
501
+ ],
502
+ outputs: [
503
+ {
504
+ name: '',
505
+ type: 'uint256',
506
+ },
507
+ ],
508
+ },
509
+ {
510
+ stateMutability: 'view',
511
+ type: 'function',
512
+ name: 'getAddLiqAmountsIn',
513
+ inputs: [
514
+ {
515
+ name: '_pool',
516
+ type: 'address',
517
+ },
518
+ {
519
+ name: '_tokenA',
520
+ type: 'address',
521
+ },
522
+ {
523
+ name: '_tokenB',
524
+ type: 'address',
525
+ },
526
+ {
527
+ name: '_availAmountA',
528
+ type: 'uint256',
529
+ },
530
+ {
531
+ name: '_availAmountB',
532
+ type: 'uint256',
533
+ },
534
+ ],
535
+ outputs: [
536
+ {
537
+ name: '',
538
+ type: 'uint256',
539
+ },
540
+ {
541
+ name: '',
542
+ type: 'uint256',
543
+ },
544
+ {
545
+ name: '',
546
+ type: 'uint256',
547
+ },
548
+ ],
549
+ },
550
+ {
551
+ stateMutability: 'view',
552
+ type: 'function',
553
+ name: 'getRemoveLiqAmountsOut',
554
+ inputs: [
555
+ {
556
+ name: '_pool',
557
+ type: 'address',
558
+ },
559
+ {
560
+ name: '_tokenA',
561
+ type: 'address',
562
+ },
563
+ {
564
+ name: '_tokenB',
565
+ type: 'address',
566
+ },
567
+ {
568
+ name: '_lpAmount',
569
+ type: 'uint256',
570
+ },
571
+ ],
572
+ outputs: [
573
+ {
574
+ name: '',
575
+ type: 'uint256',
576
+ },
577
+ {
578
+ name: '',
579
+ type: 'uint256',
580
+ },
581
+ ],
582
+ },
583
+ {
584
+ stateMutability: 'view',
585
+ type: 'function',
586
+ name: 'getPriceUnsafe',
587
+ inputs: [
588
+ {
589
+ name: '_pool',
590
+ type: 'address',
591
+ },
592
+ {
593
+ name: '_targetToken',
594
+ type: 'address',
595
+ },
596
+ ],
597
+ outputs: [
598
+ {
599
+ name: '',
600
+ type: 'uint256',
601
+ },
602
+ ],
603
+ },
604
+ {
605
+ stateMutability: 'view',
606
+ type: 'function',
607
+ name: 'getPriceUnsafe',
608
+ inputs: [
609
+ {
610
+ name: '_pool',
611
+ type: 'address',
612
+ },
613
+ {
614
+ name: '_targetToken',
615
+ type: 'address',
616
+ },
617
+ {
618
+ name: '_oracleRegistry',
619
+ type: 'address',
620
+ },
621
+ ],
622
+ outputs: [
623
+ {
624
+ name: '',
625
+ type: 'uint256',
626
+ },
627
+ ],
628
+ },
629
+ {
630
+ stateMutability: 'view',
631
+ type: 'function',
632
+ name: 'getBestSwapAmountOut',
633
+ inputs: [
634
+ {
635
+ name: '_tokenIn',
636
+ type: 'address',
637
+ },
638
+ {
639
+ name: '_tokenOut',
640
+ type: 'address',
641
+ },
642
+ {
643
+ name: '_amountIn',
644
+ type: 'uint256',
645
+ },
646
+ ],
647
+ outputs: [
648
+ {
649
+ name: '',
650
+ type: 'address',
651
+ },
652
+ {
653
+ name: '',
654
+ type: 'uint256',
655
+ },
656
+ ],
657
+ },
658
+ {
659
+ stateMutability: 'view',
660
+ type: 'function',
661
+ name: 'getBestSwapAmountIn',
662
+ inputs: [
663
+ {
664
+ name: '_tokenIn',
665
+ type: 'address',
666
+ },
667
+ {
668
+ name: '_tokenOut',
669
+ type: 'address',
670
+ },
671
+ {
672
+ name: '_amountOut',
673
+ type: 'uint256',
674
+ },
675
+ ],
676
+ outputs: [
677
+ {
678
+ name: '',
679
+ type: 'address',
680
+ },
681
+ {
682
+ name: '',
683
+ type: 'uint256',
684
+ },
685
+ ],
686
+ },
687
+ {
688
+ stateMutability: 'view',
689
+ type: 'function',
690
+ name: 'getCoreRouterPool',
691
+ inputs: [],
692
+ outputs: [
693
+ {
694
+ name: '',
695
+ type: 'address',
696
+ },
697
+ ],
698
+ },
699
+ ];
700
+ export const deployAddress = undefined;
701
+ function getRequest(method, args, contractAddressOrOptions) {
702
+ const address = typeof contractAddressOrOptions === 'string' ? contractAddressOrOptions : contractAddressOrOptions?.contractAddress;
703
+ const defaultValue = typeof contractAddressOrOptions === 'string' ? undefined : contractAddressOrOptions?.defaultValue;
704
+ const call = {
705
+ contractName: 'v0_3_LegoDex',
706
+ method,
707
+ args,
708
+ address,
709
+ deployAddress,
710
+ defaultValue,
711
+ getAbi: () => abi,
712
+ with: (options) => {
713
+ call.address = options.contractAddress;
714
+ call.defaultValue = options.defaultValue;
715
+ return call;
716
+ },
717
+ defaultTo: (defaultValue) => {
718
+ call.defaultValue = defaultValue;
719
+ return call;
720
+ },
721
+ at: (address) => {
722
+ call.address = address;
723
+ return call;
724
+ },
725
+ };
726
+ return call;
727
+ }
728
+ export const call = {
729
+ getLpToken: (...args) => getRequest('getLpToken', args),
730
+ getPoolForLpToken: (...args) => getRequest('getPoolForLpToken', args),
731
+ getSwapAmountOut: (...args) => getRequest('getSwapAmountOut', args),
732
+ getSwapAmountIn: (...args) => getRequest('getSwapAmountIn', args),
733
+ getAddLiqAmountsIn: (...args) => getRequest('getAddLiqAmountsIn', args),
734
+ getRemoveLiqAmountsOut: (...args) => getRequest('getRemoveLiqAmountsOut', args),
735
+ getPriceUnsafe: (...args) => getRequest('getPriceUnsafe', args),
736
+ getBestSwapAmountOut: (...args) => getRequest('getBestSwapAmountOut', args),
737
+ getBestSwapAmountIn: (...args) => getRequest('getBestSwapAmountIn', args),
738
+ getCoreRouterPool: (...args) => getRequest('getCoreRouterPool', args),
739
+ };
740
+ function getMutation(functionName) {
741
+ return {
742
+ contractName: 'v0_3_LegoDex',
743
+ functionName,
744
+ deployAddress,
745
+ argsType: undefined,
746
+ getAbi: () => abi,
747
+ };
748
+ }
749
+ export const mutation = {
750
+ swapTokens: getMutation('swapTokens'),
751
+ addLiquidity: getMutation('addLiquidity'),
752
+ removeLiquidity: getMutation('removeLiquidity'),
753
+ };
754
+ export function toSdk(deployAddress, publicClient, walletClient) {
755
+ return {
756
+ deployAddress,
757
+ abi,
758
+ // Queries
759
+ getLpToken: (...args) => singleQuery(publicClient, call.getLpToken(...args).at(deployAddress)),
760
+ getPoolForLpToken: (...args) => singleQuery(publicClient, call.getPoolForLpToken(...args).at(deployAddress)),
761
+ getSwapAmountOut: (...args) => singleQuery(publicClient, call.getSwapAmountOut(...args).at(deployAddress)),
762
+ getSwapAmountIn: (...args) => singleQuery(publicClient, call.getSwapAmountIn(...args).at(deployAddress)),
763
+ getAddLiqAmountsIn: (...args) => singleQuery(publicClient, call.getAddLiqAmountsIn(...args).at(deployAddress)),
764
+ getRemoveLiqAmountsOut: (...args) => singleQuery(publicClient, call.getRemoveLiqAmountsOut(...args).at(deployAddress)),
765
+ getPriceUnsafe: (...args) => singleQuery(publicClient, call.getPriceUnsafe(...args).at(deployAddress)),
766
+ getBestSwapAmountOut: (...args) => singleQuery(publicClient, call.getBestSwapAmountOut(...args).at(deployAddress)),
767
+ getBestSwapAmountIn: (...args) => singleQuery(publicClient, call.getBestSwapAmountIn(...args).at(deployAddress)),
768
+ getCoreRouterPool: (...args) => singleQuery(publicClient, call.getCoreRouterPool(...args).at(deployAddress)),
769
+ // Mutations
770
+ swapTokens: (...args) => mutate(walletClient, mutation.swapTokens, { address: deployAddress })(...args),
771
+ addLiquidity: (...args) => mutate(walletClient, mutation.addLiquidity, { address: deployAddress })(...args),
772
+ removeLiquidity: (...args) => mutate(walletClient, mutation.removeLiquidity, { address: deployAddress })(...args),
773
+ };
774
+ }