@huma-finance/widgets 0.0.62-beta.597 → 0.0.62-beta.611
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 +185 -0
- package/dist/cjs/index.cjs +1490 -268
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/index.d.ts +117 -2
- package/dist/index.js +1489 -271
- package/dist/index.js.map +1 -1
- package/package.json +11 -6
- package/src/components/CreditLine/solanaBorrow/1-ChooseAmount.tsx +86 -0
- package/src/components/CreditLine/solanaBorrow/2-ApproveAllowance.tsx +87 -0
- package/src/components/CreditLine/solanaBorrow/index.tsx +96 -0
- package/src/components/InputAmountModal.tsx +12 -2
- package/src/components/Lend/solanaAddRedemption/1-ChooseTranche.tsx +114 -0
- package/src/components/Lend/solanaAddRedemption/2-ChooseAmount.tsx +183 -0
- package/src/components/Lend/solanaAddRedemption/3-Transfer.tsx +102 -0
- package/src/components/Lend/solanaAddRedemption/4-Done.tsx +29 -0
- package/src/components/Lend/solanaAddRedemption/index.tsx +140 -0
- package/src/components/Lend/solanaCancelRedemption/1-ChooseTranche.tsx +114 -0
- package/src/components/Lend/solanaCancelRedemption/2-Transfer.tsx +99 -0
- package/src/components/Lend/solanaCancelRedemption/3-Done.tsx +55 -0
- package/src/components/Lend/solanaCancelRedemption/index.tsx +152 -0
- package/src/components/Lend/solanaSupply/1-ChooseTranche.tsx +116 -0
- package/src/components/Lend/solanaSupply/2-Evaluation.tsx +0 -0
- package/src/components/Lend/solanaSupply/3-ChooseAmount.tsx +130 -0
- package/src/components/Lend/solanaSupply/4-Transfer.tsx +89 -0
- package/src/components/Lend/solanaSupply/5-Success.tsx +50 -0
- package/src/components/Lend/solanaSupply/index.tsx +143 -0
- package/src/components/SolanaTxDoneModal.tsx +115 -0
- package/src/components/SolanaTxSendModal.tsx +61 -0
- package/src/components/SolanaViewOnExplorer.tsx +29 -0
- package/src/components/WidgetWrapper.tsx +6 -4
- package/src/index.tsx +124 -0
- package/src/store/widgets.reducers.ts +5 -0
- 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
|
|
|
7
8
|
/**
|
|
8
9
|
* Credit line pool approve allowance props
|
|
@@ -263,6 +264,61 @@ type ReceivableBackedCreditLinePaymentPropsV2 = {
|
|
|
263
264
|
handleSuccess?: (blockNumber?: number) => void;
|
|
264
265
|
};
|
|
265
266
|
|
|
267
|
+
/**
|
|
268
|
+
* Lend pool supply props
|
|
269
|
+
* @typedef {Object} SolanaLendSupplyProps
|
|
270
|
+
* @property {SolanaPoolInfo} poolInfo The metadata of the pool.
|
|
271
|
+
* @property {SolanaPoolState} poolState The current state config of the pool.
|
|
272
|
+
* @property {function():void} handleClose Function to notify to close the widget modal when user clicks the 'x' close button.
|
|
273
|
+
* @property {function():void|undefined} handleSuccess Optional function to notify that the lending pool supply action is successful.
|
|
274
|
+
*/
|
|
275
|
+
interface SolanaLendSupplyProps {
|
|
276
|
+
poolInfo: SolanaPoolInfo;
|
|
277
|
+
poolState: SolanaPoolState;
|
|
278
|
+
handleClose: () => void;
|
|
279
|
+
handleSuccess?: () => void;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
/**
|
|
283
|
+
* Lend pool supply props
|
|
284
|
+
* @typedef {Object} SolanaLendAddRedemptionProps
|
|
285
|
+
* @property {SolanaPoolInfo} poolInfo The metadata of the pool.
|
|
286
|
+
* @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.
|
|
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
|
+
handleClose: () => void;
|
|
293
|
+
handleSuccess?: () => void;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
/**
|
|
297
|
+
* Lend pool supply props
|
|
298
|
+
* @typedef {Object} SolanaLendCancelRedemptionProps
|
|
299
|
+
* @property {SolanaPoolInfo} poolInfo The metadata of the pool.
|
|
300
|
+
* @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.
|
|
301
|
+
* @property {function():void|undefined} handleSuccess Optional function to notify that the lending pool supply action is successful.
|
|
302
|
+
*/
|
|
303
|
+
interface SolanaLendCancelRedemptionProps {
|
|
304
|
+
poolInfo: SolanaPoolInfo;
|
|
305
|
+
handleClose: () => void;
|
|
306
|
+
handleSuccess?: () => void;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
/**
|
|
310
|
+
* Lend pool supply props
|
|
311
|
+
* @typedef {Object} SolanaBorrowProps
|
|
312
|
+
* @property {SolanaPoolInfo} poolInfo The metadata of the pool.
|
|
313
|
+
* @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.
|
|
314
|
+
* @property {function():void|undefined} handleSuccess Optional function to notify that the lending pool supply action is successful.
|
|
315
|
+
*/
|
|
316
|
+
interface SolanaBorrowProps {
|
|
317
|
+
poolInfo: SolanaPoolInfo;
|
|
318
|
+
handleClose: () => void;
|
|
319
|
+
handleSuccess?: () => void;
|
|
320
|
+
}
|
|
321
|
+
|
|
266
322
|
/**
|
|
267
323
|
* Mapping of your JSON-RPC connections indexed by chainId
|
|
268
324
|
* @typedef {Object} JsonRpcConnectionMap
|
|
@@ -530,5 +586,64 @@ type ReceivableBackedCreditLinePaymentWidgetPropsV2 = ReceivableBackedCreditLine
|
|
|
530
586
|
* @returns Receivable backed credit line pool payment widget component V2
|
|
531
587
|
*/
|
|
532
588
|
declare function ReceivableBackedCreditLinePaymentWidgetV2(props: ReceivableBackedCreditLinePaymentWidgetPropsV2): _emotion_react_jsx_runtime.JSX.Element;
|
|
589
|
+
/**
|
|
590
|
+
* Object representing the props passed to Solana widgets
|
|
591
|
+
* @typedef {Object} SolanaWidgetProps
|
|
592
|
+
*/
|
|
593
|
+
type SolanaWidgetProps = {
|
|
594
|
+
handleClose?: () => void;
|
|
595
|
+
};
|
|
596
|
+
/**
|
|
597
|
+
* Lend pool supply widget props for Solana pools
|
|
598
|
+
* @typedef {Object} SolanaLendSupplyWidgetProps
|
|
599
|
+
* @property {SolanaLendSupplyProps} SolanaLendSupplyProps - Specific widget props
|
|
600
|
+
* @property {SolanaWidgetProps} SolanaWidgetProps - Widget general props.
|
|
601
|
+
*/
|
|
602
|
+
type SolanaLendSupplyWidgetProps = SolanaLendSupplyProps & SolanaWidgetProps;
|
|
603
|
+
/**
|
|
604
|
+
* Lend pool supply widget for Solana pools
|
|
605
|
+
*
|
|
606
|
+
* @param {SolanaLendSupplyWidgetProps} props - Widget props
|
|
607
|
+
*/
|
|
608
|
+
declare function SolanaLendSupplyWidget(props: SolanaLendSupplyWidgetProps): _emotion_react_jsx_runtime.JSX.Element;
|
|
609
|
+
/**
|
|
610
|
+
* Lend pool supply widget props for Solana pools
|
|
611
|
+
* @typedef {Object} SolanaLendAddRedemptionWidgetProps
|
|
612
|
+
* @property {SolanaLendSupplyProps} SolanaLendSupplyProps - Specific widget props
|
|
613
|
+
* @property {SolanaWidgetProps} SolanaWidgetProps - Widget general props.
|
|
614
|
+
*/
|
|
615
|
+
type SolanaLendAddRedemptionWidgetProps = SolanaLendAddRedemptionProps & SolanaWidgetProps;
|
|
616
|
+
/**
|
|
617
|
+
* Lend pool supply widget for Solana pools
|
|
618
|
+
*
|
|
619
|
+
* @param {SolanaLendAddRedemptionWidgetProps} props - Widget props
|
|
620
|
+
*/
|
|
621
|
+
declare function SolanaLendAddRedemptionWidget(props: SolanaLendAddRedemptionWidgetProps): _emotion_react_jsx_runtime.JSX.Element;
|
|
622
|
+
/**
|
|
623
|
+
* Lend pool supply widget props for Solana pools
|
|
624
|
+
* @typedef {Object} SolanaLendCancelRedemptionWidgetProps
|
|
625
|
+
* @property {SolanaLendSupplyProps} SolanaLendSupplyProps - Specific widget props
|
|
626
|
+
* @property {SolanaWidgetProps} SolanaWidgetProps - Widget general props.
|
|
627
|
+
*/
|
|
628
|
+
type SolanaLendCancelRedemptionWidgetProps = SolanaLendCancelRedemptionProps & SolanaWidgetProps;
|
|
629
|
+
/**
|
|
630
|
+
* Lend pool supply widget for Solana pools
|
|
631
|
+
*
|
|
632
|
+
* @param {SolanaLendCancelRedemptionWidgetProps} props - Widget props
|
|
633
|
+
*/
|
|
634
|
+
declare function SolanaLendCancelRedemptionWidget(props: SolanaLendCancelRedemptionWidgetProps): _emotion_react_jsx_runtime.JSX.Element;
|
|
635
|
+
/**
|
|
636
|
+
* Lend pool supply widget props for Solana pools
|
|
637
|
+
* @typedef {Object} SolanaBorrowWidgetProps
|
|
638
|
+
* @property {SolanaLendSupplyProps} SolanaLendSupplyProps - Specific widget props
|
|
639
|
+
* @property {SolanaWidgetProps} SolanaWidgetProps - Widget general props.
|
|
640
|
+
*/
|
|
641
|
+
type SolanaBorrowWidgetProps = SolanaBorrowProps & SolanaWidgetProps;
|
|
642
|
+
/**
|
|
643
|
+
* Lend pool supply widget for Solana pools
|
|
644
|
+
*
|
|
645
|
+
* @param {SolanaBorrowWidgetProps} props - Widget props
|
|
646
|
+
*/
|
|
647
|
+
declare function SolanaBorrowWidget(props: SolanaBorrowWidgetProps): _emotion_react_jsx_runtime.JSX.Element;
|
|
533
648
|
|
|
534
|
-
export { AddRedemptionWidgetV2, AutoPaybackWidgetV2, CancelRedemptionWidgetV2, CreditLineApproveWidget, CreditLineBorrowWidget, CreditLineBorrowWidgetV2, CreditLinePaymentWidget, CreditLinePaymentWidgetV2, InvoiceFactoringBorrowWidget, InvoiceFactoringPaymentWidget, LendSupplyWidget, LendSupplyWidgetV2, LendWithdrawWidget, LendWithdrawWidgetV2, ReceivableBackedCreditLineBorrowWidgetV2, ReceivableBackedCreditLinePaymentWidgetV2, SuperfluidFactoringWidget, SupplyFirstLossCoverWidget };
|
|
649
|
+
export { AddRedemptionWidgetV2, AutoPaybackWidgetV2, CancelRedemptionWidgetV2, CreditLineApproveWidget, CreditLineBorrowWidget, CreditLineBorrowWidgetV2, CreditLinePaymentWidget, CreditLinePaymentWidgetV2, InvoiceFactoringBorrowWidget, InvoiceFactoringPaymentWidget, LendSupplyWidget, LendSupplyWidgetV2, LendWithdrawWidget, LendWithdrawWidgetV2, ReceivableBackedCreditLineBorrowWidgetV2, ReceivableBackedCreditLinePaymentWidgetV2, SolanaBorrowWidget, SolanaLendAddRedemptionWidget, SolanaLendCancelRedemptionWidget, SolanaLendSupplyWidget, SuperfluidFactoringWidget, SupplyFirstLossCoverWidget };
|