@huma-finance/widgets 0.0.62-beta.719 → 0.0.62-beta.721
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/API.md +41 -3
- package/dist/cjs/index.cjs +777 -316
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/index.d.ts +37 -11
- package/dist/index.js +780 -320
- package/dist/index.js.map +1 -1
- package/package.json +7 -9
- package/src/components/Lend/solanaEnableAutoRedemption/1-ApproveAllowance.tsx +6 -8
- package/src/components/Lend/solanaSupply/3-ChooseAmount.tsx +1 -1
- package/src/components/Lend/solanaSupply/4-Transfer.tsx +12 -13
- package/src/components/Lend/stellarSupply/1-Evaluation.tsx +9 -0
- package/src/components/Lend/stellarSupply/2-ChooseTranche.tsx +116 -0
- package/src/components/Lend/stellarSupply/3-ChooseAmount.tsx +129 -0
- package/src/components/Lend/stellarSupply/4-Transfer.tsx +69 -0
- package/src/components/Lend/stellarSupply/5-Success.tsx +61 -0
- package/src/components/Lend/stellarSupply/index.tsx +159 -0
- package/src/components/Lend/supplyV2/3-ChooseAmount.tsx +1 -1
- package/src/components/StellarTxDoneModal.tsx +119 -0
- package/src/components/StellarTxSendModal.tsx +43 -0
- package/src/components/StellarViewOnExplorer.tsx +29 -0
- package/src/index.tsx +44 -21
- package/src/store/widgets.reducers.ts +5 -0
- package/src/store/widgets.store.ts +1 -0
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +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, CloseModalOptions, SolanaPoolInfo } from '@huma-finance/shared';
|
|
4
|
+
import { POOL_NAME, POOL_TYPE, TrancheType, CloseModalOptions, SolanaPoolInfo, StellarPoolInfo } from '@huma-finance/shared';
|
|
5
5
|
import { BigNumberish, BigNumber } from 'ethers';
|
|
6
|
-
import { SolanaPoolState } from '@huma-finance/web-shared';
|
|
6
|
+
import { SolanaPoolState, StellarPoolState } from '@huma-finance/web-shared';
|
|
7
7
|
import React from 'react';
|
|
8
8
|
|
|
9
9
|
/**
|
|
@@ -338,6 +338,21 @@ interface SolanaPaymentProps {
|
|
|
338
338
|
handleSuccess?: () => void;
|
|
339
339
|
}
|
|
340
340
|
|
|
341
|
+
/**
|
|
342
|
+
* Lend pool supply props
|
|
343
|
+
* @typedef {Object} StellarLendSupplyProps
|
|
344
|
+
* @property {StellarPoolInfo} poolInfo The metadata of the pool.
|
|
345
|
+
* @property {StellarPoolState} poolState The current state config of the pool.
|
|
346
|
+
* @property {function((CloseModalOptions|undefined)):void} handleClose Function to notify to close the widget modal when user clicks the 'x' close button.
|
|
347
|
+
* @property {function():void|undefined} handleSuccess Optional function to notify that the lending pool supply action is successful.
|
|
348
|
+
*/
|
|
349
|
+
interface StellarLendSupplyProps {
|
|
350
|
+
poolInfo: StellarPoolInfo;
|
|
351
|
+
poolState: StellarPoolState;
|
|
352
|
+
handleClose: (options?: CloseModalOptions) => void;
|
|
353
|
+
handleSuccess?: () => void;
|
|
354
|
+
}
|
|
355
|
+
|
|
341
356
|
/**
|
|
342
357
|
* Lend pool supply props
|
|
343
358
|
* @typedef {Object} SolanaEnableAutoRedemptionProps
|
|
@@ -628,16 +643,16 @@ type ReceivableBackedCreditLinePaymentWidgetPropsV2 = ReceivableBackedCreditLine
|
|
|
628
643
|
declare function ReceivableBackedCreditLinePaymentWidgetV2(props: ReceivableBackedCreditLinePaymentWidgetPropsV2): _emotion_react_jsx_runtime.JSX.Element;
|
|
629
644
|
/**
|
|
630
645
|
* Object representing the props passed to Solana widgets
|
|
631
|
-
* @typedef {Object}
|
|
646
|
+
* @typedef {Object} GenericWidgetProps
|
|
632
647
|
*/
|
|
633
|
-
type
|
|
648
|
+
type GenericWidgetProps = {
|
|
634
649
|
handleClose?: () => void;
|
|
635
650
|
};
|
|
636
651
|
/**
|
|
637
652
|
* Lend pool supply widget props for Solana pools
|
|
638
653
|
* @typedef {Object} SolanaLendSupplyWidgetProps
|
|
639
654
|
*/
|
|
640
|
-
type SolanaLendSupplyWidgetProps = SolanaLendSupplyProps &
|
|
655
|
+
type SolanaLendSupplyWidgetProps = SolanaLendSupplyProps & GenericWidgetProps;
|
|
641
656
|
/**
|
|
642
657
|
* Lend pool supply widget for Solana pools
|
|
643
658
|
*
|
|
@@ -648,7 +663,7 @@ declare function SolanaLendSupplyWidget(props: SolanaLendSupplyWidgetProps): _em
|
|
|
648
663
|
* Lend pool supply widget props for Solana pools
|
|
649
664
|
* @typedef {Object} SolanaLendAddRedemptionWidgetProps
|
|
650
665
|
*/
|
|
651
|
-
type SolanaLendAddRedemptionWidgetProps = SolanaLendAddRedemptionProps &
|
|
666
|
+
type SolanaLendAddRedemptionWidgetProps = SolanaLendAddRedemptionProps & GenericWidgetProps;
|
|
652
667
|
/**
|
|
653
668
|
* Lend pool supply widget for Solana pools
|
|
654
669
|
*
|
|
@@ -659,7 +674,7 @@ declare function SolanaLendAddRedemptionWidget(props: SolanaLendAddRedemptionWid
|
|
|
659
674
|
* Lend pool supply widget props for Solana pools
|
|
660
675
|
* @typedef {Object} SolanaLendCancelRedemptionWidgetProps
|
|
661
676
|
*/
|
|
662
|
-
type SolanaLendCancelRedemptionWidgetProps = SolanaLendCancelRedemptionProps &
|
|
677
|
+
type SolanaLendCancelRedemptionWidgetProps = SolanaLendCancelRedemptionProps & GenericWidgetProps;
|
|
663
678
|
/**
|
|
664
679
|
* Lend pool supply widget for Solana pools
|
|
665
680
|
*
|
|
@@ -670,7 +685,7 @@ declare function SolanaLendCancelRedemptionWidget(props: SolanaLendCancelRedempt
|
|
|
670
685
|
* Lend pool supply widget props for Solana pools
|
|
671
686
|
* @typedef {Object} SolanaBorrowWidgetProps
|
|
672
687
|
*/
|
|
673
|
-
type SolanaBorrowWidgetProps = SolanaBorrowProps &
|
|
688
|
+
type SolanaBorrowWidgetProps = SolanaBorrowProps & GenericWidgetProps;
|
|
674
689
|
/**
|
|
675
690
|
* Lend pool supply widget for Solana pools
|
|
676
691
|
*
|
|
@@ -681,18 +696,29 @@ declare function SolanaBorrowWidget(props: SolanaBorrowWidgetProps): _emotion_re
|
|
|
681
696
|
* Lend pool supply widget props for Solana pools
|
|
682
697
|
* @typedef {Object} SolanaPaymentWidgetProps
|
|
683
698
|
*/
|
|
684
|
-
type SolanaPaymentWidgetProps = SolanaPaymentProps &
|
|
699
|
+
type SolanaPaymentWidgetProps = SolanaPaymentProps & GenericWidgetProps;
|
|
685
700
|
/**
|
|
686
701
|
* Lend pool supply widget for Solana pools
|
|
687
702
|
*
|
|
688
703
|
* @param {SolanaPaymentWidgetProps} props - Widget props
|
|
689
704
|
*/
|
|
690
705
|
declare function SolanaPaymentWidget(props: SolanaPaymentWidgetProps): _emotion_react_jsx_runtime.JSX.Element;
|
|
706
|
+
/**
|
|
707
|
+
* Lend pool supply widget props for Stellar pools
|
|
708
|
+
* @typedef {Object} StellarLendSupplyWidgetProps
|
|
709
|
+
*/
|
|
710
|
+
type StellarLendSupplyWidgetProps = StellarLendSupplyProps & GenericWidgetProps;
|
|
711
|
+
/**
|
|
712
|
+
* Lend pool supply widget for Stellar pools
|
|
713
|
+
*
|
|
714
|
+
* @param {StellarLendSupplyWidgetProps} props - Widget props
|
|
715
|
+
*/
|
|
716
|
+
declare function StellarLendSupplyWidget(props: StellarLendSupplyWidgetProps): _emotion_react_jsx_runtime.JSX.Element;
|
|
691
717
|
/**
|
|
692
718
|
* Lend pool supply widget props for Solana pools
|
|
693
719
|
* @typedef {Object} SolanaEnableAutoRedemptionWidgetProps
|
|
694
720
|
*/
|
|
695
|
-
type SolanaEnableAutoRedemptionWidgetProps = SolanaEnableAutoRedemptionProps &
|
|
721
|
+
type SolanaEnableAutoRedemptionWidgetProps = SolanaEnableAutoRedemptionProps & GenericWidgetProps;
|
|
696
722
|
/**
|
|
697
723
|
* Lend pool supply widget for Solana pools
|
|
698
724
|
*
|
|
@@ -700,4 +726,4 @@ type SolanaEnableAutoRedemptionWidgetProps = SolanaEnableAutoRedemptionProps & S
|
|
|
700
726
|
*/
|
|
701
727
|
declare function SolanaEnableAutoRedemptionWidget(props: SolanaEnableAutoRedemptionWidgetProps): _emotion_react_jsx_runtime.JSX.Element;
|
|
702
728
|
|
|
703
|
-
export { AddRedemptionWidgetV2, AutoPaybackWidgetV2, CancelRedemptionWidgetV2, CreditLineApproveWidget, CreditLineBorrowWidget, CreditLineBorrowWidgetV2, CreditLinePaymentWidget, CreditLinePaymentWidgetV2, InvoiceFactoringBorrowWidget, InvoiceFactoringPaymentWidget, LendSupplyWidget, LendSupplyWidgetV2, LendWithdrawWidget, LendWithdrawWidgetV2, NotifiContextWrapper, ReceivableBackedCreditLineBorrowWidgetV2, ReceivableBackedCreditLinePaymentWidgetV2, SolanaBorrowWidget, SolanaEnableAutoRedemptionWidget, SolanaLendAddRedemptionWidget, SolanaLendCancelRedemptionWidget, SolanaLendSupplyWidget, SolanaPaymentWidget, SuperfluidFactoringWidget, SupplyFirstLossCoverWidget };
|
|
729
|
+
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 };
|