defaultChain
: -
Rainbow Wallet’s mobile app does not support testnets, and will
reject connections if you specify a testnet as a defaultChain
. - Trust Wallet’s
SWIFT (in beta) only supports BNB
Smart Chain, Polygon, Avalanche C-Chain, Arbitrum, OP Mainnet, Base, and OpBNB. If you specify a
defaultChain
that is not one of these networks, the wallet will reject the connection request.viem
-Supported Networksviem/chains
package, continue with the
instructions below. The package’s supported networks are listed
here. Otherwise, skip to the
Other Networks section.viem
-supported networks for Privy, first, install the viem
package. This package contains JSON representations of several EVM networks, which will be used to initialize the Privy SDK.
viem/chains
package:
PrivyProvider
with these additional network(s). In particular, the config
property of the PrivyProvider
contains the optional parameters:
defaultChain
field, where you should pass a single chain object for your desired default chainsupportedChains
field, where you should pass a list of chain objects for your desired supported chainsPrivyProvider
will throw an error if:
[]
) is passed into supportedChains
defaultChain
that is not also included in supportedChains
arrayviem/chains
, you can still use Privy with
it per the steps below!viem
and use the package’s defineChain
method to build a JSON representation of your desired network.
myCustomChain
in the example above) to the defaultChain
and supportedChains
properties of the PrivyProvider
.
addRpcUrlOverrideToChain
from @privy-io/chains
to override the RPC provider
addRpcUrlOverrideToChain
(e.g. mainnetOverride
) to the supportedChains
config option like before.
defaultChain
nor supportedChains
is explicitly set for your app, Privy will automatically default to the following list of EVM-compatible networks:
*.rpc.privy.systems
. For all other chains, Privy
will pull from the Viem default RPC URL in its respective chain
definition if no override is
specified.