Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bsc example not working #103

Open
bulldogswap opened this issue Jun 28, 2021 · 9 comments
Open

bsc example not working #103

bulldogswap opened this issue Jun 28, 2021 · 9 comments

Comments

@bulldogswap
Copy link

HI, there

I downloaded this repo but no working.

Please check

@myxtype
Copy link

myxtype commented Jul 1, 2021

same question, the bsc configuration is not seen in connectors

@jbc-deve
Copy link

<UseWalletProvider
        connectors={{
          bsc: () => ({
            web3ReactConnector() {
              return bscConnector
            },
            handleActivationError(err: any) {
              if (err instanceof UserRejectedRequestError) {
                return new ConnectionRejectedError()
              }
            },
          }),
        }}
      >
        {children}
      </UseWalletProvider>

Use it like this

@madnomad420
Copy link

madnomad420 commented Oct 15, 2021

same question, the bsc configuration is not seen in connectors

same issue

ConnectorUnsupportedError: Unsupported connector: bsc.

@WissenIstNacht
Copy link
Contributor

Hey all, thanks for reporting this.

We'll be having a look at why the example is not working.

@madnomad420
Copy link

madnomad420 commented Oct 15, 2021

Also noted that in version <=0.8.1 bsc example works, but starting 0.9.0 it throws error above. If it will help.

@sascha1337
Copy link

wen custom EVM not only eth/polygon

@LucasCodr
Copy link

Hey guys! Someone found a solution for this?

@voroncv
Copy link

voroncv commented Jan 16, 2022

Hey guys! I found a solution:

connectors={{
  bsc: () => {
    return {
      web3ReactConnector: () => {
        return new BscConnector({ supportedChainIds: [config.chainId] });
      },
      handleActivationError: (err: any) => {
        if (err instanceof UserRejectedRequestError) {
          return new ConnectionRejectedError();
        }
        return null;
      },
    };
  },
}}

@linxux
Copy link

linxux commented Nov 24, 2022

@jbc-deve @voroncv are correct.

from connectors.ts, we should configure the connector as a function if it is a new customized connector,

  for (const [id, initOrConfig] of Object.entries(initsOrConfigs)) {
    // If initOrConfig is a function, it is an initializer.
    if (typeof initOrConfig === 'function') {
      connectors[id] = [initOrConfig as ConnectorInit, null]
      continue
    }

    // Otherwise it is a config
    if (connectors[id]) {
      connectors[id][1] = initOrConfig as ConnectorConfig
    }
  

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants