@huma-finance/shared 0.0.31 → 0.0.32

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 (381) hide show
  1. package/LICENSE +660 -660
  2. package/README.md +28 -28
  3. package/dist/abis/BaseCreditPoolReceivable.json +764 -0
  4. package/dist/abis/ERC20TransferrableReceivable.json +648 -0
  5. package/dist/abis/types/BaseCreditPoolReceivable.d.ts +518 -0
  6. package/dist/abis/types/BaseCreditPoolReceivable.js +2 -0
  7. package/dist/abis/types/BaseCreditPoolReceivable.js.map +1 -0
  8. package/dist/abis/types/ERC20TransferrableReceivable.d.ts +407 -0
  9. package/dist/abis/types/ERC20TransferrableReceivable.js +2 -0
  10. package/dist/abis/types/ERC20TransferrableReceivable.js.map +1 -0
  11. package/dist/abis/types/factories/BaseCreditPoolReceivable__factory.d.ts +597 -0
  12. package/dist/abis/types/factories/BaseCreditPoolReceivable__factory.js +778 -0
  13. package/dist/abis/types/factories/BaseCreditPoolReceivable__factory.js.map +1 -0
  14. package/dist/abis/types/factories/BaseCreditPool__factory.js +2 -1
  15. package/dist/abis/types/factories/BaseCreditPool__factory.js.map +1 -1
  16. package/dist/abis/types/factories/BaseFeeManager__factory.js +2 -1
  17. package/dist/abis/types/factories/BaseFeeManager__factory.js.map +1 -1
  18. package/dist/abis/types/factories/BasePoolConfig__factory.js +2 -1
  19. package/dist/abis/types/factories/BasePoolConfig__factory.js.map +1 -1
  20. package/dist/abis/types/factories/ERC20TransferableReceivable__factory.js +2 -1
  21. package/dist/abis/types/factories/ERC20TransferableReceivable__factory.js.map +1 -1
  22. package/dist/abis/types/factories/ERC20TransferrableReceivable__factory.d.ts +508 -0
  23. package/dist/abis/types/factories/ERC20TransferrableReceivable__factory.js +663 -0
  24. package/dist/abis/types/factories/ERC20TransferrableReceivable__factory.js.map +1 -0
  25. package/dist/abis/types/factories/Erc20__factory.js +2 -1
  26. package/dist/abis/types/factories/Erc20__factory.js.map +1 -1
  27. package/dist/abis/types/factories/Erc2612__factory.js +2 -1
  28. package/dist/abis/types/factories/Erc2612__factory.js.map +1 -1
  29. package/dist/abis/types/factories/Erc721__factory.js +2 -1
  30. package/dist/abis/types/factories/Erc721__factory.js.map +1 -1
  31. package/dist/abis/types/factories/HDT__factory.js +2 -1
  32. package/dist/abis/types/factories/HDT__factory.js.map +1 -1
  33. package/dist/abis/types/factories/IConstantFlowAgreementV1__factory.js +2 -1
  34. package/dist/abis/types/factories/IConstantFlowAgreementV1__factory.js.map +1 -1
  35. package/dist/abis/types/factories/ISuperfluid__factory.js +2 -1
  36. package/dist/abis/types/factories/ISuperfluid__factory.js.map +1 -1
  37. package/dist/abis/types/factories/InvoiceNFT__factory.js +2 -1
  38. package/dist/abis/types/factories/InvoiceNFT__factory.js.map +1 -1
  39. package/dist/abis/types/factories/Multisend__factory.js +2 -1
  40. package/dist/abis/types/factories/Multisend__factory.js.map +1 -1
  41. package/dist/abis/types/factories/RealWorldReceivable__factory.js +2 -1
  42. package/dist/abis/types/factories/RealWorldReceivable__factory.js.map +1 -1
  43. package/dist/abis/types/factories/ReceivableFactoringPool__factory.js +2 -1
  44. package/dist/abis/types/factories/ReceivableFactoringPool__factory.js.map +1 -1
  45. package/dist/abis/types/factories/StreamFactoringPool__factory.js +2 -1
  46. package/dist/abis/types/factories/StreamFactoringPool__factory.js.map +1 -1
  47. package/dist/abis/types/factories/StreamFeeManager__factory.js +2 -1
  48. package/dist/abis/types/factories/StreamFeeManager__factory.js.map +1 -1
  49. package/dist/abis/types/factories/SuperfluidPoolProcessor__factory.js +2 -1
  50. package/dist/abis/types/factories/SuperfluidPoolProcessor__factory.js.map +1 -1
  51. package/dist/abis/types/factories/TestERC20__factory.js +2 -1
  52. package/dist/abis/types/factories/TestERC20__factory.js.map +1 -1
  53. package/dist/abis/types/factories/TradableStream__factory.js +2 -1
  54. package/dist/abis/types/factories/TradableStream__factory.js.map +1 -1
  55. package/dist/abis/types/factories/TransferNFT__factory.js +2 -1
  56. package/dist/abis/types/factories/TransferNFT__factory.js.map +1 -1
  57. package/dist/abis/types/factories/Transfer__factory.js +2 -1
  58. package/dist/abis/types/factories/Transfer__factory.js.map +1 -1
  59. package/dist/cjs/abis/BaseCreditPool.json +1179 -1179
  60. package/dist/cjs/abis/BaseCreditPoolReceivable.json +764 -0
  61. package/dist/cjs/abis/BaseFeeManager.json +480 -480
  62. package/dist/cjs/abis/BasePoolConfig.json +1364 -1364
  63. package/dist/cjs/abis/ERC20TransferableReceivable.json +648 -648
  64. package/dist/cjs/abis/HDT.json +512 -512
  65. package/dist/cjs/abis/IConstantFlowAgreementV1.json +890 -890
  66. package/dist/cjs/abis/ISuperfluid.json +1122 -1122
  67. package/dist/cjs/abis/InvoiceNFT.json +625 -625
  68. package/dist/cjs/abis/Multisend.json +26 -26
  69. package/dist/cjs/abis/RealWorldReceivable.json +823 -823
  70. package/dist/cjs/abis/ReceivableFactoringPool.json +1529 -1529
  71. package/dist/cjs/abis/StreamFactoringPool.json +1523 -1523
  72. package/dist/cjs/abis/StreamFeeManager.json +522 -522
  73. package/dist/cjs/abis/SuperfluidPoolProcessor.json +692 -692
  74. package/dist/cjs/abis/TestERC20.json +358 -358
  75. package/dist/cjs/abis/TradableStream.json +850 -850
  76. package/dist/cjs/abis/Transfer.json +24 -24
  77. package/dist/cjs/abis/TransferNFT.json +27 -27
  78. package/dist/cjs/abis/erc20.json +117 -117
  79. package/dist/cjs/abis/erc2612.json +132 -132
  80. package/dist/cjs/abis/erc721.json +673 -673
  81. package/dist/cjs/abis/index.d.ts +3 -3
  82. package/dist/cjs/abis/index.js +12 -12
  83. package/dist/cjs/abis/types/BaseCreditPool.d.ts +803 -803
  84. package/dist/cjs/abis/types/BaseCreditPool.js +2 -2
  85. package/dist/cjs/abis/types/BaseCreditPoolReceivable.d.ts +518 -0
  86. package/dist/cjs/abis/types/BaseCreditPoolReceivable.js +3 -0
  87. package/dist/cjs/abis/types/BaseCreditPoolReceivable.js.map +1 -0
  88. package/dist/cjs/abis/types/BaseFeeManager.d.ts +408 -408
  89. package/dist/cjs/abis/types/BaseFeeManager.js +2 -2
  90. package/dist/cjs/abis/types/BasePoolConfig.d.ts +1097 -1097
  91. package/dist/cjs/abis/types/BasePoolConfig.js +2 -2
  92. package/dist/cjs/abis/types/ERC20TransferableReceivable.d.ts +407 -407
  93. package/dist/cjs/abis/types/ERC20TransferableReceivable.js +2 -2
  94. package/dist/cjs/abis/types/Erc20.d.ts +168 -168
  95. package/dist/cjs/abis/types/Erc20.js +2 -2
  96. package/dist/cjs/abis/types/Erc2612.d.ts +192 -192
  97. package/dist/cjs/abis/types/Erc2612.js +2 -2
  98. package/dist/cjs/abis/types/Erc721.d.ts +474 -474
  99. package/dist/cjs/abis/types/Erc721.js +2 -2
  100. package/dist/cjs/abis/types/HDT.d.ts +369 -369
  101. package/dist/cjs/abis/types/HDT.js +2 -2
  102. package/dist/cjs/abis/types/IConstantFlowAgreementV1.d.ts +573 -573
  103. package/dist/cjs/abis/types/IConstantFlowAgreementV1.js +2 -2
  104. package/dist/cjs/abis/types/ISuperfluid.d.ts +728 -728
  105. package/dist/cjs/abis/types/ISuperfluid.js +2 -2
  106. package/dist/cjs/abis/types/InvoiceNFT.d.ts +425 -425
  107. package/dist/cjs/abis/types/InvoiceNFT.js +2 -2
  108. package/dist/cjs/abis/types/Multisend.d.ts +50 -50
  109. package/dist/cjs/abis/types/Multisend.js +2 -2
  110. package/dist/cjs/abis/types/RealWorldReceivable.d.ts +564 -564
  111. package/dist/cjs/abis/types/RealWorldReceivable.js +2 -2
  112. package/dist/cjs/abis/types/ReceivableFactoringPool.d.ts +999 -999
  113. package/dist/cjs/abis/types/ReceivableFactoringPool.js +2 -2
  114. package/dist/cjs/abis/types/StreamFactoringPool.d.ts +985 -985
  115. package/dist/cjs/abis/types/StreamFactoringPool.js +2 -2
  116. package/dist/cjs/abis/types/StreamFeeManager.d.ts +440 -440
  117. package/dist/cjs/abis/types/StreamFeeManager.js +2 -2
  118. package/dist/cjs/abis/types/SuperfluidPoolProcessor.d.ts +398 -398
  119. package/dist/cjs/abis/types/SuperfluidPoolProcessor.js +2 -2
  120. package/dist/cjs/abis/types/TestERC20.d.ts +270 -270
  121. package/dist/cjs/abis/types/TestERC20.js +2 -2
  122. package/dist/cjs/abis/types/TradableStream.d.ts +607 -607
  123. package/dist/cjs/abis/types/TradableStream.js +2 -2
  124. package/dist/cjs/abis/types/Transfer.d.ts +45 -45
  125. package/dist/cjs/abis/types/Transfer.js +2 -2
  126. package/dist/cjs/abis/types/TransferNFT.d.ts +45 -45
  127. package/dist/cjs/abis/types/TransferNFT.js +2 -2
  128. package/dist/cjs/abis/types/common.d.ts +22 -22
  129. package/dist/cjs/abis/types/common.js +2 -2
  130. package/dist/cjs/abis/types/factories/BaseCreditPoolReceivable__factory.d.ts +597 -0
  131. package/dist/cjs/abis/types/factories/BaseCreditPoolReceivable__factory.js +782 -0
  132. package/dist/cjs/abis/types/factories/BaseCreditPoolReceivable__factory.js.map +1 -0
  133. package/dist/cjs/abis/types/factories/BaseCreditPool__factory.d.ts +931 -931
  134. package/dist/cjs/abis/types/factories/BaseCreditPool__factory.js +1196 -1196
  135. package/dist/cjs/abis/types/factories/BaseFeeManager__factory.d.ts +379 -379
  136. package/dist/cjs/abis/types/factories/BaseFeeManager__factory.js +497 -497
  137. package/dist/cjs/abis/types/factories/BasePoolConfig__factory.d.ts +1074 -1074
  138. package/dist/cjs/abis/types/factories/BasePoolConfig__factory.js +1381 -1381
  139. package/dist/cjs/abis/types/factories/ERC20TransferableReceivable__factory.d.ts +508 -508
  140. package/dist/cjs/abis/types/factories/ERC20TransferableReceivable__factory.js +665 -665
  141. package/dist/cjs/abis/types/factories/Erc20__factory.d.ts +175 -175
  142. package/dist/cjs/abis/types/factories/Erc20__factory.js +239 -239
  143. package/dist/cjs/abis/types/factories/Erc2612__factory.d.ts +209 -209
  144. package/dist/cjs/abis/types/factories/Erc2612__factory.js +282 -282
  145. package/dist/cjs/abis/types/factories/Erc721__factory.d.ts +539 -539
  146. package/dist/cjs/abis/types/factories/Erc721__factory.js +690 -690
  147. package/dist/cjs/abis/types/factories/HDT__factory.d.ts +399 -399
  148. package/dist/cjs/abis/types/factories/HDT__factory.js +529 -529
  149. package/dist/cjs/abis/types/factories/IConstantFlowAgreementV1__factory.d.ts +695 -695
  150. package/dist/cjs/abis/types/factories/IConstantFlowAgreementV1__factory.js +907 -907
  151. package/dist/cjs/abis/types/factories/ISuperfluid__factory.d.ts +866 -866
  152. package/dist/cjs/abis/types/factories/ISuperfluid__factory.js +1139 -1139
  153. package/dist/cjs/abis/types/factories/InvoiceNFT__factory.d.ts +489 -489
  154. package/dist/cjs/abis/types/factories/InvoiceNFT__factory.js +642 -642
  155. package/dist/cjs/abis/types/factories/Multisend__factory.d.ts +26 -26
  156. package/dist/cjs/abis/types/factories/Multisend__factory.js +43 -43
  157. package/dist/cjs/abis/types/factories/RealWorldReceivable__factory.d.ts +645 -645
  158. package/dist/cjs/abis/types/factories/RealWorldReceivable__factory.js +840 -840
  159. package/dist/cjs/abis/types/factories/ReceivableFactoringPool__factory.d.ts +1204 -1204
  160. package/dist/cjs/abis/types/factories/ReceivableFactoringPool__factory.js +1546 -1546
  161. package/dist/cjs/abis/types/factories/StreamFactoringPool__factory.d.ts +1200 -1200
  162. package/dist/cjs/abis/types/factories/StreamFactoringPool__factory.js +1540 -1540
  163. package/dist/cjs/abis/types/factories/StreamFeeManager__factory.d.ts +412 -412
  164. package/dist/cjs/abis/types/factories/StreamFeeManager__factory.js +539 -539
  165. package/dist/cjs/abis/types/factories/SuperfluidPoolProcessor__factory.d.ts +546 -546
  166. package/dist/cjs/abis/types/factories/SuperfluidPoolProcessor__factory.js +709 -709
  167. package/dist/cjs/abis/types/factories/TestERC20__factory.d.ts +280 -280
  168. package/dist/cjs/abis/types/factories/TestERC20__factory.js +375 -375
  169. package/dist/cjs/abis/types/factories/TradableStream__factory.d.ts +663 -663
  170. package/dist/cjs/abis/types/factories/TradableStream__factory.js +867 -867
  171. package/dist/cjs/abis/types/factories/TransferNFT__factory.d.ts +28 -28
  172. package/dist/cjs/abis/types/factories/TransferNFT__factory.js +44 -44
  173. package/dist/cjs/abis/types/factories/Transfer__factory.d.ts +25 -25
  174. package/dist/cjs/abis/types/factories/Transfer__factory.js +41 -41
  175. package/dist/cjs/abis/types/factories/index.d.ts +21 -21
  176. package/dist/cjs/abis/types/factories/index.js +48 -48
  177. package/dist/cjs/abis/types/index.d.ts +43 -43
  178. package/dist/cjs/abis/types/index.js +47 -47
  179. package/dist/cjs/hooks/index.d.ts +18 -18
  180. package/dist/cjs/hooks/index.js +21 -21
  181. package/dist/cjs/hooks/useActiveRoute.d.ts +8 -8
  182. package/dist/cjs/hooks/useActiveRoute.js +11 -11
  183. package/dist/cjs/hooks/useAsyncError.d.ts +14 -14
  184. package/dist/cjs/hooks/useAsyncError.js +26 -26
  185. package/dist/cjs/hooks/useCLPoolContract.d.ts +27 -27
  186. package/dist/cjs/hooks/useCLPoolContract.js +53 -53
  187. package/dist/cjs/hooks/useContract.d.ts +7 -7
  188. package/dist/cjs/hooks/useContract.js +49 -49
  189. package/dist/cjs/hooks/useContractFunction.d.ts +18 -18
  190. package/dist/cjs/hooks/useContractFunction.js +57 -57
  191. package/dist/cjs/hooks/useERC2612Permit/ethPermit/index.d.ts +35 -35
  192. package/dist/cjs/hooks/useERC2612Permit/ethPermit/index.js +145 -145
  193. package/dist/cjs/hooks/useERC2612Permit/ethPermit/lib.d.ts +1 -1
  194. package/dist/cjs/hooks/useERC2612Permit/ethPermit/lib.js +26 -26
  195. package/dist/cjs/hooks/useERC2612Permit/ethPermit/rpc.d.ts +10 -10
  196. package/dist/cjs/hooks/useERC2612Permit/ethPermit/rpc.js +104 -104
  197. package/dist/cjs/hooks/useERC2612Permit/index.d.ts +6 -6
  198. package/dist/cjs/hooks/useERC2612Permit/index.js +35 -35
  199. package/dist/cjs/hooks/useFactoring.d.ts +19 -19
  200. package/dist/cjs/hooks/useFactoring.js +94 -94
  201. package/dist/cjs/hooks/useForceRefresh.d.ts +1 -1
  202. package/dist/cjs/hooks/useForceRefresh.js +12 -12
  203. package/dist/cjs/hooks/useGetSizes.d.ts +12 -12
  204. package/dist/cjs/hooks/useGetSizes.js +23 -23
  205. package/dist/cjs/hooks/useInvoiceNFTContract.d.ts +11 -11
  206. package/dist/cjs/hooks/useInvoiceNFTContract.js +72 -72
  207. package/dist/cjs/hooks/useMQ.d.ts +6 -6
  208. package/dist/cjs/hooks/useMQ.js +18 -18
  209. package/dist/cjs/hooks/useMount.d.ts +2 -2
  210. package/dist/cjs/hooks/useMount.js +13 -13
  211. package/dist/cjs/hooks/useParamsSearch.d.ts +2 -2
  212. package/dist/cjs/hooks/useParamsSearch.js +11 -11
  213. package/dist/cjs/hooks/usePool.d.ts +4 -4
  214. package/dist/cjs/hooks/usePool.js +45 -45
  215. package/dist/cjs/hooks/usePoolContract.d.ts +73 -73
  216. package/dist/cjs/hooks/usePoolContract.js +309 -309
  217. package/dist/cjs/hooks/useRFPoolContract.d.ts +22 -22
  218. package/dist/cjs/hooks/useRFPoolContract.js +41 -41
  219. package/dist/cjs/hooks/useRefresh.d.ts +1 -1
  220. package/dist/cjs/hooks/useRefresh.js +51 -51
  221. package/dist/cjs/hooks/web3/index.d.ts +15 -15
  222. package/dist/cjs/hooks/web3/index.js +147 -147
  223. package/dist/cjs/hooks/web3/useConnectors.d.ts +17 -17
  224. package/dist/cjs/hooks/web3/useConnectors.js +30 -30
  225. package/dist/cjs/hooks/web3/useJsonRpcUrlsMap.d.ts +13 -13
  226. package/dist/cjs/hooks/web3/useJsonRpcUrlsMap.js +62 -62
  227. package/dist/cjs/index.d.ts +5 -5
  228. package/dist/cjs/index.js +8 -8
  229. package/dist/cjs/services/EAService.d.ts +153 -153
  230. package/dist/cjs/services/EAService.js +80 -80
  231. package/dist/cjs/services/IdentityService.d.ts +52 -35
  232. package/dist/cjs/services/IdentityService.js +83 -56
  233. package/dist/cjs/services/IdentityService.js.map +1 -1
  234. package/dist/cjs/services/RNService.d.ts +14 -14
  235. package/dist/cjs/services/RNService.js +13 -13
  236. package/dist/cjs/services/index.d.ts +3 -3
  237. package/dist/cjs/services/index.js +6 -6
  238. package/dist/cjs/utils/JsonRpcConnector.d.ts +11 -11
  239. package/dist/cjs/utils/JsonRpcConnector.js +42 -42
  240. package/dist/cjs/utils/WalletConnect.d.ts +10 -10
  241. package/dist/cjs/utils/WalletConnect.js +55 -55
  242. package/dist/cjs/utils/chain.d.ts +36 -35
  243. package/dist/cjs/utils/chain.js +116 -113
  244. package/dist/cjs/utils/chain.js.map +1 -1
  245. package/dist/cjs/utils/common.d.ts +4 -4
  246. package/dist/cjs/utils/common.js +17 -17
  247. package/dist/cjs/utils/config.d.ts +8 -8
  248. package/dist/cjs/utils/config.js +44 -44
  249. package/dist/cjs/utils/const.d.ts +2 -2
  250. package/dist/cjs/utils/const.js +5 -5
  251. package/dist/cjs/utils/contractError.json +73 -73
  252. package/dist/cjs/utils/contractconfig.json +19 -19
  253. package/dist/cjs/utils/credit.d.ts +21 -21
  254. package/dist/cjs/utils/credit.js +39 -39
  255. package/dist/cjs/utils/errors.d.ts +26 -26
  256. package/dist/cjs/utils/errors.js +46 -46
  257. package/dist/cjs/utils/index.d.ts +20 -20
  258. package/dist/cjs/utils/index.js +23 -23
  259. package/dist/cjs/utils/jsonRpcEndpoints.d.ts +12 -12
  260. package/dist/cjs/utils/jsonRpcEndpoints.js +28 -28
  261. package/dist/cjs/utils/notifi.d.ts +3 -3
  262. package/dist/cjs/utils/notifi.js +39 -28
  263. package/dist/cjs/utils/notifi.js.map +1 -1
  264. package/dist/cjs/utils/number.d.ts +5 -5
  265. package/dist/cjs/utils/number.js +61 -55
  266. package/dist/cjs/utils/number.js.map +1 -1
  267. package/dist/cjs/utils/pool.d.ts +95 -96
  268. package/dist/cjs/utils/pool.js +416 -416
  269. package/dist/cjs/utils/pool.js.map +1 -1
  270. package/dist/cjs/utils/realWorldReceivable.d.ts +12 -12
  271. package/dist/cjs/utils/realWorldReceivable.js +2 -2
  272. package/dist/cjs/utils/request.d.ts +3 -3
  273. package/dist/cjs/utils/request.js +45 -45
  274. package/dist/cjs/utils/scientificToDecimal.d.ts +1 -1
  275. package/dist/cjs/utils/scientificToDecimal.js +61 -61
  276. package/dist/cjs/utils/string.d.ts +1 -1
  277. package/dist/cjs/utils/string.js +5 -5
  278. package/dist/cjs/utils/style.d.ts +1 -1
  279. package/dist/cjs/utils/style.js +16 -16
  280. package/dist/cjs/utils/time.d.ts +26 -26
  281. package/dist/cjs/utils/time.js +58 -58
  282. package/dist/cjs/utils/transaction.d.ts +32 -32
  283. package/dist/cjs/utils/transaction.js +96 -96
  284. package/dist/cjs/utils/web3.d.ts +4 -4
  285. package/dist/cjs/utils/web3.js +39 -39
  286. package/dist/components/icons/approve-lender.svg +30 -0
  287. package/dist/components/icons/auto-payback.svg +40 -0
  288. package/dist/components/icons/check-circle.svg +3 -0
  289. package/dist/components/icons/check-green.svg +3 -0
  290. package/dist/components/icons/check.svg +10 -0
  291. package/dist/components/icons/donut.svg +904 -0
  292. package/dist/components/icons/ellipse.svg +3 -0
  293. package/dist/components/icons/ethereum.svg +1 -0
  294. package/dist/components/icons/huma-full.svg +22 -0
  295. package/dist/components/icons/huma.svg +15 -0
  296. package/dist/components/icons/index.d.ts +19 -0
  297. package/dist/components/icons/index.js +70 -0
  298. package/dist/components/icons/index.js.map +1 -0
  299. package/dist/components/icons/loader.svg +229 -0
  300. package/dist/components/icons/metamask.svg +31 -0
  301. package/dist/components/icons/polygon.svg +16 -0
  302. package/dist/components/icons/receipt.svg +3 -0
  303. package/dist/components/icons/separator.svg +3 -0
  304. package/dist/components/icons/sorry.svg +31 -0
  305. package/dist/components/icons/usdc.svg +5 -0
  306. package/dist/components/icons/wallet-connect.svg +12 -0
  307. package/dist/hooks/useCLPoolContract.js +38 -38
  308. package/dist/hooks/useContract.js +40 -40
  309. package/dist/hooks/useFactoring.js +90 -90
  310. package/dist/hooks/useInvoiceNFTContract.js +64 -64
  311. package/dist/hooks/usePool.js +39 -39
  312. package/dist/hooks/usePoolContract.js +286 -286
  313. package/dist/hooks/useRFPoolContract.js +29 -29
  314. package/dist/hooks/web3/index.js +142 -142
  315. package/dist/hooks/web3/useJsonRpcUrlsMap.js +53 -53
  316. package/dist/index.js +5 -5
  317. package/dist/services/EAService.js +77 -77
  318. package/dist/services/IdentityService.d.ts +52 -35
  319. package/dist/services/IdentityService.js +80 -53
  320. package/dist/services/IdentityService.js.map +1 -1
  321. package/dist/services/RNService.js +10 -10
  322. package/dist/services/index.js +3 -3
  323. package/dist/theme/breakpoints.d.ts +5 -0
  324. package/dist/theme/breakpoints.js +4 -0
  325. package/dist/theme/breakpoints.js.map +1 -0
  326. package/dist/theme/components.d.ts +6 -0
  327. package/dist/theme/components.js +62 -0
  328. package/dist/theme/components.js.map +1 -0
  329. package/dist/theme/coreThemeConstants.d.ts +18 -0
  330. package/dist/theme/coreThemeConstants.js +30 -0
  331. package/dist/theme/coreThemeConstants.js.map +1 -0
  332. package/dist/theme/cssMixins.d.ts +20 -0
  333. package/dist/theme/cssMixins.js +90 -0
  334. package/dist/theme/cssMixins.js.map +1 -0
  335. package/dist/theme/index.d.ts +8 -0
  336. package/dist/theme/index.js +27 -0
  337. package/dist/theme/index.js.map +1 -0
  338. package/dist/theme/palette.d.ts +53 -0
  339. package/dist/theme/palette.js +137 -0
  340. package/dist/theme/palette.js.map +1 -0
  341. package/dist/theme/shape.d.ts +2 -0
  342. package/dist/theme/shape.js +5 -0
  343. package/dist/theme/shape.js.map +1 -0
  344. package/dist/theme/theme.types.d.ts +72 -0
  345. package/dist/theme/theme.types.js +2 -0
  346. package/dist/theme/theme.types.js.map +1 -0
  347. package/dist/theme/typography.d.ts +2 -0
  348. package/dist/theme/typography.js +116 -0
  349. package/dist/theme/typography.js.map +1 -0
  350. package/dist/tsconfig.cjs.tsbuildinfo +1 -1
  351. package/dist/utils/WalletConnect.js +2 -1
  352. package/dist/utils/WalletConnect.js.map +1 -1
  353. package/dist/utils/chain.d.ts +36 -35
  354. package/dist/utils/chain.js +109 -106
  355. package/dist/utils/chain.js.map +1 -1
  356. package/dist/utils/config.d.ts +8 -8
  357. package/dist/utils/config.js +41 -41
  358. package/dist/utils/contractconfig.json +19 -19
  359. package/dist/utils/ddLogger.d.ts +4 -0
  360. package/dist/utils/ddLogger.js +48 -0
  361. package/dist/utils/ddLogger.js.map +1 -0
  362. package/dist/utils/index.d.ts +20 -20
  363. package/dist/utils/index.js +20 -20
  364. package/dist/utils/jsonRpcEndpoints.js +25 -25
  365. package/dist/utils/notifi.d.ts +3 -3
  366. package/dist/utils/notifi.js +34 -23
  367. package/dist/utils/notifi.js.map +1 -1
  368. package/dist/utils/number.js +54 -48
  369. package/dist/utils/number.js.map +1 -1
  370. package/dist/utils/pool.d.ts +95 -96
  371. package/dist/utils/pool.js +409 -409
  372. package/dist/utils/pool.js.map +1 -1
  373. package/dist/utils/realWorldReceivable.d.ts +12 -12
  374. package/dist/utils/realWorldReceivable.js +1 -1
  375. package/dist/utils/sentry.d.ts +1 -0
  376. package/dist/utils/sentry.js +19 -0
  377. package/dist/utils/sentry.js.map +1 -0
  378. package/dist/utils/storage.d.ts +12 -0
  379. package/dist/utils/storage.js +32 -0
  380. package/dist/utils/storage.js.map +1 -0
  381. package/package.json +2 -2
@@ -1,31 +1,31 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Provider = void 0;
4
- const tslib_1 = require("tslib");
5
- const react_1 = tslib_1.__importStar(require("react"));
6
- const core_1 = require("@web3-react/core");
7
- const tiny_invariant_1 = tslib_1.__importDefault(require("tiny-invariant"));
8
- const ConnectorsContext = (0, react_1.createContext)(null);
9
- function Provider({ connectors, children, }) {
10
- const { chainId, connector } = (0, core_1.useWeb3React)();
11
- // The network chainId must be kept synchronized to avoid a loop when disconnecting and for a better UX.
12
- (0, react_1.useEffect)(() => {
13
- if (connector !== connectors.network) {
14
- try {
15
- connectors.network.activate(chainId);
16
- }
17
- catch (e) {
18
- // Unknown chains (eg hardhat) will fail to connect, and should not crash
19
- }
20
- }
21
- }, [chainId, connector, connectors.network]);
22
- return (react_1.default.createElement(ConnectorsContext.Provider, { value: connectors }, children));
23
- }
24
- exports.Provider = Provider;
25
- function useConnectors() {
26
- const connectors = (0, react_1.useContext)(ConnectorsContext);
27
- (0, tiny_invariant_1.default)(connectors, 'useConnectors used without initializing the context');
28
- return connectors;
29
- }
30
- exports.default = useConnectors;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Provider = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const react_1 = tslib_1.__importStar(require("react"));
6
+ const core_1 = require("@web3-react/core");
7
+ const tiny_invariant_1 = tslib_1.__importDefault(require("tiny-invariant"));
8
+ const ConnectorsContext = (0, react_1.createContext)(null);
9
+ function Provider({ connectors, children, }) {
10
+ const { chainId, connector } = (0, core_1.useWeb3React)();
11
+ // The network chainId must be kept synchronized to avoid a loop when disconnecting and for a better UX.
12
+ (0, react_1.useEffect)(() => {
13
+ if (connector !== connectors.network) {
14
+ try {
15
+ connectors.network.activate(chainId);
16
+ }
17
+ catch (e) {
18
+ // Unknown chains (eg hardhat) will fail to connect, and should not crash
19
+ }
20
+ }
21
+ }, [chainId, connector, connectors.network]);
22
+ return (react_1.default.createElement(ConnectorsContext.Provider, { value: connectors }, children));
23
+ }
24
+ exports.Provider = Provider;
25
+ function useConnectors() {
26
+ const connectors = (0, react_1.useContext)(ConnectorsContext);
27
+ (0, tiny_invariant_1.default)(connectors, 'useConnectors used without initializing the context');
28
+ return connectors;
29
+ }
30
+ exports.default = useConnectors;
31
31
  //# sourceMappingURL=useConnectors.js.map
@@ -1,13 +1,13 @@
1
- import { PropsWithChildren } from 'react';
2
- import { JsonRpcProvider } from '@ethersproject/providers';
3
- import { ChainEnum } from '../../utils/chain';
4
- export type JsonRpcConnectionMap = {
5
- [chainId: number]: string | string[] | JsonRpcProvider | JsonRpcProvider[];
6
- };
7
- export declare function Provider({ jsonRpcMap, children, }: PropsWithChildren<{
8
- jsonRpcMap?: JsonRpcConnectionMap;
9
- }>): JSX.Element;
10
- export default function useJsonRpcUrlsMap(): Record<ChainEnum, string[]>;
11
- export declare function toJsonRpcConnectionMap(connectionMap?: JsonRpcConnectionMap): Record<ChainEnum, JsonRpcProvider>;
12
- export declare function toJsonRpcUrlMap(connectionMap?: JsonRpcConnectionMap): Record<ChainEnum, string>;
13
- export declare function toJsonRpcUrlsMap(connectionMap?: JsonRpcConnectionMap): Record<ChainEnum, string[]>;
1
+ import { PropsWithChildren } from 'react';
2
+ import { JsonRpcProvider } from '@ethersproject/providers';
3
+ import { ChainEnum } from '../../utils/chain';
4
+ export type JsonRpcConnectionMap = {
5
+ [chainId: number]: string | string[] | JsonRpcProvider | JsonRpcProvider[];
6
+ };
7
+ export declare function Provider({ jsonRpcMap, children, }: PropsWithChildren<{
8
+ jsonRpcMap?: JsonRpcConnectionMap;
9
+ }>): JSX.Element;
10
+ export default function useJsonRpcUrlsMap(): Record<ChainEnum, string[]>;
11
+ export declare function toJsonRpcConnectionMap(connectionMap?: JsonRpcConnectionMap): Record<ChainEnum, JsonRpcProvider>;
12
+ export declare function toJsonRpcUrlMap(connectionMap?: JsonRpcConnectionMap): Record<ChainEnum, string>;
13
+ export declare function toJsonRpcUrlsMap(connectionMap?: JsonRpcConnectionMap): Record<ChainEnum, string[]>;
@@ -1,63 +1,63 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.toJsonRpcUrlsMap = exports.toJsonRpcUrlMap = exports.toJsonRpcConnectionMap = exports.Provider = void 0;
4
- const tslib_1 = require("tslib");
5
- const react_1 = tslib_1.__importStar(require("react"));
6
- const providers_1 = require("@ethersproject/providers");
7
- const chain_1 = require("../../utils/chain");
8
- const jsonRpcEndpoints_1 = require("../../utils/jsonRpcEndpoints");
9
- const JsonRpcUrlMapContext = (0, react_1.createContext)(undefined);
10
- function Provider({ jsonRpcMap, children, }) {
11
- return (react_1.default.createElement(JsonRpcUrlMapContext.Provider, { value: jsonRpcMap }, children));
12
- }
13
- exports.Provider = Provider;
14
- function useJsonRpcUrlsMap() {
15
- const jsonRpcMap = (0, react_1.useContext)(JsonRpcUrlMapContext);
16
- // eslint-disable-next-line @typescript-eslint/no-use-before-define
17
- return (0, react_1.useMemo)(() => toJsonRpcUrlsMap(jsonRpcMap), [jsonRpcMap]);
18
- }
19
- exports.default = useJsonRpcUrlsMap;
20
- function toJsonRpcMap(getChainConnections) {
21
- return {
22
- [chain_1.ChainEnum.Goerli]: getChainConnections(chain_1.ChainEnum.Goerli),
23
- [chain_1.ChainEnum.Polygon]: getChainConnections(chain_1.ChainEnum.Polygon),
24
- [chain_1.ChainEnum.Mumbai]: getChainConnections(chain_1.ChainEnum.Mumbai),
25
- };
26
- }
27
- function getChainConnections(connectionMap, chainId) {
28
- const value = connectionMap === null || connectionMap === void 0 ? void 0 : connectionMap[chainId];
29
- return (Array.isArray(value) ? value : [value])
30
- .filter((value) => Boolean(value))
31
- .concat(...jsonRpcEndpoints_1.JSON_RPC_FALLBACK_ENDPOINTS[chainId]);
32
- }
33
- function toJsonRpcConnectionMap(connectionMap) {
34
- function getJsonRpcProvider(chainId) {
35
- const [connection] = getChainConnections(connectionMap, chainId);
36
- return providers_1.JsonRpcProvider.isProvider(connection)
37
- ? connection
38
- : new providers_1.StaticJsonRpcProvider(connection, Number(chainId));
39
- }
40
- return toJsonRpcMap(getJsonRpcProvider);
41
- }
42
- exports.toJsonRpcConnectionMap = toJsonRpcConnectionMap;
43
- function toJsonRpcUrlMap(connectionMap) {
44
- function getJsonRpcUrl(chainId) {
45
- const [connection] = getChainConnections(connectionMap, chainId);
46
- return providers_1.JsonRpcProvider.isProvider(connection)
47
- ? connection.connection.url
48
- : connection;
49
- }
50
- return toJsonRpcMap(getJsonRpcUrl);
51
- }
52
- exports.toJsonRpcUrlMap = toJsonRpcUrlMap;
53
- function toJsonRpcUrlsMap(connectionMap) {
54
- function getJsonRpcUrls(chainId) {
55
- const connections = getChainConnections(connectionMap, chainId);
56
- return connections.map((connection) => providers_1.JsonRpcProvider.isProvider(connection)
57
- ? connection.connection.url
58
- : connection);
59
- }
60
- return toJsonRpcMap(getJsonRpcUrls);
61
- }
62
- exports.toJsonRpcUrlsMap = toJsonRpcUrlsMap;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.toJsonRpcUrlsMap = exports.toJsonRpcUrlMap = exports.toJsonRpcConnectionMap = exports.Provider = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const react_1 = tslib_1.__importStar(require("react"));
6
+ const providers_1 = require("@ethersproject/providers");
7
+ const chain_1 = require("../../utils/chain");
8
+ const jsonRpcEndpoints_1 = require("../../utils/jsonRpcEndpoints");
9
+ const JsonRpcUrlMapContext = (0, react_1.createContext)(undefined);
10
+ function Provider({ jsonRpcMap, children, }) {
11
+ return (react_1.default.createElement(JsonRpcUrlMapContext.Provider, { value: jsonRpcMap }, children));
12
+ }
13
+ exports.Provider = Provider;
14
+ function useJsonRpcUrlsMap() {
15
+ const jsonRpcMap = (0, react_1.useContext)(JsonRpcUrlMapContext);
16
+ // eslint-disable-next-line @typescript-eslint/no-use-before-define
17
+ return (0, react_1.useMemo)(() => toJsonRpcUrlsMap(jsonRpcMap), [jsonRpcMap]);
18
+ }
19
+ exports.default = useJsonRpcUrlsMap;
20
+ function toJsonRpcMap(getChainConnections) {
21
+ return {
22
+ [chain_1.ChainEnum.Goerli]: getChainConnections(chain_1.ChainEnum.Goerli),
23
+ [chain_1.ChainEnum.Polygon]: getChainConnections(chain_1.ChainEnum.Polygon),
24
+ [chain_1.ChainEnum.Mumbai]: getChainConnections(chain_1.ChainEnum.Mumbai),
25
+ };
26
+ }
27
+ function getChainConnections(connectionMap, chainId) {
28
+ const value = connectionMap === null || connectionMap === void 0 ? void 0 : connectionMap[chainId];
29
+ return (Array.isArray(value) ? value : [value])
30
+ .filter((value) => Boolean(value))
31
+ .concat(...jsonRpcEndpoints_1.JSON_RPC_FALLBACK_ENDPOINTS[chainId]);
32
+ }
33
+ function toJsonRpcConnectionMap(connectionMap) {
34
+ function getJsonRpcProvider(chainId) {
35
+ const [connection] = getChainConnections(connectionMap, chainId);
36
+ return providers_1.JsonRpcProvider.isProvider(connection)
37
+ ? connection
38
+ : new providers_1.StaticJsonRpcProvider(connection, Number(chainId));
39
+ }
40
+ return toJsonRpcMap(getJsonRpcProvider);
41
+ }
42
+ exports.toJsonRpcConnectionMap = toJsonRpcConnectionMap;
43
+ function toJsonRpcUrlMap(connectionMap) {
44
+ function getJsonRpcUrl(chainId) {
45
+ const [connection] = getChainConnections(connectionMap, chainId);
46
+ return providers_1.JsonRpcProvider.isProvider(connection)
47
+ ? connection.connection.url
48
+ : connection;
49
+ }
50
+ return toJsonRpcMap(getJsonRpcUrl);
51
+ }
52
+ exports.toJsonRpcUrlMap = toJsonRpcUrlMap;
53
+ function toJsonRpcUrlsMap(connectionMap) {
54
+ function getJsonRpcUrls(chainId) {
55
+ const connections = getChainConnections(connectionMap, chainId);
56
+ return connections.map((connection) => providers_1.JsonRpcProvider.isProvider(connection)
57
+ ? connection.connection.url
58
+ : connection);
59
+ }
60
+ return toJsonRpcMap(getJsonRpcUrls);
61
+ }
62
+ exports.toJsonRpcUrlsMap = toJsonRpcUrlsMap;
63
63
  //# sourceMappingURL=useJsonRpcUrlsMap.js.map
@@ -1,5 +1,5 @@
1
- export * from './abis';
2
- export * from './abis/types';
3
- export * from './hooks';
4
- export * from './services';
5
- export * from './utils';
1
+ export * from './abis';
2
+ export * from './abis/types';
3
+ export * from './hooks';
4
+ export * from './services';
5
+ export * from './utils';
package/dist/cjs/index.js CHANGED
@@ -1,9 +1,9 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- tslib_1.__exportStar(require("./abis"), exports);
5
- tslib_1.__exportStar(require("./abis/types"), exports);
6
- tslib_1.__exportStar(require("./hooks"), exports);
7
- tslib_1.__exportStar(require("./services"), exports);
8
- tslib_1.__exportStar(require("./utils"), exports);
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./abis"), exports);
5
+ tslib_1.__exportStar(require("./abis/types"), exports);
6
+ tslib_1.__exportStar(require("./hooks"), exports);
7
+ tslib_1.__exportStar(require("./services"), exports);
8
+ tslib_1.__exportStar(require("./utils"), exports);
9
9
  //# sourceMappingURL=index.js.map
@@ -1,153 +1,153 @@
1
- /**
2
- * Object representing the token information of the approval.
3
- * @typedef {Object} Token
4
- * @property {string} symbol The symbol of the base token of the pool.
5
- * @property {string} name The name of the base token of the pool.
6
- * @property {number} decimal The number of decimals for the base token of the pool.
7
- */
8
- type Token = {
9
- symbol: string;
10
- name: string;
11
- decimal: number;
12
- };
13
- /**
14
- * Object representing the approved loan terms.
15
- * @typedef {Object} Terms
16
- * @property {string} creditLimit The credit limit for the borrower in the pool's base currency.
17
- * @property {string} creditLimitFormatted The credit limit for the borrower in the pool's base currency, formatted with that tokens' decimals.
18
- * @property {number} intervalInDays The interval in days for credit line rebalancing.
19
- * @property {number} remainingPeriods The number of remaining payback periods in the credit line.
20
- * @property {number} aprInBps The annual percentage rate in basis points.
21
- */
22
- type Terms = {
23
- creditLimit: string;
24
- creditLimitFormatted: string;
25
- intervalInDays: number;
26
- remainingPeriods: number;
27
- aprInBps: number;
28
- };
29
- /**
30
- * Object representing receivable information of the approval.
31
- * @typedef {Object} Receivable
32
- * @property {string} asset The address of the receivable asset contract.
33
- * @property {number|string} param The identifying parameter for the receivable asset, often the token ID of an ERC721.
34
- * @property {string} amount The expected payment amount of the receivable asset.
35
- * @property {string} amountFormatted The expected payment amount of the receivable asset, formatted with that tokens' decimals.
36
- */
37
- type Receivable = {
38
- asset: string;
39
- param: string;
40
- amount: string;
41
- amountFormatted: string;
42
- };
43
- /**
44
- * Object representing EA approval.
45
- * @typedef {Object} Approval
46
- * @property {Token} token The token information for the approval.
47
- * @property {Terms} terms The approved loan terms.
48
- * @property {Receivable} receivable The receivable information.
49
- */
50
- export type Approval = {
51
- token: Token;
52
- terms: Terms;
53
- receivable?: Receivable;
54
- };
55
- /**
56
- * Object representing EA rejection.
57
- * @typedef {Object} Rejection
58
- * @property {string[]} reasons Rejection reasons.
59
- */
60
- export type Rejection = {
61
- reasons: string[];
62
- };
63
- /**
64
- * Object representing the response to the underwriting approval request.
65
- * @typedef {Object} ApprovalResult
66
- * @property {Approval | Rejection} result the EA decision, either an approval or rejection.
67
- */
68
- export type ApprovalResult = {
69
- result: Approval | Rejection;
70
- };
71
- /**
72
- * Object representing the receivable in an underwriting request.
73
- * @typedef {Object} ReceivableRequest
74
- * @property {string} address The address of the receivable asset contract.
75
- * @property {string} [param] The parameter for the receivable asset. E.g. For Request Network integrations,
76
- * this would be the request ID associated with the ERC20TransferableReceivable.
77
- */
78
- type ReceivableRequest = {
79
- address: string;
80
- param?: string;
81
- };
82
- /**
83
- * Object representing the additional data required for a receivable-based underwriting request.
84
- * @typedef {Object} EARequestContextReceivable
85
- * @property {ReceivableRequest} receivable The receivable information.
86
- */
87
- type EARequestContextReceivable = {
88
- receivable: ReceivableRequest;
89
- };
90
- /**
91
- * Object representing the additional data required for a stream factoring underwriting request.
92
- * @typedef {Object} EARequestContextStream
93
- * @property {ReceivableRequest} receivable The receivable information.
94
- * @property {string} payerWalletAddress The address of the payer.
95
- * @property {string} superToken The address of the SuperToken contract.
96
- */
97
- type EARequestContextStream = {
98
- receivable: ReceivableRequest;
99
- payerWalletAddress: string;
100
- superToken: string;
101
- };
102
- /**
103
- * Object that represents the payload for an underwriting request.
104
- * @typedef {Object} EAPayload
105
- * @property {string} poolAddress The pool address to approve.
106
- * @property {string} borrowerWalletAddress The address of the borrower.
107
- * @property {EARequestContextReceivable | EARequestContextStream} [context] Extra values to submit with the approval request.
108
- */
109
- export type EAPayload = {
110
- poolAddress: string;
111
- borrowerWalletAddress: string;
112
- context?: EARequestContextReceivable | EARequestContextStream;
113
- };
114
- /**
115
- * Object representing the response to the underwriting preapproval request.
116
- * @typedef {Object} PreapprovalResult
117
- * @property {boolean} approved the EA decision, either an approval or rejection.
118
- * @property {string[]} [rejectionReasons] The reasons for rejection, if any
119
- */
120
- export type PreapprovalResult = {
121
- approved: boolean;
122
- rejectionReasons?: string[];
123
- };
124
- /**
125
- * Object that includes extra data to be submitted to the underwriting preapproval request when
126
- * checking for receivable requests
127
- * @typedef {Object} EAPreapproveContextReceivable
128
- * @property {string} payerWalletAddress The wallet of the payer of the receivable
129
- */
130
- type EAPreapproveContextReceivable = {
131
- payerWalletAddress: string;
132
- };
133
- /**
134
- * Object that represents the payload for a preapprove check.
135
- * @typedef {Object} EAPreapprovalPayload
136
- * @property {string} poolAddress The pool address to approve.
137
- * @property {string} borrowerWalletAddress The address of the borrower.
138
- * @property {EAPreapproveContextReceivable} [context] Extra values to submit with the preapproval request.
139
- */
140
- export type EAPreapprovalPayload = {
141
- poolAddress: string;
142
- borrowerWalletAddress: string;
143
- context?: EAPreapproveContextReceivable;
144
- };
145
- export declare const EAService: {
146
- approve: (payload: EAPayload, chainId: number, isDev?: boolean) => Promise<Approval>;
147
- approveLender: (payload: {
148
- poolAddress: string;
149
- lenderWalletAddress: string;
150
- }, chainId: number) => Promise<ApprovalResult>;
151
- preapprove: (payload: EAPreapprovalPayload, chainId: number, isDev?: boolean) => Promise<PreapprovalResult>;
152
- };
153
- export {};
1
+ /**
2
+ * Object representing the token information of the approval.
3
+ * @typedef {Object} Token
4
+ * @property {string} symbol The symbol of the base token of the pool.
5
+ * @property {string} name The name of the base token of the pool.
6
+ * @property {number} decimal The number of decimals for the base token of the pool.
7
+ */
8
+ type Token = {
9
+ symbol: string;
10
+ name: string;
11
+ decimal: number;
12
+ };
13
+ /**
14
+ * Object representing the approved loan terms.
15
+ * @typedef {Object} Terms
16
+ * @property {string} creditLimit The credit limit for the borrower in the pool's base currency.
17
+ * @property {string} creditLimitFormatted The credit limit for the borrower in the pool's base currency, formatted with that tokens' decimals.
18
+ * @property {number} intervalInDays The interval in days for credit line rebalancing.
19
+ * @property {number} remainingPeriods The number of remaining payback periods in the credit line.
20
+ * @property {number} aprInBps The annual percentage rate in basis points.
21
+ */
22
+ type Terms = {
23
+ creditLimit: string;
24
+ creditLimitFormatted: string;
25
+ intervalInDays: number;
26
+ remainingPeriods: number;
27
+ aprInBps: number;
28
+ };
29
+ /**
30
+ * Object representing receivable information of the approval.
31
+ * @typedef {Object} Receivable
32
+ * @property {string} asset The address of the receivable asset contract.
33
+ * @property {number|string} param The identifying parameter for the receivable asset, often the token ID of an ERC721.
34
+ * @property {string} amount The expected payment amount of the receivable asset.
35
+ * @property {string} amountFormatted The expected payment amount of the receivable asset, formatted with that tokens' decimals.
36
+ */
37
+ type Receivable = {
38
+ asset: string;
39
+ param: string;
40
+ amount: string;
41
+ amountFormatted: string;
42
+ };
43
+ /**
44
+ * Object representing EA approval.
45
+ * @typedef {Object} Approval
46
+ * @property {Token} token The token information for the approval.
47
+ * @property {Terms} terms The approved loan terms.
48
+ * @property {Receivable} receivable The receivable information.
49
+ */
50
+ export type Approval = {
51
+ token: Token;
52
+ terms: Terms;
53
+ receivable?: Receivable;
54
+ };
55
+ /**
56
+ * Object representing EA rejection.
57
+ * @typedef {Object} Rejection
58
+ * @property {string[]} reasons Rejection reasons.
59
+ */
60
+ export type Rejection = {
61
+ reasons: string[];
62
+ };
63
+ /**
64
+ * Object representing the response to the underwriting approval request.
65
+ * @typedef {Object} ApprovalResult
66
+ * @property {Approval | Rejection} result the EA decision, either an approval or rejection.
67
+ */
68
+ export type ApprovalResult = {
69
+ result: Approval | Rejection;
70
+ };
71
+ /**
72
+ * Object representing the receivable in an underwriting request.
73
+ * @typedef {Object} ReceivableRequest
74
+ * @property {string} address The address of the receivable asset contract.
75
+ * @property {string} [param] The parameter for the receivable asset. E.g. For Request Network integrations,
76
+ * this would be the request ID associated with the ERC20TransferableReceivable.
77
+ */
78
+ type ReceivableRequest = {
79
+ address: string;
80
+ param?: string;
81
+ };
82
+ /**
83
+ * Object representing the additional data required for a receivable-based underwriting request.
84
+ * @typedef {Object} EARequestContextReceivable
85
+ * @property {ReceivableRequest} receivable The receivable information.
86
+ */
87
+ type EARequestContextReceivable = {
88
+ receivable: ReceivableRequest;
89
+ };
90
+ /**
91
+ * Object representing the additional data required for a stream factoring underwriting request.
92
+ * @typedef {Object} EARequestContextStream
93
+ * @property {ReceivableRequest} receivable The receivable information.
94
+ * @property {string} payerWalletAddress The address of the payer.
95
+ * @property {string} superToken The address of the SuperToken contract.
96
+ */
97
+ type EARequestContextStream = {
98
+ receivable: ReceivableRequest;
99
+ payerWalletAddress: string;
100
+ superToken: string;
101
+ };
102
+ /**
103
+ * Object that represents the payload for an underwriting request.
104
+ * @typedef {Object} EAPayload
105
+ * @property {string} poolAddress The pool address to approve.
106
+ * @property {string} borrowerWalletAddress The address of the borrower.
107
+ * @property {EARequestContextReceivable | EARequestContextStream} [context] Extra values to submit with the approval request.
108
+ */
109
+ export type EAPayload = {
110
+ poolAddress: string;
111
+ borrowerWalletAddress: string;
112
+ context?: EARequestContextReceivable | EARequestContextStream;
113
+ };
114
+ /**
115
+ * Object representing the response to the underwriting preapproval request.
116
+ * @typedef {Object} PreapprovalResult
117
+ * @property {boolean} approved the EA decision, either an approval or rejection.
118
+ * @property {string[]} [rejectionReasons] The reasons for rejection, if any
119
+ */
120
+ export type PreapprovalResult = {
121
+ approved: boolean;
122
+ rejectionReasons?: string[];
123
+ };
124
+ /**
125
+ * Object that includes extra data to be submitted to the underwriting preapproval request when
126
+ * checking for receivable requests
127
+ * @typedef {Object} EAPreapproveContextReceivable
128
+ * @property {string} payerWalletAddress The wallet of the payer of the receivable
129
+ */
130
+ type EAPreapproveContextReceivable = {
131
+ payerWalletAddress: string;
132
+ };
133
+ /**
134
+ * Object that represents the payload for a preapprove check.
135
+ * @typedef {Object} EAPreapprovalPayload
136
+ * @property {string} poolAddress The pool address to approve.
137
+ * @property {string} borrowerWalletAddress The address of the borrower.
138
+ * @property {EAPreapproveContextReceivable} [context] Extra values to submit with the preapproval request.
139
+ */
140
+ export type EAPreapprovalPayload = {
141
+ poolAddress: string;
142
+ borrowerWalletAddress: string;
143
+ context?: EAPreapproveContextReceivable;
144
+ };
145
+ export declare const EAService: {
146
+ approve: (payload: EAPayload, chainId: number, isDev?: boolean) => Promise<Approval>;
147
+ approveLender: (payload: {
148
+ poolAddress: string;
149
+ lenderWalletAddress: string;
150
+ }, chainId: number) => Promise<ApprovalResult>;
151
+ preapprove: (payload: EAPreapprovalPayload, chainId: number, isDev?: boolean) => Promise<PreapprovalResult>;
152
+ };
153
+ export {};