@huma-finance/widgets 0.0.65 → 0.0.66-beta.812
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 +0 -2
- package/dist/cjs/index.cjs +100 -114
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/index.d.ts +0 -4
- package/dist/index.js +101 -115
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
- package/src/components/Lend/components/ApproveLenderBase.tsx +5 -1
- package/src/components/Lend/components/PersonaEvaluation.tsx +79 -115
- package/src/components/Lend/solanaSupply/1-Evaluation.tsx +5 -5
- package/src/components/Lend/solanaSupply/2-ApproveLender.tsx +2 -0
- package/src/components/Lend/solanaSupply/6-Transfer.tsx +7 -7
- package/src/components/Lend/solanaSupply/8-PointsEarned.tsx +17 -89
- package/src/components/Lend/solanaSupply/index.tsx +3 -5
- package/src/components/Lend/supplyV2/2-Evaluation.tsx +9 -4
- package/src/components/Lend/supplyV2/3-ApproveLender.tsx +7 -1
- package/src/components/Lend/supplyV2/6-Transfer.tsx +6 -5
- package/src/components/Lend/supplyV2/index.tsx +3 -5
package/dist/index.d.ts
CHANGED
|
@@ -192,14 +192,12 @@ interface Campaign {
|
|
|
192
192
|
* Lend pool supply props
|
|
193
193
|
* @typedef {Object} LendSupplyPropsV2
|
|
194
194
|
* @property {POOL_NAME} poolName The name of the pool.
|
|
195
|
-
* @property {boolean} pointsTestnetExperience If the user is in the testnet experience.
|
|
196
195
|
* @property {Campaign} campaign The campaign info.
|
|
197
196
|
* @property {function((CloseModalOptions|undefined)):void} handleClose Function to notify to close the widget modal when user clicks the 'x' close button.
|
|
198
197
|
* @property {function((number|undefined)):void|undefined} handleSuccess Optional function to notify that the lending pool supply action is successful.
|
|
199
198
|
*/
|
|
200
199
|
interface LendSupplyPropsV2 {
|
|
201
200
|
poolName: keyof typeof POOL_NAME;
|
|
202
|
-
pointsTestnetExperience: boolean;
|
|
203
201
|
campaign?: Campaign;
|
|
204
202
|
handleClose: (options?: CloseModalOptions) => void;
|
|
205
203
|
handleSuccess?: (blockNumber?: number) => void;
|
|
@@ -270,14 +268,12 @@ type ReceivableBackedCreditLinePaymentPropsV2 = {
|
|
|
270
268
|
* @typedef {Object} SolanaLendSupplyProps
|
|
271
269
|
* @property {SolanaPoolInfo} poolInfo The metadata of the pool.
|
|
272
270
|
* @property {SolanaPoolState} poolState The current state config of the pool.
|
|
273
|
-
* @property {boolean} pointsTestnetExperience If the user is in the testnet experience.
|
|
274
271
|
* @property {function((CloseModalOptions|undefined)):void} handleClose Function to notify to close the widget modal when user clicks the 'x' close button.
|
|
275
272
|
* @property {function():void|undefined} handleSuccess Optional function to notify that the lending pool supply action is successful.
|
|
276
273
|
*/
|
|
277
274
|
interface SolanaLendSupplyProps {
|
|
278
275
|
poolInfo: SolanaPoolInfo;
|
|
279
276
|
poolState: SolanaPoolState;
|
|
280
|
-
pointsTestnetExperience: boolean;
|
|
281
277
|
handleClose: (options?: CloseModalOptions) => void;
|
|
282
278
|
handleSuccess?: () => void;
|
|
283
279
|
}
|
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import { useTheme, css, Box, Typography, Tooltip, Button, Dialog, Slider, Input,
|
|
|
3
3
|
import { useAtom, Provider as Provider$1 } from 'jotai';
|
|
4
4
|
import React, { useCallback, useState, useEffect, useMemo, useRef, useContext } from 'react';
|
|
5
5
|
import { useSelector, useDispatch, Provider } from 'react-redux';
|
|
6
|
-
import { supportedChainId, isTxFailed, getExplorerUrl, openInNewTab, TxStateType, decodeLogs, ERC20_ABI, downScale, formatMoney, POOL_NAME, POOL_TYPE, getERC20Contract, checkIsDev, EAService, EARejectionError, EARejectMessage, EARejectReason, timeUtil, formatNumber, doesChainSupportNotifi, CreditState, isEmpty, CreditStateV2, upScale, toBigNumber, TRANSFER_ABI, FirstLossCoverIndex, combineStyles, timestampToLL, getTrancheAssetsAndShares, IdentityService, CHAINS, configUtil, IdentityServiceV2, IdentityVerificationStatusV2,
|
|
6
|
+
import { supportedChainId, isTxFailed, getExplorerUrl, openInNewTab, TxStateType, decodeLogs, ERC20_ABI, downScale, formatMoney, POOL_NAME, POOL_TYPE, getERC20Contract, checkIsDev, EAService, EARejectionError, EARejectMessage, EARejectReason, timeUtil, formatNumber, doesChainSupportNotifi, CreditState, isEmpty, CreditStateV2, upScale, toBigNumber, TRANSFER_ABI, FirstLossCoverIndex, combineStyles, timestampToLL, getTrancheAssetsAndShares, IdentityService, CHAINS, configUtil, IdentityServiceV2, IdentityVerificationStatusV2, KYC_PROVIDER, CHAIN_TYPE, getEvmNetworkType, CampaignService, formatAmount, getTrancheVaultContractV2, getTrancheRedemptionStatusV2, getPoolContractV2, CURRENCY_CODE, SuperfluidPoolProcessor_ABI, PoolMap, SOLANA_CHAIN_INFO, getSolanaNetworkType, SolanaTokenUtils, getSolanaExplorerUrl, sleep, getTokenAccounts, convertToShares, getSentinelAddress, getCreditAccounts, ChainEnum, getBlockchainConfigFromChain, tokenDecimalUtils, STELLAR_CHAINS_INFO, getStellarExplorerUrl } from '@huma-finance/shared';
|
|
7
7
|
import { useWeb3React } from '@web3-react/core';
|
|
8
8
|
import ErrorOutlineIcon from '@mui/icons-material/ErrorOutline';
|
|
9
9
|
import { txAtom, useMQ, sendTxAtom, usePoolUnderlyingTokenContract, useMount, usePoolInfo, useAccountStats, usePoolInfoV2, usePoolUnderlyingTokenInfoV2, usePoolSafeAllowanceV2, useAuthErrorHandling, useCLFeeManager, useCLPoolAllowance, usePoolContract, useCreditContractV2, useCreditStatsV2, useFirstLossCoverContractV2, useFirstLossCoverRequirementV2, useFirstLossCoverAllowanceV2, useFeeManager, useInvoiceNFTContract, useRFPoolAllowance, useLenderDepositRecordV2, useLPConfigV2, useNextEpochStartTimeV2, useTrancheVaultContractV2, useCancellableRedemptionInfoV2, useParamsSearch, usePoolAllowance, useLenderApproved, useLenderPosition, useWithdrawlLockoutInSeconds, usePoolUnderlyingTokenBalance, useChainInfo, usePoolUnderlyingTokenBalanceV2, useLenderApprovedV2, useTrancheVaultAssetsV2, useLastDepositTime, usePoolBalance, useReceivableInfoV2, useReceivableContractV2, useERC2612Permit, useMultiSendContract, useFactoring, getLenderLockupDates, useLenderAccounts, useTrancheTokenAccounts, useHumaProgram, useTokenAccount, useTrancheMintAccounts, useBorrowerAccounts, StellarConnectionContext, getClientCommonParams, useStellarLender, useStellarTokenBalance, notEnabledAutoRedeem } from '@huma-finance/web-shared';
|
|
@@ -5593,17 +5593,13 @@ function PersonaEvaluation(_ref) {
|
|
|
5593
5593
|
let {
|
|
5594
5594
|
poolInfo,
|
|
5595
5595
|
campaign,
|
|
5596
|
-
|
|
5596
|
+
networkType,
|
|
5597
5597
|
chainType,
|
|
5598
5598
|
handleClose
|
|
5599
5599
|
} = _ref;
|
|
5600
5600
|
const theme = useTheme();
|
|
5601
5601
|
const isDev = checkIsDev();
|
|
5602
5602
|
const dispatch = useAppDispatch();
|
|
5603
|
-
const {
|
|
5604
|
-
account,
|
|
5605
|
-
chainId
|
|
5606
|
-
} = useChainInfo(isDev, chainType);
|
|
5607
5603
|
const {
|
|
5608
5604
|
errorType,
|
|
5609
5605
|
setError: setAuthError,
|
|
@@ -5621,110 +5617,99 @@ function PersonaEvaluation(_ref) {
|
|
|
5621
5617
|
const isKYCCompletedRef = useRef(false);
|
|
5622
5618
|
const isActionOngoingRef = useRef(false);
|
|
5623
5619
|
const isKYCResumedRef = useRef(false);
|
|
5624
|
-
useEffect(() => {
|
|
5625
|
-
const createNewWallet = async () => {
|
|
5626
|
-
if (isWalletOwnershipVerified && campaign && account) {
|
|
5627
|
-
var _localStorage$getItem;
|
|
5628
|
-
await CampaignService.createNewWallet(account, (_localStorage$getItem = localStorage.getItem(CAMPAIGN_REFERENCE_CODE)) !== null && _localStorage$getItem !== void 0 ? _localStorage$getItem : undefined, isDev, pointsTestnetExperience);
|
|
5629
|
-
}
|
|
5630
|
-
};
|
|
5631
|
-
createNewWallet();
|
|
5632
|
-
}, [account, campaign, isDev, isWalletOwnershipVerified, pointsTestnetExperience]);
|
|
5633
5620
|
const checkVerificationStatus = useCallback(async () => {
|
|
5634
5621
|
if (isActionOngoingRef.current || isKYCResumedRef.current) {
|
|
5635
5622
|
return;
|
|
5636
5623
|
}
|
|
5637
5624
|
try {
|
|
5638
|
-
|
|
5639
|
-
|
|
5640
|
-
|
|
5641
|
-
|
|
5642
|
-
|
|
5643
|
-
|
|
5644
|
-
|
|
5645
|
-
|
|
5646
|
-
|
|
5647
|
-
|
|
5648
|
-
|
|
5649
|
-
|
|
5650
|
-
|
|
5651
|
-
|
|
5652
|
-
|
|
5653
|
-
setKYCCopy(KYCCopies.verificationBypassed);
|
|
5654
|
-
}
|
|
5655
|
-
break;
|
|
5656
|
-
}
|
|
5657
|
-
case IdentityVerificationStatusV2.CREATED:
|
|
5658
|
-
{
|
|
5659
|
-
setKYCCopy(KYCCopies.verifyIdentity);
|
|
5660
|
-
setLoadingType(undefined);
|
|
5661
|
-
break;
|
|
5662
|
-
}
|
|
5663
|
-
case IdentityVerificationStatusV2.PENDING:
|
|
5664
|
-
{
|
|
5665
|
-
if (!isKYCCompletedRef.current) {
|
|
5666
|
-
const resumeVerificationResult = await IdentityServiceV2.resumeVerification(account, chainId, isDev);
|
|
5667
|
-
verificationStatus.status = resumeVerificationResult.status;
|
|
5668
|
-
setVerificationStatus(verificationStatus);
|
|
5669
|
-
setSessionToken(resumeVerificationResult.sessionToken);
|
|
5670
|
-
setLoadingType(undefined);
|
|
5671
|
-
isKYCResumedRef.current = true;
|
|
5672
|
-
} else {
|
|
5673
|
-
setLoadingType('verificationStatus');
|
|
5674
|
-
}
|
|
5675
|
-
setKYCCopy(KYCCopies.verifyIdentity);
|
|
5676
|
-
break;
|
|
5625
|
+
isActionOngoingRef.current = true;
|
|
5626
|
+
setLoadingType('verificationStatus');
|
|
5627
|
+
const verificationStatus = await IdentityServiceV2.getVerificationStatusV2(networkType, isDev);
|
|
5628
|
+
setVerificationStatus(verificationStatus);
|
|
5629
|
+
setInquiryId(verificationStatus.personaInquiryId);
|
|
5630
|
+
switch (verificationStatus.status) {
|
|
5631
|
+
case IdentityVerificationStatusV2.ACCREDITED:
|
|
5632
|
+
{
|
|
5633
|
+
const startVerificationResult = await IdentityServiceV2.startVerification(networkType, isDev);
|
|
5634
|
+
setInquiryId(startVerificationResult.personaInquiryId);
|
|
5635
|
+
setKYCCopy(KYCCopies.verifyIdentity);
|
|
5636
|
+
setLoadingType(undefined);
|
|
5637
|
+
if (startVerificationResult.status === IdentityVerificationStatusV2.BYPASSED) {
|
|
5638
|
+
setVerificationStatus(startVerificationResult);
|
|
5639
|
+
setKYCCopy(KYCCopies.verificationBypassed);
|
|
5677
5640
|
}
|
|
5678
|
-
|
|
5679
|
-
|
|
5680
|
-
|
|
5641
|
+
break;
|
|
5642
|
+
}
|
|
5643
|
+
case IdentityVerificationStatusV2.CREATED:
|
|
5644
|
+
{
|
|
5645
|
+
setKYCCopy(KYCCopies.verifyIdentity);
|
|
5646
|
+
setLoadingType(undefined);
|
|
5647
|
+
break;
|
|
5648
|
+
}
|
|
5649
|
+
case IdentityVerificationStatusV2.PENDING:
|
|
5650
|
+
{
|
|
5651
|
+
if (!isKYCCompletedRef.current) {
|
|
5652
|
+
const resumeVerificationResult = await IdentityServiceV2.resumeVerification(networkType, isDev);
|
|
5681
5653
|
verificationStatus.status = resumeVerificationResult.status;
|
|
5682
5654
|
setVerificationStatus(verificationStatus);
|
|
5683
5655
|
setSessionToken(resumeVerificationResult.sessionToken);
|
|
5684
|
-
setKYCCopy(KYCCopies.verifyIdentity);
|
|
5685
5656
|
setLoadingType(undefined);
|
|
5686
5657
|
isKYCResumedRef.current = true;
|
|
5687
|
-
|
|
5688
|
-
|
|
5689
|
-
case IdentityVerificationStatusV2.BYPASSED:
|
|
5690
|
-
{
|
|
5691
|
-
setKYCCopy(KYCCopies.verificationBypassed);
|
|
5692
|
-
setLoadingType(undefined);
|
|
5693
|
-
break;
|
|
5694
|
-
}
|
|
5695
|
-
case IdentityVerificationStatusV2.APPROVED:
|
|
5696
|
-
{
|
|
5697
|
-
setKYCCopy(KYCCopies.verificationApproved);
|
|
5698
|
-
setLoadingType(undefined);
|
|
5699
|
-
break;
|
|
5700
|
-
}
|
|
5701
|
-
case IdentityVerificationStatusV2.DECLINED:
|
|
5702
|
-
{
|
|
5703
|
-
setKYCCopy(KYCCopies.verificationDeclined);
|
|
5704
|
-
setLoadingType(undefined);
|
|
5705
|
-
break;
|
|
5706
|
-
}
|
|
5707
|
-
case IdentityVerificationStatusV2.NEEDS_REVIEW:
|
|
5708
|
-
{
|
|
5709
|
-
setKYCCopy(KYCCopies.verificationNeedsReview);
|
|
5710
|
-
setLoadingType(undefined);
|
|
5711
|
-
break;
|
|
5712
|
-
}
|
|
5713
|
-
case IdentityVerificationStatusV2.CONSENTED_TO_SUBSCRIPTION:
|
|
5714
|
-
{
|
|
5715
|
-
dispatch(setStep(WIDGET_STEP.ApproveLender));
|
|
5716
|
-
break;
|
|
5658
|
+
} else {
|
|
5659
|
+
setLoadingType('verificationStatus');
|
|
5717
5660
|
}
|
|
5718
|
-
|
|
5661
|
+
setKYCCopy(KYCCopies.verifyIdentity);
|
|
5719
5662
|
break;
|
|
5720
|
-
|
|
5663
|
+
}
|
|
5664
|
+
case IdentityVerificationStatusV2.EXPIRED:
|
|
5665
|
+
{
|
|
5666
|
+
const resumeVerificationResult = await IdentityServiceV2.resumeVerification(networkType, isDev);
|
|
5667
|
+
verificationStatus.status = resumeVerificationResult.status;
|
|
5668
|
+
setVerificationStatus(verificationStatus);
|
|
5669
|
+
setSessionToken(resumeVerificationResult.sessionToken);
|
|
5670
|
+
setKYCCopy(KYCCopies.verifyIdentity);
|
|
5671
|
+
setLoadingType(undefined);
|
|
5672
|
+
isKYCResumedRef.current = true;
|
|
5673
|
+
break;
|
|
5674
|
+
}
|
|
5675
|
+
case IdentityVerificationStatusV2.BYPASSED:
|
|
5676
|
+
{
|
|
5677
|
+
setKYCCopy(KYCCopies.verificationBypassed);
|
|
5678
|
+
setLoadingType(undefined);
|
|
5679
|
+
break;
|
|
5680
|
+
}
|
|
5681
|
+
case IdentityVerificationStatusV2.APPROVED:
|
|
5682
|
+
{
|
|
5683
|
+
setKYCCopy(KYCCopies.verificationApproved);
|
|
5684
|
+
setLoadingType(undefined);
|
|
5685
|
+
break;
|
|
5686
|
+
}
|
|
5687
|
+
case IdentityVerificationStatusV2.DECLINED:
|
|
5688
|
+
{
|
|
5689
|
+
setKYCCopy(KYCCopies.verificationDeclined);
|
|
5690
|
+
setLoadingType(undefined);
|
|
5691
|
+
break;
|
|
5692
|
+
}
|
|
5693
|
+
case IdentityVerificationStatusV2.NEEDS_REVIEW:
|
|
5694
|
+
{
|
|
5695
|
+
setKYCCopy(KYCCopies.verificationNeedsReview);
|
|
5696
|
+
setLoadingType(undefined);
|
|
5697
|
+
break;
|
|
5698
|
+
}
|
|
5699
|
+
case IdentityVerificationStatusV2.CONSENTED_TO_SUBSCRIPTION:
|
|
5700
|
+
{
|
|
5701
|
+
dispatch(setStep(WIDGET_STEP.ApproveLender));
|
|
5702
|
+
break;
|
|
5703
|
+
}
|
|
5704
|
+
default:
|
|
5705
|
+
break;
|
|
5721
5706
|
}
|
|
5722
5707
|
} catch (e) {
|
|
5723
5708
|
setAuthError(e);
|
|
5724
5709
|
} finally {
|
|
5725
5710
|
isActionOngoingRef.current = false;
|
|
5726
5711
|
}
|
|
5727
|
-
}, [KYCCopies,
|
|
5712
|
+
}, [KYCCopies, dispatch, isDev, networkType, setAuthError]);
|
|
5728
5713
|
useEffect(() => {
|
|
5729
5714
|
checkVerificationStatus();
|
|
5730
5715
|
}, [checkVerificationStatus]);
|
|
@@ -5813,7 +5798,7 @@ function PersonaEvaluation(_ref) {
|
|
|
5813
5798
|
}
|
|
5814
5799
|
}
|
|
5815
5800
|
}, [KYCAutoStarted, startKYC, verificationStatus]);
|
|
5816
|
-
const handleAction = () => {
|
|
5801
|
+
const handleAction = useCallback(() => {
|
|
5817
5802
|
if (verificationStatus) {
|
|
5818
5803
|
switch (verificationStatus.status) {
|
|
5819
5804
|
case IdentityVerificationStatusV2.ACCREDITED:
|
|
@@ -5836,7 +5821,7 @@ function PersonaEvaluation(_ref) {
|
|
|
5836
5821
|
break;
|
|
5837
5822
|
}
|
|
5838
5823
|
}
|
|
5839
|
-
};
|
|
5824
|
+
}, [handleClose, startKYC, verificationStatus]);
|
|
5840
5825
|
const styles = {
|
|
5841
5826
|
iconWrapper: css(_templateObject$b || (_templateObject$b = _taggedTemplateLiteral(["\n ", ";\n margin-top: ", ";\n & > img {\n width: 144px;\n }\n "])), theme.cssMixins.rowCentered, theme.spacing(8)),
|
|
5842
5827
|
description: css(_templateObject2$b || (_templateObject2$b = _taggedTemplateLiteral(["\n margin-top: ", ";\n padding: ", ";\n font-weight: 400;\n font-size: 16px;\n color: ", ";\n "])), theme.spacing(10), theme.spacing(0, 2), theme.palette.text.primary),
|
|
@@ -6110,7 +6095,7 @@ function Evaluation$2(_ref) {
|
|
|
6110
6095
|
let {
|
|
6111
6096
|
poolInfo,
|
|
6112
6097
|
campaign,
|
|
6113
|
-
|
|
6098
|
+
networkType,
|
|
6114
6099
|
handleClose
|
|
6115
6100
|
} = _ref;
|
|
6116
6101
|
if ((_poolInfo$KYC = poolInfo.KYC) !== null && _poolInfo$KYC !== void 0 && _poolInfo$KYC.Securitize) {
|
|
@@ -6123,8 +6108,8 @@ function Evaluation$2(_ref) {
|
|
|
6123
6108
|
return jsx(PersonaEvaluation, {
|
|
6124
6109
|
poolInfo: poolInfo,
|
|
6125
6110
|
handleClose: handleClose,
|
|
6126
|
-
pointsTestnetExperience: pointsTestnetExperience,
|
|
6127
6111
|
campaign: campaign,
|
|
6112
|
+
networkType: networkType,
|
|
6128
6113
|
chainType: CHAIN_TYPE.EVM
|
|
6129
6114
|
});
|
|
6130
6115
|
}
|
|
@@ -6138,6 +6123,7 @@ function ApproveLenderBase(_ref) {
|
|
|
6138
6123
|
seniorTrancheVault,
|
|
6139
6124
|
isUniTranche,
|
|
6140
6125
|
chainType,
|
|
6126
|
+
networkType,
|
|
6141
6127
|
chainSpecificData,
|
|
6142
6128
|
changeTranche
|
|
6143
6129
|
} = _ref;
|
|
@@ -6152,7 +6138,7 @@ function ApproveLenderBase(_ref) {
|
|
|
6152
6138
|
while (tryAttempts > 0) {
|
|
6153
6139
|
try {
|
|
6154
6140
|
tryAttempts -= 1;
|
|
6155
|
-
await IdentityServiceV2.approveLender(account, chainId, trancheVault, isDev, chainSpecificData);
|
|
6141
|
+
await IdentityServiceV2.approveLender(networkType, account, chainId, trancheVault, isDev, chainSpecificData);
|
|
6156
6142
|
tryAttempts = 0;
|
|
6157
6143
|
} catch (e) {
|
|
6158
6144
|
if (tryAttempts === 0) {
|
|
@@ -6165,7 +6151,7 @@ function ApproveLenderBase(_ref) {
|
|
|
6165
6151
|
}
|
|
6166
6152
|
}
|
|
6167
6153
|
}
|
|
6168
|
-
}, [account, chainId, chainSpecificData, dispatch, isDev]);
|
|
6154
|
+
}, [account, chainId, chainSpecificData, dispatch, isDev, networkType]);
|
|
6169
6155
|
useEffect(() => {
|
|
6170
6156
|
const approveLenderAsync = async () => {
|
|
6171
6157
|
if (account && chainId) {
|
|
@@ -6199,6 +6185,7 @@ function ApproveLender$1(_ref) {
|
|
|
6199
6185
|
seniorTrancheVault: poolInfo.seniorTrancheVault,
|
|
6200
6186
|
isUniTranche: isUniTranche,
|
|
6201
6187
|
chainType: CHAIN_TYPE.EVM,
|
|
6188
|
+
networkType: getEvmNetworkType(poolInfo.chainId),
|
|
6202
6189
|
changeTranche: changeTranche
|
|
6203
6190
|
});
|
|
6204
6191
|
}
|
|
@@ -6308,7 +6295,7 @@ function Transfer$c(_ref) {
|
|
|
6308
6295
|
let {
|
|
6309
6296
|
poolInfo,
|
|
6310
6297
|
trancheType,
|
|
6311
|
-
|
|
6298
|
+
networkType,
|
|
6312
6299
|
campaign
|
|
6313
6300
|
} = _ref;
|
|
6314
6301
|
const isDev = checkIsDev();
|
|
@@ -6329,14 +6316,14 @@ function Transfer$c(_ref) {
|
|
|
6329
6316
|
const handleSuccess = useCallback(async options => {
|
|
6330
6317
|
if (campaign && options !== null && options !== void 0 && options.txHash) {
|
|
6331
6318
|
try {
|
|
6332
|
-
const result = await CampaignService.
|
|
6319
|
+
const result = await CampaignService.updateHumaAccountPoints(account, options.txHash, chainId, networkType, isDev);
|
|
6333
6320
|
dispatch(setPointsAccumulated(result.pointsAccumulated));
|
|
6334
6321
|
} catch (error) {
|
|
6335
6322
|
console.error('Failed to update wallet points', error);
|
|
6336
6323
|
}
|
|
6337
6324
|
}
|
|
6338
6325
|
dispatch(setStep(WIDGET_STEP.Done));
|
|
6339
|
-
}, [account, campaign, chainId, dispatch, isDev,
|
|
6326
|
+
}, [account, campaign, chainId, dispatch, isDev, networkType]);
|
|
6340
6327
|
if (!trancheVaultContract || !account) {
|
|
6341
6328
|
return null;
|
|
6342
6329
|
}
|
|
@@ -6444,7 +6431,6 @@ function Notifications$1(_ref) {
|
|
|
6444
6431
|
function LendSupplyV2(_ref) {
|
|
6445
6432
|
let {
|
|
6446
6433
|
poolName: poolNameStr,
|
|
6447
|
-
pointsTestnetExperience,
|
|
6448
6434
|
campaign,
|
|
6449
6435
|
handleClose,
|
|
6450
6436
|
handleSuccess
|
|
@@ -6524,8 +6510,8 @@ function LendSupplyV2(_ref) {
|
|
|
6524
6510
|
}), step === WIDGET_STEP.Evaluation && jsx(Evaluation$2, {
|
|
6525
6511
|
poolInfo: poolInfo,
|
|
6526
6512
|
handleClose: handleClose,
|
|
6527
|
-
|
|
6528
|
-
|
|
6513
|
+
campaign: campaign,
|
|
6514
|
+
networkType: getEvmNetworkType(poolInfo.chainId)
|
|
6529
6515
|
}), step === WIDGET_STEP.ApproveLender && jsx(ApproveLender$1, {
|
|
6530
6516
|
poolInfo: poolInfo,
|
|
6531
6517
|
isUniTranche: isUniTranche,
|
|
@@ -6542,8 +6528,8 @@ function LendSupplyV2(_ref) {
|
|
|
6542
6528
|
}), step === WIDGET_STEP.Transfer && selectedTranche && jsx(Transfer$c, {
|
|
6543
6529
|
poolInfo: poolInfo,
|
|
6544
6530
|
trancheType: selectedTranche,
|
|
6545
|
-
|
|
6546
|
-
|
|
6531
|
+
campaign: campaign,
|
|
6532
|
+
networkType: getEvmNetworkType(poolInfo.chainId)
|
|
6547
6533
|
}), step === WIDGET_STEP.Done && jsx(Success$7, {
|
|
6548
6534
|
poolInfo: poolInfo,
|
|
6549
6535
|
lpConfig: lpConfig,
|
|
@@ -8571,7 +8557,7 @@ function Evaluation(_ref) {
|
|
|
8571
8557
|
var _poolInfo$KYC;
|
|
8572
8558
|
let {
|
|
8573
8559
|
poolInfo,
|
|
8574
|
-
|
|
8560
|
+
networkType,
|
|
8575
8561
|
campaign,
|
|
8576
8562
|
handleClose
|
|
8577
8563
|
} = _ref;
|
|
@@ -8583,9 +8569,9 @@ function Evaluation(_ref) {
|
|
|
8583
8569
|
seniorTrancheVault: poolInfo.seniorTrancheMint
|
|
8584
8570
|
},
|
|
8585
8571
|
handleClose: handleClose,
|
|
8586
|
-
|
|
8587
|
-
|
|
8588
|
-
|
|
8572
|
+
networkType: networkType,
|
|
8573
|
+
chainType: CHAIN_TYPE.SOLANA,
|
|
8574
|
+
campaign: campaign
|
|
8589
8575
|
});
|
|
8590
8576
|
}
|
|
8591
8577
|
return null;
|
|
@@ -8603,6 +8589,7 @@ function ApproveLender(_ref) {
|
|
|
8603
8589
|
seniorTrancheVault: poolInfo.seniorTrancheMint,
|
|
8604
8590
|
isUniTranche: isUniTranche,
|
|
8605
8591
|
chainType: CHAIN_TYPE.SOLANA,
|
|
8592
|
+
networkType: getSolanaNetworkType(poolInfo.chainId),
|
|
8606
8593
|
chainSpecificData: {
|
|
8607
8594
|
huma_program_id: solanaChainInfo.poolProgram,
|
|
8608
8595
|
pool_id: poolInfo.poolId
|
|
@@ -8888,7 +8875,7 @@ function Transfer$6(_ref) {
|
|
|
8888
8875
|
poolInfo,
|
|
8889
8876
|
poolState,
|
|
8890
8877
|
selectedTranche,
|
|
8891
|
-
|
|
8878
|
+
networkType
|
|
8892
8879
|
} = _ref;
|
|
8893
8880
|
const isDev = checkIsDev();
|
|
8894
8881
|
const dispatch = useAppDispatch();
|
|
@@ -8921,14 +8908,14 @@ function Transfer$6(_ref) {
|
|
|
8921
8908
|
const handleSuccess = useCallback(async options => {
|
|
8922
8909
|
if (publicKey && poolState.campaign && options !== null && options !== void 0 && options.signature) {
|
|
8923
8910
|
try {
|
|
8924
|
-
const result = await CampaignService.
|
|
8911
|
+
const result = await CampaignService.updateHumaAccountPoints(publicKey.toString(), options.signature, poolInfo.chainId, networkType, isDev);
|
|
8925
8912
|
dispatch(setPointsAccumulated(result.pointsAccumulated));
|
|
8926
8913
|
} catch (error) {
|
|
8927
8914
|
console.error('Failed to update wallet points', error);
|
|
8928
8915
|
}
|
|
8929
8916
|
}
|
|
8930
8917
|
dispatch(setStep(WIDGET_STEP.Done));
|
|
8931
|
-
}, [dispatch, isDev,
|
|
8918
|
+
}, [dispatch, isDev, networkType, poolInfo.chainId, poolState.campaign, publicKey]);
|
|
8932
8919
|
useEffect(() => {
|
|
8933
8920
|
async function getTx() {
|
|
8934
8921
|
var _poolState$seniorTran, _poolState$juniorTran, _seniorTrancheMintSup, _juniorTrancheMintSup, _poolState$seniorTran2, _poolState$juniorTran2, _seniorTrancheMintSup2, _juniorTrancheMintSup2, _seniorTokenAccount$a, _juniorTokenAccount$a;
|
|
@@ -9106,7 +9093,6 @@ function SolanaLendSupply(_ref) {
|
|
|
9106
9093
|
let {
|
|
9107
9094
|
poolInfo,
|
|
9108
9095
|
poolState,
|
|
9109
|
-
pointsTestnetExperience,
|
|
9110
9096
|
handleClose,
|
|
9111
9097
|
handleSuccess
|
|
9112
9098
|
} = _ref;
|
|
@@ -9166,8 +9152,8 @@ function SolanaLendSupply(_ref) {
|
|
|
9166
9152
|
handleSuccess: handleSuccess,
|
|
9167
9153
|
children: [step === WIDGET_STEP.Evaluation && jsx(Evaluation, {
|
|
9168
9154
|
poolInfo: poolInfo,
|
|
9169
|
-
pointsTestnetExperience: pointsTestnetExperience,
|
|
9170
9155
|
campaign: poolState.campaign,
|
|
9156
|
+
networkType: getSolanaNetworkType(poolInfo.chainId),
|
|
9171
9157
|
handleClose: handleClose
|
|
9172
9158
|
}), step === WIDGET_STEP.ApproveLender && jsx(ApproveLender, {
|
|
9173
9159
|
poolInfo: poolInfo,
|
|
@@ -9189,7 +9175,7 @@ function SolanaLendSupply(_ref) {
|
|
|
9189
9175
|
poolInfo: poolInfo,
|
|
9190
9176
|
poolState: poolState,
|
|
9191
9177
|
selectedTranche: selectedTranche,
|
|
9192
|
-
|
|
9178
|
+
networkType: getSolanaNetworkType(poolInfo.chainId)
|
|
9193
9179
|
}), step === WIDGET_STEP.Done && jsx(Success$2, {
|
|
9194
9180
|
poolInfo: poolInfo,
|
|
9195
9181
|
poolState: poolState,
|