@wirexapp/wpay-baas-sdk 0.1.6 → 0.1.7

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 (342) hide show
  1. package/dist/chunk-BN5Q2YHP.js +4945 -0
  2. package/dist/chunk-BN5Q2YHP.js.map +1 -0
  3. package/dist/chunk-C4OR7ZVY.js +303 -0
  4. package/dist/chunk-C4OR7ZVY.js.map +1 -0
  5. package/dist/chunk-Y7TGKAUA.js +1364 -0
  6. package/dist/chunk-Y7TGKAUA.js.map +1 -0
  7. package/dist/core/index.d.ts +32 -8
  8. package/dist/core/index.js +2 -4
  9. package/dist/core/index.js.map +1 -1
  10. package/dist/{core/errors.d.ts → errors-5LpyK95R.d.ts} +10 -9
  11. package/dist/index-DETvmzdr.d.ts +1715 -0
  12. package/dist/index.d.ts +33 -14
  13. package/dist/index.js +111 -6
  14. package/dist/index.js.map +1 -1
  15. package/dist/modules/api/index.d.ts +4 -7
  16. package/dist/modules/api/index.js +3 -4
  17. package/dist/modules/api/index.js.map +1 -1
  18. package/dist/modules/crypto/index.d.ts +192 -9
  19. package/dist/modules/crypto/index.js +4 -7
  20. package/dist/modules/crypto/index.js.map +1 -1
  21. package/dist/types-IKGr4nyf.d.ts +179 -0
  22. package/dist/types-_VJ4UPM4.d.ts +185 -0
  23. package/dist/{modules/crypto/interfaces/crypto.interface.d.ts → withdrawal.api-DsvQPbRN.d.ts} +20 -11
  24. package/package.json +37 -9
  25. package/dist/abi/accounts.abi.d.ts +0 -405
  26. package/dist/abi/accounts.abi.d.ts.map +0 -1
  27. package/dist/abi/accounts.abi.js +0 -351
  28. package/dist/abi/accounts.abi.js.map +0 -1
  29. package/dist/abi/contractRegistry.abi.d.ts +0 -220
  30. package/dist/abi/contractRegistry.abi.d.ts.map +0 -1
  31. package/dist/abi/contractRegistry.abi.js +0 -287
  32. package/dist/abi/contractRegistry.abi.js.map +0 -1
  33. package/dist/abi/corporateAccounts.abi.d.ts +0 -42
  34. package/dist/abi/corporateAccounts.abi.d.ts.map +0 -1
  35. package/dist/abi/corporateAccounts.abi.js +0 -34
  36. package/dist/abi/corporateAccounts.abi.js.map +0 -1
  37. package/dist/abi/erc20.abi.d.ts +0 -253
  38. package/dist/abi/erc20.abi.d.ts.map +0 -1
  39. package/dist/abi/erc20.abi.js +0 -98
  40. package/dist/abi/erc20.abi.js.map +0 -1
  41. package/dist/abi/executionDelayPolicy.abi.d.ts +0 -378
  42. package/dist/abi/executionDelayPolicy.abi.d.ts.map +0 -1
  43. package/dist/abi/executionDelayPolicy.abi.js +0 -502
  44. package/dist/abi/executionDelayPolicy.abi.js.map +0 -1
  45. package/dist/abi/fundsManagement.abi.d.ts +0 -54
  46. package/dist/abi/fundsManagement.abi.d.ts.map +0 -1
  47. package/dist/abi/fundsManagement.abi.js +0 -361
  48. package/dist/abi/fundsManagement.abi.js.map +0 -1
  49. package/dist/abi/index.d.ts +0 -11
  50. package/dist/abi/index.d.ts.map +0 -1
  51. package/dist/abi/index.js +0 -11
  52. package/dist/abi/index.js.map +0 -1
  53. package/dist/abi/signer.abi.d.ts +0 -20
  54. package/dist/abi/signer.abi.d.ts.map +0 -1
  55. package/dist/abi/signer.abi.js +0 -13
  56. package/dist/abi/signer.abi.js.map +0 -1
  57. package/dist/abi/synthetic.abi.d.ts +0 -2459
  58. package/dist/abi/synthetic.abi.d.ts.map +0 -1
  59. package/dist/abi/synthetic.abi.js +0 -1739
  60. package/dist/abi/synthetic.abi.js.map +0 -1
  61. package/dist/abi/tokenRegistry.abi.d.ts +0 -209
  62. package/dist/abi/tokenRegistry.abi.d.ts.map +0 -1
  63. package/dist/abi/tokenRegistry.abi.js +0 -117
  64. package/dist/abi/tokenRegistry.abi.js.map +0 -1
  65. package/dist/abi/yieldCalculator.abi.d.ts +0 -327
  66. package/dist/abi/yieldCalculator.abi.d.ts.map +0 -1
  67. package/dist/abi/yieldCalculator.abi.js +0 -2
  68. package/dist/abi/yieldCalculator.abi.js.map +0 -1
  69. package/dist/client.d.ts +0 -23
  70. package/dist/client.d.ts.map +0 -1
  71. package/dist/client.js +0 -98
  72. package/dist/client.js.map +0 -1
  73. package/dist/core/config/config.service.d.ts +0 -19
  74. package/dist/core/config/config.service.d.ts.map +0 -1
  75. package/dist/core/config/config.service.js +0 -83
  76. package/dist/core/config/config.service.js.map +0 -1
  77. package/dist/core/config/index.d.ts +0 -4
  78. package/dist/core/config/index.d.ts.map +0 -1
  79. package/dist/core/config/index.js +0 -3
  80. package/dist/core/config/index.js.map +0 -1
  81. package/dist/core/config/types.d.ts +0 -40
  82. package/dist/core/config/types.d.ts.map +0 -1
  83. package/dist/core/config/types.js +0 -5
  84. package/dist/core/config/types.js.map +0 -1
  85. package/dist/core/errors.d.ts.map +0 -1
  86. package/dist/core/errors.js +0 -63
  87. package/dist/core/errors.js.map +0 -1
  88. package/dist/core/index.d.ts.map +0 -1
  89. package/dist/core/internal/http-client.d.ts +0 -40
  90. package/dist/core/internal/http-client.d.ts.map +0 -1
  91. package/dist/core/internal/http-client.js +0 -113
  92. package/dist/core/internal/http-client.js.map +0 -1
  93. package/dist/core/types.d.ts +0 -93
  94. package/dist/core/types.d.ts.map +0 -1
  95. package/dist/core/types.js +0 -13
  96. package/dist/core/types.js.map +0 -1
  97. package/dist/index.d.ts.map +0 -1
  98. package/dist/modules/api/api.module.d.ts +0 -21
  99. package/dist/modules/api/api.module.d.ts.map +0 -1
  100. package/dist/modules/api/api.module.js +0 -47
  101. package/dist/modules/api/api.module.js.map +0 -1
  102. package/dist/modules/api/baas/activity/activity.service.d.ts +0 -34
  103. package/dist/modules/api/baas/activity/activity.service.d.ts.map +0 -1
  104. package/dist/modules/api/baas/activity/activity.service.js +0 -61
  105. package/dist/modules/api/baas/activity/activity.service.js.map +0 -1
  106. package/dist/modules/api/baas/activity/index.d.ts +0 -3
  107. package/dist/modules/api/baas/activity/index.d.ts.map +0 -1
  108. package/dist/modules/api/baas/activity/index.js +0 -2
  109. package/dist/modules/api/baas/activity/index.js.map +0 -1
  110. package/dist/modules/api/baas/activity/types.d.ts +0 -166
  111. package/dist/modules/api/baas/activity/types.d.ts.map +0 -1
  112. package/dist/modules/api/baas/activity/types.js +0 -5
  113. package/dist/modules/api/baas/activity/types.js.map +0 -1
  114. package/dist/modules/api/baas/baas.module.d.ts +0 -44
  115. package/dist/modules/api/baas/baas.module.d.ts.map +0 -1
  116. package/dist/modules/api/baas/baas.module.js +0 -156
  117. package/dist/modules/api/baas/baas.module.js.map +0 -1
  118. package/dist/modules/api/baas/bank/bank.service.d.ts +0 -42
  119. package/dist/modules/api/baas/bank/bank.service.d.ts.map +0 -1
  120. package/dist/modules/api/baas/bank/bank.service.js +0 -75
  121. package/dist/modules/api/baas/bank/bank.service.js.map +0 -1
  122. package/dist/modules/api/baas/bank/index.d.ts +0 -3
  123. package/dist/modules/api/baas/bank/index.d.ts.map +0 -1
  124. package/dist/modules/api/baas/bank/index.js +0 -2
  125. package/dist/modules/api/baas/bank/index.js.map +0 -1
  126. package/dist/modules/api/baas/bank/types.d.ts +0 -116
  127. package/dist/modules/api/baas/bank/types.d.ts.map +0 -1
  128. package/dist/modules/api/baas/bank/types.js +0 -5
  129. package/dist/modules/api/baas/bank/types.js.map +0 -1
  130. package/dist/modules/api/baas/cards/cards.service.d.ts +0 -118
  131. package/dist/modules/api/baas/cards/cards.service.d.ts.map +0 -1
  132. package/dist/modules/api/baas/cards/cards.service.js +0 -254
  133. package/dist/modules/api/baas/cards/cards.service.js.map +0 -1
  134. package/dist/modules/api/baas/cards/index.d.ts +0 -3
  135. package/dist/modules/api/baas/cards/index.d.ts.map +0 -1
  136. package/dist/modules/api/baas/cards/index.js +0 -2
  137. package/dist/modules/api/baas/cards/index.js.map +0 -1
  138. package/dist/modules/api/baas/cards/types.d.ts +0 -249
  139. package/dist/modules/api/baas/cards/types.d.ts.map +0 -1
  140. package/dist/modules/api/baas/cards/types.js +0 -5
  141. package/dist/modules/api/baas/cards/types.js.map +0 -1
  142. package/dist/modules/api/baas/config/config.service.d.ts +0 -21
  143. package/dist/modules/api/baas/config/config.service.d.ts.map +0 -1
  144. package/dist/modules/api/baas/config/config.service.js +0 -22
  145. package/dist/modules/api/baas/config/config.service.js.map +0 -1
  146. package/dist/modules/api/baas/config/index.d.ts +0 -3
  147. package/dist/modules/api/baas/config/index.d.ts.map +0 -1
  148. package/dist/modules/api/baas/config/index.js +0 -2
  149. package/dist/modules/api/baas/config/index.js.map +0 -1
  150. package/dist/modules/api/baas/config/types.d.ts +0 -42
  151. package/dist/modules/api/baas/config/types.d.ts.map +0 -1
  152. package/dist/modules/api/baas/config/types.js +0 -2
  153. package/dist/modules/api/baas/config/types.js.map +0 -1
  154. package/dist/modules/api/baas/confirmation/confirmation.service.d.ts +0 -30
  155. package/dist/modules/api/baas/confirmation/confirmation.service.d.ts.map +0 -1
  156. package/dist/modules/api/baas/confirmation/confirmation.service.js +0 -39
  157. package/dist/modules/api/baas/confirmation/confirmation.service.js.map +0 -1
  158. package/dist/modules/api/baas/confirmation/index.d.ts +0 -3
  159. package/dist/modules/api/baas/confirmation/index.d.ts.map +0 -1
  160. package/dist/modules/api/baas/confirmation/index.js +0 -2
  161. package/dist/modules/api/baas/confirmation/index.js.map +0 -1
  162. package/dist/modules/api/baas/confirmation/types.d.ts +0 -30
  163. package/dist/modules/api/baas/confirmation/types.d.ts.map +0 -1
  164. package/dist/modules/api/baas/confirmation/types.js +0 -5
  165. package/dist/modules/api/baas/confirmation/types.js.map +0 -1
  166. package/dist/modules/api/baas/index.d.ts +0 -13
  167. package/dist/modules/api/baas/index.d.ts.map +0 -1
  168. package/dist/modules/api/baas/index.js +0 -13
  169. package/dist/modules/api/baas/index.js.map +0 -1
  170. package/dist/modules/api/baas/rates/index.d.ts +0 -3
  171. package/dist/modules/api/baas/rates/index.d.ts.map +0 -1
  172. package/dist/modules/api/baas/rates/index.js +0 -2
  173. package/dist/modules/api/baas/rates/index.js.map +0 -1
  174. package/dist/modules/api/baas/rates/rates.service.d.ts +0 -21
  175. package/dist/modules/api/baas/rates/rates.service.d.ts.map +0 -1
  176. package/dist/modules/api/baas/rates/rates.service.js +0 -25
  177. package/dist/modules/api/baas/rates/rates.service.js.map +0 -1
  178. package/dist/modules/api/baas/rates/types.d.ts +0 -12
  179. package/dist/modules/api/baas/rates/types.d.ts.map +0 -1
  180. package/dist/modules/api/baas/rates/types.js +0 -2
  181. package/dist/modules/api/baas/rates/types.js.map +0 -1
  182. package/dist/modules/api/baas/recipients/index.d.ts +0 -3
  183. package/dist/modules/api/baas/recipients/index.d.ts.map +0 -1
  184. package/dist/modules/api/baas/recipients/index.js +0 -2
  185. package/dist/modules/api/baas/recipients/index.js.map +0 -1
  186. package/dist/modules/api/baas/recipients/recipients.service.d.ts +0 -74
  187. package/dist/modules/api/baas/recipients/recipients.service.d.ts.map +0 -1
  188. package/dist/modules/api/baas/recipients/recipients.service.js +0 -190
  189. package/dist/modules/api/baas/recipients/recipients.service.js.map +0 -1
  190. package/dist/modules/api/baas/recipients/types.d.ts +0 -208
  191. package/dist/modules/api/baas/recipients/types.d.ts.map +0 -1
  192. package/dist/modules/api/baas/recipients/types.js +0 -5
  193. package/dist/modules/api/baas/recipients/types.js.map +0 -1
  194. package/dist/modules/api/baas/swap/index.d.ts +0 -3
  195. package/dist/modules/api/baas/swap/index.d.ts.map +0 -1
  196. package/dist/modules/api/baas/swap/index.js +0 -2
  197. package/dist/modules/api/baas/swap/index.js.map +0 -1
  198. package/dist/modules/api/baas/swap/swap.service.d.ts +0 -28
  199. package/dist/modules/api/baas/swap/swap.service.d.ts.map +0 -1
  200. package/dist/modules/api/baas/swap/swap.service.js +0 -32
  201. package/dist/modules/api/baas/swap/swap.service.js.map +0 -1
  202. package/dist/modules/api/baas/swap/types.d.ts +0 -56
  203. package/dist/modules/api/baas/swap/types.d.ts.map +0 -1
  204. package/dist/modules/api/baas/swap/types.js +0 -6
  205. package/dist/modules/api/baas/swap/types.js.map +0 -1
  206. package/dist/modules/api/baas/token/index.d.ts +0 -3
  207. package/dist/modules/api/baas/token/index.d.ts.map +0 -1
  208. package/dist/modules/api/baas/token/index.js +0 -2
  209. package/dist/modules/api/baas/token/index.js.map +0 -1
  210. package/dist/modules/api/baas/token/token.service.d.ts +0 -21
  211. package/dist/modules/api/baas/token/token.service.d.ts.map +0 -1
  212. package/dist/modules/api/baas/token/token.service.js +0 -22
  213. package/dist/modules/api/baas/token/token.service.js.map +0 -1
  214. package/dist/modules/api/baas/token/types.d.ts +0 -12
  215. package/dist/modules/api/baas/token/types.d.ts.map +0 -1
  216. package/dist/modules/api/baas/token/types.js +0 -2
  217. package/dist/modules/api/baas/token/types.js.map +0 -1
  218. package/dist/modules/api/baas/user/index.d.ts +0 -3
  219. package/dist/modules/api/baas/user/index.d.ts.map +0 -1
  220. package/dist/modules/api/baas/user/index.js +0 -2
  221. package/dist/modules/api/baas/user/index.js.map +0 -1
  222. package/dist/modules/api/baas/user/types.d.ts +0 -145
  223. package/dist/modules/api/baas/user/types.d.ts.map +0 -1
  224. package/dist/modules/api/baas/user/types.js +0 -5
  225. package/dist/modules/api/baas/user/types.js.map +0 -1
  226. package/dist/modules/api/baas/user/user.service.d.ts +0 -73
  227. package/dist/modules/api/baas/user/user.service.d.ts.map +0 -1
  228. package/dist/modules/api/baas/user/user.service.js +0 -140
  229. package/dist/modules/api/baas/user/user.service.js.map +0 -1
  230. package/dist/modules/api/baas/wallet/index.d.ts +0 -3
  231. package/dist/modules/api/baas/wallet/index.d.ts.map +0 -1
  232. package/dist/modules/api/baas/wallet/index.js +0 -2
  233. package/dist/modules/api/baas/wallet/index.js.map +0 -1
  234. package/dist/modules/api/baas/wallet/types.d.ts +0 -26
  235. package/dist/modules/api/baas/wallet/types.d.ts.map +0 -1
  236. package/dist/modules/api/baas/wallet/types.js +0 -5
  237. package/dist/modules/api/baas/wallet/types.js.map +0 -1
  238. package/dist/modules/api/baas/wallet/wallet.service.d.ts +0 -30
  239. package/dist/modules/api/baas/wallet/wallet.service.d.ts.map +0 -1
  240. package/dist/modules/api/baas/wallet/wallet.service.js +0 -43
  241. package/dist/modules/api/baas/wallet/wallet.service.js.map +0 -1
  242. package/dist/modules/api/index.d.ts.map +0 -1
  243. package/dist/modules/api/internal/endpoints/wallets.api.d.ts +0 -8
  244. package/dist/modules/api/internal/endpoints/wallets.api.d.ts.map +0 -1
  245. package/dist/modules/api/internal/endpoints/wallets.api.js +0 -9
  246. package/dist/modules/api/internal/endpoints/wallets.api.js.map +0 -1
  247. package/dist/modules/api/internal/endpoints/withdrawal.api.d.ts +0 -8
  248. package/dist/modules/api/internal/endpoints/withdrawal.api.d.ts.map +0 -1
  249. package/dist/modules/api/internal/endpoints/withdrawal.api.js +0 -10
  250. package/dist/modules/api/internal/endpoints/withdrawal.api.js.map +0 -1
  251. package/dist/modules/api/types/common.types.d.ts +0 -19
  252. package/dist/modules/api/types/common.types.d.ts.map +0 -1
  253. package/dist/modules/api/types/common.types.js +0 -2
  254. package/dist/modules/api/types/common.types.js.map +0 -1
  255. package/dist/modules/api/types/wallets.types.d.ts +0 -12
  256. package/dist/modules/api/types/wallets.types.d.ts.map +0 -1
  257. package/dist/modules/api/types/wallets.types.js +0 -2
  258. package/dist/modules/api/types/wallets.types.js.map +0 -1
  259. package/dist/modules/auth/auth.service.d.ts +0 -32
  260. package/dist/modules/auth/auth.service.d.ts.map +0 -1
  261. package/dist/modules/auth/auth.service.js +0 -182
  262. package/dist/modules/auth/auth.service.js.map +0 -1
  263. package/dist/modules/auth/index.d.ts +0 -3
  264. package/dist/modules/auth/index.d.ts.map +0 -1
  265. package/dist/modules/auth/index.js +0 -2
  266. package/dist/modules/auth/index.js.map +0 -1
  267. package/dist/modules/auth/types.d.ts +0 -82
  268. package/dist/modules/auth/types.d.ts.map +0 -1
  269. package/dist/modules/auth/types.js +0 -2
  270. package/dist/modules/auth/types.js.map +0 -1
  271. package/dist/modules/crypto/chains/base/account-abstraction.service.d.ts +0 -28
  272. package/dist/modules/crypto/chains/base/account-abstraction.service.d.ts.map +0 -1
  273. package/dist/modules/crypto/chains/base/account-abstraction.service.js +0 -173
  274. package/dist/modules/crypto/chains/base/account-abstraction.service.js.map +0 -1
  275. package/dist/modules/crypto/chains/base/account.contract.service.d.ts +0 -26
  276. package/dist/modules/crypto/chains/base/account.contract.service.d.ts.map +0 -1
  277. package/dist/modules/crypto/chains/base/account.contract.service.js +0 -109
  278. package/dist/modules/crypto/chains/base/account.contract.service.js.map +0 -1
  279. package/dist/modules/crypto/chains/base/crypto.service.d.ts +0 -34
  280. package/dist/modules/crypto/chains/base/crypto.service.d.ts.map +0 -1
  281. package/dist/modules/crypto/chains/base/crypto.service.js +0 -289
  282. package/dist/modules/crypto/chains/base/crypto.service.js.map +0 -1
  283. package/dist/modules/crypto/chains/base/index.d.ts +0 -6
  284. package/dist/modules/crypto/chains/base/index.d.ts.map +0 -1
  285. package/dist/modules/crypto/chains/base/index.js +0 -55
  286. package/dist/modules/crypto/chains/base/index.js.map +0 -1
  287. package/dist/modules/crypto/chains/base/wallet.service.d.ts +0 -55
  288. package/dist/modules/crypto/chains/base/wallet.service.d.ts.map +0 -1
  289. package/dist/modules/crypto/chains/base/wallet.service.js +0 -149
  290. package/dist/modules/crypto/chains/base/wallet.service.js.map +0 -1
  291. package/dist/modules/crypto/chains/base/yield.service.d.ts +0 -38
  292. package/dist/modules/crypto/chains/base/yield.service.d.ts.map +0 -1
  293. package/dist/modules/crypto/chains/base/yield.service.js +0 -297
  294. package/dist/modules/crypto/chains/base/yield.service.js.map +0 -1
  295. package/dist/modules/crypto/chains/index.d.ts +0 -5
  296. package/dist/modules/crypto/chains/index.d.ts.map +0 -1
  297. package/dist/modules/crypto/chains/index.js +0 -3
  298. package/dist/modules/crypto/chains/index.js.map +0 -1
  299. package/dist/modules/crypto/chains/registry.d.ts +0 -11
  300. package/dist/modules/crypto/chains/registry.d.ts.map +0 -1
  301. package/dist/modules/crypto/chains/registry.js +0 -19
  302. package/dist/modules/crypto/chains/registry.js.map +0 -1
  303. package/dist/modules/crypto/chains/types.d.ts +0 -39
  304. package/dist/modules/crypto/chains/types.d.ts.map +0 -1
  305. package/dist/modules/crypto/chains/types.js +0 -2
  306. package/dist/modules/crypto/chains/types.js.map +0 -1
  307. package/dist/modules/crypto/crypto.module.d.ts +0 -40
  308. package/dist/modules/crypto/crypto.module.d.ts.map +0 -1
  309. package/dist/modules/crypto/crypto.module.js +0 -134
  310. package/dist/modules/crypto/crypto.module.js.map +0 -1
  311. package/dist/modules/crypto/index.d.ts.map +0 -1
  312. package/dist/modules/crypto/interfaces/account-abstraction.interface.d.ts +0 -8
  313. package/dist/modules/crypto/interfaces/account-abstraction.interface.d.ts.map +0 -1
  314. package/dist/modules/crypto/interfaces/account-abstraction.interface.js +0 -2
  315. package/dist/modules/crypto/interfaces/account-abstraction.interface.js.map +0 -1
  316. package/dist/modules/crypto/interfaces/account-contract.interface.d.ts +0 -8
  317. package/dist/modules/crypto/interfaces/account-contract.interface.d.ts.map +0 -1
  318. package/dist/modules/crypto/interfaces/account-contract.interface.js +0 -2
  319. package/dist/modules/crypto/interfaces/account-contract.interface.js.map +0 -1
  320. package/dist/modules/crypto/interfaces/crypto.interface.d.ts.map +0 -1
  321. package/dist/modules/crypto/interfaces/crypto.interface.js +0 -2
  322. package/dist/modules/crypto/interfaces/crypto.interface.js.map +0 -1
  323. package/dist/modules/crypto/interfaces/index.d.ts +0 -5
  324. package/dist/modules/crypto/interfaces/index.d.ts.map +0 -1
  325. package/dist/modules/crypto/interfaces/index.js +0 -2
  326. package/dist/modules/crypto/interfaces/index.js.map +0 -1
  327. package/dist/modules/crypto/interfaces/yield.interface.d.ts +0 -19
  328. package/dist/modules/crypto/interfaces/yield.interface.d.ts.map +0 -1
  329. package/dist/modules/crypto/interfaces/yield.interface.js +0 -2
  330. package/dist/modules/crypto/interfaces/yield.interface.js.map +0 -1
  331. package/dist/modules/crypto/internal/contract-registry.service.d.ts +0 -14
  332. package/dist/modules/crypto/internal/contract-registry.service.d.ts.map +0 -1
  333. package/dist/modules/crypto/internal/contract-registry.service.js +0 -76
  334. package/dist/modules/crypto/internal/contract-registry.service.js.map +0 -1
  335. package/dist/modules/crypto/internal/smartDepositWallet.service.d.ts +0 -39
  336. package/dist/modules/crypto/internal/smartDepositWallet.service.d.ts.map +0 -1
  337. package/dist/modules/crypto/internal/smartDepositWallet.service.js +0 -183
  338. package/dist/modules/crypto/internal/smartDepositWallet.service.js.map +0 -1
  339. package/dist/modules/crypto/types.d.ts +0 -47
  340. package/dist/modules/crypto/types.d.ts.map +0 -1
  341. package/dist/modules/crypto/types.js +0 -2
  342. package/dist/modules/crypto/types.js.map +0 -1
@@ -0,0 +1,4945 @@
1
+ import { AuthService, WithdrawalApi } from './chunk-Y7TGKAUA.js';
2
+ import { ContractError, ConfigurationError } from './chunk-C4OR7ZVY.js';
3
+ import { toPermissionValidator } from '@zerodev/permissions';
4
+ import { toSudoPolicy } from '@zerodev/permissions/policies';
5
+ import { toECDSASigner } from '@zerodev/permissions/signers';
6
+ import { getCustomNonceKeyFromString, KernelV3_1AccountAbi, createKernelAccount, createKernelAccountClient, createZeroDevPaymasterClient } from '@zerodev/sdk';
7
+ import { KERNEL_V3_1, getEntryPoint, VALIDATOR_TYPE } from '@zerodev/sdk/constants';
8
+ import { encodeFunctionData, decodeFunctionResult, parseAbiItem, formatUnits, parseUnits, keccak256, pad, erc20Abi, concatHex, zeroAddress, zeroHash, createWalletClient, custom, http, createPublicClient } from 'viem';
9
+ import { signerToEcdsaValidator } from '@zerodev/ecdsa-validator';
10
+ import { SupportedChains, RhinoSdk } from '@rhino.fi/sdk';
11
+
12
+ // src/modules/crypto/chains/registry.ts
13
+ var ChainRegistry = class {
14
+ constructor() {
15
+ this.factories = /* @__PURE__ */ new Map();
16
+ }
17
+ register(chainId, factory) {
18
+ this.factories.set(chainId, factory);
19
+ }
20
+ get(chainId) {
21
+ return this.factories.get(chainId);
22
+ }
23
+ has(chainId) {
24
+ return this.factories.has(chainId);
25
+ }
26
+ getSupportedChainIds() {
27
+ return Array.from(this.factories.keys());
28
+ }
29
+ };
30
+ var chainRegistry = new ChainRegistry();
31
+
32
+ // src/abi/contractRegistry.abi.ts
33
+ var contractRegistryAbi = [
34
+ {
35
+ "inputs": [],
36
+ "stateMutability": "nonpayable",
37
+ "type": "constructor"
38
+ },
39
+ {
40
+ "inputs": [
41
+ {
42
+ "internalType": "address",
43
+ "name": "owner",
44
+ "type": "address"
45
+ }
46
+ ],
47
+ "name": "OwnableInvalidOwner",
48
+ "type": "error"
49
+ },
50
+ {
51
+ "inputs": [
52
+ {
53
+ "internalType": "address",
54
+ "name": "account",
55
+ "type": "address"
56
+ }
57
+ ],
58
+ "name": "OwnableUnauthorizedAccount",
59
+ "type": "error"
60
+ },
61
+ {
62
+ "anonymous": false,
63
+ "inputs": [
64
+ {
65
+ "indexed": true,
66
+ "internalType": "address",
67
+ "name": "previousOwner",
68
+ "type": "address"
69
+ },
70
+ {
71
+ "indexed": true,
72
+ "internalType": "address",
73
+ "name": "newOwner",
74
+ "type": "address"
75
+ }
76
+ ],
77
+ "name": "OwnershipTransferred",
78
+ "type": "event"
79
+ },
80
+ {
81
+ "inputs": [],
82
+ "name": "admin",
83
+ "outputs": [
84
+ {
85
+ "internalType": "address",
86
+ "name": "",
87
+ "type": "address"
88
+ }
89
+ ],
90
+ "stateMutability": "view",
91
+ "type": "function"
92
+ },
93
+ {
94
+ "inputs": [
95
+ {
96
+ "internalType": "string",
97
+ "name": "name",
98
+ "type": "string"
99
+ }
100
+ ],
101
+ "name": "contractByName",
102
+ "outputs": [
103
+ {
104
+ "internalType": "address",
105
+ "name": "proxy",
106
+ "type": "address"
107
+ }
108
+ ],
109
+ "stateMutability": "view",
110
+ "type": "function"
111
+ },
112
+ {
113
+ "inputs": [],
114
+ "name": "contracts",
115
+ "outputs": [
116
+ {
117
+ "components": [
118
+ {
119
+ "internalType": "string",
120
+ "name": "name",
121
+ "type": "string"
122
+ },
123
+ {
124
+ "internalType": "address",
125
+ "name": "proxy",
126
+ "type": "address"
127
+ }
128
+ ],
129
+ "internalType": "struct IContractRegistry.ContractData[]",
130
+ "name": "contractsInfo",
131
+ "type": "tuple[]"
132
+ }
133
+ ],
134
+ "stateMutability": "view",
135
+ "type": "function"
136
+ },
137
+ {
138
+ "inputs": [],
139
+ "name": "oracleCards",
140
+ "outputs": [
141
+ {
142
+ "internalType": "address",
143
+ "name": "",
144
+ "type": "address"
145
+ }
146
+ ],
147
+ "stateMutability": "view",
148
+ "type": "function"
149
+ },
150
+ {
151
+ "inputs": [],
152
+ "name": "oracleFunds",
153
+ "outputs": [
154
+ {
155
+ "internalType": "address",
156
+ "name": "",
157
+ "type": "address"
158
+ }
159
+ ],
160
+ "stateMutability": "view",
161
+ "type": "function"
162
+ },
163
+ {
164
+ "inputs": [],
165
+ "name": "oracleKYC",
166
+ "outputs": [
167
+ {
168
+ "internalType": "address",
169
+ "name": "",
170
+ "type": "address"
171
+ }
172
+ ],
173
+ "stateMutability": "view",
174
+ "type": "function"
175
+ },
176
+ {
177
+ "inputs": [],
178
+ "name": "oracleProcessing",
179
+ "outputs": [
180
+ {
181
+ "internalType": "address",
182
+ "name": "",
183
+ "type": "address"
184
+ }
185
+ ],
186
+ "stateMutability": "view",
187
+ "type": "function"
188
+ },
189
+ {
190
+ "inputs": [],
191
+ "name": "owner",
192
+ "outputs": [
193
+ {
194
+ "internalType": "address",
195
+ "name": "",
196
+ "type": "address"
197
+ }
198
+ ],
199
+ "stateMutability": "view",
200
+ "type": "function"
201
+ },
202
+ {
203
+ "inputs": [
204
+ {
205
+ "internalType": "string",
206
+ "name": "name",
207
+ "type": "string"
208
+ }
209
+ ],
210
+ "name": "removeContract",
211
+ "outputs": [],
212
+ "stateMutability": "nonpayable",
213
+ "type": "function"
214
+ },
215
+ {
216
+ "inputs": [],
217
+ "name": "renounceOwnership",
218
+ "outputs": [],
219
+ "stateMutability": "nonpayable",
220
+ "type": "function"
221
+ },
222
+ {
223
+ "inputs": [
224
+ {
225
+ "internalType": "address",
226
+ "name": "newAddress",
227
+ "type": "address"
228
+ }
229
+ ],
230
+ "name": "setAdmin",
231
+ "outputs": [],
232
+ "stateMutability": "nonpayable",
233
+ "type": "function"
234
+ },
235
+ {
236
+ "inputs": [
237
+ {
238
+ "internalType": "string",
239
+ "name": "name",
240
+ "type": "string"
241
+ },
242
+ {
243
+ "internalType": "address",
244
+ "name": "proxy",
245
+ "type": "address"
246
+ }
247
+ ],
248
+ "name": "setContract",
249
+ "outputs": [],
250
+ "stateMutability": "nonpayable",
251
+ "type": "function"
252
+ },
253
+ {
254
+ "inputs": [
255
+ {
256
+ "internalType": "address",
257
+ "name": "newAddress",
258
+ "type": "address"
259
+ }
260
+ ],
261
+ "name": "setOracleCards",
262
+ "outputs": [],
263
+ "stateMutability": "nonpayable",
264
+ "type": "function"
265
+ },
266
+ {
267
+ "inputs": [
268
+ {
269
+ "internalType": "address",
270
+ "name": "newAddress",
271
+ "type": "address"
272
+ }
273
+ ],
274
+ "name": "setOracleFunds",
275
+ "outputs": [],
276
+ "stateMutability": "nonpayable",
277
+ "type": "function"
278
+ },
279
+ {
280
+ "inputs": [
281
+ {
282
+ "internalType": "address",
283
+ "name": "newAddress",
284
+ "type": "address"
285
+ }
286
+ ],
287
+ "name": "setOracleKYC",
288
+ "outputs": [],
289
+ "stateMutability": "nonpayable",
290
+ "type": "function"
291
+ },
292
+ {
293
+ "inputs": [
294
+ {
295
+ "internalType": "address",
296
+ "name": "newAddress",
297
+ "type": "address"
298
+ }
299
+ ],
300
+ "name": "setOracleProcessing",
301
+ "outputs": [],
302
+ "stateMutability": "nonpayable",
303
+ "type": "function"
304
+ },
305
+ {
306
+ "inputs": [
307
+ {
308
+ "internalType": "address",
309
+ "name": "newOwner",
310
+ "type": "address"
311
+ }
312
+ ],
313
+ "name": "transferOwnership",
314
+ "outputs": [],
315
+ "stateMutability": "nonpayable",
316
+ "type": "function"
317
+ }
318
+ ];
319
+
320
+ // src/abi/tokenRegistry.abi.ts
321
+ var tokenRegistryAbi = [{ "inputs": [], "name": "InvalidInitialization", "type": "error" }, {
322
+ "inputs": [],
323
+ "name": "NotInitializing",
324
+ "type": "error"
325
+ }, {
326
+ "anonymous": false,
327
+ "inputs": [{ "indexed": false, "internalType": "uint64", "name": "version", "type": "uint64" }],
328
+ "name": "Initialized",
329
+ "type": "event"
330
+ }, {
331
+ "anonymous": false,
332
+ "inputs": [{ "indexed": true, "internalType": "address", "name": "tokenAddress", "type": "address" }, {
333
+ "indexed": false,
334
+ "internalType": "string",
335
+ "name": "symbol",
336
+ "type": "string"
337
+ }, { "indexed": false, "internalType": "uint256", "name": "decimals", "type": "uint256" }],
338
+ "name": "TokenAdded",
339
+ "type": "event"
340
+ }, {
341
+ "anonymous": false,
342
+ "inputs": [{ "indexed": true, "internalType": "address", "name": "tokenAddress", "type": "address" }, {
343
+ "indexed": true,
344
+ "internalType": "address",
345
+ "name": "newTokenAddress",
346
+ "type": "address"
347
+ }, { "indexed": false, "internalType": "string", "name": "symbol", "type": "string" }],
348
+ "name": "TokenAddressChanged",
349
+ "type": "event"
350
+ }, {
351
+ "anonymous": false,
352
+ "inputs": [{ "indexed": true, "internalType": "address", "name": "tokenAddress", "type": "address" }, {
353
+ "indexed": false,
354
+ "internalType": "string",
355
+ "name": "symbol",
356
+ "type": "string"
357
+ }],
358
+ "name": "TokenRemoved",
359
+ "type": "event"
360
+ }, {
361
+ "inputs": [{ "internalType": "address", "name": "tokenAddress", "type": "address" }, {
362
+ "internalType": "string",
363
+ "name": "symbol",
364
+ "type": "string"
365
+ }, { "internalType": "uint256", "name": "decimals", "type": "uint256" }],
366
+ "name": "addToken",
367
+ "outputs": [],
368
+ "stateMutability": "nonpayable",
369
+ "type": "function"
370
+ }, {
371
+ "inputs": [{ "internalType": "string", "name": "symbol", "type": "string" }, {
372
+ "internalType": "address",
373
+ "name": "newTokenAddress",
374
+ "type": "address"
375
+ }],
376
+ "name": "changeTokenAddress",
377
+ "outputs": [],
378
+ "stateMutability": "nonpayable",
379
+ "type": "function"
380
+ }, {
381
+ "inputs": [{ "internalType": "address", "name": "register", "type": "address" }],
382
+ "name": "init",
383
+ "outputs": [],
384
+ "stateMutability": "nonpayable",
385
+ "type": "function"
386
+ }, {
387
+ "inputs": [{ "internalType": "address", "name": "tokenAddress", "type": "address" }],
388
+ "name": "isSupportedByAddress",
389
+ "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
390
+ "stateMutability": "view",
391
+ "type": "function"
392
+ }, {
393
+ "inputs": [{ "internalType": "string", "name": "symbol", "type": "string" }],
394
+ "name": "isSupportedBySymbol",
395
+ "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
396
+ "stateMutability": "view",
397
+ "type": "function"
398
+ }, {
399
+ "inputs": [{ "internalType": "string", "name": "symbol", "type": "string" }],
400
+ "name": "removeToken",
401
+ "outputs": [],
402
+ "stateMutability": "nonpayable",
403
+ "type": "function"
404
+ }, {
405
+ "inputs": [],
406
+ "name": "retrieveAllTokens",
407
+ "outputs": [{
408
+ "components": [{
409
+ "internalType": "address",
410
+ "name": "tokenAddress",
411
+ "type": "address"
412
+ }, { "internalType": "string", "name": "symbol", "type": "string" }, {
413
+ "internalType": "uint256",
414
+ "name": "decimals",
415
+ "type": "uint256"
416
+ }],
417
+ "internalType": "struct ITokensRegistry.Token[]",
418
+ "name": "",
419
+ "type": "tuple[]"
420
+ }],
421
+ "stateMutability": "view",
422
+ "type": "function"
423
+ }, {
424
+ "inputs": [],
425
+ "name": "retrieveAllTokensV2",
426
+ "outputs": [{
427
+ "components": [{
428
+ "internalType": "address",
429
+ "name": "tokenAddress",
430
+ "type": "address"
431
+ }, { "internalType": "string", "name": "symbol", "type": "string" }, {
432
+ "internalType": "uint256",
433
+ "name": "decimals",
434
+ "type": "uint256"
435
+ }, { "internalType": "bool", "name": "isSynthetic", "type": "bool" }, {
436
+ "internalType": "address",
437
+ "name": "baseToken",
438
+ "type": "address"
439
+ }],
440
+ "internalType": "struct ITokensRegistry.TokenExtended[]",
441
+ "name": "",
442
+ "type": "tuple[]"
443
+ }],
444
+ "stateMutability": "view",
445
+ "type": "function"
446
+ }];
447
+
448
+ // src/abi/accounts.abi.ts
449
+ var accountsAbi = [
450
+ { type: "error", name: "InvalidInitialization", inputs: [] },
451
+ {
452
+ type: "error",
453
+ name: "NotInitializing",
454
+ inputs: []
455
+ },
456
+ {
457
+ type: "event",
458
+ anonymous: false,
459
+ name: "AccountCreated",
460
+ inputs: [{ type: "address", name: "owner", indexed: false }]
461
+ },
462
+ {
463
+ type: "event",
464
+ anonymous: false,
465
+ name: "AccountStatusChanged",
466
+ inputs: [
467
+ { type: "address", name: "owner", indexed: false },
468
+ {
469
+ type: "uint8",
470
+ name: "newStatus",
471
+ indexed: false
472
+ }
473
+ ]
474
+ },
475
+ {
476
+ type: "event",
477
+ anonymous: false,
478
+ name: "AccountVerificationStatusChanged",
479
+ inputs: [
480
+ { type: "address", name: "owner", indexed: false },
481
+ {
482
+ type: "uint8",
483
+ name: "newStatus",
484
+ indexed: false
485
+ }
486
+ ]
487
+ },
488
+ {
489
+ type: "event",
490
+ anonymous: false,
491
+ name: "Initialized",
492
+ inputs: [{ type: "uint64", name: "version", indexed: false }]
493
+ },
494
+ {
495
+ type: "event",
496
+ anonymous: false,
497
+ name: "UserAccountCreated",
498
+ inputs: [
499
+ { type: "bytes16", name: "parentEntity", indexed: false },
500
+ {
501
+ type: "address",
502
+ name: "owner",
503
+ indexed: false
504
+ }
505
+ ]
506
+ },
507
+ {
508
+ type: "event",
509
+ anonymous: false,
510
+ name: "UserAccountStatusChanged",
511
+ inputs: [
512
+ { type: "bytes16", name: "parentEntity", indexed: false },
513
+ {
514
+ type: "address",
515
+ name: "owner",
516
+ indexed: false
517
+ },
518
+ { type: "uint8", name: "newStatus", indexed: false }
519
+ ]
520
+ },
521
+ {
522
+ type: "event",
523
+ anonymous: false,
524
+ name: "UserAccountVerificationStatusChanged",
525
+ inputs: [
526
+ { type: "bytes16", name: "parentEntity", indexed: false },
527
+ {
528
+ type: "address",
529
+ name: "owner",
530
+ indexed: false
531
+ },
532
+ { type: "uint8", name: "newStatus", indexed: false }
533
+ ]
534
+ },
535
+ {
536
+ type: "event",
537
+ anonymous: false,
538
+ name: "WalletConfirmationStatusChanged",
539
+ inputs: [
540
+ { type: "bytes16", name: "parentEntity", indexed: false },
541
+ {
542
+ type: "address",
543
+ name: "wallet",
544
+ indexed: false
545
+ },
546
+ { type: "uint8", name: "newStatus", indexed: false }
547
+ ]
548
+ },
549
+ {
550
+ type: "event",
551
+ anonymous: false,
552
+ name: "WalletLinked",
553
+ inputs: [
554
+ { type: "bytes16", name: "parentEntity", indexed: false },
555
+ {
556
+ type: "address",
557
+ name: "owner",
558
+ indexed: false
559
+ },
560
+ { type: "address", name: "wallet", indexed: false }
561
+ ]
562
+ },
563
+ {
564
+ type: "event",
565
+ anonymous: false,
566
+ name: "WalletRoleAssigned",
567
+ inputs: [
568
+ { type: "bytes16", name: "parentEntity", indexed: false },
569
+ {
570
+ type: "address",
571
+ name: "account",
572
+ indexed: false
573
+ },
574
+ { type: "address", name: "wallet", indexed: false },
575
+ { type: "string", name: "role", indexed: false }
576
+ ]
577
+ },
578
+ {
579
+ type: "event",
580
+ anonymous: false,
581
+ name: "WalletRoleRemoved",
582
+ inputs: [
583
+ { type: "bytes16", name: "parentEntity", indexed: false },
584
+ {
585
+ type: "address",
586
+ name: "account",
587
+ indexed: false
588
+ },
589
+ { type: "address", name: "wallet", indexed: false }
590
+ ]
591
+ },
592
+ {
593
+ type: "function",
594
+ name: "assignWalletRole",
595
+ constant: false,
596
+ payable: false,
597
+ inputs: [
598
+ { type: "bytes16", name: "parentEntity" },
599
+ { type: "address", name: "account" },
600
+ {
601
+ type: "address",
602
+ name: "wallet"
603
+ },
604
+ { type: "string", name: "role" }
605
+ ],
606
+ outputs: []
607
+ },
608
+ {
609
+ type: "function",
610
+ name: "changeAccountStatus",
611
+ constant: false,
612
+ payable: false,
613
+ inputs: [
614
+ { type: "address", name: "owner" },
615
+ { type: "uint8", name: "newStatus" }
616
+ ],
617
+ outputs: []
618
+ },
619
+ {
620
+ type: "function",
621
+ name: "changeAccountVerificationStatus",
622
+ constant: false,
623
+ payable: false,
624
+ inputs: [
625
+ { type: "address", name: "owner" },
626
+ { type: "uint8", name: "newStatus" }
627
+ ],
628
+ outputs: []
629
+ },
630
+ {
631
+ type: "function",
632
+ name: "changeUserAccountStatus",
633
+ constant: false,
634
+ payable: false,
635
+ inputs: [
636
+ { type: "bytes16", name: "parentEntity" },
637
+ { type: "address", name: "owner" },
638
+ {
639
+ type: "uint8",
640
+ name: "newStatus"
641
+ }
642
+ ],
643
+ outputs: []
644
+ },
645
+ {
646
+ type: "function",
647
+ name: "changeUserAccountVerificationStatus",
648
+ constant: false,
649
+ payable: false,
650
+ inputs: [
651
+ { type: "bytes16", name: "parentEntity" },
652
+ { type: "address", name: "owner" },
653
+ {
654
+ type: "uint8",
655
+ name: "newStatus"
656
+ }
657
+ ],
658
+ outputs: []
659
+ },
660
+ {
661
+ type: "function",
662
+ name: "changeWalletConfirmationStatus",
663
+ constant: false,
664
+ payable: false,
665
+ inputs: [
666
+ { type: "bytes16", name: "parentEntity" },
667
+ { type: "address", name: "wallet" },
668
+ {
669
+ type: "uint8",
670
+ name: "status"
671
+ }
672
+ ],
673
+ outputs: []
674
+ },
675
+ {
676
+ type: "function",
677
+ name: "createAccount",
678
+ constant: false,
679
+ payable: false,
680
+ inputs: [],
681
+ outputs: []
682
+ },
683
+ {
684
+ type: "function",
685
+ name: "createUserAccount",
686
+ constant: false,
687
+ payable: false,
688
+ inputs: [{ type: "bytes16", name: "parentEntity" }],
689
+ outputs: []
690
+ },
691
+ {
692
+ type: "function",
693
+ name: "createUserAccountWithWallet",
694
+ constant: false,
695
+ payable: false,
696
+ inputs: [{ type: "bytes16", name: "parentEntity" }],
697
+ outputs: []
698
+ },
699
+ {
700
+ type: "function",
701
+ name: "getAccount",
702
+ constant: true,
703
+ stateMutability: "view",
704
+ payable: false,
705
+ inputs: [{ type: "address", name: "owner" }],
706
+ outputs: [
707
+ {
708
+ type: "tuple",
709
+ name: "",
710
+ components: [
711
+ { type: "uint8", name: "status" },
712
+ { type: "uint8", name: "verificationStatus" }
713
+ ]
714
+ }
715
+ ]
716
+ },
717
+ {
718
+ type: "function",
719
+ name: "getUserAccount",
720
+ constant: true,
721
+ stateMutability: "view",
722
+ payable: false,
723
+ inputs: [
724
+ { type: "address", name: "owner" },
725
+ { type: "bytes16", name: "parentEntity" }
726
+ ],
727
+ outputs: [
728
+ {
729
+ type: "tuple",
730
+ name: "",
731
+ components: [
732
+ { type: "uint8", name: "status" },
733
+ { type: "uint8", name: "verificationStatus" }
734
+ ]
735
+ }
736
+ ]
737
+ },
738
+ {
739
+ type: "function",
740
+ name: "getWallet",
741
+ constant: true,
742
+ stateMutability: "view",
743
+ payable: false,
744
+ inputs: [
745
+ { type: "bytes16", name: "parentEntity" },
746
+ { type: "address", name: "wallet" }
747
+ ],
748
+ outputs: [
749
+ {
750
+ type: "tuple",
751
+ name: "",
752
+ components: [
753
+ { type: "uint8", name: "confirmationStatus" },
754
+ { type: "address", name: "owner" }
755
+ ]
756
+ }
757
+ ]
758
+ },
759
+ {
760
+ type: "function",
761
+ name: "init",
762
+ constant: false,
763
+ payable: false,
764
+ inputs: [{ type: "address", name: "register" }],
765
+ outputs: []
766
+ },
767
+ {
768
+ type: "function",
769
+ name: "linkWallet",
770
+ constant: false,
771
+ payable: false,
772
+ inputs: [{ type: "bytes16", name: "parentEntity" }],
773
+ outputs: []
774
+ },
775
+ {
776
+ type: "function",
777
+ name: "migrateAccount",
778
+ constant: false,
779
+ payable: false,
780
+ inputs: [],
781
+ outputs: []
782
+ },
783
+ {
784
+ type: "function",
785
+ name: "removeWalletRole",
786
+ constant: false,
787
+ payable: false,
788
+ inputs: [
789
+ { type: "bytes16", name: "parentEntity" },
790
+ { type: "address", name: "account" },
791
+ {
792
+ type: "address",
793
+ name: "wallet"
794
+ }
795
+ ],
796
+ outputs: []
797
+ }
798
+ ];
799
+
800
+ // src/abi/corporateAccounts.abi.ts
801
+ var corporateAccountsAbi = [
802
+ {
803
+ type: "function",
804
+ name: "getCorporation",
805
+ constant: true,
806
+ stateMutability: "view",
807
+ payable: false,
808
+ inputs: [
809
+ { type: "bytes16", name: "companyId" },
810
+ { type: "address", name: "wallet" }
811
+ ],
812
+ outputs: [
813
+ {
814
+ type: "tuple",
815
+ name: "",
816
+ components: [
817
+ { type: "address", name: "creator" },
818
+ { type: "uint8", name: "status" },
819
+ { type: "uint8", name: "verificationStatus" },
820
+ { type: "uint8", name: "walletStatus" }
821
+ ]
822
+ }
823
+ ]
824
+ },
825
+ {
826
+ type: "function",
827
+ name: "createCorporation",
828
+ constant: false,
829
+ payable: false,
830
+ inputs: [{ type: "bytes16", name: "companyId" }],
831
+ outputs: []
832
+ }
833
+ ];
834
+
835
+ // src/abi/synthetic.abi.ts
836
+ var syntheticAbi = [
837
+ {
838
+ inputs: [{ internalType: "address", name: "_lzEndpoint", type: "address" }],
839
+ stateMutability: "nonpayable",
840
+ type: "constructor"
841
+ },
842
+ { inputs: [], name: "AccessControlBadConfirmation", type: "error" },
843
+ {
844
+ inputs: [
845
+ { internalType: "address", name: "account", type: "address" },
846
+ { internalType: "bytes32", name: "neededRole", type: "bytes32" }
847
+ ],
848
+ name: "AccessControlUnauthorizedAccount",
849
+ type: "error"
850
+ },
851
+ {
852
+ inputs: [{ internalType: "uint256", name: "amountSD", type: "uint256" }],
853
+ name: "AmountSDOverflowed",
854
+ type: "error"
855
+ },
856
+ { inputs: [], name: "ECDSAInvalidSignature", type: "error" },
857
+ {
858
+ inputs: [{ internalType: "uint256", name: "length", type: "uint256" }],
859
+ name: "ECDSAInvalidSignatureLength",
860
+ type: "error"
861
+ },
862
+ {
863
+ inputs: [{ internalType: "bytes32", name: "s", type: "bytes32" }],
864
+ name: "ECDSAInvalidSignatureS",
865
+ type: "error"
866
+ },
867
+ {
868
+ inputs: [
869
+ { internalType: "address", name: "spender", type: "address" },
870
+ { internalType: "uint256", name: "allowance", type: "uint256" },
871
+ { internalType: "uint256", name: "needed", type: "uint256" }
872
+ ],
873
+ name: "ERC20InsufficientAllowance",
874
+ type: "error"
875
+ },
876
+ {
877
+ inputs: [
878
+ { internalType: "address", name: "sender", type: "address" },
879
+ { internalType: "uint256", name: "balance", type: "uint256" },
880
+ { internalType: "uint256", name: "needed", type: "uint256" }
881
+ ],
882
+ name: "ERC20InsufficientBalance",
883
+ type: "error"
884
+ },
885
+ {
886
+ inputs: [{ internalType: "address", name: "approver", type: "address" }],
887
+ name: "ERC20InvalidApprover",
888
+ type: "error"
889
+ },
890
+ {
891
+ inputs: [{ internalType: "address", name: "receiver", type: "address" }],
892
+ name: "ERC20InvalidReceiver",
893
+ type: "error"
894
+ },
895
+ {
896
+ inputs: [{ internalType: "address", name: "sender", type: "address" }],
897
+ name: "ERC20InvalidSender",
898
+ type: "error"
899
+ },
900
+ {
901
+ inputs: [{ internalType: "address", name: "spender", type: "address" }],
902
+ name: "ERC20InvalidSpender",
903
+ type: "error"
904
+ },
905
+ {
906
+ inputs: [{ internalType: "uint256", name: "deadline", type: "uint256" }],
907
+ name: "ERC2612ExpiredSignature",
908
+ type: "error"
909
+ },
910
+ {
911
+ inputs: [
912
+ { internalType: "address", name: "signer", type: "address" },
913
+ { internalType: "address", name: "owner", type: "address" }
914
+ ],
915
+ name: "ERC2612InvalidSigner",
916
+ type: "error"
917
+ },
918
+ { inputs: [], name: "ISyntheticErrors_AddressZero", type: "error" },
919
+ { inputs: [], name: "ISyntheticErrors_AlreadyProcessed", type: "error" },
920
+ { inputs: [], name: "ISyntheticErrors_AmountNotDivisible", type: "error" },
921
+ { inputs: [], name: "ISyntheticErrors_DepositNA", type: "error" },
922
+ {
923
+ inputs: [],
924
+ name: "ISyntheticErrors_InsufficientVaultBalance",
925
+ type: "error"
926
+ },
927
+ {
928
+ inputs: [],
929
+ name: "ISyntheticErrors_InsufficientVaultFunds",
930
+ type: "error"
931
+ },
932
+ { inputs: [], name: "ISyntheticErrors_InvalidAddress", type: "error" },
933
+ { inputs: [], name: "ISyntheticErrors_InvalidAmount", type: "error" },
934
+ { inputs: [], name: "ISyntheticErrors_InvalidBaseAddress", type: "error" },
935
+ { inputs: [], name: "ISyntheticErrors_InvalidDecimals", type: "error" },
936
+ { inputs: [], name: "ISyntheticErrors_InvalidParameter", type: "error" },
937
+ { inputs: [], name: "ISyntheticErrors_InvalidTokenAddress", type: "error" },
938
+ { inputs: [], name: "ISyntheticErrors_NoYieldToClaim", type: "error" },
939
+ { inputs: [], name: "ISyntheticErrors_NotCoreChain", type: "error" },
940
+ { inputs: [], name: "ISyntheticErrors_RangeToLarge", type: "error" },
941
+ { inputs: [], name: "ISyntheticErrors_RequestNotFound", type: "error" },
942
+ { inputs: [], name: "ISyntheticErrors_WithdrawNA", type: "error" },
943
+ {
944
+ inputs: [
945
+ { internalType: "address", name: "account", type: "address" },
946
+ { internalType: "uint256", name: "currentNonce", type: "uint256" }
947
+ ],
948
+ name: "InvalidAccountNonce",
949
+ type: "error"
950
+ },
951
+ { inputs: [], name: "InvalidDelegate", type: "error" },
952
+ { inputs: [], name: "InvalidEndpointCall", type: "error" },
953
+ { inputs: [], name: "InvalidInitialization", type: "error" },
954
+ { inputs: [], name: "InvalidLocalDecimals", type: "error" },
955
+ {
956
+ inputs: [{ internalType: "bytes", name: "options", type: "bytes" }],
957
+ name: "InvalidOptions",
958
+ type: "error"
959
+ },
960
+ { inputs: [], name: "LzTokenUnavailable", type: "error" },
961
+ {
962
+ inputs: [{ internalType: "uint32", name: "eid", type: "uint32" }],
963
+ name: "NoPeer",
964
+ type: "error"
965
+ },
966
+ {
967
+ inputs: [{ internalType: "uint256", name: "msgValue", type: "uint256" }],
968
+ name: "NotEnoughNative",
969
+ type: "error"
970
+ },
971
+ { inputs: [], name: "NotInitializing", type: "error" },
972
+ {
973
+ inputs: [{ internalType: "address", name: "addr", type: "address" }],
974
+ name: "OnlyEndpoint",
975
+ type: "error"
976
+ },
977
+ {
978
+ inputs: [
979
+ { internalType: "uint32", name: "eid", type: "uint32" },
980
+ { internalType: "bytes32", name: "sender", type: "bytes32" }
981
+ ],
982
+ name: "OnlyPeer",
983
+ type: "error"
984
+ },
985
+ { inputs: [], name: "OnlySelf", type: "error" },
986
+ {
987
+ inputs: [{ internalType: "address", name: "owner", type: "address" }],
988
+ name: "OwnableInvalidOwner",
989
+ type: "error"
990
+ },
991
+ {
992
+ inputs: [{ internalType: "address", name: "account", type: "address" }],
993
+ name: "OwnableUnauthorizedAccount",
994
+ type: "error"
995
+ },
996
+ { inputs: [], name: "ReentrancyGuardReentrantCall", type: "error" },
997
+ {
998
+ inputs: [{ internalType: "address", name: "token", type: "address" }],
999
+ name: "SafeERC20FailedOperation",
1000
+ type: "error"
1001
+ },
1002
+ {
1003
+ inputs: [{ internalType: "bytes", name: "result", type: "bytes" }],
1004
+ name: "SimulationResult",
1005
+ type: "error"
1006
+ },
1007
+ {
1008
+ inputs: [
1009
+ { internalType: "uint256", name: "amountLD", type: "uint256" },
1010
+ { internalType: "uint256", name: "minAmountLD", type: "uint256" }
1011
+ ],
1012
+ name: "SlippageExceeded",
1013
+ type: "error"
1014
+ },
1015
+ {
1016
+ anonymous: false,
1017
+ inputs: [
1018
+ {
1019
+ indexed: true,
1020
+ internalType: "address",
1021
+ name: "oldAdmin",
1022
+ type: "address"
1023
+ },
1024
+ {
1025
+ indexed: true,
1026
+ internalType: "address",
1027
+ name: "newAdmin",
1028
+ type: "address"
1029
+ }
1030
+ ],
1031
+ name: "AdminChanged",
1032
+ type: "event"
1033
+ },
1034
+ {
1035
+ anonymous: false,
1036
+ inputs: [
1037
+ {
1038
+ indexed: true,
1039
+ internalType: "address",
1040
+ name: "owner",
1041
+ type: "address"
1042
+ },
1043
+ {
1044
+ indexed: true,
1045
+ internalType: "address",
1046
+ name: "spender",
1047
+ type: "address"
1048
+ },
1049
+ {
1050
+ indexed: false,
1051
+ internalType: "uint256",
1052
+ name: "value",
1053
+ type: "uint256"
1054
+ }
1055
+ ],
1056
+ name: "Approval",
1057
+ type: "event"
1058
+ },
1059
+ {
1060
+ anonymous: false,
1061
+ inputs: [
1062
+ {
1063
+ indexed: false,
1064
+ internalType: "uint32",
1065
+ name: "updatedApr",
1066
+ type: "uint32"
1067
+ },
1068
+ {
1069
+ indexed: false,
1070
+ internalType: "uint256",
1071
+ name: "blockTime",
1072
+ type: "uint256"
1073
+ }
1074
+ ],
1075
+ name: "AprChanged",
1076
+ type: "event"
1077
+ },
1078
+ {
1079
+ anonymous: false,
1080
+ inputs: [
1081
+ {
1082
+ indexed: false,
1083
+ internalType: "bool",
1084
+ name: "isDepositable",
1085
+ type: "bool"
1086
+ }
1087
+ ],
1088
+ name: "DepositableChanged",
1089
+ type: "event"
1090
+ },
1091
+ {
1092
+ anonymous: false,
1093
+ inputs: [
1094
+ { indexed: true, internalType: "address", name: "user", type: "address" },
1095
+ {
1096
+ indexed: false,
1097
+ internalType: "uint256",
1098
+ name: "amount",
1099
+ type: "uint256"
1100
+ },
1101
+ {
1102
+ indexed: false,
1103
+ internalType: "uint256",
1104
+ name: "timestamp",
1105
+ type: "uint256"
1106
+ }
1107
+ ],
1108
+ name: "Deposited",
1109
+ type: "event"
1110
+ },
1111
+ { anonymous: false, inputs: [], name: "EIP712DomainChanged", type: "event" },
1112
+ {
1113
+ anonymous: false,
1114
+ inputs: [
1115
+ {
1116
+ components: [
1117
+ { internalType: "uint32", name: "eid", type: "uint32" },
1118
+ { internalType: "uint16", name: "msgType", type: "uint16" },
1119
+ { internalType: "bytes", name: "options", type: "bytes" }
1120
+ ],
1121
+ indexed: false,
1122
+ internalType: "struct EnforcedOptionParam[]",
1123
+ name: "_enforcedOptions",
1124
+ type: "tuple[]"
1125
+ }
1126
+ ],
1127
+ name: "EnforcedOptionSet",
1128
+ type: "event"
1129
+ },
1130
+ {
1131
+ anonymous: false,
1132
+ inputs: [
1133
+ {
1134
+ indexed: false,
1135
+ internalType: "uint64",
1136
+ name: "version",
1137
+ type: "uint64"
1138
+ }
1139
+ ],
1140
+ name: "Initialized",
1141
+ type: "event"
1142
+ },
1143
+ {
1144
+ anonymous: false,
1145
+ inputs: [
1146
+ {
1147
+ indexed: false,
1148
+ internalType: "address",
1149
+ name: "receiver",
1150
+ type: "address"
1151
+ },
1152
+ {
1153
+ indexed: false,
1154
+ internalType: "uint256",
1155
+ name: "transferAmount",
1156
+ type: "uint256"
1157
+ },
1158
+ {
1159
+ indexed: false,
1160
+ internalType: "uint256",
1161
+ name: "vaultBalance",
1162
+ type: "uint256"
1163
+ }
1164
+ ],
1165
+ name: "InsufficientVaultFunds",
1166
+ type: "event"
1167
+ },
1168
+ {
1169
+ anonymous: false,
1170
+ inputs: [
1171
+ {
1172
+ indexed: false,
1173
+ internalType: "address",
1174
+ name: "inspector",
1175
+ type: "address"
1176
+ }
1177
+ ],
1178
+ name: "MsgInspectorSet",
1179
+ type: "event"
1180
+ },
1181
+ {
1182
+ anonymous: false,
1183
+ inputs: [
1184
+ { indexed: true, internalType: "bytes32", name: "guid", type: "bytes32" },
1185
+ {
1186
+ indexed: false,
1187
+ internalType: "uint32",
1188
+ name: "srcEid",
1189
+ type: "uint32"
1190
+ },
1191
+ {
1192
+ indexed: true,
1193
+ internalType: "address",
1194
+ name: "toAddress",
1195
+ type: "address"
1196
+ },
1197
+ {
1198
+ indexed: false,
1199
+ internalType: "uint256",
1200
+ name: "amountReceivedLD",
1201
+ type: "uint256"
1202
+ }
1203
+ ],
1204
+ name: "OFTReceived",
1205
+ type: "event"
1206
+ },
1207
+ {
1208
+ anonymous: false,
1209
+ inputs: [
1210
+ { indexed: true, internalType: "bytes32", name: "guid", type: "bytes32" },
1211
+ {
1212
+ indexed: false,
1213
+ internalType: "uint32",
1214
+ name: "dstEid",
1215
+ type: "uint32"
1216
+ },
1217
+ {
1218
+ indexed: true,
1219
+ internalType: "address",
1220
+ name: "fromAddress",
1221
+ type: "address"
1222
+ },
1223
+ {
1224
+ indexed: false,
1225
+ internalType: "uint256",
1226
+ name: "amountSentLD",
1227
+ type: "uint256"
1228
+ },
1229
+ {
1230
+ indexed: false,
1231
+ internalType: "uint256",
1232
+ name: "amountReceivedLD",
1233
+ type: "uint256"
1234
+ }
1235
+ ],
1236
+ name: "OFTSent",
1237
+ type: "event"
1238
+ },
1239
+ {
1240
+ anonymous: false,
1241
+ inputs: [
1242
+ {
1243
+ indexed: true,
1244
+ internalType: "address",
1245
+ name: "previousOwner",
1246
+ type: "address"
1247
+ },
1248
+ {
1249
+ indexed: true,
1250
+ internalType: "address",
1251
+ name: "newOwner",
1252
+ type: "address"
1253
+ }
1254
+ ],
1255
+ name: "OwnershipTransferred",
1256
+ type: "event"
1257
+ },
1258
+ {
1259
+ anonymous: false,
1260
+ inputs: [
1261
+ { indexed: false, internalType: "uint32", name: "eid", type: "uint32" },
1262
+ {
1263
+ indexed: false,
1264
+ internalType: "bytes32",
1265
+ name: "peer",
1266
+ type: "bytes32"
1267
+ }
1268
+ ],
1269
+ name: "PeerSet",
1270
+ type: "event"
1271
+ },
1272
+ {
1273
+ anonymous: false,
1274
+ inputs: [
1275
+ {
1276
+ indexed: false,
1277
+ internalType: "address",
1278
+ name: "preCrimeAddress",
1279
+ type: "address"
1280
+ }
1281
+ ],
1282
+ name: "PreCrimeSet",
1283
+ type: "event"
1284
+ },
1285
+ {
1286
+ anonymous: false,
1287
+ inputs: [
1288
+ { indexed: true, internalType: "bytes32", name: "role", type: "bytes32" },
1289
+ {
1290
+ indexed: true,
1291
+ internalType: "bytes32",
1292
+ name: "previousAdminRole",
1293
+ type: "bytes32"
1294
+ },
1295
+ {
1296
+ indexed: true,
1297
+ internalType: "bytes32",
1298
+ name: "newAdminRole",
1299
+ type: "bytes32"
1300
+ }
1301
+ ],
1302
+ name: "RoleAdminChanged",
1303
+ type: "event"
1304
+ },
1305
+ {
1306
+ anonymous: false,
1307
+ inputs: [
1308
+ { indexed: true, internalType: "bytes32", name: "role", type: "bytes32" },
1309
+ {
1310
+ indexed: true,
1311
+ internalType: "address",
1312
+ name: "account",
1313
+ type: "address"
1314
+ },
1315
+ {
1316
+ indexed: true,
1317
+ internalType: "address",
1318
+ name: "sender",
1319
+ type: "address"
1320
+ }
1321
+ ],
1322
+ name: "RoleGranted",
1323
+ type: "event"
1324
+ },
1325
+ {
1326
+ anonymous: false,
1327
+ inputs: [
1328
+ { indexed: true, internalType: "bytes32", name: "role", type: "bytes32" },
1329
+ {
1330
+ indexed: true,
1331
+ internalType: "address",
1332
+ name: "account",
1333
+ type: "address"
1334
+ },
1335
+ {
1336
+ indexed: true,
1337
+ internalType: "address",
1338
+ name: "sender",
1339
+ type: "address"
1340
+ }
1341
+ ],
1342
+ name: "RoleRevoked",
1343
+ type: "event"
1344
+ },
1345
+ {
1346
+ anonymous: false,
1347
+ inputs: [
1348
+ {
1349
+ indexed: true,
1350
+ internalType: "address",
1351
+ name: "token",
1352
+ type: "address"
1353
+ },
1354
+ {
1355
+ indexed: true,
1356
+ internalType: "address",
1357
+ name: "receiver",
1358
+ type: "address"
1359
+ },
1360
+ {
1361
+ indexed: false,
1362
+ internalType: "uint256",
1363
+ name: "amount",
1364
+ type: "uint256"
1365
+ }
1366
+ ],
1367
+ name: "TokensRescued",
1368
+ type: "event"
1369
+ },
1370
+ {
1371
+ anonymous: false,
1372
+ inputs: [
1373
+ { indexed: true, internalType: "address", name: "from", type: "address" },
1374
+ { indexed: true, internalType: "address", name: "to", type: "address" },
1375
+ {
1376
+ indexed: false,
1377
+ internalType: "uint256",
1378
+ name: "value",
1379
+ type: "uint256"
1380
+ }
1381
+ ],
1382
+ name: "Transfer",
1383
+ type: "event"
1384
+ },
1385
+ {
1386
+ anonymous: false,
1387
+ inputs: [
1388
+ {
1389
+ indexed: true,
1390
+ internalType: "address",
1391
+ name: "user",
1392
+ type: "address"
1393
+ },
1394
+ {
1395
+ indexed: false,
1396
+ internalType: "uint256",
1397
+ name: "accumulatedYield",
1398
+ type: "uint256"
1399
+ },
1400
+ {
1401
+ indexed: false,
1402
+ internalType: "uint256",
1403
+ name: "lastBalance",
1404
+ type: "uint256"
1405
+ },
1406
+ {
1407
+ indexed: false,
1408
+ internalType: "uint256",
1409
+ name: "currentBalance",
1410
+ type: "uint256"
1411
+ },
1412
+ {
1413
+ indexed: false,
1414
+ internalType: "uint64",
1415
+ name: "lastUpdateTime",
1416
+ type: "uint64"
1417
+ }
1418
+ ],
1419
+ name: "UserYieldChanged",
1420
+ type: "event"
1421
+ },
1422
+ {
1423
+ anonymous: false,
1424
+ inputs: [
1425
+ {
1426
+ indexed: true,
1427
+ internalType: "uint256",
1428
+ name: "requestId",
1429
+ type: "uint256"
1430
+ },
1431
+ { indexed: true, internalType: "address", name: "user", type: "address" },
1432
+ {
1433
+ indexed: false,
1434
+ internalType: "uint256",
1435
+ name: "amount",
1436
+ type: "uint256"
1437
+ },
1438
+ {
1439
+ indexed: false,
1440
+ internalType: "uint256",
1441
+ name: "createdTime",
1442
+ type: "uint256"
1443
+ }
1444
+ ],
1445
+ name: "WithdrawRequestCreated",
1446
+ type: "event"
1447
+ },
1448
+ {
1449
+ anonymous: false,
1450
+ inputs: [
1451
+ {
1452
+ indexed: true,
1453
+ internalType: "uint256",
1454
+ name: "requestId",
1455
+ type: "uint256"
1456
+ },
1457
+ { indexed: true, internalType: "address", name: "user", type: "address" },
1458
+ {
1459
+ indexed: false,
1460
+ internalType: "uint256",
1461
+ name: "amount",
1462
+ type: "uint256"
1463
+ }
1464
+ ],
1465
+ name: "WithdrawRequestProcessed",
1466
+ type: "event"
1467
+ },
1468
+ {
1469
+ anonymous: false,
1470
+ inputs: [
1471
+ {
1472
+ indexed: false,
1473
+ internalType: "bool",
1474
+ name: "isWithdrawable",
1475
+ type: "bool"
1476
+ }
1477
+ ],
1478
+ name: "WithdrawableChanged",
1479
+ type: "event"
1480
+ },
1481
+ {
1482
+ anonymous: false,
1483
+ inputs: [
1484
+ { indexed: true, internalType: "address", name: "user", type: "address" },
1485
+ {
1486
+ indexed: false,
1487
+ internalType: "uint256",
1488
+ name: "amount",
1489
+ type: "uint256"
1490
+ },
1491
+ {
1492
+ indexed: false,
1493
+ internalType: "uint256",
1494
+ name: "timestamp",
1495
+ type: "uint256"
1496
+ }
1497
+ ],
1498
+ name: "Withdrawn",
1499
+ type: "event"
1500
+ },
1501
+ {
1502
+ anonymous: false,
1503
+ inputs: [
1504
+ {
1505
+ indexed: false,
1506
+ internalType: "address",
1507
+ name: "user",
1508
+ type: "address"
1509
+ },
1510
+ {
1511
+ indexed: false,
1512
+ internalType: "uint256",
1513
+ name: "yieldToClaim",
1514
+ type: "uint256"
1515
+ },
1516
+ {
1517
+ indexed: false,
1518
+ internalType: "uint256",
1519
+ name: "timestamp",
1520
+ type: "uint256"
1521
+ }
1522
+ ],
1523
+ name: "YieldClaimed",
1524
+ type: "event"
1525
+ },
1526
+ {
1527
+ inputs: [],
1528
+ name: "ADMIN_ROLE",
1529
+ outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }],
1530
+ stateMutability: "view",
1531
+ type: "function"
1532
+ },
1533
+ {
1534
+ inputs: [],
1535
+ name: "BASE_TOKEN_DECIMALS",
1536
+ outputs: [{ internalType: "uint8", name: "", type: "uint8" }],
1537
+ stateMutability: "view",
1538
+ type: "function"
1539
+ },
1540
+ {
1541
+ inputs: [],
1542
+ name: "BURNER_ROLE",
1543
+ outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }],
1544
+ stateMutability: "view",
1545
+ type: "function"
1546
+ },
1547
+ {
1548
+ inputs: [],
1549
+ name: "DECIMALS_CONVERSION",
1550
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
1551
+ stateMutability: "view",
1552
+ type: "function"
1553
+ },
1554
+ {
1555
+ inputs: [],
1556
+ name: "DEFAULT_ADMIN_ROLE",
1557
+ outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }],
1558
+ stateMutability: "view",
1559
+ type: "function"
1560
+ },
1561
+ {
1562
+ inputs: [],
1563
+ name: "DOMAIN_SEPARATOR",
1564
+ outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }],
1565
+ stateMutability: "view",
1566
+ type: "function"
1567
+ },
1568
+ {
1569
+ inputs: [],
1570
+ name: "MINTER_ROLE",
1571
+ outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }],
1572
+ stateMutability: "view",
1573
+ type: "function"
1574
+ },
1575
+ {
1576
+ inputs: [],
1577
+ name: "SEND",
1578
+ outputs: [{ internalType: "uint16", name: "", type: "uint16" }],
1579
+ stateMutability: "view",
1580
+ type: "function"
1581
+ },
1582
+ {
1583
+ inputs: [],
1584
+ name: "SEND_AND_CALL",
1585
+ outputs: [{ internalType: "uint16", name: "", type: "uint16" }],
1586
+ stateMutability: "view",
1587
+ type: "function"
1588
+ },
1589
+ {
1590
+ inputs: [{ internalType: "uint256", name: "amount", type: "uint256" }],
1591
+ name: "adminAddFunds",
1592
+ outputs: [],
1593
+ stateMutability: "nonpayable",
1594
+ type: "function"
1595
+ },
1596
+ {
1597
+ inputs: [
1598
+ {
1599
+ components: [
1600
+ { internalType: "uint32", name: "srcEid", type: "uint32" },
1601
+ { internalType: "bytes32", name: "sender", type: "bytes32" },
1602
+ { internalType: "uint64", name: "nonce", type: "uint64" }
1603
+ ],
1604
+ internalType: "struct Origin",
1605
+ name: "origin",
1606
+ type: "tuple"
1607
+ }
1608
+ ],
1609
+ name: "allowInitializePath",
1610
+ outputs: [{ internalType: "bool", name: "", type: "bool" }],
1611
+ stateMutability: "view",
1612
+ type: "function"
1613
+ },
1614
+ {
1615
+ inputs: [
1616
+ { internalType: "address", name: "owner", type: "address" },
1617
+ { internalType: "address", name: "spender", type: "address" }
1618
+ ],
1619
+ name: "allowance",
1620
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
1621
+ stateMutability: "view",
1622
+ type: "function"
1623
+ },
1624
+ {
1625
+ inputs: [],
1626
+ name: "approvalRequired",
1627
+ outputs: [{ internalType: "bool", name: "", type: "bool" }],
1628
+ stateMutability: "pure",
1629
+ type: "function"
1630
+ },
1631
+ {
1632
+ inputs: [
1633
+ { internalType: "address", name: "spender", type: "address" },
1634
+ { internalType: "uint256", name: "value", type: "uint256" }
1635
+ ],
1636
+ name: "approve",
1637
+ outputs: [{ internalType: "bool", name: "", type: "bool" }],
1638
+ stateMutability: "nonpayable",
1639
+ type: "function"
1640
+ },
1641
+ {
1642
+ inputs: [],
1643
+ name: "apr",
1644
+ outputs: [{ internalType: "uint32", name: "", type: "uint32" }],
1645
+ stateMutability: "view",
1646
+ type: "function"
1647
+ },
1648
+ {
1649
+ inputs: [{ internalType: "address", name: "account", type: "address" }],
1650
+ name: "balanceOf",
1651
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
1652
+ stateMutability: "view",
1653
+ type: "function"
1654
+ },
1655
+ {
1656
+ inputs: [],
1657
+ name: "baseToken",
1658
+ outputs: [{ internalType: "address", name: "", type: "address" }],
1659
+ stateMutability: "view",
1660
+ type: "function"
1661
+ },
1662
+ {
1663
+ inputs: [
1664
+ { internalType: "address", name: "_user", type: "address" },
1665
+ { internalType: "uint256", name: "_amount", type: "uint256" }
1666
+ ],
1667
+ name: "burn",
1668
+ outputs: [],
1669
+ stateMutability: "nonpayable",
1670
+ type: "function"
1671
+ },
1672
+ {
1673
+ inputs: [{ internalType: "uint256", name: "requestId", type: "uint256" }],
1674
+ name: "canProcessRequest",
1675
+ outputs: [
1676
+ { internalType: "bool", name: "canProcess", type: "bool" },
1677
+ { internalType: "string", name: "reason", type: "string" }
1678
+ ],
1679
+ stateMutability: "view",
1680
+ type: "function"
1681
+ },
1682
+ {
1683
+ inputs: [],
1684
+ name: "claimFailedWithdraw",
1685
+ outputs: [],
1686
+ stateMutability: "nonpayable",
1687
+ type: "function"
1688
+ },
1689
+ {
1690
+ inputs: [],
1691
+ name: "claimYield",
1692
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
1693
+ stateMutability: "nonpayable",
1694
+ type: "function"
1695
+ },
1696
+ {
1697
+ inputs: [
1698
+ { internalType: "uint32", name: "_eid", type: "uint32" },
1699
+ { internalType: "uint16", name: "_msgType", type: "uint16" },
1700
+ { internalType: "bytes", name: "_extraOptions", type: "bytes" }
1701
+ ],
1702
+ name: "combineOptions",
1703
+ outputs: [{ internalType: "bytes", name: "", type: "bytes" }],
1704
+ stateMutability: "view",
1705
+ type: "function"
1706
+ },
1707
+ {
1708
+ inputs: [],
1709
+ name: "decimalConversionRate",
1710
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
1711
+ stateMutability: "view",
1712
+ type: "function"
1713
+ },
1714
+ {
1715
+ inputs: [],
1716
+ name: "decimals",
1717
+ outputs: [{ internalType: "uint8", name: "", type: "uint8" }],
1718
+ stateMutability: "view",
1719
+ type: "function"
1720
+ },
1721
+ {
1722
+ inputs: [{ internalType: "uint256", name: "amount", type: "uint256" }],
1723
+ name: "deposit",
1724
+ outputs: [{ internalType: "uint256", name: "mintAmount", type: "uint256" }],
1725
+ stateMutability: "nonpayable",
1726
+ type: "function"
1727
+ },
1728
+ {
1729
+ inputs: [{ internalType: "address", name: "transferTo", type: "address" }],
1730
+ name: "depositAllAndTransfer",
1731
+ outputs: [],
1732
+ stateMutability: "nonpayable",
1733
+ type: "function"
1734
+ },
1735
+ {
1736
+ inputs: [
1737
+ { internalType: "uint256", name: "amount", type: "uint256" },
1738
+ { internalType: "address", name: "recipient", type: "address" }
1739
+ ],
1740
+ name: "depositTo",
1741
+ outputs: [{ internalType: "uint256", name: "mintAmount", type: "uint256" }],
1742
+ stateMutability: "nonpayable",
1743
+ type: "function"
1744
+ },
1745
+ {
1746
+ inputs: [],
1747
+ name: "eip712Domain",
1748
+ outputs: [
1749
+ { internalType: "bytes1", name: "fields", type: "bytes1" },
1750
+ { internalType: "string", name: "name", type: "string" },
1751
+ { internalType: "string", name: "version", type: "string" },
1752
+ { internalType: "uint256", name: "chainId", type: "uint256" },
1753
+ { internalType: "address", name: "verifyingContract", type: "address" },
1754
+ { internalType: "bytes32", name: "salt", type: "bytes32" },
1755
+ { internalType: "uint256[]", name: "extensions", type: "uint256[]" }
1756
+ ],
1757
+ stateMutability: "view",
1758
+ type: "function"
1759
+ },
1760
+ {
1761
+ inputs: [],
1762
+ name: "endpoint",
1763
+ outputs: [
1764
+ {
1765
+ internalType: "contract ILayerZeroEndpointV2",
1766
+ name: "",
1767
+ type: "address"
1768
+ }
1769
+ ],
1770
+ stateMutability: "view",
1771
+ type: "function"
1772
+ },
1773
+ {
1774
+ inputs: [
1775
+ { internalType: "uint32", name: "_eid", type: "uint32" },
1776
+ { internalType: "uint16", name: "_msgType", type: "uint16" }
1777
+ ],
1778
+ name: "enforcedOptions",
1779
+ outputs: [{ internalType: "bytes", name: "", type: "bytes" }],
1780
+ stateMutability: "view",
1781
+ type: "function"
1782
+ },
1783
+ {
1784
+ inputs: [{ internalType: "uint256", name: "batchSize", type: "uint256" }],
1785
+ name: "getNextProcessableBatch",
1786
+ outputs: [
1787
+ { internalType: "uint256[]", name: "requestIds", type: "uint256[]" },
1788
+ { internalType: "uint256", name: "totalRequired", type: "uint256" }
1789
+ ],
1790
+ stateMutability: "view",
1791
+ type: "function"
1792
+ },
1793
+ {
1794
+ inputs: [
1795
+ { internalType: "uint256", name: "startId", type: "uint256" },
1796
+ { internalType: "uint256", name: "endId", type: "uint256" }
1797
+ ],
1798
+ name: "getPendingRequestsCount",
1799
+ outputs: [{ internalType: "uint256", name: "count", type: "uint256" }],
1800
+ stateMutability: "view",
1801
+ type: "function"
1802
+ },
1803
+ {
1804
+ inputs: [{ internalType: "bytes32", name: "role", type: "bytes32" }],
1805
+ name: "getRoleAdmin",
1806
+ outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }],
1807
+ stateMutability: "view",
1808
+ type: "function"
1809
+ },
1810
+ {
1811
+ inputs: [{ internalType: "address", name: "user", type: "address" }],
1812
+ name: "getUserWithdrawRequests",
1813
+ outputs: [{ internalType: "uint256[]", name: "", type: "uint256[]" }],
1814
+ stateMutability: "view",
1815
+ type: "function"
1816
+ },
1817
+ {
1818
+ inputs: [
1819
+ { internalType: "bytes32", name: "role", type: "bytes32" },
1820
+ { internalType: "address", name: "account", type: "address" }
1821
+ ],
1822
+ name: "grantRole",
1823
+ outputs: [],
1824
+ stateMutability: "nonpayable",
1825
+ type: "function"
1826
+ },
1827
+ {
1828
+ inputs: [
1829
+ { internalType: "bytes32", name: "role", type: "bytes32" },
1830
+ { internalType: "address", name: "account", type: "address" }
1831
+ ],
1832
+ name: "hasRole",
1833
+ outputs: [{ internalType: "bool", name: "", type: "bool" }],
1834
+ stateMutability: "view",
1835
+ type: "function"
1836
+ },
1837
+ {
1838
+ inputs: [
1839
+ { internalType: "string", name: "_name", type: "string" },
1840
+ { internalType: "string", name: "_symbol", type: "string" },
1841
+ { internalType: "address", name: "_baseToken", type: "address" },
1842
+ { internalType: "uint8", name: "_baseTokenDecimals", type: "uint8" },
1843
+ { internalType: "address", name: "_ownerOrDelegate", type: "address" },
1844
+ { internalType: "bool", name: "_isCoreChain", type: "bool" }
1845
+ ],
1846
+ name: "initialize",
1847
+ outputs: [],
1848
+ stateMutability: "nonpayable",
1849
+ type: "function"
1850
+ },
1851
+ {
1852
+ inputs: [
1853
+ {
1854
+ components: [
1855
+ { internalType: "uint32", name: "srcEid", type: "uint32" },
1856
+ { internalType: "bytes32", name: "sender", type: "bytes32" },
1857
+ { internalType: "uint64", name: "nonce", type: "uint64" }
1858
+ ],
1859
+ internalType: "struct Origin",
1860
+ name: "",
1861
+ type: "tuple"
1862
+ },
1863
+ { internalType: "bytes", name: "", type: "bytes" },
1864
+ { internalType: "address", name: "_sender", type: "address" }
1865
+ ],
1866
+ name: "isComposeMsgSender",
1867
+ outputs: [{ internalType: "bool", name: "", type: "bool" }],
1868
+ stateMutability: "view",
1869
+ type: "function"
1870
+ },
1871
+ {
1872
+ inputs: [],
1873
+ name: "isCoreChain",
1874
+ outputs: [{ internalType: "bool", name: "", type: "bool" }],
1875
+ stateMutability: "view",
1876
+ type: "function"
1877
+ },
1878
+ {
1879
+ inputs: [],
1880
+ name: "isDepositable",
1881
+ outputs: [{ internalType: "bool", name: "", type: "bool" }],
1882
+ stateMutability: "view",
1883
+ type: "function"
1884
+ },
1885
+ {
1886
+ inputs: [
1887
+ { internalType: "uint32", name: "_eid", type: "uint32" },
1888
+ { internalType: "bytes32", name: "_peer", type: "bytes32" }
1889
+ ],
1890
+ name: "isPeer",
1891
+ outputs: [{ internalType: "bool", name: "", type: "bool" }],
1892
+ stateMutability: "view",
1893
+ type: "function"
1894
+ },
1895
+ {
1896
+ inputs: [],
1897
+ name: "isWithdrawable",
1898
+ outputs: [{ internalType: "bool", name: "", type: "bool" }],
1899
+ stateMutability: "view",
1900
+ type: "function"
1901
+ },
1902
+ {
1903
+ inputs: [
1904
+ {
1905
+ components: [
1906
+ { internalType: "uint32", name: "srcEid", type: "uint32" },
1907
+ { internalType: "bytes32", name: "sender", type: "bytes32" },
1908
+ { internalType: "uint64", name: "nonce", type: "uint64" }
1909
+ ],
1910
+ internalType: "struct Origin",
1911
+ name: "_origin",
1912
+ type: "tuple"
1913
+ },
1914
+ { internalType: "bytes32", name: "_guid", type: "bytes32" },
1915
+ { internalType: "bytes", name: "_message", type: "bytes" },
1916
+ { internalType: "address", name: "_executor", type: "address" },
1917
+ { internalType: "bytes", name: "_extraData", type: "bytes" }
1918
+ ],
1919
+ name: "lzReceive",
1920
+ outputs: [],
1921
+ stateMutability: "payable",
1922
+ type: "function"
1923
+ },
1924
+ {
1925
+ inputs: [
1926
+ {
1927
+ components: [
1928
+ {
1929
+ components: [
1930
+ { internalType: "uint32", name: "srcEid", type: "uint32" },
1931
+ { internalType: "bytes32", name: "sender", type: "bytes32" },
1932
+ { internalType: "uint64", name: "nonce", type: "uint64" }
1933
+ ],
1934
+ internalType: "struct Origin",
1935
+ name: "origin",
1936
+ type: "tuple"
1937
+ },
1938
+ { internalType: "uint32", name: "dstEid", type: "uint32" },
1939
+ { internalType: "address", name: "receiver", type: "address" },
1940
+ { internalType: "bytes32", name: "guid", type: "bytes32" },
1941
+ { internalType: "uint256", name: "value", type: "uint256" },
1942
+ { internalType: "address", name: "executor", type: "address" },
1943
+ { internalType: "bytes", name: "message", type: "bytes" },
1944
+ { internalType: "bytes", name: "extraData", type: "bytes" }
1945
+ ],
1946
+ internalType: "struct InboundPacket[]",
1947
+ name: "_packets",
1948
+ type: "tuple[]"
1949
+ }
1950
+ ],
1951
+ name: "lzReceiveAndRevert",
1952
+ outputs: [],
1953
+ stateMutability: "payable",
1954
+ type: "function"
1955
+ },
1956
+ {
1957
+ inputs: [
1958
+ {
1959
+ components: [
1960
+ { internalType: "uint32", name: "srcEid", type: "uint32" },
1961
+ { internalType: "bytes32", name: "sender", type: "bytes32" },
1962
+ { internalType: "uint64", name: "nonce", type: "uint64" }
1963
+ ],
1964
+ internalType: "struct Origin",
1965
+ name: "_origin",
1966
+ type: "tuple"
1967
+ },
1968
+ { internalType: "bytes32", name: "_guid", type: "bytes32" },
1969
+ { internalType: "bytes", name: "_message", type: "bytes" },
1970
+ { internalType: "address", name: "_executor", type: "address" },
1971
+ { internalType: "bytes", name: "_extraData", type: "bytes" }
1972
+ ],
1973
+ name: "lzReceiveSimulate",
1974
+ outputs: [],
1975
+ stateMutability: "payable",
1976
+ type: "function"
1977
+ },
1978
+ {
1979
+ inputs: [],
1980
+ name: "maxRequestsPerBatch",
1981
+ outputs: [{ internalType: "uint16", name: "", type: "uint16" }],
1982
+ stateMutability: "view",
1983
+ type: "function"
1984
+ },
1985
+ {
1986
+ inputs: [],
1987
+ name: "maxViewRange",
1988
+ outputs: [{ internalType: "uint8", name: "", type: "uint8" }],
1989
+ stateMutability: "view",
1990
+ type: "function"
1991
+ },
1992
+ {
1993
+ inputs: [
1994
+ { internalType: "address", name: "_user", type: "address" },
1995
+ { internalType: "uint256", name: "_amount", type: "uint256" }
1996
+ ],
1997
+ name: "mint",
1998
+ outputs: [],
1999
+ stateMutability: "nonpayable",
2000
+ type: "function"
2001
+ },
2002
+ {
2003
+ inputs: [],
2004
+ name: "msgInspector",
2005
+ outputs: [{ internalType: "address", name: "", type: "address" }],
2006
+ stateMutability: "view",
2007
+ type: "function"
2008
+ },
2009
+ {
2010
+ inputs: [],
2011
+ name: "name",
2012
+ outputs: [{ internalType: "string", name: "", type: "string" }],
2013
+ stateMutability: "view",
2014
+ type: "function"
2015
+ },
2016
+ {
2017
+ inputs: [
2018
+ { internalType: "uint32", name: "", type: "uint32" },
2019
+ { internalType: "bytes32", name: "", type: "bytes32" }
2020
+ ],
2021
+ name: "nextNonce",
2022
+ outputs: [{ internalType: "uint64", name: "nonce", type: "uint64" }],
2023
+ stateMutability: "view",
2024
+ type: "function"
2025
+ },
2026
+ {
2027
+ inputs: [{ internalType: "address", name: "owner", type: "address" }],
2028
+ name: "nonces",
2029
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
2030
+ stateMutability: "view",
2031
+ type: "function"
2032
+ },
2033
+ {
2034
+ inputs: [],
2035
+ name: "oApp",
2036
+ outputs: [{ internalType: "address", name: "", type: "address" }],
2037
+ stateMutability: "view",
2038
+ type: "function"
2039
+ },
2040
+ {
2041
+ inputs: [],
2042
+ name: "oAppVersion",
2043
+ outputs: [
2044
+ { internalType: "uint64", name: "senderVersion", type: "uint64" },
2045
+ { internalType: "uint64", name: "receiverVersion", type: "uint64" }
2046
+ ],
2047
+ stateMutability: "pure",
2048
+ type: "function"
2049
+ },
2050
+ {
2051
+ inputs: [],
2052
+ name: "oftVersion",
2053
+ outputs: [
2054
+ { internalType: "bytes4", name: "interfaceId", type: "bytes4" },
2055
+ { internalType: "uint64", name: "version", type: "uint64" }
2056
+ ],
2057
+ stateMutability: "pure",
2058
+ type: "function"
2059
+ },
2060
+ {
2061
+ inputs: [],
2062
+ name: "oldestUnprocessedRequest",
2063
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
2064
+ stateMutability: "view",
2065
+ type: "function"
2066
+ },
2067
+ {
2068
+ inputs: [],
2069
+ name: "owner",
2070
+ outputs: [{ internalType: "address", name: "", type: "address" }],
2071
+ stateMutability: "view",
2072
+ type: "function"
2073
+ },
2074
+ {
2075
+ inputs: [{ internalType: "uint32", name: "_eid", type: "uint32" }],
2076
+ name: "peers",
2077
+ outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }],
2078
+ stateMutability: "view",
2079
+ type: "function"
2080
+ },
2081
+ {
2082
+ inputs: [{ internalType: "address", name: "", type: "address" }],
2083
+ name: "pendingBalances",
2084
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
2085
+ stateMutability: "view",
2086
+ type: "function"
2087
+ },
2088
+ {
2089
+ inputs: [{ internalType: "address", name: "account", type: "address" }],
2090
+ name: "pendingYield",
2091
+ outputs: [
2092
+ {
2093
+ components: [
2094
+ {
2095
+ internalType: "uint256",
2096
+ name: "accumulatedYield",
2097
+ type: "uint256"
2098
+ },
2099
+ { internalType: "uint256", name: "lastBalance", type: "uint256" },
2100
+ { internalType: "uint64", name: "lastUpdateTime", type: "uint64" }
2101
+ ],
2102
+ internalType: "struct ISyntheticStructs.UserYield",
2103
+ name: "info",
2104
+ type: "tuple"
2105
+ }
2106
+ ],
2107
+ stateMutability: "view",
2108
+ type: "function"
2109
+ },
2110
+ {
2111
+ inputs: [{ internalType: "address", name: "", type: "address" }],
2112
+ name: "claimedYield",
2113
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
2114
+ stateMutability: "view",
2115
+ type: "function"
2116
+ },
2117
+ {
2118
+ inputs: [
2119
+ { internalType: "address", name: "owner", type: "address" },
2120
+ { internalType: "address", name: "spender", type: "address" },
2121
+ { internalType: "uint256", name: "value", type: "uint256" },
2122
+ { internalType: "uint256", name: "deadline", type: "uint256" },
2123
+ { internalType: "uint8", name: "v", type: "uint8" },
2124
+ { internalType: "bytes32", name: "r", type: "bytes32" },
2125
+ { internalType: "bytes32", name: "s", type: "bytes32" }
2126
+ ],
2127
+ name: "permit",
2128
+ outputs: [],
2129
+ stateMutability: "nonpayable",
2130
+ type: "function"
2131
+ },
2132
+ {
2133
+ inputs: [],
2134
+ name: "preCrime",
2135
+ outputs: [{ internalType: "address", name: "", type: "address" }],
2136
+ stateMutability: "view",
2137
+ type: "function"
2138
+ },
2139
+ {
2140
+ inputs: [
2141
+ {
2142
+ components: [
2143
+ { internalType: "uint32", name: "dstEid", type: "uint32" },
2144
+ { internalType: "bytes32", name: "to", type: "bytes32" },
2145
+ { internalType: "uint256", name: "amountLD", type: "uint256" },
2146
+ { internalType: "uint256", name: "minAmountLD", type: "uint256" },
2147
+ { internalType: "bytes", name: "extraOptions", type: "bytes" },
2148
+ { internalType: "bytes", name: "composeMsg", type: "bytes" },
2149
+ { internalType: "bytes", name: "oftCmd", type: "bytes" }
2150
+ ],
2151
+ internalType: "struct SendParam",
2152
+ name: "_sendParam",
2153
+ type: "tuple"
2154
+ }
2155
+ ],
2156
+ name: "quoteOFT",
2157
+ outputs: [
2158
+ {
2159
+ components: [
2160
+ { internalType: "uint256", name: "minAmountLD", type: "uint256" },
2161
+ { internalType: "uint256", name: "maxAmountLD", type: "uint256" }
2162
+ ],
2163
+ internalType: "struct OFTLimit",
2164
+ name: "oftLimit",
2165
+ type: "tuple"
2166
+ },
2167
+ {
2168
+ components: [
2169
+ { internalType: "int256", name: "feeAmountLD", type: "int256" },
2170
+ { internalType: "string", name: "description", type: "string" }
2171
+ ],
2172
+ internalType: "struct OFTFeeDetail[]",
2173
+ name: "oftFeeDetails",
2174
+ type: "tuple[]"
2175
+ },
2176
+ {
2177
+ components: [
2178
+ { internalType: "uint256", name: "amountSentLD", type: "uint256" },
2179
+ {
2180
+ internalType: "uint256",
2181
+ name: "amountReceivedLD",
2182
+ type: "uint256"
2183
+ }
2184
+ ],
2185
+ internalType: "struct OFTReceipt",
2186
+ name: "oftReceipt",
2187
+ type: "tuple"
2188
+ }
2189
+ ],
2190
+ stateMutability: "view",
2191
+ type: "function"
2192
+ },
2193
+ {
2194
+ inputs: [
2195
+ {
2196
+ components: [
2197
+ { internalType: "uint32", name: "dstEid", type: "uint32" },
2198
+ { internalType: "bytes32", name: "to", type: "bytes32" },
2199
+ { internalType: "uint256", name: "amountLD", type: "uint256" },
2200
+ { internalType: "uint256", name: "minAmountLD", type: "uint256" },
2201
+ { internalType: "bytes", name: "extraOptions", type: "bytes" },
2202
+ { internalType: "bytes", name: "composeMsg", type: "bytes" },
2203
+ { internalType: "bytes", name: "oftCmd", type: "bytes" }
2204
+ ],
2205
+ internalType: "struct SendParam",
2206
+ name: "_sendParam",
2207
+ type: "tuple"
2208
+ },
2209
+ { internalType: "bool", name: "_payInLzToken", type: "bool" }
2210
+ ],
2211
+ name: "quoteSend",
2212
+ outputs: [
2213
+ {
2214
+ components: [
2215
+ { internalType: "uint256", name: "nativeFee", type: "uint256" },
2216
+ { internalType: "uint256", name: "lzTokenFee", type: "uint256" }
2217
+ ],
2218
+ internalType: "struct MessagingFee",
2219
+ name: "msgFee",
2220
+ type: "tuple"
2221
+ }
2222
+ ],
2223
+ stateMutability: "view",
2224
+ type: "function"
2225
+ },
2226
+ {
2227
+ inputs: [],
2228
+ name: "renounceOwnership",
2229
+ outputs: [],
2230
+ stateMutability: "nonpayable",
2231
+ type: "function"
2232
+ },
2233
+ {
2234
+ inputs: [
2235
+ { internalType: "bytes32", name: "role", type: "bytes32" },
2236
+ { internalType: "address", name: "callerConfirmation", type: "address" }
2237
+ ],
2238
+ name: "renounceRole",
2239
+ outputs: [],
2240
+ stateMutability: "nonpayable",
2241
+ type: "function"
2242
+ },
2243
+ {
2244
+ inputs: [
2245
+ { internalType: "address", name: "_token", type: "address" },
2246
+ { internalType: "address", name: "_to", type: "address" },
2247
+ { internalType: "uint256", name: "_amount", type: "uint256" }
2248
+ ],
2249
+ name: "rescueTokens",
2250
+ outputs: [],
2251
+ stateMutability: "nonpayable",
2252
+ type: "function"
2253
+ },
2254
+ {
2255
+ inputs: [
2256
+ { internalType: "bytes32", name: "role", type: "bytes32" },
2257
+ { internalType: "address", name: "account", type: "address" }
2258
+ ],
2259
+ name: "revokeRole",
2260
+ outputs: [],
2261
+ stateMutability: "nonpayable",
2262
+ type: "function"
2263
+ },
2264
+ {
2265
+ inputs: [
2266
+ {
2267
+ components: [
2268
+ { internalType: "uint32", name: "dstEid", type: "uint32" },
2269
+ { internalType: "bytes32", name: "to", type: "bytes32" },
2270
+ { internalType: "uint256", name: "amountLD", type: "uint256" },
2271
+ { internalType: "uint256", name: "minAmountLD", type: "uint256" },
2272
+ { internalType: "bytes", name: "extraOptions", type: "bytes" },
2273
+ { internalType: "bytes", name: "composeMsg", type: "bytes" },
2274
+ { internalType: "bytes", name: "oftCmd", type: "bytes" }
2275
+ ],
2276
+ internalType: "struct SendParam",
2277
+ name: "_sendParam",
2278
+ type: "tuple"
2279
+ },
2280
+ {
2281
+ components: [
2282
+ { internalType: "uint256", name: "nativeFee", type: "uint256" },
2283
+ { internalType: "uint256", name: "lzTokenFee", type: "uint256" }
2284
+ ],
2285
+ internalType: "struct MessagingFee",
2286
+ name: "_fee",
2287
+ type: "tuple"
2288
+ },
2289
+ { internalType: "address", name: "_refundAddress", type: "address" }
2290
+ ],
2291
+ name: "send",
2292
+ outputs: [
2293
+ {
2294
+ components: [
2295
+ { internalType: "bytes32", name: "guid", type: "bytes32" },
2296
+ { internalType: "uint64", name: "nonce", type: "uint64" },
2297
+ {
2298
+ components: [
2299
+ { internalType: "uint256", name: "nativeFee", type: "uint256" },
2300
+ { internalType: "uint256", name: "lzTokenFee", type: "uint256" }
2301
+ ],
2302
+ internalType: "struct MessagingFee",
2303
+ name: "fee",
2304
+ type: "tuple"
2305
+ }
2306
+ ],
2307
+ internalType: "struct MessagingReceipt",
2308
+ name: "msgReceipt",
2309
+ type: "tuple"
2310
+ },
2311
+ {
2312
+ components: [
2313
+ { internalType: "uint256", name: "amountSentLD", type: "uint256" },
2314
+ {
2315
+ internalType: "uint256",
2316
+ name: "amountReceivedLD",
2317
+ type: "uint256"
2318
+ }
2319
+ ],
2320
+ internalType: "struct OFTReceipt",
2321
+ name: "oftReceipt",
2322
+ type: "tuple"
2323
+ }
2324
+ ],
2325
+ stateMutability: "payable",
2326
+ type: "function"
2327
+ },
2328
+ {
2329
+ inputs: [{ internalType: "uint32", name: "_apr", type: "uint32" }],
2330
+ name: "setApr",
2331
+ outputs: [],
2332
+ stateMutability: "nonpayable",
2333
+ type: "function"
2334
+ },
2335
+ {
2336
+ inputs: [{ internalType: "address", name: "_delegate", type: "address" }],
2337
+ name: "setDelegate",
2338
+ outputs: [],
2339
+ stateMutability: "nonpayable",
2340
+ type: "function"
2341
+ },
2342
+ {
2343
+ inputs: [{ internalType: "bool", name: "_isDepositable", type: "bool" }],
2344
+ name: "setDepositable",
2345
+ outputs: [],
2346
+ stateMutability: "nonpayable",
2347
+ type: "function"
2348
+ },
2349
+ {
2350
+ inputs: [
2351
+ {
2352
+ components: [
2353
+ { internalType: "uint32", name: "eid", type: "uint32" },
2354
+ { internalType: "uint16", name: "msgType", type: "uint16" },
2355
+ { internalType: "bytes", name: "options", type: "bytes" }
2356
+ ],
2357
+ internalType: "struct EnforcedOptionParam[]",
2358
+ name: "_enforcedOptions",
2359
+ type: "tuple[]"
2360
+ }
2361
+ ],
2362
+ name: "setEnforcedOptions",
2363
+ outputs: [],
2364
+ stateMutability: "nonpayable",
2365
+ type: "function"
2366
+ },
2367
+ {
2368
+ inputs: [{ internalType: "uint16", name: "_maxRequests", type: "uint16" }],
2369
+ name: "setMaxRequestsPerBatch",
2370
+ outputs: [],
2371
+ stateMutability: "nonpayable",
2372
+ type: "function"
2373
+ },
2374
+ {
2375
+ inputs: [{ internalType: "uint8", name: "_maxRange", type: "uint8" }],
2376
+ name: "setMaxViewRange",
2377
+ outputs: [],
2378
+ stateMutability: "nonpayable",
2379
+ type: "function"
2380
+ },
2381
+ {
2382
+ inputs: [
2383
+ { internalType: "address", name: "_msgInspector", type: "address" }
2384
+ ],
2385
+ name: "setMsgInspector",
2386
+ outputs: [],
2387
+ stateMutability: "nonpayable",
2388
+ type: "function"
2389
+ },
2390
+ {
2391
+ inputs: [
2392
+ { internalType: "uint32", name: "_eid", type: "uint32" },
2393
+ { internalType: "bytes32", name: "_peer", type: "bytes32" }
2394
+ ],
2395
+ name: "setPeer",
2396
+ outputs: [],
2397
+ stateMutability: "nonpayable",
2398
+ type: "function"
2399
+ },
2400
+ {
2401
+ inputs: [{ internalType: "address", name: "_preCrime", type: "address" }],
2402
+ name: "setPreCrime",
2403
+ outputs: [],
2404
+ stateMutability: "nonpayable",
2405
+ type: "function"
2406
+ },
2407
+ {
2408
+ inputs: [{ internalType: "address", name: "_strategy", type: "address" }],
2409
+ name: "setStrategy",
2410
+ outputs: [],
2411
+ stateMutability: "nonpayable",
2412
+ type: "function"
2413
+ },
2414
+ {
2415
+ inputs: [{ internalType: "bool", name: "_isWithdrawable", type: "bool" }],
2416
+ name: "setWithdrawable",
2417
+ outputs: [],
2418
+ stateMutability: "nonpayable",
2419
+ type: "function"
2420
+ },
2421
+ {
2422
+ inputs: [{ internalType: "address", name: "_calculator", type: "address" }],
2423
+ name: "setYieldCalculator",
2424
+ outputs: [],
2425
+ stateMutability: "nonpayable",
2426
+ type: "function"
2427
+ },
2428
+ {
2429
+ inputs: [],
2430
+ name: "sharedDecimals",
2431
+ outputs: [{ internalType: "uint8", name: "", type: "uint8" }],
2432
+ stateMutability: "pure",
2433
+ type: "function"
2434
+ },
2435
+ {
2436
+ inputs: [],
2437
+ name: "strategy",
2438
+ outputs: [
2439
+ { internalType: "contract IStrategy", name: "", type: "address" }
2440
+ ],
2441
+ stateMutability: "view",
2442
+ type: "function"
2443
+ },
2444
+ {
2445
+ inputs: [{ internalType: "uint256", name: "amount", type: "uint256" }],
2446
+ name: "supplyMorpho",
2447
+ outputs: [],
2448
+ stateMutability: "nonpayable",
2449
+ type: "function"
2450
+ },
2451
+ {
2452
+ inputs: [{ internalType: "bytes4", name: "interfaceId", type: "bytes4" }],
2453
+ name: "supportsInterface",
2454
+ outputs: [{ internalType: "bool", name: "", type: "bool" }],
2455
+ stateMutability: "view",
2456
+ type: "function"
2457
+ },
2458
+ {
2459
+ inputs: [],
2460
+ name: "symbol",
2461
+ outputs: [{ internalType: "string", name: "", type: "string" }],
2462
+ stateMutability: "view",
2463
+ type: "function"
2464
+ },
2465
+ {
2466
+ inputs: [],
2467
+ name: "token",
2468
+ outputs: [{ internalType: "address", name: "", type: "address" }],
2469
+ stateMutability: "view",
2470
+ type: "function"
2471
+ },
2472
+ {
2473
+ inputs: [],
2474
+ name: "totalSupply",
2475
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
2476
+ stateMutability: "view",
2477
+ type: "function"
2478
+ },
2479
+ {
2480
+ inputs: [
2481
+ { internalType: "address", name: "to", type: "address" },
2482
+ { internalType: "uint256", name: "value", type: "uint256" }
2483
+ ],
2484
+ name: "transfer",
2485
+ outputs: [{ internalType: "bool", name: "", type: "bool" }],
2486
+ stateMutability: "nonpayable",
2487
+ type: "function"
2488
+ },
2489
+ {
2490
+ inputs: [
2491
+ { internalType: "address", name: "from", type: "address" },
2492
+ { internalType: "address", name: "to", type: "address" },
2493
+ { internalType: "uint256", name: "value", type: "uint256" }
2494
+ ],
2495
+ name: "transferFrom",
2496
+ outputs: [{ internalType: "bool", name: "", type: "bool" }],
2497
+ stateMutability: "nonpayable",
2498
+ type: "function"
2499
+ },
2500
+ {
2501
+ inputs: [{ internalType: "address", name: "newOwner", type: "address" }],
2502
+ name: "transferOwnership",
2503
+ outputs: [],
2504
+ stateMutability: "nonpayable",
2505
+ type: "function"
2506
+ },
2507
+ {
2508
+ inputs: [
2509
+ { internalType: "address", name: "", type: "address" },
2510
+ { internalType: "uint256", name: "", type: "uint256" }
2511
+ ],
2512
+ name: "userWithdrawRequests",
2513
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
2514
+ stateMutability: "view",
2515
+ type: "function"
2516
+ },
2517
+ {
2518
+ inputs: [{ internalType: "address", name: "", type: "address" }],
2519
+ name: "userYields",
2520
+ outputs: [
2521
+ { internalType: "uint256", name: "accumulatedYield", type: "uint256" },
2522
+ { internalType: "uint256", name: "lastBalance", type: "uint256" },
2523
+ { internalType: "uint64", name: "lastUpdateTime", type: "uint64" }
2524
+ ],
2525
+ stateMutability: "view",
2526
+ type: "function"
2527
+ },
2528
+ {
2529
+ inputs: [{ internalType: "uint256", name: "amount", type: "uint256" }],
2530
+ name: "withdraw",
2531
+ outputs: [],
2532
+ stateMutability: "nonpayable",
2533
+ type: "function"
2534
+ },
2535
+ {
2536
+ inputs: [],
2537
+ name: "withdrawRequestCounter",
2538
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
2539
+ stateMutability: "view",
2540
+ type: "function"
2541
+ },
2542
+ {
2543
+ inputs: [{ internalType: "uint256", name: "", type: "uint256" }],
2544
+ name: "withdrawRequests",
2545
+ outputs: [
2546
+ { internalType: "address", name: "user", type: "address" },
2547
+ { internalType: "uint256", name: "amount", type: "uint256" },
2548
+ { internalType: "uint256", name: "requestTime", type: "uint256" },
2549
+ { internalType: "bool", name: "processed", type: "bool" }
2550
+ ],
2551
+ stateMutability: "view",
2552
+ type: "function"
2553
+ },
2554
+ {
2555
+ inputs: [
2556
+ { internalType: "uint256", name: "amount", type: "uint256" },
2557
+ { internalType: "address", name: "recipient", type: "address" }
2558
+ ],
2559
+ name: "withdrawTo",
2560
+ outputs: [],
2561
+ stateMutability: "nonpayable",
2562
+ type: "function"
2563
+ },
2564
+ {
2565
+ inputs: [],
2566
+ name: "yieldCalculator",
2567
+ outputs: [
2568
+ { internalType: "contract IYieldCalculator", name: "", type: "address" }
2569
+ ],
2570
+ stateMutability: "view",
2571
+ type: "function"
2572
+ }
2573
+ ];
2574
+
2575
+ // src/abi/fundsManagement.abi.ts
2576
+ var fundsManagementAbi = [{
2577
+ "type": "error",
2578
+ "name": "AlreadyInitialized",
2579
+ "inputs": [{ "type": "address", "name": "smartAccount" }]
2580
+ }, { "type": "error", "name": "InvalidInitialization", "inputs": [] }, {
2581
+ "type": "error",
2582
+ "name": "NotInitialized",
2583
+ "inputs": [{ "type": "address", "name": "smartAccount" }]
2584
+ }, { "type": "error", "name": "NotInitializing", "inputs": [] }, {
2585
+ "type": "error",
2586
+ "name": "ReentrancyGuardReentrantCall",
2587
+ "inputs": []
2588
+ }, {
2589
+ "type": "error",
2590
+ "name": "SafeERC20FailedOperation",
2591
+ "inputs": [{ "type": "address", "name": "token" }]
2592
+ }, {
2593
+ "type": "event",
2594
+ "anonymous": false,
2595
+ "name": "BatchTransactionApproved",
2596
+ "inputs": [{ "type": "bytes16", "name": "transactionId", "indexed": true }, {
2597
+ "type": "bytes16",
2598
+ "name": "operationId",
2599
+ "indexed": true
2600
+ }, { "type": "address", "name": "wallet", "indexed": true }, {
2601
+ "type": "address",
2602
+ "name": "token",
2603
+ "indexed": false
2604
+ }, { "type": "uint256", "name": "totalAmount", "indexed": false }, {
2605
+ "type": "uint256",
2606
+ "name": "createdAt",
2607
+ "indexed": false
2608
+ }]
2609
+ }, {
2610
+ "type": "event",
2611
+ "anonymous": false,
2612
+ "name": "IncomingTransactionProcessed",
2613
+ "inputs": [{ "type": "bytes16", "name": "transactionID", "indexed": false }, {
2614
+ "type": "bytes16",
2615
+ "name": "operationID",
2616
+ "indexed": false
2617
+ }, { "type": "bytes32", "name": "transactionType", "indexed": false }, {
2618
+ "type": "bytes3",
2619
+ "name": "transactionCurrency",
2620
+ "indexed": false
2621
+ }, { "type": "address", "name": "transactionToken", "indexed": false }, {
2622
+ "type": "uint256",
2623
+ "name": "transactionAmount",
2624
+ "indexed": false
2625
+ }, { "type": "address", "name": "targetWallet", "indexed": false }, {
2626
+ "type": "address",
2627
+ "name": "targetToken",
2628
+ "indexed": false
2629
+ }, { "type": "uint256", "name": "targetAmount", "indexed": false }, {
2630
+ "type": "uint256",
2631
+ "name": "createdAt",
2632
+ "indexed": false
2633
+ }]
2634
+ }, {
2635
+ "type": "event",
2636
+ "anonymous": false,
2637
+ "name": "Initialized",
2638
+ "inputs": [{ "type": "uint64", "name": "version", "indexed": false }]
2639
+ }, {
2640
+ "type": "event",
2641
+ "anonymous": false,
2642
+ "name": "MigrationTransactionProcessed",
2643
+ "inputs": [{ "type": "bytes16", "name": "transactionID", "indexed": true }, {
2644
+ "type": "bytes16",
2645
+ "name": "operationID",
2646
+ "indexed": true
2647
+ }, { "type": "bytes32", "name": "transactionType", "indexed": false }, {
2648
+ "type": "bytes3",
2649
+ "name": "transactionCurrency",
2650
+ "indexed": false
2651
+ }, { "type": "address", "name": "transactionToken", "indexed": false }, {
2652
+ "type": "uint256",
2653
+ "name": "transactionAmount",
2654
+ "indexed": false
2655
+ }, { "type": "address", "name": "sourceWallet", "indexed": false }, {
2656
+ "type": "address",
2657
+ "name": "targetToken",
2658
+ "indexed": false
2659
+ }, { "type": "uint256", "name": "targetAmount", "indexed": false }, {
2660
+ "type": "uint256",
2661
+ "name": "createdAt",
2662
+ "indexed": false
2663
+ }]
2664
+ }, {
2665
+ "type": "event",
2666
+ "anonymous": false,
2667
+ "name": "OutgoingBatchTransactionProcessed",
2668
+ "inputs": [{ "type": "bytes16", "name": "transactionId", "indexed": true }, {
2669
+ "type": "bytes16",
2670
+ "name": "operationId",
2671
+ "indexed": true
2672
+ }, { "type": "address", "name": "wallet", "indexed": true }, {
2673
+ "type": "address",
2674
+ "name": "token",
2675
+ "indexed": false
2676
+ }, { "type": "uint256", "name": "totalAmount", "indexed": false }, {
2677
+ "type": "uint256",
2678
+ "name": "createdAt",
2679
+ "indexed": false
2680
+ }]
2681
+ }, {
2682
+ "type": "event",
2683
+ "anonymous": false,
2684
+ "name": "OutgoingTransactionProcessed",
2685
+ "inputs": [{ "type": "bytes16", "name": "transactionID", "indexed": false }, {
2686
+ "type": "bytes16",
2687
+ "name": "operationID",
2688
+ "indexed": false
2689
+ }, { "type": "bytes32", "name": "transactionType", "indexed": false }, {
2690
+ "type": "bytes3",
2691
+ "name": "transactionCurrency",
2692
+ "indexed": false
2693
+ }, { "type": "address", "name": "transactionToken", "indexed": false }, {
2694
+ "type": "uint256",
2695
+ "name": "transactionAmount",
2696
+ "indexed": false
2697
+ }, { "type": "address", "name": "sourceWallet", "indexed": false }, {
2698
+ "type": "address",
2699
+ "name": "sourceToken",
2700
+ "indexed": false
2701
+ }, { "type": "uint256", "name": "sourceAmount", "indexed": false }, {
2702
+ "type": "uint256",
2703
+ "name": "createdAt",
2704
+ "indexed": false
2705
+ }]
2706
+ }, {
2707
+ "type": "function",
2708
+ "name": "approveOutgoingBatchTransaction",
2709
+ "constant": false,
2710
+ "payable": false,
2711
+ "inputs": [{ "type": "bytes16", "name": "transactionId" }, {
2712
+ "type": "bytes16",
2713
+ "name": "operationId"
2714
+ }, { "type": "address", "name": "wallet" }, { "type": "address", "name": "token" }, {
2715
+ "type": "uint256",
2716
+ "name": "totalAmount"
2717
+ }],
2718
+ "outputs": []
2719
+ }, {
2720
+ "type": "function",
2721
+ "name": "baseToSyntheticMigration",
2722
+ "constant": true,
2723
+ "stateMutability": "view",
2724
+ "payable": false,
2725
+ "inputs": [{ "type": "address", "name": "" }],
2726
+ "outputs": [{ "type": "address", "name": "" }]
2727
+ }, {
2728
+ "type": "function",
2729
+ "name": "batchTransactionRequests",
2730
+ "constant": true,
2731
+ "stateMutability": "view",
2732
+ "payable": false,
2733
+ "inputs": [{ "type": "bytes32", "name": "" }],
2734
+ "outputs": [{ "type": "address", "name": "wallet" }, { "type": "address", "name": "token" }, {
2735
+ "type": "uint256",
2736
+ "name": "totalAmount"
2737
+ }, { "type": "uint256", "name": "createdAt" }]
2738
+ }, {
2739
+ "type": "function",
2740
+ "name": "changeFundsBufferAddress",
2741
+ "constant": false,
2742
+ "payable": false,
2743
+ "inputs": [{ "type": "address", "name": "newAddress" }],
2744
+ "outputs": []
2745
+ }, {
2746
+ "type": "function",
2747
+ "name": "configureMigrationPair",
2748
+ "constant": false,
2749
+ "payable": false,
2750
+ "inputs": [{ "type": "address", "name": "baseToken" }, { "type": "address", "name": "syntheticToken" }],
2751
+ "outputs": []
2752
+ }, {
2753
+ "type": "function",
2754
+ "name": "executeOutgoingBatchTransaction",
2755
+ "constant": false,
2756
+ "payable": false,
2757
+ "inputs": [{ "type": "bytes16", "name": "transactionId" }, {
2758
+ "type": "bytes16",
2759
+ "name": "operationId"
2760
+ }, { "type": "address", "name": "tokenAddress" }, {
2761
+ "type": "address[]",
2762
+ "name": "recipients"
2763
+ }, { "type": "uint256[]", "name": "amounts" }],
2764
+ "outputs": []
2765
+ }, {
2766
+ "type": "function",
2767
+ "name": "init",
2768
+ "constant": false,
2769
+ "payable": false,
2770
+ "inputs": [{ "type": "address", "name": "register" }, { "type": "address", "name": "fundsBuffer" }],
2771
+ "outputs": []
2772
+ }, {
2773
+ "type": "function",
2774
+ "name": "initV2",
2775
+ "constant": false,
2776
+ "payable": false,
2777
+ "inputs": [],
2778
+ "outputs": []
2779
+ }, {
2780
+ "type": "function",
2781
+ "name": "isInitialized",
2782
+ "constant": true,
2783
+ "stateMutability": "view",
2784
+ "payable": false,
2785
+ "inputs": [{ "type": "address", "name": "wallet" }],
2786
+ "outputs": [{ "type": "bool", "name": "" }]
2787
+ }, {
2788
+ "type": "function",
2789
+ "name": "isModuleType",
2790
+ "constant": true,
2791
+ "stateMutability": "view",
2792
+ "payable": false,
2793
+ "inputs": [{ "type": "uint256", "name": "moduleTypeId" }],
2794
+ "outputs": [{ "type": "bool", "name": "" }]
2795
+ }, {
2796
+ "type": "function",
2797
+ "name": "onInstall",
2798
+ "constant": false,
2799
+ "stateMutability": "payable",
2800
+ "payable": true,
2801
+ "inputs": [{ "type": "bytes", "name": "data" }],
2802
+ "outputs": []
2803
+ }, {
2804
+ "type": "function",
2805
+ "name": "onUninstall",
2806
+ "constant": false,
2807
+ "stateMutability": "payable",
2808
+ "payable": true,
2809
+ "inputs": [{ "type": "bytes", "name": "data" }],
2810
+ "outputs": []
2811
+ }, {
2812
+ "type": "function",
2813
+ "name": "processIncomingTransaction",
2814
+ "constant": false,
2815
+ "payable": false,
2816
+ "inputs": [{ "type": "bytes16", "name": "transactionID" }, {
2817
+ "type": "bytes16",
2818
+ "name": "operationID"
2819
+ }, { "type": "bytes32", "name": "transactionType" }, {
2820
+ "type": "bytes3",
2821
+ "name": "transactionCurrency"
2822
+ }, { "type": "address", "name": "transactionToken" }, {
2823
+ "type": "uint256",
2824
+ "name": "transactionAmount"
2825
+ }, { "type": "address", "name": "targetWallet" }, { "type": "address", "name": "targetToken" }, {
2826
+ "type": "uint256",
2827
+ "name": "targetAmount"
2828
+ }, { "type": "uint256", "name": "createdAt" }],
2829
+ "outputs": []
2830
+ }, {
2831
+ "type": "function",
2832
+ "name": "processIncomingTransactionSynthetic",
2833
+ "constant": false,
2834
+ "payable": false,
2835
+ "inputs": [{ "type": "bytes16", "name": "transactionID" }, {
2836
+ "type": "bytes16",
2837
+ "name": "operationID"
2838
+ }, { "type": "bytes32", "name": "transactionType" }, {
2839
+ "type": "bytes3",
2840
+ "name": "transactionCurrency"
2841
+ }, { "type": "address", "name": "transactionToken" }, {
2842
+ "type": "uint256",
2843
+ "name": "transactionAmount"
2844
+ }, { "type": "address", "name": "targetWallet" }, { "type": "address", "name": "targetToken" }, {
2845
+ "type": "uint256",
2846
+ "name": "targetAmount"
2847
+ }, { "type": "uint256", "name": "createdAt" }],
2848
+ "outputs": []
2849
+ }, {
2850
+ "type": "function",
2851
+ "name": "processMigrationAdmin",
2852
+ "constant": false,
2853
+ "payable": false,
2854
+ "inputs": [{ "type": "address", "name": "sourceWallet" }],
2855
+ "outputs": []
2856
+ }, {
2857
+ "type": "function",
2858
+ "name": "processMigrationSynthetic",
2859
+ "constant": false,
2860
+ "payable": false,
2861
+ "inputs": [{ "type": "bytes16", "name": "transactionID" }, {
2862
+ "type": "bytes16",
2863
+ "name": "operationID"
2864
+ }, { "type": "bytes32", "name": "transactionType" }, {
2865
+ "type": "bytes3",
2866
+ "name": "transactionCurrency"
2867
+ }, { "type": "address", "name": "transactionToken" }, {
2868
+ "type": "uint256",
2869
+ "name": "transactionAmount"
2870
+ }, { "type": "address", "name": "sourceWallet" }, { "type": "address", "name": "targetToken" }, {
2871
+ "type": "uint256",
2872
+ "name": "targetAmount"
2873
+ }, { "type": "uint256", "name": "createdAt" }],
2874
+ "outputs": []
2875
+ }, {
2876
+ "type": "function",
2877
+ "name": "processOutgoingTransaction",
2878
+ "constant": false,
2879
+ "payable": false,
2880
+ "inputs": [{ "type": "bytes16", "name": "transactionID" }, {
2881
+ "type": "bytes16",
2882
+ "name": "operationID"
2883
+ }, { "type": "bytes32", "name": "transactionType" }, {
2884
+ "type": "bytes3",
2885
+ "name": "transactionCurrency"
2886
+ }, { "type": "address", "name": "transactionToken" }, {
2887
+ "type": "uint256",
2888
+ "name": "transactionAmount"
2889
+ }, { "type": "address", "name": "sourceWallet" }, { "type": "address", "name": "sourceToken" }, {
2890
+ "type": "uint256",
2891
+ "name": "sourceAmount"
2892
+ }, { "type": "uint256", "name": "createdAt" }],
2893
+ "outputs": []
2894
+ }, {
2895
+ "type": "function",
2896
+ "name": "processOutgoingTransactionByApproval",
2897
+ "constant": false,
2898
+ "payable": false,
2899
+ "inputs": [{ "type": "bytes16", "name": "transactionID" }, {
2900
+ "type": "bytes16",
2901
+ "name": "operationID"
2902
+ }, { "type": "bytes32", "name": "transactionType" }, {
2903
+ "type": "bytes3",
2904
+ "name": "transactionCurrency"
2905
+ }, { "type": "address", "name": "transactionToken" }, {
2906
+ "type": "uint256",
2907
+ "name": "transactionAmount"
2908
+ }, { "type": "address", "name": "sourceWallet" }, { "type": "address", "name": "sourceToken" }, {
2909
+ "type": "uint256",
2910
+ "name": "sourceAmount"
2911
+ }, { "type": "uint256", "name": "createdAt" }],
2912
+ "outputs": []
2913
+ }, {
2914
+ "type": "function",
2915
+ "name": "removeMigrationPair",
2916
+ "constant": false,
2917
+ "payable": false,
2918
+ "inputs": [{ "type": "address", "name": "baseToken" }],
2919
+ "outputs": []
2920
+ }, {
2921
+ "type": "function",
2922
+ "name": "setApprovalsForRegistryTokens",
2923
+ "constant": false,
2924
+ "payable": false,
2925
+ "inputs": [{ "type": "address", "name": "sourceWallet" }],
2926
+ "outputs": []
2927
+ }, {
2928
+ "type": "function",
2929
+ "name": "status",
2930
+ "constant": true,
2931
+ "stateMutability": "view",
2932
+ "payable": false,
2933
+ "inputs": [{ "type": "address", "name": "" }],
2934
+ "outputs": [{ "type": "uint8", "name": "" }]
2935
+ }];
2936
+
2937
+ // src/abi/yieldCalculator.abi.ts
2938
+ var yieldCalculatorAbi = [{ "inputs": [], "name": "InvalidInitialization", "type": "error" }, { "inputs": [], "name": "NotInitializing", "type": "error" }, { "inputs": [{ "internalType": "address", "name": "owner", "type": "address" }], "name": "OwnableInvalidOwner", "type": "error" }, { "inputs": [{ "internalType": "address", "name": "account", "type": "address" }], "name": "OwnableUnauthorizedAccount", "type": "error" }, { "anonymous": false, "inputs": [{ "indexed": false, "internalType": "uint32", "name": "updatedApr", "type": "uint32" }, { "indexed": false, "internalType": "uint256", "name": "blockTime", "type": "uint256" }], "name": "AprChanged", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "synthetic", "type": "address" }, { "indexed": false, "internalType": "uint32", "name": "newApr", "type": "uint32" }, { "indexed": false, "internalType": "uint64", "name": "timestamp", "type": "uint64" }], "name": "AprHistoryUpdated", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "synthetic", "type": "address" }, { "indexed": false, "internalType": "uint32", "name": "oldApr", "type": "uint32" }, { "indexed": false, "internalType": "uint32", "name": "newApr", "type": "uint32" }, { "indexed": false, "internalType": "uint256", "name": "timestamp", "type": "uint256" }], "name": "CurrentAprUpdated", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": false, "internalType": "uint64", "name": "version", "type": "uint64" }], "name": "Initialized", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "previousOwner", "type": "address" }, { "indexed": true, "internalType": "address", "name": "newOwner", "type": "address" }], "name": "OwnershipTransferred", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "user", "type": "address" }, { "indexed": true, "internalType": "address", "name": "oldToken", "type": "address" }, { "indexed": true, "internalType": "address", "name": "newToken", "type": "address" }], "name": "YieldStatusChanged", "type": "event" }, { "inputs": [{ "internalType": "address", "name": "", "type": "address" }], "name": "activeYieldToken", "outputs": [{ "internalType": "address", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "synthetic", "type": "address" }, { "internalType": "uint32", "name": "newApr", "type": "uint32" }], "name": "aprChange", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "", "type": "address" }, { "internalType": "uint256", "name": "", "type": "uint256" }], "name": "aprHistory", "outputs": [{ "internalType": "uint32", "name": "apr", "type": "uint32" }, { "internalType": "uint64", "name": "timestamp", "type": "uint64" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "", "type": "address" }], "name": "aprs", "outputs": [{ "internalType": "uint32", "name": "", "type": "uint32" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "components": [{ "internalType": "uint256", "name": "accumulatedYield", "type": "uint256" }, { "internalType": "uint256", "name": "currentBalance", "type": "uint256" }, { "internalType": "uint64", "name": "lastUpdateTime", "type": "uint64" }], "internalType": "struct ISyntheticStructs.UserYield", "name": "user", "type": "tuple" }, { "internalType": "address", "name": "account", "type": "address" }], "name": "calculateCompoundYield", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "user", "type": "address" }], "name": "getActiveYieldToken", "outputs": [{ "internalType": "address", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "synthetic", "type": "address" }], "name": "getAprHistory", "outputs": [{ "components": [{ "internalType": "uint32", "name": "apr", "type": "uint32" }, { "internalType": "uint64", "name": "timestamp", "type": "uint64" }], "internalType": "struct YieldCalculator.AprChange[]", "name": "", "type": "tuple[]" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "synthetic", "type": "address" }], "name": "getCurrentApr", "outputs": [{ "internalType": "uint32", "name": "", "type": "uint32" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_owner", "type": "address" }, { "internalType": "address", "name": "__tokensRegistry", "type": "address" }], "name": "initialize", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "owner", "outputs": [{ "internalType": "address", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "renounceOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "syntheticToken", "type": "address" }], "name": "setActiveYieldToken", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "newOwner", "type": "address" }], "name": "transferOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }];
2939
+
2940
+ // src/abi/executionDelayPolicy.abi.ts
2941
+ var executionDelayPolicyAbi = [
2942
+ {
2943
+ "type": "error",
2944
+ "name": "AlreadyInitialized",
2945
+ "inputs": [
2946
+ {
2947
+ "type": "address",
2948
+ "name": "smartAccount"
2949
+ }
2950
+ ]
2951
+ },
2952
+ {
2953
+ "type": "error",
2954
+ "name": "InvalidInitialization",
2955
+ "inputs": []
2956
+ },
2957
+ {
2958
+ "type": "error",
2959
+ "name": "NotInitialized",
2960
+ "inputs": [
2961
+ {
2962
+ "type": "address",
2963
+ "name": "smartAccount"
2964
+ }
2965
+ ]
2966
+ },
2967
+ {
2968
+ "type": "error",
2969
+ "name": "NotInitializing",
2970
+ "inputs": []
2971
+ },
2972
+ {
2973
+ "type": "event",
2974
+ "anonymous": false,
2975
+ "name": "AccountChangesExecuted",
2976
+ "inputs": [
2977
+ {
2978
+ "type": "bytes16",
2979
+ "name": "parentEntity",
2980
+ "indexed": false
2981
+ },
2982
+ {
2983
+ "type": "address",
2984
+ "name": "account",
2985
+ "indexed": false
2986
+ }
2987
+ ]
2988
+ },
2989
+ {
2990
+ "type": "event",
2991
+ "anonymous": false,
2992
+ "name": "AccountChangesRequested",
2993
+ "inputs": [
2994
+ {
2995
+ "type": "bytes16",
2996
+ "name": "parentEntity",
2997
+ "indexed": false
2998
+ },
2999
+ {
3000
+ "type": "address",
3001
+ "name": "account",
3002
+ "indexed": false
3003
+ }
3004
+ ]
3005
+ },
3006
+ {
3007
+ "type": "event",
3008
+ "anonymous": false,
3009
+ "name": "ErcApprovalExecuted",
3010
+ "inputs": [
3011
+ {
3012
+ "type": "bytes16",
3013
+ "name": "parentEntity",
3014
+ "indexed": false
3015
+ },
3016
+ {
3017
+ "type": "address",
3018
+ "name": "account",
3019
+ "indexed": false
3020
+ },
3021
+ {
3022
+ "type": "address",
3023
+ "name": "token",
3024
+ "indexed": false
3025
+ },
3026
+ {
3027
+ "type": "address",
3028
+ "name": "to",
3029
+ "indexed": false
3030
+ }
3031
+ ]
3032
+ },
3033
+ {
3034
+ "type": "event",
3035
+ "anonymous": false,
3036
+ "name": "ErcWithdrawalExecuted",
3037
+ "inputs": [
3038
+ {
3039
+ "type": "bytes16",
3040
+ "name": "parentEntity",
3041
+ "indexed": false
3042
+ },
3043
+ {
3044
+ "type": "bytes32",
3045
+ "name": "callDataAndNonceHash",
3046
+ "indexed": false
3047
+ }
3048
+ ]
3049
+ },
3050
+ {
3051
+ "type": "event",
3052
+ "anonymous": false,
3053
+ "name": "ErcWithdrawalRequested",
3054
+ "inputs": [
3055
+ {
3056
+ "type": "bytes16",
3057
+ "name": "parentEntity",
3058
+ "indexed": false
3059
+ },
3060
+ {
3061
+ "type": "address",
3062
+ "name": "account",
3063
+ "indexed": false
3064
+ },
3065
+ {
3066
+ "type": "address",
3067
+ "name": "token",
3068
+ "indexed": false
3069
+ },
3070
+ {
3071
+ "type": "address",
3072
+ "name": "to",
3073
+ "indexed": false
3074
+ },
3075
+ {
3076
+ "type": "uint256",
3077
+ "name": "amount",
3078
+ "indexed": false
3079
+ },
3080
+ {
3081
+ "type": "uint48",
3082
+ "name": "validAfter",
3083
+ "indexed": false
3084
+ },
3085
+ {
3086
+ "type": "uint48",
3087
+ "name": "validUntil",
3088
+ "indexed": false
3089
+ },
3090
+ {
3091
+ "type": "bytes32",
3092
+ "name": "callDataAndNonceHash",
3093
+ "indexed": false
3094
+ },
3095
+ {
3096
+ "type": "bytes",
3097
+ "name": "callData",
3098
+ "indexed": false
3099
+ }
3100
+ ]
3101
+ },
3102
+ {
3103
+ "type": "event",
3104
+ "anonymous": false,
3105
+ "name": "Initialized",
3106
+ "inputs": [
3107
+ {
3108
+ "type": "uint64",
3109
+ "name": "version",
3110
+ "indexed": false
3111
+ }
3112
+ ]
3113
+ },
3114
+ {
3115
+ "type": "function",
3116
+ "name": "accountToOwner",
3117
+ "constant": true,
3118
+ "stateMutability": "view",
3119
+ "payable": false,
3120
+ "inputs": [
3121
+ {
3122
+ "type": "address",
3123
+ "name": ""
3124
+ }
3125
+ ],
3126
+ "outputs": [
3127
+ {
3128
+ "type": "address",
3129
+ "name": ""
3130
+ }
3131
+ ]
3132
+ },
3133
+ {
3134
+ "type": "function",
3135
+ "name": "accountToParentEntity",
3136
+ "constant": true,
3137
+ "stateMutability": "view",
3138
+ "payable": false,
3139
+ "inputs": [
3140
+ {
3141
+ "type": "address",
3142
+ "name": ""
3143
+ }
3144
+ ],
3145
+ "outputs": [
3146
+ {
3147
+ "type": "bytes16",
3148
+ "name": ""
3149
+ }
3150
+ ]
3151
+ },
3152
+ {
3153
+ "type": "function",
3154
+ "name": "checkSignaturePolicy",
3155
+ "constant": true,
3156
+ "stateMutability": "view",
3157
+ "payable": false,
3158
+ "inputs": [
3159
+ {
3160
+ "type": "bytes32",
3161
+ "name": "id"
3162
+ },
3163
+ {
3164
+ "type": "address",
3165
+ "name": "sender"
3166
+ },
3167
+ {
3168
+ "type": "bytes32",
3169
+ "name": "hash"
3170
+ },
3171
+ {
3172
+ "type": "bytes",
3173
+ "name": "sig"
3174
+ }
3175
+ ],
3176
+ "outputs": [
3177
+ {
3178
+ "type": "uint256",
3179
+ "name": ""
3180
+ }
3181
+ ]
3182
+ },
3183
+ {
3184
+ "type": "function",
3185
+ "name": "checkUserOpPolicy",
3186
+ "constant": false,
3187
+ "stateMutability": "payable",
3188
+ "payable": true,
3189
+ "inputs": [
3190
+ {
3191
+ "type": "bytes32",
3192
+ "name": "id"
3193
+ },
3194
+ {
3195
+ "type": "tuple",
3196
+ "name": "userOp",
3197
+ "components": [
3198
+ {
3199
+ "type": "address",
3200
+ "name": "sender"
3201
+ },
3202
+ {
3203
+ "type": "uint256",
3204
+ "name": "nonce"
3205
+ },
3206
+ {
3207
+ "type": "bytes",
3208
+ "name": "initCode"
3209
+ },
3210
+ {
3211
+ "type": "bytes",
3212
+ "name": "callData"
3213
+ },
3214
+ {
3215
+ "type": "bytes32",
3216
+ "name": "accountGasLimits"
3217
+ },
3218
+ {
3219
+ "type": "uint256",
3220
+ "name": "preVerificationGas"
3221
+ },
3222
+ {
3223
+ "type": "bytes32",
3224
+ "name": "gasFees"
3225
+ },
3226
+ {
3227
+ "type": "bytes",
3228
+ "name": "paymasterAndData"
3229
+ },
3230
+ {
3231
+ "type": "bytes",
3232
+ "name": "signature"
3233
+ }
3234
+ ]
3235
+ }
3236
+ ],
3237
+ "outputs": [
3238
+ {
3239
+ "type": "uint256",
3240
+ "name": ""
3241
+ }
3242
+ ]
3243
+ },
3244
+ {
3245
+ "type": "function",
3246
+ "name": "init",
3247
+ "constant": false,
3248
+ "payable": false,
3249
+ "inputs": [
3250
+ {
3251
+ "type": "address",
3252
+ "name": "contractRegistry"
3253
+ },
3254
+ {
3255
+ "type": "address",
3256
+ "name": "tokenRegistry"
3257
+ }
3258
+ ],
3259
+ "outputs": []
3260
+ },
3261
+ {
3262
+ "type": "function",
3263
+ "name": "isInitialized",
3264
+ "constant": true,
3265
+ "stateMutability": "view",
3266
+ "payable": false,
3267
+ "inputs": [
3268
+ {
3269
+ "type": "address",
3270
+ "name": "wallet"
3271
+ }
3272
+ ],
3273
+ "outputs": [
3274
+ {
3275
+ "type": "bool",
3276
+ "name": ""
3277
+ }
3278
+ ]
3279
+ },
3280
+ {
3281
+ "type": "function",
3282
+ "name": "isModuleType",
3283
+ "constant": true,
3284
+ "stateMutability": "pure",
3285
+ "payable": false,
3286
+ "inputs": [
3287
+ {
3288
+ "type": "uint256",
3289
+ "name": "id"
3290
+ }
3291
+ ],
3292
+ "outputs": [
3293
+ {
3294
+ "type": "bool",
3295
+ "name": ""
3296
+ }
3297
+ ]
3298
+ },
3299
+ {
3300
+ "type": "function",
3301
+ "name": "onInstall",
3302
+ "constant": false,
3303
+ "stateMutability": "payable",
3304
+ "payable": true,
3305
+ "inputs": [
3306
+ {
3307
+ "type": "bytes",
3308
+ "name": "data"
3309
+ }
3310
+ ],
3311
+ "outputs": []
3312
+ },
3313
+ {
3314
+ "type": "function",
3315
+ "name": "onUninstall",
3316
+ "constant": false,
3317
+ "stateMutability": "payable",
3318
+ "payable": true,
3319
+ "inputs": [
3320
+ {
3321
+ "type": "bytes",
3322
+ "name": "data"
3323
+ }
3324
+ ],
3325
+ "outputs": []
3326
+ },
3327
+ {
3328
+ "type": "function",
3329
+ "name": "operationsPerAccount",
3330
+ "constant": true,
3331
+ "stateMutability": "view",
3332
+ "payable": false,
3333
+ "inputs": [
3334
+ {
3335
+ "type": "bytes32",
3336
+ "name": "callDataAndNonceHash"
3337
+ }
3338
+ ],
3339
+ "outputs": [
3340
+ {
3341
+ "type": "uint8",
3342
+ "name": "opType"
3343
+ },
3344
+ {
3345
+ "type": "uint8",
3346
+ "name": "status"
3347
+ },
3348
+ {
3349
+ "type": "uint48",
3350
+ "name": "validAfter"
3351
+ },
3352
+ {
3353
+ "type": "uint48",
3354
+ "name": "validUntil"
3355
+ }
3356
+ ]
3357
+ },
3358
+ {
3359
+ "type": "function",
3360
+ "name": "request",
3361
+ "constant": false,
3362
+ "payable": false,
3363
+ "inputs": [
3364
+ {
3365
+ "type": "address",
3366
+ "name": "wallet"
3367
+ },
3368
+ {
3369
+ "type": "uint256",
3370
+ "name": "nonce"
3371
+ },
3372
+ {
3373
+ "type": "bytes",
3374
+ "name": "callData"
3375
+ }
3376
+ ],
3377
+ "outputs": [
3378
+ {
3379
+ "type": "uint48",
3380
+ "name": ""
3381
+ }
3382
+ ]
3383
+ },
3384
+ {
3385
+ "type": "function",
3386
+ "name": "setParentEntity",
3387
+ "constant": false,
3388
+ "payable": false,
3389
+ "inputs": [
3390
+ {
3391
+ "type": "address",
3392
+ "name": "account"
3393
+ },
3394
+ {
3395
+ "type": "bytes16",
3396
+ "name": "parentEntity"
3397
+ }
3398
+ ],
3399
+ "outputs": []
3400
+ },
3401
+ {
3402
+ "type": "function",
3403
+ "name": "status",
3404
+ "constant": true,
3405
+ "stateMutability": "view",
3406
+ "payable": false,
3407
+ "inputs": [
3408
+ {
3409
+ "type": "address",
3410
+ "name": ""
3411
+ }
3412
+ ],
3413
+ "outputs": [
3414
+ {
3415
+ "type": "uint8",
3416
+ "name": ""
3417
+ }
3418
+ ]
3419
+ },
3420
+ {
3421
+ "type": "function",
3422
+ "name": "updateDelayConfiguration",
3423
+ "constant": false,
3424
+ "payable": false,
3425
+ "inputs": [
3426
+ {
3427
+ "type": "uint48",
3428
+ "name": "normalDelay"
3429
+ },
3430
+ {
3431
+ "type": "uint48",
3432
+ "name": "longDelay"
3433
+ },
3434
+ {
3435
+ "type": "uint48",
3436
+ "name": "operationValidity"
3437
+ }
3438
+ ],
3439
+ "outputs": []
3440
+ }
3441
+ ];
3442
+
3443
+ // src/abi/signer.abi.ts
3444
+ var signerAbi = [
3445
+ {
3446
+ type: "function",
3447
+ name: "signer",
3448
+ inputs: [
3449
+ { name: "id", type: "bytes32", internalType: "bytes32" },
3450
+ { name: "wallet", type: "address", internalType: "address" }
3451
+ ],
3452
+ outputs: [{ name: "", type: "address", internalType: "address" }],
3453
+ stateMutability: "view"
3454
+ }
3455
+ ];
3456
+
3457
+ // src/modules/crypto/chains/base/account-abstraction.service.ts
3458
+ var BaseAccountAbstractionService = class {
3459
+ constructor(config) {
3460
+ this.publicRpcClient = config.publicRpcClient;
3461
+ this.kernelPublicClient = config.kernelPublicClient;
3462
+ this.contracts = config.contracts;
3463
+ this.walletService = config.walletService;
3464
+ this.logger = config.logger;
3465
+ }
3466
+ async isExecutorInstalled() {
3467
+ const smartWalletClient = await this.walletService.getSmartWalletClientWithoutPolicy();
3468
+ try {
3469
+ const fundsManagementContract = this.contracts.fundsManagement;
3470
+ const res = await this.publicRpcClient.readContract({
3471
+ address: smartWalletClient.account.address,
3472
+ abi: KernelV3_1AccountAbi,
3473
+ functionName: "isModuleInstalled",
3474
+ args: [BigInt(2), fundsManagementContract, "0x"]
3475
+ });
3476
+ return res;
3477
+ } catch (e) {
3478
+ console.error("Error checking if executor is installed:", e);
3479
+ return false;
3480
+ }
3481
+ }
3482
+ async isPolicyInstalled() {
3483
+ const mainWalletClient = await this.walletService.getMainWalletClient();
3484
+ const mainWalletAddress = mainWalletClient?.address;
3485
+ const smartWalletClient = await this.walletService.getSmartWalletClientWithoutPolicy();
3486
+ try {
3487
+ const bytecode = await this.publicRpcClient.getCode({
3488
+ address: smartWalletClient.account.address
3489
+ });
3490
+ if (!bytecode || bytecode === "0x") {
3491
+ return false;
3492
+ }
3493
+ const rootValidatorId = await this.publicRpcClient.readContract({
3494
+ address: smartWalletClient.account.address,
3495
+ abi: KernelV3_1AccountAbi,
3496
+ functionName: "rootValidator"
3497
+ });
3498
+ if (!rootValidatorId || rootValidatorId === "0x") {
3499
+ this.logger?.info("Policy not installed");
3500
+ return false;
3501
+ }
3502
+ const permissionId = "0x" + rootValidatorId.replace("0x", "").slice(2, 10);
3503
+ const permissionConfig = await this.publicRpcClient.readContract({
3504
+ address: smartWalletClient.account.address,
3505
+ abi: KernelV3_1AccountAbi,
3506
+ functionName: "permissionConfig",
3507
+ args: [permissionId]
3508
+ });
3509
+ const { policyData, signer } = permissionConfig;
3510
+ if (policyData.length !== 1) {
3511
+ this.logger?.info("Policy not installed");
3512
+ return false;
3513
+ }
3514
+ const data = policyData[0];
3515
+ const policyAddress = "0x" + data.replace("0x", "").slice(4, 44);
3516
+ const paddedPermissionId = pad(permissionId, {
3517
+ size: 32,
3518
+ dir: "right"
3519
+ });
3520
+ const ownerAddress = await this.publicRpcClient.readContract({
3521
+ address: signer,
3522
+ abi: signerAbi,
3523
+ functionName: "signer",
3524
+ args: [paddedPermissionId, smartWalletClient.account.address]
3525
+ });
3526
+ const executionDelayPolicyContract = await this.contracts.executionDelayPolicy;
3527
+ return policyAddress.toLowerCase() === executionDelayPolicyContract?.toLowerCase() && ownerAddress.toLowerCase() === mainWalletAddress.toLowerCase();
3528
+ } catch (e) {
3529
+ this.logger?.error("Error checking if policy is installed:", e);
3530
+ return false;
3531
+ }
3532
+ }
3533
+ async signInPolicyAndExecutor() {
3534
+ const smartWalletClient = await this.walletService.getSmartWalletClientWithoutPolicy();
3535
+ const executorCallData = await this.getExecutorCallData();
3536
+ const policyCallData = await this.getPolicyCallData();
3537
+ const calls = await smartWalletClient.account.encodeCalls([
3538
+ {
3539
+ to: smartWalletClient.account.address,
3540
+ value: BigInt(0),
3541
+ data: executorCallData
3542
+ },
3543
+ {
3544
+ to: smartWalletClient.account.address,
3545
+ value: BigInt(0),
3546
+ data: policyCallData
3547
+ }
3548
+ ]);
3549
+ return await this.walletService.sendUserOperationsAndWaitReceipt(calls, smartWalletClient);
3550
+ }
3551
+ async signInPolicy() {
3552
+ const smartWalletClient = await this.walletService.getSmartWalletClientWithoutPolicy();
3553
+ const policyCallData = await this.getPolicyCallData();
3554
+ const calls = await smartWalletClient.account.encodeCalls([
3555
+ {
3556
+ to: smartWalletClient.account.address,
3557
+ value: BigInt(0),
3558
+ data: policyCallData
3559
+ }
3560
+ ]);
3561
+ return await this.walletService.sendUserOperationsAndWaitReceipt(calls, smartWalletClient);
3562
+ }
3563
+ async signInExecutor() {
3564
+ const smartWalletClient = await this.walletService.getSmartWalletClientWithoutPolicy();
3565
+ const policyCallData = await this.getExecutorCallData();
3566
+ const calls = await smartWalletClient.account.encodeCalls([
3567
+ {
3568
+ to: smartWalletClient.account.address,
3569
+ value: BigInt(0),
3570
+ data: policyCallData
3571
+ }
3572
+ ]);
3573
+ return await this.walletService.sendUserOperationsAndWaitReceipt(calls, smartWalletClient);
3574
+ }
3575
+ async createExecutionDelayValidator() {
3576
+ const executionDelayPolicyContract = this.contracts.executionDelayPolicy;
3577
+ const rootPolicy = toSudoPolicy({ policyAddress: executionDelayPolicyContract });
3578
+ const smartAccountSigner = await this.walletService.getSmartAccountSigner();
3579
+ const res = await toPermissionValidator(this.kernelPublicClient, {
3580
+ entryPoint: getEntryPoint("0.7"),
3581
+ signer: await toECDSASigner({ signer: smartAccountSigner }),
3582
+ kernelVersion: KERNEL_V3_1,
3583
+ policies: [rootPolicy]
3584
+ });
3585
+ res.address = executionDelayPolicyContract;
3586
+ return res;
3587
+ }
3588
+ async getExecutorCallData() {
3589
+ const initData = concatHex([zeroAddress, zeroHash]);
3590
+ const fundsManagementContract = this.contracts.fundsManagement;
3591
+ return encodeFunctionData({
3592
+ abi: KernelV3_1AccountAbi,
3593
+ functionName: "installModule",
3594
+ args: [BigInt(2), fundsManagementContract, initData]
3595
+ });
3596
+ }
3597
+ async getPolicyCallData() {
3598
+ const validator = await this.createExecutionDelayValidator();
3599
+ const smartWallet = await this.walletService.getSmartWalletClientWithoutPolicy();
3600
+ const rootValidatorId = concatHex([
3601
+ VALIDATOR_TYPE[validator.validatorType],
3602
+ pad(validator.getIdentifier(), {
3603
+ size: 20,
3604
+ dir: "right"
3605
+ })
3606
+ ]);
3607
+ return encodeFunctionData({
3608
+ abi: KernelV3_1AccountAbi,
3609
+ functionName: "changeRootValidator",
3610
+ args: [
3611
+ rootValidatorId,
3612
+ zeroAddress,
3613
+ await validator.getEnableData(smartWallet.account.address),
3614
+ "0x"
3615
+ ]
3616
+ });
3617
+ }
3618
+ };
3619
+ var BaseAccountContractService = class {
3620
+ constructor(config) {
3621
+ this.walletService = config.walletService;
3622
+ this.logger = config.logger;
3623
+ this.companyId = config.companyId;
3624
+ this.publicRpcClient = config.publicRpcClient;
3625
+ this.contracts = config.contracts;
3626
+ }
3627
+ async isWalletInAccounts() {
3628
+ const mainWalletClient = await this.walletService.getMainWalletClient();
3629
+ try {
3630
+ const data = encodeFunctionData({
3631
+ abi: accountsAbi,
3632
+ functionName: "getUserAccount",
3633
+ args: [mainWalletClient?.address, this.companyId]
3634
+ });
3635
+ const result = await this.publicRpcClient.call({
3636
+ to: this.contracts.accounts,
3637
+ data
3638
+ });
3639
+ const decodedResult = decodeFunctionResult({
3640
+ abi: accountsAbi,
3641
+ functionName: "getUserAccount",
3642
+ data: result.data
3643
+ });
3644
+ return decodedResult && decodedResult.status !== 0;
3645
+ } catch (e) {
3646
+ this.logger?.warn("Error checking wallet in accounts contract:", e);
3647
+ return false;
3648
+ }
3649
+ }
3650
+ async isWalletInCorporateAccounts() {
3651
+ const smartWalletClient = await this.walletService.getSmartWalletClient();
3652
+ try {
3653
+ const data = encodeFunctionData({
3654
+ abi: corporateAccountsAbi,
3655
+ functionName: "getCorporation",
3656
+ args: [
3657
+ this.companyId,
3658
+ smartWalletClient.account?.address
3659
+ ]
3660
+ });
3661
+ const result = await this.publicRpcClient.call({
3662
+ to: this.contracts.corporateAccounts,
3663
+ data
3664
+ });
3665
+ const decodedResult = decodeFunctionResult({
3666
+ abi: corporateAccountsAbi,
3667
+ functionName: "getCorporation",
3668
+ data: result.data
3669
+ });
3670
+ return decodedResult && decodedResult.status !== 0;
3671
+ } catch (e) {
3672
+ this.logger?.warn("Error checking wallet in corporate accounts contract:", e);
3673
+ return false;
3674
+ }
3675
+ }
3676
+ async registerInAccounts() {
3677
+ const callData = await this.getCallData();
3678
+ const smartWalletClient = await this.walletService.getSmartWalletClient();
3679
+ const encodedCallData = await smartWalletClient.account.encodeCalls([
3680
+ {
3681
+ to: this.contracts.accounts,
3682
+ value: BigInt(0),
3683
+ data: callData
3684
+ }
3685
+ ]);
3686
+ const receipt = await this.walletService.sendUserOperationsAndWaitReceipt(encodedCallData);
3687
+ if (!receipt) {
3688
+ throw new Error("Unable to register in accounts contract");
3689
+ }
3690
+ return receipt;
3691
+ }
3692
+ async registerInCorporateAccounts() {
3693
+ const callData = await this.getCorporateCallData();
3694
+ const smartWalletClient = await this.walletService.getSmartWalletClient();
3695
+ const encodedCallData = await smartWalletClient.account.encodeCalls([
3696
+ {
3697
+ to: this.contracts.corporateAccounts,
3698
+ value: BigInt(0),
3699
+ data: callData
3700
+ }
3701
+ ]);
3702
+ const receipt = await this.walletService.sendUserOperationsAndWaitReceipt(encodedCallData);
3703
+ if (!receipt) {
3704
+ throw new Error("Unable to register in corporate accounts contract");
3705
+ }
3706
+ return receipt;
3707
+ }
3708
+ async getCorporateCallData() {
3709
+ return encodeFunctionData({
3710
+ abi: corporateAccountsAbi,
3711
+ functionName: "createCorporation",
3712
+ args: [this.companyId]
3713
+ });
3714
+ }
3715
+ async getCallData() {
3716
+ return encodeFunctionData({
3717
+ abi: accountsAbi,
3718
+ functionName: "createUserAccountWithWallet",
3719
+ args: [this.companyId]
3720
+ });
3721
+ }
3722
+ };
3723
+ var BaseCryptoService = class {
3724
+ constructor(config) {
3725
+ this.walletService = config.walletService;
3726
+ this.contracts = config.contracts;
3727
+ this.logger = config.logger;
3728
+ this.tokens = config.tokens;
3729
+ this.withdrawalApi = config.withdrawalApi;
3730
+ }
3731
+ async makeErc20TransferFirstPart(params) {
3732
+ const smartWalletClient = await this.walletService?.getSmartWalletClient();
3733
+ const tokenData = this.tokens.find((token) => token.address === params.tokenAddress);
3734
+ if (!tokenData) {
3735
+ throw new Error("Token not found in token registry. Please check token address");
3736
+ }
3737
+ const baseToken = this.tokens.find((token) => token.address === tokenData?.baseToken?.address);
3738
+ if (!baseToken) {
3739
+ throw new Error("Base token not found in token registry. Please check token address");
3740
+ }
3741
+ const callDataArray = [];
3742
+ const unwrapCallData = await this.generateUnwrapCallData(
3743
+ params.tokenAddress,
3744
+ parseUnits(String(params.amount), tokenData?.decimals ?? 18)
3745
+ );
3746
+ callDataArray.push(unwrapCallData);
3747
+ const erc20TransferCallDetails = await this.ercTransferCall(
3748
+ baseToken?.address,
3749
+ params.recipientAddress,
3750
+ parseUnits(String(params.amount), baseToken?.decimals ?? 18)
3751
+ );
3752
+ callDataArray.push(erc20TransferCallDetails);
3753
+ if (!smartWalletClient.account) {
3754
+ throw new Error("Smart wallet client account is not available.");
3755
+ }
3756
+ const encodedExecutionCalls = await smartWalletClient.account.encodeCalls(callDataArray);
3757
+ const requestCallData = await this.operationRequestCall(encodedExecutionCalls);
3758
+ const requestCalls = await smartWalletClient.account.encodeCalls([requestCallData.call]);
3759
+ const userOpReceipt = await this.walletService.sendUserOperationsAndWaitReceipt(requestCalls);
3760
+ if (!userOpReceipt.success) {
3761
+ throw new Error(
3762
+ `ERC20 Transfer Execution UserOperation failed: userOpHash=${userOpReceipt.userOpHash}, tx=${userOpReceipt.receipt.transactionHash}, reason=${userOpReceipt.reason ?? "unknown (likely out of gas)"}`
3763
+ );
3764
+ }
3765
+ return userOpReceipt.receipt.transactionHash;
3766
+ }
3767
+ async makeErc20TransferFinal(withdrawalCallData) {
3768
+ const callData = "0x" + withdrawalCallData;
3769
+ const nonce = await this.getCustomNonceToFinishRequest(callData);
3770
+ const userOpReceipt = await this.walletService.sendUserOperationsWithNonceAndWaitReceipt(
3771
+ callData,
3772
+ nonce
3773
+ );
3774
+ if (!userOpReceipt.success) {
3775
+ throw new Error(
3776
+ `ERC20 Transfer Execution UserOperation failed: userOpHash=${userOpReceipt.userOpHash}, tx=${userOpReceipt.receipt.transactionHash}, reason=${userOpReceipt.reason ?? "unknown (likely out of gas)"}`
3777
+ );
3778
+ }
3779
+ return userOpReceipt.receipt.transactionHash;
3780
+ }
3781
+ async makeErc20TransferFull(params) {
3782
+ const smartWalletClient = await this.walletService.getSmartWalletClient();
3783
+ const tokenData = this.tokens.find((token) => token.address === params.tokenAddress);
3784
+ if (!tokenData) {
3785
+ throw new Error("Token not found in token registry. Please check token address");
3786
+ }
3787
+ const baseToken = this.tokens.find((token) => token.address === tokenData?.baseToken?.address);
3788
+ if (!baseToken) {
3789
+ throw new Error("Base token not found in token registry. Please check token address");
3790
+ }
3791
+ if (!smartWalletClient.account) {
3792
+ throw new Error("Smart wallet client account is not available.");
3793
+ }
3794
+ const unwrapCallData = await this.generateUnwrapCallData(
3795
+ params.tokenAddress,
3796
+ parseUnits(String(params.amount), tokenData?.decimals ?? 18)
3797
+ );
3798
+ const erc20TransferCallDetails = await this.ercTransferCall(
3799
+ baseToken.address,
3800
+ params.recipientAddress,
3801
+ parseUnits(String(params.amount), baseToken?.decimals ?? 18)
3802
+ );
3803
+ const encodedExecutionCalls = await smartWalletClient.account.encodeCalls([
3804
+ unwrapCallData,
3805
+ erc20TransferCallDetails
3806
+ ]);
3807
+ const requestCallData = await this.operationRequestCall(encodedExecutionCalls);
3808
+ const requestCalls = await smartWalletClient.account.encodeCalls([requestCallData.call]);
3809
+ const requestUserOpReceipt = await this.walletService.sendUserOperationsAndWaitReceipt(
3810
+ requestCalls,
3811
+ void 0,
3812
+ { waitOnChainBlocks: 4 }
3813
+ );
3814
+ if (!requestUserOpReceipt.success) {
3815
+ throw new Error(
3816
+ `ERC20 Transfer Request UserOperation failed: userOpHash=${requestUserOpReceipt.userOpHash}, tx=${requestUserOpReceipt.receipt.transactionHash}, reason=${requestUserOpReceipt.reason ?? "unknown (likely out of gas)"}`
3817
+ );
3818
+ }
3819
+ const nonce = await this.getCustomNonceToFinishRequest(encodedExecutionCalls);
3820
+ const userOpReceipt = await this.walletService.sendUserOperationsWithNonceAndWaitReceipt(
3821
+ encodedExecutionCalls,
3822
+ nonce
3823
+ );
3824
+ if (!userOpReceipt.success) {
3825
+ throw new Error(
3826
+ `ERC20 Transfer Execution UserOperation failed: userOpHash=${userOpReceipt.userOpHash}, tx=${userOpReceipt.receipt.transactionHash}, reason=${userOpReceipt.reason ?? "unknown (likely out of gas)"}`
3827
+ );
3828
+ }
3829
+ return userOpReceipt.receipt.transactionHash;
3830
+ }
3831
+ async makeErc20TransferSynthetic(params) {
3832
+ const smartWalletClient = await this.walletService.getSmartWalletClient();
3833
+ const tokenData = this.tokens.find((token) => token.address === params.tokenAddress);
3834
+ if (!smartWalletClient.account) {
3835
+ throw new Error("Smart wallet client account is not available.");
3836
+ }
3837
+ const erc20TransferCallDetails = await this.ercTransferCall(
3838
+ params.tokenAddress,
3839
+ params.recipientAddress,
3840
+ parseUnits(String(params.amount), tokenData?.decimals ?? 18)
3841
+ );
3842
+ const encodedExecutionCalls = await smartWalletClient.account.encodeCalls([
3843
+ erc20TransferCallDetails
3844
+ ]);
3845
+ const userOpReceipt = await this.walletService.sendUserOperationsAndWaitReceipt(encodedExecutionCalls);
3846
+ if (!userOpReceipt.success) {
3847
+ throw new Error(
3848
+ `ERC20 Transfer Execution UserOperation failed: userOpHash=${userOpReceipt.userOpHash}, tx=${userOpReceipt.receipt.transactionHash}, reason=${userOpReceipt.reason ?? "unknown (likely out of gas)"}`
3849
+ );
3850
+ }
3851
+ return new Promise((resolve) => {
3852
+ setTimeout(() => {
3853
+ resolve(userOpReceipt.receipt.transactionHash);
3854
+ }, 2e3);
3855
+ });
3856
+ }
3857
+ async makeFullErc20Transfer(params) {
3858
+ if (!this.withdrawalApi) {
3859
+ throw new Error("Withdrawal API is required for full ERC20 transfer");
3860
+ }
3861
+ const authService = AuthService.getInstance();
3862
+ authService.ensureAuthenticated();
3863
+ const firstPartTxHash = await this.makeErc20TransferFirstPart({
3864
+ tokenAddress: params.tokenAddress,
3865
+ recipientAddress: params.recipientAddress,
3866
+ amount: params.amount
3867
+ });
3868
+ this.logger?.info("First part of ERC20 transfer completed", { txHash: firstPartTxHash });
3869
+ await this.delay(6e3);
3870
+ const withdrawalRequests = await this.withdrawalApi.getWithdrawalRequests();
3871
+ if (!withdrawalRequests || withdrawalRequests.length === 0) {
3872
+ throw new Error("No withdrawal requests found after first part of transfer");
3873
+ }
3874
+ const tokenData = this.tokens.find((token) => token.address === params.tokenAddress);
3875
+ if (!tokenData) {
3876
+ throw new Error("Token not found in token registry");
3877
+ }
3878
+ const baseToken = this.tokens.find((token) => token.address === tokenData.baseToken?.address);
3879
+ if (!baseToken) {
3880
+ throw new Error("Base token not found in token registry");
3881
+ }
3882
+ const withdrawalRequest = withdrawalRequests.find(
3883
+ (req) => req.to_address === params.recipientAddress && req.token_address === baseToken.address && req.amount === params.amount
3884
+ );
3885
+ if (!withdrawalRequest) {
3886
+ throw new Error("No pending withdrawal request found");
3887
+ }
3888
+ const now = /* @__PURE__ */ new Date();
3889
+ const validAfterDate = new Date(withdrawalRequest.valid_after);
3890
+ if (validAfterDate > now) {
3891
+ const waitTime = validAfterDate.getTime() - now.getTime();
3892
+ this.logger?.info(`Waiting ${waitTime}ms until valid_after time`, {
3893
+ validAfter: withdrawalRequest.valid_after,
3894
+ now: now.toISOString()
3895
+ });
3896
+ await this.delay(waitTime + 1e3);
3897
+ }
3898
+ const finalReceipt = await this.makeErc20TransferFinal(withdrawalRequest.call_data);
3899
+ this.logger?.info("Full ERC20 transfer completed successfully");
3900
+ return {
3901
+ firstPartTxHash,
3902
+ finalTxHash: finalReceipt,
3903
+ success: true
3904
+ };
3905
+ }
3906
+ async makeTransferWithoutDelayPolicy(params) {
3907
+ const smartWalletClient = await this.walletService.getSmartWalletClient();
3908
+ const tokenData = this.tokens.find((token) => token.address === params.tokenAddress);
3909
+ if (!tokenData) {
3910
+ throw new Error("Token not found in token registry. Please check token address");
3911
+ }
3912
+ const baseToken = this.tokens.find((token) => token.address === tokenData.baseToken?.address);
3913
+ if (!baseToken) {
3914
+ throw new Error("Base token not found in token registry. Please check token address");
3915
+ }
3916
+ if (!smartWalletClient.account) {
3917
+ throw new Error("Smart wallet client account is not available.");
3918
+ }
3919
+ const unwrapCallData = await this.generateUnwrapCallData(
3920
+ params.tokenAddress,
3921
+ parseUnits(params.amount, tokenData.decimals ?? 18)
3922
+ );
3923
+ const erc20TransferCallDetails = await this.ercTransferCall(
3924
+ baseToken.address,
3925
+ params.recipientAddress,
3926
+ parseUnits(params.amount, baseToken.decimals ?? 18)
3927
+ );
3928
+ const encodedExecutionCalls = await smartWalletClient.account.encodeCalls([
3929
+ unwrapCallData,
3930
+ erc20TransferCallDetails
3931
+ ]);
3932
+ const userOpReceipt = await this.walletService.sendUserOperationsAndWaitReceipt(encodedExecutionCalls);
3933
+ if (!userOpReceipt.success) {
3934
+ throw new Error(
3935
+ `ERC20 Unwrap Transfer UserOperation failed: userOpHash=${userOpReceipt.userOpHash}, tx=${userOpReceipt.receipt.transactionHash}, reason=${userOpReceipt.reason ?? "unknown (likely out of gas)"}`
3936
+ );
3937
+ }
3938
+ return userOpReceipt.receipt.transactionHash;
3939
+ }
3940
+ delay(ms) {
3941
+ return new Promise((resolve) => setTimeout(resolve, ms));
3942
+ }
3943
+ async batchTransfer({ responses, tokenAddress }) {
3944
+ const smartWalletClient = await this.walletService.getSmartWalletClient();
3945
+ const transactionHashes = [];
3946
+ for (const response of responses) {
3947
+ const transactionIdBytes16 = this.convertGuidToBytes16(response.transaction_id);
3948
+ const operationIdBytes16 = this.convertGuidToBytes16(response.operation_id);
3949
+ const recipients = response.crypto_transfers.map(
3950
+ (transfer) => transfer.address
3951
+ );
3952
+ const amounts = response.crypto_transfers.map((transfer) => BigInt(transfer.precise_amount));
3953
+ const callData = await this.generateBatchTransferCallData(
3954
+ transactionIdBytes16,
3955
+ operationIdBytes16,
3956
+ tokenAddress,
3957
+ recipients,
3958
+ amounts
3959
+ );
3960
+ if (!smartWalletClient.account) {
3961
+ throw new Error("Smart wallet client account is not available.");
3962
+ }
3963
+ const encodedCall = await smartWalletClient.account.encodeCalls([callData]);
3964
+ const nonce = await this.getCustomNonceToFinishRequest(encodedCall);
3965
+ const userOpReceipt = await this.walletService.sendUserOperationsWithNonceAndWaitReceipt(
3966
+ encodedCall,
3967
+ nonce
3968
+ );
3969
+ if (!userOpReceipt.success) {
3970
+ throw new Error(
3971
+ `Bulk transfer execution failed for transaction ${response.transaction_id}: userOpHash=${userOpReceipt.userOpHash}, tx=${userOpReceipt.receipt.transactionHash}, reason=${userOpReceipt.reason ?? "unknown (likely out of gas)"}`
3972
+ );
3973
+ }
3974
+ transactionHashes.push(userOpReceipt.receipt.transactionHash);
3975
+ }
3976
+ return transactionHashes;
3977
+ }
3978
+ async getCustomNonceToFinishRequest(callData) {
3979
+ const smartWalletClient = await this.walletService.getSmartWalletClient();
3980
+ const nonceKey = keccak256(callData);
3981
+ const customNonce = getCustomNonceKeyFromString(nonceKey, "0.7");
3982
+ return await smartWalletClient.account.getNonce({ key: customNonce });
3983
+ }
3984
+ convertGuidToBytes16(guid) {
3985
+ const guidHex = `0x${guid.replace(/-/g, "")}`;
3986
+ return pad(guidHex, { size: 16 });
3987
+ }
3988
+ async ercTransferCall(token, recipientAddress, amount) {
3989
+ const callData = encodeFunctionData({
3990
+ abi: erc20Abi,
3991
+ functionName: "transfer",
3992
+ args: [recipientAddress, amount]
3993
+ });
3994
+ return {
3995
+ to: token,
3996
+ value: BigInt(0),
3997
+ data: callData
3998
+ };
3999
+ }
4000
+ async operationRequestCall(callData) {
4001
+ const smartWalletClient = await this.walletService.getSmartWalletClient();
4002
+ const executionDelayPolicyContract = this.contracts?.executionDelayPolicy;
4003
+ const nonceKey = keccak256(callData);
4004
+ const customNonce = getCustomNonceKeyFromString(nonceKey, "0.7");
4005
+ const nonce = await smartWalletClient.account.getNonce({ key: customNonce });
4006
+ const requestCallData = encodeFunctionData({
4007
+ abi: executionDelayPolicyAbi,
4008
+ functionName: "request",
4009
+ args: [smartWalletClient.account?.address, nonce, callData]
4010
+ });
4011
+ return {
4012
+ call: {
4013
+ to: executionDelayPolicyContract,
4014
+ value: BigInt(0),
4015
+ data: requestCallData
4016
+ },
4017
+ hasCustomNonce: true
4018
+ };
4019
+ }
4020
+ async generateUnwrapCallData(token, amount) {
4021
+ const callData = encodeFunctionData({
4022
+ abi: syntheticAbi,
4023
+ functionName: "withdraw",
4024
+ args: [amount]
4025
+ });
4026
+ return {
4027
+ to: token,
4028
+ value: BigInt(0),
4029
+ data: callData
4030
+ };
4031
+ }
4032
+ async generateBatchTransferCallData(transactionId, operationId, tokenAddress, recipients, amounts) {
4033
+ const fundsManagementContract = this.contracts?.fundsManagement;
4034
+ const callData = encodeFunctionData({
4035
+ abi: fundsManagementAbi,
4036
+ functionName: "executeOutgoingBatchTransaction",
4037
+ args: [transactionId, operationId, tokenAddress, recipients, amounts]
4038
+ });
4039
+ return {
4040
+ to: fundsManagementContract,
4041
+ value: BigInt(0),
4042
+ data: callData
4043
+ };
4044
+ }
4045
+ };
4046
+ var BaseWalletService = class {
4047
+ constructor(config) {
4048
+ this.bundlerTransport = config.bundlerTransport;
4049
+ this.kernelPaymasterClient = config.kernelPaymasterClient;
4050
+ this.kernelPublicClient = config.kernelPublicClient;
4051
+ this.contracts = config.contracts;
4052
+ this.chain = config.chain;
4053
+ this.logger = config.logger;
4054
+ this._getMainWalletClient = config.getMainWalletClient;
4055
+ }
4056
+ async getSmartWalletClientWithoutPolicy() {
4057
+ const smartAccountSigner = await this.getSmartAccountSigner();
4058
+ const simpleValidator = await this.createSimpleValidator(smartAccountSigner);
4059
+ const simpleSmartWalletClient = await this.createKernelClient(simpleValidator);
4060
+ if (!this.smartAddress) {
4061
+ const address = simpleSmartWalletClient.account?.address;
4062
+ if (!address) {
4063
+ throw new Error("Failed to create smart wallet: account address is undefined");
4064
+ }
4065
+ this.smartAddress = address;
4066
+ }
4067
+ return simpleSmartWalletClient;
4068
+ }
4069
+ async getSmartWalletClient() {
4070
+ if (this.smartWalletClient) {
4071
+ return this.smartWalletClient;
4072
+ }
4073
+ const validator = await this.createExecutionDelayValidator();
4074
+ const smartWalletAddress = await this.getSmartWalletAddress();
4075
+ return this.smartWalletClient = await this.createKernelClient(validator, smartWalletAddress);
4076
+ }
4077
+ async getSmartWalletAddress() {
4078
+ if (this.smartAddress) {
4079
+ return this.smartAddress;
4080
+ }
4081
+ const simpleSmartWalletClient = await this.getSmartWalletClientWithoutPolicy();
4082
+ const address = simpleSmartWalletClient.account?.address;
4083
+ if (!address) {
4084
+ throw new Error("Failed to resolve smart wallet address: account address is undefined");
4085
+ }
4086
+ this.smartAddress = address;
4087
+ return this.smartAddress;
4088
+ }
4089
+ async getMainWalletClient() {
4090
+ return await this._getMainWalletClient();
4091
+ }
4092
+ async getSmartAccountSigner() {
4093
+ if (this.smartAccountSigner) {
4094
+ return this.smartAccountSigner;
4095
+ }
4096
+ const mainWalletClient = await this.getMainWalletClient();
4097
+ const nativeProvider = await mainWalletClient.getEthereumProvider();
4098
+ if (!nativeProvider) {
4099
+ throw new Error("Ethereum provider not available");
4100
+ }
4101
+ this.smartAccountSigner = createWalletClient({
4102
+ chain: this.chain,
4103
+ transport: custom(nativeProvider)
4104
+ });
4105
+ return this.smartAccountSigner;
4106
+ }
4107
+ async sendUserOperationsAndWaitReceipt(callData, smartWalletClient, config) {
4108
+ if (!smartWalletClient) {
4109
+ smartWalletClient = await this.getSmartWalletClient();
4110
+ }
4111
+ if (!smartWalletClient) {
4112
+ throw new Error("Smart wallet client is not available.");
4113
+ }
4114
+ try {
4115
+ const trxHash = await smartWalletClient.sendUserOperation({ callData });
4116
+ const result = await smartWalletClient.waitForUserOperationReceipt({
4117
+ hash: trxHash,
4118
+ timeout: 30 * 1e3
4119
+ });
4120
+ if (config?.waitOnChainBlocks) {
4121
+ await this.kernelPublicClient.waitForTransactionReceipt({
4122
+ hash: result.receipt.transactionHash,
4123
+ confirmations: config.waitOnChainBlocks
4124
+ });
4125
+ }
4126
+ return result;
4127
+ } catch (error) {
4128
+ this.logger?.error("Error in sendUserOperationsAndWaitReceipt:", error);
4129
+ throw error;
4130
+ }
4131
+ }
4132
+ async sendUserOperationsWithNonceAndWaitReceipt(callData, nonce) {
4133
+ const smartWalletClient = await this.getSmartWalletClient();
4134
+ const trxHash = await smartWalletClient.sendUserOperation({ callData, nonce });
4135
+ return await smartWalletClient.waitForUserOperationReceipt({
4136
+ hash: trxHash,
4137
+ timeout: 30 * 1e3
4138
+ });
4139
+ }
4140
+ invalidateLocalCache() {
4141
+ this.smartWalletClient = void 0;
4142
+ this.smartAddress = void 0;
4143
+ this.smartAccountSigner = void 0;
4144
+ }
4145
+ async createSimpleValidator(signer) {
4146
+ return await signerToEcdsaValidator(this.kernelPublicClient, {
4147
+ signer,
4148
+ entryPoint: getEntryPoint("0.7"),
4149
+ kernelVersion: KERNEL_V3_1
4150
+ });
4151
+ }
4152
+ async createKernelClient(validator, address) {
4153
+ const baseConfig = {
4154
+ entryPoint: getEntryPoint("0.7"),
4155
+ kernelVersion: KERNEL_V3_1,
4156
+ plugins: {
4157
+ sudo: validator
4158
+ },
4159
+ ...address && { address }
4160
+ };
4161
+ const kernelAccount = await createKernelAccount(this.kernelPublicClient, baseConfig);
4162
+ return createKernelAccountClient({
4163
+ account: kernelAccount,
4164
+ chain: this.chain,
4165
+ bundlerTransport: this.bundlerTransport,
4166
+ paymaster: {
4167
+ getPaymasterData: (userOperation) => {
4168
+ return this.kernelPaymasterClient.sponsorUserOperation({ userOperation });
4169
+ }
4170
+ }
4171
+ });
4172
+ }
4173
+ async createExecutionDelayValidator() {
4174
+ const executionDelayPolicyContract = await this.contracts.executionDelayPolicy;
4175
+ const rootPolicy = toSudoPolicy({ policyAddress: executionDelayPolicyContract });
4176
+ const res = await toPermissionValidator(this.kernelPublicClient, {
4177
+ entryPoint: getEntryPoint("0.7"),
4178
+ signer: await toECDSASigner({ signer: await this.getSmartAccountSigner() }),
4179
+ kernelVersion: KERNEL_V3_1,
4180
+ policies: [rootPolicy]
4181
+ });
4182
+ res.address = executionDelayPolicyContract;
4183
+ return res;
4184
+ }
4185
+ };
4186
+ var BaseYieldService = class {
4187
+ constructor(config) {
4188
+ this.BLOCKS_PER_SECOND = 0.5;
4189
+ this.publicClient = config.publicClient;
4190
+ this.walletService = config.walletService;
4191
+ this.contracts = config.contracts;
4192
+ this.tokens = config.tokens;
4193
+ }
4194
+ async fetchYieldData() {
4195
+ const [currentPendingYield, apr, weeklyYield, totalClaimed] = await Promise.all([
4196
+ this.fetchUserPendingYield(),
4197
+ this.getApr(),
4198
+ this.getWeeklyYield(),
4199
+ this.getTotalClaimedYield()
4200
+ ]);
4201
+ const syntheticToken = await this.getSyntheticTokenInfo();
4202
+ return {
4203
+ apy: Number(apr) / 100,
4204
+ currentPendingYield: this.toFullBalance(
4205
+ currentPendingYield?.accumulatedYield,
4206
+ syntheticToken.decimals
4207
+ ),
4208
+ weeklyYield,
4209
+ lifeTimeYield: this.toFullBalance(
4210
+ totalClaimed + currentPendingYield?.accumulatedYield,
4211
+ syntheticToken.decimals
4212
+ )
4213
+ };
4214
+ }
4215
+ async getYieldDataForGraphic() {
4216
+ const eventsForMonth = await this.fetchUserYieldEvents();
4217
+ return this.processYieldEvents(eventsForMonth);
4218
+ }
4219
+ async getWeeklyYield() {
4220
+ const [currentPendingYield, apr] = await Promise.all([
4221
+ this.fetchUserPendingYield(),
4222
+ this.getApr()
4223
+ ]);
4224
+ const syntheticToken = await this.getSyntheticTokenInfo();
4225
+ const weekAfter = this.now() + BigInt(7 * 24 * 60 * 60);
4226
+ const calculatedWeekYield = await this.calculateYieldByWeek(
4227
+ currentPendingYield?.lastBalance,
4228
+ currentPendingYield?.accumulatedYield,
4229
+ this.now(),
4230
+ weekAfter,
4231
+ apr
4232
+ );
4233
+ return this.toFullBalance(calculatedWeekYield, syntheticToken.decimals);
4234
+ }
4235
+ async switchYieldToken(token) {
4236
+ const smartWalletClient = await this.walletService.getSmartWalletClient();
4237
+ const claimCallData = await this.generateCallDataFoSwitchToken(token);
4238
+ const encodedExecutionCalls = await smartWalletClient.account.encodeCalls([claimCallData]);
4239
+ const { receipt: executeReceipt } = await this.walletService.sendUserOperationsAndWaitReceipt(encodedExecutionCalls);
4240
+ if (executeReceipt.success === false) {
4241
+ throw new Error("Switching yield token failed");
4242
+ }
4243
+ this.syntheticToken = void 0;
4244
+ this.apr = void 0;
4245
+ }
4246
+ async withdraw() {
4247
+ const smartWalletClient = await this.walletService.getSmartWalletClient();
4248
+ const claimCallData = await this.generateClaimCallData();
4249
+ const encodedExecutionCalls = await smartWalletClient.account.encodeCalls([claimCallData]);
4250
+ const { receipt: executeReceipt } = await this.walletService.sendUserOperationsAndWaitReceipt(encodedExecutionCalls);
4251
+ if (executeReceipt.success === false) {
4252
+ throw new Error("Claimed yield failed");
4253
+ }
4254
+ }
4255
+ async generateClaimCallData() {
4256
+ const syntheticInYield = await this.getSyntheticTokenInfo();
4257
+ if (!syntheticInYield) {
4258
+ throw new Error("Synthetic token not found in yield");
4259
+ }
4260
+ const callData = encodeFunctionData({
4261
+ abi: syntheticAbi,
4262
+ functionName: "claimYield"
4263
+ });
4264
+ return {
4265
+ to: syntheticInYield.address,
4266
+ value: BigInt(0),
4267
+ data: callData
4268
+ };
4269
+ }
4270
+ async generateCallDataFoSwitchToken(token) {
4271
+ const yieldCalculatorContract = this.contracts.yieldCalculator;
4272
+ if (!yieldCalculatorContract) {
4273
+ throw new Error("Yield calculator contract not found");
4274
+ }
4275
+ const callData = encodeFunctionData({
4276
+ abi: yieldCalculatorAbi,
4277
+ functionName: "setActiveYieldToken",
4278
+ args: [token.address]
4279
+ });
4280
+ return {
4281
+ to: yieldCalculatorContract,
4282
+ value: BigInt(0),
4283
+ data: callData
4284
+ };
4285
+ }
4286
+ async processYieldEvents(events, daysPeriod = 7) {
4287
+ const currentPendingYield = await this.fetchUserPendingYield();
4288
+ const syntheticToken = await this.getSyntheticTokenInfo();
4289
+ const apr = await this.getApr();
4290
+ const yieldByPeriod = [];
4291
+ if (events.length === 0 && currentPendingYield.accumulatedYield === BigInt(0)) {
4292
+ return [];
4293
+ }
4294
+ if (events.length === 1 && this.toFullBalance(currentPendingYield.accumulatedYield, syntheticToken.decimals) === "0") {
4295
+ return [];
4296
+ }
4297
+ if (events.length === 0 && currentPendingYield.accumulatedYield !== BigInt(0)) {
4298
+ const timestampPeriodAgo = this.now() - BigInt(daysPeriod * 24 * 60 * 60);
4299
+ const calculatedYield = await this.calculateYieldByWeek(
4300
+ currentPendingYield.lastBalance,
4301
+ currentPendingYield.accumulatedYield,
4302
+ timestampPeriodAgo,
4303
+ this.now(),
4304
+ apr
4305
+ );
4306
+ yieldByPeriod.push({
4307
+ timestamp: Number(timestampPeriodAgo),
4308
+ yield: this.toFullBalance(
4309
+ currentPendingYield.accumulatedYield - calculatedYield,
4310
+ syntheticToken.decimals
4311
+ )
4312
+ });
4313
+ }
4314
+ const sortedEvents = events.sort((a, b) => Number(a.lastUpdateTime - b.lastUpdateTime));
4315
+ for (let i = 0; i < sortedEvents.length; i++) {
4316
+ const event = sortedEvents[i];
4317
+ if (i === 0 && event.isYieldActive) {
4318
+ yieldByPeriod.push({
4319
+ timestamp: Number(event.lastUpdateTime),
4320
+ yield: this.toFullBalance(event.accumulatedYield, syntheticToken.decimals)
4321
+ });
4322
+ }
4323
+ if (!event.isYieldActive) {
4324
+ yieldByPeriod.push({
4325
+ timestamp: Number(event.lastUpdateTime)
4326
+ });
4327
+ continue;
4328
+ }
4329
+ if (event.isYieldActive && events[i - 1] && !events[i - 1].isYieldActive) {
4330
+ yieldByPeriod.push({
4331
+ timestamp: Number(event.lastUpdateTime),
4332
+ yield: this.toFullBalance(event.accumulatedYield, syntheticToken.decimals)
4333
+ });
4334
+ }
4335
+ if (sortedEvents[i + 1]) {
4336
+ const calculatedYieldBetweenPeriods = await this.calculateYieldByWeek(
4337
+ event.currentBalance,
4338
+ event.accumulatedYield,
4339
+ event.lastUpdateTime,
4340
+ sortedEvents[i + 1].lastUpdateTime,
4341
+ apr
4342
+ );
4343
+ if (calculatedYieldBetweenPeriods + event.accumulatedYield > sortedEvents[i + 1].accumulatedYield) {
4344
+ yieldByPeriod.push({
4345
+ timestamp: Number(event.lastUpdateTime),
4346
+ yield: this.toFullBalance(
4347
+ calculatedYieldBetweenPeriods + event.accumulatedYield,
4348
+ syntheticToken.decimals
4349
+ )
4350
+ });
4351
+ }
4352
+ yieldByPeriod.push({
4353
+ timestamp: Number(sortedEvents[i + 1].lastUpdateTime),
4354
+ yield: this.toFullBalance(sortedEvents[i + 1].accumulatedYield, syntheticToken.decimals)
4355
+ });
4356
+ }
4357
+ }
4358
+ yieldByPeriod.push({
4359
+ timestamp: Number(this.now()),
4360
+ yield: this.toFullBalance(currentPendingYield.accumulatedYield, syntheticToken.decimals)
4361
+ });
4362
+ return yieldByPeriod;
4363
+ }
4364
+ calculateYield(balance, accumulatedYield, startPeriod, endPeriod, apr) {
4365
+ const precision = BigInt("1000000000000000000");
4366
+ const basisPoints = BigInt(1e4);
4367
+ const dailyRateScaled = apr * precision / (basisPoints * BigInt(365));
4368
+ const secondsElapsed = endPeriod - startPeriod;
4369
+ const daysElapsedScaled = secondsElapsed * precision / BigInt(86400);
4370
+ const growthMinusOne = daysElapsedScaled * dailyRateScaled / precision;
4371
+ const totalBalance = balance + accumulatedYield;
4372
+ return totalBalance * growthMinusOne / precision;
4373
+ }
4374
+ async calculateYieldByWeek(balance, accumulatedYield, startPeriod, endPeriod, apr) {
4375
+ const precision = BigInt("1000000000000000000");
4376
+ const basisPoints = BigInt(1e4);
4377
+ const timePassed = endPeriod - startPeriod;
4378
+ const weeklyRate = apr * precision / (BigInt(52) * basisPoints);
4379
+ const fullWeeks = timePassed / BigInt(604800);
4380
+ const fractionalWeek = timePassed % BigInt(604800) * precision / BigInt(604800);
4381
+ const base = precision + weeklyRate;
4382
+ const fullPeriodsFactor = this.power(base, fullWeeks, precision);
4383
+ const fractionalFactor = precision + weeklyRate * fractionalWeek / precision;
4384
+ const compoundFactor = fullPeriodsFactor * fractionalFactor / precision;
4385
+ if (compoundFactor <= precision) {
4386
+ return BigInt(0);
4387
+ }
4388
+ const yieldMultiplier = compoundFactor - precision;
4389
+ return (balance + accumulatedYield) * yieldMultiplier / precision;
4390
+ }
4391
+ power(x, n, precision) {
4392
+ if (n == BigInt(0)) return precision;
4393
+ if (n == BigInt(1)) return x;
4394
+ let result = precision;
4395
+ let base = x;
4396
+ while (n > BigInt(0)) {
4397
+ if (n % BigInt(2) == BigInt(1)) {
4398
+ result = result * base / precision;
4399
+ }
4400
+ base = base * base / precision;
4401
+ n /= BigInt(2);
4402
+ }
4403
+ return result;
4404
+ }
4405
+ async fetchUserPendingYield() {
4406
+ const syntheticInYield = await this.getSyntheticTokenInfo();
4407
+ const smartWalletClient = await this.walletService.getSmartWalletClient();
4408
+ const smartWalletAddress = smartWalletClient.account?.address;
4409
+ return await this.publicClient.readContract({
4410
+ address: syntheticInYield?.address,
4411
+ abi: syntheticAbi,
4412
+ functionName: "pendingYield",
4413
+ args: [smartWalletAddress]
4414
+ });
4415
+ }
4416
+ async getApr() {
4417
+ if (this.apr) return this.apr;
4418
+ const calculatorContract = this.contracts.yieldCalculator;
4419
+ const syntheticInYield = await this.getSyntheticTokenInfo();
4420
+ const apr = await this.publicClient.readContract({
4421
+ address: calculatorContract,
4422
+ abi: yieldCalculatorAbi,
4423
+ functionName: "aprs",
4424
+ args: [syntheticInYield?.address]
4425
+ });
4426
+ this.apr = BigInt(apr);
4427
+ return this.apr;
4428
+ }
4429
+ async fetchUserYieldEvents(days = 7, toBlock = null) {
4430
+ try {
4431
+ const currentBlockNumber = await this.publicClient.getBlockNumber();
4432
+ const actualToBlock = toBlock ?? currentBlockNumber;
4433
+ const blocksInDaysPeriod = BigInt(Math.floor(days * 24 * 60 * 60 * this.BLOCKS_PER_SECOND));
4434
+ const fromBlock = actualToBlock > blocksInDaysPeriod ? actualToBlock - blocksInDaysPeriod : BigInt(0);
4435
+ const smartWalletClient = await this.walletService.getSmartWalletClient();
4436
+ const smartWalletAddress = smartWalletClient.account?.address;
4437
+ const syntheticInYield = await this.getSyntheticTokenInfo();
4438
+ const logs = await this.publicClient.getLogs({
4439
+ address: syntheticInYield?.address,
4440
+ event: parseAbiItem(
4441
+ "event UserYieldChanged(address indexed user, uint256 accumulatedYield, uint256 lastBalance, uint256 currentBalance, uint64 lastUpdateTime, bool isYieldActive)"
4442
+ ),
4443
+ fromBlock,
4444
+ toBlock: toBlock ?? currentBlockNumber,
4445
+ ...smartWalletAddress && {
4446
+ args: {
4447
+ user: smartWalletAddress
4448
+ }
4449
+ }
4450
+ });
4451
+ return logs.map((log) => ({
4452
+ accumulatedYield: log.args?.accumulatedYield,
4453
+ lastBalance: log.args?.lastBalance,
4454
+ lastUpdateTime: log.args?.lastUpdateTime,
4455
+ blockNumber: log.blockNumber,
4456
+ currentBalance: log.args?.currentBalance,
4457
+ isYieldActive: log.args?.isYieldActive
4458
+ }));
4459
+ } catch (error) {
4460
+ console.error("Error fetching UserYieldChanged events:", error);
4461
+ throw error;
4462
+ }
4463
+ }
4464
+ async getTotalClaimedYield() {
4465
+ const smartWalletClient = await this.walletService.getSmartWalletClient();
4466
+ const smartWalletAddress = smartWalletClient.account?.address;
4467
+ const syntheticInYield = await this.getSyntheticTokenInfo();
4468
+ return await this.publicClient.readContract({
4469
+ address: syntheticInYield?.address,
4470
+ abi: syntheticAbi,
4471
+ functionName: "claimedYield",
4472
+ args: [smartWalletAddress]
4473
+ });
4474
+ }
4475
+ async getSyntheticTokenInfo() {
4476
+ if (this.syntheticToken) return this.syntheticToken;
4477
+ const smartWalletAddress = await this.walletService.getSmartWalletAddress();
4478
+ const tokenAddressInYield = await this.publicClient.readContract({
4479
+ address: this.contracts.yieldCalculator,
4480
+ abi: yieldCalculatorAbi,
4481
+ functionName: "getActiveYieldToken",
4482
+ args: [smartWalletAddress]
4483
+ });
4484
+ if (!tokenAddressInYield) {
4485
+ throw new Error("Yield token not found in yield calculator");
4486
+ }
4487
+ const token = this.tokens.find(
4488
+ (token2) => token2.isSynthetic && token2.address === tokenAddressInYield
4489
+ );
4490
+ if (!token) {
4491
+ throw new Error("Yield token not found in tokens list");
4492
+ }
4493
+ this.syntheticToken = token;
4494
+ return this.syntheticToken;
4495
+ }
4496
+ now() {
4497
+ return BigInt(Math.floor(Date.now() / 1e3));
4498
+ }
4499
+ toFullBalance(amount, decimals) {
4500
+ const amountString = formatUnits(amount, decimals);
4501
+ const num = parseFloat(amountString);
4502
+ if (num < 1e-6) return "0";
4503
+ return num.toFixed(4);
4504
+ }
4505
+ };
4506
+
4507
+ // src/modules/crypto/chains/base/index.ts
4508
+ var baseFactory = {
4509
+ createWalletService(config) {
4510
+ return new BaseWalletService(config);
4511
+ },
4512
+ createAccountAbstractionService(config, walletService) {
4513
+ return new BaseAccountAbstractionService({
4514
+ publicRpcClient: config.publicClient,
4515
+ kernelPublicClient: config.kernelPublicClient,
4516
+ contracts: config.contracts,
4517
+ walletService,
4518
+ logger: config.logger
4519
+ });
4520
+ },
4521
+ createCryptoService(config, walletService, tokens) {
4522
+ return new BaseCryptoService({
4523
+ contracts: config.contracts,
4524
+ walletService,
4525
+ tokens,
4526
+ logger: config.logger,
4527
+ withdrawalApi: config.withdrawalApi
4528
+ });
4529
+ },
4530
+ createYieldService(config, walletService, tokens) {
4531
+ return new BaseYieldService({
4532
+ publicClient: config.publicClient,
4533
+ walletService,
4534
+ contracts: config.contracts,
4535
+ tokens
4536
+ });
4537
+ },
4538
+ createAccountContractService(config, walletService) {
4539
+ return new BaseAccountContractService({
4540
+ publicRpcClient: config.publicClient,
4541
+ walletService,
4542
+ companyId: config.companyId || "",
4543
+ logger: config.logger,
4544
+ contracts: config.contracts
4545
+ });
4546
+ }
4547
+ };
4548
+ chainRegistry.register(8453, baseFactory);
4549
+ chainRegistry.register(84532, baseFactory);
4550
+ chainRegistry.register(5042002, baseFactory);
4551
+
4552
+ // src/modules/crypto/internal/contract-registry.service.ts
4553
+ var CONTRACT_NAMES = {
4554
+ accounts: "Accounts",
4555
+ corporateAccounts: "CorporateAccounts",
4556
+ tokenRegistry: "TokensRegistry",
4557
+ processing: "Processing",
4558
+ executionDelayPolicy: "ExecutionDelayPolicy",
4559
+ fundsManagement: "FundsManagement",
4560
+ fundsBuffer: "FundsBuffer",
4561
+ syntheticRouter: "SyntheticRouter",
4562
+ yieldCalculator: "YieldCalculator",
4563
+ cardsManagement: "CardsManagement"
4564
+ };
4565
+ var ContractRegistryService = class {
4566
+ constructor(config) {
4567
+ this.registryAddress = config.registryAddress;
4568
+ this.logger = config.logger;
4569
+ this.publicClient = config.publicClient;
4570
+ }
4571
+ async loadContracts() {
4572
+ this.logger?.info("Loading contracts from registry...");
4573
+ const contracts = {};
4574
+ for (const [key, name] of Object.entries(CONTRACT_NAMES)) {
4575
+ try {
4576
+ const address = await this.publicClient.readContract({
4577
+ address: this.registryAddress,
4578
+ abi: contractRegistryAbi,
4579
+ functionName: "contractByName",
4580
+ args: [name]
4581
+ });
4582
+ contracts[key] = address;
4583
+ this.logger?.debug(`Loaded ${name}: ${address}`);
4584
+ } catch (error) {
4585
+ this.logger?.warn(`Failed to load contract ${name}:`, error);
4586
+ }
4587
+ }
4588
+ this.logger?.info("Contracts loaded successfully");
4589
+ return contracts;
4590
+ }
4591
+ async loadTokens(tokenRegistryAddress) {
4592
+ this.logger?.info("Loading tokens from registry...");
4593
+ try {
4594
+ const tokensRaw = await this.publicClient.readContract({
4595
+ address: tokenRegistryAddress,
4596
+ abi: tokenRegistryAbi,
4597
+ functionName: "retrieveAllTokensV2"
4598
+ });
4599
+ const tokens = tokensRaw.map((token) => {
4600
+ const baseTokenRaw = tokensRaw.find(
4601
+ (baseToken) => baseToken.tokenAddress === token.baseToken
4602
+ );
4603
+ return {
4604
+ symbol: token.symbol,
4605
+ address: token.tokenAddress,
4606
+ decimals: Number(token.decimals),
4607
+ isSynthetic: token.isSynthetic,
4608
+ baseToken: baseTokenRaw ? {
4609
+ address: baseTokenRaw.tokenAddress,
4610
+ decimals: Number(baseTokenRaw.decimals),
4611
+ symbol: baseTokenRaw.symbol,
4612
+ isSynthetic: baseTokenRaw.isSynthetic
4613
+ } : void 0
4614
+ };
4615
+ });
4616
+ this.logger?.info(`Loaded ${tokens.length} tokens`);
4617
+ return tokens;
4618
+ } catch (error) {
4619
+ this.logger?.error("Failed to load tokens:", error);
4620
+ throw new ContractError(
4621
+ "Failed to load tokens from registry",
4622
+ tokenRegistryAddress,
4623
+ error
4624
+ );
4625
+ }
4626
+ }
4627
+ };
4628
+ var supportedEVMChains = [
4629
+ SupportedChains.BASE,
4630
+ SupportedChains.ARBITRUM_ONE,
4631
+ SupportedChains.BNB_SMART_CHAIN,
4632
+ SupportedChains.ETHEREUM,
4633
+ SupportedChains.KAIA,
4634
+ SupportedChains.POLYGON,
4635
+ SupportedChains.OPTIMISM
4636
+ ];
4637
+ var SYSTEM_SUPPORTED_TOKENS = ["USDT", "USDC", "EURC"];
4638
+ var SmartDepositAddressesService = class {
4639
+ constructor(config) {
4640
+ this.rhinoSdkInstance = null;
4641
+ this.addresses = [];
4642
+ this.walletService = config.walletService;
4643
+ this.rhinoApiKey = config.rhinoApiKey;
4644
+ }
4645
+ async initializeSmartDepositAddresses(forceRefresh = false) {
4646
+ if (this.addresses.length > 0 && !forceRefresh) {
4647
+ return this.addresses;
4648
+ }
4649
+ try {
4650
+ const result = await this.createSmartDepositAddresses();
4651
+ const allAddresses = result.allAddresses;
4652
+ const hasEvmAddresses = result.evmChains.length > 0;
4653
+ const hasTronAddresses = result.tronChains.length > 0;
4654
+ const hasSolanaAddresses = result.solanaChains.length > 0;
4655
+ if (!hasEvmAddresses || !hasTronAddresses || !hasSolanaAddresses) {
4656
+ const failedGroups = [];
4657
+ if (!hasEvmAddresses) failedGroups.push("EVM");
4658
+ if (!hasTronAddresses) failedGroups.push("TRON");
4659
+ if (!hasSolanaAddresses) failedGroups.push("Solana");
4660
+ console.warn(`Some chain groups failed to initialize: ${failedGroups.join(", ")}`);
4661
+ }
4662
+ this.setAddresses(allAddresses);
4663
+ return allAddresses;
4664
+ } catch (err) {
4665
+ console.error("Failed to initialize smart deposit addresses:", err);
4666
+ throw err;
4667
+ }
4668
+ }
4669
+ getAddresses() {
4670
+ return this.addresses;
4671
+ }
4672
+ clearAddresses() {
4673
+ this.addresses = [];
4674
+ }
4675
+ setAddresses(addresses) {
4676
+ this.addresses = addresses;
4677
+ }
4678
+ async createSmartDepositAddressForChains(supportedChains) {
4679
+ const smartWalletClient = await this.walletService.getSmartWalletClient();
4680
+ const smartWalletAddress = smartWalletClient.account.address;
4681
+ const sdk = this.getRhinoSdk();
4682
+ const response = await sdk.api.depositAddresses.create({
4683
+ depositChains: supportedChains,
4684
+ destinationChain: SupportedChains.BASE,
4685
+ destinationAddress: smartWalletAddress,
4686
+ bridgeIfNotSwappable: true,
4687
+ tokenOut: "USDC",
4688
+ postBridgeData: {
4689
+ _tag: "wirexwrap"
4690
+ },
4691
+ reusePolicy: "reuse-existing"
4692
+ });
4693
+ if (response.response.status !== 200 || !response.data) {
4694
+ throw new Error(JSON.stringify(response.error));
4695
+ }
4696
+ const activationPromises = response.data.filter((depositData) => !depositData.isActive).map(async (depositData) => {
4697
+ const activationResponse = await sdk.api.depositAddresses.activate({
4698
+ depositAddress: depositData.depositAddress,
4699
+ depositChain: depositData.depositChain
4700
+ });
4701
+ if (activationResponse.response.status !== 200) {
4702
+ throw new Error(JSON.stringify(activationResponse.error));
4703
+ }
4704
+ });
4705
+ await Promise.all(activationPromises);
4706
+ return response.data.map((item) => {
4707
+ const supportedTokens = (item.supportedTokens || []).map((token) => token.symbol).filter((symbol) => SYSTEM_SUPPORTED_TOKENS.includes(symbol));
4708
+ return {
4709
+ depositChain: item.depositChain,
4710
+ depositAddress: item.depositAddress,
4711
+ destinationChain: item.destinationChain,
4712
+ destinationAddress: item.destinationAddress,
4713
+ isActive: true,
4714
+ supportedTokens
4715
+ };
4716
+ });
4717
+ }
4718
+ async createSmartDepositAddresses() {
4719
+ const results = await Promise.allSettled([
4720
+ this.createSmartDepositAddressForChains(supportedEVMChains),
4721
+ this.createSmartDepositAddressForChains([SupportedChains.TRON]),
4722
+ this.createSmartDepositAddressForChains([SupportedChains.SOLANA])
4723
+ ]);
4724
+ const evmChains = results[0].status === "fulfilled" ? results[0].value : [];
4725
+ const tronChains = results[1].status === "fulfilled" ? results[1].value : [];
4726
+ const solanaChains = results[2].status === "fulfilled" ? results[2].value : [];
4727
+ if (results[0].status === "rejected") {
4728
+ console.error("Failed to create EVM chain addresses:", results[0].reason);
4729
+ }
4730
+ if (results[1].status === "rejected") {
4731
+ console.error("Failed to create TRON chain addresses:", results[1].reason);
4732
+ }
4733
+ if (results[2].status === "rejected") {
4734
+ console.error("Failed to create Solana chain addresses:", results[2].reason);
4735
+ }
4736
+ return {
4737
+ evmChains,
4738
+ tronChains,
4739
+ solanaChains,
4740
+ allAddresses: [...evmChains, ...tronChains, ...solanaChains]
4741
+ };
4742
+ }
4743
+ async createMissingAddressesForChainGroup(chainCode) {
4744
+ try {
4745
+ const chainGroup = this.getChainGroupByChainCode(chainCode);
4746
+ if (this.hasAddressesForChainGroup(chainGroup)) {
4747
+ return;
4748
+ }
4749
+ const chains = this.getChainsForGroup(chainGroup);
4750
+ const newAddresses = await this.createSmartDepositAddressForChains(chains);
4751
+ const existingChainCodes = new Set(this.addresses.map((addr) => addr.depositChain));
4752
+ const newUniqueAddresses = newAddresses.filter(
4753
+ (addr) => !existingChainCodes.has(addr.depositChain)
4754
+ );
4755
+ if (newUniqueAddresses.length > 0) {
4756
+ const updatedAddresses = [...this.addresses, ...newUniqueAddresses];
4757
+ this.setAddresses(updatedAddresses);
4758
+ }
4759
+ } catch (err) {
4760
+ console.error(`Failed to create addresses for chain ${chainCode}:`, err);
4761
+ throw err;
4762
+ }
4763
+ }
4764
+ hasAddressesForChainGroup(chainGroup) {
4765
+ const requiredChains = this.getChainsForGroup(chainGroup);
4766
+ const existingChainCodes = new Set(this.addresses.map((addr) => addr.depositChain));
4767
+ return requiredChains.some((chain) => existingChainCodes.has(chain));
4768
+ }
4769
+ getChainsForGroup(chainGroup) {
4770
+ switch (chainGroup) {
4771
+ case "evm":
4772
+ return supportedEVMChains;
4773
+ case "tron":
4774
+ return [SupportedChains.TRON];
4775
+ case "solana":
4776
+ return [SupportedChains.SOLANA];
4777
+ default:
4778
+ throw new Error(`Unknown chain group: ${chainGroup}`);
4779
+ }
4780
+ }
4781
+ getChainGroupByChainCode(chainCode) {
4782
+ if (supportedEVMChains.includes(chainCode)) {
4783
+ return "evm";
4784
+ }
4785
+ if (chainCode === SupportedChains.TRON) {
4786
+ return "tron";
4787
+ }
4788
+ if (chainCode === SupportedChains.SOLANA) {
4789
+ return "solana";
4790
+ }
4791
+ throw new Error(`Unknown chain code: ${chainCode}`);
4792
+ }
4793
+ getRhinoSdk() {
4794
+ if (!this.rhinoSdkInstance) {
4795
+ this.rhinoSdkInstance = RhinoSdk({
4796
+ apiKey: this.rhinoApiKey
4797
+ });
4798
+ }
4799
+ return this.rhinoSdkInstance;
4800
+ }
4801
+ };
4802
+
4803
+ // src/modules/crypto/crypto.module.ts
4804
+ var CryptoModule = class {
4805
+ constructor(context) {
4806
+ this.name = "crypto";
4807
+ this._tokens = [];
4808
+ this._initialized = false;
4809
+ this.context = context;
4810
+ this.logger = context.logger;
4811
+ }
4812
+ get wallet() {
4813
+ this.ensureInitialized();
4814
+ return this._walletService;
4815
+ }
4816
+ get accountAbstraction() {
4817
+ this.ensureInitialized();
4818
+ return this._accountAbstraction;
4819
+ }
4820
+ get transfer() {
4821
+ this.ensureInitialized();
4822
+ return this._cryptoService;
4823
+ }
4824
+ get yield() {
4825
+ this.ensureInitialized();
4826
+ return this._yieldService;
4827
+ }
4828
+ get accountContract() {
4829
+ this.ensureInitialized();
4830
+ return this._accountContractService;
4831
+ }
4832
+ get smartDepositAddress() {
4833
+ this.ensureInitialized();
4834
+ if (!this._smartDepositService) {
4835
+ this.logger.error(
4836
+ "smartDepositAddress unavailable: no rhinoApiKey was provided to createSDK(). Pass rhinoApiKey in the SDK config to enable smart deposit addresses."
4837
+ );
4838
+ throw new ConfigurationError("rhinoApiKey is required to use smartDepositAddress.");
4839
+ }
4840
+ return this._smartDepositService;
4841
+ }
4842
+ get contracts() {
4843
+ return this._contracts;
4844
+ }
4845
+ get tokens() {
4846
+ return this._tokens;
4847
+ }
4848
+ async initialize() {
4849
+ if (this._initialized) {
4850
+ this.logger.warn("Crypto module already initialized");
4851
+ return;
4852
+ }
4853
+ this.logger.info("Initializing Crypto module...");
4854
+ const { config } = this.context;
4855
+ this._bundlerTransport = http(config.bundlerRpc, { timeout: 30 * 1e3 });
4856
+ this._kernelPaymasterClient = createZeroDevPaymasterClient({
4857
+ chain: config.chain,
4858
+ transport: http(config.paymasterRpc)
4859
+ });
4860
+ this._kernelPublicClient = createPublicClient({
4861
+ chain: config.chain,
4862
+ transport: http(config.rpcUrl, { timeout: 30 * 1e3 })
4863
+ });
4864
+ this._publicRPCClient = createPublicClient({
4865
+ chain: config.chain,
4866
+ transport: http(config.rpcUrl, { timeout: 30 * 1e3 })
4867
+ });
4868
+ this._httpClient = this.context.httpClient;
4869
+ this._withdrawalApi = new WithdrawalApi(this._httpClient);
4870
+ this._contractRegistry = new ContractRegistryService({
4871
+ registryAddress: config.contractRegistry,
4872
+ publicClient: this._publicRPCClient,
4873
+ logger: this.logger
4874
+ });
4875
+ this._contracts = await this._contractRegistry.loadContracts();
4876
+ this._tokens = await this._contractRegistry.loadTokens(this._contracts.tokenRegistry);
4877
+ this.initializeChainServices();
4878
+ this._initialized = true;
4879
+ this.logger.info("Crypto module initialized successfully");
4880
+ }
4881
+ isInitialized() {
4882
+ return this._initialized;
4883
+ }
4884
+ ensureInitialized() {
4885
+ if (!this._initialized) {
4886
+ throw new ConfigurationError("Crypto module not initialized");
4887
+ }
4888
+ }
4889
+ initializeChainServices() {
4890
+ const { config } = this.context;
4891
+ const factory = chainRegistry.get(config.chainId);
4892
+ if (!factory) {
4893
+ const supported = chainRegistry.getSupportedChainIds().join(", ");
4894
+ throw new ConfigurationError(
4895
+ `Unsupported chainId: ${config.chainId}. Supported: ${supported}`
4896
+ );
4897
+ }
4898
+ const serviceConfig = {
4899
+ publicClient: this._publicRPCClient,
4900
+ kernelPaymasterClient: this._kernelPaymasterClient,
4901
+ kernelPublicClient: this._kernelPublicClient,
4902
+ bundlerTransport: this._bundlerTransport,
4903
+ contracts: this._contracts,
4904
+ chain: config.chain,
4905
+ logger: this.logger,
4906
+ getMainWalletClient: config.getMainWalletClient,
4907
+ tokens: this._tokens,
4908
+ companyId: config.companyId,
4909
+ withdrawalApi: this._withdrawalApi
4910
+ };
4911
+ this._walletService = factory.createWalletService(serviceConfig);
4912
+ this._accountAbstraction = factory.createAccountAbstractionService(
4913
+ serviceConfig,
4914
+ this._walletService
4915
+ );
4916
+ this._cryptoService = factory.createCryptoService(
4917
+ serviceConfig,
4918
+ this._walletService,
4919
+ this._tokens
4920
+ );
4921
+ this._yieldService = factory.createYieldService(
4922
+ serviceConfig,
4923
+ this._walletService,
4924
+ this._tokens
4925
+ );
4926
+ this._accountContractService = factory.createAccountContractService(
4927
+ serviceConfig,
4928
+ this._walletService
4929
+ );
4930
+ if (config.rhinoApiKey) {
4931
+ this._smartDepositService = new SmartDepositAddressesService({
4932
+ walletService: this._walletService,
4933
+ rhinoApiKey: config.rhinoApiKey
4934
+ });
4935
+ }
4936
+ }
4937
+ getToken(symbol) {
4938
+ this.ensureInitialized();
4939
+ return this._tokens.find((t) => t.symbol.toUpperCase() === symbol.toUpperCase());
4940
+ }
4941
+ };
4942
+
4943
+ export { BaseAccountAbstractionService, BaseAccountContractService, BaseCryptoService, BaseWalletService, BaseYieldService, ContractRegistryService, CryptoModule, chainRegistry };
4944
+ //# sourceMappingURL=chunk-BN5Q2YHP.js.map
4945
+ //# sourceMappingURL=chunk-BN5Q2YHP.js.map