@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/index.js
CHANGED
|
@@ -6251,8 +6251,8 @@ var STATE = /*#__PURE__*/function (STATE) {
|
|
|
6251
6251
|
STATE["SignIn"] = "SignIn";
|
|
6252
6252
|
STATE["Congrats"] = "Congrats";
|
|
6253
6253
|
return STATE;
|
|
6254
|
-
}(STATE || {});
|
|
6255
|
-
|
|
6254
|
+
}(STATE || {}); // const ERROR_MESSAGE =
|
|
6255
|
+
// 'Failed to update wallet points. Be assured that your points will be added later.'
|
|
6256
6256
|
function PointsEarned(_ref) {
|
|
6257
6257
|
let {
|
|
6258
6258
|
transactionHash,
|
|
@@ -6271,61 +6271,84 @@ function PointsEarned(_ref) {
|
|
|
6271
6271
|
const hasPointsAccumulated = !isEmpty(pointsAccumulated) && pointsAccumulated > 0;
|
|
6272
6272
|
const lockupMonths = Math.round(lpConfig.withdrawalLockoutPeriodInDays / 30);
|
|
6273
6273
|
const monthText = lockupMonths > 1 ? "".concat(lockupMonths, " months") : "".concat(lockupMonths, " month");
|
|
6274
|
-
|
|
6275
|
-
|
|
6276
|
-
|
|
6277
|
-
|
|
6278
|
-
|
|
6279
|
-
|
|
6280
|
-
|
|
6274
|
+
|
|
6275
|
+
// const {
|
|
6276
|
+
// errorType,
|
|
6277
|
+
// setError: setAuthError,
|
|
6278
|
+
// isWalletOwnershipVerified,
|
|
6279
|
+
// isWalletOwnershipVerificationRequired,
|
|
6280
|
+
// } = useAuthErrorHandling(isDev)
|
|
6281
|
+
// const [walletOwnership, setWalletOwnership] = useState<boolean | undefined>()
|
|
6281
6282
|
const [state, setState] = useState(STATE.Loading);
|
|
6282
|
-
|
|
6283
|
-
|
|
6284
|
-
|
|
6285
|
-
|
|
6286
|
-
}
|
|
6287
|
-
|
|
6288
|
-
|
|
6289
|
-
|
|
6290
|
-
|
|
6291
|
-
|
|
6292
|
-
|
|
6293
|
-
|
|
6294
|
-
|
|
6295
|
-
|
|
6296
|
-
|
|
6297
|
-
|
|
6298
|
-
|
|
6299
|
-
|
|
6300
|
-
|
|
6301
|
-
|
|
6302
|
-
|
|
6303
|
-
|
|
6304
|
-
|
|
6305
|
-
|
|
6306
|
-
|
|
6307
|
-
|
|
6308
|
-
|
|
6309
|
-
|
|
6310
|
-
|
|
6311
|
-
|
|
6312
|
-
|
|
6313
|
-
|
|
6314
|
-
|
|
6283
|
+
|
|
6284
|
+
// useEffect(() => {
|
|
6285
|
+
// if (isWalletOwnershipVerificationRequired) {
|
|
6286
|
+
// setState(STATE.Loading)
|
|
6287
|
+
// }
|
|
6288
|
+
// }, [isWalletOwnershipVerificationRequired])
|
|
6289
|
+
|
|
6290
|
+
// useEffect(() => {
|
|
6291
|
+
// if (isWalletOwnershipVerified) {
|
|
6292
|
+
// setWalletOwnership(true)
|
|
6293
|
+
// }
|
|
6294
|
+
// }, [isWalletOwnershipVerified])
|
|
6295
|
+
|
|
6296
|
+
// useEffect(() => {
|
|
6297
|
+
// const checkWalletOwnership = async () => {
|
|
6298
|
+
// const ownership = await CampaignService.checkWalletOwnership(
|
|
6299
|
+
// account!,
|
|
6300
|
+
// isDev,
|
|
6301
|
+
// pointsTestnetExperience,
|
|
6302
|
+
// )
|
|
6303
|
+
// setWalletOwnership(ownership)
|
|
6304
|
+
// if (!ownership) {
|
|
6305
|
+
// setAuthError('WalletNotSignInException')
|
|
6306
|
+
// }
|
|
6307
|
+
// }
|
|
6308
|
+
// checkWalletOwnership()
|
|
6309
|
+
// }, [account, isDev, pointsTestnetExperience, setAuthError])
|
|
6310
|
+
|
|
6311
|
+
// useEffect(() => {
|
|
6312
|
+
// if (errorType === 'NotSignedIn') {
|
|
6313
|
+
// setState(STATE.SignIn)
|
|
6314
|
+
// } else if (errorType === 'UserRejected') {
|
|
6315
|
+
// dispatch(
|
|
6316
|
+
// setError({
|
|
6317
|
+
// errorMessage: 'User has rejected the transaction.',
|
|
6318
|
+
// }),
|
|
6319
|
+
// )
|
|
6320
|
+
// } else if (errorType === 'Other') {
|
|
6321
|
+
// dispatch(
|
|
6322
|
+
// setError({
|
|
6323
|
+
// errorMessage: ERROR_MESSAGE,
|
|
6324
|
+
// }),
|
|
6325
|
+
// )
|
|
6326
|
+
// }
|
|
6327
|
+
// }, [dispatch, errorType])
|
|
6328
|
+
|
|
6315
6329
|
useEffect(() => {
|
|
6316
6330
|
const updateWalletPoints = async () => {
|
|
6317
|
-
if (walletOwnership) {
|
|
6318
|
-
|
|
6319
|
-
|
|
6320
|
-
|
|
6321
|
-
|
|
6322
|
-
|
|
6323
|
-
|
|
6324
|
-
|
|
6331
|
+
// if (walletOwnership) {
|
|
6332
|
+
try {
|
|
6333
|
+
// const result = await CampaignService.updateWalletPoints(
|
|
6334
|
+
// account!,
|
|
6335
|
+
// transactionHash,
|
|
6336
|
+
// chainId!,
|
|
6337
|
+
// isDev,
|
|
6338
|
+
// pointsTestnetExperience,
|
|
6339
|
+
// )
|
|
6340
|
+
// setPointsAccumulated(result.pointsAccumulated)
|
|
6341
|
+
setPointsAccumulated(5000);
|
|
6342
|
+
setState(STATE.Congrats);
|
|
6343
|
+
} catch (error) {
|
|
6344
|
+
console.error('Failed to update wallet points', error);
|
|
6325
6345
|
}
|
|
6346
|
+
// }
|
|
6326
6347
|
};
|
|
6327
6348
|
updateWalletPoints();
|
|
6328
|
-
}, [account, chainId, dispatch, isDev, pointsTestnetExperience, transactionHash
|
|
6349
|
+
}, [account, chainId, dispatch, isDev, pointsTestnetExperience, transactionHash
|
|
6350
|
+
// walletOwnership,
|
|
6351
|
+
]);
|
|
6329
6352
|
const styles = {
|
|
6330
6353
|
wrapper: css(_templateObject$8 || (_templateObject$8 = _taggedTemplateLiteral(["\n height: 518px;\n position: relative;\n "]))),
|
|
6331
6354
|
congrats: css(_templateObject2$6 || (_templateObject2$6 = _taggedTemplateLiteral(["\n margin: ", ";\n "])), theme.spacing(-4, -4.5, 0, -4.5)),
|