@huma-finance/shared 0.0.34 → 0.0.36

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 (401) hide show
  1. package/LICENSE +660 -660
  2. package/README.md +28 -28
  3. package/dist/abis/erc20.json +10 -0
  4. package/dist/abis/types/Erc20.d.ts +17 -1
  5. package/dist/abis/types/factories/BaseCreditPool__factory.js +1 -2
  6. package/dist/abis/types/factories/BaseCreditPool__factory.js.map +1 -1
  7. package/dist/abis/types/factories/BaseFeeManager__factory.js +1 -2
  8. package/dist/abis/types/factories/BaseFeeManager__factory.js.map +1 -1
  9. package/dist/abis/types/factories/BasePoolConfig__factory.js +1 -2
  10. package/dist/abis/types/factories/BasePoolConfig__factory.js.map +1 -1
  11. package/dist/abis/types/factories/ERC20TransferableReceivable__factory.js +1 -2
  12. package/dist/abis/types/factories/ERC20TransferableReceivable__factory.js.map +1 -1
  13. package/dist/abis/types/factories/Erc20__factory.d.ts +18 -0
  14. package/dist/abis/types/factories/Erc20__factory.js +25 -2
  15. package/dist/abis/types/factories/Erc20__factory.js.map +1 -1
  16. package/dist/abis/types/factories/Erc2612__factory.js +1 -2
  17. package/dist/abis/types/factories/Erc2612__factory.js.map +1 -1
  18. package/dist/abis/types/factories/Erc721__factory.js +1 -2
  19. package/dist/abis/types/factories/Erc721__factory.js.map +1 -1
  20. package/dist/abis/types/factories/HDT__factory.js +1 -2
  21. package/dist/abis/types/factories/HDT__factory.js.map +1 -1
  22. package/dist/abis/types/factories/IConstantFlowAgreementV1__factory.js +1 -2
  23. package/dist/abis/types/factories/IConstantFlowAgreementV1__factory.js.map +1 -1
  24. package/dist/abis/types/factories/ISuperfluid__factory.js +1 -2
  25. package/dist/abis/types/factories/ISuperfluid__factory.js.map +1 -1
  26. package/dist/abis/types/factories/InvoiceNFT__factory.js +1 -2
  27. package/dist/abis/types/factories/InvoiceNFT__factory.js.map +1 -1
  28. package/dist/abis/types/factories/Multisend__factory.js +1 -2
  29. package/dist/abis/types/factories/Multisend__factory.js.map +1 -1
  30. package/dist/abis/types/factories/RealWorldReceivable__factory.js +1 -2
  31. package/dist/abis/types/factories/RealWorldReceivable__factory.js.map +1 -1
  32. package/dist/abis/types/factories/ReceivableFactoringPool__factory.js +1 -2
  33. package/dist/abis/types/factories/ReceivableFactoringPool__factory.js.map +1 -1
  34. package/dist/abis/types/factories/StreamFactoringPool__factory.js +1 -2
  35. package/dist/abis/types/factories/StreamFactoringPool__factory.js.map +1 -1
  36. package/dist/abis/types/factories/StreamFeeManager__factory.js +1 -2
  37. package/dist/abis/types/factories/StreamFeeManager__factory.js.map +1 -1
  38. package/dist/abis/types/factories/SuperfluidPoolProcessor__factory.js +1 -2
  39. package/dist/abis/types/factories/SuperfluidPoolProcessor__factory.js.map +1 -1
  40. package/dist/abis/types/factories/TestERC20__factory.js +1 -2
  41. package/dist/abis/types/factories/TestERC20__factory.js.map +1 -1
  42. package/dist/abis/types/factories/TradableStream__factory.js +1 -2
  43. package/dist/abis/types/factories/TradableStream__factory.js.map +1 -1
  44. package/dist/abis/types/factories/TransferNFT__factory.js +1 -2
  45. package/dist/abis/types/factories/TransferNFT__factory.js.map +1 -1
  46. package/dist/abis/types/factories/Transfer__factory.js +1 -2
  47. package/dist/abis/types/factories/Transfer__factory.js.map +1 -1
  48. package/dist/cjs/abis/BaseCreditPool.json +1179 -1179
  49. package/dist/cjs/abis/BaseFeeManager.json +480 -480
  50. package/dist/cjs/abis/BasePoolConfig.json +1364 -1364
  51. package/dist/cjs/abis/ERC20TransferableReceivable.json +648 -648
  52. package/dist/cjs/abis/HDT.json +512 -512
  53. package/dist/cjs/abis/IConstantFlowAgreementV1.json +890 -890
  54. package/dist/cjs/abis/ISuperfluid.json +1122 -1122
  55. package/dist/cjs/abis/InvoiceNFT.json +625 -625
  56. package/dist/cjs/abis/Multisend.json +26 -26
  57. package/dist/cjs/abis/RealWorldReceivable.json +823 -823
  58. package/dist/cjs/abis/ReceivableFactoringPool.json +1529 -1529
  59. package/dist/cjs/abis/StreamFactoringPool.json +1523 -1523
  60. package/dist/cjs/abis/StreamFeeManager.json +522 -522
  61. package/dist/cjs/abis/SuperfluidPoolProcessor.json +692 -692
  62. package/dist/cjs/abis/TestERC20.json +358 -358
  63. package/dist/cjs/abis/TradableStream.json +850 -850
  64. package/dist/cjs/abis/Transfer.json +24 -24
  65. package/dist/cjs/abis/TransferNFT.json +27 -27
  66. package/dist/cjs/abis/erc20.json +127 -117
  67. package/dist/cjs/abis/erc2612.json +132 -132
  68. package/dist/cjs/abis/erc721.json +673 -673
  69. package/dist/cjs/abis/index.d.ts +3 -3
  70. package/dist/cjs/abis/index.js +12 -12
  71. package/dist/cjs/abis/types/BaseCreditPool.d.ts +803 -803
  72. package/dist/cjs/abis/types/BaseCreditPool.js +2 -2
  73. package/dist/cjs/abis/types/BaseFeeManager.d.ts +408 -408
  74. package/dist/cjs/abis/types/BaseFeeManager.js +2 -2
  75. package/dist/cjs/abis/types/BasePoolConfig.d.ts +1097 -1097
  76. package/dist/cjs/abis/types/BasePoolConfig.js +2 -2
  77. package/dist/cjs/abis/types/ERC20TransferableReceivable.d.ts +407 -407
  78. package/dist/cjs/abis/types/ERC20TransferableReceivable.js +2 -2
  79. package/dist/cjs/abis/types/Erc20.d.ts +184 -168
  80. package/dist/cjs/abis/types/Erc20.js +2 -2
  81. package/dist/cjs/abis/types/Erc2612.d.ts +192 -192
  82. package/dist/cjs/abis/types/Erc2612.js +2 -2
  83. package/dist/cjs/abis/types/Erc721.d.ts +474 -474
  84. package/dist/cjs/abis/types/Erc721.js +2 -2
  85. package/dist/cjs/abis/types/HDT.d.ts +369 -369
  86. package/dist/cjs/abis/types/HDT.js +2 -2
  87. package/dist/cjs/abis/types/IConstantFlowAgreementV1.d.ts +573 -573
  88. package/dist/cjs/abis/types/IConstantFlowAgreementV1.js +2 -2
  89. package/dist/cjs/abis/types/ISuperfluid.d.ts +728 -728
  90. package/dist/cjs/abis/types/ISuperfluid.js +2 -2
  91. package/dist/cjs/abis/types/InvoiceNFT.d.ts +425 -425
  92. package/dist/cjs/abis/types/InvoiceNFT.js +2 -2
  93. package/dist/cjs/abis/types/Multisend.d.ts +50 -50
  94. package/dist/cjs/abis/types/Multisend.js +2 -2
  95. package/dist/cjs/abis/types/RealWorldReceivable.d.ts +564 -564
  96. package/dist/cjs/abis/types/RealWorldReceivable.js +2 -2
  97. package/dist/cjs/abis/types/ReceivableFactoringPool.d.ts +999 -999
  98. package/dist/cjs/abis/types/ReceivableFactoringPool.js +2 -2
  99. package/dist/cjs/abis/types/StreamFactoringPool.d.ts +985 -985
  100. package/dist/cjs/abis/types/StreamFactoringPool.js +2 -2
  101. package/dist/cjs/abis/types/StreamFeeManager.d.ts +440 -440
  102. package/dist/cjs/abis/types/StreamFeeManager.js +2 -2
  103. package/dist/cjs/abis/types/SuperfluidPoolProcessor.d.ts +398 -398
  104. package/dist/cjs/abis/types/SuperfluidPoolProcessor.js +2 -2
  105. package/dist/cjs/abis/types/TestERC20.d.ts +270 -270
  106. package/dist/cjs/abis/types/TestERC20.js +2 -2
  107. package/dist/cjs/abis/types/TradableStream.d.ts +607 -607
  108. package/dist/cjs/abis/types/TradableStream.js +2 -2
  109. package/dist/cjs/abis/types/Transfer.d.ts +45 -45
  110. package/dist/cjs/abis/types/Transfer.js +2 -2
  111. package/dist/cjs/abis/types/TransferNFT.d.ts +45 -45
  112. package/dist/cjs/abis/types/TransferNFT.js +2 -2
  113. package/dist/cjs/abis/types/common.d.ts +22 -22
  114. package/dist/cjs/abis/types/common.js +2 -2
  115. package/dist/cjs/abis/types/factories/BaseCreditPool__factory.d.ts +931 -931
  116. package/dist/cjs/abis/types/factories/BaseCreditPool__factory.js +1196 -1196
  117. package/dist/cjs/abis/types/factories/BaseFeeManager__factory.d.ts +379 -379
  118. package/dist/cjs/abis/types/factories/BaseFeeManager__factory.js +497 -497
  119. package/dist/cjs/abis/types/factories/BasePoolConfig__factory.d.ts +1074 -1074
  120. package/dist/cjs/abis/types/factories/BasePoolConfig__factory.js +1381 -1381
  121. package/dist/cjs/abis/types/factories/ERC20TransferableReceivable__factory.d.ts +508 -508
  122. package/dist/cjs/abis/types/factories/ERC20TransferableReceivable__factory.js +665 -665
  123. package/dist/cjs/abis/types/factories/Erc20__factory.d.ts +193 -175
  124. package/dist/cjs/abis/types/factories/Erc20__factory.js +263 -239
  125. package/dist/cjs/abis/types/factories/Erc20__factory.js.map +1 -1
  126. package/dist/cjs/abis/types/factories/Erc2612__factory.d.ts +209 -209
  127. package/dist/cjs/abis/types/factories/Erc2612__factory.js +282 -282
  128. package/dist/cjs/abis/types/factories/Erc721__factory.d.ts +539 -539
  129. package/dist/cjs/abis/types/factories/Erc721__factory.js +690 -690
  130. package/dist/cjs/abis/types/factories/HDT__factory.d.ts +399 -399
  131. package/dist/cjs/abis/types/factories/HDT__factory.js +529 -529
  132. package/dist/cjs/abis/types/factories/IConstantFlowAgreementV1__factory.d.ts +695 -695
  133. package/dist/cjs/abis/types/factories/IConstantFlowAgreementV1__factory.js +907 -907
  134. package/dist/cjs/abis/types/factories/ISuperfluid__factory.d.ts +866 -866
  135. package/dist/cjs/abis/types/factories/ISuperfluid__factory.js +1139 -1139
  136. package/dist/cjs/abis/types/factories/InvoiceNFT__factory.d.ts +489 -489
  137. package/dist/cjs/abis/types/factories/InvoiceNFT__factory.js +642 -642
  138. package/dist/cjs/abis/types/factories/Multisend__factory.d.ts +26 -26
  139. package/dist/cjs/abis/types/factories/Multisend__factory.js +43 -43
  140. package/dist/cjs/abis/types/factories/RealWorldReceivable__factory.d.ts +645 -645
  141. package/dist/cjs/abis/types/factories/RealWorldReceivable__factory.js +840 -840
  142. package/dist/cjs/abis/types/factories/ReceivableFactoringPool__factory.d.ts +1204 -1204
  143. package/dist/cjs/abis/types/factories/ReceivableFactoringPool__factory.js +1546 -1546
  144. package/dist/cjs/abis/types/factories/StreamFactoringPool__factory.d.ts +1200 -1200
  145. package/dist/cjs/abis/types/factories/StreamFactoringPool__factory.js +1540 -1540
  146. package/dist/cjs/abis/types/factories/StreamFeeManager__factory.d.ts +412 -412
  147. package/dist/cjs/abis/types/factories/StreamFeeManager__factory.js +539 -539
  148. package/dist/cjs/abis/types/factories/SuperfluidPoolProcessor__factory.d.ts +546 -546
  149. package/dist/cjs/abis/types/factories/SuperfluidPoolProcessor__factory.js +709 -709
  150. package/dist/cjs/abis/types/factories/TestERC20__factory.d.ts +280 -280
  151. package/dist/cjs/abis/types/factories/TestERC20__factory.js +375 -375
  152. package/dist/cjs/abis/types/factories/TradableStream__factory.d.ts +663 -663
  153. package/dist/cjs/abis/types/factories/TradableStream__factory.js +867 -867
  154. package/dist/cjs/abis/types/factories/TransferNFT__factory.d.ts +28 -28
  155. package/dist/cjs/abis/types/factories/TransferNFT__factory.js +44 -44
  156. package/dist/cjs/abis/types/factories/Transfer__factory.d.ts +25 -25
  157. package/dist/cjs/abis/types/factories/Transfer__factory.js +41 -41
  158. package/dist/cjs/abis/types/factories/index.d.ts +21 -21
  159. package/dist/cjs/abis/types/factories/index.js +48 -48
  160. package/dist/cjs/abis/types/index.d.ts +43 -43
  161. package/dist/cjs/abis/types/index.js +47 -47
  162. package/dist/cjs/hooks/index.d.ts +18 -18
  163. package/dist/cjs/hooks/index.js +21 -21
  164. package/dist/cjs/hooks/useActiveRoute.d.ts +8 -8
  165. package/dist/cjs/hooks/useActiveRoute.js +11 -11
  166. package/dist/cjs/hooks/useAsyncError.d.ts +14 -14
  167. package/dist/cjs/hooks/useAsyncError.js +26 -26
  168. package/dist/cjs/hooks/useCLPoolContract.d.ts +28 -27
  169. package/dist/cjs/hooks/useCLPoolContract.js +53 -53
  170. package/dist/cjs/hooks/useContract.d.ts +7 -7
  171. package/dist/cjs/hooks/useContract.js +49 -49
  172. package/dist/cjs/hooks/useContractFunction.d.ts +18 -18
  173. package/dist/cjs/hooks/useContractFunction.js +57 -57
  174. package/dist/cjs/hooks/useERC2612Permit/ethPermit/index.d.ts +35 -35
  175. package/dist/cjs/hooks/useERC2612Permit/ethPermit/index.js +145 -145
  176. package/dist/cjs/hooks/useERC2612Permit/ethPermit/lib.d.ts +1 -1
  177. package/dist/cjs/hooks/useERC2612Permit/ethPermit/lib.js +26 -26
  178. package/dist/cjs/hooks/useERC2612Permit/ethPermit/rpc.d.ts +10 -10
  179. package/dist/cjs/hooks/useERC2612Permit/ethPermit/rpc.js +104 -104
  180. package/dist/cjs/hooks/useERC2612Permit/index.d.ts +6 -6
  181. package/dist/cjs/hooks/useERC2612Permit/index.js +35 -35
  182. package/dist/cjs/hooks/useFactoring.d.ts +19 -19
  183. package/dist/cjs/hooks/useFactoring.js +94 -94
  184. package/dist/cjs/hooks/useForceRefresh.d.ts +1 -1
  185. package/dist/cjs/hooks/useForceRefresh.js +12 -12
  186. package/dist/cjs/hooks/useGetSizes.d.ts +12 -12
  187. package/dist/cjs/hooks/useGetSizes.js +23 -23
  188. package/dist/cjs/hooks/useInvoiceNFTContract.d.ts +11 -11
  189. package/dist/cjs/hooks/useInvoiceNFTContract.js +72 -72
  190. package/dist/cjs/hooks/useMQ.d.ts +6 -6
  191. package/dist/cjs/hooks/useMQ.js +18 -18
  192. package/dist/cjs/hooks/useMount.d.ts +2 -2
  193. package/dist/cjs/hooks/useMount.js +13 -13
  194. package/dist/cjs/hooks/useParamsSearch.d.ts +2 -2
  195. package/dist/cjs/hooks/useParamsSearch.js +11 -11
  196. package/dist/cjs/hooks/usePool.d.ts +4 -4
  197. package/dist/cjs/hooks/usePool.js +45 -45
  198. package/dist/cjs/hooks/usePoolContract.d.ts +74 -73
  199. package/dist/cjs/hooks/usePoolContract.js +310 -309
  200. package/dist/cjs/hooks/usePoolContract.js.map +1 -1
  201. package/dist/cjs/hooks/useRFPoolContract.d.ts +23 -22
  202. package/dist/cjs/hooks/useRFPoolContract.js +41 -41
  203. package/dist/cjs/hooks/useRefresh.d.ts +1 -1
  204. package/dist/cjs/hooks/useRefresh.js +51 -51
  205. package/dist/cjs/hooks/web3/index.d.ts +11 -15
  206. package/dist/cjs/hooks/web3/index.js +146 -147
  207. package/dist/cjs/hooks/web3/index.js.map +1 -1
  208. package/dist/cjs/hooks/web3/useConnectors.d.ts +17 -17
  209. package/dist/cjs/hooks/web3/useConnectors.js +30 -30
  210. package/dist/cjs/hooks/web3/useJsonRpcUrlsMap.d.ts +13 -13
  211. package/dist/cjs/hooks/web3/useJsonRpcUrlsMap.js +64 -62
  212. package/dist/cjs/hooks/web3/useJsonRpcUrlsMap.js.map +1 -1
  213. package/dist/cjs/index.d.ts +5 -5
  214. package/dist/cjs/index.js +8 -8
  215. package/dist/cjs/services/EAService.d.ts +153 -153
  216. package/dist/cjs/services/EAService.js +80 -80
  217. package/dist/cjs/services/IdentityService.d.ts +52 -52
  218. package/dist/cjs/services/IdentityService.js +83 -83
  219. package/dist/cjs/services/RNService.d.ts +14 -14
  220. package/dist/cjs/services/RNService.js +13 -13
  221. package/dist/cjs/services/index.d.ts +3 -3
  222. package/dist/cjs/services/index.js +6 -6
  223. package/dist/cjs/utils/JsonRpcConnector.d.ts +11 -11
  224. package/dist/cjs/utils/JsonRpcConnector.js +42 -42
  225. package/dist/cjs/utils/WalletConnect.d.ts +10 -10
  226. package/dist/cjs/utils/WalletConnect.js +55 -55
  227. package/dist/cjs/utils/chain.d.ts +39 -36
  228. package/dist/cjs/utils/chain.js +126 -116
  229. package/dist/cjs/utils/chain.js.map +1 -1
  230. package/dist/cjs/utils/common.d.ts +4 -4
  231. package/dist/cjs/utils/common.js +17 -17
  232. package/dist/cjs/utils/config.d.ts +8 -8
  233. package/dist/cjs/utils/config.js +45 -44
  234. package/dist/cjs/utils/config.js.map +1 -1
  235. package/dist/cjs/utils/const.d.ts +2 -2
  236. package/dist/cjs/utils/const.js +5 -5
  237. package/dist/cjs/utils/contractError.json +73 -73
  238. package/dist/cjs/utils/contractconfig.json +19 -19
  239. package/dist/cjs/utils/credit.d.ts +21 -21
  240. package/dist/cjs/utils/credit.js +41 -39
  241. package/dist/cjs/utils/credit.js.map +1 -1
  242. package/dist/cjs/utils/errors.d.ts +26 -26
  243. package/dist/cjs/utils/errors.js +46 -46
  244. package/dist/cjs/utils/index.d.ts +20 -20
  245. package/dist/cjs/utils/index.js +23 -23
  246. package/dist/cjs/utils/jsonRpcEndpoints.d.ts +12 -12
  247. package/dist/cjs/utils/jsonRpcEndpoints.js +21 -28
  248. package/dist/cjs/utils/jsonRpcEndpoints.js.map +1 -1
  249. package/dist/cjs/utils/notifi.d.ts +4 -3
  250. package/dist/cjs/utils/notifi.js +42 -39
  251. package/dist/cjs/utils/notifi.js.map +1 -1
  252. package/dist/cjs/utils/number.d.ts +6 -5
  253. package/dist/cjs/utils/number.js +74 -61
  254. package/dist/cjs/utils/number.js.map +1 -1
  255. package/dist/cjs/utils/pool.d.ts +96 -96
  256. package/dist/cjs/utils/pool.js +371 -440
  257. package/dist/cjs/utils/pool.js.map +1 -1
  258. package/dist/cjs/utils/realWorldReceivable.d.ts +12 -12
  259. package/dist/cjs/utils/realWorldReceivable.js +2 -2
  260. package/dist/cjs/utils/request.d.ts +3 -3
  261. package/dist/cjs/utils/request.js +45 -45
  262. package/dist/cjs/utils/scientificToDecimal.d.ts +1 -1
  263. package/dist/cjs/utils/scientificToDecimal.js +61 -61
  264. package/dist/cjs/utils/string.d.ts +1 -1
  265. package/dist/cjs/utils/string.js +5 -5
  266. package/dist/cjs/utils/style.d.ts +1 -1
  267. package/dist/cjs/utils/style.js +16 -16
  268. package/dist/cjs/utils/time.d.ts +26 -26
  269. package/dist/cjs/utils/time.js +58 -58
  270. package/dist/cjs/utils/transaction.d.ts +32 -32
  271. package/dist/cjs/utils/transaction.js +96 -96
  272. package/dist/cjs/utils/web3.d.ts +4 -4
  273. package/dist/cjs/utils/web3.js +39 -39
  274. package/dist/hooks/useCLPoolContract.d.ts +1 -0
  275. package/dist/hooks/useCLPoolContract.js +38 -38
  276. package/dist/hooks/useContract.js +40 -40
  277. package/dist/hooks/useFactoring.js +90 -90
  278. package/dist/hooks/useInvoiceNFTContract.js +64 -64
  279. package/dist/hooks/usePool.js +39 -39
  280. package/dist/hooks/usePoolContract.d.ts +1 -0
  281. package/dist/hooks/usePoolContract.js +287 -286
  282. package/dist/hooks/usePoolContract.js.map +1 -1
  283. package/dist/hooks/useRFPoolContract.d.ts +1 -0
  284. package/dist/hooks/useRFPoolContract.js +29 -29
  285. package/dist/hooks/web3/index.d.ts +1 -5
  286. package/dist/hooks/web3/index.js +141 -142
  287. package/dist/hooks/web3/index.js.map +1 -1
  288. package/dist/hooks/web3/useJsonRpcUrlsMap.js +55 -53
  289. package/dist/hooks/web3/useJsonRpcUrlsMap.js.map +1 -1
  290. package/dist/index.js +5 -5
  291. package/dist/services/EAService.js +77 -77
  292. package/dist/services/IdentityService.d.ts +52 -52
  293. package/dist/services/IdentityService.js +80 -80
  294. package/dist/services/RNService.js +10 -10
  295. package/dist/services/index.js +3 -3
  296. package/dist/tsconfig.cjs.tsbuildinfo +1 -1
  297. package/dist/utils/WalletConnect.js +1 -2
  298. package/dist/utils/WalletConnect.js.map +1 -1
  299. package/dist/utils/chain.d.ts +39 -36
  300. package/dist/utils/chain.js +118 -109
  301. package/dist/utils/chain.js.map +1 -1
  302. package/dist/utils/config.d.ts +8 -8
  303. package/dist/utils/config.js +42 -41
  304. package/dist/utils/config.js.map +1 -1
  305. package/dist/utils/contractconfig.json +19 -19
  306. package/dist/utils/credit.js +2 -0
  307. package/dist/utils/credit.js.map +1 -1
  308. package/dist/utils/index.d.ts +20 -20
  309. package/dist/utils/index.js +20 -20
  310. package/dist/utils/jsonRpcEndpoints.js +18 -25
  311. package/dist/utils/jsonRpcEndpoints.js.map +1 -1
  312. package/dist/utils/notifi.d.ts +4 -3
  313. package/dist/utils/notifi.js +36 -34
  314. package/dist/utils/notifi.js.map +1 -1
  315. package/dist/utils/number.d.ts +1 -0
  316. package/dist/utils/number.js +66 -54
  317. package/dist/utils/number.js.map +1 -1
  318. package/dist/utils/pool.d.ts +96 -96
  319. package/dist/utils/pool.js +364 -433
  320. package/dist/utils/pool.js.map +1 -1
  321. package/dist/utils/realWorldReceivable.d.ts +12 -12
  322. package/dist/utils/realWorldReceivable.js +1 -1
  323. package/package.json +5 -4
  324. package/dist/abis/BaseCreditPoolReceivable.json +0 -764
  325. package/dist/abis/ERC20TransferrableReceivable.json +0 -648
  326. package/dist/abis/types/BaseCreditPoolReceivable.d.ts +0 -518
  327. package/dist/abis/types/BaseCreditPoolReceivable.js +0 -2
  328. package/dist/abis/types/BaseCreditPoolReceivable.js.map +0 -1
  329. package/dist/abis/types/ERC20TransferrableReceivable.d.ts +0 -407
  330. package/dist/abis/types/ERC20TransferrableReceivable.js +0 -2
  331. package/dist/abis/types/ERC20TransferrableReceivable.js.map +0 -1
  332. package/dist/abis/types/factories/BaseCreditPoolReceivable__factory.d.ts +0 -597
  333. package/dist/abis/types/factories/BaseCreditPoolReceivable__factory.js +0 -778
  334. package/dist/abis/types/factories/BaseCreditPoolReceivable__factory.js.map +0 -1
  335. package/dist/abis/types/factories/ERC20TransferrableReceivable__factory.d.ts +0 -508
  336. package/dist/abis/types/factories/ERC20TransferrableReceivable__factory.js +0 -663
  337. package/dist/abis/types/factories/ERC20TransferrableReceivable__factory.js.map +0 -1
  338. package/dist/cjs/abis/BaseCreditPoolReceivable.json +0 -764
  339. package/dist/cjs/abis/types/BaseCreditPoolReceivable.d.ts +0 -518
  340. package/dist/cjs/abis/types/BaseCreditPoolReceivable.js +0 -3
  341. package/dist/cjs/abis/types/BaseCreditPoolReceivable.js.map +0 -1
  342. package/dist/cjs/abis/types/factories/BaseCreditPoolReceivable__factory.d.ts +0 -597
  343. package/dist/cjs/abis/types/factories/BaseCreditPoolReceivable__factory.js +0 -782
  344. package/dist/cjs/abis/types/factories/BaseCreditPoolReceivable__factory.js.map +0 -1
  345. package/dist/components/icons/approve-lender.svg +0 -30
  346. package/dist/components/icons/auto-payback.svg +0 -40
  347. package/dist/components/icons/check-circle.svg +0 -3
  348. package/dist/components/icons/check-green.svg +0 -3
  349. package/dist/components/icons/check.svg +0 -10
  350. package/dist/components/icons/donut.svg +0 -904
  351. package/dist/components/icons/ellipse.svg +0 -3
  352. package/dist/components/icons/ethereum.svg +0 -1
  353. package/dist/components/icons/huma-full.svg +0 -22
  354. package/dist/components/icons/huma.svg +0 -15
  355. package/dist/components/icons/index.d.ts +0 -19
  356. package/dist/components/icons/index.js +0 -70
  357. package/dist/components/icons/index.js.map +0 -1
  358. package/dist/components/icons/loader.svg +0 -229
  359. package/dist/components/icons/metamask.svg +0 -31
  360. package/dist/components/icons/polygon.svg +0 -16
  361. package/dist/components/icons/receipt.svg +0 -3
  362. package/dist/components/icons/separator.svg +0 -3
  363. package/dist/components/icons/sorry.svg +0 -31
  364. package/dist/components/icons/usdc.svg +0 -5
  365. package/dist/components/icons/wallet-connect.svg +0 -12
  366. package/dist/theme/breakpoints.d.ts +0 -5
  367. package/dist/theme/breakpoints.js +0 -4
  368. package/dist/theme/breakpoints.js.map +0 -1
  369. package/dist/theme/components.d.ts +0 -6
  370. package/dist/theme/components.js +0 -62
  371. package/dist/theme/components.js.map +0 -1
  372. package/dist/theme/coreThemeConstants.d.ts +0 -18
  373. package/dist/theme/coreThemeConstants.js +0 -30
  374. package/dist/theme/coreThemeConstants.js.map +0 -1
  375. package/dist/theme/cssMixins.d.ts +0 -20
  376. package/dist/theme/cssMixins.js +0 -90
  377. package/dist/theme/cssMixins.js.map +0 -1
  378. package/dist/theme/index.d.ts +0 -8
  379. package/dist/theme/index.js +0 -27
  380. package/dist/theme/index.js.map +0 -1
  381. package/dist/theme/palette.d.ts +0 -53
  382. package/dist/theme/palette.js +0 -137
  383. package/dist/theme/palette.js.map +0 -1
  384. package/dist/theme/shape.d.ts +0 -2
  385. package/dist/theme/shape.js +0 -5
  386. package/dist/theme/shape.js.map +0 -1
  387. package/dist/theme/theme.types.d.ts +0 -72
  388. package/dist/theme/theme.types.js +0 -2
  389. package/dist/theme/theme.types.js.map +0 -1
  390. package/dist/theme/typography.d.ts +0 -2
  391. package/dist/theme/typography.js +0 -116
  392. package/dist/theme/typography.js.map +0 -1
  393. package/dist/utils/ddLogger.d.ts +0 -4
  394. package/dist/utils/ddLogger.js +0 -48
  395. package/dist/utils/ddLogger.js.map +0 -1
  396. package/dist/utils/sentry.d.ts +0 -1
  397. package/dist/utils/sentry.js +0 -19
  398. package/dist/utils/sentry.js.map +0 -1
  399. package/dist/utils/storage.d.ts +0 -12
  400. package/dist/utils/storage.js +0 -32
  401. package/dist/utils/storage.js.map +0 -1
@@ -1,78 +1,78 @@
1
- import { configUtil } from '../utils/config';
2
- import { EARejectionError } from '../utils/errors';
3
- import { downScale } from '../utils/number';
4
- import { requestPost } from '../utils/request';
5
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
6
- const isRejection = (obj) => obj !== null && typeof obj === 'object' && Array.isArray(obj.reasons);
7
- /**
8
- * Submits a credit underwriting request to Huma's EAVerse. This approves a creditline
9
- * in Huma's pools that can be drawn down by the borrower.
10
- *
11
- * @param {EAPayload} payload The payload for the underwrite approval.
12
- * @param {number} chainId The chain ID.
13
- * @param {boolean} isDev Is dev environment or not.
14
- * @returns {Promise<Approval>} Promise that returns the approval on success.
15
- * @throws {EARejectionError} If the underwrite approval is rejected.
16
- */
17
- const approve = async (payload, chainId, isDev = false) => {
18
- const approvalResult = await requestPost(`${configUtil.getEAVerseUrl(chainId, isDev)}/underwriter/underwrite`, payload);
19
- const { result } = approvalResult;
20
- if (isRejection(result)) {
21
- throw new EARejectionError();
22
- }
23
- if (!result) {
24
- throw new Error('Sorry, there was an error approving your wallet', {
25
- cause: 'server error',
26
- });
27
- }
28
- const { terms, receivable, token } = result;
29
- if (terms === null || terms === void 0 ? void 0 : terms.creditLimit) {
30
- terms.creditLimit = String(result.terms.creditLimit);
31
- terms.creditLimitFormatted = downScale(String(result.terms.creditLimit), token.decimal);
32
- }
33
- if (receivable === null || receivable === void 0 ? void 0 : receivable.amount) {
34
- receivable.amount = String(receivable.amount);
35
- receivable.amountFormatted = downScale(String(receivable.amount), token.decimal);
36
- }
37
- return result;
38
- };
39
- /**
40
- * Checks whether or not a credit underwriting request to Huma's EAVerse would be approved.
41
- * Note that this does not approve a creditline in Huma's pools and an approve call is still required.
42
- *
43
- * @param {EAPreapprovalPayload} payload The payload for the underwrite approval.
44
- * @param {number} chainId The chain ID.
45
- * @param {boolean} isDev Is dev environment or not.
46
- * @returns {Promise<Approval>} Promise that returns the approval on success.
47
- */
48
- const preapprove = async (payload, chainId, isDev = false) => requestPost(`${configUtil.getEAVerseUrl(chainId, isDev)}/underwriter/pre-approve`, payload);
49
- const approveLender = async (payload, chainId) => {
50
- var _a, _b;
51
- const generalErrorMessage = 'Sorry, there was an error approving your wallet as a lender.';
52
- try {
53
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
54
- const data = await requestPost(`${configUtil.getEABaseUrlV1(chainId)}/addApprovedLender`, payload);
55
- if (data.statusCode >= 500) {
56
- throw new Error(data.errorMessage ? data.errorMessage[0] : generalErrorMessage);
57
- }
58
- else if (data.status) {
59
- throw new Error(data.reason[0]);
60
- }
61
- else if ((_a = data.rejectionReason) === null || _a === void 0 ? void 0 : _a.length) {
62
- throw new Error(data.rejectionReason[0]);
63
- }
64
- return data;
65
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
66
- }
67
- catch (error) {
68
- throw new Error((_b = error.message) !== null && _b !== void 0 ? _b : generalErrorMessage, {
69
- cause: 'server error',
70
- });
71
- }
72
- };
73
- export const EAService = {
74
- approve,
75
- approveLender,
76
- preapprove,
77
- };
1
+ import { configUtil } from '../utils/config';
2
+ import { EARejectionError } from '../utils/errors';
3
+ import { downScale } from '../utils/number';
4
+ import { requestPost } from '../utils/request';
5
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
6
+ const isRejection = (obj) => obj !== null && typeof obj === 'object' && Array.isArray(obj.reasons);
7
+ /**
8
+ * Submits a credit underwriting request to Huma's EAVerse. This approves a creditline
9
+ * in Huma's pools that can be drawn down by the borrower.
10
+ *
11
+ * @param {EAPayload} payload The payload for the underwrite approval.
12
+ * @param {number} chainId The chain ID.
13
+ * @param {boolean} isDev Is dev environment or not.
14
+ * @returns {Promise<Approval>} Promise that returns the approval on success.
15
+ * @throws {EARejectionError} If the underwrite approval is rejected.
16
+ */
17
+ const approve = async (payload, chainId, isDev = false) => {
18
+ const approvalResult = await requestPost(`${configUtil.getEAVerseUrl(chainId, isDev)}/underwriter/underwrite`, payload);
19
+ const { result } = approvalResult;
20
+ if (isRejection(result)) {
21
+ throw new EARejectionError();
22
+ }
23
+ if (!result) {
24
+ throw new Error('Sorry, there was an error approving your wallet', {
25
+ cause: 'server error',
26
+ });
27
+ }
28
+ const { terms, receivable, token } = result;
29
+ if (terms === null || terms === void 0 ? void 0 : terms.creditLimit) {
30
+ terms.creditLimit = String(result.terms.creditLimit);
31
+ terms.creditLimitFormatted = downScale(String(result.terms.creditLimit), token.decimal);
32
+ }
33
+ if (receivable === null || receivable === void 0 ? void 0 : receivable.amount) {
34
+ receivable.amount = String(receivable.amount);
35
+ receivable.amountFormatted = downScale(String(receivable.amount), token.decimal);
36
+ }
37
+ return result;
38
+ };
39
+ /**
40
+ * Checks whether or not a credit underwriting request to Huma's EAVerse would be approved.
41
+ * Note that this does not approve a creditline in Huma's pools and an approve call is still required.
42
+ *
43
+ * @param {EAPreapprovalPayload} payload The payload for the underwrite approval.
44
+ * @param {number} chainId The chain ID.
45
+ * @param {boolean} isDev Is dev environment or not.
46
+ * @returns {Promise<Approval>} Promise that returns the approval on success.
47
+ */
48
+ const preapprove = async (payload, chainId, isDev = false) => requestPost(`${configUtil.getEAVerseUrl(chainId, isDev)}/underwriter/pre-approve`, payload);
49
+ const approveLender = async (payload, chainId) => {
50
+ var _a, _b;
51
+ const generalErrorMessage = 'Sorry, there was an error approving your wallet as a lender.';
52
+ try {
53
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
54
+ const data = await requestPost(`${configUtil.getEABaseUrlV1(chainId)}/addApprovedLender`, payload);
55
+ if (data.statusCode >= 500) {
56
+ throw new Error(data.errorMessage ? data.errorMessage[0] : generalErrorMessage);
57
+ }
58
+ else if (data.status) {
59
+ throw new Error(data.reason[0]);
60
+ }
61
+ else if ((_a = data.rejectionReason) === null || _a === void 0 ? void 0 : _a.length) {
62
+ throw new Error(data.rejectionReason[0]);
63
+ }
64
+ return data;
65
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
66
+ }
67
+ catch (error) {
68
+ throw new Error((_b = error.message) !== null && _b !== void 0 ? _b : generalErrorMessage, {
69
+ cause: 'server error',
70
+ });
71
+ }
72
+ };
73
+ export const EAService = {
74
+ approve,
75
+ approveLender,
76
+ preapprove,
77
+ };
78
78
  //# sourceMappingURL=EAService.js.map
@@ -1,52 +1,52 @@
1
- /**
2
- * Enum representing the identity status.
3
- * @typedef {Enum} IdentityStatus
4
- */
5
- declare enum IdentityVerificationStatus {
6
- ACCREDITED = "ACCREDITED",
7
- ACCREDITATION_NOT_APPLICABLE = "ACCREDITATION_NOT_APPLICABLE",
8
- NOT_ACCREDITED = "NOT_ACCREDITED",
9
- ACCREDITATION_PENDING = "ACCREDITATION_PENDING",
10
- IDENTITY_VERIFICATION_COMPLETED = "IDENTITY_VERIFICATION_COMPLETED",
11
- IDENTITY_VERIFICATION_FAILED = "IDENTITY_VERIFICATION_FAILED",
12
- IDENTITY_VERIFICATION_PENDING = "IDENTITY_VERIFICATION_PENDING",
13
- IDENTITY_VERIFICATION_UPDATES_REQUIRED = "IDENTITY_VERIFICATION_UPDATES_REQUIRED",
14
- IDENTITY_VERIFICATION_NOT_STARTED = "IDENTITY_VERIFICATION_NOT_STARTED",
15
- USER_NOT_ONBOARDED = "USER_NOT_ONBOARDED"
16
- }
17
- /**
18
- * Object representing the response to the identity verification status request.
19
- * @typedef {Object} VerificationStatus
20
- * @property {string} walletAddress the wallet address to get the verification status.
21
- * @property {IdentityVerificationStatus} identityVerificationStatus The wallet's identity verification status.
22
- * @property {boolean} isVerified the wallet address has been verified or not.
23
- * @property {boolean} isNotOnboarded the wallet address has been not onboarded or not.
24
- */
25
- export type VerificationStatusResult = {
26
- walletAddress: string;
27
- verificationStatus: IdentityVerificationStatus;
28
- isVerified: boolean;
29
- isNotOnboarded: boolean;
30
- };
31
- /**
32
- * Object representing the response to the document signature status request.
33
- * @typedef {Object} DocSignatureStatus
34
- * @property {string} envelopeId the envelope id to get the document signature status.
35
- * @property {string} status the document signature status.
36
- */
37
- export type DocSignatureStatus = {
38
- envelopeId: string;
39
- status: 'completed' | 'created' | 'declined' | 'deleted' | 'delivered' | 'processing' | 'sent' | 'signed' | 'template' | 'voided';
40
- };
41
- export declare const IdentityService: {
42
- getVerificationStatus: (walletAddress: string, pool: string, chainId: number, isDev?: boolean) => Promise<VerificationStatusResult>;
43
- onboard: (walletAddress: string, code: string, pool: string, chainId: number, isDev?: boolean) => Promise<string>;
44
- getDocSignatureStatus: (envelopeId: string, chainId: number, isDev?: boolean) => Promise<DocSignatureStatus>;
45
- requestDocSignature: (walletAddress: string, chainId: number, isDev?: boolean) => Promise<{
46
- envelopeId: string;
47
- }>;
48
- resendDocSignatureLink: (envelopeId: string, chainId: number, isDev?: boolean) => Promise<{
49
- envelopeId: string;
50
- }>;
51
- };
52
- export {};
1
+ /**
2
+ * Enum representing the identity status.
3
+ * @typedef {Enum} IdentityStatus
4
+ */
5
+ declare enum IdentityVerificationStatus {
6
+ ACCREDITED = "ACCREDITED",
7
+ ACCREDITATION_NOT_APPLICABLE = "ACCREDITATION_NOT_APPLICABLE",
8
+ NOT_ACCREDITED = "NOT_ACCREDITED",
9
+ ACCREDITATION_PENDING = "ACCREDITATION_PENDING",
10
+ IDENTITY_VERIFICATION_COMPLETED = "IDENTITY_VERIFICATION_COMPLETED",
11
+ IDENTITY_VERIFICATION_FAILED = "IDENTITY_VERIFICATION_FAILED",
12
+ IDENTITY_VERIFICATION_PENDING = "IDENTITY_VERIFICATION_PENDING",
13
+ IDENTITY_VERIFICATION_UPDATES_REQUIRED = "IDENTITY_VERIFICATION_UPDATES_REQUIRED",
14
+ IDENTITY_VERIFICATION_NOT_STARTED = "IDENTITY_VERIFICATION_NOT_STARTED",
15
+ USER_NOT_ONBOARDED = "USER_NOT_ONBOARDED"
16
+ }
17
+ /**
18
+ * Object representing the response to the identity verification status request.
19
+ * @typedef {Object} VerificationStatus
20
+ * @property {string} walletAddress the wallet address to get the verification status.
21
+ * @property {IdentityVerificationStatus} identityVerificationStatus The wallet's identity verification status.
22
+ * @property {boolean} isVerified the wallet address has been verified or not.
23
+ * @property {boolean} isNotOnboarded the wallet address has been not onboarded or not.
24
+ */
25
+ export type VerificationStatusResult = {
26
+ walletAddress: string;
27
+ verificationStatus: IdentityVerificationStatus;
28
+ isVerified: boolean;
29
+ isNotOnboarded: boolean;
30
+ };
31
+ /**
32
+ * Object representing the response to the document signature status request.
33
+ * @typedef {Object} DocSignatureStatus
34
+ * @property {string} envelopeId the envelope id to get the document signature status.
35
+ * @property {string} status the document signature status.
36
+ */
37
+ export type DocSignatureStatus = {
38
+ envelopeId: string;
39
+ status: 'completed' | 'created' | 'declined' | 'deleted' | 'delivered' | 'processing' | 'sent' | 'signed' | 'template' | 'voided';
40
+ };
41
+ export declare const IdentityService: {
42
+ getVerificationStatus: (walletAddress: string, pool: string, chainId: number, isDev?: boolean) => Promise<VerificationStatusResult>;
43
+ onboard: (walletAddress: string, code: string, pool: string, chainId: number, isDev?: boolean) => Promise<string>;
44
+ getDocSignatureStatus: (envelopeId: string, chainId: number, isDev?: boolean) => Promise<DocSignatureStatus>;
45
+ requestDocSignature: (walletAddress: string, chainId: number, isDev?: boolean) => Promise<{
46
+ envelopeId: string;
47
+ }>;
48
+ resendDocSignatureLink: (envelopeId: string, chainId: number, isDev?: boolean) => Promise<{
49
+ envelopeId: string;
50
+ }>;
51
+ };
52
+ export {};
@@ -1,81 +1,81 @@
1
- import { configUtil } from '../utils/config';
2
- import { requestGet, requestPost, requestPut } from '../utils/request';
3
- /**
4
- * Enum representing the identity status.
5
- * @typedef {Enum} IdentityStatus
6
- */
7
- var IdentityVerificationStatus;
8
- (function (IdentityVerificationStatus) {
9
- IdentityVerificationStatus["ACCREDITED"] = "ACCREDITED";
10
- IdentityVerificationStatus["ACCREDITATION_NOT_APPLICABLE"] = "ACCREDITATION_NOT_APPLICABLE";
11
- IdentityVerificationStatus["NOT_ACCREDITED"] = "NOT_ACCREDITED";
12
- IdentityVerificationStatus["ACCREDITATION_PENDING"] = "ACCREDITATION_PENDING";
13
- IdentityVerificationStatus["IDENTITY_VERIFICATION_COMPLETED"] = "IDENTITY_VERIFICATION_COMPLETED";
14
- IdentityVerificationStatus["IDENTITY_VERIFICATION_FAILED"] = "IDENTITY_VERIFICATION_FAILED";
15
- IdentityVerificationStatus["IDENTITY_VERIFICATION_PENDING"] = "IDENTITY_VERIFICATION_PENDING";
16
- IdentityVerificationStatus["IDENTITY_VERIFICATION_UPDATES_REQUIRED"] = "IDENTITY_VERIFICATION_UPDATES_REQUIRED";
17
- IdentityVerificationStatus["IDENTITY_VERIFICATION_NOT_STARTED"] = "IDENTITY_VERIFICATION_NOT_STARTED";
18
- IdentityVerificationStatus["USER_NOT_ONBOARDED"] = "USER_NOT_ONBOARDED";
19
- })(IdentityVerificationStatus || (IdentityVerificationStatus = {}));
20
- /**
21
- * Get wallet's identity verification status.
22
- *
23
- * @param {string} walletAddress The wallet address.
24
- * @param {string} pool The pool address.
25
- * @param {number} chainId chain Id.
26
- * @param {boolean} isDev Is dev environment or not.
27
- * @returns {Promise<VerificationStatusResult>} Promise that returns the verification status result.
28
- */
29
- const getVerificationStatus = async (walletAddress, pool, chainId, isDev = false) => {
30
- const result = await requestPut(`${configUtil.getIdentityAPIUrl(chainId, isDev)}/wallets/${walletAddress}/verification-status?poolAddress=${pool}`);
31
- result.isVerified = [IdentityVerificationStatus.ACCREDITED].includes(result.verificationStatus);
32
- result.isNotOnboarded =
33
- result.verificationStatus === IdentityVerificationStatus.USER_NOT_ONBOARDED;
34
- return result;
35
- };
36
- /**
37
- * Onboard user
38
- *
39
- * @param {string} walletAddress The wallet address.
40
- * @param {string} code The investor code.
41
- * @param {string} pool Pool address.
42
- * @param {number} chainId chain Id.
43
- * @param {boolean} isDev Is dev environment or not.
44
- * @returns {Promise<string>} Promise that returns the onboard result
45
- */
46
- const onboard = async (walletAddress, code, pool, chainId, isDev = false) => requestPost(`${configUtil.getIdentityAPIUrl(chainId, isDev)}/wallets/${walletAddress}/onboard?code=${code}&poolAddress=${pool}`);
47
- /**
48
- * Get document signature status
49
- *
50
- * @param {string} envelopeId The envelope id.
51
- * @param {number} chainId chain Id.
52
- * @param {boolean} isDev Is dev environment or not.
53
- * @returns {Promise<{envelopeId: string}>} Promise that returns the envelope id
54
- */
55
- const getDocSignatureStatus = async (envelopeId, chainId, isDev = false) => requestGet(`${configUtil.getIdentityAPIUrl(chainId, isDev)}/${envelopeId}/document-signature-status`);
56
- /**
57
- * Request document signature
58
- *
59
- * @param {string} walletAddress The wallet address.
60
- * @param {number} chainId chain Id.
61
- * @param {boolean} isDev Is dev environment or not.
62
- * @returns {Promise<{envelopeId: string}>} Promise that returns the envelope id
63
- */
64
- const requestDocSignature = async (walletAddress, chainId, isDev = false) => requestPost(`${configUtil.getIdentityAPIUrl(chainId, isDev)}/request-document-signature`, { walletAddress });
65
- /**
66
- * Resend document signature link
67
- *
68
- * @param {string} envelopeId The envelope id.
69
- * @param {number} chainId chain Id.
70
- * @param {boolean} isDev Is dev environment or not.
71
- * @returns {Promise<{envelopeId: string}>} Promise that returns the envelope id
72
- */
73
- const resendDocSignatureLink = async (envelopeId, chainId, isDev = false) => requestPost(`${configUtil.getIdentityAPIUrl(chainId, isDev)}/resend-document-signature-link`, { envelopeId });
74
- export const IdentityService = {
75
- getVerificationStatus,
76
- onboard,
77
- getDocSignatureStatus,
78
- requestDocSignature,
79
- resendDocSignatureLink,
80
- };
1
+ import { configUtil } from '../utils/config';
2
+ import { requestGet, requestPost, requestPut } from '../utils/request';
3
+ /**
4
+ * Enum representing the identity status.
5
+ * @typedef {Enum} IdentityStatus
6
+ */
7
+ var IdentityVerificationStatus;
8
+ (function (IdentityVerificationStatus) {
9
+ IdentityVerificationStatus["ACCREDITED"] = "ACCREDITED";
10
+ IdentityVerificationStatus["ACCREDITATION_NOT_APPLICABLE"] = "ACCREDITATION_NOT_APPLICABLE";
11
+ IdentityVerificationStatus["NOT_ACCREDITED"] = "NOT_ACCREDITED";
12
+ IdentityVerificationStatus["ACCREDITATION_PENDING"] = "ACCREDITATION_PENDING";
13
+ IdentityVerificationStatus["IDENTITY_VERIFICATION_COMPLETED"] = "IDENTITY_VERIFICATION_COMPLETED";
14
+ IdentityVerificationStatus["IDENTITY_VERIFICATION_FAILED"] = "IDENTITY_VERIFICATION_FAILED";
15
+ IdentityVerificationStatus["IDENTITY_VERIFICATION_PENDING"] = "IDENTITY_VERIFICATION_PENDING";
16
+ IdentityVerificationStatus["IDENTITY_VERIFICATION_UPDATES_REQUIRED"] = "IDENTITY_VERIFICATION_UPDATES_REQUIRED";
17
+ IdentityVerificationStatus["IDENTITY_VERIFICATION_NOT_STARTED"] = "IDENTITY_VERIFICATION_NOT_STARTED";
18
+ IdentityVerificationStatus["USER_NOT_ONBOARDED"] = "USER_NOT_ONBOARDED";
19
+ })(IdentityVerificationStatus || (IdentityVerificationStatus = {}));
20
+ /**
21
+ * Get wallet's identity verification status.
22
+ *
23
+ * @param {string} walletAddress The wallet address.
24
+ * @param {string} pool The pool address.
25
+ * @param {number} chainId chain Id.
26
+ * @param {boolean} isDev Is dev environment or not.
27
+ * @returns {Promise<VerificationStatusResult>} Promise that returns the verification status result.
28
+ */
29
+ const getVerificationStatus = async (walletAddress, pool, chainId, isDev = false) => {
30
+ const result = await requestPut(`${configUtil.getIdentityAPIUrl(chainId, isDev)}/wallets/${walletAddress}/verification-status?poolAddress=${pool}`);
31
+ result.isVerified = [IdentityVerificationStatus.ACCREDITED].includes(result.verificationStatus);
32
+ result.isNotOnboarded =
33
+ result.verificationStatus === IdentityVerificationStatus.USER_NOT_ONBOARDED;
34
+ return result;
35
+ };
36
+ /**
37
+ * Onboard user
38
+ *
39
+ * @param {string} walletAddress The wallet address.
40
+ * @param {string} code The investor code.
41
+ * @param {string} pool Pool address.
42
+ * @param {number} chainId chain Id.
43
+ * @param {boolean} isDev Is dev environment or not.
44
+ * @returns {Promise<string>} Promise that returns the onboard result
45
+ */
46
+ const onboard = async (walletAddress, code, pool, chainId, isDev = false) => requestPost(`${configUtil.getIdentityAPIUrl(chainId, isDev)}/wallets/${walletAddress}/onboard?code=${code}&poolAddress=${pool}`);
47
+ /**
48
+ * Get document signature status
49
+ *
50
+ * @param {string} envelopeId The envelope id.
51
+ * @param {number} chainId chain Id.
52
+ * @param {boolean} isDev Is dev environment or not.
53
+ * @returns {Promise<{envelopeId: string}>} Promise that returns the envelope id
54
+ */
55
+ const getDocSignatureStatus = async (envelopeId, chainId, isDev = false) => requestGet(`${configUtil.getIdentityAPIUrl(chainId, isDev)}/${envelopeId}/document-signature-status`);
56
+ /**
57
+ * Request document signature
58
+ *
59
+ * @param {string} walletAddress The wallet address.
60
+ * @param {number} chainId chain Id.
61
+ * @param {boolean} isDev Is dev environment or not.
62
+ * @returns {Promise<{envelopeId: string}>} Promise that returns the envelope id
63
+ */
64
+ const requestDocSignature = async (walletAddress, chainId, isDev = false) => requestPost(`${configUtil.getIdentityAPIUrl(chainId, isDev)}/request-document-signature`, { walletAddress });
65
+ /**
66
+ * Resend document signature link
67
+ *
68
+ * @param {string} envelopeId The envelope id.
69
+ * @param {number} chainId chain Id.
70
+ * @param {boolean} isDev Is dev environment or not.
71
+ * @returns {Promise<{envelopeId: string}>} Promise that returns the envelope id
72
+ */
73
+ const resendDocSignatureLink = async (envelopeId, chainId, isDev = false) => requestPost(`${configUtil.getIdentityAPIUrl(chainId, isDev)}/resend-document-signature-link`, { envelopeId });
74
+ export const IdentityService = {
75
+ getVerificationStatus,
76
+ onboard,
77
+ getDocSignatureStatus,
78
+ requestDocSignature,
79
+ resendDocSignatureLink,
80
+ };
81
81
  //# sourceMappingURL=IdentityService.js.map
@@ -1,11 +1,11 @@
1
- import { configUtil } from '../utils/config';
2
- import { requestGet } from '../utils/request';
3
- const getRequestInfo = async (requestId, chainId) => {
4
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
5
- const data = await requestGet(`${configUtil.getRequestAPIUrl(chainId)}/request?id=${requestId}`);
6
- return data;
7
- };
8
- export const RNService = {
9
- getRequestInfo,
10
- };
1
+ import { configUtil } from '../utils/config';
2
+ import { requestGet } from '../utils/request';
3
+ const getRequestInfo = async (requestId, chainId) => {
4
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
5
+ const data = await requestGet(`${configUtil.getRequestAPIUrl(chainId)}/request?id=${requestId}`);
6
+ return data;
7
+ };
8
+ export const RNService = {
9
+ getRequestInfo,
10
+ };
11
11
  //# sourceMappingURL=RNService.js.map
@@ -1,4 +1,4 @@
1
- export * from './EAService';
2
- export * from './RNService';
3
- export * from './IdentityService';
1
+ export * from './EAService';
2
+ export * from './RNService';
3
+ export * from './IdentityService';
4
4
  //# sourceMappingURL=index.js.map