Skip to main content

Recommended: JavaScript SDK with React Hooks

For new React apps, we recommend the JavaScript SDK with React Hooks (@dynamic-labs-sdk/react-hooks) instead of the legacy React SDK documented here. The JS SDK comes with many benefits such as a much smaller bundle size and other optimizations. Use the React quickstart (JavaScript SDK) to get started.
IWalletConnectConnector is available in SDK v2.0.0+.
FieldDescription
getSupportedNetworks: Promise<string[]>A method to retrieve the supported/approved networks for the WalletConnect wallet. Some wallets will only allow approve a network if the user manually switches in the wallet app first.

Interface definition

interface IWalletConnectConnector {
  getSupportedNetworks: Promise<string[]>
};

How to use it

In this example, we are going to return all supported networks for the wallet connector.
import { useDynamicContext } from '@dynamic-labs/sdk-react-core';
import { isWalletConnectConnector } from '@dynamic-labs/wallet-connector-core';

const MyComponent = () => {
  const { primaryWallet } = useDynamicContext();

  const getWCSupportedNetworks = async () => {
    if (!isWalletConnectConnector(primaryWallet?.connector)) {
      return;
    }

    const supportedNetworks = await primaryWallet.connector.getSupportedNetworks();

    console.log('supportedNetworks', supportedNetworks);

    return supportedNetworks;
  };

  ...
};
Last modified on June 25, 2026