@0xsquid/react-hooks 8.7.2-beta-interactive-to-amount.1 → 8.7.2-beta-interactive-to-amount.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.
@@ -4425,6 +4425,35 @@ const isSwapRouteError = (error) => {
4425
4425
  const isStatusError = (error) => {
4426
4426
  return error && typeof error.errorType === "string";
4427
4427
  };
4428
+ // --------------------
4429
+ // SQUID ROUTE ERROR MESSAGES
4430
+ // --------------------
4431
+ const GENERIC_ROUTE_ERROR_MESSAGE = "Oops! something went wrong. Try again later";
4432
+ const squidRouteErrorMapping = {
4433
+ Unknown: GENERIC_ROUTE_ERROR_MESSAGE,
4434
+ UnknownError: GENERIC_ROUTE_ERROR_MESSAGE,
4435
+ SquidServiceError: GENERIC_ROUTE_ERROR_MESSAGE,
4436
+ BAD_REQUEST: GENERIC_ROUTE_ERROR_MESSAGE,
4437
+ };
4438
+ /**
4439
+ * Extract a human-readable message from a Squid route error.
4440
+ *
4441
+ * Accepts either a raw `SquidRouteError` or an axios-shaped error with the
4442
+ * route error nested in `response.data`, so callers don't have to unwrap.
4443
+ * Falls back to a generic message when no usable string is available.
4444
+ */
4445
+ const getSquidRouteErrorMessage = (error) => {
4446
+ const candidate = (error?.response?.data ?? error);
4447
+ if (typeof candidate?.message === "string" && candidate.message.length > 0) {
4448
+ return candidate.message;
4449
+ }
4450
+ if (typeof candidate?.type === "string") {
4451
+ const mapped = squidRouteErrorMapping[candidate.type];
4452
+ if (mapped)
4453
+ return mapped;
4454
+ }
4455
+ return GENERIC_ROUTE_ERROR_MESSAGE;
4456
+ };
4428
4457
 
4429
4458
  // Xion has a way to create smart contract accounts (with social logins) these are 63 characters long
4430
4459
  // And the particularity is that we can't derive the osmosis fallback address from these because they don't have a way to access funds in other networks
@@ -23321,7 +23350,7 @@ const filterViewableTokens = (tokens, config, direction) => {
23321
23350
  };
23322
23351
  const getSecretNetworkBalances = async (chainData, cosmosAddress, squidTokens, keplrTypeWallet) => {
23323
23352
  const squidSecretTokens = squidTokens.filter((t) => t.chainId === CHAIN_IDS.SECRET);
23324
- const { fetchAllSecretBalances } = await Promise.resolve().then(function () { return require('./secretService-Bp_azQsY.js'); });
23353
+ const { fetchAllSecretBalances } = await Promise.resolve().then(function () { return require('./secretService-XZVHxElk.js'); });
23325
23354
  return fetchAllSecretBalances(chainData, cosmosAddress, squidSecretTokens, keplrTypeWallet);
23326
23355
  };
23327
23356
  function getTokenAssetsKey(token) {
@@ -26715,8 +26744,8 @@ function useStellarWallets() {
26715
26744
  return;
26716
26745
  try {
26717
26746
  const { allowAllModules: initializeAllModules } = await import('@creit.tech/stellar-wallets-kit');
26718
- const { LedgerModule } = await import('@creit.tech/stellar-wallets-kit/modules/ledger.module');
26719
- const { formatStellarWallet } = await Promise.resolve().then(function () { return require('./stellarService.client-CrlGBSG9.js'); });
26747
+ const { LedgerModule } = await import('@creit.tech/stellar-wallets-kit/modules/ledger.module.mjs');
26748
+ const { formatStellarWallet } = await Promise.resolve().then(function () { return require('./stellarService.client-CBqIkpcb.js'); });
26720
26749
  const modules = [...initializeAllModules(), new LedgerModule()];
26721
26750
  const promises = modules.map(async (module) => {
26722
26751
  const isAvailable = await module.isAvailable();
@@ -30048,7 +30077,7 @@ function hederaWalletConnect(parameters) {
30048
30077
  const optionalChains = config.chains.map((x) => x.id);
30049
30078
  if (!optionalChains.length)
30050
30079
  return;
30051
- const { EthereumProvider } = await Promise.resolve().then(function () { return require('./index.es-C93MXP-M.js'); });
30080
+ const { EthereumProvider } = await Promise.resolve().then(function () { return require('./index.es-DjscAACC.js'); });
30052
30081
  const rawProvider = await EthereumProvider.init({
30053
30082
  ...restParameters,
30054
30083
  disableProviderPing: true,
@@ -30185,6 +30214,7 @@ const createWagmiConfig = (squidChains, hederaExtensions) => {
30185
30214
  description: SQUID_METADATA.description,
30186
30215
  };
30187
30216
  return wagmi.createConfig({
30217
+ ssr: true,
30188
30218
  chains: wagmiChains,
30189
30219
  transports: Object.fromEntries(wagmiChains.map((chain) => [
30190
30220
  chain.id,
@@ -37470,6 +37500,7 @@ const SquidProvider = ({ children, config, placeholder, }) => {
37470
37500
  // Even with an error, we want wagmi to be defined so that we can display the maintenance mode layout
37471
37501
  // Create wagmi config with mainnet as fallback in maintenance mode
37472
37502
  const newWagmiConfig = wagmi.createConfig({
37503
+ ssr: true,
37473
37504
  chains: [chains$1.mainnet],
37474
37505
  connectors: [connectors.injected()],
37475
37506
  transports: {
@@ -37515,6 +37546,7 @@ exports.DEFAULT_ROUTE_REFETCH_INTERVAL = DEFAULT_ROUTE_REFETCH_INTERVAL;
37515
37546
  exports.EnsService = EnsService;
37516
37547
  exports.EvmNetworkNotSupportedErrorCode = EvmNetworkNotSupportedErrorCode;
37517
37548
  exports.FINAL_TRANSACTION_STATUSES = FINAL_TRANSACTION_STATUSES;
37549
+ exports.GENERIC_ROUTE_ERROR_MESSAGE = GENERIC_ROUTE_ERROR_MESSAGE;
37518
37550
  exports.HederaExtensionHelper = HederaExtensionHelper;
37519
37551
  exports.Nr = Nr;
37520
37552
  exports.SquidProvider = SquidProvider;
@@ -37598,6 +37630,7 @@ exports.getRouteExpiry = getRouteExpiry;
37598
37630
  exports.getSecretNetworkBalances = getSecretNetworkBalances;
37599
37631
  exports.getSendTxStatusRefetchInterval = getSendTxStatusRefetchInterval;
37600
37632
  exports.getSourceExplorerTxUrl = getSourceExplorerTxUrl;
37633
+ exports.getSquidRouteErrorMessage = getSquidRouteErrorMessage;
37601
37634
  exports.getStatusCode = getStatusCode;
37602
37635
  exports.getStellarHorizonApiUrl = getStellarHorizonApiUrl;
37603
37636
  exports.getStellarNetwork = getStellarNetwork;
@@ -37772,4 +37805,4 @@ exports.useXrplTrustLine = useXrplTrustLine;
37772
37805
  exports.waitForReceiptWithRetry = waitForReceiptWithRetry;
37773
37806
  exports.walletIconBaseUrl = walletIconBaseUrl;
37774
37807
  exports.walletSupportsChainType = walletSupportsChainType;
37775
- //# sourceMappingURL=index-B9EnYPpR.js.map
37808
+ //# sourceMappingURL=index-cWo0aVvt.js.map