FaucetClient.fromNetwork constructor

FaucetClient.fromNetwork(
  1. Network network, {
  2. bool enableDebugLog = false,
})

Implementation

factory FaucetClient.fromNetwork(Network network, {bool enableDebugLog = false}) {
  String endpoint;
  String clientEndpoint;
  switch (network) {
    case Network.testnet:
      endpoint = Constants.faucetTestAPI;
      clientEndpoint = Constants.testnetAPI;
      break;
    case Network.devnet:
      endpoint = Constants.faucetDevAPI;
      clientEndpoint = Constants.devnetAPI;
    default:
      throw ArgumentError("Unsupport Network $network");
  }
  return FaucetClient._(endpoint, clientEndpoint: clientEndpoint, enableDebugLog: enableDebugLog);
}