@huma-finance/widgets 0.0.61-beta.544 → 0.0.61-beta.546
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 +74 -51
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/index.js +74 -51
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
- package/src/components/Lend/supplyV2/8-PointsEarned.tsx +72 -76
package/dist/cjs/index.cjs
CHANGED
|
@@ -6291,8 +6291,8 @@ var STATE = /*#__PURE__*/function (STATE) {
|
|
|
6291
6291
|
STATE["SignIn"] = "SignIn";
|
|
6292
6292
|
STATE["Congrats"] = "Congrats";
|
|
6293
6293
|
return STATE;
|
|
6294
|
-
}(STATE || {});
|
|
6295
|
-
|
|
6294
|
+
}(STATE || {}); // const ERROR_MESSAGE =
|
|
6295
|
+
// 'Failed to update wallet points. Be assured that your points will be added later.'
|
|
6296
6296
|
function PointsEarned(_ref) {
|
|
6297
6297
|
let {
|
|
6298
6298
|
transactionHash,
|
|
@@ -6311,61 +6311,84 @@ function PointsEarned(_ref) {
|
|
|
6311
6311
|
const hasPointsAccumulated = !shared.isEmpty(pointsAccumulated) && pointsAccumulated > 0;
|
|
6312
6312
|
const lockupMonths = Math.round(lpConfig.withdrawalLockoutPeriodInDays / 30);
|
|
6313
6313
|
const monthText = lockupMonths > 1 ? "".concat(lockupMonths, " months") : "".concat(lockupMonths, " month");
|
|
6314
|
-
|
|
6315
|
-
|
|
6316
|
-
|
|
6317
|
-
|
|
6318
|
-
|
|
6319
|
-
|
|
6320
|
-
|
|
6314
|
+
|
|
6315
|
+
// const {
|
|
6316
|
+
// errorType,
|
|
6317
|
+
// setError: setAuthError,
|
|
6318
|
+
// isWalletOwnershipVerified,
|
|
6319
|
+
// isWalletOwnershipVerificationRequired,
|
|
6320
|
+
// } = useAuthErrorHandling(isDev)
|
|
6321
|
+
// const [walletOwnership, setWalletOwnership] = useState<boolean | undefined>()
|
|
6321
6322
|
const [state, setState] = React.useState(STATE.Loading);
|
|
6322
|
-
|
|
6323
|
-
|
|
6324
|
-
|
|
6325
|
-
|
|
6326
|
-
}
|
|
6327
|
-
|
|
6328
|
-
|
|
6329
|
-
|
|
6330
|
-
|
|
6331
|
-
|
|
6332
|
-
|
|
6333
|
-
|
|
6334
|
-
|
|
6335
|
-
|
|
6336
|
-
|
|
6337
|
-
|
|
6338
|
-
|
|
6339
|
-
|
|
6340
|
-
|
|
6341
|
-
|
|
6342
|
-
|
|
6343
|
-
|
|
6344
|
-
|
|
6345
|
-
|
|
6346
|
-
|
|
6347
|
-
|
|
6348
|
-
|
|
6349
|
-
|
|
6350
|
-
|
|
6351
|
-
|
|
6352
|
-
|
|
6353
|
-
|
|
6354
|
-
|
|
6323
|
+
|
|
6324
|
+
// useEffect(() => {
|
|
6325
|
+
// if (isWalletOwnershipVerificationRequired) {
|
|
6326
|
+
// setState(STATE.Loading)
|
|
6327
|
+
// }
|
|
6328
|
+
// }, [isWalletOwnershipVerificationRequired])
|
|
6329
|
+
|
|
6330
|
+
// useEffect(() => {
|
|
6331
|
+
// if (isWalletOwnershipVerified) {
|
|
6332
|
+
// setWalletOwnership(true)
|
|
6333
|
+
// }
|
|
6334
|
+
// }, [isWalletOwnershipVerified])
|
|
6335
|
+
|
|
6336
|
+
// useEffect(() => {
|
|
6337
|
+
// const checkWalletOwnership = async () => {
|
|
6338
|
+
// const ownership = await CampaignService.checkWalletOwnership(
|
|
6339
|
+
// account!,
|
|
6340
|
+
// isDev,
|
|
6341
|
+
// pointsTestnetExperience,
|
|
6342
|
+
// )
|
|
6343
|
+
// setWalletOwnership(ownership)
|
|
6344
|
+
// if (!ownership) {
|
|
6345
|
+
// setAuthError('WalletNotSignInException')
|
|
6346
|
+
// }
|
|
6347
|
+
// }
|
|
6348
|
+
// checkWalletOwnership()
|
|
6349
|
+
// }, [account, isDev, pointsTestnetExperience, setAuthError])
|
|
6350
|
+
|
|
6351
|
+
// useEffect(() => {
|
|
6352
|
+
// if (errorType === 'NotSignedIn') {
|
|
6353
|
+
// setState(STATE.SignIn)
|
|
6354
|
+
// } else if (errorType === 'UserRejected') {
|
|
6355
|
+
// dispatch(
|
|
6356
|
+
// setError({
|
|
6357
|
+
// errorMessage: 'User has rejected the transaction.',
|
|
6358
|
+
// }),
|
|
6359
|
+
// )
|
|
6360
|
+
// } else if (errorType === 'Other') {
|
|
6361
|
+
// dispatch(
|
|
6362
|
+
// setError({
|
|
6363
|
+
// errorMessage: ERROR_MESSAGE,
|
|
6364
|
+
// }),
|
|
6365
|
+
// )
|
|
6366
|
+
// }
|
|
6367
|
+
// }, [dispatch, errorType])
|
|
6368
|
+
|
|
6355
6369
|
React.useEffect(() => {
|
|
6356
6370
|
const updateWalletPoints = async () => {
|
|
6357
|
-
if (walletOwnership) {
|
|
6358
|
-
|
|
6359
|
-
|
|
6360
|
-
|
|
6361
|
-
|
|
6362
|
-
|
|
6363
|
-
|
|
6364
|
-
|
|
6371
|
+
// if (walletOwnership) {
|
|
6372
|
+
try {
|
|
6373
|
+
// const result = await CampaignService.updateWalletPoints(
|
|
6374
|
+
// account!,
|
|
6375
|
+
// transactionHash,
|
|
6376
|
+
// chainId!,
|
|
6377
|
+
// isDev,
|
|
6378
|
+
// pointsTestnetExperience,
|
|
6379
|
+
// )
|
|
6380
|
+
// setPointsAccumulated(result.pointsAccumulated)
|
|
6381
|
+
setPointsAccumulated(5000);
|
|
6382
|
+
setState(STATE.Congrats);
|
|
6383
|
+
} catch (error) {
|
|
6384
|
+
console.error('Failed to update wallet points', error);
|
|
6365
6385
|
}
|
|
6386
|
+
// }
|
|
6366
6387
|
};
|
|
6367
6388
|
updateWalletPoints();
|
|
6368
|
-
}, [account, chainId, dispatch, isDev, pointsTestnetExperience, transactionHash
|
|
6389
|
+
}, [account, chainId, dispatch, isDev, pointsTestnetExperience, transactionHash
|
|
6390
|
+
// walletOwnership,
|
|
6391
|
+
]);
|
|
6369
6392
|
const styles = {
|
|
6370
6393
|
wrapper: material.css(_templateObject$8 || (_templateObject$8 = _taggedTemplateLiteral(["\n height: 518px;\n position: relative;\n "]))),
|
|
6371
6394
|
congrats: material.css(_templateObject2$6 || (_templateObject2$6 = _taggedTemplateLiteral(["\n margin: ", ";\n "])), theme.spacing(-4, -4.5, 0, -4.5)),
|