@folks-finance/xchain-sdk 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (346) hide show
  1. package/README.md +1 -0
  2. package/dist/chains/evm/common/constants/abi/ccip-data-adapter-abi.d.ts +796 -0
  3. package/dist/chains/evm/common/constants/abi/ccip-data-adapter-abi.js +614 -0
  4. package/dist/chains/evm/common/constants/abi/ccip-data-adapter-abi.js.map +1 -0
  5. package/dist/chains/evm/common/constants/abi/erc-20-abi.d.ts +235 -0
  6. package/dist/chains/evm/common/constants/abi/erc-20-abi.js +157 -0
  7. package/dist/chains/evm/common/constants/abi/erc-20-abi.js.map +1 -0
  8. package/dist/chains/evm/common/constants/abi/wormhole-data-adapter-abi.d.ts +807 -0
  9. package/dist/chains/evm/common/constants/abi/wormhole-data-adapter-abi.js +621 -0
  10. package/dist/chains/evm/common/constants/abi/wormhole-data-adapter-abi.js.map +1 -0
  11. package/dist/chains/evm/common/constants/chain.d.ts +2349 -0
  12. package/dist/chains/evm/common/constants/chain.js +45 -0
  13. package/dist/chains/evm/common/constants/chain.js.map +1 -0
  14. package/dist/chains/evm/common/constants/contract.d.ts +2 -0
  15. package/dist/chains/evm/common/constants/contract.js +6 -0
  16. package/dist/chains/evm/common/constants/contract.js.map +1 -0
  17. package/dist/chains/evm/common/constants/tokens.d.ts +6 -0
  18. package/dist/chains/evm/common/constants/tokens.js +33 -0
  19. package/dist/chains/evm/common/constants/tokens.js.map +1 -0
  20. package/dist/chains/evm/common/types/chain.d.ts +10 -0
  21. package/dist/chains/evm/common/types/chain.js +2 -0
  22. package/dist/chains/evm/common/types/chain.js.map +1 -0
  23. package/dist/chains/evm/common/types/contract.d.ts +8 -0
  24. package/dist/chains/evm/common/types/contract.js +2 -0
  25. package/dist/chains/evm/common/types/contract.js.map +1 -0
  26. package/dist/chains/evm/common/types/gmp.d.ts +14 -0
  27. package/dist/chains/evm/common/types/gmp.js +2 -0
  28. package/dist/chains/evm/common/types/gmp.js.map +1 -0
  29. package/dist/chains/evm/common/types/index.d.ts +3 -0
  30. package/dist/chains/evm/common/types/index.js +4 -0
  31. package/dist/chains/evm/common/types/index.js.map +1 -0
  32. package/dist/chains/evm/common/types/module.d.ts +66 -0
  33. package/dist/chains/evm/common/types/module.js +2 -0
  34. package/dist/chains/evm/common/types/module.js.map +1 -0
  35. package/dist/chains/evm/common/types/tokens.d.ts +28 -0
  36. package/dist/chains/evm/common/types/tokens.js +2 -0
  37. package/dist/chains/evm/common/types/tokens.js.map +1 -0
  38. package/dist/chains/evm/common/utils/chain.d.ts +6 -0
  39. package/dist/chains/evm/common/utils/chain.js +16 -0
  40. package/dist/chains/evm/common/utils/chain.js.map +1 -0
  41. package/dist/chains/evm/common/utils/contract.d.ts +6006 -0
  42. package/dist/chains/evm/common/utils/contract.js +54 -0
  43. package/dist/chains/evm/common/utils/contract.js.map +1 -0
  44. package/dist/chains/evm/common/utils/gmp.d.ts +4 -0
  45. package/dist/chains/evm/common/utils/gmp.js +13 -0
  46. package/dist/chains/evm/common/utils/gmp.js.map +1 -0
  47. package/dist/chains/evm/common/utils/message.d.ts +22 -0
  48. package/dist/chains/evm/common/utils/message.js +398 -0
  49. package/dist/chains/evm/common/utils/message.js.map +1 -0
  50. package/dist/chains/evm/common/utils/provider.d.ts +5 -0
  51. package/dist/chains/evm/common/utils/provider.js +24 -0
  52. package/dist/chains/evm/common/utils/provider.js.map +1 -0
  53. package/dist/chains/evm/common/utils/tokens.d.ts +10 -0
  54. package/dist/chains/evm/common/utils/tokens.js +37 -0
  55. package/dist/chains/evm/common/utils/tokens.js.map +1 -0
  56. package/dist/chains/evm/hub/constants/abi/account-manager-abi.d.ts +907 -0
  57. package/dist/chains/evm/hub/constants/abi/account-manager-abi.js +686 -0
  58. package/dist/chains/evm/hub/constants/abi/account-manager-abi.js.map +1 -0
  59. package/dist/chains/evm/hub/constants/abi/bridge-router-hub-abi.d.ts +969 -0
  60. package/dist/chains/evm/hub/constants/abi/bridge-router-hub-abi.js +764 -0
  61. package/dist/chains/evm/hub/constants/abi/bridge-router-hub-abi.js.map +1 -0
  62. package/dist/chains/evm/hub/constants/abi/hub-abi.d.ts +285 -0
  63. package/dist/chains/evm/hub/constants/abi/hub-abi.js +187 -0
  64. package/dist/chains/evm/hub/constants/abi/hub-abi.js.map +1 -0
  65. package/dist/chains/evm/hub/constants/abi/hub-pool-abi.d.ts +1742 -0
  66. package/dist/chains/evm/hub/constants/abi/hub-pool-abi.js +1346 -0
  67. package/dist/chains/evm/hub/constants/abi/hub-pool-abi.js.map +1 -0
  68. package/dist/chains/evm/hub/constants/abi/loan-manager-abi.d.ts +1559 -0
  69. package/dist/chains/evm/hub/constants/abi/loan-manager-abi.js +1040 -0
  70. package/dist/chains/evm/hub/constants/abi/loan-manager-abi.js.map +1 -0
  71. package/dist/chains/evm/hub/constants/abi/oracle-manager-abi.d.ts +495 -0
  72. package/dist/chains/evm/hub/constants/abi/oracle-manager-abi.js +389 -0
  73. package/dist/chains/evm/hub/constants/abi/oracle-manager-abi.js.map +1 -0
  74. package/dist/chains/evm/hub/constants/chain.d.ts +3 -0
  75. package/dist/chains/evm/hub/constants/chain.js +96 -0
  76. package/dist/chains/evm/hub/constants/chain.js.map +1 -0
  77. package/dist/chains/evm/hub/modules/folks-hub-account.d.ts +15 -0
  78. package/dist/chains/evm/hub/modules/folks-hub-account.js +98 -0
  79. package/dist/chains/evm/hub/modules/folks-hub-account.js.map +1 -0
  80. package/dist/chains/evm/hub/modules/folks-hub-gmp.d.ts +14 -0
  81. package/dist/chains/evm/hub/modules/folks-hub-gmp.js +57 -0
  82. package/dist/chains/evm/hub/modules/folks-hub-gmp.js.map +1 -0
  83. package/dist/chains/evm/hub/modules/folks-hub-loan.d.ts +25 -0
  84. package/dist/chains/evm/hub/modules/folks-hub-loan.js +397 -0
  85. package/dist/chains/evm/hub/modules/folks-hub-loan.js.map +1 -0
  86. package/dist/chains/evm/hub/modules/folks-hub-oracle.d.ts +5 -0
  87. package/dist/chains/evm/hub/modules/folks-hub-oracle.js +24 -0
  88. package/dist/chains/evm/hub/modules/folks-hub-oracle.js.map +1 -0
  89. package/dist/chains/evm/hub/modules/folks-hub-pool.d.ts +5 -0
  90. package/dist/chains/evm/hub/modules/folks-hub-pool.js +114 -0
  91. package/dist/chains/evm/hub/modules/folks-hub-pool.js.map +1 -0
  92. package/dist/chains/evm/hub/modules/index.d.ts +5 -0
  93. package/dist/chains/evm/hub/modules/index.js +6 -0
  94. package/dist/chains/evm/hub/modules/index.js.map +1 -0
  95. package/dist/chains/evm/hub/types/account.d.ts +23 -0
  96. package/dist/chains/evm/hub/types/account.js +2 -0
  97. package/dist/chains/evm/hub/types/account.js.map +1 -0
  98. package/dist/chains/evm/hub/types/chain.d.ts +15 -0
  99. package/dist/chains/evm/hub/types/chain.js +2 -0
  100. package/dist/chains/evm/hub/types/chain.js.map +1 -0
  101. package/dist/chains/evm/hub/types/loan.d.ts +126 -0
  102. package/dist/chains/evm/hub/types/loan.js +9 -0
  103. package/dist/chains/evm/hub/types/loan.js.map +1 -0
  104. package/dist/chains/evm/hub/types/oracle.d.ts +4 -0
  105. package/dist/chains/evm/hub/types/oracle.js +2 -0
  106. package/dist/chains/evm/hub/types/oracle.js.map +1 -0
  107. package/dist/chains/evm/hub/types/pool.d.ts +60 -0
  108. package/dist/chains/evm/hub/types/pool.js +2 -0
  109. package/dist/chains/evm/hub/types/pool.js.map +1 -0
  110. package/dist/chains/evm/hub/types/token.d.ts +9 -0
  111. package/dist/chains/evm/hub/types/token.js +2 -0
  112. package/dist/chains/evm/hub/types/token.js.map +1 -0
  113. package/dist/chains/evm/hub/utils/chain.d.ts +13 -0
  114. package/dist/chains/evm/hub/utils/chain.js +29 -0
  115. package/dist/chains/evm/hub/utils/chain.js.map +1 -0
  116. package/dist/chains/evm/hub/utils/contract.d.ts +17 -0
  117. package/dist/chains/evm/hub/utils/contract.js +52 -0
  118. package/dist/chains/evm/hub/utils/contract.js.map +1 -0
  119. package/dist/chains/evm/hub/utils/events.d.ts +24 -0
  120. package/dist/chains/evm/hub/utils/events.js +97 -0
  121. package/dist/chains/evm/hub/utils/events.js.map +1 -0
  122. package/dist/chains/evm/hub/utils/loan.d.ts +4 -0
  123. package/dist/chains/evm/hub/utils/loan.js +36 -0
  124. package/dist/chains/evm/hub/utils/loan.js.map +1 -0
  125. package/dist/chains/evm/spoke/constants/abi/bridge-router-spoke-abi.d.ts +951 -0
  126. package/dist/chains/evm/spoke/constants/abi/bridge-router-spoke-abi.js +754 -0
  127. package/dist/chains/evm/spoke/constants/abi/bridge-router-spoke-abi.js.map +1 -0
  128. package/dist/chains/evm/spoke/constants/abi/spoke-common-abi.d.ts +1101 -0
  129. package/dist/chains/evm/spoke/constants/abi/spoke-common-abi.js +710 -0
  130. package/dist/chains/evm/spoke/constants/abi/spoke-common-abi.js.map +1 -0
  131. package/dist/chains/evm/spoke/constants/abi/spoke-token-abi.d.ts +882 -0
  132. package/dist/chains/evm/spoke/constants/abi/spoke-token-abi.js +643 -0
  133. package/dist/chains/evm/spoke/constants/abi/spoke-token-abi.js.map +1 -0
  134. package/dist/chains/evm/spoke/modules/folks-evm-account.d.ts +18 -0
  135. package/dist/chains/evm/spoke/modules/folks-evm-account.js +119 -0
  136. package/dist/chains/evm/spoke/modules/folks-evm-account.js.map +1 -0
  137. package/dist/chains/evm/spoke/modules/folks-evm-gmp.d.ts +14 -0
  138. package/dist/chains/evm/spoke/modules/folks-evm-gmp.js +57 -0
  139. package/dist/chains/evm/spoke/modules/folks-evm-gmp.js.map +1 -0
  140. package/dist/chains/evm/spoke/modules/folks-evm-loan.d.ts +39 -0
  141. package/dist/chains/evm/spoke/modules/folks-evm-loan.js +396 -0
  142. package/dist/chains/evm/spoke/modules/folks-evm-loan.js.map +1 -0
  143. package/dist/chains/evm/spoke/modules/index.d.ts +3 -0
  144. package/dist/chains/evm/spoke/modules/index.js +4 -0
  145. package/dist/chains/evm/spoke/modules/index.js.map +1 -0
  146. package/dist/chains/evm/spoke/types/pool.d.ts +7 -0
  147. package/dist/chains/evm/spoke/types/pool.js +2 -0
  148. package/dist/chains/evm/spoke/types/pool.js.map +1 -0
  149. package/dist/chains/evm/spoke/utils/contract.d.ts +12 -0
  150. package/dist/chains/evm/spoke/utils/contract.js +28 -0
  151. package/dist/chains/evm/spoke/utils/contract.js.map +1 -0
  152. package/dist/common/constants/adapter.d.ts +4 -0
  153. package/dist/common/constants/adapter.js +5 -0
  154. package/dist/common/constants/adapter.js.map +1 -0
  155. package/dist/common/constants/bytes.d.ts +5 -0
  156. package/dist/common/constants/bytes.js +6 -0
  157. package/dist/common/constants/bytes.js.map +1 -0
  158. package/dist/common/constants/chain.d.ts +15 -0
  159. package/dist/common/constants/chain.js +152 -0
  160. package/dist/common/constants/chain.js.map +1 -0
  161. package/dist/common/constants/gmp.d.ts +4 -0
  162. package/dist/common/constants/gmp.js +32 -0
  163. package/dist/common/constants/gmp.js.map +1 -0
  164. package/dist/common/constants/lending.d.ts +1 -0
  165. package/dist/common/constants/lending.js +3 -0
  166. package/dist/common/constants/lending.js.map +1 -0
  167. package/dist/common/constants/message.d.ts +4 -0
  168. package/dist/common/constants/message.js +5 -0
  169. package/dist/common/constants/message.js.map +1 -0
  170. package/dist/common/constants/pool.d.ts +8 -0
  171. package/dist/common/constants/pool.js +10 -0
  172. package/dist/common/constants/pool.js.map +1 -0
  173. package/dist/common/constants/token.d.ts +2 -0
  174. package/dist/common/constants/token.js +3 -0
  175. package/dist/common/constants/token.js.map +1 -0
  176. package/dist/common/types/adapter.d.ts +30 -0
  177. package/dist/common/types/adapter.js +7 -0
  178. package/dist/common/types/adapter.js.map +1 -0
  179. package/dist/common/types/address.d.ts +9 -0
  180. package/dist/common/types/address.js +2 -0
  181. package/dist/common/types/address.js.map +1 -0
  182. package/dist/common/types/brand.d.ts +6 -0
  183. package/dist/common/types/brand.js +2 -0
  184. package/dist/common/types/brand.js.map +1 -0
  185. package/dist/common/types/chain.d.ts +29 -0
  186. package/dist/common/types/chain.js +10 -0
  187. package/dist/common/types/chain.js.map +1 -0
  188. package/dist/common/types/core.d.ts +28 -0
  189. package/dist/common/types/core.js +2 -0
  190. package/dist/common/types/core.js.map +1 -0
  191. package/dist/common/types/gmp.d.ts +17 -0
  192. package/dist/common/types/gmp.js +6 -0
  193. package/dist/common/types/gmp.js.map +1 -0
  194. package/dist/common/types/lending.d.ts +4 -0
  195. package/dist/common/types/lending.js +2 -0
  196. package/dist/common/types/lending.js.map +1 -0
  197. package/dist/common/types/message.d.ts +239 -0
  198. package/dist/common/types/message.js +33 -0
  199. package/dist/common/types/message.js.map +1 -0
  200. package/dist/common/types/module.d.ts +21 -0
  201. package/dist/common/types/module.js +6 -0
  202. package/dist/common/types/module.js.map +1 -0
  203. package/dist/common/types/token.d.ts +42 -0
  204. package/dist/common/types/token.js +15 -0
  205. package/dist/common/types/token.js.map +1 -0
  206. package/dist/common/utils/adapter.d.ts +11 -0
  207. package/dist/common/utils/adapter.js +63 -0
  208. package/dist/common/utils/adapter.js.map +1 -0
  209. package/dist/common/utils/address.d.ts +8 -0
  210. package/dist/common/utils/address.js +35 -0
  211. package/dist/common/utils/address.js.map +1 -0
  212. package/dist/common/utils/bytes.d.ts +9 -0
  213. package/dist/common/utils/bytes.js +34 -0
  214. package/dist/common/utils/bytes.js.map +1 -0
  215. package/dist/common/utils/chain.d.ts +19 -0
  216. package/dist/common/utils/chain.js +74 -0
  217. package/dist/common/utils/chain.js.map +1 -0
  218. package/dist/common/utils/formulae.d.ts +15 -0
  219. package/dist/common/utils/formulae.js +77 -0
  220. package/dist/common/utils/formulae.js.map +1 -0
  221. package/dist/common/utils/gmp.d.ts +4 -0
  222. package/dist/common/utils/gmp.js +14 -0
  223. package/dist/common/utils/gmp.js.map +1 -0
  224. package/dist/common/utils/math-lib.d.ts +9 -0
  225. package/dist/common/utils/math-lib.js +38 -0
  226. package/dist/common/utils/math-lib.js.map +1 -0
  227. package/dist/common/utils/messages.d.ts +7 -0
  228. package/dist/common/utils/messages.js +93 -0
  229. package/dist/common/utils/messages.js.map +1 -0
  230. package/dist/common/utils/token.d.ts +2 -0
  231. package/dist/common/utils/token.js +5 -0
  232. package/dist/common/utils/token.js.map +1 -0
  233. package/dist/index.d.ts +30 -0
  234. package/dist/index.js +38 -0
  235. package/dist/index.js.map +1 -0
  236. package/dist/utils/exhaustive-check.d.ts +1 -0
  237. package/dist/utils/exhaustive-check.js +4 -0
  238. package/dist/utils/exhaustive-check.js.map +1 -0
  239. package/dist/xchain/core/folks-core.d.ts +24 -0
  240. package/dist/xchain/core/folks-core.js +100 -0
  241. package/dist/xchain/core/folks-core.js.map +1 -0
  242. package/dist/xchain/modules/folks-account.d.ts +30 -0
  243. package/dist/xchain/modules/folks-account.js +205 -0
  244. package/dist/xchain/modules/folks-account.js.map +1 -0
  245. package/dist/xchain/modules/folks-gmp.d.ts +12 -0
  246. package/dist/xchain/modules/folks-gmp.js +53 -0
  247. package/dist/xchain/modules/folks-gmp.js.map +1 -0
  248. package/dist/xchain/modules/folks-loan.d.ts +68 -0
  249. package/dist/xchain/modules/folks-loan.js +598 -0
  250. package/dist/xchain/modules/folks-loan.js.map +1 -0
  251. package/dist/xchain/modules/folks-oracle.d.ts +4 -0
  252. package/dist/xchain/modules/folks-oracle.js +11 -0
  253. package/dist/xchain/modules/folks-oracle.js.map +1 -0
  254. package/dist/xchain/modules/folks-pool.d.ts +5 -0
  255. package/dist/xchain/modules/folks-pool.js +8 -0
  256. package/dist/xchain/modules/folks-pool.js.map +1 -0
  257. package/dist/xchain/modules/index.d.ts +5 -0
  258. package/dist/xchain/modules/index.js +6 -0
  259. package/dist/xchain/modules/index.js.map +1 -0
  260. package/package.json +79 -0
  261. package/src/chains/evm/common/constants/abi/ccip-data-adapter-abi.ts +613 -0
  262. package/src/chains/evm/common/constants/abi/erc-20-abi.ts +156 -0
  263. package/src/chains/evm/common/constants/abi/wormhole-data-adapter-abi.ts +620 -0
  264. package/src/chains/evm/common/constants/chain.ts +56 -0
  265. package/src/chains/evm/common/constants/contract.ts +7 -0
  266. package/src/chains/evm/common/constants/tokens.ts +39 -0
  267. package/src/chains/evm/common/types/chain.ts +23 -0
  268. package/src/chains/evm/common/types/contract.ts +7 -0
  269. package/src/chains/evm/common/types/gmp.ts +15 -0
  270. package/src/chains/evm/common/types/index.ts +3 -0
  271. package/src/chains/evm/common/types/module.ts +85 -0
  272. package/src/chains/evm/common/types/tokens.ts +31 -0
  273. package/src/chains/evm/common/utils/chain.ts +20 -0
  274. package/src/chains/evm/common/utils/contract.ts +84 -0
  275. package/src/chains/evm/common/utils/gmp.ts +24 -0
  276. package/src/chains/evm/common/utils/message.ts +496 -0
  277. package/src/chains/evm/common/utils/provider.ts +32 -0
  278. package/src/chains/evm/common/utils/tokens.ts +52 -0
  279. package/src/chains/evm/hub/constants/abi/account-manager-abi.ts +685 -0
  280. package/src/chains/evm/hub/constants/abi/bridge-router-hub-abi.ts +763 -0
  281. package/src/chains/evm/hub/constants/abi/hub-abi.ts +186 -0
  282. package/src/chains/evm/hub/constants/abi/hub-pool-abi.ts +1345 -0
  283. package/src/chains/evm/hub/constants/abi/loan-manager-abi.ts +1039 -0
  284. package/src/chains/evm/hub/constants/abi/oracle-manager-abi.ts +388 -0
  285. package/src/chains/evm/hub/constants/chain.ts +130 -0
  286. package/src/chains/evm/hub/modules/folks-hub-account.ts +137 -0
  287. package/src/chains/evm/hub/modules/folks-hub-gmp.ts +105 -0
  288. package/src/chains/evm/hub/modules/folks-hub-loan.ts +603 -0
  289. package/src/chains/evm/hub/modules/folks-hub-oracle.ts +38 -0
  290. package/src/chains/evm/hub/modules/folks-hub-pool.ts +171 -0
  291. package/src/chains/evm/hub/modules/index.ts +5 -0
  292. package/src/chains/evm/hub/types/account.ts +27 -0
  293. package/src/chains/evm/hub/types/chain.ts +16 -0
  294. package/src/chains/evm/hub/types/loan.ts +147 -0
  295. package/src/chains/evm/hub/types/oracle.ts +6 -0
  296. package/src/chains/evm/hub/types/pool.ts +66 -0
  297. package/src/chains/evm/hub/types/token.ts +10 -0
  298. package/src/chains/evm/hub/utils/chain.ts +41 -0
  299. package/src/chains/evm/hub/utils/contract.ts +98 -0
  300. package/src/chains/evm/hub/utils/events.ts +112 -0
  301. package/src/chains/evm/hub/utils/loan.ts +60 -0
  302. package/src/chains/evm/spoke/constants/abi/bridge-router-spoke-abi.ts +753 -0
  303. package/src/chains/evm/spoke/constants/abi/spoke-common-abi.ts +709 -0
  304. package/src/chains/evm/spoke/constants/abi/spoke-token-abi.ts +642 -0
  305. package/src/chains/evm/spoke/modules/folks-evm-account.ts +228 -0
  306. package/src/chains/evm/spoke/modules/folks-evm-gmp.ts +105 -0
  307. package/src/chains/evm/spoke/modules/folks-evm-loan.ts +721 -0
  308. package/src/chains/evm/spoke/modules/index.ts +3 -0
  309. package/src/chains/evm/spoke/types/pool.ts +7 -0
  310. package/src/chains/evm/spoke/utils/contract.ts +74 -0
  311. package/src/common/constants/adapter.ts +5 -0
  312. package/src/common/constants/bytes.ts +6 -0
  313. package/src/common/constants/chain.ts +227 -0
  314. package/src/common/constants/gmp.ts +38 -0
  315. package/src/common/constants/lending.ts +3 -0
  316. package/src/common/constants/message.ts +4 -0
  317. package/src/common/constants/pool.ts +11 -0
  318. package/src/common/constants/token.ts +3 -0
  319. package/src/common/types/adapter.ts +38 -0
  320. package/src/common/types/address.ts +11 -0
  321. package/src/common/types/brand.ts +3 -0
  322. package/src/common/types/chain.ts +35 -0
  323. package/src/common/types/core.ts +31 -0
  324. package/src/common/types/gmp.ts +22 -0
  325. package/src/common/types/lending.ts +5 -0
  326. package/src/common/types/message.ts +330 -0
  327. package/src/common/types/module.ts +42 -0
  328. package/src/common/types/token.ts +50 -0
  329. package/src/common/utils/adapter.ts +75 -0
  330. package/src/common/utils/address.ts +49 -0
  331. package/src/common/utils/bytes.ts +46 -0
  332. package/src/common/utils/chain.ts +103 -0
  333. package/src/common/utils/formulae.ts +124 -0
  334. package/src/common/utils/gmp.ts +16 -0
  335. package/src/common/utils/math-lib.ts +46 -0
  336. package/src/common/utils/messages.ts +192 -0
  337. package/src/common/utils/token.ts +7 -0
  338. package/src/index.ts +47 -0
  339. package/src/utils/exhaustive-check.ts +3 -0
  340. package/src/xchain/core/folks-core.ts +128 -0
  341. package/src/xchain/modules/folks-account.ts +385 -0
  342. package/src/xchain/modules/folks-gmp.ts +129 -0
  343. package/src/xchain/modules/folks-loan.ts +1175 -0
  344. package/src/xchain/modules/folks-oracle.ts +15 -0
  345. package/src/xchain/modules/folks-pool.ts +11 -0
  346. package/src/xchain/modules/index.ts +5 -0
@@ -0,0 +1,1346 @@
1
+ export const HubPoolAbi = [
2
+ { inputs: [], name: "AccessControlBadConfirmation", type: "error" },
3
+ {
4
+ inputs: [{ internalType: "uint48", name: "schedule", type: "uint48" }],
5
+ name: "AccessControlEnforcedDefaultAdminDelay",
6
+ type: "error",
7
+ },
8
+ { inputs: [], name: "AccessControlEnforcedDefaultAdminRules", type: "error" },
9
+ {
10
+ inputs: [{ internalType: "address", name: "defaultAdmin", type: "address" }],
11
+ name: "AccessControlInvalidDefaultAdmin",
12
+ type: "error",
13
+ },
14
+ {
15
+ inputs: [
16
+ { internalType: "address", name: "account", type: "address" },
17
+ { internalType: "bytes32", name: "neededRole", type: "bytes32" },
18
+ ],
19
+ name: "AccessControlUnauthorizedAccount",
20
+ type: "error",
21
+ },
22
+ {
23
+ inputs: [
24
+ { internalType: "address", name: "spender", type: "address" },
25
+ { internalType: "uint256", name: "allowance", type: "uint256" },
26
+ { internalType: "uint256", name: "needed", type: "uint256" },
27
+ ],
28
+ name: "ERC20InsufficientAllowance",
29
+ type: "error",
30
+ },
31
+ {
32
+ inputs: [
33
+ { internalType: "address", name: "sender", type: "address" },
34
+ { internalType: "uint256", name: "balance", type: "uint256" },
35
+ { internalType: "uint256", name: "needed", type: "uint256" },
36
+ ],
37
+ name: "ERC20InsufficientBalance",
38
+ type: "error",
39
+ },
40
+ {
41
+ inputs: [{ internalType: "address", name: "approver", type: "address" }],
42
+ name: "ERC20InvalidApprover",
43
+ type: "error",
44
+ },
45
+ {
46
+ inputs: [{ internalType: "address", name: "receiver", type: "address" }],
47
+ name: "ERC20InvalidReceiver",
48
+ type: "error",
49
+ },
50
+ {
51
+ inputs: [{ internalType: "address", name: "sender", type: "address" }],
52
+ name: "ERC20InvalidSender",
53
+ type: "error",
54
+ },
55
+ {
56
+ inputs: [{ internalType: "address", name: "spender", type: "address" }],
57
+ name: "ERC20InvalidSpender",
58
+ type: "error",
59
+ },
60
+ {
61
+ inputs: [{ internalType: "uint256", name: "maxLoan", type: "uint256" }],
62
+ name: "ERC3156ExceededMaxLoan",
63
+ type: "error",
64
+ },
65
+ {
66
+ inputs: [{ internalType: "address", name: "receiver", type: "address" }],
67
+ name: "ERC3156InvalidReceiver",
68
+ type: "error",
69
+ },
70
+ {
71
+ inputs: [{ internalType: "address", name: "token", type: "address" }],
72
+ name: "ERC3156UnsupportedToken",
73
+ type: "error",
74
+ },
75
+ {
76
+ inputs: [{ internalType: "uint16", name: "chainId", type: "uint16" }],
77
+ name: "ExistingChainSpoke",
78
+ type: "error",
79
+ },
80
+ { inputs: [], name: "FlashLoanFeeTooHigh", type: "error" },
81
+ { inputs: [], name: "MathOverflowedMulDiv", type: "error" },
82
+ { inputs: [], name: "MaxStableInterestRateTooHigh", type: "error" },
83
+ { inputs: [], name: "MaxVariableInterestRateTooHigh", type: "error" },
84
+ {
85
+ inputs: [{ internalType: "uint16", name: "chainId", type: "uint16" }],
86
+ name: "NoChainSpoke",
87
+ type: "error",
88
+ },
89
+ { inputs: [], name: "OptimalStableToTotalDebtRatioTooHigh", type: "error" },
90
+ { inputs: [], name: "OptimalUtilisationRatioTooHigh", type: "error" },
91
+ { inputs: [], name: "OptimalUtilisationRatioTooLow", type: "error" },
92
+ { inputs: [], name: "RebalanceUpDepositInterestRateTooHigh", type: "error" },
93
+ { inputs: [], name: "RebalanceUpUtilisationRatioTooHigh", type: "error" },
94
+ { inputs: [], name: "ReentrancyGuardReentrantCall", type: "error" },
95
+ { inputs: [], name: "RetentionRateTooHigh", type: "error" },
96
+ {
97
+ inputs: [
98
+ { internalType: "uint8", name: "bits", type: "uint8" },
99
+ { internalType: "uint256", name: "value", type: "uint256" },
100
+ ],
101
+ name: "SafeCastOverflowedUintDowncast",
102
+ type: "error",
103
+ },
104
+ { inputs: [], name: "StableBorrowPercentageTooHigh", type: "error" },
105
+ {
106
+ inputs: [
107
+ { internalType: "uint16", name: "chainId", type: "uint16" },
108
+ { internalType: "bytes32", name: "expected", type: "bytes32" },
109
+ { internalType: "bytes32", name: "actual", type: "bytes32" },
110
+ ],
111
+ name: "UnmatchedChainSpoke",
112
+ type: "error",
113
+ },
114
+ {
115
+ anonymous: false,
116
+ inputs: [
117
+ {
118
+ indexed: true,
119
+ internalType: "address",
120
+ name: "owner",
121
+ type: "address",
122
+ },
123
+ {
124
+ indexed: true,
125
+ internalType: "address",
126
+ name: "spender",
127
+ type: "address",
128
+ },
129
+ {
130
+ indexed: false,
131
+ internalType: "uint256",
132
+ name: "value",
133
+ type: "uint256",
134
+ },
135
+ ],
136
+ name: "Approval",
137
+ type: "event",
138
+ },
139
+ {
140
+ anonymous: false,
141
+ inputs: [
142
+ {
143
+ indexed: false,
144
+ internalType: "uint256",
145
+ name: "amount",
146
+ type: "uint256",
147
+ },
148
+ ],
149
+ name: "ClearTokenFees",
150
+ type: "event",
151
+ },
152
+ {
153
+ anonymous: false,
154
+ inputs: [],
155
+ name: "DefaultAdminDelayChangeCanceled",
156
+ type: "event",
157
+ },
158
+ {
159
+ anonymous: false,
160
+ inputs: [
161
+ {
162
+ indexed: false,
163
+ internalType: "uint48",
164
+ name: "newDelay",
165
+ type: "uint48",
166
+ },
167
+ {
168
+ indexed: false,
169
+ internalType: "uint48",
170
+ name: "effectSchedule",
171
+ type: "uint48",
172
+ },
173
+ ],
174
+ name: "DefaultAdminDelayChangeScheduled",
175
+ type: "event",
176
+ },
177
+ {
178
+ anonymous: false,
179
+ inputs: [],
180
+ name: "DefaultAdminTransferCanceled",
181
+ type: "event",
182
+ },
183
+ {
184
+ anonymous: false,
185
+ inputs: [
186
+ {
187
+ indexed: true,
188
+ internalType: "address",
189
+ name: "newAdmin",
190
+ type: "address",
191
+ },
192
+ {
193
+ indexed: false,
194
+ internalType: "uint48",
195
+ name: "acceptSchedule",
196
+ type: "uint48",
197
+ },
198
+ ],
199
+ name: "DefaultAdminTransferScheduled",
200
+ type: "event",
201
+ },
202
+ {
203
+ anonymous: false,
204
+ inputs: [
205
+ {
206
+ indexed: false,
207
+ internalType: "uint256",
208
+ name: "variableBorrowInterestIndex",
209
+ type: "uint256",
210
+ },
211
+ {
212
+ indexed: false,
213
+ internalType: "uint256",
214
+ name: "depositInterestIndex",
215
+ type: "uint256",
216
+ },
217
+ {
218
+ indexed: false,
219
+ internalType: "uint256",
220
+ name: "lastUpdateTimestamp",
221
+ type: "uint256",
222
+ },
223
+ ],
224
+ name: "InterestIndexesUpdated",
225
+ type: "event",
226
+ },
227
+ {
228
+ anonymous: false,
229
+ inputs: [
230
+ {
231
+ indexed: false,
232
+ internalType: "uint256",
233
+ name: "variableBorrowInterestRate",
234
+ type: "uint256",
235
+ },
236
+ {
237
+ indexed: false,
238
+ internalType: "uint256",
239
+ name: "stableBorrowInterestRate",
240
+ type: "uint256",
241
+ },
242
+ {
243
+ indexed: false,
244
+ internalType: "uint256",
245
+ name: "depositInterestRate",
246
+ type: "uint256",
247
+ },
248
+ ],
249
+ name: "InterestRatesUpdated",
250
+ type: "event",
251
+ },
252
+ {
253
+ anonymous: false,
254
+ inputs: [
255
+ { indexed: true, internalType: "bytes32", name: "role", type: "bytes32" },
256
+ {
257
+ indexed: true,
258
+ internalType: "bytes32",
259
+ name: "previousAdminRole",
260
+ type: "bytes32",
261
+ },
262
+ {
263
+ indexed: true,
264
+ internalType: "bytes32",
265
+ name: "newAdminRole",
266
+ type: "bytes32",
267
+ },
268
+ ],
269
+ name: "RoleAdminChanged",
270
+ type: "event",
271
+ },
272
+ {
273
+ anonymous: false,
274
+ inputs: [
275
+ { indexed: true, internalType: "bytes32", name: "role", type: "bytes32" },
276
+ {
277
+ indexed: true,
278
+ internalType: "address",
279
+ name: "account",
280
+ type: "address",
281
+ },
282
+ {
283
+ indexed: true,
284
+ internalType: "address",
285
+ name: "sender",
286
+ type: "address",
287
+ },
288
+ ],
289
+ name: "RoleGranted",
290
+ type: "event",
291
+ },
292
+ {
293
+ anonymous: false,
294
+ inputs: [
295
+ { indexed: true, internalType: "bytes32", name: "role", type: "bytes32" },
296
+ {
297
+ indexed: true,
298
+ internalType: "address",
299
+ name: "account",
300
+ type: "address",
301
+ },
302
+ {
303
+ indexed: true,
304
+ internalType: "address",
305
+ name: "sender",
306
+ type: "address",
307
+ },
308
+ ],
309
+ name: "RoleRevoked",
310
+ type: "event",
311
+ },
312
+ {
313
+ anonymous: false,
314
+ inputs: [
315
+ { indexed: true, internalType: "address", name: "from", type: "address" },
316
+ { indexed: true, internalType: "address", name: "to", type: "address" },
317
+ {
318
+ indexed: false,
319
+ internalType: "uint256",
320
+ name: "value",
321
+ type: "uint256",
322
+ },
323
+ ],
324
+ name: "Transfer",
325
+ type: "event",
326
+ },
327
+ {
328
+ inputs: [],
329
+ name: "DEFAULT_ADMIN_ROLE",
330
+ outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }],
331
+ stateMutability: "view",
332
+ type: "function",
333
+ },
334
+ {
335
+ inputs: [],
336
+ name: "HUB_ROLE",
337
+ outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }],
338
+ stateMutability: "view",
339
+ type: "function",
340
+ },
341
+ {
342
+ inputs: [],
343
+ name: "LOAN_MANAGER_ROLE",
344
+ outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }],
345
+ stateMutability: "view",
346
+ type: "function",
347
+ },
348
+ {
349
+ inputs: [],
350
+ name: "ORACLE_ROLE",
351
+ outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }],
352
+ stateMutability: "view",
353
+ type: "function",
354
+ },
355
+ {
356
+ inputs: [],
357
+ name: "PARAM_ROLE",
358
+ outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }],
359
+ stateMutability: "view",
360
+ type: "function",
361
+ },
362
+ {
363
+ inputs: [],
364
+ name: "acceptDefaultAdminTransfer",
365
+ outputs: [],
366
+ stateMutability: "nonpayable",
367
+ type: "function",
368
+ },
369
+ {
370
+ inputs: [
371
+ { internalType: "address", name: "owner", type: "address" },
372
+ { internalType: "address", name: "spender", type: "address" },
373
+ ],
374
+ name: "allowance",
375
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
376
+ stateMutability: "view",
377
+ type: "function",
378
+ },
379
+ {
380
+ inputs: [
381
+ { internalType: "address", name: "spender", type: "address" },
382
+ { internalType: "uint256", name: "value", type: "uint256" },
383
+ ],
384
+ name: "approve",
385
+ outputs: [{ internalType: "bool", name: "", type: "bool" }],
386
+ stateMutability: "nonpayable",
387
+ type: "function",
388
+ },
389
+ {
390
+ inputs: [{ internalType: "address", name: "account", type: "address" }],
391
+ name: "balanceOf",
392
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
393
+ stateMutability: "view",
394
+ type: "function",
395
+ },
396
+ {
397
+ inputs: [{ internalType: "address", name: "newAdmin", type: "address" }],
398
+ name: "beginDefaultAdminTransfer",
399
+ outputs: [],
400
+ stateMutability: "nonpayable",
401
+ type: "function",
402
+ },
403
+ {
404
+ inputs: [
405
+ { internalType: "address", name: "sender", type: "address" },
406
+ { internalType: "uint256", name: "amount", type: "uint256" },
407
+ ],
408
+ name: "burnFToken",
409
+ outputs: [],
410
+ stateMutability: "nonpayable",
411
+ type: "function",
412
+ },
413
+ {
414
+ inputs: [],
415
+ name: "cancelDefaultAdminTransfer",
416
+ outputs: [],
417
+ stateMutability: "nonpayable",
418
+ type: "function",
419
+ },
420
+ {
421
+ inputs: [{ internalType: "uint48", name: "newDelay", type: "uint48" }],
422
+ name: "changeDefaultAdminDelay",
423
+ outputs: [],
424
+ stateMutability: "nonpayable",
425
+ type: "function",
426
+ },
427
+ {
428
+ inputs: [],
429
+ name: "clearTokenFees",
430
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
431
+ stateMutability: "nonpayable",
432
+ type: "function",
433
+ },
434
+ {
435
+ inputs: [],
436
+ name: "decimals",
437
+ outputs: [{ internalType: "uint8", name: "", type: "uint8" }],
438
+ stateMutability: "view",
439
+ type: "function",
440
+ },
441
+ {
442
+ inputs: [],
443
+ name: "defaultAdmin",
444
+ outputs: [{ internalType: "address", name: "", type: "address" }],
445
+ stateMutability: "view",
446
+ type: "function",
447
+ },
448
+ {
449
+ inputs: [],
450
+ name: "defaultAdminDelay",
451
+ outputs: [{ internalType: "uint48", name: "", type: "uint48" }],
452
+ stateMutability: "view",
453
+ type: "function",
454
+ },
455
+ {
456
+ inputs: [],
457
+ name: "defaultAdminDelayIncreaseWait",
458
+ outputs: [{ internalType: "uint48", name: "", type: "uint48" }],
459
+ stateMutability: "view",
460
+ type: "function",
461
+ },
462
+ {
463
+ inputs: [
464
+ { internalType: "address", name: "token", type: "address" },
465
+ { internalType: "uint256", name: "value", type: "uint256" },
466
+ ],
467
+ name: "flashFee",
468
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
469
+ stateMutability: "view",
470
+ type: "function",
471
+ },
472
+ {
473
+ inputs: [
474
+ {
475
+ internalType: "contract IERC3156FlashBorrower",
476
+ name: "receiver",
477
+ type: "address",
478
+ },
479
+ { internalType: "address", name: "token", type: "address" },
480
+ { internalType: "uint256", name: "value", type: "uint256" },
481
+ { internalType: "bytes", name: "data", type: "bytes" },
482
+ ],
483
+ name: "flashLoan",
484
+ outputs: [{ internalType: "bool", name: "", type: "bool" }],
485
+ stateMutability: "nonpayable",
486
+ type: "function",
487
+ },
488
+ {
489
+ inputs: [],
490
+ name: "getCapsData",
491
+ outputs: [
492
+ {
493
+ components: [
494
+ { internalType: "uint64", name: "deposit", type: "uint64" },
495
+ { internalType: "uint64", name: "borrow", type: "uint64" },
496
+ {
497
+ internalType: "uint64",
498
+ name: "stableBorrowPercentage",
499
+ type: "uint64",
500
+ },
501
+ ],
502
+ internalType: "struct HubPoolState.CapsData",
503
+ name: "",
504
+ type: "tuple",
505
+ },
506
+ ],
507
+ stateMutability: "view",
508
+ type: "function",
509
+ },
510
+ {
511
+ inputs: [{ internalType: "uint16", name: "chainId", type: "uint16" }],
512
+ name: "getChainSpoke",
513
+ outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }],
514
+ stateMutability: "view",
515
+ type: "function",
516
+ },
517
+ {
518
+ inputs: [],
519
+ name: "getConfigData",
520
+ outputs: [
521
+ {
522
+ components: [
523
+ { internalType: "bool", name: "deprecated", type: "bool" },
524
+ { internalType: "bool", name: "stableBorrowSupported", type: "bool" },
525
+ { internalType: "bool", name: "canMintFToken", type: "bool" },
526
+ { internalType: "bool", name: "flashLoanSupported", type: "bool" },
527
+ ],
528
+ internalType: "struct HubPoolState.ConfigData",
529
+ name: "",
530
+ type: "tuple",
531
+ },
532
+ ],
533
+ stateMutability: "view",
534
+ type: "function",
535
+ },
536
+ {
537
+ inputs: [],
538
+ name: "getDepositData",
539
+ outputs: [
540
+ {
541
+ components: [
542
+ {
543
+ internalType: "uint16",
544
+ name: "optimalUtilisationRatio",
545
+ type: "uint16",
546
+ },
547
+ { internalType: "uint256", name: "totalAmount", type: "uint256" },
548
+ { internalType: "uint256", name: "interestRate", type: "uint256" },
549
+ { internalType: "uint256", name: "interestIndex", type: "uint256" },
550
+ ],
551
+ internalType: "struct HubPoolState.DepositData",
552
+ name: "",
553
+ type: "tuple",
554
+ },
555
+ ],
556
+ stateMutability: "view",
557
+ type: "function",
558
+ },
559
+ {
560
+ inputs: [],
561
+ name: "getFeeData",
562
+ outputs: [
563
+ {
564
+ components: [
565
+ { internalType: "uint32", name: "flashLoanFee", type: "uint32" },
566
+ { internalType: "uint32", name: "retentionRate", type: "uint32" },
567
+ {
568
+ internalType: "address",
569
+ name: "fTokenFeeRecipient",
570
+ type: "address",
571
+ },
572
+ { internalType: "address", name: "tokenFeeClaimer", type: "address" },
573
+ {
574
+ internalType: "uint256",
575
+ name: "totalRetainedAmount",
576
+ type: "uint256",
577
+ },
578
+ {
579
+ internalType: "bytes32",
580
+ name: "tokenFeeRecipient",
581
+ type: "bytes32",
582
+ },
583
+ ],
584
+ internalType: "struct HubPoolState.FeeData",
585
+ name: "",
586
+ type: "tuple",
587
+ },
588
+ ],
589
+ stateMutability: "view",
590
+ type: "function",
591
+ },
592
+ {
593
+ inputs: [],
594
+ name: "getLastUpdateTimestamp",
595
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
596
+ stateMutability: "view",
597
+ type: "function",
598
+ },
599
+ {
600
+ inputs: [],
601
+ name: "getOracleManager",
602
+ outputs: [{ internalType: "address", name: "", type: "address" }],
603
+ stateMutability: "view",
604
+ type: "function",
605
+ },
606
+ {
607
+ inputs: [],
608
+ name: "getPoolId",
609
+ outputs: [{ internalType: "uint8", name: "", type: "uint8" }],
610
+ stateMutability: "view",
611
+ type: "function",
612
+ },
613
+ {
614
+ inputs: [{ internalType: "bytes32", name: "role", type: "bytes32" }],
615
+ name: "getRoleAdmin",
616
+ outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }],
617
+ stateMutability: "view",
618
+ type: "function",
619
+ },
620
+ {
621
+ inputs: [
622
+ {
623
+ internalType: "contract IBridgeRouter",
624
+ name: "bridgeRouter",
625
+ type: "address",
626
+ },
627
+ { internalType: "uint16", name: "adapterId", type: "uint16" },
628
+ { internalType: "uint256", name: "gasLimit", type: "uint256" },
629
+ { internalType: "bytes32", name: "accountId", type: "bytes32" },
630
+ { internalType: "uint16", name: "chainId", type: "uint16" },
631
+ { internalType: "uint256", name: "amount", type: "uint256" },
632
+ { internalType: "bytes32", name: "recipient", type: "bytes32" },
633
+ ],
634
+ name: "getSendTokenMessage",
635
+ outputs: [
636
+ {
637
+ components: [
638
+ {
639
+ components: [
640
+ { internalType: "uint16", name: "adapterId", type: "uint16" },
641
+ {
642
+ internalType: "uint16",
643
+ name: "returnAdapterId",
644
+ type: "uint16",
645
+ },
646
+ {
647
+ internalType: "uint256",
648
+ name: "receiverValue",
649
+ type: "uint256",
650
+ },
651
+ { internalType: "uint256", name: "gasLimit", type: "uint256" },
652
+ {
653
+ internalType: "uint256",
654
+ name: "returnGasLimit",
655
+ type: "uint256",
656
+ },
657
+ ],
658
+ internalType: "struct Messages.MessageParams",
659
+ name: "params",
660
+ type: "tuple",
661
+ },
662
+ { internalType: "bytes32", name: "sender", type: "bytes32" },
663
+ {
664
+ internalType: "uint16",
665
+ name: "destinationChainId",
666
+ type: "uint16",
667
+ },
668
+ { internalType: "bytes32", name: "handler", type: "bytes32" },
669
+ { internalType: "bytes", name: "payload", type: "bytes" },
670
+ { internalType: "uint64", name: "finalityLevel", type: "uint64" },
671
+ { internalType: "bytes", name: "extraArgs", type: "bytes" },
672
+ ],
673
+ internalType: "struct Messages.MessageToSend",
674
+ name: "",
675
+ type: "tuple",
676
+ },
677
+ ],
678
+ stateMutability: "nonpayable",
679
+ type: "function",
680
+ },
681
+ {
682
+ inputs: [],
683
+ name: "getStableBorrowData",
684
+ outputs: [
685
+ {
686
+ components: [
687
+ { internalType: "uint32", name: "sr0", type: "uint32" },
688
+ { internalType: "uint32", name: "sr1", type: "uint32" },
689
+ { internalType: "uint32", name: "sr2", type: "uint32" },
690
+ { internalType: "uint32", name: "sr3", type: "uint32" },
691
+ {
692
+ internalType: "uint16",
693
+ name: "optimalStableToTotalDebtRatio",
694
+ type: "uint16",
695
+ },
696
+ {
697
+ internalType: "uint16",
698
+ name: "rebalanceUpUtilisationRatio",
699
+ type: "uint16",
700
+ },
701
+ {
702
+ internalType: "uint16",
703
+ name: "rebalanceUpDepositInterestRate",
704
+ type: "uint16",
705
+ },
706
+ {
707
+ internalType: "uint16",
708
+ name: "rebalanceDownDelta",
709
+ type: "uint16",
710
+ },
711
+ { internalType: "uint256", name: "totalAmount", type: "uint256" },
712
+ { internalType: "uint256", name: "interestRate", type: "uint256" },
713
+ {
714
+ internalType: "uint256",
715
+ name: "averageInterestRate",
716
+ type: "uint256",
717
+ },
718
+ ],
719
+ internalType: "struct HubPoolState.StableBorrowData",
720
+ name: "",
721
+ type: "tuple",
722
+ },
723
+ ],
724
+ stateMutability: "view",
725
+ type: "function",
726
+ },
727
+ {
728
+ inputs: [],
729
+ name: "getTokenFeeClaimer",
730
+ outputs: [{ internalType: "address", name: "", type: "address" }],
731
+ stateMutability: "view",
732
+ type: "function",
733
+ },
734
+ {
735
+ inputs: [],
736
+ name: "getTokenFeeRecipient",
737
+ outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }],
738
+ stateMutability: "view",
739
+ type: "function",
740
+ },
741
+ {
742
+ inputs: [],
743
+ name: "getUpdatedDepositInterestIndex",
744
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
745
+ stateMutability: "view",
746
+ type: "function",
747
+ },
748
+ {
749
+ inputs: [],
750
+ name: "getUpdatedVariableBorrowInterestIndex",
751
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
752
+ stateMutability: "view",
753
+ type: "function",
754
+ },
755
+ {
756
+ inputs: [],
757
+ name: "getVariableBorrowData",
758
+ outputs: [
759
+ {
760
+ components: [
761
+ { internalType: "uint32", name: "vr0", type: "uint32" },
762
+ { internalType: "uint32", name: "vr1", type: "uint32" },
763
+ { internalType: "uint32", name: "vr2", type: "uint32" },
764
+ { internalType: "uint256", name: "totalAmount", type: "uint256" },
765
+ { internalType: "uint256", name: "interestRate", type: "uint256" },
766
+ { internalType: "uint256", name: "interestIndex", type: "uint256" },
767
+ ],
768
+ internalType: "struct HubPoolState.VariableBorrowData",
769
+ name: "",
770
+ type: "tuple",
771
+ },
772
+ ],
773
+ stateMutability: "view",
774
+ type: "function",
775
+ },
776
+ {
777
+ inputs: [
778
+ { internalType: "bytes32", name: "role", type: "bytes32" },
779
+ { internalType: "address", name: "account", type: "address" },
780
+ ],
781
+ name: "grantRole",
782
+ outputs: [],
783
+ stateMutability: "nonpayable",
784
+ type: "function",
785
+ },
786
+ {
787
+ inputs: [
788
+ { internalType: "bytes32", name: "role", type: "bytes32" },
789
+ { internalType: "address", name: "account", type: "address" },
790
+ ],
791
+ name: "hasRole",
792
+ outputs: [{ internalType: "bool", name: "", type: "bool" }],
793
+ stateMutability: "view",
794
+ type: "function",
795
+ },
796
+ {
797
+ inputs: [{ internalType: "address", name: "token", type: "address" }],
798
+ name: "maxFlashLoan",
799
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
800
+ stateMutability: "view",
801
+ type: "function",
802
+ },
803
+ {
804
+ inputs: [
805
+ { internalType: "address", name: "recipient", type: "address" },
806
+ { internalType: "uint256", name: "amount", type: "uint256" },
807
+ ],
808
+ name: "mintFToken",
809
+ outputs: [],
810
+ stateMutability: "nonpayable",
811
+ type: "function",
812
+ },
813
+ {
814
+ inputs: [{ internalType: "uint256", name: "amount", type: "uint256" }],
815
+ name: "mintFTokenForFeeRecipient",
816
+ outputs: [],
817
+ stateMutability: "nonpayable",
818
+ type: "function",
819
+ },
820
+ {
821
+ inputs: [],
822
+ name: "name",
823
+ outputs: [{ internalType: "string", name: "", type: "string" }],
824
+ stateMutability: "view",
825
+ type: "function",
826
+ },
827
+ {
828
+ inputs: [],
829
+ name: "owner",
830
+ outputs: [{ internalType: "address", name: "", type: "address" }],
831
+ stateMutability: "view",
832
+ type: "function",
833
+ },
834
+ {
835
+ inputs: [],
836
+ name: "pendingDefaultAdmin",
837
+ outputs: [
838
+ { internalType: "address", name: "newAdmin", type: "address" },
839
+ { internalType: "uint48", name: "schedule", type: "uint48" },
840
+ ],
841
+ stateMutability: "view",
842
+ type: "function",
843
+ },
844
+ {
845
+ inputs: [],
846
+ name: "pendingDefaultAdminDelay",
847
+ outputs: [
848
+ { internalType: "uint48", name: "newDelay", type: "uint48" },
849
+ { internalType: "uint48", name: "schedule", type: "uint48" },
850
+ ],
851
+ stateMutability: "view",
852
+ type: "function",
853
+ },
854
+ {
855
+ inputs: [],
856
+ name: "poolId",
857
+ outputs: [{ internalType: "uint8", name: "", type: "uint8" }],
858
+ stateMutability: "view",
859
+ type: "function",
860
+ },
861
+ {
862
+ inputs: [
863
+ { internalType: "uint256", name: "amount", type: "uint256" },
864
+ { internalType: "uint256", name: "maxStableRate", type: "uint256" },
865
+ ],
866
+ name: "preparePoolForBorrow",
867
+ outputs: [
868
+ {
869
+ components: [
870
+ {
871
+ internalType: "uint256",
872
+ name: "variableInterestIndex",
873
+ type: "uint256",
874
+ },
875
+ {
876
+ internalType: "uint256",
877
+ name: "stableInterestRate",
878
+ type: "uint256",
879
+ },
880
+ ],
881
+ internalType: "struct DataTypes.BorrowPoolParams",
882
+ name: "borrowPoolParams",
883
+ type: "tuple",
884
+ },
885
+ ],
886
+ stateMutability: "nonpayable",
887
+ type: "function",
888
+ },
889
+ {
890
+ inputs: [],
891
+ name: "preparePoolForRebalanceDown",
892
+ outputs: [
893
+ {
894
+ components: [
895
+ {
896
+ internalType: "uint256",
897
+ name: "variableInterestIndex",
898
+ type: "uint256",
899
+ },
900
+ {
901
+ internalType: "uint256",
902
+ name: "stableInterestRate",
903
+ type: "uint256",
904
+ },
905
+ { internalType: "uint256", name: "threshold", type: "uint256" },
906
+ ],
907
+ internalType: "struct DataTypes.RebalanceDownPoolParams",
908
+ name: "rebalanceDownPoolParams",
909
+ type: "tuple",
910
+ },
911
+ ],
912
+ stateMutability: "nonpayable",
913
+ type: "function",
914
+ },
915
+ {
916
+ inputs: [],
917
+ name: "preparePoolForRebalanceUp",
918
+ outputs: [
919
+ {
920
+ components: [
921
+ {
922
+ internalType: "uint256",
923
+ name: "variableInterestIndex",
924
+ type: "uint256",
925
+ },
926
+ {
927
+ internalType: "uint256",
928
+ name: "stableInterestRate",
929
+ type: "uint256",
930
+ },
931
+ ],
932
+ internalType: "struct DataTypes.BorrowPoolParams",
933
+ name: "borrowPoolParams",
934
+ type: "tuple",
935
+ },
936
+ ],
937
+ stateMutability: "nonpayable",
938
+ type: "function",
939
+ },
940
+ {
941
+ inputs: [],
942
+ name: "preparePoolForRepay",
943
+ outputs: [
944
+ {
945
+ components: [
946
+ {
947
+ internalType: "uint256",
948
+ name: "variableInterestIndex",
949
+ type: "uint256",
950
+ },
951
+ {
952
+ internalType: "uint256",
953
+ name: "stableInterestRate",
954
+ type: "uint256",
955
+ },
956
+ ],
957
+ internalType: "struct DataTypes.BorrowPoolParams",
958
+ name: "",
959
+ type: "tuple",
960
+ },
961
+ ],
962
+ stateMutability: "nonpayable",
963
+ type: "function",
964
+ },
965
+ {
966
+ inputs: [
967
+ { internalType: "uint256", name: "amount", type: "uint256" },
968
+ { internalType: "uint256", name: "maxStableRate", type: "uint256" },
969
+ ],
970
+ name: "preparePoolForSwitchBorrowType",
971
+ outputs: [
972
+ {
973
+ components: [
974
+ {
975
+ internalType: "uint256",
976
+ name: "variableInterestIndex",
977
+ type: "uint256",
978
+ },
979
+ {
980
+ internalType: "uint256",
981
+ name: "stableInterestRate",
982
+ type: "uint256",
983
+ },
984
+ ],
985
+ internalType: "struct DataTypes.BorrowPoolParams",
986
+ name: "borrowPoolParams",
987
+ type: "tuple",
988
+ },
989
+ ],
990
+ stateMutability: "nonpayable",
991
+ type: "function",
992
+ },
993
+ {
994
+ inputs: [],
995
+ name: "preparePoolForWithdrawFToken",
996
+ outputs: [],
997
+ stateMutability: "view",
998
+ type: "function",
999
+ },
1000
+ {
1001
+ inputs: [
1002
+ { internalType: "bytes32", name: "role", type: "bytes32" },
1003
+ { internalType: "address", name: "account", type: "address" },
1004
+ ],
1005
+ name: "renounceRole",
1006
+ outputs: [],
1007
+ stateMutability: "nonpayable",
1008
+ type: "function",
1009
+ },
1010
+ {
1011
+ inputs: [
1012
+ { internalType: "bytes32", name: "role", type: "bytes32" },
1013
+ { internalType: "address", name: "account", type: "address" },
1014
+ ],
1015
+ name: "revokeRole",
1016
+ outputs: [],
1017
+ stateMutability: "nonpayable",
1018
+ type: "function",
1019
+ },
1020
+ {
1021
+ inputs: [],
1022
+ name: "rollbackDefaultAdminDelay",
1023
+ outputs: [],
1024
+ stateMutability: "nonpayable",
1025
+ type: "function",
1026
+ },
1027
+ {
1028
+ inputs: [{ internalType: "bytes4", name: "interfaceId", type: "bytes4" }],
1029
+ name: "supportsInterface",
1030
+ outputs: [{ internalType: "bool", name: "", type: "bool" }],
1031
+ stateMutability: "view",
1032
+ type: "function",
1033
+ },
1034
+ {
1035
+ inputs: [],
1036
+ name: "symbol",
1037
+ outputs: [{ internalType: "string", name: "", type: "string" }],
1038
+ stateMutability: "view",
1039
+ type: "function",
1040
+ },
1041
+ {
1042
+ inputs: [],
1043
+ name: "totalSupply",
1044
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
1045
+ stateMutability: "view",
1046
+ type: "function",
1047
+ },
1048
+ {
1049
+ inputs: [
1050
+ { internalType: "address", name: "to", type: "address" },
1051
+ { internalType: "uint256", name: "value", type: "uint256" },
1052
+ ],
1053
+ name: "transfer",
1054
+ outputs: [{ internalType: "bool", name: "", type: "bool" }],
1055
+ stateMutability: "nonpayable",
1056
+ type: "function",
1057
+ },
1058
+ {
1059
+ inputs: [
1060
+ { internalType: "address", name: "from", type: "address" },
1061
+ { internalType: "address", name: "to", type: "address" },
1062
+ { internalType: "uint256", name: "value", type: "uint256" },
1063
+ ],
1064
+ name: "transferFrom",
1065
+ outputs: [{ internalType: "bool", name: "", type: "bool" }],
1066
+ stateMutability: "nonpayable",
1067
+ type: "function",
1068
+ },
1069
+ {
1070
+ inputs: [
1071
+ {
1072
+ components: [
1073
+ { internalType: "uint64", name: "deposit", type: "uint64" },
1074
+ { internalType: "uint64", name: "borrow", type: "uint64" },
1075
+ {
1076
+ internalType: "uint64",
1077
+ name: "stableBorrowPercentage",
1078
+ type: "uint64",
1079
+ },
1080
+ ],
1081
+ internalType: "struct HubPoolState.CapsData",
1082
+ name: "capsData",
1083
+ type: "tuple",
1084
+ },
1085
+ ],
1086
+ name: "updateCapsData",
1087
+ outputs: [],
1088
+ stateMutability: "nonpayable",
1089
+ type: "function",
1090
+ },
1091
+ {
1092
+ inputs: [
1093
+ {
1094
+ components: [
1095
+ { internalType: "bool", name: "deprecated", type: "bool" },
1096
+ { internalType: "bool", name: "stableBorrowSupported", type: "bool" },
1097
+ { internalType: "bool", name: "canMintFToken", type: "bool" },
1098
+ { internalType: "bool", name: "flashLoanSupported", type: "bool" },
1099
+ ],
1100
+ internalType: "struct HubPoolState.ConfigData",
1101
+ name: "configData",
1102
+ type: "tuple",
1103
+ },
1104
+ ],
1105
+ name: "updateConfigData",
1106
+ outputs: [],
1107
+ stateMutability: "nonpayable",
1108
+ type: "function",
1109
+ },
1110
+ {
1111
+ inputs: [
1112
+ {
1113
+ internalType: "uint16",
1114
+ name: "optimalUtilisationRatio",
1115
+ type: "uint16",
1116
+ },
1117
+ ],
1118
+ name: "updateDepositData",
1119
+ outputs: [],
1120
+ stateMutability: "nonpayable",
1121
+ type: "function",
1122
+ },
1123
+ {
1124
+ inputs: [
1125
+ { internalType: "uint32", name: "flashLoanFee", type: "uint32" },
1126
+ { internalType: "uint32", name: "retentionRate", type: "uint32" },
1127
+ { internalType: "address", name: "fTokenFeeRecipient", type: "address" },
1128
+ { internalType: "address", name: "tokenFeeClaimer", type: "address" },
1129
+ { internalType: "bytes32", name: "tokenFeeRecipient", type: "bytes32" },
1130
+ ],
1131
+ name: "updateFeeData",
1132
+ outputs: [],
1133
+ stateMutability: "nonpayable",
1134
+ type: "function",
1135
+ },
1136
+ {
1137
+ inputs: [],
1138
+ name: "updateInterestIndexes",
1139
+ outputs: [],
1140
+ stateMutability: "nonpayable",
1141
+ type: "function",
1142
+ },
1143
+ {
1144
+ inputs: [
1145
+ {
1146
+ internalType: "contract IOracleManager",
1147
+ name: "newOracleManager",
1148
+ type: "address",
1149
+ },
1150
+ ],
1151
+ name: "updateOracleManager",
1152
+ outputs: [],
1153
+ stateMutability: "nonpayable",
1154
+ type: "function",
1155
+ },
1156
+ {
1157
+ inputs: [
1158
+ { internalType: "uint256", name: "amount", type: "uint256" },
1159
+ { internalType: "bool", name: "isStable", type: "bool" },
1160
+ ],
1161
+ name: "updatePoolWithBorrow",
1162
+ outputs: [],
1163
+ stateMutability: "nonpayable",
1164
+ type: "function",
1165
+ },
1166
+ {
1167
+ inputs: [{ internalType: "uint256", name: "amount", type: "uint256" }],
1168
+ name: "updatePoolWithDeposit",
1169
+ outputs: [
1170
+ {
1171
+ components: [
1172
+ { internalType: "uint256", name: "fAmount", type: "uint256" },
1173
+ {
1174
+ internalType: "uint256",
1175
+ name: "depositInterestIndex",
1176
+ type: "uint256",
1177
+ },
1178
+ {
1179
+ components: [
1180
+ { internalType: "uint256", name: "price", type: "uint256" },
1181
+ { internalType: "uint8", name: "decimals", type: "uint8" },
1182
+ ],
1183
+ internalType: "struct DataTypes.PriceFeed",
1184
+ name: "priceFeed",
1185
+ type: "tuple",
1186
+ },
1187
+ ],
1188
+ internalType: "struct DataTypes.DepositPoolParams",
1189
+ name: "",
1190
+ type: "tuple",
1191
+ },
1192
+ ],
1193
+ stateMutability: "nonpayable",
1194
+ type: "function",
1195
+ },
1196
+ {
1197
+ inputs: [],
1198
+ name: "updatePoolWithLiquidation",
1199
+ outputs: [],
1200
+ stateMutability: "nonpayable",
1201
+ type: "function",
1202
+ },
1203
+ {
1204
+ inputs: [
1205
+ { internalType: "uint256", name: "amount", type: "uint256" },
1206
+ {
1207
+ internalType: "uint256",
1208
+ name: "oldLoanStableInterestRate",
1209
+ type: "uint256",
1210
+ },
1211
+ ],
1212
+ name: "updatePoolWithRebalanceDown",
1213
+ outputs: [],
1214
+ stateMutability: "nonpayable",
1215
+ type: "function",
1216
+ },
1217
+ {
1218
+ inputs: [
1219
+ { internalType: "uint256", name: "amount", type: "uint256" },
1220
+ {
1221
+ internalType: "uint256",
1222
+ name: "oldLoanStableInterestRate",
1223
+ type: "uint256",
1224
+ },
1225
+ ],
1226
+ name: "updatePoolWithRebalanceUp",
1227
+ outputs: [],
1228
+ stateMutability: "nonpayable",
1229
+ type: "function",
1230
+ },
1231
+ {
1232
+ inputs: [
1233
+ { internalType: "uint256", name: "principalPaid", type: "uint256" },
1234
+ { internalType: "uint256", name: "interestPaid", type: "uint256" },
1235
+ { internalType: "uint256", name: "loanStableRate", type: "uint256" },
1236
+ { internalType: "uint256", name: "excessAmount", type: "uint256" },
1237
+ ],
1238
+ name: "updatePoolWithRepay",
1239
+ outputs: [],
1240
+ stateMutability: "nonpayable",
1241
+ type: "function",
1242
+ },
1243
+ {
1244
+ inputs: [
1245
+ { internalType: "uint256", name: "principalPaid", type: "uint256" },
1246
+ { internalType: "uint256", name: "interestPaid", type: "uint256" },
1247
+ { internalType: "uint256", name: "loanStableRate", type: "uint256" },
1248
+ ],
1249
+ name: "updatePoolWithRepayWithCollateral",
1250
+ outputs: [
1251
+ {
1252
+ components: [{ internalType: "uint256", name: "fAmount", type: "uint256" }],
1253
+ internalType: "struct DataTypes.RepayWithCollateralPoolParams",
1254
+ name: "",
1255
+ type: "tuple",
1256
+ },
1257
+ ],
1258
+ stateMutability: "nonpayable",
1259
+ type: "function",
1260
+ },
1261
+ {
1262
+ inputs: [
1263
+ { internalType: "uint256", name: "loanBorrowAmount", type: "uint256" },
1264
+ { internalType: "bool", name: "switchingToStable", type: "bool" },
1265
+ {
1266
+ internalType: "uint256",
1267
+ name: "oldLoanBorrowStableRate",
1268
+ type: "uint256",
1269
+ },
1270
+ ],
1271
+ name: "updatePoolWithSwitchBorrowType",
1272
+ outputs: [],
1273
+ stateMutability: "nonpayable",
1274
+ type: "function",
1275
+ },
1276
+ {
1277
+ inputs: [
1278
+ { internalType: "uint256", name: "amount", type: "uint256" },
1279
+ { internalType: "bool", name: "isFAmount", type: "bool" },
1280
+ ],
1281
+ name: "updatePoolWithWithdraw",
1282
+ outputs: [
1283
+ {
1284
+ components: [
1285
+ { internalType: "uint256", name: "underlingAmount", type: "uint256" },
1286
+ { internalType: "uint256", name: "fAmount", type: "uint256" },
1287
+ ],
1288
+ internalType: "struct DataTypes.WithdrawPoolParams",
1289
+ name: "",
1290
+ type: "tuple",
1291
+ },
1292
+ ],
1293
+ stateMutability: "nonpayable",
1294
+ type: "function",
1295
+ },
1296
+ {
1297
+ inputs: [
1298
+ { internalType: "uint32", name: "sr0", type: "uint32" },
1299
+ { internalType: "uint32", name: "sr1", type: "uint32" },
1300
+ { internalType: "uint32", name: "sr2", type: "uint32" },
1301
+ { internalType: "uint32", name: "sr3", type: "uint32" },
1302
+ {
1303
+ internalType: "uint16",
1304
+ name: "optimalStableToTotalDebtRatio",
1305
+ type: "uint16",
1306
+ },
1307
+ {
1308
+ internalType: "uint16",
1309
+ name: "rebalanceUpUtilisationRatio",
1310
+ type: "uint16",
1311
+ },
1312
+ {
1313
+ internalType: "uint16",
1314
+ name: "rebalanceUpDepositInterestRate",
1315
+ type: "uint16",
1316
+ },
1317
+ { internalType: "uint16", name: "rebalanceDownDelta", type: "uint16" },
1318
+ ],
1319
+ name: "updateStableBorrowData",
1320
+ outputs: [],
1321
+ stateMutability: "nonpayable",
1322
+ type: "function",
1323
+ },
1324
+ {
1325
+ inputs: [
1326
+ { internalType: "uint32", name: "vr0", type: "uint32" },
1327
+ { internalType: "uint32", name: "vr1", type: "uint32" },
1328
+ { internalType: "uint32", name: "vr2", type: "uint32" },
1329
+ ],
1330
+ name: "updateVariableBorrowData",
1331
+ outputs: [],
1332
+ stateMutability: "nonpayable",
1333
+ type: "function",
1334
+ },
1335
+ {
1336
+ inputs: [
1337
+ { internalType: "uint16", name: "chainId", type: "uint16" },
1338
+ { internalType: "bytes32", name: "source", type: "bytes32" },
1339
+ ],
1340
+ name: "verifyReceiveToken",
1341
+ outputs: [],
1342
+ stateMutability: "view",
1343
+ type: "function",
1344
+ },
1345
+ ];
1346
+ //# sourceMappingURL=hub-pool-abi.js.map