SmallRuralDog / web3modal-vue

A single Web3 / Ethereum provider solution for all Wallets
https://smallruraldog.github.io/web3modal-vue/
MIT License
109 stars 68 forks source link

How to customize the network constants for test? #7

Open linxux opened 2 years ago

linxux commented 2 years ago

How to override the CHAIN_DATA_LIST? Seems it is unable to use this lib for new networks since the connector will check the ChainId in CHAIN_DATA_LIST?

Or any example to customize the provider with custom-xxxx?

export function getChainId(network) {
    const chains = Object.values(CHAIN_DATA_LIST);
    const match = filterMatches(
        chains,
        x => x.network === network,
        undefined
    );
    if (!match) {
        throw new Error(`No chainId found match ${network}`);
    }
    return match.chainId;
}
linxux commented 2 years ago

Or would you please help to add the new network - 'OEC' into CHAIN_DATA_LIST

  "65":{
    "chainId":65,
    "chain":"okexchain",
    "network":"oec-test",
    "networkId":65
  },
  "66":{
    "chainId":66,
    "chain":"okexchain",
    "network":"oec",
    "networkId":66
  }
linxux commented 2 years ago

@SmallRuralDog Hi, sir. Any update for this?