getRpcUrl function

String getRpcUrl(
  1. Environment env,
  2. ChainType chainType
)

Implementation

String getRpcUrl(Environment env, ChainType chainType) {
  if (env == Environment.testnet) {
    switch (chainType) {
      case ChainType.polygon:
        return rpcUrl.polygonMumbai;
      case ChainType.eth:
        return rpcUrl.ethGoerli;
      case ChainType.bsc:
        return rpcUrl.bscTestnet;
      case ChainType.rangers:
        return rpcUrl.rangersRobin;
      case ChainType.arbitrum:
        return rpcUrl.arbitrumTestnet;
      case ChainType.avalanche:
        return rpcUrl.avalancheTestnet;
      case ChainType.kcc:
        return rpcUrl.kccTestnet;
      case ChainType.platon:
        return rpcUrl.platonTestnet;
      case ChainType.okc:
        return rpcUrl.okcTestnet;
    }
  } else {
    switch (chainType) {
      case ChainType.polygon:
        return rpcUrl.polygonMainnet;
      case ChainType.eth:
        return rpcUrl.ethMainnet;
      case ChainType.bsc:
        return rpcUrl.bscMainnet;
      case ChainType.rangers:
        return rpcUrl.rangersMainnet;
      case ChainType.arbitrum:
        return rpcUrl.arbitrumMainnet;
      case ChainType.avalanche:
        return rpcUrl.avalancheMainnet;
      case ChainType.kcc:
        return rpcUrl.kccMainnet;
      case ChainType.platon:
        return rpcUrl.platonMainnet;
      case ChainType.okc:
        return rpcUrl.okcMainnet;
    }
  }
}