@huma-finance/widgets 0.0.69-beta.840 → 0.0.69-beta.845

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
@@ -1,9 +1,10 @@
1
1
  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
- import { POOL_NAME, POOL_TYPE, TrancheType, CloseModalOptions, SolanaPoolInfo, StellarPoolInfo } from '@huma-finance/shared';
4
+ import { POOL_NAME, POOL_TYPE, SolanaPoolInfo, TrancheType, CloseModalOptions, StellarPoolInfo } from '@huma-finance/shared';
5
5
  import { BigNumberish, BigNumber } from 'ethers';
6
- import { SolanaPoolState, StellarPoolState } from '@huma-finance/web-shared';
6
+ import { SolanaPoolState, LenderStateAccount, StellarPoolState } from '@huma-finance/web-shared';
7
+ import { Mint } from '@solana/spl-token';
7
8
  import React from 'react';
8
9
 
9
10
  /**
@@ -94,6 +95,32 @@ type CreditLinePaymentPropsV2 = {
94
95
  handleSuccess?: (blockNumber?: number) => void;
95
96
  };
96
97
 
98
+ /**
99
+ * Lend pool supply props
100
+ * @typedef {Object} SolanaBorrowProps
101
+ * @property {SolanaPoolInfo} poolInfo The metadata of the pool.
102
+ * @property {SolanaPoolState} poolState The current state config of the pool. * @property {function():void} handleClose Function to notify to close the widget modal when user clicks the 'x' close button.
103
+ * @property {function():void|undefined} handleSuccess Optional function to notify that the lending pool supply action is successful.
104
+ */
105
+ interface SolanaBorrowProps {
106
+ poolInfo: SolanaPoolInfo;
107
+ poolState: SolanaPoolState;
108
+ handleClose: () => void;
109
+ handleSuccess?: () => void;
110
+ }
111
+
112
+ /**
113
+ * Lend pool supply props
114
+ * @typedef {Object} SolanaPaymentProps
115
+ * @property {SolanaPoolInfo} poolInfo The metadata of the pool.
116
+ * @property {function():void|undefined} handleSuccess Optional function to notify that the lending pool supply action is successful.
117
+ */
118
+ interface SolanaPaymentProps {
119
+ poolInfo: SolanaPoolInfo;
120
+ handleClose: () => void;
121
+ handleSuccess?: () => void;
122
+ }
123
+
97
124
  /**
98
125
  * Supply first loss cover props
99
126
  * @typedef {Object} SupplyFirstLossCoverProps
@@ -169,6 +196,102 @@ type CancelRedemptionPropsV2 = {
169
196
  handleSuccess?: (blockNumber?: number) => void;
170
197
  };
171
198
 
199
+ /**
200
+ * Lend pool supply props
201
+ * @typedef {Object} SolanaLendAddRedemptionProps
202
+ * @property {SolanaPoolInfo} poolInfo The metadata of the pool.
203
+ * @property {SolanaPoolState} poolState The current state config of the pool. * @property {function():void} handleClose Function to notify to close the widget modal when user clicks the 'x' close button.
204
+ * @property {POOL_NTrancheTypeAME} tranche The tranche type.
205
+ * @property {function():void|undefined} handleSuccess Optional function to notify that the lending pool supply action is successful.
206
+ */
207
+ interface SolanaLendAddRedemptionProps {
208
+ poolInfo: SolanaPoolInfo;
209
+ poolState: SolanaPoolState;
210
+ tranche?: TrancheType;
211
+ handleClose: () => void;
212
+ handleSuccess?: () => void;
213
+ }
214
+
215
+ /**
216
+ * Lend pool supply props
217
+ * @typedef {Object} SolanaLendCancelRedemptionProps
218
+ * @property {SolanaPoolInfo} poolInfo The metadata of the pool.
219
+ * @property {SolanaPoolState} poolState The current state config of the pool. * @property {function():void} handleClose Function to notify to close the widget modal when user clicks the 'x' close button.
220
+ * @property {function():void|undefined} handleSuccess Optional function to notify that the lending pool supply action is successful.
221
+ */
222
+ interface SolanaLendCancelRedemptionProps {
223
+ poolInfo: SolanaPoolInfo;
224
+ tranche?: TrancheType;
225
+ handleClose: () => void;
226
+ handleSuccess?: () => void;
227
+ }
228
+
229
+ /**
230
+ * Lend pool supply props
231
+ * @typedef {Object} SolanaEnableAutoRedemptionProps
232
+ * @property {SolanaPoolInfo} poolInfo The metadata of the pool.
233
+ * @property {SolanaPoolState} poolState The current state config of the pool.
234
+ * @property {function((CloseModalOptions|undefined)):void} handleClose Function to notify to close the widget modal when user clicks the 'x' close button.
235
+ * @property {function():void|undefined} handleSuccess Optional function to notify that the lending pool supply action is successful.
236
+ */
237
+ interface SolanaEnableAutoRedemptionProps {
238
+ poolInfo: SolanaPoolInfo;
239
+ poolState: SolanaPoolState;
240
+ handleClose: (options?: CloseModalOptions) => void;
241
+ handleSuccess?: () => void;
242
+ }
243
+
244
+ /**
245
+ * Lend pool supply props
246
+ * @typedef {Object} SolanaLendSupplyProps
247
+ * @property {SolanaPoolInfo} poolInfo The metadata of the pool.
248
+ * @property {SolanaPoolState} poolState The current state config of the pool.
249
+ * @property {function((CloseModalOptions|undefined)):void} handleClose Function to notify to close the widget modal when user clicks the 'x' close button.
250
+ * @property {function():void|undefined} handleSuccess Optional function to notify that the lending pool supply action is successful.
251
+ */
252
+ interface SolanaLendSupplyProps {
253
+ poolInfo: SolanaPoolInfo;
254
+ poolState: SolanaPoolState;
255
+ handleClose: (options?: CloseModalOptions) => void;
256
+ handleSuccess?: () => void;
257
+ }
258
+
259
+ /**
260
+ * Solana lend pool withdraw props
261
+ * @typedef {Object} SolanaLendWithdrawProps
262
+ * @property {SolanaPoolInfo} poolInfo The metadata of the pool.
263
+ * @property {SolanaPoolState} poolState The current state config of the pool.
264
+ * @property {LenderStateAccount} lenderStateAccount The lender state account of the user.
265
+ * @property {Mint} trancheMintAccount The mint account of the tranche.
266
+ * @property {TrancheType} trancheType The type of the tranche.
267
+ * @property {function():void} handleClose Function to notify to close the widget modal when user clicks the 'x' close button.
268
+ * @property {function((number|undefined)):void|undefined} handleSuccess Optional function to notify that the lending pool withdraw action is successful.
269
+ */
270
+ type SolanaLendWithdrawProps = {
271
+ poolInfo: SolanaPoolInfo;
272
+ poolState: SolanaPoolState;
273
+ lenderStateAccount: LenderStateAccount;
274
+ trancheMintAccount: Mint;
275
+ trancheType: TrancheType;
276
+ handleClose: () => void;
277
+ handleSuccess?: (blockNumber?: number) => void;
278
+ };
279
+
280
+ /**
281
+ * Lend pool supply props
282
+ * @typedef {Object} StellarLendSupplyProps
283
+ * @property {StellarPoolInfo} poolInfo The metadata of the pool.
284
+ * @property {StellarPoolState} poolState The current state config of the pool.
285
+ * @property {function((CloseModalOptions|undefined)):void} handleClose Function to notify to close the widget modal when user clicks the 'x' close button.
286
+ * @property {function():void|undefined} handleSuccess Optional function to notify that the lending pool supply action is successful.
287
+ */
288
+ interface StellarLendSupplyProps {
289
+ poolInfo: StellarPoolInfo;
290
+ poolState: StellarPoolState;
291
+ handleClose: (options?: CloseModalOptions) => void;
292
+ handleSuccess?: () => void;
293
+ }
294
+
172
295
  /**
173
296
  * Lend pool supply props
174
297
  * @typedef {Object} LendSupplyProps
@@ -263,107 +386,6 @@ type ReceivableBackedCreditLinePaymentPropsV2 = {
263
386
  handleSuccess?: (blockNumber?: number) => void;
264
387
  };
265
388
 
266
- /**
267
- * Lend pool supply props
268
- * @typedef {Object} SolanaLendSupplyProps
269
- * @property {SolanaPoolInfo} poolInfo The metadata of the pool.
270
- * @property {SolanaPoolState} poolState The current state config of the pool.
271
- * @property {function((CloseModalOptions|undefined)):void} handleClose Function to notify to close the widget modal when user clicks the 'x' close button.
272
- * @property {function():void|undefined} handleSuccess Optional function to notify that the lending pool supply action is successful.
273
- */
274
- interface SolanaLendSupplyProps {
275
- poolInfo: SolanaPoolInfo;
276
- poolState: SolanaPoolState;
277
- handleClose: (options?: CloseModalOptions) => void;
278
- handleSuccess?: () => void;
279
- }
280
-
281
- /**
282
- * Lend pool supply props
283
- * @typedef {Object} SolanaLendAddRedemptionProps
284
- * @property {SolanaPoolInfo} poolInfo The metadata of the pool.
285
- * @property {SolanaPoolState} poolState The current state config of the pool. * @property {function():void} handleClose Function to notify to close the widget modal when user clicks the 'x' close button.
286
- * @property {POOL_NTrancheTypeAME} tranche The tranche type.
287
- * @property {function():void|undefined} handleSuccess Optional function to notify that the lending pool supply action is successful.
288
- */
289
- interface SolanaLendAddRedemptionProps {
290
- poolInfo: SolanaPoolInfo;
291
- poolState: SolanaPoolState;
292
- tranche?: TrancheType;
293
- handleClose: () => void;
294
- handleSuccess?: () => void;
295
- }
296
-
297
- /**
298
- * Lend pool supply props
299
- * @typedef {Object} SolanaLendCancelRedemptionProps
300
- * @property {SolanaPoolInfo} poolInfo The metadata of the pool.
301
- * @property {SolanaPoolState} poolState The current state config of the pool. * @property {function():void} handleClose Function to notify to close the widget modal when user clicks the 'x' close button.
302
- * @property {function():void|undefined} handleSuccess Optional function to notify that the lending pool supply action is successful.
303
- */
304
- interface SolanaLendCancelRedemptionProps {
305
- poolInfo: SolanaPoolInfo;
306
- tranche?: TrancheType;
307
- handleClose: () => void;
308
- handleSuccess?: () => void;
309
- }
310
-
311
- /**
312
- * Lend pool supply props
313
- * @typedef {Object} SolanaBorrowProps
314
- * @property {SolanaPoolInfo} poolInfo The metadata of the pool.
315
- * @property {SolanaPoolState} poolState The current state config of the pool. * @property {function():void} handleClose Function to notify to close the widget modal when user clicks the 'x' close button.
316
- * @property {function():void|undefined} handleSuccess Optional function to notify that the lending pool supply action is successful.
317
- */
318
- interface SolanaBorrowProps {
319
- poolInfo: SolanaPoolInfo;
320
- poolState: SolanaPoolState;
321
- handleClose: () => void;
322
- handleSuccess?: () => void;
323
- }
324
-
325
- /**
326
- * Lend pool supply props
327
- * @typedef {Object} SolanaPaymentProps
328
- * @property {SolanaPoolInfo} poolInfo The metadata of the pool.
329
- * @property {function():void|undefined} handleSuccess Optional function to notify that the lending pool supply action is successful.
330
- */
331
- interface SolanaPaymentProps {
332
- poolInfo: SolanaPoolInfo;
333
- handleClose: () => void;
334
- handleSuccess?: () => void;
335
- }
336
-
337
- /**
338
- * Lend pool supply props
339
- * @typedef {Object} StellarLendSupplyProps
340
- * @property {StellarPoolInfo} poolInfo The metadata of the pool.
341
- * @property {StellarPoolState} poolState The current state config of the pool.
342
- * @property {function((CloseModalOptions|undefined)):void} handleClose Function to notify to close the widget modal when user clicks the 'x' close button.
343
- * @property {function():void|undefined} handleSuccess Optional function to notify that the lending pool supply action is successful.
344
- */
345
- interface StellarLendSupplyProps {
346
- poolInfo: StellarPoolInfo;
347
- poolState: StellarPoolState;
348
- handleClose: (options?: CloseModalOptions) => void;
349
- handleSuccess?: () => void;
350
- }
351
-
352
- /**
353
- * Lend pool supply props
354
- * @typedef {Object} SolanaEnableAutoRedemptionProps
355
- * @property {SolanaPoolInfo} poolInfo The metadata of the pool.
356
- * @property {SolanaPoolState} poolState The current state config of the pool.
357
- * @property {function((CloseModalOptions|undefined)):void} handleClose Function to notify to close the widget modal when user clicks the 'x' close button.
358
- * @property {function():void|undefined} handleSuccess Optional function to notify that the lending pool supply action is successful.
359
- */
360
- interface SolanaEnableAutoRedemptionProps {
361
- poolInfo: SolanaPoolInfo;
362
- poolState: SolanaPoolState;
363
- handleClose: (options?: CloseModalOptions) => void;
364
- handleSuccess?: () => void;
365
- }
366
-
367
389
  type Props = {
368
390
  chainId: number | undefined;
369
391
  children?: any;
@@ -699,6 +721,13 @@ type SolanaPaymentWidgetProps = SolanaPaymentProps & GenericWidgetProps;
699
721
  * @param {SolanaPaymentWidgetProps} props - Widget props
700
722
  */
701
723
  declare function SolanaPaymentWidget(props: SolanaPaymentWidgetProps): _emotion_react_jsx_runtime.JSX.Element;
724
+ /**
725
+ * Solana lend withdraw widget
726
+ *
727
+ * @param {SolanaLendWithdrawProps} props - The solana lend pool withdraw widget props.
728
+ * @returns Solana lend pool withdraw widget component
729
+ */
730
+ declare function SolanaLendWithdrawWidget(props: SolanaLendWithdrawProps): _emotion_react_jsx_runtime.JSX.Element;
702
731
  /**
703
732
  * Lend pool supply widget props for Stellar pools
704
733
  * @typedef {Object} StellarLendSupplyWidgetProps
@@ -722,4 +751,4 @@ type SolanaEnableAutoRedemptionWidgetProps = SolanaEnableAutoRedemptionProps & G
722
751
  */
723
752
  declare function SolanaEnableAutoRedemptionWidget(props: SolanaEnableAutoRedemptionWidgetProps): _emotion_react_jsx_runtime.JSX.Element;
724
753
 
725
- export { AddRedemptionWidgetV2, AutoPaybackWidgetV2, CancelRedemptionWidgetV2, CreditLineApproveWidget, CreditLineBorrowWidget, CreditLineBorrowWidgetV2, CreditLinePaymentWidget, CreditLinePaymentWidgetV2, InvoiceFactoringBorrowWidget, InvoiceFactoringPaymentWidget, LendSupplyWidget, LendSupplyWidgetV2, LendWithdrawWidget, LendWithdrawWidgetV2, NotifiContextWrapper, ReceivableBackedCreditLineBorrowWidgetV2, ReceivableBackedCreditLinePaymentWidgetV2, SolanaBorrowWidget, SolanaEnableAutoRedemptionWidget, SolanaLendAddRedemptionWidget, SolanaLendCancelRedemptionWidget, SolanaLendSupplyWidget, SolanaPaymentWidget, StellarLendSupplyWidget, SuperfluidFactoringWidget, SupplyFirstLossCoverWidget };
754
+ export { AddRedemptionWidgetV2, AutoPaybackWidgetV2, CancelRedemptionWidgetV2, CreditLineApproveWidget, CreditLineBorrowWidget, CreditLineBorrowWidgetV2, CreditLinePaymentWidget, CreditLinePaymentWidgetV2, InvoiceFactoringBorrowWidget, InvoiceFactoringPaymentWidget, LendSupplyWidget, LendSupplyWidgetV2, LendWithdrawWidget, LendWithdrawWidgetV2, NotifiContextWrapper, ReceivableBackedCreditLineBorrowWidgetV2, ReceivableBackedCreditLinePaymentWidgetV2, SolanaBorrowWidget, SolanaEnableAutoRedemptionWidget, SolanaLendAddRedemptionWidget, SolanaLendCancelRedemptionWidget, SolanaLendSupplyWidget, SolanaLendWithdrawWidget, SolanaPaymentWidget, StellarLendSupplyWidget, SuperfluidFactoringWidget, SupplyFirstLossCoverWidget };