Add or Switch Network

Request

Leveraging EIP-3085, HyperPlay can pass requests to add a custom network, or switch to the appropriate network, for the user's MetaMask or WalletConnect wallet.

Network information, including a directory of public RPC endpoints, can be found here.

curl --location --request POST "localhost:9680/rpc" \
--header 'Content-Type: application/json' \
--data-raw '{
   "request":{
      "method":"eth_accounts"
   },
   "chain":{
      "chainId":"137",
      "chainMetadata":{
         "chainName":"Polygon",
         "nativeCurrency":{
            "name":"MATIC",
            "symbol":"MATIC",
            "decimals":18
         },
         "rpcUrls":[
            "https://polygon-rpc.com"
         ]
      }
   }
}'

Response

["0x638105AA1B69406560f6428aEFACe3DB9da83c64"]

Last updated