@huma-finance/shared 0.0.30 → 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 (259) hide show
  1. package/dist/abis/BaseCreditPool.json +1179 -1179
  2. package/dist/abis/BaseFeeManager.json +480 -480
  3. package/dist/abis/BasePoolConfig.json +1364 -1364
  4. package/dist/abis/ERC20TransferableReceivable.json +648 -648
  5. package/dist/abis/HDT.json +512 -512
  6. package/dist/abis/IConstantFlowAgreementV1.json +890 -890
  7. package/dist/abis/ISuperfluid.json +1122 -1122
  8. package/dist/abis/InvoiceNFT.json +625 -625
  9. package/dist/abis/Multisend.json +26 -26
  10. package/dist/abis/RealWorldReceivable.json +823 -823
  11. package/dist/abis/ReceivableFactoringPool.json +1529 -1529
  12. package/dist/abis/StreamFactoringPool.json +1523 -1523
  13. package/dist/abis/StreamFeeManager.json +522 -522
  14. package/dist/abis/SuperfluidPoolProcessor.json +692 -692
  15. package/dist/abis/TestERC20.json +358 -358
  16. package/dist/abis/TradableStream.json +850 -850
  17. package/dist/abis/Transfer.json +24 -24
  18. package/dist/abis/TransferNFT.json +27 -27
  19. package/dist/abis/erc20.json +117 -117
  20. package/dist/abis/erc2612.json +132 -132
  21. package/dist/abis/erc721.json +673 -673
  22. package/dist/abis/index.d.ts +3 -3
  23. package/dist/abis/index.js +3 -3
  24. package/dist/abis/types/BaseCreditPool.d.ts +803 -803
  25. package/dist/abis/types/BaseCreditPool.js +1 -1
  26. package/dist/abis/types/BaseFeeManager.d.ts +408 -408
  27. package/dist/abis/types/BaseFeeManager.js +1 -1
  28. package/dist/abis/types/BasePoolConfig.d.ts +1097 -1097
  29. package/dist/abis/types/BasePoolConfig.js +1 -1
  30. package/dist/abis/types/ERC20TransferableReceivable.d.ts +407 -407
  31. package/dist/abis/types/ERC20TransferableReceivable.js +1 -1
  32. package/dist/abis/types/Erc20.d.ts +168 -168
  33. package/dist/abis/types/Erc20.js +1 -1
  34. package/dist/abis/types/Erc2612.d.ts +192 -192
  35. package/dist/abis/types/Erc2612.js +1 -1
  36. package/dist/abis/types/Erc721.d.ts +474 -474
  37. package/dist/abis/types/Erc721.js +1 -1
  38. package/dist/abis/types/HDT.d.ts +369 -369
  39. package/dist/abis/types/HDT.js +1 -1
  40. package/dist/abis/types/IConstantFlowAgreementV1.d.ts +573 -573
  41. package/dist/abis/types/IConstantFlowAgreementV1.js +1 -1
  42. package/dist/abis/types/ISuperfluid.d.ts +728 -728
  43. package/dist/abis/types/ISuperfluid.js +1 -1
  44. package/dist/abis/types/InvoiceNFT.d.ts +425 -425
  45. package/dist/abis/types/InvoiceNFT.js +1 -1
  46. package/dist/abis/types/Multisend.d.ts +50 -50
  47. package/dist/abis/types/Multisend.js +1 -1
  48. package/dist/abis/types/RealWorldReceivable.d.ts +564 -564
  49. package/dist/abis/types/RealWorldReceivable.js +1 -1
  50. package/dist/abis/types/ReceivableFactoringPool.d.ts +999 -999
  51. package/dist/abis/types/ReceivableFactoringPool.js +1 -1
  52. package/dist/abis/types/StreamFactoringPool.d.ts +985 -985
  53. package/dist/abis/types/StreamFactoringPool.js +1 -1
  54. package/dist/abis/types/StreamFeeManager.d.ts +440 -440
  55. package/dist/abis/types/StreamFeeManager.js +1 -1
  56. package/dist/abis/types/SuperfluidPoolProcessor.d.ts +398 -398
  57. package/dist/abis/types/SuperfluidPoolProcessor.js +1 -1
  58. package/dist/abis/types/TestERC20.d.ts +270 -270
  59. package/dist/abis/types/TestERC20.js +1 -1
  60. package/dist/abis/types/TradableStream.d.ts +607 -607
  61. package/dist/abis/types/TradableStream.js +1 -1
  62. package/dist/abis/types/Transfer.d.ts +45 -45
  63. package/dist/abis/types/Transfer.js +1 -1
  64. package/dist/abis/types/TransferNFT.d.ts +45 -45
  65. package/dist/abis/types/TransferNFT.js +1 -1
  66. package/dist/abis/types/common.d.ts +22 -22
  67. package/dist/abis/types/common.js +1 -1
  68. package/dist/abis/types/factories/BaseCreditPool__factory.d.ts +931 -931
  69. package/dist/abis/types/factories/BaseCreditPool__factory.js +1193 -1192
  70. package/dist/abis/types/factories/BaseCreditPool__factory.js.map +1 -1
  71. package/dist/abis/types/factories/BaseFeeManager__factory.d.ts +379 -379
  72. package/dist/abis/types/factories/BaseFeeManager__factory.js +494 -493
  73. package/dist/abis/types/factories/BaseFeeManager__factory.js.map +1 -1
  74. package/dist/abis/types/factories/BasePoolConfig__factory.d.ts +1074 -1074
  75. package/dist/abis/types/factories/BasePoolConfig__factory.js +1378 -1377
  76. package/dist/abis/types/factories/BasePoolConfig__factory.js.map +1 -1
  77. package/dist/abis/types/factories/ERC20TransferableReceivable__factory.d.ts +508 -508
  78. package/dist/abis/types/factories/ERC20TransferableReceivable__factory.js +662 -661
  79. package/dist/abis/types/factories/ERC20TransferableReceivable__factory.js.map +1 -1
  80. package/dist/abis/types/factories/Erc20__factory.d.ts +175 -175
  81. package/dist/abis/types/factories/Erc20__factory.js +236 -235
  82. package/dist/abis/types/factories/Erc20__factory.js.map +1 -1
  83. package/dist/abis/types/factories/Erc2612__factory.d.ts +209 -209
  84. package/dist/abis/types/factories/Erc2612__factory.js +279 -278
  85. package/dist/abis/types/factories/Erc2612__factory.js.map +1 -1
  86. package/dist/abis/types/factories/Erc721__factory.d.ts +539 -539
  87. package/dist/abis/types/factories/Erc721__factory.js +687 -686
  88. package/dist/abis/types/factories/Erc721__factory.js.map +1 -1
  89. package/dist/abis/types/factories/HDT__factory.d.ts +399 -399
  90. package/dist/abis/types/factories/HDT__factory.js +526 -525
  91. package/dist/abis/types/factories/HDT__factory.js.map +1 -1
  92. package/dist/abis/types/factories/IConstantFlowAgreementV1__factory.d.ts +695 -695
  93. package/dist/abis/types/factories/IConstantFlowAgreementV1__factory.js +904 -903
  94. package/dist/abis/types/factories/IConstantFlowAgreementV1__factory.js.map +1 -1
  95. package/dist/abis/types/factories/ISuperfluid__factory.d.ts +866 -866
  96. package/dist/abis/types/factories/ISuperfluid__factory.js +1136 -1135
  97. package/dist/abis/types/factories/ISuperfluid__factory.js.map +1 -1
  98. package/dist/abis/types/factories/InvoiceNFT__factory.d.ts +489 -489
  99. package/dist/abis/types/factories/InvoiceNFT__factory.js +639 -638
  100. package/dist/abis/types/factories/InvoiceNFT__factory.js.map +1 -1
  101. package/dist/abis/types/factories/Multisend__factory.d.ts +26 -26
  102. package/dist/abis/types/factories/Multisend__factory.js +40 -39
  103. package/dist/abis/types/factories/Multisend__factory.js.map +1 -1
  104. package/dist/abis/types/factories/RealWorldReceivable__factory.d.ts +645 -645
  105. package/dist/abis/types/factories/RealWorldReceivable__factory.js +837 -836
  106. package/dist/abis/types/factories/RealWorldReceivable__factory.js.map +1 -1
  107. package/dist/abis/types/factories/ReceivableFactoringPool__factory.d.ts +1204 -1204
  108. package/dist/abis/types/factories/ReceivableFactoringPool__factory.js +1543 -1542
  109. package/dist/abis/types/factories/ReceivableFactoringPool__factory.js.map +1 -1
  110. package/dist/abis/types/factories/StreamFactoringPool__factory.d.ts +1200 -1200
  111. package/dist/abis/types/factories/StreamFactoringPool__factory.js +1537 -1536
  112. package/dist/abis/types/factories/StreamFactoringPool__factory.js.map +1 -1
  113. package/dist/abis/types/factories/StreamFeeManager__factory.d.ts +412 -412
  114. package/dist/abis/types/factories/StreamFeeManager__factory.js +536 -535
  115. package/dist/abis/types/factories/StreamFeeManager__factory.js.map +1 -1
  116. package/dist/abis/types/factories/SuperfluidPoolProcessor__factory.d.ts +546 -546
  117. package/dist/abis/types/factories/SuperfluidPoolProcessor__factory.js +706 -705
  118. package/dist/abis/types/factories/SuperfluidPoolProcessor__factory.js.map +1 -1
  119. package/dist/abis/types/factories/TestERC20__factory.d.ts +280 -280
  120. package/dist/abis/types/factories/TestERC20__factory.js +372 -371
  121. package/dist/abis/types/factories/TestERC20__factory.js.map +1 -1
  122. package/dist/abis/types/factories/TradableStream__factory.d.ts +663 -663
  123. package/dist/abis/types/factories/TradableStream__factory.js +864 -863
  124. package/dist/abis/types/factories/TradableStream__factory.js.map +1 -1
  125. package/dist/abis/types/factories/TransferNFT__factory.d.ts +28 -28
  126. package/dist/abis/types/factories/TransferNFT__factory.js +41 -40
  127. package/dist/abis/types/factories/TransferNFT__factory.js.map +1 -1
  128. package/dist/abis/types/factories/Transfer__factory.d.ts +25 -25
  129. package/dist/abis/types/factories/Transfer__factory.js +38 -37
  130. package/dist/abis/types/factories/Transfer__factory.js.map +1 -1
  131. package/dist/abis/types/factories/index.d.ts +21 -21
  132. package/dist/abis/types/factories/index.js +24 -24
  133. package/dist/abis/types/index.d.ts +43 -43
  134. package/dist/abis/types/index.js +22 -22
  135. package/dist/cjs/hooks/web3/index.js +2 -2
  136. package/dist/cjs/hooks/web3/index.js.map +1 -1
  137. package/dist/cjs/services/IdentityService.d.ts +17 -0
  138. package/dist/cjs/services/IdentityService.js +31 -4
  139. package/dist/cjs/services/IdentityService.js.map +1 -1
  140. package/dist/cjs/utils/chain.d.ts +3 -1
  141. package/dist/cjs/utils/chain.js +9 -1
  142. package/dist/cjs/utils/chain.js.map +1 -1
  143. package/dist/cjs/utils/config.d.ts +1 -0
  144. package/dist/cjs/utils/config.js +10 -1
  145. package/dist/cjs/utils/config.js.map +1 -1
  146. package/dist/cjs/utils/index.d.ts +2 -0
  147. package/dist/cjs/utils/index.js +2 -0
  148. package/dist/cjs/utils/index.js.map +1 -1
  149. package/dist/cjs/utils/notifi.d.ts +3 -0
  150. package/dist/cjs/utils/notifi.js +40 -0
  151. package/dist/cjs/utils/notifi.js.map +1 -0
  152. package/dist/cjs/utils/number.js +7 -1
  153. package/dist/cjs/utils/number.js.map +1 -1
  154. package/dist/cjs/utils/pool.d.ts +1 -0
  155. package/dist/cjs/utils/pool.js +9 -6
  156. package/dist/cjs/utils/pool.js.map +1 -1
  157. package/dist/cjs/utils/realWorldReceivable.d.ts +12 -0
  158. package/dist/cjs/utils/realWorldReceivable.js +3 -0
  159. package/dist/cjs/utils/realWorldReceivable.js.map +1 -0
  160. package/dist/hooks/index.d.ts +18 -18
  161. package/dist/hooks/index.js +18 -18
  162. package/dist/hooks/useActiveRoute.d.ts +8 -8
  163. package/dist/hooks/useActiveRoute.js +7 -7
  164. package/dist/hooks/useAsyncError.d.ts +14 -14
  165. package/dist/hooks/useAsyncError.js +22 -22
  166. package/dist/hooks/useCLPoolContract.d.ts +27 -27
  167. package/dist/hooks/useContract.d.ts +7 -7
  168. package/dist/hooks/useContractFunction.d.ts +18 -18
  169. package/dist/hooks/useContractFunction.js +54 -54
  170. package/dist/hooks/useERC2612Permit/ethPermit/index.d.ts +35 -35
  171. package/dist/hooks/useERC2612Permit/ethPermit/index.js +139 -139
  172. package/dist/hooks/useERC2612Permit/ethPermit/lib.d.ts +1 -1
  173. package/dist/hooks/useERC2612Permit/ethPermit/lib.js +21 -21
  174. package/dist/hooks/useERC2612Permit/ethPermit/rpc.d.ts +10 -10
  175. package/dist/hooks/useERC2612Permit/ethPermit/rpc.js +96 -96
  176. package/dist/hooks/useERC2612Permit/index.d.ts +6 -6
  177. package/dist/hooks/useERC2612Permit/index.js +31 -31
  178. package/dist/hooks/useFactoring.d.ts +19 -19
  179. package/dist/hooks/useForceRefresh.d.ts +1 -1
  180. package/dist/hooks/useForceRefresh.js +8 -8
  181. package/dist/hooks/useGetSizes.d.ts +12 -12
  182. package/dist/hooks/useGetSizes.js +19 -19
  183. package/dist/hooks/useInvoiceNFTContract.d.ts +11 -11
  184. package/dist/hooks/useMQ.d.ts +6 -6
  185. package/dist/hooks/useMQ.js +14 -14
  186. package/dist/hooks/useMount.d.ts +2 -2
  187. package/dist/hooks/useMount.js +8 -8
  188. package/dist/hooks/useParamsSearch.d.ts +2 -2
  189. package/dist/hooks/useParamsSearch.js +6 -6
  190. package/dist/hooks/usePool.d.ts +4 -4
  191. package/dist/hooks/usePoolContract.d.ts +73 -73
  192. package/dist/hooks/useRFPoolContract.d.ts +22 -22
  193. package/dist/hooks/useRefresh.d.ts +1 -1
  194. package/dist/hooks/useRefresh.js +47 -47
  195. package/dist/hooks/web3/index.d.ts +15 -15
  196. package/dist/hooks/web3/index.js +2 -2
  197. package/dist/hooks/web3/index.js.map +1 -1
  198. package/dist/hooks/web3/useConnectors.d.ts +17 -17
  199. package/dist/hooks/web3/useConnectors.js +24 -24
  200. package/dist/hooks/web3/useJsonRpcUrlsMap.d.ts +13 -13
  201. package/dist/index.d.ts +5 -5
  202. package/dist/services/EAService.d.ts +153 -153
  203. package/dist/services/IdentityService.d.ts +17 -0
  204. package/dist/services/IdentityService.js +32 -5
  205. package/dist/services/IdentityService.js.map +1 -1
  206. package/dist/services/RNService.d.ts +14 -14
  207. package/dist/services/index.d.ts +3 -3
  208. package/dist/tsconfig.cjs.tsbuildinfo +1 -1
  209. package/dist/utils/JsonRpcConnector.d.ts +11 -11
  210. package/dist/utils/JsonRpcConnector.js +38 -38
  211. package/dist/utils/WalletConnect.d.ts +10 -10
  212. package/dist/utils/WalletConnect.js +50 -49
  213. package/dist/utils/WalletConnect.js.map +1 -1
  214. package/dist/utils/chain.d.ts +3 -1
  215. package/dist/utils/chain.js +7 -0
  216. package/dist/utils/chain.js.map +1 -1
  217. package/dist/utils/common.d.ts +4 -4
  218. package/dist/utils/common.js +10 -10
  219. package/dist/utils/config.d.ts +1 -0
  220. package/dist/utils/config.js +10 -1
  221. package/dist/utils/config.js.map +1 -1
  222. package/dist/utils/const.d.ts +2 -2
  223. package/dist/utils/const.js +2 -2
  224. package/dist/utils/contractError.json +73 -73
  225. package/dist/utils/credit.d.ts +21 -21
  226. package/dist/utils/credit.js +35 -35
  227. package/dist/utils/errors.d.ts +26 -26
  228. package/dist/utils/errors.js +39 -39
  229. package/dist/utils/index.d.ts +2 -0
  230. package/dist/utils/index.js +2 -0
  231. package/dist/utils/index.js.map +1 -1
  232. package/dist/utils/jsonRpcEndpoints.d.ts +12 -12
  233. package/dist/utils/notifi.d.ts +3 -0
  234. package/dist/utils/notifi.js +35 -0
  235. package/dist/utils/notifi.js.map +1 -0
  236. package/dist/utils/number.d.ts +5 -5
  237. package/dist/utils/number.js +7 -1
  238. package/dist/utils/number.js.map +1 -1
  239. package/dist/utils/pool.d.ts +1 -0
  240. package/dist/utils/pool.js +9 -6
  241. package/dist/utils/pool.js.map +1 -1
  242. package/dist/utils/realWorldReceivable.d.ts +12 -0
  243. package/dist/utils/realWorldReceivable.js +2 -0
  244. package/dist/utils/realWorldReceivable.js.map +1 -0
  245. package/dist/utils/request.d.ts +3 -3
  246. package/dist/utils/request.js +38 -38
  247. package/dist/utils/scientificToDecimal.d.ts +1 -1
  248. package/dist/utils/scientificToDecimal.js +57 -57
  249. package/dist/utils/string.d.ts +1 -1
  250. package/dist/utils/string.js +1 -1
  251. package/dist/utils/style.d.ts +1 -1
  252. package/dist/utils/style.js +12 -12
  253. package/dist/utils/time.d.ts +26 -26
  254. package/dist/utils/time.js +50 -50
  255. package/dist/utils/transaction.d.ts +32 -32
  256. package/dist/utils/transaction.js +87 -87
  257. package/dist/utils/web3.d.ts +4 -4
  258. package/dist/utils/web3.js +34 -34
  259. package/package.json +3 -3
@@ -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 {};
@@ -28,8 +28,25 @@ export type VerificationStatusResult = {
28
28
  isVerified: boolean;
29
29
  isNotOnboarded: boolean;
30
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
+ };
31
41
  export declare const IdentityService: {
32
42
  getVerificationStatus: (walletAddress: string, pool: string, chainId: number, isDev?: boolean) => Promise<VerificationStatusResult>;
33
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
+ }>;
34
51
  };
35
52
  export {};
@@ -1,5 +1,5 @@
1
1
  import { configUtil } from '../utils/config';
2
- import { requestPost, requestPut } from '../utils/request';
2
+ import { requestGet, requestPost, requestPut } from '../utils/request';
3
3
  /**
4
4
  * Enum representing the identity status.
5
5
  * @typedef {Enum} IdentityStatus
@@ -43,12 +43,39 @@ const getVerificationStatus = async (walletAddress, pool, chainId, isDev = false
43
43
  * @param {boolean} isDev Is dev environment or not.
44
44
  * @returns {Promise<string>} Promise that returns the onboard result
45
45
  */
46
- const onboard = async (walletAddress, code, pool, chainId, isDev = false) => {
47
- const result = await requestPost(`${configUtil.getIdentityAPIUrl(chainId, isDev)}/wallets/${walletAddress}/onboard?code=${code}&poolAddress=${pool}`);
48
- return result;
49
- };
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 });
50
74
  export const IdentityService = {
51
75
  getVerificationStatus,
52
76
  onboard,
77
+ getDocSignatureStatus,
78
+ requestDocSignature,
79
+ resendDocSignatureLink,
53
80
  };
54
81
  //# sourceMappingURL=IdentityService.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"IdentityService.js","sourceRoot":"","sources":["../../src/services/IdentityService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC5C,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAE1D;;;GAGG;AACH,IAAK,0BAWJ;AAXD,WAAK,0BAA0B;IAC7B,uDAAyB,CAAA;IACzB,2FAA6D,CAAA;IAC7D,+DAAiC,CAAA;IACjC,6EAA+C,CAAA;IAC/C,iGAAmE,CAAA;IACnE,2FAA6D,CAAA;IAC7D,6FAA+D,CAAA;IAC/D,+GAAiF,CAAA;IACjF,qGAAuE,CAAA;IACvE,uEAAyC,CAAA;AAC3C,CAAC,EAXI,0BAA0B,KAA1B,0BAA0B,QAW9B;AAiBD;;;;;;;;GAQG;AACH,MAAM,qBAAqB,GAAG,KAAK,EACjC,aAAqB,EACrB,IAAY,EACZ,OAAe,EACf,KAAK,GAAG,KAAK,EACsB,EAAE;IACrC,MAAM,MAAM,GAAG,MAAM,UAAU,CAC7B,GAAG,UAAU,CAAC,iBAAiB,CAC7B,OAAO,EACP,KAAK,CACN,YAAY,aAA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K,EAClC,UAAkB,EAClB,OAAe,EACf,KAAK,GAAG,KAAK,EACoB,EAAE,CACnC,WAAW,CACT,GAAG,UAAU,CAAC,iBAAiB,CAC7B,OAAO,EACP,KAAK,CACN,iCAAiC,EAClC,EAAE,UAAU,EAAE,CACf,CAAA;AAEH,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,qBAAqB;IACrB,OAAO;IACP,qBAAqB;IACrB,mBAAmB;IACnB,sBAAsB;CACvB,CAAA"}
@@ -1,14 +1,14 @@
1
- export type RequestInfoType = {
2
- expectedAmount: string;
3
- payer: {
4
- type: string;
5
- value: string;
6
- };
7
- payee: {
8
- type: string;
9
- value: string;
10
- };
11
- };
12
- export declare const RNService: {
13
- getRequestInfo: (requestId: string, chainId: number) => Promise<any>;
14
- };
1
+ export type RequestInfoType = {
2
+ expectedAmount: string;
3
+ payer: {
4
+ type: string;
5
+ value: string;
6
+ };
7
+ payee: {
8
+ type: string;
9
+ value: string;
10
+ };
11
+ };
12
+ export declare const RNService: {
13
+ getRequestInfo: (requestId: string, chainId: number) => Promise<any>;
14
+ };
@@ -1,3 +1,3 @@
1
- export * from './EAService';
2
- export * from './RNService';
3
- export * from './IdentityService';
1
+ export * from './EAService';
2
+ export * from './RNService';
3
+ export * from './IdentityService';