@huma-finance/widgets 0.0.59-beta.511 → 0.0.59-beta.517
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/cjs/index.cjs +135 -134
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/index.js +4 -3
- package/dist/index.js.map +1 -1
- package/package.json +5 -4
- package/src/components/Activity.tsx +1 -1
- package/src/components/ApproveAllowanceModal.tsx +2 -3
- package/src/components/ApproveAllowanceModalV2.tsx +1 -3
- package/src/components/ChooseAmountModal.tsx +1 -1
- package/src/components/CreditLine/approve/2-Success.tsx +1 -1
- package/src/components/CreditLine/approve/index.tsx +2 -6
- package/src/components/CreditLine/autoPaybackV2/index.tsx +2 -2
- package/src/components/CreditLine/borrow/2-ChooseAmount.tsx +2 -6
- package/src/components/CreditLine/borrow/4-Transfer.tsx +2 -1
- package/src/components/CreditLine/borrow/index.tsx +2 -7
- package/src/components/CreditLine/borrowV2/1-ChooseAmount.tsx +1 -1
- package/src/components/CreditLine/borrowV2/3-Transfer.tsx +2 -1
- package/src/components/CreditLine/borrowV2/index.tsx +2 -3
- package/src/components/CreditLine/payment/1-ChooseAmount.tsx +2 -6
- package/src/components/CreditLine/payment/4-Success.tsx +1 -1
- package/src/components/CreditLine/payment/index.tsx +2 -6
- package/src/components/CreditLine/paymentV2/1-ChooseAmount.tsx +1 -1
- package/src/components/CreditLine/paymentV2/3-Transfer.tsx +1 -1
- package/src/components/CreditLine/paymentV2/4-Success.tsx +1 -1
- package/src/components/CreditLine/paymentV2/index.tsx +2 -2
- package/src/components/CreditLine/supplyFLC/2-Transfer.tsx +2 -5
- package/src/components/CreditLine/supplyFLC/index.tsx +2 -3
- package/src/components/ErrorModal.tsx +1 -1
- package/src/components/Factoring/FactoredList.tsx +1 -2
- package/src/components/Factoring/UpcomingList.tsx +1 -1
- package/src/components/InvoiceFactoring/borrow/2-ChooseAmount.tsx +2 -1
- package/src/components/InvoiceFactoring/borrow/4-ApproveNFT.tsx +2 -3
- package/src/components/InvoiceFactoring/borrow/index.tsx +2 -6
- package/src/components/InvoiceFactoring/payment/1-ChooseAmount.tsx +1 -1
- package/src/components/InvoiceFactoring/payment/index.tsx +2 -6
- package/src/components/Lend/addRedemptionV2/2-ChooseAmount.tsx +3 -1
- package/src/components/Lend/addRedemptionV2/3-Transfer.tsx +2 -5
- package/src/components/Lend/addRedemptionV2/index.tsx +3 -1
- package/src/components/Lend/cancelRedemptionV2 /1-Transfer.tsx +2 -5
- package/src/components/Lend/cancelRedemptionV2 /index.tsx +2 -3
- package/src/components/Lend/supply/1-Evaluation/EvaluationKYC.tsx +1 -2
- package/src/components/Lend/supply/5-Success.tsx +1 -1
- package/src/components/Lend/supply/index.tsx +2 -4
- package/src/components/Lend/supplyV2/3-ChooseAmount.tsx +4 -2
- package/src/components/Lend/supplyV2/5-Transfer.tsx +1 -1
- package/src/components/Lend/supplyV2/6-Success.tsx +2 -2
- package/src/components/Lend/supplyV2/8-PointsEarned.tsx +2 -6
- package/src/components/Lend/supplyV2/components/PersonaEvaluation.tsx +1 -1
- package/src/components/Lend/supplyV2/components/SecuritizeEvaluation.tsx +1 -2
- package/src/components/Lend/supplyV2/index.tsx +3 -5
- package/src/components/Lend/withdraw/1-CheckWithdrawble.tsx +2 -4
- package/src/components/Lend/withdraw/4-Success.tsx +1 -1
- package/src/components/Lend/withdraw/index.tsx +2 -3
- package/src/components/Lend/withdrawV2/2-Transfer.tsx +2 -5
- package/src/components/Lend/withdrawV2/index.tsx +3 -1
- package/src/components/Notifi/NotifiSubscriptionModal.tsx +2 -1
- package/src/components/ReceivableBackedCreditLine/borrow/1-ChooseAmount.tsx +3 -1
- package/src/components/ReceivableBackedCreditLine/borrow/3-ApproveReceivable.tsx +2 -3
- package/src/components/ReceivableBackedCreditLine/borrow/index.tsx +2 -3
- package/src/components/ReceivableBackedCreditLine/payment/2-ChooseAmount.tsx +1 -1
- package/src/components/ReceivableBackedCreditLine/payment/5-ApproveReceivable.tsx +2 -3
- package/src/components/ReceivableBackedCreditLine/payment/index.tsx +2 -2
- package/src/components/StreamFactoring/borrow/2-ChooseAmount.tsx +1 -1
- package/src/components/StreamFactoring/borrow/5-Permit.tsx +1 -2
- package/src/components/StreamFactoring/borrow/6-Transfer.tsx +2 -1
- package/src/components/StreamFactoring/borrow/index.tsx +2 -1
- package/src/components/StreamFactoring/payment/index.tsx +5 -2
- package/src/components/SuperfluidFactoring/index.tsx +1 -1
- package/src/components/TxDoneModal.tsx +1 -1
- package/src/components/TxSendModal.tsx +2 -7
- package/src/components/TxSendModalV2.tsx +2 -1
- package/src/components/WidgetWrapper.tsx +2 -1
- package/src/components/humaModal/HumaModal.tsx +1 -1
- package/src/hooks/useEA.ts +1 -1
- package/src/index.tsx +1 -1
- package/tsconfig.json +3 -0
package/dist/cjs/index.cjs
CHANGED
|
@@ -3,11 +3,12 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var providers = require('@ethersproject/providers');
|
|
6
|
-
var
|
|
6
|
+
var webShared = require('@huma-finance/web-shared');
|
|
7
7
|
var material = require('@mui/material');
|
|
8
8
|
var jotai = require('jotai');
|
|
9
9
|
var React = require('react');
|
|
10
10
|
var reactRedux = require('react-redux');
|
|
11
|
+
var shared = require('@huma-finance/shared');
|
|
11
12
|
var core = require('@web3-react/core');
|
|
12
13
|
var ErrorOutlineIcon = require('@mui/icons-material/ErrorOutline');
|
|
13
14
|
var utils = require('jotai/utils');
|
|
@@ -269,7 +270,7 @@ function ErrorModal(_ref) {
|
|
|
269
270
|
} = _ref;
|
|
270
271
|
const theme = material.useTheme();
|
|
271
272
|
const dispatch = useAppDispatch();
|
|
272
|
-
const reset = utils.useResetAtom(
|
|
273
|
+
const reset = utils.useResetAtom(webShared.txAtom);
|
|
273
274
|
if (!errorReason) {
|
|
274
275
|
errorReason = 'Oops! Something went wrong';
|
|
275
276
|
}
|
|
@@ -343,9 +344,9 @@ function HumaModal(_ref) {
|
|
|
343
344
|
} = _ref;
|
|
344
345
|
const {
|
|
345
346
|
isXsSize
|
|
346
|
-
} =
|
|
347
|
+
} = webShared.useMQ();
|
|
347
348
|
const styles = {
|
|
348
|
-
wrapper: /*#__PURE__*/react.css("max-width:100vw;width:", isXsSize ? '100%' : width, ";height:auto;padding:", padding, ";box-sizing:border-box;" + (process.env.NODE_ENV === "production" ? "" : ";label:wrapper;"), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
349
|
+
wrapper: /*#__PURE__*/react.css("max-width:100vw;width:", isXsSize ? '100%' : width, ";height:auto;padding:", padding, ";box-sizing:border-box;" + (process.env.NODE_ENV === "production" ? "" : ";label:wrapper;"), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkh1bWFNb2RhbC50c3giXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBNkJnQiIsImZpbGUiOiJIdW1hTW9kYWwudHN4Iiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgY3NzIH0gZnJvbSAnQGVtb3Rpb24vcmVhY3QnXG5pbXBvcnQgeyBEaWFsb2cgfSBmcm9tICdAbXVpL21hdGVyaWFsJ1xuaW1wb3J0IHsgdXNlTVEgfSBmcm9tICdAaHVtYS1maW5hbmNlL3dlYi1zaGFyZWQnXG5pbXBvcnQgUmVhY3QgZnJvbSAncmVhY3QnXG5cbnR5cGUgSHVtYU1vZGFsVHlwZSA9IHtcbiAgY2hpbGRyZW4/OiBSZWFjdC5SZWFjdE5vZGVcbiAgaXNPcGVuOiBib29sZWFuXG4gIG9uQ2xvc2U6ICgpID0+IHZvaWRcbiAgb3ZlcmZsb3c/OiBzdHJpbmdcbiAgb3ZlcmZsb3dZPzogJ3Zpc2libGUnIHwgJ2hpZGRlbicgfCAnY2xpcCcgfCAnc2Nyb2xsJyB8ICdhdXRvJ1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ICBtYXhXaWR0aD17ZmFsc2V9XG4gICAgICBmdWxsU2NyZWVuPXtpc1hzU2l6ZX1cbiAgICAgIG9wZW49e2lzT3Blbn1cbiAgICAgIFBhcGVyUHJvcHM9e3tcbiAgICAgICAgc3R5bGU6IHtcbiAgICAgICAgICBib3JkZXI6ICcxcHggc29saWQgIzIwMjAyMCcsXG4gICAgICAgICAgYmFja2dyb3VuZDogJ3JnYmEoMjU1LCAyNTUsIDI1NSwgMC4wNSknLFxuICAgICAgICAgIGJhY2tkcm9wRmlsdGVyOiAnYmx1cig1MHB4KScsXG4gICAgICAgICAgYm9yZGVyUmFkaXVzOiAnMTZweCcsXG4gICAgICAgICAgb3ZlcmZsb3c6IG92ZXJmbG93IHx8ICdpbmhlcml0JyxcbiAgICAgICAgICBvdmVyZmxvd1k6IG92ZXJmbG93WSB8fCAnaW5oZXJpdCcsXG4gICAgICAgIH0sXG4gICAgICB9fVxuICAgICAgb25DbG9zZT17KGV2ZW50LCByZWFzb24pID0+IGhhbmRsZUNsb3NlKHJlYXNvbil9XG4gICAgPlxuICAgICAgPGRpdiBjc3M9e3N0eWxlcy53cmFwcGVyfT57Y2hpbGRyZW59PC9kaXY+XG4gICAgPC9EaWFsb2c+XG4gIClcbn1cbiJdfQ== */")
|
|
349
350
|
};
|
|
350
351
|
const handleClose = reason => {
|
|
351
352
|
if (!disableBackdropClick) {
|
|
@@ -1740,8 +1741,8 @@ function WidgetWrapper(_ref) {
|
|
|
1740
1741
|
state,
|
|
1741
1742
|
failReason,
|
|
1742
1743
|
txReceipt
|
|
1743
|
-
}] = jotai.useAtom(
|
|
1744
|
-
const reset = utils.useResetAtom(
|
|
1744
|
+
}] = jotai.useAtom(webShared.sendTxAtom);
|
|
1745
|
+
const reset = utils.useResetAtom(webShared.txAtom);
|
|
1745
1746
|
React.useEffect(() => {
|
|
1746
1747
|
if (shared.isTxFailed(state) && failReason) {
|
|
1747
1748
|
dispatch(setError({
|
|
@@ -1845,12 +1846,12 @@ function ApproveAllowanceModal(_ref) {
|
|
|
1845
1846
|
const {
|
|
1846
1847
|
symbol
|
|
1847
1848
|
} = poolUnderlyingToken;
|
|
1848
|
-
const poolUnderlyingTokenContract =
|
|
1849
|
-
const reset = utils.useResetAtom(
|
|
1849
|
+
const poolUnderlyingTokenContract = webShared.usePoolUnderlyingTokenContract(poolInfo.poolName, poolInfo.poolType, chainId, provider);
|
|
1850
|
+
const reset = utils.useResetAtom(webShared.txAtom);
|
|
1850
1851
|
const [{
|
|
1851
1852
|
state,
|
|
1852
1853
|
txHash
|
|
1853
|
-
}, send] = jotai.useAtom(
|
|
1854
|
+
}, send] = jotai.useAtom(webShared.sendTxAtom);
|
|
1854
1855
|
const waitingForAccept = state === shared.TxStateType.New;
|
|
1855
1856
|
React.useEffect(() => {
|
|
1856
1857
|
if (state === shared.TxStateType.Success) {
|
|
@@ -1880,7 +1881,7 @@ function ApproveAllowanceModal(_ref) {
|
|
|
1880
1881
|
provider
|
|
1881
1882
|
});
|
|
1882
1883
|
}, [account, allowanceAmount, handleSuccess, poolInfo.pool, poolUnderlyingTokenContract, provider, send, spender]);
|
|
1883
|
-
|
|
1884
|
+
webShared.useMount(() => {
|
|
1884
1885
|
if (!showAutoPayback) {
|
|
1885
1886
|
sendIncreaseAllowance();
|
|
1886
1887
|
}
|
|
@@ -1942,7 +1943,7 @@ function TxDoneModal(_ref) {
|
|
|
1942
1943
|
} = _ref;
|
|
1943
1944
|
const theme = material.useTheme();
|
|
1944
1945
|
const dispatch = useAppDispatch();
|
|
1945
|
-
const reset = utils.useResetAtom(
|
|
1946
|
+
const reset = utils.useResetAtom(webShared.txAtom);
|
|
1946
1947
|
const styles = {
|
|
1947
1948
|
wrapper: material.css(_templateObject$m || (_templateObject$m = _taggedTemplateLiteral(["\n height: 518px;\n position: relative;\n "]))),
|
|
1948
1949
|
header: material.css(_templateObject2$k || (_templateObject2$k = _taggedTemplateLiteral(["\n ", ";\n margin-top: ", ";\n "])), theme.cssMixins.rowHCentered, theme.spacing(-0.5)),
|
|
@@ -2002,7 +2003,7 @@ function Success$e(_ref) {
|
|
|
2002
2003
|
} = poolInfo.poolUnderlyingToken;
|
|
2003
2004
|
const [{
|
|
2004
2005
|
txReceipt
|
|
2005
|
-
}] = jotai.useAtom(
|
|
2006
|
+
}] = jotai.useAtom(webShared.sendTxAtom);
|
|
2006
2007
|
const [approvedAmount, setApprovedAmount] = React.useState();
|
|
2007
2008
|
React.useEffect(() => {
|
|
2008
2009
|
if (txReceipt) {
|
|
@@ -2035,12 +2036,12 @@ function CreditLineApprove(_ref) {
|
|
|
2035
2036
|
} = core.useWeb3React();
|
|
2036
2037
|
const poolName = shared.POOL_NAME[poolNameStr];
|
|
2037
2038
|
const poolType = shared.POOL_TYPE[poolTypeStr];
|
|
2038
|
-
const poolInfo =
|
|
2039
|
+
const poolInfo = webShared.usePoolInfo(poolName, poolType, chainId);
|
|
2039
2040
|
const {
|
|
2040
2041
|
step,
|
|
2041
2042
|
errorMessage
|
|
2042
2043
|
} = useAppSelector(selectWidgetState);
|
|
2043
|
-
const [accountStats] =
|
|
2044
|
+
const [accountStats] = webShared.useAccountStats(poolName, poolType, chainId, account, provider);
|
|
2044
2045
|
const {
|
|
2045
2046
|
creditRecord
|
|
2046
2047
|
} = accountStats;
|
|
@@ -2086,11 +2087,11 @@ function ApproveAllowanceModalV2(_ref) {
|
|
|
2086
2087
|
provider,
|
|
2087
2088
|
account
|
|
2088
2089
|
} = core.useWeb3React();
|
|
2089
|
-
const reset = utils.useResetAtom(
|
|
2090
|
+
const reset = utils.useResetAtom(webShared.txAtom);
|
|
2090
2091
|
const [{
|
|
2091
2092
|
state,
|
|
2092
2093
|
txHash
|
|
2093
|
-
}, send] = jotai.useAtom(
|
|
2094
|
+
}, send] = jotai.useAtom(webShared.sendTxAtom);
|
|
2094
2095
|
const waitingForAccept = state === shared.TxStateType.New;
|
|
2095
2096
|
const {
|
|
2096
2097
|
symbol,
|
|
@@ -2121,7 +2122,7 @@ function ApproveAllowanceModalV2(_ref) {
|
|
|
2121
2122
|
provider
|
|
2122
2123
|
});
|
|
2123
2124
|
}, [account, address, allowanceAmount, poolInfo.pool, provider, send, spender]);
|
|
2124
|
-
|
|
2125
|
+
webShared.useMount(() => {
|
|
2125
2126
|
if (!showAutoPayback) {
|
|
2126
2127
|
sendIncreaseAllowance();
|
|
2127
2128
|
}
|
|
@@ -2197,15 +2198,15 @@ function AutoPaybackV2(_ref) {
|
|
|
2197
2198
|
chainId,
|
|
2198
2199
|
provider
|
|
2199
2200
|
} = core.useWeb3React();
|
|
2200
|
-
const poolInfo =
|
|
2201
|
-
const poolUnderlyingToken =
|
|
2201
|
+
const poolInfo = webShared.usePoolInfoV2(poolName, chainId);
|
|
2202
|
+
const poolUnderlyingToken = webShared.usePoolUnderlyingTokenInfoV2(poolName, provider);
|
|
2202
2203
|
const {
|
|
2203
2204
|
step,
|
|
2204
2205
|
errorMessage
|
|
2205
2206
|
} = useAppSelector(selectWidgetState);
|
|
2206
2207
|
const {
|
|
2207
2208
|
autopayEnabled
|
|
2208
|
-
} =
|
|
2209
|
+
} = webShared.usePoolSafeAllowanceV2(poolName, account, provider);
|
|
2209
2210
|
React.useEffect(() => {
|
|
2210
2211
|
if (!step && !autopayEnabled) {
|
|
2211
2212
|
dispatch(setStep(WIDGET_STEP.ApproveAllowance));
|
|
@@ -2247,7 +2248,7 @@ const useEA = () => {
|
|
|
2247
2248
|
isWalletOwnershipVerificationRequired,
|
|
2248
2249
|
isWalletOwnershipVerified,
|
|
2249
2250
|
setError: setAuthError
|
|
2250
|
-
} =
|
|
2251
|
+
} = webShared.useAuthErrorHandling(shared.checkIsDev());
|
|
2251
2252
|
const checkingEA = React.useCallback(async (payload, nextStep) => {
|
|
2252
2253
|
try {
|
|
2253
2254
|
const result = await shared.EAService.approve(payload, chainId, shared.checkIsDev());
|
|
@@ -2439,7 +2440,7 @@ function ChooseAmountModal(_ref) {
|
|
|
2439
2440
|
const theme = material.useTheme();
|
|
2440
2441
|
const {
|
|
2441
2442
|
isXsSize
|
|
2442
|
-
} =
|
|
2443
|
+
} = webShared.useMQ();
|
|
2443
2444
|
const [inputTouched, setInputTouched] = React.useState(false);
|
|
2444
2445
|
const styles = {
|
|
2445
2446
|
subTitle: material.css(_templateObject$i || (_templateObject$i = _taggedTemplateLiteral(["\n font-weight: 400;\n "]))),
|
|
@@ -2618,7 +2619,7 @@ function ChooseAmount$c(_ref) {
|
|
|
2618
2619
|
} = poolUnderlyingToken;
|
|
2619
2620
|
const {
|
|
2620
2621
|
getFeesCharged
|
|
2621
|
-
} =
|
|
2622
|
+
} = webShared.useCLFeeManager(poolInfo.poolName, chainId, provider);
|
|
2622
2623
|
const [chargedFees, setChargedFees] = React.useState(0);
|
|
2623
2624
|
const [currentAmount, setCurrentAmount] = React.useState(0);
|
|
2624
2625
|
const {
|
|
@@ -2627,7 +2628,7 @@ function ChooseAmount$c(_ref) {
|
|
|
2627
2628
|
} = accountStats;
|
|
2628
2629
|
const {
|
|
2629
2630
|
approved
|
|
2630
|
-
} =
|
|
2631
|
+
} = webShared.useCLPoolAllowance(poolInfo.poolName, chainId, account, provider);
|
|
2631
2632
|
const handleChangeAmount = React.useCallback(newAmount => {
|
|
2632
2633
|
setCurrentAmount(newAmount);
|
|
2633
2634
|
const newChargedFees = getFeesCharged(newAmount);
|
|
@@ -2688,11 +2689,11 @@ function TxSendModal(_ref) {
|
|
|
2688
2689
|
chainId,
|
|
2689
2690
|
account
|
|
2690
2691
|
} = core.useWeb3React();
|
|
2691
|
-
const poolContract =
|
|
2692
|
+
const poolContract = webShared.usePoolContract(poolInfo.poolName, poolInfo.poolType, chainId, provider, account);
|
|
2692
2693
|
const [{
|
|
2693
2694
|
state,
|
|
2694
2695
|
txHash
|
|
2695
|
-
}, send] = jotai.useAtom(
|
|
2696
|
+
}, send] = jotai.useAtom(webShared.sendTxAtom);
|
|
2696
2697
|
React.useEffect(() => {
|
|
2697
2698
|
if (state === shared.TxStateType.Success) {
|
|
2698
2699
|
if (handleSuccess) {
|
|
@@ -2700,7 +2701,7 @@ function TxSendModal(_ref) {
|
|
|
2700
2701
|
}
|
|
2701
2702
|
}
|
|
2702
2703
|
}, [dispatch, handleSuccess, state]);
|
|
2703
|
-
|
|
2704
|
+
webShared.useMount(() => {
|
|
2704
2705
|
send({
|
|
2705
2706
|
contract: contract !== null && contract !== void 0 ? contract : poolContract,
|
|
2706
2707
|
method,
|
|
@@ -2722,7 +2723,7 @@ function Transfer$f(_ref) {
|
|
|
2722
2723
|
poolInfo
|
|
2723
2724
|
} = _ref;
|
|
2724
2725
|
const dispatch = useAppDispatch();
|
|
2725
|
-
const reset = utils.useResetAtom(
|
|
2726
|
+
const reset = utils.useResetAtom(webShared.txAtom);
|
|
2726
2727
|
const {
|
|
2727
2728
|
borrowAmountBN: borrowAmountBNJson
|
|
2728
2729
|
} = useAppSelector(selectWidgetState);
|
|
@@ -2880,7 +2881,7 @@ function NotifiSubscriptionModal(_ref) {
|
|
|
2880
2881
|
handleSuccess
|
|
2881
2882
|
} = _ref;
|
|
2882
2883
|
const theme = material.useTheme();
|
|
2883
|
-
const reset = utils.useResetAtom(
|
|
2884
|
+
const reset = utils.useResetAtom(webShared.txAtom);
|
|
2884
2885
|
const dispatch = useAppDispatch();
|
|
2885
2886
|
const {
|
|
2886
2887
|
account,
|
|
@@ -3028,12 +3029,12 @@ function CreditLineBorrow(_ref) {
|
|
|
3028
3029
|
} = core.useWeb3React();
|
|
3029
3030
|
const poolName = shared.POOL_NAME[poolNameStr];
|
|
3030
3031
|
const poolType = shared.POOL_TYPE[poolTypeStr];
|
|
3031
|
-
const poolInfo =
|
|
3032
|
+
const poolInfo = webShared.usePoolInfo(poolName, poolType, chainId);
|
|
3032
3033
|
const {
|
|
3033
3034
|
step,
|
|
3034
3035
|
errorMessage
|
|
3035
3036
|
} = useAppSelector(selectWidgetState);
|
|
3036
|
-
const [accountStats, refreshAccountStats] =
|
|
3037
|
+
const [accountStats, refreshAccountStats] = webShared.useAccountStats(poolName, poolType, chainId, account, provider);
|
|
3037
3038
|
const {
|
|
3038
3039
|
isFirstTimeNotifiUser
|
|
3039
3040
|
} = useIsFirstTimeNotifiUser(account, chainId);
|
|
@@ -3203,7 +3204,7 @@ function ChooseAmount$b(_ref) {
|
|
|
3203
3204
|
const creditAvailableFormatted = creditAvailable ? Number(ethers.ethers.utils.formatUnits(creditAvailable, decimals)) : 0;
|
|
3204
3205
|
const {
|
|
3205
3206
|
autopayEnabled
|
|
3206
|
-
} =
|
|
3207
|
+
} = webShared.usePoolSafeAllowanceV2(poolInfo.poolName, account, provider);
|
|
3207
3208
|
const handleChangeAmount = React.useCallback(newAmount => {
|
|
3208
3209
|
setCurrentAmount(newAmount);
|
|
3209
3210
|
}, []);
|
|
@@ -3267,7 +3268,7 @@ function TxSendModalV2(_ref) {
|
|
|
3267
3268
|
const [{
|
|
3268
3269
|
state,
|
|
3269
3270
|
txHash
|
|
3270
|
-
}, send] = jotai.useAtom(
|
|
3271
|
+
}, send] = jotai.useAtom(webShared.sendTxAtom);
|
|
3271
3272
|
React.useEffect(() => {
|
|
3272
3273
|
if (state === shared.TxStateType.Success) {
|
|
3273
3274
|
if (handleSuccess) {
|
|
@@ -3275,7 +3276,7 @@ function TxSendModalV2(_ref) {
|
|
|
3275
3276
|
}
|
|
3276
3277
|
}
|
|
3277
3278
|
}, [dispatch, handleSuccess, state]);
|
|
3278
|
-
|
|
3279
|
+
webShared.useMount(() => {
|
|
3279
3280
|
send({
|
|
3280
3281
|
contract,
|
|
3281
3282
|
method,
|
|
@@ -3301,12 +3302,12 @@ function Transfer$e(_ref) {
|
|
|
3301
3302
|
provider,
|
|
3302
3303
|
account
|
|
3303
3304
|
} = core.useWeb3React();
|
|
3304
|
-
const reset = utils.useResetAtom(
|
|
3305
|
+
const reset = utils.useResetAtom(webShared.txAtom);
|
|
3305
3306
|
const {
|
|
3306
3307
|
borrowAmountBN: borrowAmountBNJson
|
|
3307
3308
|
} = useAppSelector(selectWidgetState);
|
|
3308
3309
|
const borrowAmountBN = ethers.BigNumber.from(borrowAmountBNJson);
|
|
3309
|
-
const creditContract =
|
|
3310
|
+
const creditContract = webShared.useCreditContractV2(poolInfo.poolName, provider, account);
|
|
3310
3311
|
const handleSuccess = React.useCallback(() => {
|
|
3311
3312
|
reset();
|
|
3312
3313
|
const nextStep = WIDGET_STEP.Done;
|
|
@@ -3370,13 +3371,13 @@ function CreditLineBorrowV2(_ref) {
|
|
|
3370
3371
|
chainId,
|
|
3371
3372
|
provider
|
|
3372
3373
|
} = core.useWeb3React();
|
|
3373
|
-
const poolInfo =
|
|
3374
|
-
const poolUnderlyingToken =
|
|
3374
|
+
const poolInfo = webShared.usePoolInfoV2(poolName, chainId);
|
|
3375
|
+
const poolUnderlyingToken = webShared.usePoolUnderlyingTokenInfoV2(poolName, provider);
|
|
3375
3376
|
const {
|
|
3376
3377
|
step,
|
|
3377
3378
|
errorMessage
|
|
3378
3379
|
} = useAppSelector(selectWidgetState);
|
|
3379
|
-
const [accountStats, refreshAccountStats] =
|
|
3380
|
+
const [accountStats, refreshAccountStats] = webShared.useCreditStatsV2(poolName, account, provider);
|
|
3380
3381
|
const {
|
|
3381
3382
|
isFirstTimeNotifiUser
|
|
3382
3383
|
} = useIsFirstTimeNotifiUser(account, chainId);
|
|
@@ -3466,7 +3467,7 @@ function ChooseAmount$a(_ref) {
|
|
|
3466
3467
|
const [currentAmount, setCurrentAmount] = React.useState(0);
|
|
3467
3468
|
const {
|
|
3468
3469
|
allowance
|
|
3469
|
-
} =
|
|
3470
|
+
} = webShared.useCLPoolAllowance(poolInfo.poolName, chainId, account, provider);
|
|
3470
3471
|
React.useEffect(() => {
|
|
3471
3472
|
setCurrentAmount(totalDueAmount);
|
|
3472
3473
|
dispatch(setPaymentAmount({
|
|
@@ -3549,7 +3550,7 @@ function Success$a(_ref) {
|
|
|
3549
3550
|
} = poolInfo.poolUnderlyingToken;
|
|
3550
3551
|
const [{
|
|
3551
3552
|
txReceipt
|
|
3552
|
-
}] = jotai.useAtom(
|
|
3553
|
+
}] = jotai.useAtom(webShared.sendTxAtom);
|
|
3553
3554
|
const [payedAmount, setPayedAmount] = React.useState();
|
|
3554
3555
|
React.useEffect(() => {
|
|
3555
3556
|
if (txReceipt) {
|
|
@@ -3582,7 +3583,7 @@ function CreditLinePayment(_ref) {
|
|
|
3582
3583
|
} = core.useWeb3React();
|
|
3583
3584
|
const poolName = shared.POOL_NAME[poolNameStr];
|
|
3584
3585
|
const poolType = shared.POOL_TYPE[poolTypeStr];
|
|
3585
|
-
const poolInfo =
|
|
3586
|
+
const poolInfo = webShared.usePoolInfo(poolName, poolType, chainId);
|
|
3586
3587
|
const {
|
|
3587
3588
|
step,
|
|
3588
3589
|
errorMessage
|
|
@@ -3591,7 +3592,7 @@ function CreditLinePayment(_ref) {
|
|
|
3591
3592
|
creditRecord,
|
|
3592
3593
|
payoffAmount,
|
|
3593
3594
|
totalDueAmount
|
|
3594
|
-
}] =
|
|
3595
|
+
}] = webShared.useAccountStats(poolName, poolType, chainId, account, provider);
|
|
3595
3596
|
React.useEffect(() => {
|
|
3596
3597
|
dispatch(setStep(WIDGET_STEP.ChooseAmount));
|
|
3597
3598
|
}, [dispatch]);
|
|
@@ -3642,7 +3643,7 @@ function ChooseAmount$9(_ref) {
|
|
|
3642
3643
|
const [currentAmount, setCurrentAmount] = React.useState(0);
|
|
3643
3644
|
const {
|
|
3644
3645
|
allowance
|
|
3645
|
-
} =
|
|
3646
|
+
} = webShared.usePoolSafeAllowanceV2(poolInfo.poolName, account, provider);
|
|
3646
3647
|
const totalDueAmount = Number(ethers.ethers.utils.formatUnits(totalDueAmountBN, decimals));
|
|
3647
3648
|
const payoffAmount = Number(ethers.ethers.utils.formatUnits(payoffAmountBN, decimals));
|
|
3648
3649
|
console.log('totalDueAmountBN', totalDueAmountBN.toString());
|
|
@@ -3723,7 +3724,7 @@ function Transfer$c(_ref) {
|
|
|
3723
3724
|
decimals
|
|
3724
3725
|
} = poolUnderlyingToken;
|
|
3725
3726
|
const paymentBigNumber = shared.toBigNumber(shared.upScale(paymentAmount, decimals));
|
|
3726
|
-
const creditContract =
|
|
3727
|
+
const creditContract = webShared.useCreditContractV2(poolInfo.poolName, provider, account);
|
|
3727
3728
|
const handleSuccess = React.useCallback(() => {
|
|
3728
3729
|
dispatch(setStep(WIDGET_STEP.Done));
|
|
3729
3730
|
}, [dispatch]);
|
|
@@ -3752,7 +3753,7 @@ function Success$9(_ref) {
|
|
|
3752
3753
|
} = poolUnderlyingToken;
|
|
3753
3754
|
const [{
|
|
3754
3755
|
txReceipt
|
|
3755
|
-
}] = jotai.useAtom(
|
|
3756
|
+
}] = jotai.useAtom(webShared.sendTxAtom);
|
|
3756
3757
|
const [paidAmount, setPaidAmount] = React.useState();
|
|
3757
3758
|
React.useEffect(() => {
|
|
3758
3759
|
if (txReceipt) {
|
|
@@ -3783,7 +3784,7 @@ function CreditLinePaymentV2(_ref) {
|
|
|
3783
3784
|
provider
|
|
3784
3785
|
} = core.useWeb3React();
|
|
3785
3786
|
const poolName = shared.POOL_NAME[poolNameStr];
|
|
3786
|
-
const poolInfo =
|
|
3787
|
+
const poolInfo = webShared.usePoolInfoV2(poolName, chainId);
|
|
3787
3788
|
const {
|
|
3788
3789
|
step,
|
|
3789
3790
|
errorMessage
|
|
@@ -3792,8 +3793,8 @@ function CreditLinePaymentV2(_ref) {
|
|
|
3792
3793
|
creditRecord,
|
|
3793
3794
|
totalDueAmount,
|
|
3794
3795
|
payoffAmount
|
|
3795
|
-
}] =
|
|
3796
|
-
const poolUnderlyingToken =
|
|
3796
|
+
}] = webShared.useCreditStatsV2(poolName, account, provider);
|
|
3797
|
+
const poolUnderlyingToken = webShared.usePoolUnderlyingTokenInfoV2(poolName, provider);
|
|
3797
3798
|
React.useEffect(() => {
|
|
3798
3799
|
dispatch(setStep(WIDGET_STEP.ChooseAmount));
|
|
3799
3800
|
}, [dispatch]);
|
|
@@ -3882,7 +3883,7 @@ function Transfer$b(_ref) {
|
|
|
3882
3883
|
provider,
|
|
3883
3884
|
account
|
|
3884
3885
|
} = core.useWeb3React();
|
|
3885
|
-
const firstLossCoverContract =
|
|
3886
|
+
const firstLossCoverContract = webShared.useFirstLossCoverContractV2(poolInfo.poolName, shared.FirstLossCoverIndex.borrower, provider, account);
|
|
3886
3887
|
const handleSuccess = React.useCallback(() => {
|
|
3887
3888
|
dispatch(setStep(WIDGET_STEP.Done));
|
|
3888
3889
|
}, [dispatch]);
|
|
@@ -3913,14 +3914,14 @@ function SupplyFirstLossCover(_ref) {
|
|
|
3913
3914
|
chainId,
|
|
3914
3915
|
provider
|
|
3915
3916
|
} = core.useWeb3React();
|
|
3916
|
-
const poolInfo =
|
|
3917
|
-
const poolUnderlyingToken =
|
|
3917
|
+
const poolInfo = webShared.usePoolInfoV2(poolName, chainId);
|
|
3918
|
+
const poolUnderlyingToken = webShared.usePoolUnderlyingTokenInfoV2(poolName, provider);
|
|
3918
3919
|
const {
|
|
3919
3920
|
step,
|
|
3920
3921
|
errorMessage
|
|
3921
3922
|
} = useAppSelector(selectWidgetState);
|
|
3922
|
-
const [requirement] =
|
|
3923
|
-
const [allowance] =
|
|
3923
|
+
const [requirement] = webShared.useFirstLossCoverRequirementV2(poolName, shared.FirstLossCoverIndex.borrower, account, provider);
|
|
3924
|
+
const [allowance] = webShared.useFirstLossCoverAllowanceV2(poolName, shared.FirstLossCoverIndex.borrower, account, provider);
|
|
3924
3925
|
const {
|
|
3925
3926
|
minAmountToDeposit
|
|
3926
3927
|
} = requirement || {};
|
|
@@ -4026,7 +4027,7 @@ function ChooseAmount$8(_ref) {
|
|
|
4026
4027
|
} = useAppSelector(selectWidgetState);
|
|
4027
4028
|
const {
|
|
4028
4029
|
getFeesCharged
|
|
4029
|
-
} =
|
|
4030
|
+
} = webShared.useFeeManager(poolInfo.poolName, poolInfo.poolType, chainId, provider);
|
|
4030
4031
|
const [remainder, setRemainder] = React.useState((_receivable = approval.receivable) === null || _receivable === void 0 ? void 0 : _receivable.amountFormatted);
|
|
4031
4032
|
const getAvailableCreditLimit = () => {
|
|
4032
4033
|
if (approval && creditRecord) {
|
|
@@ -4184,9 +4185,9 @@ function ApproveNFT(_ref) {
|
|
|
4184
4185
|
const [{
|
|
4185
4186
|
state,
|
|
4186
4187
|
txHash
|
|
4187
|
-
}, send] = jotai.useAtom(
|
|
4188
|
-
const reset = utils.useResetAtom(
|
|
4189
|
-
const invoiceNFTContract =
|
|
4188
|
+
}, send] = jotai.useAtom(webShared.sendTxAtom);
|
|
4189
|
+
const reset = utils.useResetAtom(webShared.txAtom);
|
|
4190
|
+
const invoiceNFTContract = webShared.useInvoiceNFTContract(poolInfo.poolName, chainId, provider);
|
|
4190
4191
|
React.useEffect(() => {
|
|
4191
4192
|
if (state === shared.TxStateType.Success) {
|
|
4192
4193
|
reset();
|
|
@@ -4267,12 +4268,12 @@ function InvoiceFactoringBorrow(_ref) {
|
|
|
4267
4268
|
} = core.useWeb3React();
|
|
4268
4269
|
const poolName = shared.POOL_NAME[poolNameStr];
|
|
4269
4270
|
const poolType = shared.POOL_TYPE[poolTypeStr];
|
|
4270
|
-
const poolInfo =
|
|
4271
|
+
const poolInfo = webShared.usePoolInfo(poolName, poolType, chainId);
|
|
4271
4272
|
const {
|
|
4272
4273
|
step,
|
|
4273
4274
|
errorMessage
|
|
4274
4275
|
} = useAppSelector(selectWidgetState);
|
|
4275
|
-
const [accountStats] =
|
|
4276
|
+
const [accountStats] = webShared.useAccountStats(poolName, poolType, chainId, account, provider);
|
|
4276
4277
|
React.useEffect(() => {
|
|
4277
4278
|
dispatch(setStep(WIDGET_STEP.Evaluation));
|
|
4278
4279
|
}, [dispatch]);
|
|
@@ -4323,7 +4324,7 @@ function ChooseAmount$7(_ref) {
|
|
|
4323
4324
|
const totalDue = shared.downScale(creditRecord.totalDue.toNumber(), decimals);
|
|
4324
4325
|
const {
|
|
4325
4326
|
allowance
|
|
4326
|
-
} =
|
|
4327
|
+
} = webShared.useRFPoolAllowance(poolInfo.poolName, chainId, account, provider);
|
|
4327
4328
|
const [remainingDue, setRemainingDue] = React.useState(totalDue);
|
|
4328
4329
|
const [currentAmount, setCurrentAmount] = React.useState(0);
|
|
4329
4330
|
const handleChangeAmount = React.useCallback(newAmount => {
|
|
@@ -4430,14 +4431,14 @@ function InvoiceFactoringPayment(_ref) {
|
|
|
4430
4431
|
} = core.useWeb3React();
|
|
4431
4432
|
const poolName = shared.POOL_NAME[poolNameStr];
|
|
4432
4433
|
const poolType = shared.POOL_TYPE[poolTypeStr];
|
|
4433
|
-
const poolInfo =
|
|
4434
|
+
const poolInfo = webShared.usePoolInfo(poolName, poolType, chainId);
|
|
4434
4435
|
const {
|
|
4435
4436
|
step,
|
|
4436
4437
|
errorMessage
|
|
4437
4438
|
} = useAppSelector(selectWidgetState);
|
|
4438
4439
|
const [{
|
|
4439
4440
|
creditRecord
|
|
4440
|
-
}] =
|
|
4441
|
+
}] = webShared.useAccountStats(poolName, poolType, chainId, account, provider);
|
|
4441
4442
|
React.useEffect(() => {
|
|
4442
4443
|
dispatch(setStep(WIDGET_STEP.ChooseAmount));
|
|
4443
4444
|
}, [dispatch]);
|
|
@@ -4542,9 +4543,9 @@ function ChooseAmount$6(_ref) {
|
|
|
4542
4543
|
const [currentShares, setCurrentShares] = React.useState(0);
|
|
4543
4544
|
const maxSharesFormatted = ethers.ethers.utils.formatUnits(trancheInfo.shares, poolUnderlyingToken.decimals);
|
|
4544
4545
|
const sharePrice = trancheInfo.assets.toNumber() / trancheInfo.shares.toNumber();
|
|
4545
|
-
const [depositRecord] =
|
|
4546
|
-
const lpConfig =
|
|
4547
|
-
const nextEpochStartTime =
|
|
4546
|
+
const [depositRecord] = webShared.useLenderDepositRecordV2(poolInfo.poolName, trancheInfo.tranche, account, provider);
|
|
4547
|
+
const lpConfig = webShared.useLPConfigV2(poolInfo.poolName, provider);
|
|
4548
|
+
const nextEpochStartTime = webShared.useNextEpochStartTimeV2(poolInfo.poolName, provider);
|
|
4548
4549
|
React.useEffect(() => {
|
|
4549
4550
|
if (depositRecord && lpConfig && nextEpochStartTime) {
|
|
4550
4551
|
const SECONDS_IN_A_DAY = 24 * 60 * 60;
|
|
@@ -4604,7 +4605,7 @@ function Transfer$8(_ref) {
|
|
|
4604
4605
|
const {
|
|
4605
4606
|
redeemShares
|
|
4606
4607
|
} = useAppSelector(selectWidgetState);
|
|
4607
|
-
const trancheVaultContract =
|
|
4608
|
+
const trancheVaultContract = webShared.useTrancheVaultContractV2(poolInfo.poolName, trancheInfo.tranche, provider, account);
|
|
4608
4609
|
const redeemSharesBN = ethers.ethers.utils.parseUnits(String(redeemShares), decimals);
|
|
4609
4610
|
const handleSuccess = React.useCallback(() => {
|
|
4610
4611
|
dispatch(setStep(WIDGET_STEP.Done));
|
|
@@ -4648,13 +4649,13 @@ function AddRedemptionV2(_ref) {
|
|
|
4648
4649
|
provider
|
|
4649
4650
|
} = core.useWeb3React();
|
|
4650
4651
|
const poolName = shared.POOL_NAME[poolNameStr];
|
|
4651
|
-
const poolInfo =
|
|
4652
|
+
const poolInfo = webShared.usePoolInfoV2(poolName, chainId);
|
|
4652
4653
|
const {
|
|
4653
4654
|
step,
|
|
4654
4655
|
errorMessage,
|
|
4655
4656
|
errorReason
|
|
4656
4657
|
} = useAppSelector(selectWidgetState);
|
|
4657
|
-
const poolUnderlyingToken =
|
|
4658
|
+
const poolUnderlyingToken = webShared.usePoolUnderlyingTokenInfoV2(poolName, provider);
|
|
4658
4659
|
const [seniorTrancheInfo, setSeniorTrancheInfo] = React.useState();
|
|
4659
4660
|
const [juniorTrancheInfo, setJuniorTrancheInfo] = React.useState();
|
|
4660
4661
|
const [trancheInfo, setTrancheInfo] = React.useState();
|
|
@@ -4757,7 +4758,7 @@ function Transfer$7(_ref) {
|
|
|
4757
4758
|
account,
|
|
4758
4759
|
provider
|
|
4759
4760
|
} = core.useWeb3React();
|
|
4760
|
-
const trancheVaultContract =
|
|
4761
|
+
const trancheVaultContract = webShared.useTrancheVaultContractV2(poolInfo.poolName, trancheType, provider, account);
|
|
4761
4762
|
const handleSuccess = React.useCallback(() => {
|
|
4762
4763
|
dispatch(setStep(WIDGET_STEP.Done));
|
|
4763
4764
|
}, [dispatch]);
|
|
@@ -4801,14 +4802,14 @@ function CancelRedemptionV2(_ref) {
|
|
|
4801
4802
|
provider
|
|
4802
4803
|
} = core.useWeb3React();
|
|
4803
4804
|
const poolName = shared.POOL_NAME[poolNameStr];
|
|
4804
|
-
const poolInfo =
|
|
4805
|
+
const poolInfo = webShared.usePoolInfoV2(poolName, chainId);
|
|
4805
4806
|
const {
|
|
4806
4807
|
step,
|
|
4807
4808
|
errorMessage,
|
|
4808
4809
|
errorReason
|
|
4809
4810
|
} = useAppSelector(selectWidgetState);
|
|
4810
|
-
const poolUnderlyingToken =
|
|
4811
|
-
const [redemptionInfo] =
|
|
4811
|
+
const poolUnderlyingToken = webShared.usePoolUnderlyingTokenInfoV2(poolName, provider);
|
|
4812
|
+
const [redemptionInfo] = webShared.useCancellableRedemptionInfoV2(poolName, trancheType, account, provider);
|
|
4812
4813
|
React.useEffect(() => {
|
|
4813
4814
|
if (!step) {
|
|
4814
4815
|
dispatch(setStep(WIDGET_STEP.Transfer));
|
|
@@ -5013,12 +5014,12 @@ function EvaluationKYC(_ref) {
|
|
|
5013
5014
|
kycProvider,
|
|
5014
5015
|
code,
|
|
5015
5016
|
kycPool
|
|
5016
|
-
} =
|
|
5017
|
+
} = webShared.useParamsSearch();
|
|
5017
5018
|
const {
|
|
5018
5019
|
isWalletOwnershipVerified,
|
|
5019
5020
|
setError: setAuthError,
|
|
5020
5021
|
error: authError
|
|
5021
|
-
} =
|
|
5022
|
+
} = webShared.useAuthErrorHandling(isDev);
|
|
5022
5023
|
const [loadingType, setLoadingType] = React.useState();
|
|
5023
5024
|
const [kycCopy, setKYCCopy] = React.useState(JiaPoolCopies.verifyIdentity);
|
|
5024
5025
|
const [KYCVerifyStatus, setKYCVerifyStatus] = React.useState();
|
|
@@ -5333,7 +5334,7 @@ function Success$5(_ref) {
|
|
|
5333
5334
|
} = poolInfo;
|
|
5334
5335
|
const [{
|
|
5335
5336
|
txReceipt
|
|
5336
|
-
}] = jotai.useAtom(
|
|
5337
|
+
}] = jotai.useAtom(webShared.sendTxAtom);
|
|
5337
5338
|
const {
|
|
5338
5339
|
symbol,
|
|
5339
5340
|
decimals,
|
|
@@ -5389,7 +5390,7 @@ function LendSupply(_ref) {
|
|
|
5389
5390
|
} = core.useWeb3React();
|
|
5390
5391
|
const poolName = shared.POOL_NAME[poolNameStr];
|
|
5391
5392
|
const poolType = shared.POOL_TYPE[poolTypeStr];
|
|
5392
|
-
const poolInfo =
|
|
5393
|
+
const poolInfo = webShared.usePoolInfo(poolName, poolType, chainId);
|
|
5393
5394
|
const {
|
|
5394
5395
|
decimals
|
|
5395
5396
|
} = (poolInfo === null || poolInfo === void 0 ? void 0 : poolInfo.poolUnderlyingToken) || {};
|
|
@@ -5399,17 +5400,17 @@ function LendSupply(_ref) {
|
|
|
5399
5400
|
} = useAppSelector(selectWidgetState);
|
|
5400
5401
|
const {
|
|
5401
5402
|
allowance
|
|
5402
|
-
} =
|
|
5403
|
+
} = webShared.usePoolAllowance(poolName, poolType, chainId, account, provider);
|
|
5403
5404
|
const {
|
|
5404
5405
|
isFirstTimeNotifiUser
|
|
5405
5406
|
} = useIsFirstTimeNotifiUser(account, chainId);
|
|
5406
5407
|
const {
|
|
5407
5408
|
notifiChainSupported
|
|
5408
5409
|
} = useDoesChainSupportNotifi(chainId);
|
|
5409
|
-
const [lenderApproved, refreshLenderApproved] =
|
|
5410
|
-
const [, refreshLenderPosition] =
|
|
5411
|
-
const withdrawlLockoutSeconds =
|
|
5412
|
-
const underlyingTokenBalance =
|
|
5410
|
+
const [lenderApproved, refreshLenderApproved] = webShared.useLenderApproved(poolName, poolType, chainId, account, provider);
|
|
5411
|
+
const [, refreshLenderPosition] = webShared.useLenderPosition(poolName, poolType, chainId, account, provider);
|
|
5412
|
+
const withdrawlLockoutSeconds = webShared.useWithdrawlLockoutInSeconds(poolName, poolType, chainId, provider);
|
|
5413
|
+
const underlyingTokenBalance = webShared.usePoolUnderlyingTokenBalance(poolName, poolType, chainId, account, provider);
|
|
5413
5414
|
const balanceWithoutDecimals = shared.downScale(underlyingTokenBalance, decimals);
|
|
5414
5415
|
React.useEffect(() => {
|
|
5415
5416
|
if (!step && lenderApproved !== undefined) {
|
|
@@ -5561,7 +5562,7 @@ function PersonaEvaluation(_ref) {
|
|
|
5561
5562
|
setError: setAuthError,
|
|
5562
5563
|
isWalletOwnershipVerified,
|
|
5563
5564
|
isWalletOwnershipVerificationRequired
|
|
5564
|
-
} =
|
|
5565
|
+
} = webShared.useAuthErrorHandling(isDev);
|
|
5565
5566
|
const KYCCopies = poolInfo.KYC.Persona;
|
|
5566
5567
|
const [loadingType, setLoadingType] = React.useState();
|
|
5567
5568
|
const [kycCopy, setKYCCopy] = React.useState(KYCCopies.verifyIdentity);
|
|
@@ -5847,12 +5848,12 @@ function SecuritizeEvaluation(_ref) {
|
|
|
5847
5848
|
kycProvider,
|
|
5848
5849
|
code,
|
|
5849
5850
|
kycPool
|
|
5850
|
-
} =
|
|
5851
|
+
} = webShared.useParamsSearch();
|
|
5851
5852
|
const {
|
|
5852
5853
|
isWalletOwnershipVerified,
|
|
5853
5854
|
setError: setAuthError,
|
|
5854
5855
|
error: authError
|
|
5855
|
-
} =
|
|
5856
|
+
} = webShared.useAuthErrorHandling(isDev);
|
|
5856
5857
|
const [loadingType, setLoadingType] = React.useState();
|
|
5857
5858
|
const KYCCopies = poolInfo.KYC.Securitize;
|
|
5858
5859
|
const [kycCopy, setKYCCopy] = React.useState(KYCCopies.verifyIdentity);
|
|
@@ -6106,13 +6107,13 @@ function ChooseAmount$4(_ref) {
|
|
|
6106
6107
|
decimals
|
|
6107
6108
|
} = poolUnderlyingToken;
|
|
6108
6109
|
const [currentAmount, setCurrentAmount] = React.useState(0);
|
|
6109
|
-
const debouncedValue =
|
|
6110
|
+
const debouncedValue = webShared.useDebouncedValue(currentAmount);
|
|
6110
6111
|
const [campaignPoints, setCampaignPoints] = React.useState(0);
|
|
6111
6112
|
const [lockupPeriodMonths, setLockupPeriodMonths] = React.useState(0);
|
|
6112
6113
|
const {
|
|
6113
6114
|
allowance = ethers.BigNumber.from(0)
|
|
6114
|
-
} =
|
|
6115
|
-
const [balance] =
|
|
6115
|
+
} = webShared.usePoolSafeAllowanceV2(poolInfo.poolName, account, provider);
|
|
6116
|
+
const [balance] = webShared.usePoolUnderlyingTokenBalanceV2(poolInfo.poolName, account, provider);
|
|
6116
6117
|
const maxAmountFormatted = ethers.ethers.utils.formatUnits(balance, poolUnderlyingToken.decimals);
|
|
6117
6118
|
React.useEffect(() => {
|
|
6118
6119
|
const getBasePoints = async () => {
|
|
@@ -6191,7 +6192,7 @@ function Transfer$5(_ref) {
|
|
|
6191
6192
|
decimals
|
|
6192
6193
|
} = poolUnderlyingToken;
|
|
6193
6194
|
const supplyBigNumber = ethers.ethers.utils.parseUnits(String(supplyAmount), decimals);
|
|
6194
|
-
const trancheVaultContract =
|
|
6195
|
+
const trancheVaultContract = webShared.useTrancheVaultContractV2(poolInfo.poolName, trancheType, provider, account);
|
|
6195
6196
|
const handleSuccess = React.useCallback(() => {
|
|
6196
6197
|
dispatch(setStep(WIDGET_STEP.Done));
|
|
6197
6198
|
}, [dispatch]);
|
|
@@ -6223,7 +6224,7 @@ function Success$4(_ref) {
|
|
|
6223
6224
|
const [{
|
|
6224
6225
|
txReceipt,
|
|
6225
6226
|
txHash
|
|
6226
|
-
}] = jotai.useAtom(
|
|
6227
|
+
}] = jotai.useAtom(webShared.sendTxAtom);
|
|
6227
6228
|
const {
|
|
6228
6229
|
symbol,
|
|
6229
6230
|
decimals,
|
|
@@ -6335,7 +6336,7 @@ function PointsEarned(_ref) {
|
|
|
6335
6336
|
setError: setAuthError,
|
|
6336
6337
|
isWalletOwnershipVerified,
|
|
6337
6338
|
isWalletOwnershipVerificationRequired
|
|
6338
|
-
} =
|
|
6339
|
+
} = webShared.useAuthErrorHandling(isDev);
|
|
6339
6340
|
const [walletOwnership, setWalletOwnership] = React.useState();
|
|
6340
6341
|
const [state, setState] = React.useState(STATE.Loading);
|
|
6341
6342
|
React.useEffect(() => {
|
|
@@ -6460,19 +6461,19 @@ function LendSupplyV2(_ref) {
|
|
|
6460
6461
|
provider,
|
|
6461
6462
|
account
|
|
6462
6463
|
} = core.useWeb3React();
|
|
6463
|
-
const poolInfo =
|
|
6464
|
+
const poolInfo = webShared.usePoolInfoV2(poolName, chainId);
|
|
6464
6465
|
const {
|
|
6465
6466
|
step,
|
|
6466
6467
|
errorMessage
|
|
6467
6468
|
} = useAppSelector(selectWidgetState);
|
|
6468
6469
|
const [selectedTranche, setSelectedTranche] = React.useState();
|
|
6469
6470
|
const [transactionHash, setTransactionHash] = React.useState();
|
|
6470
|
-
const poolUnderlyingToken =
|
|
6471
|
-
const poolSettings =
|
|
6472
|
-
const lpConfig =
|
|
6471
|
+
const poolUnderlyingToken = webShared.usePoolUnderlyingTokenInfoV2(poolName, provider);
|
|
6472
|
+
const poolSettings = webShared.usePoolSettingsV2(poolName, provider);
|
|
6473
|
+
const lpConfig = webShared.useLPConfigV2(poolName, provider);
|
|
6473
6474
|
const isUniTranche = (lpConfig === null || lpConfig === void 0 ? void 0 : lpConfig.maxSeniorJuniorRatio) === 0;
|
|
6474
|
-
const [lenderApprovedSenior] =
|
|
6475
|
-
const [lenderApprovedJunior] =
|
|
6475
|
+
const [lenderApprovedSenior] = webShared.useLenderApprovedV2(poolName, 'senior', account, provider);
|
|
6476
|
+
const [lenderApprovedJunior] = webShared.useLenderApprovedV2(poolName, 'junior', account, provider);
|
|
6476
6477
|
const lenderApproveStatusFetched = lenderApprovedSenior !== undefined && lenderApprovedJunior !== undefined;
|
|
6477
6478
|
React.useEffect(() => {
|
|
6478
6479
|
if (!step && poolInfo && lenderApproveStatusFetched && lpConfig) {
|
|
@@ -6584,8 +6585,8 @@ function CheckWithdrawable(_ref) {
|
|
|
6584
6585
|
chainId,
|
|
6585
6586
|
provider
|
|
6586
6587
|
} = core.useWeb3React();
|
|
6587
|
-
const withdrawlLockoutSeconds =
|
|
6588
|
-
const lastDepositTime =
|
|
6588
|
+
const withdrawlLockoutSeconds = webShared.useWithdrawlLockoutInSeconds(poolInfo.poolName, poolInfo.poolType, chainId, provider);
|
|
6589
|
+
const lastDepositTime = webShared.useLastDepositTime(poolInfo.poolName, poolInfo.poolType, chainId, account, provider);
|
|
6589
6590
|
const {
|
|
6590
6591
|
symbol
|
|
6591
6592
|
} = poolInfo.poolUnderlyingToken;
|
|
@@ -6689,7 +6690,7 @@ function Success$3(_ref) {
|
|
|
6689
6690
|
} = poolInfo;
|
|
6690
6691
|
const [{
|
|
6691
6692
|
txReceipt
|
|
6692
|
-
}] = jotai.useAtom(
|
|
6693
|
+
}] = jotai.useAtom(webShared.sendTxAtom);
|
|
6693
6694
|
const {
|
|
6694
6695
|
symbol,
|
|
6695
6696
|
decimals,
|
|
@@ -6735,13 +6736,13 @@ function LendWithdraw(_ref) {
|
|
|
6735
6736
|
} = core.useWeb3React();
|
|
6736
6737
|
const poolName = shared.POOL_NAME[poolNameStr];
|
|
6737
6738
|
const poolType = shared.POOL_TYPE[poolTypeStr];
|
|
6738
|
-
const poolInfo =
|
|
6739
|
+
const poolInfo = webShared.usePoolInfo(poolName, poolType, chainId);
|
|
6739
6740
|
const {
|
|
6740
6741
|
step,
|
|
6741
6742
|
errorMessage
|
|
6742
6743
|
} = useAppSelector(selectWidgetState);
|
|
6743
|
-
const [lenderPosition, refreshLenderPosition] =
|
|
6744
|
-
const [poolBalance, refreshPoolBalance] =
|
|
6744
|
+
const [lenderPosition, refreshLenderPosition] = webShared.useLenderPosition(poolName, poolType, chainId, account, provider);
|
|
6745
|
+
const [poolBalance, refreshPoolBalance] = webShared.usePoolBalance(poolName, poolType, chainId, provider);
|
|
6745
6746
|
React.useEffect(() => {
|
|
6746
6747
|
if (!step && lenderPosition !== null && lenderPosition !== void 0 && lenderPosition.gt(0) && poolBalance !== null && poolBalance !== void 0 && poolBalance.gt(0)) {
|
|
6747
6748
|
dispatch(setStep(WIDGET_STEP.CheckWithdrawable));
|
|
@@ -6884,7 +6885,7 @@ function Transfer$3(_ref) {
|
|
|
6884
6885
|
account,
|
|
6885
6886
|
provider
|
|
6886
6887
|
} = core.useWeb3React();
|
|
6887
|
-
const trancheVaultContract =
|
|
6888
|
+
const trancheVaultContract = webShared.useTrancheVaultContractV2(poolInfo.poolName, tranche, provider, account);
|
|
6888
6889
|
const handleSuccess = React.useCallback(() => {
|
|
6889
6890
|
dispatch(setStep(WIDGET_STEP.Done));
|
|
6890
6891
|
}, [dispatch]);
|
|
@@ -6930,12 +6931,12 @@ function LendWithdrawV2(_ref) {
|
|
|
6930
6931
|
provider
|
|
6931
6932
|
} = core.useWeb3React();
|
|
6932
6933
|
const poolName = shared.POOL_NAME[poolNameStr];
|
|
6933
|
-
const poolInfo =
|
|
6934
|
+
const poolInfo = webShared.usePoolInfoV2(poolName, chainId);
|
|
6934
6935
|
const {
|
|
6935
6936
|
step,
|
|
6936
6937
|
errorMessage
|
|
6937
6938
|
} = useAppSelector(selectWidgetState);
|
|
6938
|
-
const poolUnderlyingToken =
|
|
6939
|
+
const poolUnderlyingToken = webShared.usePoolUnderlyingTokenInfoV2(poolName, provider);
|
|
6939
6940
|
const title = poolUnderlyingToken ? "Withdraw ".concat(poolUnderlyingToken.symbol) : 'Withdraw';
|
|
6940
6941
|
const [redemptionStatus, setRedemptionStatus] = React__default["default"].useState();
|
|
6941
6942
|
const [poolIsClosed, setPoolIsClosed] = React.useState(undefined);
|
|
@@ -7036,10 +7037,10 @@ function ChooseAmount$2(_ref) {
|
|
|
7036
7037
|
const {
|
|
7037
7038
|
creditAvailable
|
|
7038
7039
|
} = accountStats;
|
|
7039
|
-
const receivableInfo =
|
|
7040
|
+
const receivableInfo = webShared.useReceivableInfoV2(poolInfo.poolName, tokenId, provider);
|
|
7040
7041
|
const {
|
|
7041
7042
|
autopayEnabled
|
|
7042
|
-
} =
|
|
7043
|
+
} = webShared.usePoolSafeAllowanceV2(poolInfo.poolName, account, provider);
|
|
7043
7044
|
const [maxAmount, setMaxAmount] = React.useState(0);
|
|
7044
7045
|
React.useEffect(() => {
|
|
7045
7046
|
if (creditAvailable) {
|
|
@@ -7111,9 +7112,9 @@ function ApproveReceivable$1(_ref) {
|
|
|
7111
7112
|
const [{
|
|
7112
7113
|
state,
|
|
7113
7114
|
txHash
|
|
7114
|
-
}, send] = jotai.useAtom(
|
|
7115
|
-
const reset = utils.useResetAtom(
|
|
7116
|
-
const receivableContract =
|
|
7115
|
+
}, send] = jotai.useAtom(webShared.sendTxAtom);
|
|
7116
|
+
const reset = utils.useResetAtom(webShared.txAtom);
|
|
7117
|
+
const receivableContract = webShared.useReceivableContractV2(poolInfo.poolName, provider, account);
|
|
7117
7118
|
React.useEffect(() => {
|
|
7118
7119
|
if (state === shared.TxStateType.Success) {
|
|
7119
7120
|
reset();
|
|
@@ -7229,13 +7230,13 @@ function ReceivableBackedCreditLineBorrowV2(_ref) {
|
|
|
7229
7230
|
chainId,
|
|
7230
7231
|
provider
|
|
7231
7232
|
} = core.useWeb3React();
|
|
7232
|
-
const poolInfo =
|
|
7233
|
-
const poolUnderlyingToken =
|
|
7233
|
+
const poolInfo = webShared.usePoolInfoV2(poolName, chainId);
|
|
7234
|
+
const poolUnderlyingToken = webShared.usePoolUnderlyingTokenInfoV2(poolName, provider);
|
|
7234
7235
|
const {
|
|
7235
7236
|
step,
|
|
7236
7237
|
errorMessage
|
|
7237
7238
|
} = useAppSelector(selectWidgetState);
|
|
7238
|
-
const [accountStats, refreshAccountStats] =
|
|
7239
|
+
const [accountStats, refreshAccountStats] = webShared.useCreditStatsV2(poolName, account, provider);
|
|
7239
7240
|
const {
|
|
7240
7241
|
isFirstTimeNotifiUser
|
|
7241
7242
|
} = useIsFirstTimeNotifiUser(account, chainId);
|
|
@@ -7384,7 +7385,7 @@ function ChooseAmount$1(_ref) {
|
|
|
7384
7385
|
const [currentAmount, setCurrentAmount] = React.useState(0);
|
|
7385
7386
|
const {
|
|
7386
7387
|
allowance
|
|
7387
|
-
} =
|
|
7388
|
+
} = webShared.usePoolSafeAllowanceV2(poolInfo.poolName, account, provider);
|
|
7388
7389
|
const payoffAmount = Number(ethers.ethers.utils.formatUnits(payoffAmountBN, decimals));
|
|
7389
7390
|
const handleChangeAmount = React.useCallback(newAmount => {
|
|
7390
7391
|
setCurrentAmount(newAmount);
|
|
@@ -7519,9 +7520,9 @@ function ApproveReceivable(_ref) {
|
|
|
7519
7520
|
const [{
|
|
7520
7521
|
state,
|
|
7521
7522
|
txHash
|
|
7522
|
-
}, send] = jotai.useAtom(
|
|
7523
|
-
const reset = utils.useResetAtom(
|
|
7524
|
-
const receivableContract =
|
|
7523
|
+
}, send] = jotai.useAtom(webShared.sendTxAtom);
|
|
7524
|
+
const reset = utils.useResetAtom(webShared.txAtom);
|
|
7525
|
+
const receivableContract = webShared.useReceivableContractV2(poolInfo.poolName, provider, account);
|
|
7525
7526
|
React.useEffect(() => {
|
|
7526
7527
|
if (state === shared.TxStateType.Success) {
|
|
7527
7528
|
reset();
|
|
@@ -7663,18 +7664,18 @@ function ReceivableBackedCreditLinePaymentV2(_ref) {
|
|
|
7663
7664
|
provider
|
|
7664
7665
|
} = core.useWeb3React();
|
|
7665
7666
|
const poolName = shared.POOL_NAME[poolNameStr];
|
|
7666
|
-
const poolInfo =
|
|
7667
|
+
const poolInfo = webShared.usePoolInfoV2(poolName, chainId);
|
|
7667
7668
|
const {
|
|
7668
7669
|
step,
|
|
7669
7670
|
errorMessage
|
|
7670
7671
|
} = useAppSelector(selectWidgetState);
|
|
7671
7672
|
const [{
|
|
7672
7673
|
creditRecord
|
|
7673
|
-
}] =
|
|
7674
|
-
const poolUnderlyingToken =
|
|
7674
|
+
}] = webShared.useCreditStatsV2(poolName, account, provider);
|
|
7675
|
+
const poolUnderlyingToken = webShared.usePoolUnderlyingTokenInfoV2(poolName, provider);
|
|
7675
7676
|
const [paymentType, setPaymentType] = React.useState();
|
|
7676
7677
|
const [borrowTokenId, setBorrowTokenId] = React.useState();
|
|
7677
|
-
const paymentReceivableInfo =
|
|
7678
|
+
const paymentReceivableInfo = webShared.useReceivableInfoV2(poolName, tokenId, provider);
|
|
7678
7679
|
const payoffAmount = paymentReceivableInfo ? ethers.BigNumber.from(paymentReceivableInfo.receivableAmount).sub(paymentReceivableInfo.paidAmount) : ethers.BigNumber.from(0);
|
|
7679
7680
|
const [successTxReceipt, setSuccessTxReceipt] = React.useState();
|
|
7680
7681
|
React.useEffect(() => {
|
|
@@ -7950,7 +7951,7 @@ function Activity(_ref) {
|
|
|
7950
7951
|
});
|
|
7951
7952
|
const {
|
|
7952
7953
|
isSmSize
|
|
7953
|
-
} =
|
|
7954
|
+
} = webShared.useMQ();
|
|
7954
7955
|
const getPadding = () => {
|
|
7955
7956
|
if (isSmSize) {
|
|
7956
7957
|
return theme.spacing(2, 3);
|
|
@@ -8060,7 +8061,7 @@ function ChooseAmount(_ref) {
|
|
|
8060
8061
|
} = useAppSelector(selectWidgetState);
|
|
8061
8062
|
const {
|
|
8062
8063
|
getFeesCharged
|
|
8063
|
-
} =
|
|
8064
|
+
} = webShared.useFeeManager(poolInfo.poolName, poolInfo.poolType, chainId, provider);
|
|
8064
8065
|
const [chargedFees, setChargedFees] = React.useState(0);
|
|
8065
8066
|
const [currentAmount, setCurrentAmount] = React.useState(0);
|
|
8066
8067
|
const borrowPeriodInSeconds = approval.terms.intervalInDays * 24 * 60 * 60;
|
|
@@ -8192,7 +8193,7 @@ function Permit(_ref) {
|
|
|
8192
8193
|
} = useAppSelector(selectWidgetState);
|
|
8193
8194
|
const {
|
|
8194
8195
|
getTradableStreamPermitMessage
|
|
8195
|
-
} =
|
|
8196
|
+
} = webShared.useERC2612Permit();
|
|
8196
8197
|
const borrowAmountBN = ethers.BigNumber.from(borrowAmountBNJson);
|
|
8197
8198
|
const getDrawdownCallData = async () => {
|
|
8198
8199
|
const NFTPermitResult = await getTradableStreamPermitMessage(poolInfo.assetAddress, borrower, superToken, payerAddress, poolInfo.poolProcessor, stream.borrowFlowrate, stream.durationInSeconds);
|
|
@@ -8200,7 +8201,7 @@ function Permit(_ref) {
|
|
|
8200
8201
|
const poolProcessorContract = new ethers.Contract(poolInfo.poolProcessor, shared.SuperfluidPoolProcessor_ABI);
|
|
8201
8202
|
return poolProcessorContract.interface.encodeFunctionData('mintAndDrawdown', [borrower, borrowAmountBN, poolInfo.assetAddress, drawdownEncodedData]);
|
|
8202
8203
|
};
|
|
8203
|
-
|
|
8204
|
+
webShared.useMount(async () => {
|
|
8204
8205
|
try {
|
|
8205
8206
|
const callData = [];
|
|
8206
8207
|
const addresses = [];
|
|
@@ -8242,7 +8243,7 @@ function Transfer(_ref) {
|
|
|
8242
8243
|
const {
|
|
8243
8244
|
multisend
|
|
8244
8245
|
} = useAppSelector(selectWidgetState);
|
|
8245
|
-
const multiSendContract =
|
|
8246
|
+
const multiSendContract = webShared.useMultiSendContract(chainId, provider);
|
|
8246
8247
|
const handleSuccess = React.useCallback(() => {
|
|
8247
8248
|
dispatch(setStep(WIDGET_STEP.Done));
|
|
8248
8249
|
}, [dispatch]);
|
|
@@ -8290,7 +8291,7 @@ function StreamFactoringBorrow(_ref) {
|
|
|
8290
8291
|
account,
|
|
8291
8292
|
chainId
|
|
8292
8293
|
} = core.useWeb3React();
|
|
8293
|
-
const poolInfo =
|
|
8294
|
+
const poolInfo = webShared.usePoolInfo(poolName, poolType, chainId);
|
|
8294
8295
|
const {
|
|
8295
8296
|
step,
|
|
8296
8297
|
errorMessage
|
|
@@ -8349,7 +8350,7 @@ function UpcomingList(_ref) {
|
|
|
8349
8350
|
const {
|
|
8350
8351
|
isMdSize,
|
|
8351
8352
|
isSmSize
|
|
8352
|
-
} =
|
|
8353
|
+
} = webShared.useMQ();
|
|
8353
8354
|
const getPadding = () => {
|
|
8354
8355
|
if (isMdSize) {
|
|
8355
8356
|
return theme.spacing(0, 1, 1, 1);
|
|
@@ -8397,7 +8398,7 @@ var _ref2$1 = process.env.NODE_ENV === "production" ? {
|
|
|
8397
8398
|
} : {
|
|
8398
8399
|
name: "w5slvu-icon",
|
|
8399
8400
|
styles: "width:24px;label:icon;",
|
|
8400
|
-
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
8401
|
+
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkZhY3RvcmVkTGlzdC50c3giXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBNEQ2QiIsImZpbGUiOiJGYWN0b3JlZExpc3QudHN4Iiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgQm94LCBjc3MsIExpbmVhclByb2dyZXNzLCB1c2VUaGVtZSB9IGZyb20gJ0BtdWkvbWF0ZXJpYWwnXG5pbXBvcnQgeyB1c2VXZWIzUmVhY3QgfSBmcm9tICdAd2ViMy1yZWFjdC9jb3JlJ1xuaW1wb3J0IHtcbiAgQWNjb3VudFN0YXRzLFxuICBkb3duU2NhbGUsXG4gIGZvcm1hdE1vbmV5LFxuICBoYXNSRkFjdGl2ZUxvYW4sXG4gIFBvb2xJbmZvVHlwZSxcbiAgdGltZXN0YW1wVG9MTCxcbn0gZnJvbSAnQGh1bWEtZmluYW5jZS9zaGFyZWQnXG5pbXBvcnQgeyB1c2VNUSwgdXNlUG9vbFVuZGVybHlpbmdUb2tlbiB9IGZyb20gJ0BodW1hLWZpbmFuY2Uvd2ViLXNoYXJlZCdcbmltcG9ydCBSZWFjdCwgeyB1c2VFZmZlY3QsIHVzZVN0YXRlIH0gZnJvbSAncmVhY3QnXG5cbmltcG9ydCB7IENvbHVtblR5cGUgfSBmcm9tICcuLi8uLi91dGlsVHlwZXMnXG5pbXBvcnQgeyBIdW1hVGFibGUgfSBmcm9tICcuLi9IdW1hVGFibGUnXG5pbXBvcnQgeyBSZWNlaXB0SWNvbiB9IGZyb20gJy4uL2ljb25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ICAgICAgICAgWW91IGRvbuKAmXQgaGF2ZSBhbnkgZmFjdG9yZWQge3RpdGxlLnRvTG93ZXJDYXNlKCl9LlxuICAgICAgICAgIDwvQm94PlxuICAgICAgICApfVxuICAgICAgICB7aXNBY3RpdmUgJiYgaGFzQWN0aXZlTG9hbiAmJiBmYWN0b3JlZEl0ZW0gJiYgKFxuICAgICAgICAgIDxCb3ggY3NzPXtzdHlsZXMudGFibGVXcmFwcGVyfT5cbiAgICAgICAgICAgIHtsb2FkaW5nICYmIChcbiAgICAgICAgICAgICAgPEJveCBjc3M9e3N0eWxlcy5wcm9ncmVzc30+XG4gICAgICAgICAgICAgICAgPExpbmVhclByb2dyZXNzIC8+XG4gICAgICAgICAgICAgIDwvQm94PlxuICAgICAgICAgICAgKX1cbiAgICAgICAgICAgIDxIdW1hVGFibGVcbiAgICAgICAgICAgICAgY29sdW1ucz17Z2V0Q29sdW1ucyhoYW5kbGVQYXlNYW51YWxseSl9XG4gICAgICAgICAgICAgIHJvd3M9e1tmYWN0b3JlZEl0ZW1dfVxuICAgICAgICAgICAgLz5cbiAgICAgICAgICA8L0JveD5cbiAgICAgICAgKX1cbiAgICAgIDwvQm94PlxuICAgIDwvQm94PlxuICApXG59XG4iXX0= */",
|
|
8401
8402
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__$2
|
|
8402
8403
|
};
|
|
8403
8404
|
function FactoredList(_ref) {
|
|
@@ -8413,14 +8414,14 @@ function FactoredList(_ref) {
|
|
|
8413
8414
|
const theme = material.useTheme();
|
|
8414
8415
|
const {
|
|
8415
8416
|
isMdSize
|
|
8416
|
-
} =
|
|
8417
|
+
} = webShared.useMQ();
|
|
8417
8418
|
const {
|
|
8418
8419
|
isActive,
|
|
8419
8420
|
chainId
|
|
8420
8421
|
} = core.useWeb3React();
|
|
8421
8422
|
const {
|
|
8422
8423
|
decimals
|
|
8423
|
-
} =
|
|
8424
|
+
} = webShared.usePoolUnderlyingToken(poolInfo.poolName, poolInfo.poolType, chainId);
|
|
8424
8425
|
const [factoredItem, setFactoredItem] = React.useState();
|
|
8425
8426
|
const {
|
|
8426
8427
|
creditRecord,
|
|
@@ -8695,7 +8696,7 @@ function SuperfluidFactoring() {
|
|
|
8695
8696
|
handleGetPaidSuccess,
|
|
8696
8697
|
handlePayManually,
|
|
8697
8698
|
handleClose
|
|
8698
|
-
} =
|
|
8699
|
+
} = webShared.useFactoring(poolName, shared.POOL_TYPE.Stream);
|
|
8699
8700
|
return jsxRuntime.jsxs(material.Box, {
|
|
8700
8701
|
css: styles.wrapper,
|
|
8701
8702
|
children: [jsxRuntime.jsx(material.Box, {
|
|
@@ -9236,7 +9237,7 @@ function Widget(props) {
|
|
|
9236
9237
|
theme: themeHuma,
|
|
9237
9238
|
children: jsxRuntime.jsx(reactRedux.Provider, {
|
|
9238
9239
|
store: store,
|
|
9239
|
-
children: jsxRuntime.jsx(
|
|
9240
|
+
children: jsxRuntime.jsx(webShared.Provider, {
|
|
9240
9241
|
...props,
|
|
9241
9242
|
defaultChainId: chainId,
|
|
9242
9243
|
children: jsxRuntime.jsx(jotai.Provider, {
|