@huma-finance/widgets 0.0.35 → 0.0.37
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.
- package/dist/cjs/index.cjs +1534 -1114
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/index.d.ts +42 -10
- package/dist/index.js +1536 -1117
- package/dist/index.js.map +1 -1
- package/package.json +5 -4
- package/src/components/Activity.tsx +1 -5
- package/src/components/ApproveAllowanceModal.tsx +24 -10
- package/src/components/CreditLine/approve/1-ApproveAllowance.tsx +34 -0
- package/src/components/CreditLine/approve/2-Success.tsx +43 -0
- package/src/components/CreditLine/approve/index.tsx +85 -0
- package/src/components/CreditLine/borrow/2-ChooseAmount.tsx +8 -2
- package/src/components/CreditLine/borrow/{4-ApproveAllowance.tsx → 3-ApproveAllowance.tsx} +1 -1
- package/src/components/CreditLine/borrow/{3-Transfer.tsx → 4-Transfer.tsx} +4 -14
- package/src/components/CreditLine/borrow/index.tsx +2 -2
- package/src/components/HumaTable.tsx +111 -66
- package/src/components/Lend/supply/1-Evaluation/EvaluationKYC.tsx +52 -19
- package/src/components/Notifi/NotifiSubscriptionModal.tsx +7 -3
- package/src/components/SuperfluidFactoring/SuperfluidFactoredList.tsx +0 -1
- package/src/components/SuperfluidFactoring/SuperfluidUpcomingList.tsx +0 -1
- package/src/components/ViewOnExplorer.tsx +4 -7
- package/src/hooks/useElementDimensions.ts +30 -0
- package/src/index.tsx +40 -58
- package/src/utilTypes.d.ts +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,24 @@ import * as _emotion_react_jsx_runtime from '@emotion/react/jsx-runtime';
|
|
|
2
2
|
import { JsonRpcProvider } from '@ethersproject/providers';
|
|
3
3
|
import { Provider } from '@web3-react/types';
|
|
4
4
|
import { POOL_NAME, POOL_TYPE } from '@huma-finance/shared';
|
|
5
|
-
import { BigNumber } from 'ethers';
|
|
5
|
+
import { BigNumberish, BigNumber } from 'ethers';
|
|
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;
|
|
22
|
+
};
|
|
6
23
|
|
|
7
24
|
/**
|
|
8
25
|
* Credit line pool borrow props
|
|
@@ -111,13 +128,13 @@ type JsonRpcConnectionMap = {
|
|
|
111
128
|
* @typedef {Object} WidgetProps
|
|
112
129
|
* @property {desiredChainId|undefined} desiredChainId Optional desired chain id, will trigger the switch network action if different from the current chain id
|
|
113
130
|
* @property {JsonRpcConnectionMap|undefined} jsonRpcUrlMap Optional mapping of your JSON-RPC connections indexed by chainId
|
|
114
|
-
* @property {Eip1193Provider|
|
|
131
|
+
* @property {Eip1193Provider|JsonRpcProviderl} provider EIP-1193 provider or JsonRpc Provider
|
|
115
132
|
*/
|
|
116
133
|
type WidgetProps = {
|
|
117
134
|
handleClose?: () => void;
|
|
118
135
|
desiredChainId?: number;
|
|
119
136
|
jsonRpcUrlMap?: JsonRpcConnectionMap;
|
|
120
|
-
provider
|
|
137
|
+
provider: Provider | JsonRpcProvider;
|
|
121
138
|
};
|
|
122
139
|
/**
|
|
123
140
|
* Invoice factoring pool borrow widget props
|
|
@@ -129,7 +146,7 @@ type InvoiceFactoringBorrowWidgetProps = InvoiceFactoringBorrowProps & WidgetPro
|
|
|
129
146
|
/**
|
|
130
147
|
* Invoice factoring borrow widget
|
|
131
148
|
*
|
|
132
|
-
* @param {
|
|
149
|
+
* @param {InvoiceFactoringBorrowWidgetProps} props - The invoice factoring pool borrow widget props.
|
|
133
150
|
* @returns Invoice factoring pool borrow widget component
|
|
134
151
|
*/
|
|
135
152
|
declare function InvoiceFactoringBorrowWidget(props: InvoiceFactoringBorrowWidgetProps): _emotion_react_jsx_runtime.JSX.Element;
|
|
@@ -143,7 +160,7 @@ type InvoiceFactoringPaymentWidgetProps = InvoiceFactoringPaymentProps & WidgetP
|
|
|
143
160
|
/**
|
|
144
161
|
* Invoice factoring payment widget
|
|
145
162
|
*
|
|
146
|
-
* @param {
|
|
163
|
+
* @param {InvoiceFactoringPaymentWidgetProps} props - The invoice factoring pool payment widget props.
|
|
147
164
|
* @returns Invoice factoring pool payment widget component
|
|
148
165
|
*/
|
|
149
166
|
declare function InvoiceFactoringPaymentWidget(props: InvoiceFactoringPaymentWidgetProps): _emotion_react_jsx_runtime.JSX.Element;
|
|
@@ -157,7 +174,7 @@ type CreditLineBorrowWidgetProps = CreditLineBorrowProps & WidgetProps;
|
|
|
157
174
|
/**
|
|
158
175
|
* Credit line borrow widget
|
|
159
176
|
*
|
|
160
|
-
* @param {
|
|
177
|
+
* @param {CreditLineBorrowWidgetProps} props - The credit line pool borrow widget props.
|
|
161
178
|
* @returns Credit line pool borrow widget component
|
|
162
179
|
*/
|
|
163
180
|
declare function CreditLineBorrowWidget(props: CreditLineBorrowWidgetProps): _emotion_react_jsx_runtime.JSX.Element;
|
|
@@ -171,10 +188,25 @@ type CreditLinePaymentWidgetProps = CreditLinePaymentProps & WidgetProps;
|
|
|
171
188
|
/**
|
|
172
189
|
* Credit line payment widget
|
|
173
190
|
*
|
|
174
|
-
* @param {
|
|
191
|
+
* @param {CreditLinePaymentWidgetProps} props - The credit line pool payment widget props.
|
|
175
192
|
* @returns Credit line pool payment widget component
|
|
176
193
|
*/
|
|
177
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;
|
|
178
210
|
/**
|
|
179
211
|
* Lend pool supply widget props
|
|
180
212
|
* @typedef {Object} LendSupplyWidgetProps
|
|
@@ -185,7 +217,7 @@ type LendSupplyWidgetProps = LendSupplyProps & WidgetProps;
|
|
|
185
217
|
/**
|
|
186
218
|
* Lend supply widget
|
|
187
219
|
*
|
|
188
|
-
* @param {
|
|
220
|
+
* @param {LendSupplyWidgetProps} props - The lend pool supply widget props.
|
|
189
221
|
* @returns Lend pool supply widget component
|
|
190
222
|
*/
|
|
191
223
|
declare function LendSupplyWidget(props: LendSupplyWidgetProps): _emotion_react_jsx_runtime.JSX.Element;
|
|
@@ -199,7 +231,7 @@ type LendWithdrawWidgetProps = LendWithdrawProps & WidgetProps;
|
|
|
199
231
|
/**
|
|
200
232
|
* Lend withdraw widget
|
|
201
233
|
*
|
|
202
|
-
* @param {
|
|
234
|
+
* @param {LendWithdrawWidgetProps} props The lend pool withdraw widget props
|
|
203
235
|
* @returns Lend pool withdraw widget component
|
|
204
236
|
*/
|
|
205
237
|
declare function LendWithdrawWidget(props: LendWithdrawWidgetProps): _emotion_react_jsx_runtime.JSX.Element;
|
|
@@ -211,4 +243,4 @@ declare function LendWithdrawWidget(props: LendWithdrawWidgetProps): _emotion_re
|
|
|
211
243
|
*/
|
|
212
244
|
declare function SuperfluidFactoringWidget(props: WidgetProps): _emotion_react_jsx_runtime.JSX.Element;
|
|
213
245
|
|
|
214
|
-
export { CreditLineBorrowWidget, CreditLinePaymentWidget, InvoiceFactoringBorrowWidget, InvoiceFactoringPaymentWidget, LendSupplyWidget, LendWithdrawWidget, SuperfluidFactoringWidget };
|
|
246
|
+
export { CreditLineApproveWidget, CreditLineBorrowWidget, CreditLinePaymentWidget, InvoiceFactoringBorrowWidget, InvoiceFactoringPaymentWidget, LendSupplyWidget, LendWithdrawWidget, SuperfluidFactoringWidget };
|