Setup the Relay SDK in your application
baseApiUrl
with TESTNET_RELAY_API
when testing with testnets. In the example above we also pass in an array of RelayChains converted from a viem chain, the sdk exports a function (convertViemChainToRelayChain
) to easily do this. Learn more about the createClient
options.
— Warning! Calling createClient
creates a singleton instance that will be used throughout your application. —
configureDynamicChains
method. Then with the new chains in the promise you would use the viemChain
property to create the wagmi config (refer to the wagmi docs for this). Finally take the resulting chains and configure the RainbowKitProvider
. Although in this example we used RainbowKit + Wagmi, you’re free to choose whatever libraries you’d like to connect a users wallet. You can call this method as often as you like to refresh the SDK’s chains.