Summary

This hook provides acces to EVM and Solana RPC providers.

Check out our guide on Using RPC Providers

Usage

This hook must be fed with an RPC provider selector, of which you can chose among two:

  • evmProvidersSelector, exported from @dynamic-labs/ethereum-core
  • solanaProvidersSelector, exported from @dynamic-labs/solana-core
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)
}

Return Value

This hook’s return value depends on the selector with which it was fed: