@sodax/dapp-kit 2.1.0 → 2.2.0-rc.2

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.
Files changed (70) hide show
  1. package/README.md +2 -0
  2. package/dist/index.d.ts +120 -8
  3. package/dist/index.mjs +126 -61
  4. package/package.json +3 -3
  5. package/src/hooks/_apiKeyWire.test.ts +487 -0
  6. package/src/hooks/_mutationContract.test.ts +6 -0
  7. package/src/hooks/backend/index.ts +4 -0
  8. package/src/hooks/backend/useBackendOracleCandles.ts +47 -0
  9. package/src/hooks/backend/useBackendOracleMarkets.ts +30 -0
  10. package/src/hooks/bitcoin/useFundTradingWallet.ts +2 -1
  11. package/src/hooks/bitcoin/useRadfiWithdraw.ts +2 -1
  12. package/src/hooks/bridge/useBridge.test.ts +104 -0
  13. package/src/hooks/bridge/useBridge.ts +2 -2
  14. package/src/hooks/dex/useDexDeposit.ts +2 -1
  15. package/src/hooks/dex/useDexWithdraw.ts +2 -1
  16. package/src/hooks/dex/useSupplyLiquidity.ts +2 -1
  17. package/src/hooks/leverageYield/useLeverageYieldVaultSwap.ts +2 -2
  18. package/src/hooks/migrate/useMigrateBaln.ts +2 -2
  19. package/src/hooks/migrate/useMigrateIcxToSoda.ts +2 -2
  20. package/src/hooks/migrate/useMigratebnUSD.ts +2 -2
  21. package/src/hooks/migrate/useRevertMigrateSodaToIcx.ts +2 -2
  22. package/src/hooks/mm/useBorrow.ts +2 -4
  23. package/src/hooks/mm/useRepay.ts +2 -1
  24. package/src/hooks/mm/useSupply.ts +2 -1
  25. package/src/hooks/mm/useWithdraw.ts +2 -4
  26. package/src/hooks/partner/useFeeClaimWithdraw.ts +2 -1
  27. package/src/hooks/recovery/useWithdrawHubAsset.ts +2 -1
  28. package/src/hooks/shared/index.ts +3 -0
  29. package/src/hooks/shared/invalidateBalances.test.ts +71 -0
  30. package/src/hooks/shared/invalidateBalances.ts +25 -0
  31. package/src/hooks/shared/retryUnlessAuthFailure.test.ts +38 -0
  32. package/src/hooks/shared/retryUnlessAuthFailure.ts +18 -0
  33. package/src/hooks/shared/useBalances.test.ts +118 -0
  34. package/src/hooks/shared/useBalances.ts +81 -0
  35. package/src/hooks/shared/useEstablishTrustline.test.ts +2 -0
  36. package/src/hooks/shared/useEstablishTrustline.ts +2 -1
  37. package/src/hooks/shared/useStellarGate.test.ts +1 -1
  38. package/src/hooks/sponsoring/useActivateStellarAccount.test.ts +6 -4
  39. package/src/hooks/sponsoring/useActivateStellarAccount.ts +2 -1
  40. package/src/hooks/sponsoring/useActivateStellarAccount.wire.test.ts +109 -0
  41. package/src/hooks/sponsoring/useSponsorConfig.test.ts +8 -2
  42. package/src/hooks/sponsoring/useStellarAccountActive.test.ts +2 -2
  43. package/src/hooks/sponsoring/useStellarAccountStatus.test.ts +8 -2
  44. package/src/hooks/staking/useClaim.ts +2 -1
  45. package/src/hooks/staking/useInstantUnstake.ts +2 -1
  46. package/src/hooks/staking/useStake.ts +2 -1
  47. package/src/hooks/swap/useDetailedStatus.test.ts +2 -2
  48. package/src/hooks/swap/useSwap.test.ts +128 -0
  49. package/src/hooks/swap/useSwap.ts +2 -2
  50. package/src/hooks/swapsApi/useSwapsApiAllowance.ts +2 -1
  51. package/src/hooks/swapsApi/useSwapsApiApprove.ts +2 -1
  52. package/src/hooks/swapsApi/useSwapsApiCancelIntent.ts +2 -1
  53. package/src/hooks/swapsApi/useSwapsApiCreateIntent.ts +2 -1
  54. package/src/hooks/swapsApi/useSwapsApiCreateLimitOrder.ts +2 -1
  55. package/src/hooks/swapsApi/useSwapsApiDeadline.ts +2 -1
  56. package/src/hooks/swapsApi/useSwapsApiEstimateGas.ts +2 -1
  57. package/src/hooks/swapsApi/useSwapsApiFilledIntent.ts +2 -1
  58. package/src/hooks/swapsApi/useSwapsApiIntent.ts +2 -1
  59. package/src/hooks/swapsApi/useSwapsApiIntentExtraData.ts +2 -1
  60. package/src/hooks/swapsApi/useSwapsApiIntentHash.ts +2 -1
  61. package/src/hooks/swapsApi/useSwapsApiIntentPacket.ts +2 -1
  62. package/src/hooks/swapsApi/useSwapsApiPartnerFee.ts +2 -1
  63. package/src/hooks/swapsApi/useSwapsApiQuote.ts +5 -1
  64. package/src/hooks/swapsApi/useSwapsApiSolverFee.ts +2 -1
  65. package/src/hooks/swapsApi/useSwapsApiStatus.ts +10 -4
  66. package/src/hooks/swapsApi/useSwapsApiSubmitTx.ts +5 -3
  67. package/src/hooks/swapsApi/useSwapsApiSubmitTxStatus.ts +8 -4
  68. package/src/hooks/swapsApi/useSwapsApiTokens.ts +2 -1
  69. package/src/hooks/swapsApi/useSwapsApiTokensByChain.ts +2 -1
  70. package/src/providers/SodaxProvider.test.ts +41 -0
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { isSodaxError, ChainKeys, STELLAR_TRUSTLINE_MIN_XLM_STROOPS, RadfiApiError, normalizePsbtToBase64, ClService, SPONSOR_CONFIG_TTL_MS, Sodax, SolverIntentStatusCode, DETAILED_STATUS_NOT_DELIVERED, isApprovalSupportedChainKeyType, isHubChainKeyType, isEvmSpokeOnlyChainKeyType, isStellarChainKeyType } from '@sodax/sdk';
1
+ import { isSodaxError, isAuthFailure, ChainKeys, STELLAR_TRUSTLINE_MIN_XLM_STROOPS, RadfiApiError, normalizePsbtToBase64, ClService, SPONSOR_CONFIG_TTL_MS, Sodax, SolverIntentStatusCode, DETAILED_STATUS_NOT_DELIVERED, isApprovalSupportedChainKeyType, isHubChainKeyType, isEvmSpokeOnlyChainKeyType, isStellarChainKeyType } from '@sodax/sdk';
2
2
  export * from '@sodax/sdk';
3
3
  import { useMutation, useQuery, useQueryClient, useQueries, QueryClient, MutationCache } from '@tanstack/react-query';
4
4
  import { createContext, useCallback, useContext, useRef, useState, useEffect, useMemo } from 'react';
@@ -9,6 +9,8 @@ import { jsx } from 'react/jsx-runtime';
9
9
  function isUserRejectedError(error) {
10
10
  return isSodaxError(error) && error.code === "USER_REJECTED";
11
11
  }
12
+ var MAX_RETRIES = 3;
13
+ var retryUnlessAuthFailure = (failureCount, error) => !isAuthFailure(error) && failureCount < MAX_RETRIES;
12
14
 
13
15
  // src/hooks/shared/unwrapResult.ts
14
16
  function unwrapResult(result) {
@@ -111,6 +113,17 @@ function useStellarTrustlineCheck({
111
113
  ...queryOptions
112
114
  });
113
115
  }
116
+
117
+ // src/hooks/shared/invalidateBalances.ts
118
+ function invalidateBalances(queryClient, ...chainKeys) {
119
+ for (const chainKey of new Set(chainKeys)) {
120
+ if (!chainKey) continue;
121
+ queryClient.invalidateQueries({ queryKey: ["shared", "balances", chainKey] });
122
+ queryClient.invalidateQueries({ queryKey: ["shared", "xBalances", chainKey] });
123
+ }
124
+ }
125
+
126
+ // src/hooks/shared/useEstablishTrustline.ts
114
127
  function useEstablishTrustline({
115
128
  mutationOptions
116
129
  } = {}) {
@@ -141,7 +154,7 @@ function useEstablishTrustline({
141
154
  queryClient.invalidateQueries({
142
155
  queryKey: srcAddress ? ["sponsoring", "stellarAccountStatus", srcAddress] : ["sponsoring", "stellarAccountStatus"]
143
156
  });
144
- queryClient.invalidateQueries({ queryKey: ["shared", "xBalances", ChainKeys.STELLAR_MAINNET] });
157
+ invalidateBalances(queryClient, ChainKeys.STELLAR_MAINNET);
145
158
  await mutationOptions?.onSuccess?.(data, vars, ctx);
146
159
  }
147
160
  });
@@ -286,7 +299,7 @@ function useActivateStellarAccount({
286
299
  queryClient.invalidateQueries({ queryKey: ["sponsoring", "stellarAccountActive", vars.address] });
287
300
  queryClient.invalidateQueries({ queryKey: ["sponsoring", "stellarAccountStatus", vars.address] });
288
301
  queryClient.invalidateQueries({ queryKey: ["shared", "stellarTrustlineCheck"] });
289
- queryClient.invalidateQueries({ queryKey: ["shared", "xBalances", ChainKeys.STELLAR_MAINNET] });
302
+ invalidateBalances(queryClient, ChainKeys.STELLAR_MAINNET);
290
303
  await mutationOptions?.onSuccess?.(data, vars, ctx);
291
304
  }
292
305
  });
@@ -502,6 +515,34 @@ function useXBalances({
502
515
  ...queryOptions
503
516
  });
504
517
  }
518
+ var REFETCH_INTERVAL_MS2 = 5e3;
519
+ function getBalancesQueryOptions(sodax, { chainKey, tokens, address }) {
520
+ return {
521
+ // Pair symbol + address: readable in devtools, unique on-chain (symbol alone can collide —
522
+ // e.g. scam tokens copying a legitimate ticker).
523
+ queryKey: ["shared", "balances", chainKey, tokens.map((t) => [t.symbol, t.address]), address],
524
+ queryFn: async () => {
525
+ if (!chainKey || !address) return {};
526
+ return unwrapResult(await sodax.spoke.getWalletBalances({ srcChainKey: chainKey, srcAddress: address, tokens }));
527
+ },
528
+ enabled: !!chainKey && !!address && tokens.length > 0,
529
+ refetchInterval: REFETCH_INTERVAL_MS2
530
+ // Deliberately NOT `placeholderData: keepPreviousData`: the query key carries the chain, so a
531
+ // chain switch would surface the previous chain's map — and every EVM chain shares the native
532
+ // token address, so its native balance would render as the new chain's until the fetch lands.
533
+ };
534
+ }
535
+ function useBalances({ params, queryOptions } = {}) {
536
+ const { sodax } = useSodaxContext();
537
+ return useQuery({
538
+ ...getBalancesQueryOptions(sodax, {
539
+ chainKey: params?.chainKey,
540
+ tokens: params?.tokens ?? [],
541
+ address: params?.address
542
+ }),
543
+ ...queryOptions
544
+ });
545
+ }
505
546
 
506
547
  // src/hooks/provider/useHubProvider.ts
507
548
  function useHubProvider() {
@@ -620,7 +661,7 @@ function useFundTradingWallet({
620
661
  onSuccess: async (data, vars, ctx) => {
621
662
  queryClient.invalidateQueries({ queryKey: ["bitcoin", "balance"] });
622
663
  queryClient.invalidateQueries({ queryKey: ["bitcoin", "tradingWalletBalance"] });
623
- queryClient.invalidateQueries({ queryKey: ["shared", "xBalances", ChainKeys.BITCOIN_MAINNET] });
664
+ invalidateBalances(queryClient, ChainKeys.BITCOIN_MAINNET);
624
665
  await mutationOptions?.onSuccess?.(data, vars, ctx);
625
666
  }
626
667
  });
@@ -758,7 +799,7 @@ function useRadfiWithdraw({
758
799
  onSuccess: async (data, vars, ctx) => {
759
800
  queryClient.invalidateQueries({ queryKey: ["bitcoin", "tradingWalletBalance"] });
760
801
  queryClient.invalidateQueries({ queryKey: ["bitcoin", "balance"] });
761
- queryClient.invalidateQueries({ queryKey: ["shared", "xBalances", ChainKeys.BITCOIN_MAINNET] });
802
+ invalidateBalances(queryClient, ChainKeys.BITCOIN_MAINNET);
762
803
  await mutationOptions?.onSuccess?.(data, vars, ctx);
763
804
  }
764
805
  });
@@ -779,10 +820,7 @@ function useBorrow({
779
820
  queryKey: ["mm", "userFormattedSummary", params.srcChainKey, params.srcAddress]
780
821
  });
781
822
  queryClient.invalidateQueries({ queryKey: ["mm", "aTokensBalances"] });
782
- const balanceChains = /* @__PURE__ */ new Set([params.srcChainKey, params.dstChainKey ?? params.srcChainKey]);
783
- for (const chainKey of balanceChains) {
784
- queryClient.invalidateQueries({ queryKey: ["shared", "xBalances", chainKey] });
785
- }
823
+ invalidateBalances(queryClient, params.srcChainKey, params.dstChainKey);
786
824
  await mutationOptions?.onSuccess?.(data, vars, ctx);
787
825
  }
788
826
  });
@@ -804,7 +842,7 @@ function useRepay({
804
842
  });
805
843
  queryClient.invalidateQueries({ queryKey: ["mm", "aTokensBalances"] });
806
844
  queryClient.invalidateQueries({ queryKey: ["mm", "allowance", params.srcChainKey, params.token, params.action] });
807
- queryClient.invalidateQueries({ queryKey: ["shared", "xBalances", params.srcChainKey] });
845
+ invalidateBalances(queryClient, params.srcChainKey);
808
846
  await mutationOptions?.onSuccess?.(data, vars, ctx);
809
847
  }
810
848
  });
@@ -826,7 +864,7 @@ function useSupply({
826
864
  });
827
865
  queryClient.invalidateQueries({ queryKey: ["mm", "aTokensBalances"] });
828
866
  queryClient.invalidateQueries({ queryKey: ["mm", "allowance", params.srcChainKey, params.token, params.action] });
829
- queryClient.invalidateQueries({ queryKey: ["shared", "xBalances", params.srcChainKey] });
867
+ invalidateBalances(queryClient, params.srcChainKey);
830
868
  await mutationOptions?.onSuccess?.(data, vars, ctx);
831
869
  }
832
870
  });
@@ -847,10 +885,7 @@ function useWithdraw({
847
885
  queryKey: ["mm", "userFormattedSummary", params.srcChainKey, params.srcAddress]
848
886
  });
849
887
  queryClient.invalidateQueries({ queryKey: ["mm", "aTokensBalances"] });
850
- const balanceChains = /* @__PURE__ */ new Set([params.srcChainKey, params.dstChainKey ?? params.srcChainKey]);
851
- for (const chainKey of balanceChains) {
852
- queryClient.invalidateQueries({ queryKey: ["shared", "xBalances", chainKey] });
853
- }
888
+ invalidateBalances(queryClient, params.srcChainKey, params.dstChainKey);
854
889
  await mutationOptions?.onSuccess?.(data, vars, ctx);
855
890
  }
856
891
  });
@@ -1101,8 +1136,7 @@ function useSwap({
1101
1136
  ...mutationOptions,
1102
1137
  mutationFn: async (vars) => unwrapResult(await sodax.swaps.swap({ ...vars, raw: false })),
1103
1138
  onSuccess: async (data, vars, ctx) => {
1104
- queryClient.invalidateQueries({ queryKey: ["shared", "xBalances", vars.params.srcChainKey] });
1105
- queryClient.invalidateQueries({ queryKey: ["shared", "xBalances", vars.params.dstChainKey] });
1139
+ invalidateBalances(queryClient, vars.params.srcChainKey, vars.params.dstChainKey);
1106
1140
  await mutationOptions?.onSuccess?.(data, vars, ctx);
1107
1141
  }
1108
1142
  });
@@ -1500,6 +1534,39 @@ var useBackendAllMoneyMarketBorrowers = ({
1500
1534
  ...queryOptions
1501
1535
  });
1502
1536
  };
1537
+ var useBackendOracleMarkets = ({
1538
+ queryOptions
1539
+ } = {}) => {
1540
+ const { sodax } = useSodaxContext();
1541
+ return useQuery({
1542
+ queryKey: ["backend", "oracle", "markets"],
1543
+ queryFn: async () => {
1544
+ return unwrapResult(await sodax.backendApi.getOracleMarkets());
1545
+ },
1546
+ staleTime: 60 * 1e3,
1547
+ retry: 3,
1548
+ ...queryOptions
1549
+ });
1550
+ };
1551
+ var useBackendOracleCandles = ({
1552
+ params,
1553
+ queryOptions
1554
+ } = {}) => {
1555
+ const { sodax } = useSodaxContext();
1556
+ return useQuery({
1557
+ queryKey: ["backend", "oracle", "candles", params?.symbol, params?.interval, params?.from, params?.to],
1558
+ queryFn: async () => {
1559
+ if (!params) {
1560
+ throw new Error("symbol, interval, from and to are required");
1561
+ }
1562
+ return unwrapResult(await sodax.backendApi.getOracleCandles(params));
1563
+ },
1564
+ enabled: !!params?.symbol && !!params?.interval && params?.from != null && params?.to != null,
1565
+ staleTime: 10 * 1e3,
1566
+ retry: 3,
1567
+ ...queryOptions
1568
+ });
1569
+ };
1503
1570
  var useSwapsApiTokens = ({
1504
1571
  params,
1505
1572
  queryOptions
@@ -1509,7 +1576,7 @@ var useSwapsApiTokens = ({
1509
1576
  return useQuery({
1510
1577
  queryKey: ["swapsApi", "tokens"],
1511
1578
  queryFn: async () => unwrapResult(await sodax.api.swaps.getTokens(apiConfig)),
1512
- retry: 3,
1579
+ retry: retryUnlessAuthFailure,
1513
1580
  ...queryOptions
1514
1581
  });
1515
1582
  };
@@ -1527,7 +1594,7 @@ var useSwapsApiTokensByChain = ({
1527
1594
  return unwrapResult(await sodax.api.swaps.getTokensByChain(chainKey, apiConfig));
1528
1595
  },
1529
1596
  enabled: !!chainKey && chainKey.length > 0,
1530
- retry: 3,
1597
+ retry: retryUnlessAuthFailure,
1531
1598
  ...queryOptions
1532
1599
  });
1533
1600
  };
@@ -1550,7 +1617,7 @@ var useSwapsApiQuote = ({
1550
1617
  return unwrapResult(await sodax.api.swaps.getQuote(body, query, apiConfig));
1551
1618
  },
1552
1619
  enabled: !!body,
1553
- retry: 3,
1620
+ retry: retryUnlessAuthFailure,
1554
1621
  ...queryOptions
1555
1622
  });
1556
1623
  };
@@ -1564,7 +1631,7 @@ var useSwapsApiDeadline = ({
1564
1631
  return useQuery({
1565
1632
  queryKey: ["swapsApi", "deadline", query?.offsetSeconds ?? null],
1566
1633
  queryFn: async () => unwrapResult(await sodax.api.swaps.getDeadline(query, apiConfig)),
1567
- retry: 3,
1634
+ retry: retryUnlessAuthFailure,
1568
1635
  ...queryOptions
1569
1636
  });
1570
1637
  };
@@ -1582,7 +1649,7 @@ var useSwapsApiAllowance = ({
1582
1649
  return unwrapResult(await sodax.api.swaps.checkAllowance(body, apiConfig));
1583
1650
  },
1584
1651
  enabled: !!body,
1585
- retry: 3,
1652
+ retry: retryUnlessAuthFailure,
1586
1653
  ...queryOptions
1587
1654
  });
1588
1655
  };
@@ -1594,7 +1661,7 @@ var useSwapsApiApprove = ({
1594
1661
  const { sodax } = useSodaxContext();
1595
1662
  return useSafeMutation({
1596
1663
  mutationKey: ["swapsApi", "approve"],
1597
- retry: 3,
1664
+ retry: retryUnlessAuthFailure,
1598
1665
  ...mutationOptions,
1599
1666
  mutationFn: async ({ body, apiConfig }) => unwrapResult(await sodax.api.swaps.approve(body, apiConfig))
1600
1667
  });
@@ -1707,7 +1774,7 @@ var useSwapsApiCreateIntent = ({
1707
1774
  const { sodax } = useSodaxContext();
1708
1775
  return useSafeMutation({
1709
1776
  mutationKey: ["swapsApi", "createIntent"],
1710
- retry: 3,
1777
+ retry: retryUnlessAuthFailure,
1711
1778
  ...mutationOptions,
1712
1779
  mutationFn: async ({ body, apiConfig }) => unwrapResult(await sodax.api.swaps.createIntent(body, apiConfig))
1713
1780
  });
@@ -1744,8 +1811,11 @@ var useSwapsApiStatus = ({
1744
1811
  return unwrapResult(await sodax.api.swaps.getStatus({ intentTxHash }, apiConfig));
1745
1812
  },
1746
1813
  enabled: !!intentTxHash && intentTxHash.length > 0,
1747
- retry: 3,
1748
- refetchInterval: (query) => isTerminalSwapIntentStatus(query.state.data?.status) ? false : 1e3,
1814
+ retry: retryUnlessAuthFailure,
1815
+ refetchInterval: (query) => {
1816
+ if (isAuthFailure(query.state.error)) return false;
1817
+ return isTerminalSwapIntentStatus(query.state.data?.status) ? false : 1e3;
1818
+ },
1749
1819
  ...queryOptions
1750
1820
  });
1751
1821
  };
@@ -1757,7 +1827,7 @@ var useSwapsApiCancelIntent = ({
1757
1827
  const { sodax } = useSodaxContext();
1758
1828
  return useSafeMutation({
1759
1829
  mutationKey: ["swapsApi", "cancelIntent"],
1760
- retry: 3,
1830
+ retry: retryUnlessAuthFailure,
1761
1831
  ...mutationOptions,
1762
1832
  mutationFn: async ({ body, apiConfig }) => unwrapResult(await sodax.api.swaps.cancelIntent(body, apiConfig))
1763
1833
  });
@@ -1776,7 +1846,7 @@ var useSwapsApiIntentHash = ({
1776
1846
  return unwrapResult(await sodax.api.swaps.getIntentHash({ intent }, apiConfig));
1777
1847
  },
1778
1848
  enabled: !!intent,
1779
- retry: 3,
1849
+ retry: retryUnlessAuthFailure,
1780
1850
  ...queryOptions
1781
1851
  });
1782
1852
  };
@@ -1794,7 +1864,7 @@ var useSwapsApiIntentPacket = ({
1794
1864
  return unwrapResult(await sodax.api.swaps.getSolvedIntentPacket(body, apiConfig));
1795
1865
  },
1796
1866
  enabled: !!body,
1797
- retry: 3,
1867
+ retry: retryUnlessAuthFailure,
1798
1868
  ...queryOptions
1799
1869
  });
1800
1870
  };
@@ -1812,7 +1882,7 @@ var useSwapsApiIntentExtraData = ({
1812
1882
  return unwrapResult(await sodax.api.swaps.getIntentSubmitTxExtraData(body, apiConfig));
1813
1883
  },
1814
1884
  enabled: !!body && (!!body.txHash || !!body.intent),
1815
- retry: 3,
1885
+ retry: retryUnlessAuthFailure,
1816
1886
  ...queryOptions
1817
1887
  });
1818
1888
  };
@@ -1830,7 +1900,7 @@ var useSwapsApiFilledIntent = ({
1830
1900
  return unwrapResult(await sodax.api.swaps.getFilledIntent(txHash, apiConfig));
1831
1901
  },
1832
1902
  enabled: !!txHash && txHash.length > 0,
1833
- retry: 3,
1903
+ retry: retryUnlessAuthFailure,
1834
1904
  ...queryOptions
1835
1905
  });
1836
1906
  };
@@ -1848,7 +1918,7 @@ var useSwapsApiIntent = ({
1848
1918
  return unwrapResult(await sodax.api.swaps.getIntent(txHash, apiConfig));
1849
1919
  },
1850
1920
  enabled: !!txHash && txHash.length > 0,
1851
- retry: 3,
1921
+ retry: retryUnlessAuthFailure,
1852
1922
  ...queryOptions
1853
1923
  });
1854
1924
  };
@@ -1860,7 +1930,7 @@ var useSwapsApiCreateLimitOrder = ({
1860
1930
  const { sodax } = useSodaxContext();
1861
1931
  return useSafeMutation({
1862
1932
  mutationKey: ["swapsApi", "createLimitOrder"],
1863
- retry: 3,
1933
+ retry: retryUnlessAuthFailure,
1864
1934
  ...mutationOptions,
1865
1935
  mutationFn: async ({ body, apiConfig }) => unwrapResult(await sodax.api.swaps.createLimitOrderIntent(body, apiConfig))
1866
1936
  });
@@ -1879,7 +1949,7 @@ var useSwapsApiEstimateGas = ({
1879
1949
  return unwrapResult(await sodax.api.swaps.estimateGas(body, apiConfig));
1880
1950
  },
1881
1951
  enabled: !!body,
1882
- retry: 3,
1952
+ retry: retryUnlessAuthFailure,
1883
1953
  ...queryOptions
1884
1954
  });
1885
1955
  };
@@ -1897,7 +1967,7 @@ var useSwapsApiPartnerFee = ({
1897
1967
  return unwrapResult(await sodax.api.swaps.getPartnerFee({ amount }, apiConfig));
1898
1968
  },
1899
1969
  enabled: !!amount && amount.length > 0,
1900
- retry: 3,
1970
+ retry: retryUnlessAuthFailure,
1901
1971
  ...queryOptions
1902
1972
  });
1903
1973
  };
@@ -1915,7 +1985,7 @@ var useSwapsApiSolverFee = ({
1915
1985
  return unwrapResult(await sodax.api.swaps.getSolverFee({ amount }, apiConfig));
1916
1986
  },
1917
1987
  enabled: !!amount && amount.length > 0,
1918
- retry: 3,
1988
+ retry: retryUnlessAuthFailure,
1919
1989
  ...queryOptions
1920
1990
  });
1921
1991
  };
@@ -1927,7 +1997,7 @@ var useSwapsApiSubmitTx = ({
1927
1997
  const { sodax } = useSodaxContext();
1928
1998
  return useSafeMutation({
1929
1999
  mutationKey: ["swapsApi", "submitTx"],
1930
- retry: 3,
2000
+ retry: retryUnlessAuthFailure,
1931
2001
  ...mutationOptions,
1932
2002
  mutationFn: async ({ request, apiConfig }) => unwrapResult(await sodax.api.swaps.submitTx(request, apiConfig))
1933
2003
  });
@@ -1947,8 +2017,9 @@ var useSwapsApiSubmitTxStatus = ({
1947
2017
  return unwrapResult(await sodax.api.swaps.getSubmitTxStatus({ txHash, srcChainKey }, apiConfig));
1948
2018
  },
1949
2019
  enabled: !!txHash && txHash.length > 0 && !!srcChainKey,
1950
- retry: 3,
2020
+ retry: retryUnlessAuthFailure,
1951
2021
  refetchInterval: (query) => {
2022
+ if (isAuthFailure(query.state.error)) return false;
1952
2023
  const data = query.state.data?.data;
1953
2024
  if (data?.status === "solved" || data?.status === "failed" || data?.abandonedAt) return false;
1954
2025
  return 1e3;
@@ -1966,8 +2037,7 @@ function useBridge({
1966
2037
  ...mutationOptions,
1967
2038
  mutationFn: async (vars) => unwrapResult(await sodax.bridge.bridge({ ...vars, raw: false })),
1968
2039
  onSuccess: async (data, vars, ctx) => {
1969
- queryClient.invalidateQueries({ queryKey: ["shared", "xBalances", vars.params.srcChainKey] });
1970
- queryClient.invalidateQueries({ queryKey: ["shared", "xBalances", vars.params.dstChainKey] });
2040
+ invalidateBalances(queryClient, vars.params.srcChainKey, vars.params.dstChainKey);
1971
2041
  await mutationOptions?.onSuccess?.(data, vars, ctx);
1972
2042
  }
1973
2043
  });
@@ -2274,7 +2344,7 @@ function useStake({
2274
2344
  queryClient.invalidateQueries({ queryKey: ["staking", "allowance", params.srcChainKey, "stake"] });
2275
2345
  queryClient.invalidateQueries({ queryKey: ["staking", "stakeRatio"] });
2276
2346
  queryClient.invalidateQueries({ queryKey: ["staking", "convertedAssets"] });
2277
- queryClient.invalidateQueries({ queryKey: ["shared", "xBalances", params.srcChainKey] });
2347
+ invalidateBalances(queryClient, params.srcChainKey);
2278
2348
  await mutationOptions?.onSuccess?.(data, vars, ctx);
2279
2349
  }
2280
2350
  });
@@ -2361,7 +2431,7 @@ function useClaim({
2361
2431
  queryClient.invalidateQueries({
2362
2432
  queryKey: ["staking", "unstakingInfoWithPenalty", params.srcChainKey, params.srcAddress]
2363
2433
  });
2364
- queryClient.invalidateQueries({ queryKey: ["shared", "xBalances", params.srcChainKey] });
2434
+ invalidateBalances(queryClient, params.srcChainKey);
2365
2435
  await mutationOptions?.onSuccess?.(data, vars, ctx);
2366
2436
  }
2367
2437
  });
@@ -2520,7 +2590,7 @@ function useInstantUnstake({
2520
2590
  queryClient.invalidateQueries({ queryKey: ["staking", "info", params.srcChainKey, params.srcAddress] });
2521
2591
  queryClient.invalidateQueries({ queryKey: ["staking", "instantUnstakeRatio"] });
2522
2592
  queryClient.invalidateQueries({ queryKey: ["staking", "allowance", params.srcChainKey, "instantUnstake"] });
2523
- queryClient.invalidateQueries({ queryKey: ["shared", "xBalances", params.srcChainKey] });
2593
+ invalidateBalances(queryClient, params.srcChainKey);
2524
2594
  await mutationOptions?.onSuccess?.(data, vars, ctx);
2525
2595
  }
2526
2596
  });
@@ -2865,7 +2935,7 @@ function useFeeClaimWithdraw({
2865
2935
  queryClient.invalidateQueries({
2866
2936
  queryKey: ["partner", "feeClaim", "assetsBalances", vars.params.srcAddress]
2867
2937
  });
2868
- queryClient.invalidateQueries({ queryKey: ["shared", "xBalances", vars.params.dstChainKey] });
2938
+ invalidateBalances(queryClient, vars.params.dstChainKey);
2869
2939
  await mutationOptions?.onSuccess?.(data, vars, ctx);
2870
2940
  }
2871
2941
  });
@@ -2906,7 +2976,7 @@ function useWithdrawHubAsset({
2906
2976
  queryClient.invalidateQueries({
2907
2977
  queryKey: ["recovery", "hubAssetBalances", params.srcChainKey, params.srcAddress]
2908
2978
  });
2909
- queryClient.invalidateQueries({ queryKey: ["shared", "xBalances", params.srcChainKey] });
2979
+ invalidateBalances(queryClient, params.srcChainKey);
2910
2980
  await mutationOptions?.onSuccess?.(data, vars, ctx);
2911
2981
  }
2912
2982
  });
@@ -2922,8 +2992,7 @@ function useMigrateIcxToSoda({
2922
2992
  mutationFn: async (vars) => unwrapResult(await sodax.migration.migrateIcxToSoda({ ...vars, raw: false })),
2923
2993
  onSuccess: async (data, vars, ctx) => {
2924
2994
  queryClient.invalidateQueries({ queryKey: ["migrate", "allowance"] });
2925
- queryClient.invalidateQueries({ queryKey: ["shared", "xBalances", vars.params.srcChainKey] });
2926
- queryClient.invalidateQueries({ queryKey: ["shared", "xBalances", ChainKeys.SONIC_MAINNET] });
2995
+ invalidateBalances(queryClient, vars.params.srcChainKey, ChainKeys.SONIC_MAINNET);
2927
2996
  await mutationOptions?.onSuccess?.(data, vars, ctx);
2928
2997
  }
2929
2998
  });
@@ -2939,8 +3008,7 @@ function useRevertMigrateSodaToIcx({
2939
3008
  mutationFn: async (vars) => unwrapResult(await sodax.migration.revertMigrateSodaToIcx({ ...vars, raw: false })),
2940
3009
  onSuccess: async (data, vars, ctx) => {
2941
3010
  queryClient.invalidateQueries({ queryKey: ["migrate", "allowance"] });
2942
- queryClient.invalidateQueries({ queryKey: ["shared", "xBalances", vars.params.srcChainKey] });
2943
- queryClient.invalidateQueries({ queryKey: ["shared", "xBalances", ChainKeys.ICON_MAINNET] });
3011
+ invalidateBalances(queryClient, vars.params.srcChainKey, ChainKeys.ICON_MAINNET);
2944
3012
  await mutationOptions?.onSuccess?.(data, vars, ctx);
2945
3013
  }
2946
3014
  });
@@ -2957,8 +3025,7 @@ function useMigratebnUSD({
2957
3025
  onSuccess: async (data, vars, ctx) => {
2958
3026
  const { params } = vars;
2959
3027
  queryClient.invalidateQueries({ queryKey: ["migrate", "allowance"] });
2960
- queryClient.invalidateQueries({ queryKey: ["shared", "xBalances", params.srcChainKey] });
2961
- queryClient.invalidateQueries({ queryKey: ["shared", "xBalances", params.dstChainKey] });
3028
+ invalidateBalances(queryClient, params.srcChainKey, params.dstChainKey);
2962
3029
  await mutationOptions?.onSuccess?.(data, vars, ctx);
2963
3030
  }
2964
3031
  });
@@ -2974,8 +3041,7 @@ function useMigrateBaln({
2974
3041
  mutationFn: async (vars) => unwrapResult(await sodax.migration.migrateBaln({ ...vars, raw: false })),
2975
3042
  onSuccess: async (data, vars, ctx) => {
2976
3043
  queryClient.invalidateQueries({ queryKey: ["migrate", "allowance"] });
2977
- queryClient.invalidateQueries({ queryKey: ["shared", "xBalances", ChainKeys.ICON_MAINNET] });
2978
- queryClient.invalidateQueries({ queryKey: ["shared", "xBalances", ChainKeys.SONIC_MAINNET] });
3044
+ invalidateBalances(queryClient, ChainKeys.ICON_MAINNET, ChainKeys.SONIC_MAINNET);
2979
3045
  queryClient.invalidateQueries({ queryKey: ["staking", "info"] });
2980
3046
  await mutationOptions?.onSuccess?.(data, vars, ctx);
2981
3047
  }
@@ -3001,7 +3067,7 @@ function useMigrationApprove({
3001
3067
  }
3002
3068
  });
3003
3069
  }
3004
- var REFETCH_INTERVAL_MS2 = 2e3;
3070
+ var REFETCH_INTERVAL_MS3 = 2e3;
3005
3071
  function useMigrationAllowance({
3006
3072
  params,
3007
3073
  queryOptions
@@ -3027,7 +3093,7 @@ function useMigrationAllowance({
3027
3093
  return result.ok ? result.value : false;
3028
3094
  },
3029
3095
  enabled: !!migrationParams && !!action,
3030
- refetchInterval: REFETCH_INTERVAL_MS2,
3096
+ refetchInterval: REFETCH_INTERVAL_MS3,
3031
3097
  ...queryOptions
3032
3098
  });
3033
3099
  }
@@ -3136,7 +3202,7 @@ function useDexDeposit({
3136
3202
  queryClient.invalidateQueries({
3137
3203
  queryKey: ["dex", "allowance", params.srcChainKey, params.asset, params.amount.toString()]
3138
3204
  });
3139
- queryClient.invalidateQueries({ queryKey: ["shared", "xBalances", params.srcChainKey] });
3205
+ invalidateBalances(queryClient, params.srcChainKey);
3140
3206
  await mutationOptions?.onSuccess?.(data, vars, ctx);
3141
3207
  }
3142
3208
  });
@@ -3153,7 +3219,7 @@ function useDexWithdraw({
3153
3219
  onSuccess: async (data, vars, ctx) => {
3154
3220
  const { params } = vars;
3155
3221
  queryClient.invalidateQueries({ queryKey: ["dex", "poolBalances", params.srcChainKey, params.srcAddress] });
3156
- queryClient.invalidateQueries({ queryKey: ["shared", "xBalances", params.srcChainKey] });
3222
+ invalidateBalances(queryClient, params.srcChainKey);
3157
3223
  await mutationOptions?.onSuccess?.(data, vars, ctx);
3158
3224
  }
3159
3225
  });
@@ -3340,7 +3406,7 @@ function useSupplyLiquidity({
3340
3406
  }
3341
3407
  queryClient.invalidateQueries({ queryKey: ["dex", "poolData", params.poolKey] });
3342
3408
  queryClient.invalidateQueries({ queryKey: ["dex", "poolBalances", params.srcChainKey, params.srcAddress] });
3343
- queryClient.invalidateQueries({ queryKey: ["shared", "xBalances", params.srcChainKey] });
3409
+ invalidateBalances(queryClient, params.srcChainKey);
3344
3410
  await mutationOptions?.onSuccess?.(data, vars, ctx);
3345
3411
  }
3346
3412
  });
@@ -3763,8 +3829,7 @@ function useLeverageYieldVaultSwap({
3763
3829
  ...mutationOptions,
3764
3830
  mutationFn: async (vars) => unwrapResult(await sodax.leverageYield.vaultSwap({ ...vars, raw: false })),
3765
3831
  onSuccess: async (data, vars, ctx) => {
3766
- queryClient.invalidateQueries({ queryKey: ["shared", "xBalances", vars.params.srcChainKey] });
3767
- queryClient.invalidateQueries({ queryKey: ["shared", "xBalances", vars.params.dstChainKey] });
3832
+ invalidateBalances(queryClient, vars.params.srcChainKey, vars.params.dstChainKey);
3768
3833
  await mutationOptions?.onSuccess?.(data, vars, ctx);
3769
3834
  }
3770
3835
  });
@@ -3857,4 +3922,4 @@ function createSodaxQueryClient({
3857
3922
  });
3858
3923
  }
3859
3924
 
3860
- export { SodaxProvider, clearRadfiSession, createDecreaseLiquidityParamsProps, createDepositParamsProps, createSodaxQueryClient, createSupplyLiquidityParamsProps, createWithdrawParamsProps, getLeverageYieldQuoteQueryOptions, getSponsorConfigQueryOptions, getStellarAccountActiveQueryOptions, getStellarAccountStatusQueryOptions, getStellarTrustlineCheckQueryOptions, getSwapQuoteQueryOptions, getXBalancesQueryOptions, isTerminalSwapIntentStatus, isUserRejectedError, loadRadfiSession, resolveNearStorageGate, resolveStellarGate, runApprovalPlan, saveRadfiSession, toResult, unwrapResult, useAToken, useATokensBalances, useActivateStellarAccount, useApproveToken, useBackendAllMoneyMarketAssets, useBackendAllMoneyMarketBorrowers, useBackendIntentByHash, useBackendIntentByTxHash, useBackendMoneyMarketAsset, useBackendMoneyMarketAssetBorrowers, useBackendMoneyMarketAssetSuppliers, useBackendMoneyMarketPosition, useBackendOrderbook, useBackendUserIntents, useBitcoinBalance, useBitcoinTradingSetup, useBorrow, useBridge, useBridgeAllowance, useBridgeApiAllowance, useBridgeApiApprove, useBridgeApiApproveAndBroadcast, useBridgeApiBridgeableAmount, useBridgeApiCreateBridgeIntent, useBridgeApiFee, useBridgeApiIsBridgeable, useBridgeApiSubmitTx, useBridgeApiSubmitTxStatus, useBridgeApiTokens, useBridgeApiTokensByChain, useBridgeApprove, useCancelLimitOrder, useCancelSwap, useCancelUnstake, useClaim, useClaimRewards, useConvertedAssets, useCreateDecreaseLiquidityParams, useCreateDepositParams, useCreateLimitOrder, useCreateSupplyLiquidityParams, useCreateWithdrawParams, useDecreaseLiquidity, useDeriveUserWalletAddress, useDetailedStatus, useDexAllowance, useDexApprove, useDexDeposit, useDexWithdraw, useEnsureRadfiAccessToken, useEstablishTrustline, useEstimateGas, useExpiredUtxos, useFeeClaimSwap, useFeeClaimWithdraw, useFetchAssetsBalances, useFundTradingWallet, useGetAutoSwapPreferences, useGetBridgeableAmount, useGetBridgeableTokens, useGetIntentDetails, useGetUserHubWalletAddress, useGetUserIntent, useHubAssetBalances, useHubProvider, useInstantUnstake, useInstantUnstakeAllowance, useInstantUnstakeApprove, useInstantUnstakeRatio, useIsTokenApproved, useLeverageYieldDeposit, useLeverageYieldEffectiveApr, useLeverageYieldNotifySolver, useLeverageYieldPosition, useLeverageYieldPreviewRedeem, useLeverageYieldQuote, useLeverageYieldShareBalances, useLeverageYieldTotalAssets, useLeverageYieldVaultSwap, useLeverageYieldWithdraw, useLiquidityAmounts, useMMAllowance, useMMApprove, useMigrateBaln, useMigrateIcxToSoda, useMigratebnUSD, useMigrationAllowance, useMigrationApprove, useNearStorageCheck, useNearStorageGate, usePartnerCancelIntent, usePoolBalances, usePoolData, usePools, usePositionInfo, useQuote, useRadfiAuth, useRadfiSession, useRadfiWithdraw, useRegisterNearStorage, useRenewUtxos, useRepay, useRequestTrustline, useReservesData, useReservesHumanized, useReservesList, useReservesUsdFormat, useRevertMigrateSodaToIcx, useSafeMutation, useSetSwapPreference, useSodaxContext, useSponsorConfig, useStake, useStakeAllowance, useStakeApprove, useStakeRatio, useStakingConfig, useStakingInfo, useStatus, useStellarAccountActive, useStellarAccountStatus, useStellarGate, useStellarTrustlineCheck, useSupply, useSupplyLiquidity, useSwap, useSwapAllowance, useSwapApprove, useSwapsApiAllowance, useSwapsApiApprove, useSwapsApiApproveAndBroadcast, useSwapsApiCancelIntent, useSwapsApiCreateIntent, useSwapsApiCreateLimitOrder, useSwapsApiDeadline, useSwapsApiEstimateGas, useSwapsApiFilledIntent, useSwapsApiIntent, useSwapsApiIntentExtraData, useSwapsApiIntentHash, useSwapsApiIntentPacket, useSwapsApiPartnerFee, useSwapsApiQuote, useSwapsApiSolverFee, useSwapsApiStatus, useSwapsApiSubmitIntent, useSwapsApiSubmitTx, useSwapsApiSubmitTxStatus, useSwapsApiTokens, useSwapsApiTokensByChain, useTradingWallet, useTradingWalletBalance, useUnstake, useUnstakeAllowance, useUnstakeApprove, useUnstakingInfo, useUnstakingInfoWithPenalty, useUserFormattedSummary, useUserReservesData, useWithdraw, useWithdrawHubAsset, useXBalances };
3925
+ export { SodaxProvider, clearRadfiSession, createDecreaseLiquidityParamsProps, createDepositParamsProps, createSodaxQueryClient, createSupplyLiquidityParamsProps, createWithdrawParamsProps, getBalancesQueryOptions, getLeverageYieldQuoteQueryOptions, getSponsorConfigQueryOptions, getStellarAccountActiveQueryOptions, getStellarAccountStatusQueryOptions, getStellarTrustlineCheckQueryOptions, getSwapQuoteQueryOptions, getXBalancesQueryOptions, invalidateBalances, isTerminalSwapIntentStatus, isUserRejectedError, loadRadfiSession, resolveNearStorageGate, resolveStellarGate, retryUnlessAuthFailure, runApprovalPlan, saveRadfiSession, toResult, unwrapResult, useAToken, useATokensBalances, useActivateStellarAccount, useApproveToken, useBackendAllMoneyMarketAssets, useBackendAllMoneyMarketBorrowers, useBackendIntentByHash, useBackendIntentByTxHash, useBackendMoneyMarketAsset, useBackendMoneyMarketAssetBorrowers, useBackendMoneyMarketAssetSuppliers, useBackendMoneyMarketPosition, useBackendOracleCandles, useBackendOracleMarkets, useBackendOrderbook, useBackendUserIntents, useBalances, useBitcoinBalance, useBitcoinTradingSetup, useBorrow, useBridge, useBridgeAllowance, useBridgeApiAllowance, useBridgeApiApprove, useBridgeApiApproveAndBroadcast, useBridgeApiBridgeableAmount, useBridgeApiCreateBridgeIntent, useBridgeApiFee, useBridgeApiIsBridgeable, useBridgeApiSubmitTx, useBridgeApiSubmitTxStatus, useBridgeApiTokens, useBridgeApiTokensByChain, useBridgeApprove, useCancelLimitOrder, useCancelSwap, useCancelUnstake, useClaim, useClaimRewards, useConvertedAssets, useCreateDecreaseLiquidityParams, useCreateDepositParams, useCreateLimitOrder, useCreateSupplyLiquidityParams, useCreateWithdrawParams, useDecreaseLiquidity, useDeriveUserWalletAddress, useDetailedStatus, useDexAllowance, useDexApprove, useDexDeposit, useDexWithdraw, useEnsureRadfiAccessToken, useEstablishTrustline, useEstimateGas, useExpiredUtxos, useFeeClaimSwap, useFeeClaimWithdraw, useFetchAssetsBalances, useFundTradingWallet, useGetAutoSwapPreferences, useGetBridgeableAmount, useGetBridgeableTokens, useGetIntentDetails, useGetUserHubWalletAddress, useGetUserIntent, useHubAssetBalances, useHubProvider, useInstantUnstake, useInstantUnstakeAllowance, useInstantUnstakeApprove, useInstantUnstakeRatio, useIsTokenApproved, useLeverageYieldDeposit, useLeverageYieldEffectiveApr, useLeverageYieldNotifySolver, useLeverageYieldPosition, useLeverageYieldPreviewRedeem, useLeverageYieldQuote, useLeverageYieldShareBalances, useLeverageYieldTotalAssets, useLeverageYieldVaultSwap, useLeverageYieldWithdraw, useLiquidityAmounts, useMMAllowance, useMMApprove, useMigrateBaln, useMigrateIcxToSoda, useMigratebnUSD, useMigrationAllowance, useMigrationApprove, useNearStorageCheck, useNearStorageGate, usePartnerCancelIntent, usePoolBalances, usePoolData, usePools, usePositionInfo, useQuote, useRadfiAuth, useRadfiSession, useRadfiWithdraw, useRegisterNearStorage, useRenewUtxos, useRepay, useRequestTrustline, useReservesData, useReservesHumanized, useReservesList, useReservesUsdFormat, useRevertMigrateSodaToIcx, useSafeMutation, useSetSwapPreference, useSodaxContext, useSponsorConfig, useStake, useStakeAllowance, useStakeApprove, useStakeRatio, useStakingConfig, useStakingInfo, useStatus, useStellarAccountActive, useStellarAccountStatus, useStellarGate, useStellarTrustlineCheck, useSupply, useSupplyLiquidity, useSwap, useSwapAllowance, useSwapApprove, useSwapsApiAllowance, useSwapsApiApprove, useSwapsApiApproveAndBroadcast, useSwapsApiCancelIntent, useSwapsApiCreateIntent, useSwapsApiCreateLimitOrder, useSwapsApiDeadline, useSwapsApiEstimateGas, useSwapsApiFilledIntent, useSwapsApiIntent, useSwapsApiIntentExtraData, useSwapsApiIntentHash, useSwapsApiIntentPacket, useSwapsApiPartnerFee, useSwapsApiQuote, useSwapsApiSolverFee, useSwapsApiStatus, useSwapsApiSubmitIntent, useSwapsApiSubmitTx, useSwapsApiSubmitTxStatus, useSwapsApiTokens, useSwapsApiTokensByChain, useTradingWallet, useTradingWalletBalance, useUnstake, useUnstakeAllowance, useUnstakeApprove, useUnstakingInfo, useUnstakingInfoWithPenalty, useUserFormattedSummary, useUserReservesData, useWithdraw, useWithdrawHubAsset, useXBalances };
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "access": "public"
6
6
  },
7
7
  "license": "MIT",
8
- "version": "2.1.0",
8
+ "version": "2.2.0-rc.2",
9
9
  "description": "React hooks for building dApps on the SODAX cross-chain DeFi platform",
10
10
  "keywords": [
11
11
  "sodax",
@@ -34,7 +34,7 @@
34
34
  },
35
35
  "dependencies": {
36
36
  "viem": "2.29.2",
37
- "@sodax/sdk": "2.1.0"
37
+ "@sodax/sdk": "2.2.0-rc.2"
38
38
  },
39
39
  "devDependencies": {
40
40
  "@arethetypeswrong/cli": "0.17.4",
@@ -67,7 +67,7 @@
67
67
  "test": "vitest run",
68
68
  "clean": "rm -rf dist && rm -rf node_modules && rm -rf .turbo",
69
69
  "pretty": "biome format . --write",
70
- "checkTs": "tsc --noEmit",
70
+ "checkTs": "tsc --noEmit && node ../../scripts/check-tests-typechecked.mjs",
71
71
  "check-exports": "attw --pack --profile esm-only",
72
72
  "check:knip": "knip",
73
73
  "lint": "biome lint . --write"