getClient static method

SolanaRpcApi getClient()

Implementation

static SolanaRpcApi 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 = SolanaRpcApi(dio);
  return _instace!;
}