@ecency/wallets 1.5.3 → 1.5.5

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.
@@ -1501,9 +1501,45 @@ function useClaimRewards(username, auth, onSuccess) {
1501
1501
  queryClient.invalidateQueries({
1502
1502
  queryKey: sdk.getAccountFullQueryOptions(username).queryKey
1503
1503
  });
1504
+ queryClient.invalidateQueries({
1505
+ queryKey: getVisionPortfolioQueryOptions(username).queryKey
1506
+ });
1507
+ queryClient.invalidateQueries({
1508
+ queryKey: getHiveAssetGeneralInfoQueryOptions(username).queryKey
1509
+ });
1510
+ queryClient.invalidateQueries({
1511
+ queryKey: getHbdAssetGeneralInfoQueryOptions(username).queryKey
1512
+ });
1504
1513
  queryClient.invalidateQueries({
1505
1514
  queryKey: getHivePowerAssetGeneralInfoQueryOptions(username).queryKey
1506
1515
  });
1516
+ ["HIVE", "HBD", "HP"].forEach((asset) => {
1517
+ queryClient.invalidateQueries({
1518
+ queryKey: ["ecency-wallets", "asset-info", username, asset]
1519
+ });
1520
+ });
1521
+ setTimeout(() => {
1522
+ queryClient.invalidateQueries({
1523
+ queryKey: sdk.getAccountFullQueryOptions(username).queryKey
1524
+ });
1525
+ queryClient.invalidateQueries({
1526
+ queryKey: getVisionPortfolioQueryOptions(username).queryKey
1527
+ });
1528
+ queryClient.invalidateQueries({
1529
+ queryKey: getHiveAssetGeneralInfoQueryOptions(username).queryKey
1530
+ });
1531
+ queryClient.invalidateQueries({
1532
+ queryKey: getHbdAssetGeneralInfoQueryOptions(username).queryKey
1533
+ });
1534
+ queryClient.invalidateQueries({
1535
+ queryKey: getHivePowerAssetGeneralInfoQueryOptions(username).queryKey
1536
+ });
1537
+ ["HIVE", "HBD", "HP"].forEach((asset) => {
1538
+ queryClient.invalidateQueries({
1539
+ queryKey: ["ecency-wallets", "asset-info", username, asset]
1540
+ });
1541
+ });
1542
+ }, 5e3);
1507
1543
  },
1508
1544
  auth
1509
1545
  );
@@ -2706,6 +2742,13 @@ function useClaimPoints(username, accessToken, onSuccess, onError) {
2706
2742
  );
2707
2743
  if (!response.ok) {
2708
2744
  const body = await response.text();
2745
+ if (response.status === 406) {
2746
+ try {
2747
+ return JSON.parse(body);
2748
+ } catch {
2749
+ return { message: body, code: response.status };
2750
+ }
2751
+ }
2709
2752
  throw new Error(
2710
2753
  `[SDK][Wallets][Assets][Points][Claim] \u2013 failed with status ${response.status}${body ? `: ${body}` : ""}`
2711
2754
  );
@@ -4280,6 +4323,12 @@ function useWalletOperation(username, asset, operation, auth) {
4280
4323
  5e3
4281
4324
  );
4282
4325
  });
4326
+ setTimeout(
4327
+ () => sdk.getQueryClient().invalidateQueries({
4328
+ queryKey: getVisionPortfolioQueryOptions(username).queryKey
4329
+ }),
4330
+ 4e3
4331
+ );
4283
4332
  }
4284
4333
  });
4285
4334
  }