@underscore-finance/sdk 0.3.5 → 1.0.2

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 +33 -36
  113. package/dist/contracts/index.d.ts.map +1 -1
  114. package/dist/contracts/index.js +33 -36
  115. package/dist/contracts/sdk.d.ts +66 -72
  116. package/dist/contracts/sdk.d.ts.map +1 -1
  117. package/dist/contracts/sdk.js +66 -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 +75 -0
  233. package/dist/getContracts.d.ts.map +1 -0
  234. package/dist/getContracts.js +62 -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 +33 -0
  239. package/dist/getSwapInstructions.d.ts.map +1 -0
  240. package/dist/getSwapInstructions.js +21 -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
package/dist/index.js CHANGED
@@ -1,209 +1,35 @@
1
1
  import { iteratorQuery, query } from '@dappql/async';
2
2
  import { createPublicClient, http } from 'viem';
3
- import { base, baseSepolia } from 'viem/chains';
3
+ import { base } from 'viem/chains';
4
4
  import * as CONTRACTS from './contracts/index.js';
5
- import * as LegoHelper from './contracts/LegoHelper.js';
6
- import createSdk from './contracts/sdk.js';
5
+ import getContracts from './getContracts.js';
7
6
  export * from './contracts/index.js';
8
- const TESTNET_ADDRESSES = {
9
- AddyRegistry: '0xa89a59E14333187829528C50eBAaE6EC12Bae95d',
10
- AgentFactory: '0x50d08c554b0F7F4784B7108103e586eccb522b8E',
11
- UserWalletTemplate: '0x5081a0ff1F3518aE7D3c6E5106CC820EB5d472a5',
12
- UserWalletConfigTemplate: '0xC12152418FDF2daE2A45C3D07AdFf9f6f1249BbA',
13
- AgentTemplate: '0xfd1255e086b0E045EfBFa9E3e99aE9A450BDc486',
14
- LegoRegistry: '0xf6a8bE55c84b94Fe071575EF52F095A23c282eea',
15
- OracleRegistry: '0x2c794b3864480fAfF791cD46400E061f818cE42f',
16
- PriceSheets: '0x155d0ECd672D7a1050d34eC0a1006d67823C3123',
17
- LegoHelper: '0x98dD9D8591D826E285052f23F450c8d702f07a18',
18
- };
19
7
  class Underscore {
20
8
  constructor(config) {
21
9
  this.publicClient =
22
10
  config?.publicClient ||
23
11
  createPublicClient({
24
- chain: config?.isTestnet ? baseSepolia : base,
12
+ chain: base,
25
13
  transport: http(config?.rpcUrl),
26
14
  });
27
15
  this.walletClient = config?.walletClient;
28
- this.contracts = createSdk(this.publicClient, this.walletClient);
29
- this.isTestnet = config?.isTestnet ?? false;
16
+ this.contracts = getContracts(this.publicClient, this.walletClient);
30
17
  }
31
18
  setWalletClient(walletClient) {
32
19
  this.walletClient = walletClient;
33
- this.contracts = createSdk(this.publicClient, this.walletClient);
20
+ this.contracts = getContracts(this.publicClient, this.walletClient);
34
21
  }
35
22
  setPublicClient(publicClient) {
36
23
  this.publicClient = publicClient;
37
- this.contracts = createSdk(this.publicClient, this.walletClient);
38
- }
39
- async getSwapInstructionsAmountOut(payload) {
40
- const { tokenIn, tokenOut, amountIn, slippage, includeLegoIds } = payload;
41
- const instructions = await this.publicClient.simulateContract({
42
- address: this.LegoHelper.deployAddress,
43
- abi: LegoHelper.abi,
44
- functionName: 'getRoutesAndSwapInstructionsAmountOut',
45
- args: [tokenIn, tokenOut, amountIn, slippage, includeLegoIds ?? []],
46
- });
47
- return instructions.result;
48
- }
49
- async getSwapInstructionsAmountIn(payload) {
50
- const { tokenIn, tokenOut, amountOut, amountInAvailable, slippage, includeLegoIds } = payload;
51
- const instructions = await this.publicClient.simulateContract({
52
- address: this.LegoHelper.deployAddress,
53
- abi: LegoHelper.abi,
54
- functionName: 'getRoutesAndSwapInstructionsAmountIn',
55
- args: [tokenIn, tokenOut, amountOut, amountInAvailable, slippage, includeLegoIds ?? []],
56
- });
57
- return instructions.result;
58
- }
59
- get AddyRegistry() {
60
- const deployAddress = this.isTestnet ? TESTNET_ADDRESSES.AddyRegistry : CONTRACTS.AddyRegistry.deployAddress;
61
- return {
62
- ...this.contracts.AddyRegistry(deployAddress),
63
- deployAddress,
64
- };
65
- }
66
- /**
67
- * @deprecated Use `Registry` instead. This version is for legacy compatibility.
68
- */
69
- get AddyRegistry_v1() {
70
- return this.contracts.AddyRegistry_v1;
71
- }
72
- /**
73
- * @deprecated Use `Registry` instead. This version is for legacy compatibility.
74
- */
75
- get AddyRegistry_v2() {
76
- return this.contracts.AddyRegistry_v2;
77
- }
78
- get AgentFactory() {
79
- const deployAddress = this.isTestnet ? TESTNET_ADDRESSES.AgentFactory : CONTRACTS.AgentFactory.deployAddress;
80
- return {
81
- ...this.contracts.AgentFactory(deployAddress),
82
- deployAddress,
83
- };
84
- }
85
- /**
86
- * @deprecated Use `Factory` instead. This version is for legacy compatibility.
87
- */
88
- get AgentFactory_v2() {
89
- return this.contracts.AgentFactory_v2;
90
- }
91
- /**
92
- * @deprecated Use `Factory` instead. This version is for legacy compatibility.
93
- */
94
- get AgentFactory_v1() {
95
- return this.contracts.AgentFactory_v1;
96
- }
97
- get OracleRegistry() {
98
- const deployAddress = this.isTestnet ? TESTNET_ADDRESSES.OracleRegistry : CONTRACTS.OracleRegistry.deployAddress;
99
- return {
100
- ...this.contracts.OracleRegistry(deployAddress),
101
- deployAddress,
102
- };
103
- }
104
- get LegoRegistry() {
105
- const deployAddress = this.isTestnet ? TESTNET_ADDRESSES.LegoRegistry : CONTRACTS.LegoRegistry.deployAddress;
106
- return {
107
- ...this.contracts.LegoRegistry(deployAddress),
108
- deployAddress,
109
- };
110
- }
111
- get LegoHelper() {
112
- const deployAddress = this.isTestnet ? TESTNET_ADDRESSES.LegoHelper : LegoHelper.deployAddress;
113
- return {
114
- ...this.contracts.LegoHelper(deployAddress),
115
- deployAddress,
116
- };
117
- }
118
- get PriceSheets() {
119
- const deployAddress = this.isTestnet ? TESTNET_ADDRESSES.PriceSheets : CONTRACTS.PriceSheets.deployAddress;
120
- return {
121
- ...this.contracts.PriceSheets(deployAddress),
122
- deployAddress,
123
- };
124
- }
125
- get Agent() {
126
- return { at: (address) => this.contracts.Agent(address) };
127
- }
128
- /**
129
- * @deprecated Use `Agent` instead. This version is for legacy compatibility.
130
- */
131
- get Agent_v1() {
132
- return { at: (address) => this.contracts.Agent_v1(address) };
133
- }
134
- /**
135
- * @deprecated Use `Agent` instead. This version is for legacy compatibility.
136
- */
137
- get Agent_v2() {
138
- return { at: (address) => this.contracts.Agent_v2(address) };
139
- }
140
- get UserWallet() {
141
- return { at: (address) => this.contracts.UserWallet(address) };
142
- }
143
- /**
144
- * @deprecated Use `UserWallet` instead. This version is for legacy compatibility.
145
- */
146
- get UserWallet_v1() {
147
- return { at: (address) => this.contracts.UserWallet_v1(address) };
148
- }
149
- /**
150
- * @deprecated Use `UserWallet` instead. This version is for legacy compatibility.
151
- */
152
- get UserWallet_v2() {
153
- return { at: (address) => this.contracts.UserWallet_v2(address) };
154
- }
155
- get UserWalletConfig() {
156
- return { at: (address) => this.contracts.UserWalletConfig(address) };
157
- }
158
- /**
159
- * @deprecated Use `UserWalletConfig` instead. This version is for legacy compatibility.
160
- */
161
- get UserWalletConfig_v1() {
162
- return { at: (address) => this.contracts.UserWalletConfig_v1(address) };
163
- }
164
- /**
165
- * @deprecated Use `UserWalletConfig` instead. This version is for legacy compatibility.
166
- */
167
- get UserWalletConfig_v2() {
168
- return { at: (address) => this.contracts.UserWalletConfig_v2(address) };
169
- }
170
- get ERC20() {
171
- return { at: (address) => this.contracts.ERC20(address) };
172
- }
173
- get LegoCommon() {
174
- return { at: (address) => this.contracts.LegoCommon(address) };
175
- }
176
- get LegoCredit() {
177
- return { at: (address) => this.contracts.LegoCredit(address) };
178
- }
179
- get LegoDex() {
180
- return { at: (address) => this.contracts.LegoDex(address) };
181
- }
182
- get LegoYield() {
183
- return { at: (address) => this.contracts.LegoYield(address) };
184
- }
185
- get OracleParser() {
186
- return { at: (address) => this.contracts.OracleParser(address) };
187
- }
188
- get addressResolver() {
189
- return (contractName) => {
190
- if (this.isTestnet) {
191
- const address = TESTNET_ADDRESSES[contractName];
192
- if (!address) {
193
- throw new Error(`Address for ${contractName} not found`);
194
- }
195
- return address;
196
- }
197
- return CONTRACTS[contractName].deployAddress;
198
- };
24
+ this.contracts = getContracts(this.publicClient, this.walletClient);
199
25
  }
200
26
  async multicall(cb, options = {}) {
201
27
  const request = cb(CONTRACTS);
202
- return query(this.publicClient, request, options, this.addressResolver);
28
+ return query(this.publicClient, request, options);
203
29
  }
204
30
  async iterate(cb, options = {}) {
205
31
  const { total, getItem } = cb(CONTRACTS);
206
- return iteratorQuery(this.publicClient, total, getItem, options, this.addressResolver);
32
+ return iteratorQuery(this.publicClient, total, getItem, options);
207
33
  }
208
34
  }
209
35
  export default Underscore;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@underscore-finance/sdk",
3
- "version": "0.3.5",
3
+ "version": "1.0.2",
4
4
  "description": "SDK for interacting with Underscore Finance Smart Contracts with TypeScript",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -30,7 +30,7 @@
30
30
  },
31
31
  "dependencies": {
32
32
  "@dappql/async": "^1.0.3",
33
- "dappql": "^2.0.29",
33
+ "dappql": "^2.0.30",
34
34
  "viem": "^2.23.7"
35
35
  }
36
36
  }