typescripterc20thirdweb

Is there a polygon amoy chain for thirdweb?


I am trying to use the polygon amoy testnet on a localhost. However, I cannot seem to find if there is a way to access this chain using thirdweb.

I am using typescript.

I tried to use const activeChain = "amoy"; and const activeChain = "polygonamoy"; but it returned this error:

Error: Invalid chain: "amoy". It is not one of supportedChains.

On the tutorial I am using, text, they reference the mumbai testnet with just const activeChain = "mumbai";. However, it is now down.

Are there any alternatives I could use or is there a way to reference the polygon amoy chain?


Solution

  • I had the exact same issue and figured it out yesterday. Add the import below: import { PolygonAmoyTestnet } from "@thirdweb-dev/chains";

    Remove the active chain var, and then chain the variable into the active chain section in the return:
    return ( <ThirdwebProvider clientId={process.env.NEXT_PUBLIC_TEMPLATE_CLIENT_ID} activeChain={ PolygonAmoyTestnet }

    I hope this helps you fix your code!