@sodax/sdk 0.0.1-rc.3 → 0.0.1-rc.30

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 (304) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +164 -11
  3. package/dist/index.cjs +16884 -0
  4. package/dist/index.cjs.map +1 -0
  5. package/dist/index.d.cts +9780 -0
  6. package/dist/index.d.ts +9779 -9
  7. package/dist/index.mjs +16633 -0
  8. package/dist/index.mjs.map +1 -0
  9. package/package.json +31 -32
  10. package/dist/abis/asset-manager.abi.d.ts +0 -418
  11. package/dist/abis/asset-manager.abi.d.ts.map +0 -1
  12. package/dist/abis/asset-manager.abi.js +0 -542
  13. package/dist/abis/asset-manager.abi.js.map +0 -1
  14. package/dist/abis/connection.abi.d.ts +0 -72
  15. package/dist/abis/connection.abi.d.ts.map +0 -1
  16. package/dist/abis/connection.abi.js +0 -92
  17. package/dist/abis/connection.abi.js.map +0 -1
  18. package/dist/abis/erc20.abi.d.ts +0 -236
  19. package/dist/abis/erc20.abi.d.ts.map +0 -1
  20. package/dist/abis/erc20.abi.js +0 -311
  21. package/dist/abis/erc20.abi.js.map +0 -1
  22. package/dist/abis/index.d.ts +0 -10
  23. package/dist/abis/index.d.ts.map +0 -1
  24. package/dist/abis/index.js +0 -10
  25. package/dist/abis/index.js.map +0 -1
  26. package/dist/abis/intents.abi.d.ts +0 -901
  27. package/dist/abis/intents.abi.d.ts.map +0 -1
  28. package/dist/abis/intents.abi.js +0 -1158
  29. package/dist/abis/intents.abi.js.map +0 -1
  30. package/dist/abis/pool.abi.d.ts +0 -626
  31. package/dist/abis/pool.abi.d.ts.map +0 -1
  32. package/dist/abis/pool.abi.js +0 -812
  33. package/dist/abis/pool.abi.js.map +0 -1
  34. package/dist/abis/spokeAssetManager.abi.d.ts +0 -169
  35. package/dist/abis/spokeAssetManager.abi.d.ts.map +0 -1
  36. package/dist/abis/spokeAssetManager.abi.js +0 -217
  37. package/dist/abis/spokeAssetManager.abi.js.map +0 -1
  38. package/dist/abis/uiPoolData.abi.d.ts +0 -369
  39. package/dist/abis/uiPoolData.abi.d.ts.map +0 -1
  40. package/dist/abis/uiPoolData.abi.js +0 -476
  41. package/dist/abis/uiPoolData.abi.js.map +0 -1
  42. package/dist/abis/vaultToken.abi.d.ts +0 -816
  43. package/dist/abis/vaultToken.abi.d.ts.map +0 -1
  44. package/dist/abis/vaultToken.abi.js +0 -1062
  45. package/dist/abis/vaultToken.abi.js.map +0 -1
  46. package/dist/abis/walletFactory.abi.d.ts +0 -20
  47. package/dist/abis/walletFactory.abi.d.ts.map +0 -1
  48. package/dist/abis/walletFactory.abi.js +0 -27
  49. package/dist/abis/walletFactory.abi.js.map +0 -1
  50. package/dist/constants.d.ts +0 -550
  51. package/dist/constants.d.ts.map +0 -1
  52. package/dist/constants.js +0 -1154
  53. package/dist/constants.js.map +0 -1
  54. package/dist/constants.test.d.ts +0 -2
  55. package/dist/constants.test.d.ts.map +0 -1
  56. package/dist/constants.test.js +0 -129
  57. package/dist/constants.test.js.map +0 -1
  58. package/dist/entities/Providers.d.ts +0 -54
  59. package/dist/entities/Providers.d.ts.map +0 -1
  60. package/dist/entities/Providers.js +0 -51
  61. package/dist/entities/Providers.js.map +0 -1
  62. package/dist/entities/Sodax.d.ts +0 -23
  63. package/dist/entities/Sodax.d.ts.map +0 -1
  64. package/dist/entities/Sodax.js +0 -29
  65. package/dist/entities/Sodax.js.map +0 -1
  66. package/dist/entities/Sodax.test.d.ts +0 -2
  67. package/dist/entities/Sodax.test.d.ts.map +0 -1
  68. package/dist/entities/Sodax.test.js +0 -392
  69. package/dist/entities/Sodax.test.js.map +0 -1
  70. package/dist/entities/cosmos/CW20Token.d.ts +0 -39
  71. package/dist/entities/cosmos/CW20Token.d.ts.map +0 -1
  72. package/dist/entities/cosmos/CW20Token.js +0 -65
  73. package/dist/entities/cosmos/CW20Token.js.map +0 -1
  74. package/dist/entities/cosmos/CWSpokeProvider.d.ts +0 -92
  75. package/dist/entities/cosmos/CWSpokeProvider.d.ts.map +0 -1
  76. package/dist/entities/cosmos/CWSpokeProvider.js +0 -143
  77. package/dist/entities/cosmos/CWSpokeProvider.js.map +0 -1
  78. package/dist/entities/cosmos/CosmosWalletProvider.d.ts +0 -28
  79. package/dist/entities/cosmos/CosmosWalletProvider.d.ts.map +0 -1
  80. package/dist/entities/cosmos/CosmosWalletProvider.js +0 -102
  81. package/dist/entities/cosmos/CosmosWalletProvider.js.map +0 -1
  82. package/dist/entities/cosmos/InjectiveWalletProvider.d.ts +0 -25
  83. package/dist/entities/cosmos/InjectiveWalletProvider.d.ts.map +0 -1
  84. package/dist/entities/cosmos/InjectiveWalletProvider.js +0 -76
  85. package/dist/entities/cosmos/InjectiveWalletProvider.js.map +0 -1
  86. package/dist/entities/icon/HanaWalletConnector.d.ts +0 -36
  87. package/dist/entities/icon/HanaWalletConnector.d.ts.map +0 -1
  88. package/dist/entities/icon/HanaWalletConnector.js +0 -92
  89. package/dist/entities/icon/HanaWalletConnector.js.map +0 -1
  90. package/dist/entities/icon/IconSpokeProvider.d.ts +0 -10
  91. package/dist/entities/icon/IconSpokeProvider.d.ts.map +0 -1
  92. package/dist/entities/icon/IconSpokeProvider.js +0 -12
  93. package/dist/entities/icon/IconSpokeProvider.js.map +0 -1
  94. package/dist/entities/icon/index.d.ts +0 -4
  95. package/dist/entities/icon/index.d.ts.map +0 -1
  96. package/dist/entities/icon/index.js +0 -4
  97. package/dist/entities/icon/index.js.map +0 -1
  98. package/dist/entities/icon/utils.d.ts +0 -3
  99. package/dist/entities/icon/utils.d.ts.map +0 -1
  100. package/dist/entities/icon/utils.js +0 -4
  101. package/dist/entities/icon/utils.js.map +0 -1
  102. package/dist/entities/index.d.ts +0 -7
  103. package/dist/entities/index.d.ts.map +0 -1
  104. package/dist/entities/index.js +0 -7
  105. package/dist/entities/index.js.map +0 -1
  106. package/dist/entities/solana/Configs.d.ts +0 -10
  107. package/dist/entities/solana/Configs.d.ts.map +0 -1
  108. package/dist/entities/solana/Configs.js +0 -50
  109. package/dist/entities/solana/Configs.js.map +0 -1
  110. package/dist/entities/solana/SolanaSpokeProvider.d.ts +0 -9
  111. package/dist/entities/solana/SolanaSpokeProvider.d.ts.map +0 -1
  112. package/dist/entities/solana/SolanaSpokeProvider.js +0 -9
  113. package/dist/entities/solana/SolanaSpokeProvider.js.map +0 -1
  114. package/dist/entities/solana/SolanaWalletProvider.d.ts +0 -20
  115. package/dist/entities/solana/SolanaWalletProvider.d.ts.map +0 -1
  116. package/dist/entities/solana/SolanaWalletProvider.js +0 -53
  117. package/dist/entities/solana/SolanaWalletProvider.js.map +0 -1
  118. package/dist/entities/solana/index.d.ts +0 -4
  119. package/dist/entities/solana/index.d.ts.map +0 -1
  120. package/dist/entities/solana/index.js +0 -4
  121. package/dist/entities/solana/index.js.map +0 -1
  122. package/dist/entities/solana/pda/pda.d.ts +0 -45
  123. package/dist/entities/solana/pda/pda.d.ts.map +0 -1
  124. package/dist/entities/solana/pda/pda.js +0 -44
  125. package/dist/entities/solana/pda/pda.js.map +0 -1
  126. package/dist/entities/solana/types/asset_manager.d.ts +0 -919
  127. package/dist/entities/solana/types/asset_manager.d.ts.map +0 -1
  128. package/dist/entities/solana/types/asset_manager.js +0 -2
  129. package/dist/entities/solana/types/asset_manager.js.map +0 -1
  130. package/dist/entities/solana/types/connection.d.ts +0 -446
  131. package/dist/entities/solana/types/connection.d.ts.map +0 -1
  132. package/dist/entities/solana/types/connection.js +0 -2
  133. package/dist/entities/solana/types/connection.js.map +0 -1
  134. package/dist/entities/solana/types/rate_limit_contract.d.ts +0 -348
  135. package/dist/entities/solana/types/rate_limit_contract.d.ts.map +0 -1
  136. package/dist/entities/solana/types/rate_limit_contract.js +0 -2
  137. package/dist/entities/solana/types/rate_limit_contract.js.map +0 -1
  138. package/dist/entities/solana/utils/utils.d.ts +0 -6
  139. package/dist/entities/solana/utils/utils.d.ts.map +0 -1
  140. package/dist/entities/solana/utils/utils.js +0 -18
  141. package/dist/entities/solana/utils/utils.js.map +0 -1
  142. package/dist/entities/stellar/StellarSpokeProvider.d.ts +0 -17
  143. package/dist/entities/stellar/StellarSpokeProvider.d.ts.map +0 -1
  144. package/dist/entities/stellar/StellarSpokeProvider.js +0 -125
  145. package/dist/entities/stellar/StellarSpokeProvider.js.map +0 -1
  146. package/dist/entities/sui/SuiSpokeProvider.d.ts +0 -35
  147. package/dist/entities/sui/SuiSpokeProvider.d.ts.map +0 -1
  148. package/dist/entities/sui/SuiSpokeProvider.js +0 -145
  149. package/dist/entities/sui/SuiSpokeProvider.js.map +0 -1
  150. package/dist/errors.d.ts +0 -2
  151. package/dist/errors.d.ts.map +0 -1
  152. package/dist/errors.js +0 -2
  153. package/dist/errors.js.map +0 -1
  154. package/dist/guards.d.ts +0 -25
  155. package/dist/guards.d.ts.map +0 -1
  156. package/dist/guards.js +0 -110
  157. package/dist/guards.js.map +0 -1
  158. package/dist/index.d.ts.map +0 -1
  159. package/dist/index.js +0 -10
  160. package/dist/index.js.map +0 -1
  161. package/dist/services/hub/EvmAssetManagerService.d.ts +0 -61
  162. package/dist/services/hub/EvmAssetManagerService.d.ts.map +0 -1
  163. package/dist/services/hub/EvmAssetManagerService.js +0 -103
  164. package/dist/services/hub/EvmAssetManagerService.js.map +0 -1
  165. package/dist/services/hub/EvmVaultTokenService.d.ts +0 -81
  166. package/dist/services/hub/EvmVaultTokenService.d.ts.map +0 -1
  167. package/dist/services/hub/EvmVaultTokenService.js +0 -161
  168. package/dist/services/hub/EvmVaultTokenService.js.map +0 -1
  169. package/dist/services/hub/EvmWalletAbstraction.d.ts +0 -9
  170. package/dist/services/hub/EvmWalletAbstraction.d.ts.map +0 -1
  171. package/dist/services/hub/EvmWalletAbstraction.js +0 -14
  172. package/dist/services/hub/EvmWalletAbstraction.js.map +0 -1
  173. package/dist/services/hub/index.d.ts +0 -4
  174. package/dist/services/hub/index.d.ts.map +0 -1
  175. package/dist/services/hub/index.js +0 -4
  176. package/dist/services/hub/index.js.map +0 -1
  177. package/dist/services/index.d.ts +0 -7
  178. package/dist/services/index.d.ts.map +0 -1
  179. package/dist/services/index.js +0 -7
  180. package/dist/services/index.js.map +0 -1
  181. package/dist/services/intentRelay/IntentRelayApiService.d.ts +0 -112
  182. package/dist/services/intentRelay/IntentRelayApiService.d.ts.map +0 -1
  183. package/dist/services/intentRelay/IntentRelayApiService.js +0 -160
  184. package/dist/services/intentRelay/IntentRelayApiService.js.map +0 -1
  185. package/dist/services/intentRelay/IntentRelayApiService.test.d.ts +0 -2
  186. package/dist/services/intentRelay/IntentRelayApiService.test.d.ts.map +0 -1
  187. package/dist/services/intentRelay/IntentRelayApiService.test.js +0 -134
  188. package/dist/services/intentRelay/IntentRelayApiService.test.js.map +0 -1
  189. package/dist/services/intentRelay/index.d.ts +0 -2
  190. package/dist/services/intentRelay/index.d.ts.map +0 -1
  191. package/dist/services/intentRelay/index.js +0 -2
  192. package/dist/services/intentRelay/index.js.map +0 -1
  193. package/dist/services/moneyMarket/MoneyMarketService.d.ts +0 -323
  194. package/dist/services/moneyMarket/MoneyMarketService.d.ts.map +0 -1
  195. package/dist/services/moneyMarket/MoneyMarketService.js +0 -612
  196. package/dist/services/moneyMarket/MoneyMarketService.js.map +0 -1
  197. package/dist/services/moneyMarket/MoneyMarketService.test.d.ts +0 -2
  198. package/dist/services/moneyMarket/MoneyMarketService.test.d.ts.map +0 -1
  199. package/dist/services/moneyMarket/MoneyMarketService.test.js +0 -262
  200. package/dist/services/moneyMarket/MoneyMarketService.test.js.map +0 -1
  201. package/dist/services/moneyMarket/index.d.ts +0 -2
  202. package/dist/services/moneyMarket/index.d.ts.map +0 -1
  203. package/dist/services/moneyMarket/index.js +0 -2
  204. package/dist/services/moneyMarket/index.js.map +0 -1
  205. package/dist/services/shared/Erc20Service.d.ts +0 -42
  206. package/dist/services/shared/Erc20Service.d.ts.map +0 -1
  207. package/dist/services/shared/Erc20Service.js +0 -108
  208. package/dist/services/shared/Erc20Service.js.map +0 -1
  209. package/dist/services/shared/index.d.ts +0 -2
  210. package/dist/services/shared/index.d.ts.map +0 -1
  211. package/dist/services/shared/index.js +0 -2
  212. package/dist/services/shared/index.js.map +0 -1
  213. package/dist/services/solver/EvmSolverService.d.ts +0 -125
  214. package/dist/services/solver/EvmSolverService.d.ts.map +0 -1
  215. package/dist/services/solver/EvmSolverService.js +0 -166
  216. package/dist/services/solver/EvmSolverService.js.map +0 -1
  217. package/dist/services/solver/SolverApiService.d.ts +0 -40
  218. package/dist/services/solver/SolverApiService.d.ts.map +0 -1
  219. package/dist/services/solver/SolverApiService.js +0 -157
  220. package/dist/services/solver/SolverApiService.js.map +0 -1
  221. package/dist/services/solver/SolverApiService.test.d.ts +0 -2
  222. package/dist/services/solver/SolverApiService.test.d.ts.map +0 -1
  223. package/dist/services/solver/SolverApiService.test.js +0 -181
  224. package/dist/services/solver/SolverApiService.test.js.map +0 -1
  225. package/dist/services/solver/SolverService.d.ts +0 -196
  226. package/dist/services/solver/SolverService.d.ts.map +0 -1
  227. package/dist/services/solver/SolverService.js +0 -329
  228. package/dist/services/solver/SolverService.js.map +0 -1
  229. package/dist/services/solver/SolverService.test.d.ts +0 -2
  230. package/dist/services/solver/SolverService.test.d.ts.map +0 -1
  231. package/dist/services/solver/SolverService.test.js +0 -439
  232. package/dist/services/solver/SolverService.test.js.map +0 -1
  233. package/dist/services/solver/index.d.ts +0 -3
  234. package/dist/services/solver/index.d.ts.map +0 -1
  235. package/dist/services/solver/index.js +0 -3
  236. package/dist/services/solver/index.js.map +0 -1
  237. package/dist/services/spoke/CWSpokeService.d.ts +0 -67
  238. package/dist/services/spoke/CWSpokeService.d.ts.map +0 -1
  239. package/dist/services/spoke/CWSpokeService.js +0 -75
  240. package/dist/services/spoke/CWSpokeService.js.map +0 -1
  241. package/dist/services/spoke/EvmSpokeService.d.ts +0 -62
  242. package/dist/services/spoke/EvmSpokeService.d.ts.map +0 -1
  243. package/dist/services/spoke/EvmSpokeService.js +0 -120
  244. package/dist/services/spoke/EvmSpokeService.js.map +0 -1
  245. package/dist/services/spoke/IconSpokeService.d.ts +0 -56
  246. package/dist/services/spoke/IconSpokeService.d.ts.map +0 -1
  247. package/dist/services/spoke/IconSpokeService.js +0 -124
  248. package/dist/services/spoke/IconSpokeService.js.map +0 -1
  249. package/dist/services/spoke/SolanaSpokeService.d.ts +0 -46
  250. package/dist/services/spoke/SolanaSpokeService.d.ts.map +0 -1
  251. package/dist/services/spoke/SolanaSpokeService.js +0 -170
  252. package/dist/services/spoke/SolanaSpokeService.js.map +0 -1
  253. package/dist/services/spoke/SpokeService.d.ts +0 -34
  254. package/dist/services/spoke/SpokeService.d.ts.map +0 -1
  255. package/dist/services/spoke/SpokeService.js +0 -102
  256. package/dist/services/spoke/SpokeService.js.map +0 -1
  257. package/dist/services/spoke/StellarSpokeService.d.ts +0 -35
  258. package/dist/services/spoke/StellarSpokeService.d.ts.map +0 -1
  259. package/dist/services/spoke/StellarSpokeService.js +0 -39
  260. package/dist/services/spoke/StellarSpokeService.js.map +0 -1
  261. package/dist/services/spoke/SuiSpokeService.d.ts +0 -69
  262. package/dist/services/spoke/SuiSpokeService.d.ts.map +0 -1
  263. package/dist/services/spoke/SuiSpokeService.js +0 -74
  264. package/dist/services/spoke/SuiSpokeService.js.map +0 -1
  265. package/dist/services/spoke/index.d.ts +0 -3
  266. package/dist/services/spoke/index.d.ts.map +0 -1
  267. package/dist/services/spoke/index.js +0 -3
  268. package/dist/services/spoke/index.js.map +0 -1
  269. package/dist/tests/services/hub/EvmAssetManagerService.test.d.ts +0 -2
  270. package/dist/tests/services/hub/EvmAssetManagerService.test.d.ts.map +0 -1
  271. package/dist/tests/services/hub/EvmAssetManagerService.test.js +0 -138
  272. package/dist/tests/services/hub/EvmAssetManagerService.test.js.map +0 -1
  273. package/dist/tests/services/hub/EvmMoneyMarketService.test.d.ts +0 -2
  274. package/dist/tests/services/hub/EvmMoneyMarketService.test.d.ts.map +0 -1
  275. package/dist/tests/services/hub/EvmMoneyMarketService.test.js +0 -121
  276. package/dist/tests/services/hub/EvmMoneyMarketService.test.js.map +0 -1
  277. package/dist/tests/services/hub/EvmVaultTokenService.test.d.ts +0 -2
  278. package/dist/tests/services/hub/EvmVaultTokenService.test.d.ts.map +0 -1
  279. package/dist/tests/services/hub/EvmVaultTokenService.test.js +0 -98
  280. package/dist/tests/services/hub/EvmVaultTokenService.test.js.map +0 -1
  281. package/dist/tests/services/spoke/EvmSpokeService.test.d.ts +0 -2
  282. package/dist/tests/services/spoke/EvmSpokeService.test.d.ts.map +0 -1
  283. package/dist/tests/services/spoke/EvmSpokeService.test.js +0 -198
  284. package/dist/tests/services/spoke/EvmSpokeService.test.js.map +0 -1
  285. package/dist/types.d.ts +0 -352
  286. package/dist/types.d.ts.map +0 -1
  287. package/dist/types.js +0 -30
  288. package/dist/types.js.map +0 -1
  289. package/dist/utils/evm-utils.d.ts +0 -10
  290. package/dist/utils/evm-utils.d.ts.map +0 -1
  291. package/dist/utils/evm-utils.js +0 -15
  292. package/dist/utils/evm-utils.js.map +0 -1
  293. package/dist/utils/index.d.ts +0 -3
  294. package/dist/utils/index.d.ts.map +0 -1
  295. package/dist/utils/index.js +0 -3
  296. package/dist/utils/index.js.map +0 -1
  297. package/dist/utils/shared-utils.d.ts +0 -20
  298. package/dist/utils/shared-utils.d.ts.map +0 -1
  299. package/dist/utils/shared-utils.js +0 -69
  300. package/dist/utils/shared-utils.js.map +0 -1
  301. package/dist/utils/shared-utils.test.d.ts +0 -2
  302. package/dist/utils/shared-utils.test.d.ts.map +0 -1
  303. package/dist/utils/shared-utils.test.js +0 -63
  304. package/dist/utils/shared-utils.test.js.map +0 -1
@@ -1,612 +0,0 @@
1
- import { encodeFunctionData } from 'viem';
2
- import { poolAbi } from '../../abis/pool.abi.js';
3
- import { DEFAULT_RELAYER_API_ENDPOINT, getHubAssetInfo, getMoneyMarketConfig, getSupportedMoneyMarketTokens, isConfiguredMoneyMarketConfig, isValidOriginalAssetAddress, isValidSpokeChainId, moneyMarketReserveAssets, SpokeService, relayTxAndWaitPacket, uiPoolDataAbi, DEFAULT_RELAY_TX_TIMEOUT, EvmSpokeProvider, isMoneyMarketSupportedToken, } from '../../index.js';
4
- import { calculateFeeAmount, encodeContractCalls } from '../../utils/index.js';
5
- import { EvmAssetManagerService, EvmVaultTokenService, EvmWalletAbstraction } from '../hub/index.js';
6
- import { Erc20Service } from '../shared/index.js';
7
- import invariant from 'tiny-invariant';
8
- import { SONIC_MAINNET_CHAIN_ID } from '@sodax/types';
9
- export class MoneyMarketService {
10
- config;
11
- hubProvider;
12
- constructor(config, hubProvider, relayerApiEndpoint) {
13
- if (!config) {
14
- this.config = {
15
- ...getMoneyMarketConfig(SONIC_MAINNET_CHAIN_ID), // default to mainnet config
16
- partnerFee: undefined,
17
- relayerApiEndpoint: relayerApiEndpoint ?? DEFAULT_RELAYER_API_ENDPOINT,
18
- };
19
- }
20
- else if (isConfiguredMoneyMarketConfig(config)) {
21
- this.config = {
22
- ...config,
23
- partnerFee: config.partnerFee,
24
- relayerApiEndpoint: relayerApiEndpoint ?? DEFAULT_RELAYER_API_ENDPOINT,
25
- };
26
- }
27
- else {
28
- this.config = {
29
- ...getMoneyMarketConfig(hubProvider.chainConfig.chain.id), // default to mainnet config
30
- partnerFee: config.partnerFee,
31
- relayerApiEndpoint: relayerApiEndpoint ?? DEFAULT_RELAYER_API_ENDPOINT,
32
- };
33
- }
34
- this.hubProvider = hubProvider;
35
- }
36
- /**
37
- * Check whether assetManager contract is allowed to move the given payload amount
38
- * @param {MoneyMarketRepayParams | MoneyMarketSupplyParams} params - Money market params
39
- * @param {SpokeProvider} spokeProvider - The spoke provider
40
- * @return {Promise<Result<boolean>>} - valid = true, invalid = false
41
- */
42
- async isAllowanceValid(params, spokeProvider) {
43
- try {
44
- if (spokeProvider instanceof EvmSpokeProvider) {
45
- const walletAddress = (await spokeProvider.walletProvider.getWalletAddress());
46
- return Erc20Service.isAllowanceValid(params.token, params.amount, walletAddress, spokeProvider.chainConfig.addresses.assetManager, spokeProvider);
47
- }
48
- return {
49
- ok: true,
50
- value: true,
51
- };
52
- }
53
- catch (error) {
54
- return {
55
- ok: false,
56
- error: error,
57
- };
58
- }
59
- }
60
- /**
61
- * Approve ERC20 amount spending
62
- * @param token - ERC20 token address
63
- * @param amount - Amount to approve
64
- * @param spender - Spender address
65
- * @param spokeProvider - Spoke provider
66
- */
67
- async approve(token, amount, spender, spokeProvider) {
68
- try {
69
- if (spokeProvider instanceof EvmSpokeProvider) {
70
- return Erc20Service.approve(token, amount, spender, spokeProvider);
71
- }
72
- return {
73
- ok: false,
74
- error: new Error('Approve only supported for EVM spoke chains'),
75
- };
76
- }
77
- catch (error) {
78
- return {
79
- ok: false,
80
- error: error,
81
- };
82
- }
83
- }
84
- /**
85
- * Supply tokens to the money market pool and submit the intent to the Solver API
86
- * @param params - The parameters for the supply transaction.
87
- * @param spokeProvider - The spoke provider.
88
- * @param timeout - The timeout in milliseconds for the transaction. Default is 20 seconds.
89
- * @returns [spokeTxHash, hubTxHash]
90
- */
91
- async supplyAndSubmit(params, spokeProvider, timeout = DEFAULT_RELAY_TX_TIMEOUT) {
92
- try {
93
- const txResult = await this.supply(params, spokeProvider);
94
- if (!txResult.ok) {
95
- return {
96
- ok: false,
97
- error: {
98
- code: 'SUPPLY_FAILED',
99
- error: txResult.error,
100
- },
101
- };
102
- }
103
- const packetResult = await relayTxAndWaitPacket(txResult.value, spokeProvider, this.config.relayerApiEndpoint, timeout);
104
- if (!packetResult.ok) {
105
- return packetResult;
106
- }
107
- return { ok: true, value: [txResult.value, packetResult.value.dst_tx_hash] };
108
- }
109
- catch (error) {
110
- return {
111
- ok: false,
112
- error: {
113
- code: 'UNKNOWN',
114
- error: error,
115
- },
116
- };
117
- }
118
- }
119
- /**
120
- * Supply tokens to the money market pool
121
- * NOTE: This method does not submit the intent to the Solver API
122
- * @param params - The parameters for the supply transaction.
123
- * @param spokeProvider - The spoke provider.
124
- * @param raw - Whether to return the raw transaction data.
125
- * @returns The transaction result.
126
- */
127
- async supply(params, spokeProvider, raw) {
128
- try {
129
- invariant(params.token.length > 0, 'Token is required');
130
- invariant(params.amount > 0n, 'Amount must be greater than 0');
131
- invariant(isMoneyMarketSupportedToken(spokeProvider.chainConfig.chain.id, params.token), `Unsupported spoke chain (${spokeProvider.chainConfig.chain.id}) token: ${params.token}`);
132
- const walletAddressBytes = await spokeProvider.walletProvider.getWalletAddressBytes();
133
- const hubWallet = await EvmWalletAbstraction.getUserHubWalletAddress(spokeProvider.chainConfig.chain.id, walletAddressBytes, this.hubProvider);
134
- const data = this.supplyData(params.token, hubWallet, params.amount, spokeProvider.chainConfig.chain.id);
135
- const walletAddress = (await spokeProvider.walletProvider.getWalletAddress());
136
- const txResult = await SpokeService.deposit({
137
- from: walletAddress,
138
- to: hubWallet,
139
- token: params.token,
140
- amount: params.amount,
141
- data,
142
- }, spokeProvider, this.hubProvider, raw);
143
- return {
144
- ok: true,
145
- value: txResult,
146
- };
147
- }
148
- catch (error) {
149
- return {
150
- ok: false,
151
- error: {
152
- code: 'UNKNOWN',
153
- error,
154
- },
155
- };
156
- }
157
- }
158
- /**
159
- * Borrow tokens from the money market pool and submit the intent to the Solver API
160
- * @param params - The parameters for the borrow transaction.
161
- * @param spokeProvider - The spoke provider.
162
- * @param timeout - The timeout in milliseconds for the transaction. Default is 20 seconds.
163
- * @returns [spokeTxHash, hubTxHash]
164
- */
165
- async borrowAndSubmit(params, spokeProvider, timeout = DEFAULT_RELAY_TX_TIMEOUT) {
166
- try {
167
- const txResult = await this.borrow(params, spokeProvider);
168
- if (!txResult.ok) {
169
- return {
170
- ok: false,
171
- error: {
172
- code: 'BORROW_FAILED',
173
- error: txResult.error,
174
- },
175
- };
176
- }
177
- const packetResult = await relayTxAndWaitPacket(txResult.value, spokeProvider, this.config.relayerApiEndpoint, timeout);
178
- if (!packetResult.ok) {
179
- return packetResult;
180
- }
181
- return { ok: true, value: [txResult.value, packetResult.value.dst_tx_hash] };
182
- }
183
- catch (error) {
184
- return {
185
- ok: false,
186
- error: {
187
- code: 'UNKNOWN',
188
- error: error,
189
- },
190
- };
191
- }
192
- }
193
- /**
194
- * Borrow tokens from the money market pool
195
- * NOTE: This method does not submit the intent to the Solver API
196
- * @param params - The parameters for the borrow transaction.
197
- * @param spokeProvider - The spoke provider.
198
- * @param raw - Whether to return the raw transaction data.
199
- * @returns The transaction result (raw transaction data or transaction hash).
200
- */
201
- async borrow(params, spokeProvider, raw) {
202
- invariant(params.token.length > 0, 'Token is required');
203
- invariant(params.amount > 0n, 'Amount must be greater than 0');
204
- invariant(isMoneyMarketSupportedToken(spokeProvider.chainConfig.chain.id, params.token), `Unsupported spoke chain (${spokeProvider.chainConfig.chain.id}) token: ${params.token}`);
205
- const walletAddressBytes = await spokeProvider.walletProvider.getWalletAddressBytes();
206
- const hubWallet = await EvmWalletAbstraction.getUserHubWalletAddress(spokeProvider.chainConfig.chain.id, walletAddressBytes, this.hubProvider);
207
- const data = this.borrowData(hubWallet, walletAddressBytes, params.token, params.amount, spokeProvider.chainConfig.chain.id);
208
- const txResult = await SpokeService.callWallet(hubWallet, data, spokeProvider, this.hubProvider, raw);
209
- return { ok: true, value: txResult };
210
- }
211
- /**
212
- * Withdraw tokens from the money market pool and submit the intent to the Solver API
213
- * @param params - The parameters for the withdraw transaction.
214
- * @param spokeProvider - The spoke provider.
215
- * @param timeout - The timeout in milliseconds for the transaction. Default is 20 seconds.
216
- * @returns [spokeTxHash, hubTxHash]
217
- */
218
- async withdrawAndSubmit(params, spokeProvider, timeout = DEFAULT_RELAY_TX_TIMEOUT) {
219
- try {
220
- const txResult = await this.withdraw(params, spokeProvider);
221
- if (!txResult.ok) {
222
- return {
223
- ok: false,
224
- error: {
225
- code: 'WITHDRAW_FAILED',
226
- error: txResult.error,
227
- },
228
- };
229
- }
230
- const packetResult = await relayTxAndWaitPacket(txResult.value, spokeProvider, this.config.relayerApiEndpoint, timeout);
231
- if (!packetResult.ok) {
232
- return packetResult;
233
- }
234
- return { ok: true, value: [txResult.value, packetResult.value.dst_tx_hash] };
235
- }
236
- catch (error) {
237
- return {
238
- ok: false,
239
- error: {
240
- code: 'UNKNOWN',
241
- error: error,
242
- },
243
- };
244
- }
245
- }
246
- /**
247
- * Withdraw tokens from the money market pool
248
- * NOTE: This method does not submit the intent to the Solver API
249
- * @param params - The parameters for the withdraw transaction.
250
- * @param spokeProvider - The spoke provider.
251
- * @param raw - Whether to return the raw transaction data.
252
- * @returns The transaction result (raw transaction data or transaction hash).
253
- */
254
- async withdraw(params, spokeProvider, raw) {
255
- invariant(params.token.length > 0, 'Token is required');
256
- invariant(params.amount > 0n, 'Amount must be greater than 0');
257
- invariant(isMoneyMarketSupportedToken(spokeProvider.chainConfig.chain.id, params.token), `Unsupported spoke chain (${spokeProvider.chainConfig.chain.id}) token: ${params.token}`);
258
- const walletAddressBytes = await spokeProvider.walletProvider.getWalletAddressBytes();
259
- const hubWallet = await EvmWalletAbstraction.getUserHubWalletAddress(spokeProvider.chainConfig.chain.id, walletAddressBytes, this.hubProvider);
260
- const data = this.withdrawData(hubWallet, walletAddressBytes, params.token, params.amount, spokeProvider.chainConfig.chain.id);
261
- const txResult = await SpokeService.callWallet(hubWallet, data, spokeProvider, this.hubProvider, raw);
262
- return { ok: true, value: txResult };
263
- }
264
- /**
265
- * Repay tokens to the money market pool and submit the intent to the Solver API
266
- * @param params - The parameters for the repay transaction.
267
- * @param spokeProvider - The spoke provider.
268
- * @param timeout - The timeout in milliseconds for the transaction. Default is 20 seconds.
269
- * @returns [spokeTxHash, hubTxHash]
270
- */
271
- async repayAndSubmit(params, spokeProvider, timeout = DEFAULT_RELAY_TX_TIMEOUT) {
272
- try {
273
- const txResult = await this.repay(params, spokeProvider);
274
- if (!txResult.ok) {
275
- return {
276
- ok: false,
277
- error: {
278
- code: 'REPAY_FAILED',
279
- error: txResult.error,
280
- },
281
- };
282
- }
283
- const packetResult = await relayTxAndWaitPacket(txResult.value, spokeProvider, this.config.relayerApiEndpoint, timeout);
284
- if (!packetResult.ok) {
285
- return packetResult;
286
- }
287
- return { ok: true, value: [txResult.value, packetResult.value.dst_tx_hash] };
288
- }
289
- catch (error) {
290
- return {
291
- ok: false,
292
- error: {
293
- code: 'UNKNOWN',
294
- error: error,
295
- },
296
- };
297
- }
298
- }
299
- /**
300
- * Repay tokens to the money market pool
301
- * NOTE: This method does not submit the intent to the Solver API
302
- * @param params - The parameters for the repay transaction.
303
- * @param spokeProvider - The spoke provider.
304
- * @param raw - Whether to return the raw transaction data.
305
- * @returns The transaction result (raw transaction data or transaction hash).
306
- */
307
- async repay(params, spokeProvider, raw) {
308
- invariant(params.token.length > 0, 'Token is required');
309
- invariant(params.amount > 0n, 'Amount must be greater than 0');
310
- invariant(isMoneyMarketSupportedToken(spokeProvider.chainConfig.chain.id, params.token), `Unsupported spoke chain (${spokeProvider.chainConfig.chain.id}) token: ${params.token}`);
311
- const walletAddressBytes = await spokeProvider.walletProvider.getWalletAddressBytes();
312
- const hubWallet = await EvmWalletAbstraction.getUserHubWalletAddress(spokeProvider.chainConfig.chain.id, walletAddressBytes, this.hubProvider);
313
- const data = this.repayData(params.token, hubWallet, params.amount, spokeProvider.chainConfig.chain.id);
314
- const walletAddress = (await spokeProvider.walletProvider.getWalletAddress());
315
- const txResult = await SpokeService.deposit({
316
- from: walletAddress,
317
- to: hubWallet,
318
- token: params.token,
319
- amount: params.amount,
320
- data,
321
- }, spokeProvider, this.hubProvider, raw);
322
- return { ok: true, value: txResult };
323
- }
324
- /**
325
- * Deposit tokens to the spoke chain and supply to the money market pool
326
- * @param token - The address of the token on spoke chain
327
- * @param to The user wallet address on the hub chain
328
- * @param amount The amount to deposit
329
- * @param spokeChainId The chain ID of the spoke chain
330
- * @returns The transaction result (raw transaction data or transaction hash).
331
- */
332
- supplyData(token, to, amount, spokeChainId) {
333
- const calls = [];
334
- const assetConfig = getHubAssetInfo(spokeChainId, token);
335
- invariant(assetConfig, `hub asset not found for spoke chain token (token): ${token}`);
336
- const assetAddress = assetConfig.asset;
337
- const vaultAddress = assetConfig.vault;
338
- const lendingPool = this.config.lendingPool;
339
- calls.push(Erc20Service.encodeApprove(assetAddress, vaultAddress, amount));
340
- calls.push(EvmVaultTokenService.encodeDeposit(vaultAddress, assetAddress, amount));
341
- const translatedAmount = EvmVaultTokenService.translateIncomingDecimals(assetConfig.decimal, amount);
342
- calls.push(Erc20Service.encodeApprove(vaultAddress, lendingPool, translatedAmount));
343
- calls.push(MoneyMarketService.encodeSupply({ asset: vaultAddress, amount: translatedAmount, onBehalfOf: to, referralCode: 0 }, lendingPool));
344
- return encodeContractCalls(calls);
345
- }
346
- /**
347
- * Borrow tokens from the money market pool
348
- * @param from The user wallet address on the hub chain
349
- * @param to The user wallet address on the spoke chain
350
- * @param token The address of the token to borrow
351
- * @param amount The amount to borrow in hub chain decimals
352
- * @param spokeChainId The chain ID of the spoke chain
353
- * @returns Transaction object
354
- */
355
- borrowData(from, to, token, amount, spokeChainId) {
356
- invariant(isValidSpokeChainId(spokeChainId), `Invalid spokeChainId: ${spokeChainId}`);
357
- invariant(isValidOriginalAssetAddress(spokeChainId, token), `Unsupported spoke chain (${spokeChainId}) token: ${token}`);
358
- const assetConfig = getHubAssetInfo(spokeChainId, token);
359
- invariant(assetConfig, `hub asset not found for spoke chain token (token): ${token}`);
360
- const assetAddress = assetConfig.asset;
361
- const vaultAddress = assetConfig.vault;
362
- const bnUSDVault = this.config.bnUSDVault;
363
- const bnUSD = this.config.bnUSD;
364
- const feeAmount = calculateFeeAmount(amount, this.config.partnerFee);
365
- const calls = [];
366
- if (bnUSDVault && bnUSD && bnUSDVault.toLowerCase() === vaultAddress.toLowerCase()) {
367
- calls.push(MoneyMarketService.encodeBorrow({ asset: bnUSD, amount: amount, interestRateMode: 2n, referralCode: 0, onBehalfOf: from }, this.config.lendingPool));
368
- calls.push(Erc20Service.encodeApprove(bnUSD, bnUSDVault, amount));
369
- calls.push(EvmVaultTokenService.encodeDeposit(bnUSDVault, bnUSD, amount));
370
- if (this.config.partnerFee && feeAmount) {
371
- calls.push(Erc20Service.encodeTansfer(bnUSDVault, this.config.partnerFee.address, feeAmount));
372
- }
373
- }
374
- else {
375
- calls.push(MoneyMarketService.encodeBorrow({ asset: vaultAddress, amount: amount, interestRateMode: 2n, referralCode: 0, onBehalfOf: from }, this.config.lendingPool));
376
- if (this.config.partnerFee && feeAmount) {
377
- calls.push(Erc20Service.encodeTansfer(vaultAddress, this.config.partnerFee.address, feeAmount));
378
- }
379
- }
380
- calls.push(EvmVaultTokenService.encodeWithdraw(vaultAddress, assetAddress, amount - feeAmount));
381
- const translatedAmountOut = EvmVaultTokenService.translateOutgoingDecimals(assetConfig.decimal, amount - feeAmount);
382
- calls.push(EvmAssetManagerService.encodeTransfer(assetAddress, to, translatedAmountOut, this.hubProvider.chainConfig.addresses.assetManager));
383
- return encodeContractCalls(calls);
384
- }
385
- /**
386
- * Withdraw tokens from the money market pool
387
- * @param from The user wallet address on the hub chain
388
- * @param to The user wallet address on the spoke chain
389
- * @param token The address of the token to borrow
390
- * @param amount The amount to borrow in hub chain decimals
391
- * @param spokeChainId The chain ID of the spoke chain
392
- * @returns Transaction object
393
- */
394
- withdrawData(from, to, token, amount, spokeChainId) {
395
- const calls = [];
396
- const assetConfig = getHubAssetInfo(spokeChainId, token);
397
- if (!assetConfig) {
398
- throw new Error('[withdrawData] Hub asset not found');
399
- }
400
- const assetAddress = assetConfig.asset;
401
- const vaultAddress = assetConfig.vault;
402
- if (!assetAddress || !vaultAddress) {
403
- throw new Error('Address not found');
404
- }
405
- calls.push(MoneyMarketService.encodeWithdraw({ asset: vaultAddress, amount: amount, to: from }, this.config.lendingPool));
406
- calls.push(EvmVaultTokenService.encodeWithdraw(vaultAddress, assetAddress, amount));
407
- const translatedAmountOut = EvmVaultTokenService.translateOutgoingDecimals(assetConfig.decimal, amount);
408
- calls.push(EvmAssetManagerService.encodeTransfer(assetAddress, to, translatedAmountOut, this.hubProvider.chainConfig.addresses.assetManager));
409
- return encodeContractCalls(calls);
410
- }
411
- /**
412
- * Repay tokens to the money market pool
413
- * @param token The address of the token to repay
414
- * @param to The user wallet address on the hub chain
415
- * @param amount The amount to repay
416
- * @param spokeChainId The chain ID of the spoke chain
417
- * @param moneyMarketConfig The money market config
418
- * @returns Transaction object
419
- */
420
- repayData(token, to, amount, spokeChainId) {
421
- const calls = [];
422
- const assetConfig = getHubAssetInfo(spokeChainId, token);
423
- if (!assetConfig) {
424
- throw new Error('[repayData] Hub asset not found');
425
- }
426
- const assetAddress = assetConfig.asset;
427
- const vaultAddress = assetConfig.vault;
428
- const bnUSDVault = this.config.bnUSDVault;
429
- const bnUSD = this.config.bnUSD;
430
- calls.push(Erc20Service.encodeApprove(assetAddress, vaultAddress, amount));
431
- calls.push(EvmVaultTokenService.encodeDeposit(vaultAddress, assetAddress, amount));
432
- const translatedAmount = EvmVaultTokenService.translateIncomingDecimals(assetConfig.decimal, amount);
433
- let repayToken = vaultAddress;
434
- if (bnUSDVault && bnUSD && bnUSDVault.toLowerCase() === vaultAddress.toLowerCase()) {
435
- repayToken = bnUSD;
436
- calls.push(EvmVaultTokenService.encodeWithdraw(bnUSDVault, bnUSD, translatedAmount));
437
- }
438
- calls.push(Erc20Service.encodeApprove(repayToken, this.config.lendingPool, translatedAmount));
439
- calls.push(MoneyMarketService.encodeRepay({ asset: repayToken, amount: translatedAmount, interestRateMode: 2n, onBehalfOf: to }, this.config.lendingPool));
440
- return encodeContractCalls(calls);
441
- }
442
- /**
443
- * Get the list of all reserves in the pool
444
- * @param uiPoolDataProvider - The address of the UI Pool Data Provider
445
- * @param poolAddressesProvider - The address of the Pool Addresses Provider
446
- * @returns Array of reserve addresses
447
- */
448
- async getReservesList(uiPoolDataProvider, poolAddressesProvider) {
449
- return this.hubProvider.publicClient.readContract({
450
- address: uiPoolDataProvider,
451
- abi: uiPoolDataAbi,
452
- functionName: 'getReservesList',
453
- args: [poolAddressesProvider],
454
- });
455
- }
456
- /**
457
- * Get detailed data for all reserves in the pool
458
- * @param uiPoolDataProvider - The address of the UI Pool Data Provider
459
- * @param poolAddressesProvider - The address of the Pool Addresses Provider
460
- * @returns Tuple containing array of reserve data and base currency info
461
- */
462
- async getReservesData(uiPoolDataProvider, poolAddressesProvider) {
463
- return this.hubProvider.publicClient.readContract({
464
- address: uiPoolDataProvider,
465
- abi: uiPoolDataAbi,
466
- functionName: 'getReservesData',
467
- args: [poolAddressesProvider],
468
- });
469
- }
470
- /**
471
- * Get user-specific reserve data
472
- * @param userAddress Address of the user
473
- * @param uiPoolDataProvider - The address of the UI Pool Data Provider
474
- * @param poolAddressesProvider - The address of the Pool Addresses Provider
475
- * @returns Tuple containing array of user reserve data and eMode category ID
476
- */
477
- async getUserReservesData(userAddress, uiPoolDataProvider, poolAddressesProvider) {
478
- return this.hubProvider.publicClient.readContract({
479
- address: uiPoolDataProvider,
480
- abi: uiPoolDataAbi,
481
- functionName: 'getUserReservesData',
482
- args: [poolAddressesProvider, userAddress],
483
- });
484
- }
485
- /**
486
- * Encodes a supply transaction for a money market pool.
487
- * @param {MoneyMarketEncodeWithdrawParams} params - The parameters for the supply transaction.
488
- * @param {Address} lendingPool - The address of the lending pool contract.
489
- * @returns {EvmContractCall} The encoded contract call.
490
- */
491
- static encodeSupply(params, lendingPool) {
492
- return {
493
- address: lendingPool,
494
- value: 0n,
495
- data: encodeFunctionData({
496
- abi: poolAbi,
497
- functionName: 'supply',
498
- args: [params.asset, params.amount, params.onBehalfOf, params.referralCode],
499
- }),
500
- };
501
- }
502
- /**
503
- * Encodes a withdraw transaction from a pool.
504
- * @param {MoneyMarketEncodeWithdrawParams} params - The parameters for the withdraw transaction.
505
- * @param {Address} params.asset - The address of the asset to withdraw.
506
- * @param {bigint} params.amount - The amount of the asset to withdraw.
507
- * @param {Address} params.to - The address that will receive the withdrawn assets.
508
- * @param {Address} lendingPool - The address of the lending pool contract.
509
- * @returns {EvmContractCall} The encoded contract call.
510
- */
511
- static encodeWithdraw(params, lendingPool) {
512
- return {
513
- address: lendingPool,
514
- value: 0n,
515
- data: encodeFunctionData({
516
- abi: poolAbi,
517
- functionName: 'withdraw',
518
- args: [params.asset, params.amount, params.to],
519
- }),
520
- };
521
- }
522
- /**
523
- * Encodes a borrow transaction from a pool.
524
- * @param {MoneyMarketEncodeBorrowParams} params - The parameters for the borrow transaction.
525
- * @param {Address} lendingPool - The address of the lending pool contract.
526
- * @returns {EvmContractCall} The encoded contract call.
527
- */
528
- static encodeBorrow(params, lendingPool) {
529
- return {
530
- address: lendingPool,
531
- value: 0n,
532
- data: encodeFunctionData({
533
- abi: poolAbi,
534
- functionName: 'borrow',
535
- args: [params.asset, params.amount, params.interestRateMode, params.referralCode, params.onBehalfOf],
536
- }),
537
- };
538
- }
539
- /**
540
- * Encodes a repay transaction for a pool.
541
- * @param {MoneyMarketEncodeRepayParams} params - The parameters for the repay transaction.
542
- * @param {Address} params.asset - The address of the borrowed asset to repay.
543
- * @param {bigint} params.amount - The amount to repay. Use type(uint256).max to repay the entire debt.
544
- * @param {number} params.interestRateMode - The interest rate mode (2 for Variable).
545
- * @param {Address} params.onBehalfOf - The address of the user who will get their debt reduced/removed.
546
- * @param {Address} lendingPool - The address of the lending pool contract.
547
- * @returns {EvmContractCall} The encoded contract call.
548
- */
549
- static encodeRepay(params, lendingPool) {
550
- return {
551
- address: lendingPool,
552
- value: 0n,
553
- data: encodeFunctionData({
554
- abi: poolAbi,
555
- functionName: 'repay',
556
- args: [params.asset, params.amount, params.interestRateMode, params.onBehalfOf],
557
- }),
558
- };
559
- }
560
- /**
561
- * Encodes a repayWithATokens transaction for a pool.
562
- * @param {MoneyMarketEncodeRepayWithATokensParams} params - The parameters for the repayWithATokens transaction.
563
- * @param {Address} lendingPool - The address of the lending pool contract.
564
- * @returns {EvmContractCall} The encoded contract call.
565
- */
566
- static encodeRepayWithATokens(params, lendingPool) {
567
- return {
568
- address: lendingPool,
569
- value: 0n,
570
- data: encodeFunctionData({
571
- abi: poolAbi,
572
- functionName: 'repayWithATokens',
573
- args: [params.asset, params.amount, params.interestRateMode],
574
- }),
575
- };
576
- }
577
- /**
578
- * Encodes a setUserUseReserveAsCollateral transaction.
579
- * @param asset - The address of the underlying asset to be used as collateral.
580
- * @param useAsCollateral - True to enable the asset as collateral, false to disable.
581
- * @param lendingPool - The address of lending pool contract
582
- * @returns The encoded contract call.
583
- */
584
- static encodeSetUserUseReserveAsCollateral(asset, useAsCollateral, lendingPool) {
585
- return {
586
- address: lendingPool,
587
- value: 0n,
588
- data: encodeFunctionData({
589
- abi: poolAbi,
590
- functionName: 'setUserUseReserveAsCollateral',
591
- args: [asset, useAsCollateral],
592
- }),
593
- };
594
- }
595
- /**
596
- * Get the list of all supported money market tokens (supply / borrow tokens) for a given spoke chain ID
597
- * @param chainId The chain ID
598
- * @returns Array of supported tokens
599
- */
600
- getSupportedTokens(chainId) {
601
- return getSupportedMoneyMarketTokens(chainId);
602
- }
603
- /**
604
- * Get the list of all supported money market reserves (supply / borrow reserves)
605
- * NOTE: reserve addresses are on the hub chain and can be of type vault, erc20, etc.
606
- * @returns Array of supported reserves
607
- */
608
- getSupportedReserves() {
609
- return [...moneyMarketReserveAssets];
610
- }
611
- }
612
- //# sourceMappingURL=MoneyMarketService.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"MoneyMarketService.js","sourceRoot":"","sources":["../../../src/services/moneyMarket/MoneyMarketService.ts"],"names":[],"mappings":"AAAA,OAAO,EAA0B,kBAAkB,EAAE,MAAM,MAAM,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAEjD,OAAO,EACL,4BAA4B,EAC5B,eAAe,EACf,oBAAoB,EACpB,6BAA6B,EAC7B,6BAA6B,EAC7B,2BAA2B,EAC3B,mBAAmB,EACnB,wBAAwB,EACxB,YAAY,EACZ,oBAAoB,EACpB,aAAa,EAEb,wBAAwB,EACxB,gBAAgB,EAChB,2BAA2B,GAC5B,MAAM,gBAAgB,CAAC;AAWxB,OAAO,EAAE,kBAAkB,EAAE,mBAAmB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AAE,EAAE;YACT,IAAI,EAAE,kBAAkB,CAAC;gBACvB,GAAG,EAAE,OAAO;gBACZ,YAAY,EAAE,+BAA+B;gBAC7C,IAAI,EAAE,CAAC,KAAK,EAAE,eAAe,CAAC;aAC/B,CAAC;SACH,CAAC;IACJ,CAAC;IAED;;;;OAIG;IACI,kBAAkB,CAAC,OAAqB;QAC7C,OAAO,6BAA6B,CAAC,OAAO,CAAC,CAAC;IAChD,CAAC;IAED;;;;OAIG;IACI,oBAAoB;QACzB,OAAO,CAAC,GAAG,wBAAwB,CAAC,CAAC;IACvC,CAAC;CACF"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=MoneyMarketService.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"MoneyMarketService.test.d.ts","sourceRoot":"","sources":["../../../src/services/moneyMarket/MoneyMarketService.test.ts"],"names":[],"mappings":""}