@huma-finance/shared 0.0.8 → 0.0.11

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 (133) hide show
  1. package/dist/abis/BaseCreditPoolReceivable.json +764 -764
  2. package/dist/abis/RealWorldReceivable.json +823 -0
  3. package/dist/abis/index.d.ts +1 -1
  4. package/dist/abis/index.js +1 -1
  5. package/dist/abis/index.js.map +1 -1
  6. package/dist/abis/types/ERC20TransferableReceivable.d.ts +96 -96
  7. package/dist/abis/types/Erc2612.d.ts +41 -41
  8. package/dist/abis/types/IConstantFlowAgreementV1.d.ts +77 -77
  9. package/dist/abis/types/ISuperfluid.d.ts +140 -140
  10. package/dist/abis/types/Multisend.d.ts +8 -8
  11. package/dist/abis/types/RealWorldReceivable.d.ts +564 -0
  12. package/dist/abis/types/RealWorldReceivable.js +2 -0
  13. package/dist/abis/types/RealWorldReceivable.js.map +1 -0
  14. package/dist/abis/types/StreamFactoringPool.d.ts +189 -189
  15. package/dist/abis/types/TradableStream.d.ts +129 -129
  16. package/dist/abis/types/TransferNFT.d.ts +7 -7
  17. package/dist/abis/types/factories/ERC20TransferableReceivable__factory.d.ts +3 -3
  18. package/dist/abis/types/factories/ERC20TransferableReceivable__factory.js +316 -316
  19. package/dist/abis/types/factories/ERC20TransferableReceivable__factory.js.map +1 -1
  20. package/dist/abis/types/factories/Erc2612__factory.d.ts +3 -3
  21. package/dist/abis/types/factories/Erc2612__factory.js +108 -108
  22. package/dist/abis/types/factories/Erc2612__factory.js.map +1 -1
  23. package/dist/abis/types/factories/IConstantFlowAgreementV1__factory.d.ts +3 -3
  24. package/dist/abis/types/factories/IConstantFlowAgreementV1__factory.js +449 -449
  25. package/dist/abis/types/factories/IConstantFlowAgreementV1__factory.js.map +1 -1
  26. package/dist/abis/types/factories/ISuperfluid__factory.d.ts +3 -3
  27. package/dist/abis/types/factories/ISuperfluid__factory.js +540 -540
  28. package/dist/abis/types/factories/ISuperfluid__factory.js.map +1 -1
  29. package/dist/abis/types/factories/Multisend__factory.d.ts +3 -3
  30. package/dist/abis/types/factories/Multisend__factory.js +13 -13
  31. package/dist/abis/types/factories/Multisend__factory.js.map +1 -1
  32. package/dist/abis/types/factories/RealWorldReceivable__factory.d.ts +645 -0
  33. package/dist/abis/types/factories/RealWorldReceivable__factory.js +837 -0
  34. package/dist/abis/types/factories/RealWorldReceivable__factory.js.map +1 -0
  35. package/dist/abis/types/factories/StreamFactoringPool__factory.d.ts +3 -3
  36. package/dist/abis/types/factories/StreamFactoringPool__factory.js +719 -719
  37. package/dist/abis/types/factories/StreamFactoringPool__factory.js.map +1 -1
  38. package/dist/abis/types/factories/TradableStream__factory.d.ts +3 -3
  39. package/dist/abis/types/factories/TradableStream__factory.js +416 -416
  40. package/dist/abis/types/factories/TradableStream__factory.js.map +1 -1
  41. package/dist/abis/types/factories/TransferNFT__factory.d.ts +3 -3
  42. package/dist/abis/types/factories/TransferNFT__factory.js +12 -12
  43. package/dist/abis/types/factories/TransferNFT__factory.js.map +1 -1
  44. package/dist/abis/types/factories/index.d.ts +20 -20
  45. package/dist/abis/types/factories/index.js +20 -20
  46. package/dist/abis/types/factories/index.js.map +1 -1
  47. package/dist/abis/types/index.d.ts +41 -41
  48. package/dist/abis/types/index.js +21 -21
  49. package/dist/abis/types/index.js.map +1 -1
  50. package/dist/cjs/abis/RealWorldReceivable.json +823 -0
  51. package/dist/cjs/abis/index.d.ts +1 -1
  52. package/dist/cjs/abis/index.js +3 -3
  53. package/dist/cjs/abis/index.js.map +1 -1
  54. package/dist/cjs/abis/types/ERC20TransferableReceivable.d.ts +96 -96
  55. package/dist/cjs/abis/types/Erc2612.d.ts +41 -41
  56. package/dist/cjs/abis/types/IConstantFlowAgreementV1.d.ts +77 -77
  57. package/dist/cjs/abis/types/ISuperfluid.d.ts +140 -140
  58. package/dist/cjs/abis/types/Multisend.d.ts +8 -8
  59. package/dist/cjs/abis/types/RealWorldReceivable.d.ts +564 -0
  60. package/dist/cjs/abis/types/RealWorldReceivable.js +3 -0
  61. package/dist/cjs/abis/types/RealWorldReceivable.js.map +1 -0
  62. package/dist/cjs/abis/types/StreamFactoringPool.d.ts +189 -189
  63. package/dist/cjs/abis/types/TradableStream.d.ts +129 -129
  64. package/dist/cjs/abis/types/TransferNFT.d.ts +7 -7
  65. package/dist/cjs/abis/types/factories/ERC20TransferableReceivable__factory.d.ts +3 -3
  66. package/dist/cjs/abis/types/factories/ERC20TransferableReceivable__factory.js +315 -315
  67. package/dist/cjs/abis/types/factories/ERC20TransferableReceivable__factory.js.map +1 -1
  68. package/dist/cjs/abis/types/factories/Erc2612__factory.d.ts +3 -3
  69. package/dist/cjs/abis/types/factories/Erc2612__factory.js +107 -107
  70. package/dist/cjs/abis/types/factories/Erc2612__factory.js.map +1 -1
  71. package/dist/cjs/abis/types/factories/IConstantFlowAgreementV1__factory.d.ts +3 -3
  72. package/dist/cjs/abis/types/factories/IConstantFlowAgreementV1__factory.js +448 -448
  73. package/dist/cjs/abis/types/factories/IConstantFlowAgreementV1__factory.js.map +1 -1
  74. package/dist/cjs/abis/types/factories/ISuperfluid__factory.d.ts +3 -3
  75. package/dist/cjs/abis/types/factories/ISuperfluid__factory.js +539 -539
  76. package/dist/cjs/abis/types/factories/ISuperfluid__factory.js.map +1 -1
  77. package/dist/cjs/abis/types/factories/Multisend__factory.d.ts +3 -3
  78. package/dist/cjs/abis/types/factories/Multisend__factory.js +12 -12
  79. package/dist/cjs/abis/types/factories/Multisend__factory.js.map +1 -1
  80. package/dist/cjs/abis/types/factories/RealWorldReceivable__factory.d.ts +645 -0
  81. package/dist/cjs/abis/types/factories/RealWorldReceivable__factory.js +841 -0
  82. package/dist/cjs/abis/types/factories/RealWorldReceivable__factory.js.map +1 -0
  83. package/dist/cjs/abis/types/factories/StreamFactoringPool__factory.d.ts +3 -3
  84. package/dist/cjs/abis/types/factories/StreamFactoringPool__factory.js +718 -718
  85. package/dist/cjs/abis/types/factories/StreamFactoringPool__factory.js.map +1 -1
  86. package/dist/cjs/abis/types/factories/TradableStream__factory.d.ts +3 -3
  87. package/dist/cjs/abis/types/factories/TradableStream__factory.js +415 -415
  88. package/dist/cjs/abis/types/factories/TradableStream__factory.js.map +1 -1
  89. package/dist/cjs/abis/types/factories/TransferNFT__factory.d.ts +3 -3
  90. package/dist/cjs/abis/types/factories/TransferNFT__factory.js +11 -11
  91. package/dist/cjs/abis/types/factories/TransferNFT__factory.js.map +1 -1
  92. package/dist/cjs/abis/types/factories/index.d.ts +20 -20
  93. package/dist/cjs/abis/types/factories/index.js +3 -3
  94. package/dist/cjs/abis/types/factories/index.js.map +1 -1
  95. package/dist/cjs/abis/types/index.d.ts +41 -41
  96. package/dist/cjs/abis/types/index.js +3 -3
  97. package/dist/cjs/abis/types/index.js.map +1 -1
  98. package/dist/cjs/hooks/useGetSizes.d.ts +0 -1
  99. package/dist/cjs/hooks/useGetSizes.js +0 -2
  100. package/dist/cjs/hooks/useGetSizes.js.map +1 -1
  101. package/dist/cjs/hooks/useMQ.d.ts +0 -1
  102. package/dist/cjs/hooks/useMQ.js +0 -2
  103. package/dist/cjs/hooks/useMQ.js.map +1 -1
  104. package/dist/cjs/hooks/usePoolContract.d.ts +1 -0
  105. package/dist/cjs/hooks/usePoolContract.js +18 -1
  106. package/dist/cjs/hooks/usePoolContract.js.map +1 -1
  107. package/dist/cjs/services/EAService.d.ts +107 -26
  108. package/dist/cjs/services/EAService.js +6 -6
  109. package/dist/cjs/services/EAService.js.map +1 -1
  110. package/dist/cjs/utils/jsonRpcEndpoints.js +0 -2
  111. package/dist/cjs/utils/jsonRpcEndpoints.js.map +1 -1
  112. package/dist/cjs/utils/pool.d.ts +13 -3
  113. package/dist/cjs/utils/pool.js +75 -7
  114. package/dist/cjs/utils/pool.js.map +1 -1
  115. package/dist/hooks/useGetSizes.d.ts +0 -1
  116. package/dist/hooks/useGetSizes.js +0 -2
  117. package/dist/hooks/useGetSizes.js.map +1 -1
  118. package/dist/hooks/useMQ.d.ts +0 -1
  119. package/dist/hooks/useMQ.js +0 -2
  120. package/dist/hooks/useMQ.js.map +1 -1
  121. package/dist/hooks/usePoolContract.d.ts +1 -0
  122. package/dist/hooks/usePoolContract.js +16 -0
  123. package/dist/hooks/usePoolContract.js.map +1 -1
  124. package/dist/services/EAService.d.ts +107 -26
  125. package/dist/services/EAService.js +6 -6
  126. package/dist/services/EAService.js.map +1 -1
  127. package/dist/tsconfig.cjs.tsbuildinfo +1 -1
  128. package/dist/utils/jsonRpcEndpoints.js +0 -2
  129. package/dist/utils/jsonRpcEndpoints.js.map +1 -1
  130. package/dist/utils/pool.d.ts +13 -3
  131. package/dist/utils/pool.js +72 -6
  132. package/dist/utils/pool.js.map +1 -1
  133. package/package.json +2 -2
@@ -1,66 +1,147 @@
1
1
  /**
2
- * Object representing the information returned from a successful approve operation.
3
- * @typedef {Object} ApproveInfo
4
- * @property {number} aprInBps The annual percentage rate in basis points.
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
5
16
  * @property {number|string} creditLimit The credit limit for the borrower in the pool's base currency.
6
17
  * @property {number} intervalInDays The interval in days for credit line rebalancing.
7
- * @property {number|string} receivableAmount The expected payment amount of the receivable asset.
8
- * @property {string} receivableAsset The address of the receivable asset contract.
9
- * @property {number|string} receivableParam The identifying parameter for the receivable asset, often the token ID of an ERC721.
10
18
  * @property {number} remainingPeriods The number of remaining payback periods in the credit line.
11
- * @property {number} tokenDecimal The number of decimals for the base token of the pool.
12
- * @property {string} tokenName The name of the base token of the pool.
13
- * @property {string} tokenSymbol The symbol of the base token of the pool.
19
+ * @property {number} aprInBps The annual percentage rate in basis points.
14
20
  */
15
- export type ApproveInfo = {
16
- aprInBps: number;
17
- creditLimit: number | string;
21
+ type Terms = {
22
+ creditLimit: number;
18
23
  intervalInDays: number;
19
- receivableAmount: number | string;
20
- receivableAsset: string;
21
- receivableParam: number | string;
22
24
  remainingPeriods: number;
23
- tokenDecimal: number;
24
- tokenName: string;
25
- tokenSymbol: string;
25
+ aprInBps: number;
26
+ };
27
+ /**
28
+ * Object representing receivable information of the approval.
29
+ * @typedef {Object} Receivable
30
+ * @property {string} asset The address of the receivable asset contract.
31
+ * @property {number|string} param The identifying parameter for the receivable asset, often the token ID of an ERC721.
32
+ * @property {number|string} amount The expected payment amount of the receivable asset.
33
+ */
34
+ type Receivable = {
35
+ asset: string;
36
+ param: string;
37
+ amount: number;
38
+ };
39
+ /**
40
+ * Object representing EA approval.
41
+ * @typedef {Object} Approval
42
+ * @property {Token} token The token information for the approval.
43
+ * @property {Terms} terms The approved loan terms.
44
+ * @property {Receivable} receivable The receivable information.
45
+ */
46
+ export type Approval = {
47
+ token: Token;
48
+ terms: Terms;
49
+ receivable?: Receivable;
50
+ };
51
+ /**
52
+ * Object representing EA rejection.
53
+ * @typedef {Object} Rejection
54
+ * @property {string[]} reasons Rejection reasons.
55
+ */
56
+ export type Rejection = {
57
+ reasons: string[];
58
+ };
59
+ /**
60
+ * Object representing the response to the underwriting approval request.
61
+ * @typedef {Object} ApprovalResult
62
+ * @property {Approval | Rejection} result the EA decision, either an approval or rejection.
63
+ */
64
+ export type ApprovalResult = {
65
+ result: Approval | Rejection;
66
+ };
67
+ /**
68
+ * Object representing a credit line payload for underwriting approval.
69
+ * @typedef {Object} EAPayloadCredit
70
+ * @property {string} poolAddress The address of the pool for the underwriting.
71
+ * @property {string} [borrowerWalletAddress] The address of the borrower's wallet.
72
+ */
73
+ export type EAPayloadCredit = {
74
+ poolAddress: string;
75
+ borrowerWalletAddress: string;
76
+ };
77
+ /**
78
+ * Object representing the receivable in an underwriting request.
79
+ * @typedef {Object} ReceivableRequest
80
+ * @property {string} [address] The address of the receivable asset contract.
81
+ * @property {string} [param] The parameter for the receivable asset.
82
+ */
83
+ type ReceivableRequest = {
84
+ address: string;
85
+ param: string;
86
+ };
87
+ /**
88
+ * Object representing the additional data required for a receivable-based underwriting request.
89
+ * @typedef {Object} EARequestContextReceivable
90
+ * @property {ReceivableRequest} [receivable] The receivable information.
91
+ */
92
+ type EARequestContextReceivable = {
93
+ receivable: ReceivableRequest;
26
94
  };
27
95
  /**
28
96
  * Object representing an invoice payload for underwriting approval.
29
97
  * @typedef {Object} EAPayloadInvoice
30
- * @property {string} poolAddress The address of the pool for the underwrite.
98
+ * @property {string} poolAddress The address of the pool for the underwriting.
31
99
  * @property {string} [borrowerWalletAddress] The address of the borrower's wallet.
32
100
  * @property {string} [receivableAddress] The address of the receivable asset contract.
33
- * @property {string|number} [receivableParam] The parameter for the receivable asset.
101
+ * @property {string} [receivableParam] The parameter for the receivable asset.
102
+ * @property {EARequestContextReceivable} [context] The additional data required for the request.
34
103
  */
35
104
  export type EAPayloadInvoice = {
36
105
  poolAddress: string;
37
- borrowerWalletAddress?: string;
106
+ borrowerWalletAddress: string;
38
107
  receivableAddress?: string;
39
108
  receivableParam?: string;
109
+ context: EARequestContextReceivable;
110
+ };
111
+ /**
112
+ * Object representing the additional data required for a stream factoring underwriting request.
113
+ * @typedef {Object} EAContextStream
114
+ * @property {string} payerAddress The address of the payer.
115
+ * @property {string} superToken The address of the SuperToken contract.
116
+ */
117
+ type EAContextStream = {
118
+ payerAddress: string;
119
+ superToken: string;
40
120
  };
41
121
  /**
42
122
  * Object representing a stream payload for underwriting approval.
43
123
  * @typedef {Object} EAPayloadStream
44
124
  * @property {string} creditLimit The credit limit for the borrower in the pool's base currency.
45
- * @property {string} poolAddress The address of the pool for the underwrite.
125
+ * @property {string} poolAddress The address of the pool for the underwriting.
46
126
  * @property {string} borrowerWalletAddress The address of the borrower's wallet.
47
127
  * @property {string} payerAddress The address of the payer.
48
128
  * @property {string} superToken The address of the SuperToken contract.
129
+ * @property {EAContextStream} context The additional data required for a stream factoring underwriting request.
49
130
  */
50
131
  type EAPayloadStream = {
51
- creditLimit: string;
52
132
  poolAddress: string;
53
133
  borrowerWalletAddress: string;
54
134
  payerAddress: string;
55
135
  superToken: string;
136
+ context: EAContextStream;
56
137
  };
57
- export type EAPayload = EAPayloadInvoice | EAPayloadStream;
138
+ export type EAPayload = EAPayloadCredit | EAPayloadInvoice | EAPayloadStream;
58
139
  export declare const EAService: {
59
- approve: (payload: EAPayload, chainId: number, isDev?: boolean) => Promise<ApproveInfo>;
140
+ approve: (payload: EAPayload, chainId: number, isDev?: boolean) => Promise<Approval>;
60
141
  approveLender: (payload: {
61
142
  poolAddress: string;
62
143
  lenderWalletAddress: string;
63
- }, chainId: number) => Promise<ApproveInfo>;
144
+ }, chainId: number) => Promise<ApprovalResult>;
64
145
  addToAllowList: (walletAddress: string, poolAddress: string, userName?: string) => Promise<void>;
65
146
  };
66
147
  export {};
@@ -1,22 +1,22 @@
1
1
  import { configUtil } from '../utils/config';
2
2
  import { EARejectionError } from '../utils/errors';
3
3
  import { requestPost } from '../utils/request';
4
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
5
+ const isRejection = (obj) => obj !== null && typeof obj === 'object' && Array.isArray(obj.reasons);
4
6
  /**
5
7
  * Submits a credit underwriting request to Huma's EAVerse.
6
8
  * @param {EAPayload} payload The payload for the underwrite approval.
7
9
  * @param {number} chainId The chain ID.
8
10
  * @param {boolean} isDev Is dev environment or not.
9
- * @returns {Promise<ApproveInfo>} Promise that returns approval info on success.
11
+ * @returns {Promise<Approval>} Promise that returns the approval on success.
10
12
  * @throws {EARejectionError} If the underwrite approval is rejected.
11
13
  */
12
14
  const approve = async (payload, chainId, isDev = false) => {
13
- var _a;
14
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
15
- const data = await requestPost(`${configUtil.getEAVerseUrl(chainId, isDev)}/underwriter/underwrite`, payload);
16
- if ((_a = data.rejectionReasons) === null || _a === void 0 ? void 0 : _a.length) {
15
+ const approvalResult = await requestPost(`${configUtil.getEAVerseUrl(chainId, isDev)}/underwriter/underwrite`, payload);
16
+ if (isRejection(approvalResult.result)) {
17
17
  throw new EARejectionError();
18
18
  }
19
- return data;
19
+ return approvalResult.result;
20
20
  };
21
21
  const approveLender = async (payload, chainId) => {
22
22
  var _a, _b;
@@ -1 +1 @@
1
- {"version":3,"file":"EAService.js","sourceRoot":"","sources":["../../src/services/EAService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AA+D9C;;;;;;;GAOG;AACH,MAAM,OAAO,GAAG,KAAK,EAAE,OAAkB,EAAE,OAAe,EAAE,KAAK,GAAG,KAAK,EAAE,EAAE;;IAC3E,8DAA8D;IAC9D,MAAM,IAAI,GAAQ,MAAM,WAAW,CACjC,GAAG,UAAU,CAAC,aAAa,CAAC,OAAO,EAAE,KAAK,CAAC,yBAAyB,EACpE,OAAO,CACR,CAAA;IACD,IAAI,MAAA,IAAI,CAAC,gBAAgB,0CAAE,MAAM,EAAE;QACjC,MAAM,IAAI,gBAAgB,EAAE,CAAA;KAC7B;IAED,OAAO,IAAmB,CAAA;AAC5B,CAAC,CAAA;AAED,MAAM,aAAa,GAAG,KAAK,EACzB,OAGC,EACD,OAAe,EACf,EAAE;;IACF,MAAM,mBAAmB,GACvB,8DAA8D,CAAA;IAChE,IAAI;QACF,8DAA8D;QAC9D,MAAM,IAAI,GAAQ,MAAM,WAAW,CACjC,GAAG,UAAU,CAAC,cAAc,CAAC,OAAO,CAAC,oBAAoB,EACzD,OAAO,CACR,CAAA;QACD,IAAI,IAAI,CAAC,UAAU,IAAI,GAAG,EAAE;YAC1B,MAAM,IAAI,KAAK,CACb,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC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