> ## Documentation Index
> Fetch the complete documentation index at: https://dynamic-docs-feat-sidebar-revamp.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Using RPC Providers

## Summary

We provide the [`useRpcProviders` hook](/react-sdk/hooks/userpcproviders)
that allows direct access to RPC providers for EVM & Solana.
Rpc providers can be used to make RPC calls to the blockchain while also providing convenience
methods without going through a wallet.

Each provider will use the RPC configured in the Dashboard if present,
otherwise they fall back to public RPCs urls. By default, all EVM and Solana
networks have public default providers as shown in this table:

| Network         | Public RPC Url                                                             |
| --------------- | -------------------------------------------------------------------------- |
| Ethereum        | [https://cloudflare-eth.com](https://cloudflare-eth.com)                   |
| Solana          | [https://api.mainnet-beta.solana.com](https://api.mainnet-beta.solana.com) |
| Optimism        | [https://mainnet.optimism.io](https://mainnet.optimism.io)                 |
| Gnosis Chain    | [https://rpc.gnosischain.com](https://rpc.gnosischain.com)                 |
| Aurora          | [https://mainnet.aurora.dev](https://mainnet.aurora.dev)                   |
| Polygon         | [https://polygon-rpc.com](https://polygon-rpc.com)                         |
| Palm            | [https://palm-mainnet.infura.io/v3](https://palm-mainnet.infura.io/v3)     |
| BNB Smart Chain | [https://arb1.arbitrum.io/rpc](https://arb1.arbitrum.io/rpc)               |

## Dashboard Configuration

To enter your provider url for a given network:

1. Go to the [Chains & Networks](https://app.dynamic.xyz/dashboard/chains-and-networks) page in your Dashboard.
2. Click on the chain to open the details tab
3. Click the down down arrow to expand a network
4. Enter your Provider Url
5. Click the test button to check url

## Usage

You are able to use the [`useRpcProviders` hook](/react-sdk/hooks/userpcproviders)
to obtain an object with rpc providers, and this hook expects a selector parameter
that you must use to select either EVM or Solana rpc providers.

```typescript
import { useRpcProviders } from '@dynamic-labs/sdk-react-core'
import { evmProvidersSelector } from '@dynamic-labs/ethereum-core'
import { solanaProvidersSelector } from '@dynamic-labs/solana-core'

const App = () => {
  const evmProviders = useRpcProviders(evmProvidersSelector)
  const solanaProviders = useRpcProviders(solanaProvidersSelector)
}
```

The hook returns either [EvmRpcProviderMethods](/react-sdk/objects/EvmRpcProviderMethods)
or [SolanaRpcProviderMethods](/react-sdk/objects/SolanaRpcProviderMethods), with the following fields:

<ParamField path="defaultProvider" type="EvmRpcProvider | SolanaRpcProvider | undefined">
  The provider for EVM or Solana Mainnet, if mainnet is enabled
</ParamField>

<ParamField path="providers" type="EvmRpcProvider[] | SolanaRpcProvider[] | undefined">
  A full list of all EVM or Solana providers that have been configured
</ParamField>

<ParamField path="getProviderByChainId" type="(chainId: number | string) => EvmRpcProvider | SolanaRpcProvider | undefined">
  A convenience method that lets you retrieve a provider for a specific Chain ID
</ParamField>

<Info>
  Check out the reference for
  [EvmRpcProvider](/react-sdk/objects/EvmRpcProvider) and
  [SolanaRpcProvider](/react-sdk/objects/SolanaRpcProvider)
</Info>

### Example

Below is a simple example using EVM providers to fetch an arbitrary ENS mapping:

```TypeScript
import { useRpcProviders } from '@dynamic-labs/sdk-react-core'
import { evmProvidersSelector } from '@dynamic-labs/ethereum-core'

const useLogEnsMapping = () => {
  const { defaultProvider } = useRpcProviders(evmProvidersSelector)

  const mainnetProvider = defaultProvider?.provider;

  const ensAddress = mainnetProvider.resolveName('myname.eth');

  console.log('address for myname.eth', ensAddress);
}
```
