@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/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|JsonRpcProvider|null|undefined} provider Optional EIP-1193 provider or JsonRpc Provider
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?: Provider | JsonRpcProvider | null;
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 {InvoiceFactoringBorrowProps | WidgetProps} props - The invoice factoring pool borrow widget props.
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 {InvoiceFactoringPaymentProps | WidgetProps} props - The invoice factoring pool payment widget props.
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 {CreditLineBorrowProps | WidgetProps} props - The credit line pool borrow widget props.
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 {CreditLinePaymentProps | WidgetProps} props - The credit line pool payment widget props.
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 {LendSupplyProps | WidgetProps} props - The lend pool supply widget props.
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 {LendWithdrawProps | WidgetProps} props The lend pool withdraw widget props
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 };