BloomRpcClient constructor
BloomRpcClient({})
Creates a BloomRpcClient configured with baseUrl, timeout, and authentication options.
If httpClient is omitted, automatically creates a new BloomHttpClient.
Implementation
BloomRpcClient({
BloomHttpClient? httpClient,
String? baseUrl,
this.timeout = const Duration(seconds: 15),
Map<String, String>? defaultHeaders,
this.authToken,
this.authTokenProvider,
}) : baseUrl = baseUrl ??
BloomEnv.getOrNull('API_BASE_URL') ??
BloomEnv.getOrNull('API_URL'),
defaultHeaders = defaultHeaders ?? const {},
httpClient = httpClient ??
BloomHttpClient(
baseUrl: baseUrl,
timeout: timeout,
authToken: authToken,
authTokenProvider: authTokenProvider,
) {
if (authToken != null) this.httpClient.authToken = authToken;
if (authTokenProvider != null) {
this.httpClient.authTokenProvider = authTokenProvider;
}
}