@orderly.network/wallet-connector-privy 2.5.0 → 2.5.1-alpha.0

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/index.mjs CHANGED
@@ -2862,6 +2862,11 @@ function WalletConnectorPrivyProvider(props) {
2862
2862
  });
2863
2863
  return chainTypeObj;
2864
2864
  }, [initChains]);
2865
+ const { data: swapChainInfoRes, isLoading: swapLoading } = useSWR(
2866
+ !props.customChains && props.enableSwapDeposit ? "https://fi-api.woo.org/swap_support" : null,
2867
+ fetcher,
2868
+ commonSwrOpts
2869
+ );
2865
2870
  const { data: mainnetChainInfoRes } = useSWR(
2866
2871
  !props.customChains ? "https://api.orderly.org/v1/public/chain_info" : null,
2867
2872
  fetcher,
@@ -2872,11 +2877,6 @@ function WalletConnectorPrivyProvider(props) {
2872
2877
  fetcher,
2873
2878
  commonSwrOpts
2874
2879
  );
2875
- const { data: swapChainInfoRes } = useSWR(
2876
- !props.customChains ? "https://fi-api.woo.org/swap_support" : null,
2877
- fetcher,
2878
- commonSwrOpts
2879
- );
2880
2880
  const handleCustomerChains = () => {
2881
2881
  const testChains = processChainInfo(
2882
2882
  props.customChains.testnet?.map((item) => item.network_infos)
@@ -2962,7 +2962,7 @@ function WalletConnectorPrivyProvider(props) {
2962
2962
  if (props.customChains) {
2963
2963
  return;
2964
2964
  }
2965
- if (!mainnetChainInfoRes || !testChainInfoRes || !swapChainInfoRes) {
2965
+ if (!mainnetChainInfoRes || !testChainInfoRes || swapLoading) {
2966
2966
  return;
2967
2967
  }
2968
2968
  let testChainsList = [];
@@ -2974,7 +2974,7 @@ function WalletConnectorPrivyProvider(props) {
2974
2974
  const testChains = processChainInfo(testChainsList);
2975
2975
  const mainnetChains2 = processChainInfo(mainnetChainsList);
2976
2976
  const swapChains = processChainInfo(
2977
- formatSwapChainInfo(swapChainInfoRes?.data)
2977
+ formatSwapChainInfo(swapChainInfoRes?.data || {})
2978
2978
  );
2979
2979
  const chains = [...testChains, ...mainnetChains2];
2980
2980
  const filterSwapChains = swapChains.filter(
@@ -2992,7 +2992,8 @@ function WalletConnectorPrivyProvider(props) {
2992
2992
  props.customChains,
2993
2993
  mainnetChainInfoRes,
2994
2994
  testChainInfoRes,
2995
- swapChainInfoRes
2995
+ swapChainInfoRes,
2996
+ swapLoading
2996
2997
  ]);
2997
2998
  useEffect(() => {
2998
2999
  if (props.customChains) {