getClient static method

EvmRpcApi getClient()

Implementation

static EvmRpcApi getClient() {
  if (_instace != null) return _instace!;
  if (ParticleInfo.projectId.isEmpty || ParticleInfo.clientKey.isEmpty) {
    throw Exception(
        "projectId or clientKey must be not empty!!! Click here to get: https://dashboard.particle.network/");
  }
  final dio = Dio();
  dio.options.headers["Content-Type"] = "application/json";
  dio.options.headers["Authorization"] =
      authenticate(ParticleInfo.projectId, ParticleInfo.clientKey);
  _instace = EvmRpcApi(dio);
  return _instace!;
}