@huma-finance/widgets 0.0.48-beta.202 → 0.0.48-v2.278

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 (91) hide show
  1. package/API.md +407 -0
  2. package/dist/cjs/index.cjs +6063 -3827
  3. package/dist/cjs/index.cjs.map +1 -1
  4. package/dist/index.d.ts +471 -224
  5. package/dist/index.js +6056 -3829
  6. package/dist/index.js.map +1 -1
  7. package/package.json +5 -4
  8. package/src/components/ApproveAllowanceModal.tsx +3 -8
  9. package/src/components/ApproveAllowanceModalV2.tsx +141 -0
  10. package/src/components/CreditLine/approve/index.tsx +9 -3
  11. package/src/components/CreditLine/autoPaybackV2/1-ApproveAllowance.tsx +33 -0
  12. package/src/components/CreditLine/autoPaybackV2/2-Success.tsx +13 -0
  13. package/src/components/CreditLine/autoPaybackV2/index.tsx +87 -0
  14. package/src/components/CreditLine/borrow/2-ChooseAmount.tsx +12 -3
  15. package/src/components/CreditLine/borrow/index.tsx +4 -2
  16. package/src/components/CreditLine/borrowV2/1-ChooseAmount.tsx +79 -0
  17. package/src/components/CreditLine/borrowV2/2-ApproveAllowance.tsx +33 -0
  18. package/src/components/CreditLine/borrowV2/3-Transfer.tsx +50 -0
  19. package/src/components/CreditLine/borrowV2/4-Success.tsx +41 -0
  20. package/src/components/CreditLine/borrowV2/5-Notifications.tsx +10 -0
  21. package/src/components/CreditLine/borrowV2/index.tsx +140 -0
  22. package/src/components/CreditLine/payment/1-ChooseAmount.tsx +7 -2
  23. package/src/components/CreditLine/payment/index.tsx +4 -2
  24. package/src/components/CreditLine/paymentV2/1-ChooseAmount.tsx +86 -0
  25. package/src/components/CreditLine/paymentV2/2-ApproveAllowance.tsx +33 -0
  26. package/src/components/CreditLine/paymentV2/3-Transfer.tsx +55 -0
  27. package/src/components/CreditLine/paymentV2/4-Success.tsx +42 -0
  28. package/src/components/CreditLine/paymentV2/index.tsx +111 -0
  29. package/src/components/CreditLine/supplyFLC/1-ApproveAllowance.tsx +40 -0
  30. package/src/components/CreditLine/supplyFLC/2-Transfer.tsx +53 -0
  31. package/src/components/CreditLine/supplyFLC/3-Success.tsx +26 -0
  32. package/src/components/CreditLine/supplyFLC/index.tsx +121 -0
  33. package/src/components/Factoring/FactoredList.tsx +2 -1
  34. package/src/components/InvoiceFactoring/borrow/2-ChooseAmount.tsx +8 -1
  35. package/src/components/InvoiceFactoring/borrow/4-ApproveNFT.tsx +6 -2
  36. package/src/components/InvoiceFactoring/borrow/index.tsx +9 -3
  37. package/src/components/InvoiceFactoring/payment/1-ChooseAmount.tsx +7 -2
  38. package/src/components/InvoiceFactoring/payment/index.tsx +9 -3
  39. package/src/components/Lend/redeemV2/1-ChooseAction.tsx +236 -0
  40. package/src/components/Lend/redeemV2/2-ChooseAmount.tsx +162 -0
  41. package/src/components/Lend/redeemV2/3-Transfer.tsx +61 -0
  42. package/src/components/Lend/redeemV2/4-Done.tsx +33 -0
  43. package/src/components/Lend/redeemV2/index.tsx +207 -0
  44. package/src/components/Lend/supply/1-Evaluation/EvaluationKYC.tsx +19 -2
  45. package/src/components/Lend/supply/index.tsx +17 -3
  46. package/src/components/Lend/supplyV2/1-ChooseTranche.tsx +155 -0
  47. package/src/components/Lend/supplyV2/2-Evaluation.tsx +345 -0
  48. package/src/components/Lend/supplyV2/3-ChooseAmount.tsx +122 -0
  49. package/src/components/Lend/supplyV2/4-ApproveAllowance.tsx +33 -0
  50. package/src/components/Lend/supplyV2/5-Transfer.tsx +59 -0
  51. package/src/components/Lend/supplyV2/6-Success.tsx +79 -0
  52. package/src/components/Lend/supplyV2/7-Notifications.tsx +10 -0
  53. package/src/components/Lend/supplyV2/index.tsx +127 -0
  54. package/src/components/Lend/withdraw/1-CheckWithdrawble.tsx +5 -1
  55. package/src/components/Lend/withdraw/2-ChooseAmount.tsx +1 -7
  56. package/src/components/Lend/withdraw/index.tsx +8 -13
  57. package/src/components/Lend/withdrawV2/1-ChooseTranche.tsx +201 -0
  58. package/src/components/Lend/withdrawV2/2-Transfer.tsx +48 -0
  59. package/src/components/Lend/withdrawV2/3-Done.tsx +31 -0
  60. package/src/components/Lend/withdrawV2/index.tsx +129 -0
  61. package/src/components/Notifi/NotifiSubscriptionModal.tsx +29 -37
  62. package/src/components/NumericFormatCustom.tsx +31 -0
  63. package/src/components/ReceivableBackedCreditLine/borrow/1-ChooseAmount.tsx +101 -0
  64. package/src/components/ReceivableBackedCreditLine/borrow/2-ApproveAllowance.tsx +33 -0
  65. package/src/components/ReceivableBackedCreditLine/borrow/3-ApproveReceivable.tsx +64 -0
  66. package/src/components/ReceivableBackedCreditLine/borrow/4-Transfer.tsx +61 -0
  67. package/src/components/ReceivableBackedCreditLine/borrow/5-Success.tsx +41 -0
  68. package/src/components/ReceivableBackedCreditLine/borrow/6-Notifications.tsx +10 -0
  69. package/src/components/ReceivableBackedCreditLine/borrow/index.tsx +148 -0
  70. package/src/components/ReceivableBackedCreditLine/payment/1-ChoosePaymentType.tsx +115 -0
  71. package/src/components/ReceivableBackedCreditLine/payment/2-ChooseAmount.tsx +84 -0
  72. package/src/components/ReceivableBackedCreditLine/payment/3-ApproveAllowance.tsx +41 -0
  73. package/src/components/ReceivableBackedCreditLine/payment/4-CreateReceivable.tsx +107 -0
  74. package/src/components/ReceivableBackedCreditLine/payment/5-ApproveReceivable.tsx +64 -0
  75. package/src/components/ReceivableBackedCreditLine/payment/6-Transfer.tsx +107 -0
  76. package/src/components/ReceivableBackedCreditLine/payment/7-Success.tsx +49 -0
  77. package/src/components/ReceivableBackedCreditLine/payment/index.tsx +159 -0
  78. package/src/components/StreamFactoring/borrow/1-Evaluation.tsx +3 -4
  79. package/src/components/StreamFactoring/borrow/2-ChooseAmount.tsx +23 -22
  80. package/src/components/StreamFactoring/borrow/3-ConfirmTransfer.tsx +8 -3
  81. package/src/components/StreamFactoring/borrow/5-Permit.tsx +35 -2
  82. package/src/components/StreamFactoring/borrow/6-Transfer.tsx +3 -1
  83. package/src/components/StreamFactoring/borrow/index.tsx +4 -3
  84. package/src/components/SuperfluidFactoring/SuperfluidFactoredList.tsx +2 -2
  85. package/src/components/SuperfluidFactoring/SuperfluidUpcomingList.tsx +1 -3
  86. package/src/components/TxDoneModal.tsx +1 -1
  87. package/src/components/TxSendModal.tsx +8 -2
  88. package/src/components/TxSendModalV2.tsx +51 -0
  89. package/src/index.tsx +239 -1
  90. package/src/store/widgets.reducers.ts +15 -0
  91. package/src/store/widgets.store.ts +6 -0
package/dist/index.d.ts CHANGED
@@ -4,243 +4,490 @@ import { Provider } from '@web3-react/types';
4
4
  import { POOL_NAME, POOL_TYPE } from '@huma-finance/shared';
5
5
  import { BigNumberish, BigNumber } from 'ethers';
6
6
 
7
- /**
8
- * Credit line pool approve allowance props
9
- * @typedef {Object} CreditLineApproveProps
10
- * @property {POOL_NAME} poolName The name of the pool.
11
- * @property {POOL_TYPE} poolType The type of the pool.
12
- * @property {BigNumberish|undefined} amount The amount to approve.
13
- * @property {function():void} handleClose Function to notify to close the widget modal when user clicks the 'x' close button.
14
- * @property {function((number|undefined)):void|undefined} handleSuccess Optional function to notify that the credit line pool approve allowance action is successful.
15
- */
16
- type CreditLineApproveProps = {
17
- poolName: keyof typeof POOL_NAME;
18
- poolType: keyof typeof POOL_TYPE;
19
- amount?: BigNumberish;
20
- handleClose: () => void;
21
- handleSuccess?: (blockNumber?: number) => void;
7
+ /**
8
+ * Credit line pool approve allowance props
9
+ * @typedef {Object} CreditLineApproveProps
10
+ * @property {POOL_NAME} poolName The name of the pool.
11
+ * @property {POOL_TYPE} poolType The type of the pool.
12
+ * @property {BigNumberish|undefined} amount The amount to approve.
13
+ * @property {function():void} handleClose Function to notify to close the widget modal when user clicks the 'x' close button.
14
+ * @property {function((number|undefined)):void|undefined} handleSuccess Optional function to notify that the credit line pool approve allowance action is successful.
15
+ */
16
+ type CreditLineApproveProps = {
17
+ poolName: keyof typeof POOL_NAME;
18
+ poolType: keyof typeof POOL_TYPE;
19
+ amount?: BigNumberish;
20
+ handleClose: () => void;
21
+ handleSuccess?: (blockNumber?: number) => void;
22
22
  };
23
23
 
24
- /**
25
- * Credit line pool borrow props
26
- * @typedef {Object} CreditLineBorrowProps
27
- * @property {POOL_NAME} poolName The name of the pool.
28
- * @property {POOL_TYPE} poolType The type of the pool.
29
- * @property {function():void} handleClose Function to notify to close the widget modal when user clicks the 'x' close button.
30
- * @property {function():void|undefined} handleApprove Optional function to notify when user is approved successfully to borrow again pool.
31
- * @property {function((number|undefined)):void|undefined} handleSuccess Optional function to notify that the credit line pool borrow action is successful.
32
- */
33
- interface CreditLineBorrowProps {
34
- poolName: keyof typeof POOL_NAME;
35
- poolType: keyof typeof POOL_TYPE;
36
- handleClose: () => void;
37
- handleApprove?: () => void;
38
- handleSuccess?: (blockNumber?: number) => void;
24
+ /**
25
+ * Auto payback props V2
26
+ * @typedef {Object} AutoPaybackPropsV2
27
+ * @property {POOL_NAME} poolName The name of the pool.
28
+ * @property {function():void} handleClose Function to notify to close the widget modal when user clicks the 'x' close button.
29
+ * @property {function((number|undefined)):void|undefined} handleSuccess Optional function to notify that the credit line pool borrow action is successful.
30
+ */
31
+ interface AutoPaybackPropsV2 {
32
+ poolName: keyof typeof POOL_NAME;
33
+ handleClose: () => void;
34
+ handleSuccess?: (blockNumber?: number) => void;
39
35
  }
40
36
 
41
- /**
42
- * Credit line pool payment props
43
- * @typedef {Object} CreditLinePaymentProps
44
- * @property {POOL_NAME} poolName The name of the pool.
45
- * @property {POOL_TYPE} poolType The type of the pool.
46
- * @property {function():void} handleClose Function to notify to close the widget modal when user clicks the 'x' close button.
47
- * @property {function((number|undefined)):void|undefined} handleSuccess Optional function to notify that the credit line pool payment action is successful.
48
- */
49
- type CreditLinePaymentProps = {
50
- poolName: keyof typeof POOL_NAME;
51
- poolType: keyof typeof POOL_TYPE;
52
- handleClose: () => void;
53
- handleSuccess?: (blockNumber?: number) => void;
37
+ /**
38
+ * Credit line pool borrow props
39
+ * @typedef {Object} CreditLineBorrowProps
40
+ * @property {POOL_NAME} poolName The name of the pool.
41
+ * @property {POOL_TYPE} poolType The type of the pool.
42
+ * @property {function():void} handleClose Function to notify to close the widget modal when user clicks the 'x' close button.
43
+ * @property {function():void|undefined} handleApprove Optional function to notify when user is approved successfully to borrow again pool.
44
+ * @property {function((number|undefined)):void|undefined} handleSuccess Optional function to notify that the credit line pool borrow action is successful.
45
+ */
46
+ interface CreditLineBorrowProps {
47
+ poolName: keyof typeof POOL_NAME;
48
+ poolType: keyof typeof POOL_TYPE;
49
+ handleClose: () => void;
50
+ handleApprove?: () => void;
51
+ handleSuccess?: (blockNumber?: number) => void;
52
+ }
53
+
54
+ /**
55
+ * Credit line pool borrow props V2
56
+ * @typedef {Object} CreditLineBorrowPropsV2
57
+ * @property {POOL_NAME} poolName The name of the pool.
58
+ * @property {function():void} handleClose Function to notify to close the widget modal when user clicks the 'x' close button.
59
+ * @property {function((number|undefined)):void|undefined} handleSuccess Optional function to notify that the credit line pool borrow action is successful.
60
+ */
61
+ interface CreditLineBorrowPropsV2 {
62
+ poolName: keyof typeof POOL_NAME;
63
+ handleClose: () => void;
64
+ handleSuccess?: (blockNumber?: number) => void;
65
+ }
66
+
67
+ /**
68
+ * Credit line pool payment props
69
+ * @typedef {Object} CreditLinePaymentProps
70
+ * @property {POOL_NAME} poolName The name of the pool.
71
+ * @property {POOL_TYPE} poolType The type of the pool.
72
+ * @property {function():void} handleClose Function to notify to close the widget modal when user clicks the 'x' close button.
73
+ * @property {function((number|undefined)):void|undefined} handleSuccess Optional function to notify that the credit line pool payment action is successful.
74
+ */
75
+ type CreditLinePaymentProps = {
76
+ poolName: keyof typeof POOL_NAME;
77
+ poolType: keyof typeof POOL_TYPE;
78
+ handleClose: () => void;
79
+ handleSuccess?: (blockNumber?: number) => void;
54
80
  };
55
81
 
56
- /**
57
- * Invoice factoring pool borrow props
58
- * @typedef {Object} InvoiceFactoringBorrowProps
59
- * @property {POOL_NAME} poolName The name of the pool.
60
- * @property {POOL_TYPE} poolType The type of the pool.
61
- * @property {string|BigNumber} tokenId The NFT token id representing invoice.
62
- * @property {function():void} handleClose Function to notify to close the widget modal when user clicks the 'x' close button.
63
- * @property {function((number|undefined)):void|undefined} handleSuccess Optional function to notify that the invoice pool borrow action is successful.
64
- */
65
- interface InvoiceFactoringBorrowProps {
66
- poolName: keyof typeof POOL_NAME;
67
- poolType: keyof typeof POOL_TYPE;
68
- tokenId: string | BigNumber;
69
- handleClose: () => void;
70
- handleSuccess?: (blockNumber?: number) => void;
82
+ /**
83
+ * Credit line pool payment props V2
84
+ * @typedef {Object} CreditLinePaymentPropsV2
85
+ * @property {POOL_NAME} poolName The name of the pool.
86
+ * @property {function():void} handleClose Function to notify to close the widget modal when user clicks the 'x' close button.
87
+ * @property {function((number|undefined)):void|undefined} handleSuccess Optional function to notify that the credit line pool payment action is successful.
88
+ */
89
+ type CreditLinePaymentPropsV2 = {
90
+ poolName: keyof typeof POOL_NAME;
91
+ handleClose: () => void;
92
+ handleSuccess?: (blockNumber?: number) => void;
93
+ };
94
+
95
+ /**
96
+ * Supply first loss cover props
97
+ * @typedef {Object} SupplyFirstLossCoverProps
98
+ * @property {POOL_NAME} poolName The name of the pool.
99
+ * @property {function():void} handleClose Function to notify to close the widget modal when user clicks the 'x' close button.
100
+ * @property {function((number|undefined)):void|undefined} handleSuccess Optional function to notify that the credit line pool borrow action is successful.
101
+ */
102
+ interface SupplyFirstLossCoverProps {
103
+ poolName: keyof typeof POOL_NAME;
104
+ handleClose: () => void;
105
+ handleSuccess?: (blockNumber?: number) => void;
106
+ }
107
+
108
+ /**
109
+ * Invoice factoring pool borrow props
110
+ * @typedef {Object} InvoiceFactoringBorrowProps
111
+ * @property {POOL_NAME} poolName The name of the pool.
112
+ * @property {POOL_TYPE} poolType The type of the pool.
113
+ * @property {string|BigNumber} tokenId The NFT token id representing invoice.
114
+ * @property {function():void} handleClose Function to notify to close the widget modal when user clicks the 'x' close button.
115
+ * @property {function((number|undefined)):void|undefined} handleSuccess Optional function to notify that the invoice pool borrow action is successful.
116
+ */
117
+ interface InvoiceFactoringBorrowProps {
118
+ poolName: keyof typeof POOL_NAME;
119
+ poolType: keyof typeof POOL_TYPE;
120
+ tokenId: string | BigNumber;
121
+ handleClose: () => void;
122
+ handleSuccess?: (blockNumber?: number) => void;
71
123
  }
72
124
 
73
- /**
74
- * Invoice factoring pool payment props
75
- * @typedef {Object} InvoiceFactoringPaymentProps
76
- * @property {POOL_NAME} poolName The name of the pool.
77
- * @property {POOL_TYPE} poolType The type of the pool.
78
- * @property {function():void} handleClose Function to notify to close the widget modal when user clicks the 'x' close button.
79
- * @property {function((number|undefined)):void|undefined} handleSuccess Optional function to notify that the invoice pool payment action is successful.
80
- */
81
- type InvoiceFactoringPaymentProps = {
82
- poolName: keyof typeof POOL_NAME;
83
- poolType: keyof typeof POOL_TYPE;
84
- handleClose: () => void;
85
- handleSuccess?: (blockNumber?: number) => void;
125
+ /**
126
+ * Invoice factoring pool payment props
127
+ * @typedef {Object} InvoiceFactoringPaymentProps
128
+ * @property {POOL_NAME} poolName The name of the pool.
129
+ * @property {POOL_TYPE} poolType The type of the pool.
130
+ * @property {function():void} handleClose Function to notify to close the widget modal when user clicks the 'x' close button.
131
+ * @property {function((number|undefined)):void|undefined} handleSuccess Optional function to notify that the invoice pool payment action is successful.
132
+ */
133
+ type InvoiceFactoringPaymentProps = {
134
+ poolName: keyof typeof POOL_NAME;
135
+ poolType: keyof typeof POOL_TYPE;
136
+ handleClose: () => void;
137
+ handleSuccess?: (blockNumber?: number) => void;
86
138
  };
87
139
 
88
- /**
89
- * Lend pool supply props
90
- * @typedef {Object} LendSupplyProps
91
- * @property {POOL_NAME} poolName The name of the pool.
92
- * @property {POOL_TYPE} poolType The type of the pool.
93
- * @property {function():void} handleClose Function to notify to close the widget modal when user clicks the 'x' close button.
94
- * @property {function((number|undefined)):void|undefined} handleSuccess Optional function to notify that the lending pool supply action is successful.
95
- */
96
- interface LendSupplyProps {
97
- poolName: keyof typeof POOL_NAME;
98
- poolType: keyof typeof POOL_TYPE;
99
- handleClose: () => void;
100
- handleSuccess?: (blockNumber?: number) => void;
140
+ /**
141
+ * Lend pool withdraw props
142
+ * @typedef {Object} LendRedeemPropsV2
143
+ * @property {POOL_NAME} poolName The name of the pool.
144
+ * @property {function():void} handleClose Function to notify to close the widget modal when user clicks the 'x' close button.
145
+ * @property {function((number|undefined)):void|undefined} handleSuccess Optional function to notify that the lending pool withdraw action is successful.
146
+ */
147
+ type LendRedeemPropsV2 = {
148
+ poolName: keyof typeof POOL_NAME;
149
+ handleClose: () => void;
150
+ handleSuccess?: (blockNumber?: number) => void;
151
+ };
152
+
153
+ /**
154
+ * Lend pool supply props
155
+ * @typedef {Object} LendSupplyProps
156
+ * @property {POOL_NAME} poolName The name of the pool.
157
+ * @property {POOL_TYPE} poolType The type of the pool.
158
+ * @property {function():void} handleClose Function to notify to close the widget modal when user clicks the 'x' close button.
159
+ * @property {function((number|undefined)):void|undefined} handleSuccess Optional function to notify that the lending pool supply action is successful.
160
+ */
161
+ interface LendSupplyProps {
162
+ poolName: keyof typeof POOL_NAME;
163
+ poolType: keyof typeof POOL_TYPE;
164
+ handleClose: () => void;
165
+ handleSuccess?: (blockNumber?: number) => void;
166
+ }
167
+
168
+ /**
169
+ * Lend pool supply props
170
+ * @typedef {Object} LendSupplyPropsV2
171
+ * @property {POOL_NAME} poolName The name of the pool.
172
+ * @property {function():void} handleClose Function to notify to close the widget modal when user clicks the 'x' close button.
173
+ * @property {function((number|undefined)):void|undefined} handleSuccess Optional function to notify that the lending pool supply action is successful.
174
+ */
175
+ interface LendSupplyPropsV2 {
176
+ poolName: keyof typeof POOL_NAME;
177
+ handleClose: () => void;
178
+ handleSuccess?: (blockNumber?: number) => void;
101
179
  }
102
180
 
103
- /**
104
- * Lend pool withdraw props
105
- * @typedef {Object} LendWithdrawProps
106
- * @property {POOL_NAME} poolName The name of the pool.
107
- * @property {POOL_TYPE} poolType The type of the pool.
108
- * @property {function():void} handleClose Function to notify to close the widget modal when user clicks the 'x' close button.
109
- * @property {function((number|undefined)):void|undefined} handleSuccess Optional function to notify that the lending pool withdraw action is successful.
110
- */
111
- type LendWithdrawProps = {
112
- poolName: keyof typeof POOL_NAME;
113
- poolType: keyof typeof POOL_TYPE;
114
- handleClose: () => void;
115
- handleSuccess?: (blockNumber?: number) => void;
181
+ /**
182
+ * Lend pool withdraw props
183
+ * @typedef {Object} LendWithdrawProps
184
+ * @property {POOL_NAME} poolName The name of the pool.
185
+ * @property {POOL_TYPE} poolType The type of the pool.
186
+ * @property {function():void} handleClose Function to notify to close the widget modal when user clicks the 'x' close button.
187
+ * @property {function((number|undefined)):void|undefined} handleSuccess Optional function to notify that the lending pool withdraw action is successful.
188
+ */
189
+ type LendWithdrawProps = {
190
+ poolName: keyof typeof POOL_NAME;
191
+ poolType: keyof typeof POOL_TYPE;
192
+ handleClose: () => void;
193
+ handleSuccess?: (blockNumber?: number) => void;
116
194
  };
117
195
 
118
- /**
119
- * Mapping of your JSON-RPC connections indexed by chainId
120
- * @typedef {Object} JsonRpcConnectionMap
121
- * @property {Object.<number, string|Array<string>|JsonRpcProvider|Array<JsonRpcProvider>>} chainId Chain id to map the JSON-RPC URL/URLs or JsonRpcProvider/JsonRpcProviders
122
- */
123
- type JsonRpcConnectionMap = {
124
- [chainId: number]: string | string[] | JsonRpcProvider | JsonRpcProvider[];
196
+ /**
197
+ * Lend pool withdraw props
198
+ * @typedef {Object} LendWithdrawPropsV2
199
+ * @property {POOL_NAME} poolName The name of the pool.
200
+ * @property {function():void} handleClose Function to notify to close the widget modal when user clicks the 'x' close button.
201
+ * @property {function((number|undefined)):void|undefined} handleSuccess Optional function to notify that the lending pool withdraw action is successful.
202
+ */
203
+ type LendWithdrawPropsV2 = {
204
+ poolName: keyof typeof POOL_NAME;
205
+ handleClose: () => void;
206
+ handleSuccess?: (blockNumber?: number) => void;
125
207
  };
126
- /**
127
- * Object representing the props passed to web3 provider
128
- * @typedef {Object} WidgetProps
129
- * @property {desiredChainId|undefined} desiredChainId Optional desired chain id, will trigger the switch network action if different from the current chain id
130
- * @property {JsonRpcConnectionMap|undefined} jsonRpcUrlMap Optional mapping of your JSON-RPC connections indexed by chainId
131
- * @property {Eip1193Provider|JsonRpcProvider} provider EIP-1193 provider or JsonRpc Provider
132
- */
133
- type WidgetProps = {
134
- handleClose?: () => void;
135
- desiredChainId?: number;
136
- jsonRpcUrlMap?: JsonRpcConnectionMap;
137
- provider: Provider | JsonRpcProvider;
208
+
209
+ /**
210
+ * Receivable backed credit line pool borrow props V2
211
+ * @typedef {Object} ReceivableBackedCreditLineBorrowPropsV2
212
+ * @property {POOL_NAME} poolName The name of the pool.
213
+ * @property {tokenId} tokenId The receivable token id.
214
+ * @property {function():void} handleClose Function to notify to close the widget modal when user clicks the 'x' close button.
215
+ * @property {function((number|undefined)):void|undefined} handleSuccess Optional function to notify that the credit line pool borrow action is successful.
216
+ */
217
+ interface ReceivableBackedCreditLineBorrowPropsV2 {
218
+ poolName: keyof typeof POOL_NAME;
219
+ tokenId: string;
220
+ handleClose: () => void;
221
+ handleSuccess?: (blockNumber?: number) => void;
222
+ }
223
+
224
+ /**
225
+ * Credit line pool payment props V2
226
+ * @typedef {Object} CreditLinePaymentPropsV2
227
+ * @property {POOL_NAME} poolName The name of the pool.
228
+ * @property {tokenId} tokenID The receivable token id.
229
+ * @property {function():void} handleClose Function to notify to close the widget modal when user clicks the 'x' close button.
230
+ * @property {function((number|undefined)):void|undefined} handleSuccess Optional function to notify that the credit line pool payment action is successful.
231
+ */
232
+ type ReceivableBackedCreditLinePaymentPropsV2 = {
233
+ poolName: keyof typeof POOL_NAME;
234
+ tokenId: string;
235
+ handleClose: () => void;
236
+ handleSuccess?: (blockNumber?: number) => void;
138
237
  };
139
- /**
140
- * Invoice factoring pool borrow widget props
141
- * @typedef {Object} InvoiceFactoringBorrowWidgetProps
142
- * @property {InvoiceFactoringBorrowProps} InvoiceFactoringBorrowProps - Invoice factoring pool borrow props.
143
- * @property {WidgetProps} WidgetProps - Widget general props.
144
- */
145
- type InvoiceFactoringBorrowWidgetProps = InvoiceFactoringBorrowProps & WidgetProps;
146
- /**
147
- * Invoice factoring borrow widget
148
- *
149
- * @param {InvoiceFactoringBorrowWidgetProps} props - The invoice factoring pool borrow widget props.
150
- * @returns Invoice factoring pool borrow widget component
151
- */
152
- declare function InvoiceFactoringBorrowWidget(props: InvoiceFactoringBorrowWidgetProps): _emotion_react_jsx_runtime.JSX.Element;
153
- /**
154
- * Invoice factoring pool payment widget props
155
- * @typedef {Object} InvoiceFactoringPaymentWidgetProps
156
- * @property {InvoiceFactoringPaymentProps} InvoiceFactoringPaymentProps - Invoice factoring pool payment props.
157
- * @property {WidgetProps} WidgetProps - Widget general props.
158
- */
159
- type InvoiceFactoringPaymentWidgetProps = InvoiceFactoringPaymentProps & WidgetProps;
160
- /**
161
- * Invoice factoring payment widget
162
- *
163
- * @param {InvoiceFactoringPaymentWidgetProps} props - The invoice factoring pool payment widget props.
164
- * @returns Invoice factoring pool payment widget component
165
- */
166
- declare function InvoiceFactoringPaymentWidget(props: InvoiceFactoringPaymentWidgetProps): _emotion_react_jsx_runtime.JSX.Element;
167
- /**
168
- * Credit line pool borrow widget props
169
- * @typedef {Object} CreditLineBorrowWidgetProps
170
- * @property {CreditLineBorrowProps} CreditLineBorrowProps - Credit line pool borrow props.
171
- * @property {WidgetProps} WidgetProps - Widget general props.
172
- */
173
- type CreditLineBorrowWidgetProps = CreditLineBorrowProps & WidgetProps;
174
- /**
175
- * Credit line borrow widget
176
- *
177
- * @param {CreditLineBorrowWidgetProps} props - The credit line pool borrow widget props.
178
- * @returns Credit line pool borrow widget component
179
- */
180
- declare function CreditLineBorrowWidget(props: CreditLineBorrowWidgetProps): _emotion_react_jsx_runtime.JSX.Element;
181
- /**
182
- * Credit line pool payment widget props
183
- * @typedef {Object} CreditLinePaymentWidgetProps
184
- * @property {CreditLinePaymentProps} CreditLinePaymentProps - Credit line pool payment props.
185
- * @property {WidgetProps} WidgetProps - Widget general props.
186
- */
187
- type CreditLinePaymentWidgetProps = CreditLinePaymentProps & WidgetProps;
188
- /**
189
- * Credit line payment widget
190
- *
191
- * @param {CreditLinePaymentWidgetProps} props - The credit line pool payment widget props.
192
- * @returns Credit line pool payment widget component
193
- */
194
- declare function CreditLinePaymentWidget(props: CreditLinePaymentWidgetProps): _emotion_react_jsx_runtime.JSX.Element;
195
- /**
196
- * Credit line allowance approval widget props
197
- * @typedef {Object} CreditLinePaymentWidgetProps
198
- * @property {CreditLineApproveProps} CreditLineApproveProps - Credit line allowance approve props.
199
- * @property {WidgetProps} WidgetProps - Widget general props.
200
- */
201
- type CreditLineApproveWidgetProps = CreditLineApproveProps & WidgetProps;
202
- /**
203
- * Credit line allowance approve widget to top up a pool's ERC20 token allowance.
204
- * To be used when re-enabling autopay and other pool actions that require allowance.
205
- *
206
- * @param {CreditLineApproveWidgetProps} props - The credit line pool approve widget props.
207
- * @returns Credit line pool approve widget component
208
- */
209
- declare function CreditLineApproveWidget(props: CreditLineApproveWidgetProps): _emotion_react_jsx_runtime.JSX.Element;
210
- /**
211
- * Lend pool supply widget props
212
- * @typedef {Object} LendSupplyWidgetProps
213
- * @property {LendSupplyProps} LendSupplyProps - Lend pool supply props.
214
- * @property {WidgetProps} WidgetProps - Widget general props.
215
- */
216
- type LendSupplyWidgetProps = LendSupplyProps & WidgetProps;
217
- /**
218
- * Lend supply widget
219
- *
220
- * @param {LendSupplyWidgetProps} props - The lend pool supply widget props.
221
- * @returns Lend pool supply widget component
222
- */
223
- declare function LendSupplyWidget(props: LendSupplyWidgetProps): _emotion_react_jsx_runtime.JSX.Element;
224
- /**
225
- * Lend pool withdraw widget props
226
- * @typedef {Object} LendWithdrawWidgetProps
227
- * @property {LendWithdrawProps} LendWithdrawProps - Lend pool withdraw props.
228
- * @property {WidgetProps} WidgetProps - Widget general props.
229
- */
230
- type LendWithdrawWidgetProps = LendWithdrawProps & WidgetProps;
231
- /**
232
- * Lend withdraw widget
233
- *
234
- * @param {LendWithdrawWidgetProps} props The lend pool withdraw widget props
235
- * @returns Lend pool withdraw widget component
236
- */
237
- declare function LendWithdrawWidget(props: LendWithdrawWidgetProps): _emotion_react_jsx_runtime.JSX.Element;
238
- /**
239
- * Superfluid factoring widget
240
- *
241
- * @param {WidgetProps} props - The superfluid factoring widget props.
242
- * @returns Superfluid factoring widget component
243
- */
244
- declare function SuperfluidFactoringWidget(props: WidgetProps): _emotion_react_jsx_runtime.JSX.Element;
245
-
246
- export { CreditLineApproveWidget, CreditLineBorrowWidget, CreditLinePaymentWidget, InvoiceFactoringBorrowWidget, InvoiceFactoringPaymentWidget, LendSupplyWidget, LendWithdrawWidget, SuperfluidFactoringWidget };
238
+
239
+ /**
240
+ * Mapping of your JSON-RPC connections indexed by chainId
241
+ * @typedef {Object} JsonRpcConnectionMap
242
+ * @property {Object.<number, string|Array<string>|JsonRpcProvider|Array<JsonRpcProvider>>} chainId Chain id to map the JSON-RPC URL/URLs or JsonRpcProvider/JsonRpcProviders
243
+ */
244
+ type JsonRpcConnectionMap = {
245
+ [chainId: number]: string | string[] | JsonRpcProvider | JsonRpcProvider[];
246
+ };
247
+ /**
248
+ * Object representing the props passed to web3 provider
249
+ * @typedef {Object} WidgetProps
250
+ * @property {desiredChainId|undefined} desiredChainId Optional desired chain id, will trigger the switch network action if different from the current chain id
251
+ * @property {JsonRpcConnectionMap|undefined} jsonRpcUrlMap Optional mapping of your JSON-RPC connections indexed by chainId
252
+ * @property {Eip1193Provider|JsonRpcProvider} provider EIP-1193 provider or JsonRpc Provider
253
+ */
254
+ type WidgetProps = {
255
+ handleClose?: () => void;
256
+ desiredChainId?: number;
257
+ jsonRpcUrlMap?: JsonRpcConnectionMap;
258
+ provider: Provider | JsonRpcProvider;
259
+ };
260
+ /**
261
+ * Invoice factoring pool borrow widget props
262
+ * @typedef {Object} InvoiceFactoringBorrowWidgetProps
263
+ * @property {InvoiceFactoringBorrowProps} InvoiceFactoringBorrowProps - Invoice factoring pool borrow props.
264
+ * @property {WidgetProps} WidgetProps - Widget general props.
265
+ */
266
+ type InvoiceFactoringBorrowWidgetProps = InvoiceFactoringBorrowProps & WidgetProps;
267
+ /**
268
+ * Invoice factoring borrow widget
269
+ *
270
+ * @param {InvoiceFactoringBorrowWidgetProps} props - The invoice factoring pool borrow widget props.
271
+ * @returns Invoice factoring pool borrow widget component
272
+ */
273
+ declare function InvoiceFactoringBorrowWidget(props: InvoiceFactoringBorrowWidgetProps): _emotion_react_jsx_runtime.JSX.Element;
274
+ /**
275
+ * Invoice factoring pool payment widget props
276
+ * @typedef {Object} InvoiceFactoringPaymentWidgetProps
277
+ * @property {InvoiceFactoringPaymentProps} InvoiceFactoringPaymentProps - Invoice factoring pool payment props.
278
+ * @property {WidgetProps} WidgetProps - Widget general props.
279
+ */
280
+ type InvoiceFactoringPaymentWidgetProps = InvoiceFactoringPaymentProps & WidgetProps;
281
+ /**
282
+ * Invoice factoring payment widget
283
+ *
284
+ * @param {InvoiceFactoringPaymentWidgetProps} props - The invoice factoring pool payment widget props.
285
+ * @returns Invoice factoring pool payment widget component
286
+ */
287
+ declare function InvoiceFactoringPaymentWidget(props: InvoiceFactoringPaymentWidgetProps): _emotion_react_jsx_runtime.JSX.Element;
288
+ /**
289
+ * Credit line pool borrow widget props
290
+ * @typedef {Object} CreditLineBorrowWidgetProps
291
+ * @property {CreditLineBorrowProps} CreditLineBorrowProps - Credit line pool borrow props.
292
+ * @property {WidgetProps} WidgetProps - Widget general props.
293
+ */
294
+ type CreditLineBorrowWidgetProps = CreditLineBorrowProps & WidgetProps;
295
+ /**
296
+ * Credit line borrow widget
297
+ *
298
+ * @param {CreditLineBorrowWidgetProps} props - The credit line pool borrow widget props.
299
+ * @returns Credit line pool borrow widget component
300
+ */
301
+ declare function CreditLineBorrowWidget(props: CreditLineBorrowWidgetProps): _emotion_react_jsx_runtime.JSX.Element;
302
+ /**
303
+ * Credit line pool borrow widget props V2
304
+ * @typedef {Object} CreditLineBorrowWidgetPropsV2
305
+ * @property {CreditLineBorrowPropsV2} CreditLineBorrowPropsV2 - Credit line pool borrow props V2.
306
+ * @property {WidgetProps} WidgetProps - Widget general props.
307
+ */
308
+ type CreditLineBorrowWidgetPropsV2 = CreditLineBorrowPropsV2 & WidgetProps;
309
+ /**
310
+ * Credit line borrow widget V2
311
+ *
312
+ * @param {CreditLineBorrowWidgetPropsV2} props - The credit line pool borrow widget props V2.
313
+ * @returns Credit line pool borrow widget component V2
314
+ */
315
+ declare function CreditLineBorrowWidgetV2(props: CreditLineBorrowWidgetPropsV2): _emotion_react_jsx_runtime.JSX.Element;
316
+ /**
317
+ * Credit line pool payment widget props
318
+ * @typedef {Object} CreditLinePaymentWidgetProps
319
+ * @property {CreditLinePaymentProps} CreditLinePaymentProps - Credit line pool payment props.
320
+ * @property {WidgetProps} WidgetProps - Widget general props.
321
+ */
322
+ type CreditLinePaymentWidgetProps = CreditLinePaymentProps & WidgetProps;
323
+ /**
324
+ * Credit line payment widget
325
+ *
326
+ * @param {CreditLinePaymentWidgetProps} props - The credit line pool payment widget props.
327
+ * @returns Credit line pool payment widget component
328
+ */
329
+ declare function CreditLinePaymentWidget(props: CreditLinePaymentWidgetProps): _emotion_react_jsx_runtime.JSX.Element;
330
+ /**
331
+ * Credit line pool payment widget props V2
332
+ * @typedef {Object} CreditLinePaymentWidgetPropsV2
333
+ * @property {CreditLinePaymentPropsV2} CreditLinePaymentPropsV2 - Credit line pool payment props V2.
334
+ * @property {WidgetProps} WidgetProps - Widget general props.
335
+ */
336
+ type CreditLinePaymentWidgetPropsV2 = CreditLinePaymentPropsV2 & WidgetProps;
337
+ /**
338
+ * Credit line payment widget V2
339
+ *
340
+ * @param {CreditLinePaymentWidgetPropsV2} props - The credit line pool payment widget props V2.
341
+ * @returns Credit line pool payment widget component V2
342
+ */
343
+ declare function CreditLinePaymentWidgetV2(props: CreditLinePaymentWidgetPropsV2): _emotion_react_jsx_runtime.JSX.Element;
344
+ /**
345
+ * Credit line allowance approval widget props
346
+ * @typedef {Object} CreditLinePaymentWidgetProps
347
+ * @property {CreditLineApproveProps} CreditLineApproveProps - Credit line allowance approve props.
348
+ * @property {WidgetProps} WidgetProps - Widget general props.
349
+ */
350
+ type CreditLineApproveWidgetProps = CreditLineApproveProps & WidgetProps;
351
+ /**
352
+ * Credit line allowance approve widget to top up a pool's ERC20 token allowance.
353
+ * To be used when re-enabling autopay and other pool actions that require allowance.
354
+ *
355
+ * @param {CreditLineApproveWidgetProps} props - The credit line pool approve widget props.
356
+ * @returns Credit line pool approve widget component
357
+ */
358
+ declare function CreditLineApproveWidget(props: CreditLineApproveWidgetProps): _emotion_react_jsx_runtime.JSX.Element;
359
+ /**
360
+ * Lend pool supply widget props
361
+ * @typedef {Object} LendSupplyWidgetProps
362
+ * @property {LendSupplyProps} LendSupplyProps - Lend pool supply props.
363
+ * @property {WidgetProps} WidgetProps - Widget general props.
364
+ */
365
+ type LendSupplyWidgetProps = LendSupplyProps & WidgetProps;
366
+ /**
367
+ * Lend supply widget
368
+ *
369
+ * @param {LendSupplyWidgetProps} props - The lend pool supply widget props.
370
+ * @returns Lend pool supply widget component
371
+ */
372
+ declare function LendSupplyWidget(props: LendSupplyWidgetProps): _emotion_react_jsx_runtime.JSX.Element;
373
+ /**
374
+ * Lend pool supply widget props V2
375
+ * @typedef {Object} LendSupplyWidgetPropsV2
376
+ * @property {LendSupplyPropsV2} LendSupplyPropsV2 - Lend pool supply props V2.
377
+ * @property {WidgetProps} WidgetProps - Widget general props.
378
+ */
379
+ type LendSupplyWidgetPropsV2 = LendSupplyPropsV2 & WidgetProps;
380
+ /**
381
+ * Lend supply widget V2
382
+ *
383
+ * @param {LendSupplyWidgetPropsV2} props - The lend pool supply widget props V2.
384
+ * @returns Lend pool supply widget component V2
385
+ */
386
+ declare function LendSupplyWidgetV2(props: LendSupplyWidgetPropsV2): _emotion_react_jsx_runtime.JSX.Element;
387
+ /**
388
+ * Lend pool withdraw widget props
389
+ * @typedef {Object} LendWithdrawWidgetProps
390
+ * @property {LendWithdrawProps} LendWithdrawProps - Lend pool withdraw props.
391
+ * @property {WidgetProps} WidgetProps - Widget general props.
392
+ */
393
+ type LendWithdrawWidgetProps = LendWithdrawProps & WidgetProps;
394
+ /**
395
+ * Lend withdraw widget
396
+ *
397
+ * @param {LendWithdrawWidgetProps} props The lend pool withdraw widget props
398
+ * @returns Lend pool withdraw widget component
399
+ */
400
+ declare function LendWithdrawWidget(props: LendWithdrawWidgetProps): _emotion_react_jsx_runtime.JSX.Element;
401
+ /**
402
+ * Lend pool supply widget props V2
403
+ * @typedef {Object} LendSupplyWidgetPropsV2
404
+ * @property {LendWithdrawPropsV2} LendSupplyPropsV2 - Lend pool supply props V2.
405
+ * @property {WidgetProps} WidgetProps - Widget general props.
406
+ */
407
+ type LendWithdrawWidgetPropsV2 = LendWithdrawPropsV2 & WidgetProps;
408
+ /**
409
+ * Lend withdraw widget V2
410
+ *
411
+ * @param {LendWithdrawWidgetPropsV2} props - The lend pool supply widget props V2.
412
+ * @returns Lend pool supply widget component V2
413
+ */
414
+ declare function LendWithdrawWidgetV2(props: LendWithdrawWidgetPropsV2): _emotion_react_jsx_runtime.JSX.Element;
415
+ /**
416
+ * Lend pool redeem widget props V2
417
+ * @typedef {Object} LendRedeemWidgetPropsV2
418
+ * @property {LendRedeemPropsV2} LendRedeemPropsV2 - Lend pool redeem props V2.
419
+ * @property {WidgetProps} WidgetProps - Widget general props.
420
+ */
421
+ type LendRedeemWidgetPropsV2 = LendRedeemPropsV2 & WidgetProps;
422
+ /**
423
+ * Lend redeem widget V2
424
+ *
425
+ * @param {LendRedeemWidgetPropsV2} props - The lend pool redeem widget props V2.
426
+ * @returns Lend pool redeem widget component V2
427
+ */
428
+ declare function LendRedeemWidgetV2(props: LendRedeemWidgetPropsV2): _emotion_react_jsx_runtime.JSX.Element;
429
+ /**
430
+ * Supply first loss cover widget props
431
+ * @typedef {Object} SupplyFirstLossCoverWidgetProps
432
+ * @property {SupplyFirstLossCover} SupplyFirstLossCover - Supply first loss cover props.
433
+ * @property {WidgetProps} WidgetProps - Widget general props.
434
+ */
435
+ type SupplyFirstLossCoverWidgetProps = SupplyFirstLossCoverProps & WidgetProps;
436
+ /**
437
+ * Supply first loss cover widget
438
+ *
439
+ * @param {SupplyFirstLossCoverWidgetProps} props - The supply first loss cover widget props.
440
+ * @returns Supply first loss cover widget component
441
+ */
442
+ declare function SupplyFirstLossCoverWidget(props: SupplyFirstLossCoverWidgetProps): _emotion_react_jsx_runtime.JSX.Element;
443
+ /**
444
+ * Superfluid factoring widget
445
+ *
446
+ * @param {WidgetProps} props - The superfluid factoring widget props.
447
+ * @returns Superfluid factoring widget component
448
+ */
449
+ declare function SuperfluidFactoringWidget(props: WidgetProps): _emotion_react_jsx_runtime.JSX.Element;
450
+ /**
451
+ * Auto payback widget props V2
452
+ * @typedef {Object} AutoPaybackWidgetPropsV2
453
+ * @property {AutoPayback} AutoPayback - Auto payback props V2.
454
+ * @property {WidgetProps} WidgetProps - Widget general props.
455
+ */
456
+ type AutoPaybackWidgetPropsV2 = AutoPaybackPropsV2 & WidgetProps;
457
+ /**
458
+ * Supply first loss cover widget
459
+ *
460
+ * @param {SupplyFirstLossCoverWidgetProps} props - The supply first loss cover widget props.
461
+ * @returns Supply first loss cover widget component
462
+ */
463
+ declare function AutoPaybackWidgetV2(props: AutoPaybackWidgetPropsV2): _emotion_react_jsx_runtime.JSX.Element;
464
+ /**
465
+ * Receivable backed credit line pool borrow widget props V2
466
+ * @typedef {Object} ReceivableBackedCreditLineBorrowWidgetPropsV2
467
+ * @property {ReceivableBackedCreditLineBorrowPropsV2} ReceivableBackedCreditLineBorrowPropsV2 - Receivable backed credit line pool borrow props V2.
468
+ * @property {WidgetProps} WidgetProps - Widget general props.
469
+ */
470
+ type ReceivableBackedCreditLineBorrowWidgetPropsV2 = ReceivableBackedCreditLineBorrowPropsV2 & WidgetProps;
471
+ /**
472
+ * Receivable backed credit line borrow widget V2
473
+ *
474
+ * @param {ReceivableBackedCreditLineBorrowWidgetPropsV2} props - The receivable backed credit line pool borrow widget props V2.
475
+ * @returns Receivable backed credit line pool borrow widget component V2
476
+ */
477
+ declare function ReceivableBackedCreditLineBorrowWidgetV2(props: ReceivableBackedCreditLineBorrowWidgetPropsV2): _emotion_react_jsx_runtime.JSX.Element;
478
+ /**
479
+ * Receivable backed credit line pool payment widget props V2
480
+ * @typedef {Object} ReceivableBackedCreditLinePaymentWidgetPropsV2
481
+ * @property {ReceivableBackedCreditLinePaymentPropsV2} ReceivableBackedCreditLinePaymentPropsV2 - Receivable backed credit line pool payment props V2.
482
+ * @property {WidgetProps} WidgetProps - Widget general props.
483
+ */
484
+ type ReceivableBackedCreditLinePaymentWidgetPropsV2 = ReceivableBackedCreditLinePaymentPropsV2 & WidgetProps;
485
+ /**
486
+ * Receivable backed credit line payment widget V2
487
+ *
488
+ * @param {ReceivableBackedCreditLinePaymentWidgetPropsV2} props - The receivable backed credit line pool payment widget props V2.
489
+ * @returns Receivable backed credit line pool payment widget component V2
490
+ */
491
+ declare function ReceivableBackedCreditLinePaymentWidgetV2(props: ReceivableBackedCreditLinePaymentWidgetPropsV2): _emotion_react_jsx_runtime.JSX.Element;
492
+
493
+ export { AutoPaybackWidgetV2, CreditLineApproveWidget, CreditLineBorrowWidget, CreditLineBorrowWidgetV2, CreditLinePaymentWidget, CreditLinePaymentWidgetV2, InvoiceFactoringBorrowWidget, InvoiceFactoringPaymentWidget, LendRedeemWidgetV2, LendSupplyWidget, LendSupplyWidgetV2, LendWithdrawWidget, LendWithdrawWidgetV2, ReceivableBackedCreditLineBorrowWidgetV2, ReceivableBackedCreditLinePaymentWidgetV2, SuperfluidFactoringWidget, SupplyFirstLossCoverWidget };