@huma-finance/widgets 0.0.62-beta.633 → 0.0.62-beta.635

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 (43) hide show
  1. package/API.md +195 -0
  2. package/dist/cjs/index.cjs +1871 -299
  3. package/dist/cjs/index.cjs.map +1 -1
  4. package/dist/index.d.ts +138 -2
  5. package/dist/index.js +1869 -302
  6. package/dist/index.js.map +1 -1
  7. package/package.json +18 -8
  8. package/src/components/CreditLine/paymentV2/1-ChooseAmount.tsx +1 -0
  9. package/src/components/CreditLine/solanaBorrow/1-ChooseAmount.tsx +67 -0
  10. package/src/components/CreditLine/solanaBorrow/2-Transfer.tsx +159 -0
  11. package/src/components/CreditLine/solanaBorrow/3-Done.tsx +38 -0
  12. package/src/components/CreditLine/solanaBorrow/index.tsx +93 -0
  13. package/src/components/CreditLine/solanaPayment/1-ChooseAmount.tsx +75 -0
  14. package/src/components/CreditLine/solanaPayment/2-Transfer.tsx +92 -0
  15. package/src/components/CreditLine/solanaPayment/3-Done.tsx +60 -0
  16. package/src/components/CreditLine/solanaPayment/index.tsx +86 -0
  17. package/src/components/InputAmountModal.tsx +13 -2
  18. package/src/components/Lend/{supplyV2/components → components}/PersonaEvaluation.tsx +19 -13
  19. package/src/components/Lend/{supplyV2/components → components}/SecuritizeEvaluation.tsx +7 -8
  20. package/src/components/Lend/solanaAddRedemption/1-ChooseTranche.tsx +114 -0
  21. package/src/components/Lend/solanaAddRedemption/2-ChooseAmount.tsx +183 -0
  22. package/src/components/Lend/solanaAddRedemption/3-Transfer.tsx +102 -0
  23. package/src/components/Lend/solanaAddRedemption/4-Done.tsx +29 -0
  24. package/src/components/Lend/solanaAddRedemption/index.tsx +155 -0
  25. package/src/components/Lend/solanaCancelRedemption/1-ChooseTranche.tsx +114 -0
  26. package/src/components/Lend/solanaCancelRedemption/2-Transfer.tsx +99 -0
  27. package/src/components/Lend/solanaCancelRedemption/3-Done.tsx +55 -0
  28. package/src/components/Lend/solanaCancelRedemption/index.tsx +162 -0
  29. package/src/components/Lend/solanaSupply/1-Evaluation.tsx +43 -0
  30. package/src/components/Lend/solanaSupply/2-ChooseTranche.tsx +116 -0
  31. package/src/components/Lend/solanaSupply/3-ChooseAmount.tsx +131 -0
  32. package/src/components/Lend/solanaSupply/4-Transfer.tsx +137 -0
  33. package/src/components/Lend/solanaSupply/5-Success.tsx +52 -0
  34. package/src/components/Lend/solanaSupply/index.tsx +155 -0
  35. package/src/components/Lend/supplyV2/2-Evaluation.tsx +4 -3
  36. package/src/components/Lend/supplyV2/6-Success.tsx +3 -3
  37. package/src/components/SolanaTxDoneModal.tsx +119 -0
  38. package/src/components/SolanaTxSendModal.tsx +61 -0
  39. package/src/components/SolanaViewOnExplorer.tsx +29 -0
  40. package/src/components/WidgetWrapper.tsx +6 -4
  41. package/src/index.tsx +139 -0
  42. package/src/store/widgets.reducers.ts +5 -0
  43. package/src/store/widgets.store.ts +1 -0
package/dist/index.d.ts CHANGED
@@ -1,8 +1,9 @@
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, IdentityVerificationStatusV2 } from '@huma-finance/shared';
4
+ import { POOL_NAME, POOL_TYPE, TrancheType, IdentityVerificationStatusV2, SolanaPoolInfo } from '@huma-finance/shared';
5
5
  import { BigNumberish, BigNumber } from 'ethers';
6
+ import { SolanaPoolState } from '@huma-finance/web-shared';
6
7
  import React from 'react';
7
8
 
8
9
  /**
@@ -264,6 +265,79 @@ type ReceivableBackedCreditLinePaymentPropsV2 = {
264
265
  handleSuccess?: (blockNumber?: number) => void;
265
266
  };
266
267
 
268
+ /**
269
+ * Lend pool supply props
270
+ * @typedef {Object} SolanaLendSupplyProps
271
+ * @property {SolanaPoolInfo} poolInfo The metadata of the pool.
272
+ * @property {SolanaPoolState} poolState The current state config of the pool.
273
+ * @property {boolean} pointsTestnetExperience If the user is in the testnet experience.
274
+ * @property {function():void} handleClose Function to notify to close the widget modal when user clicks the 'x' close button.
275
+ * @property {function():void|undefined} handleSuccess Optional function to notify that the lending pool supply action is successful.
276
+ */
277
+ interface SolanaLendSupplyProps {
278
+ poolInfo: SolanaPoolInfo;
279
+ poolState: SolanaPoolState;
280
+ pointsTestnetExperience: boolean;
281
+ handleClose: () => void;
282
+ handleSuccess?: () => void;
283
+ }
284
+
285
+ /**
286
+ * Lend pool supply props
287
+ * @typedef {Object} SolanaLendAddRedemptionProps
288
+ * @property {SolanaPoolInfo} poolInfo The metadata of the pool.
289
+ * @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.
290
+ * @property {POOL_NTrancheTypeAME} tranche The tranche type.
291
+ * @property {function():void|undefined} handleSuccess Optional function to notify that the lending pool supply action is successful.
292
+ */
293
+ interface SolanaLendAddRedemptionProps {
294
+ poolInfo: SolanaPoolInfo;
295
+ poolState: SolanaPoolState;
296
+ tranche?: TrancheType;
297
+ handleClose: () => void;
298
+ handleSuccess?: () => void;
299
+ }
300
+
301
+ /**
302
+ * Lend pool supply props
303
+ * @typedef {Object} SolanaLendCancelRedemptionProps
304
+ * @property {SolanaPoolInfo} poolInfo The metadata of the pool.
305
+ * @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.
306
+ * @property {function():void|undefined} handleSuccess Optional function to notify that the lending pool supply action is successful.
307
+ */
308
+ interface SolanaLendCancelRedemptionProps {
309
+ poolInfo: SolanaPoolInfo;
310
+ tranche?: TrancheType;
311
+ handleClose: () => void;
312
+ handleSuccess?: () => void;
313
+ }
314
+
315
+ /**
316
+ * Lend pool supply props
317
+ * @typedef {Object} SolanaBorrowProps
318
+ * @property {SolanaPoolInfo} poolInfo The metadata of the pool.
319
+ * @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.
320
+ * @property {function():void|undefined} handleSuccess Optional function to notify that the lending pool supply action is successful.
321
+ */
322
+ interface SolanaBorrowProps {
323
+ poolInfo: SolanaPoolInfo;
324
+ poolState: SolanaPoolState;
325
+ handleClose: () => void;
326
+ handleSuccess?: () => void;
327
+ }
328
+
329
+ /**
330
+ * Lend pool supply props
331
+ * @typedef {Object} SolanaPaymentProps
332
+ * @property {SolanaPoolInfo} poolInfo The metadata of the pool.
333
+ * @property {function():void|undefined} handleSuccess Optional function to notify that the lending pool supply action is successful.
334
+ */
335
+ interface SolanaPaymentProps {
336
+ poolInfo: SolanaPoolInfo;
337
+ handleClose: () => void;
338
+ handleSuccess?: () => void;
339
+ }
340
+
267
341
  type Props = {
268
342
  chainId: number | undefined;
269
343
  children?: any;
@@ -537,5 +611,67 @@ type ReceivableBackedCreditLinePaymentWidgetPropsV2 = ReceivableBackedCreditLine
537
611
  * @returns Receivable backed credit line pool payment widget component V2
538
612
  */
539
613
  declare function ReceivableBackedCreditLinePaymentWidgetV2(props: ReceivableBackedCreditLinePaymentWidgetPropsV2): _emotion_react_jsx_runtime.JSX.Element;
614
+ /**
615
+ * Object representing the props passed to Solana widgets
616
+ * @typedef {Object} SolanaWidgetProps
617
+ */
618
+ type SolanaWidgetProps = {
619
+ handleClose?: () => void;
620
+ };
621
+ /**
622
+ * Lend pool supply widget props for Solana pools
623
+ * @typedef {Object} SolanaLendSupplyWidgetProps
624
+ */
625
+ type SolanaLendSupplyWidgetProps = SolanaLendSupplyProps & SolanaWidgetProps;
626
+ /**
627
+ * Lend pool supply widget for Solana pools
628
+ *
629
+ * @param {SolanaLendSupplyWidgetProps} props - Widget props
630
+ */
631
+ declare function SolanaLendSupplyWidget(props: SolanaLendSupplyWidgetProps): _emotion_react_jsx_runtime.JSX.Element;
632
+ /**
633
+ * Lend pool supply widget props for Solana pools
634
+ * @typedef {Object} SolanaLendAddRedemptionWidgetProps
635
+ */
636
+ type SolanaLendAddRedemptionWidgetProps = SolanaLendAddRedemptionProps & SolanaWidgetProps;
637
+ /**
638
+ * Lend pool supply widget for Solana pools
639
+ *
640
+ * @param {SolanaLendAddRedemptionWidgetProps} props - Widget props
641
+ */
642
+ declare function SolanaLendAddRedemptionWidget(props: SolanaLendAddRedemptionWidgetProps): _emotion_react_jsx_runtime.JSX.Element;
643
+ /**
644
+ * Lend pool supply widget props for Solana pools
645
+ * @typedef {Object} SolanaLendCancelRedemptionWidgetProps
646
+ */
647
+ type SolanaLendCancelRedemptionWidgetProps = SolanaLendCancelRedemptionProps & SolanaWidgetProps;
648
+ /**
649
+ * Lend pool supply widget for Solana pools
650
+ *
651
+ * @param {SolanaLendCancelRedemptionWidgetProps} props - Widget props
652
+ */
653
+ declare function SolanaLendCancelRedemptionWidget(props: SolanaLendCancelRedemptionWidgetProps): _emotion_react_jsx_runtime.JSX.Element;
654
+ /**
655
+ * Lend pool supply widget props for Solana pools
656
+ * @typedef {Object} SolanaBorrowWidgetProps
657
+ */
658
+ type SolanaBorrowWidgetProps = SolanaBorrowProps & SolanaWidgetProps;
659
+ /**
660
+ * Lend pool supply widget for Solana pools
661
+ *
662
+ * @param {SolanaBorrowWidgetProps} props - Widget props
663
+ */
664
+ declare function SolanaBorrowWidget(props: SolanaBorrowWidgetProps): _emotion_react_jsx_runtime.JSX.Element;
665
+ /**
666
+ * Lend pool supply widget props for Solana pools
667
+ * @typedef {Object} SolanaPaymentWidgetProps
668
+ */
669
+ type SolanaPaymentWidgetProps = SolanaPaymentProps & SolanaWidgetProps;
670
+ /**
671
+ * Lend pool supply widget for Solana pools
672
+ *
673
+ * @param {SolanaPaymentWidgetProps} props - Widget props
674
+ */
675
+ declare function SolanaPaymentWidget(props: SolanaPaymentWidgetProps): _emotion_react_jsx_runtime.JSX.Element;
540
676
 
541
- export { AddRedemptionWidgetV2, AutoPaybackWidgetV2, CancelRedemptionWidgetV2, CreditLineApproveWidget, CreditLineBorrowWidget, CreditLineBorrowWidgetV2, CreditLinePaymentWidget, CreditLinePaymentWidgetV2, InvoiceFactoringBorrowWidget, InvoiceFactoringPaymentWidget, LendSupplyWidget, LendSupplyWidgetV2, LendWithdrawWidget, LendWithdrawWidgetV2, NotifiContextWrapper, ReceivableBackedCreditLineBorrowWidgetV2, ReceivableBackedCreditLinePaymentWidgetV2, SuperfluidFactoringWidget, SupplyFirstLossCoverWidget };
677
+ export { AddRedemptionWidgetV2, AutoPaybackWidgetV2, CancelRedemptionWidgetV2, CreditLineApproveWidget, CreditLineBorrowWidget, CreditLineBorrowWidgetV2, CreditLinePaymentWidget, CreditLinePaymentWidgetV2, InvoiceFactoringBorrowWidget, InvoiceFactoringPaymentWidget, LendSupplyWidget, LendSupplyWidgetV2, LendWithdrawWidget, LendWithdrawWidgetV2, NotifiContextWrapper, ReceivableBackedCreditLineBorrowWidgetV2, ReceivableBackedCreditLinePaymentWidgetV2, SolanaBorrowWidget, SolanaLendAddRedemptionWidget, SolanaLendCancelRedemptionWidget, SolanaLendSupplyWidget, SolanaPaymentWidget, SuperfluidFactoringWidget, SupplyFirstLossCoverWidget };