Back to All

creating a provider?

seems like something has broken in the SDK

based on this code:

const provider = new ethers.providers.AlchemyProvider('mumbai', apiKey);


TypeError: Cannot read properties of null (reading 'name')
        switch ( {

I also tried passing an object

const netObj = {
    // name: 'MATIC_MUMBAI',
    name: 'polygon-mumbai',
    // chainId: 80001  // FIXME


"alchemy-sdk": "^2.0.2",

OK so the working magic codes are:

const netObj = {
    // name: 'MATIC_MUMBAI',
    // name: 'polygon-mumbai',
    name: 'maticmum',
    chainId: 80001  // hardwired bullshit
const provider = new ethers.providers.AlchemyProvider(netObj, apiKey);

is there a way to get the hardwired chainId somehow?