SquidClientManager class
Squid GraphQL client manager Handles client initialization, endpoint selection, and connection management
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
walletNameIndexer
→ Map<
String, String?> -
final
Methods
-
clearCaches(
) → void - Clear all caches (wallet name indexer and GraphQL cache)
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- client → GraphQLClient
-
no setter
Static Methods
-
checkAndHandleSchemaError(
OperationException? exception) → bool -
Check if an
OperationExceptionis a schema or network error and trigger the appropriate reconnect if needed. -
handleNetworkError(
) → Future< void> - Called when consecutive network errors reach the threshold. Skips failover if the Duniter RPC is also disconnected (device offline).
-
handleSchemaError(
) → Future< void> - Called when a runtime query detects a schema-incompatible error.
-
init(
List< String> endpoints, Networks network, Box<Config> configBox, {bool skipSyncValidation = false}) → Future<void> -
isIndexerSynced(
String endpoint) → Future< bool> - Check if Squid indexer is synced with Duniter node
-
isNetworkError(
OperationException? exception) → bool - Returns true if the exception is a network/transport-level error (endpoint unreachable, timeout, HTTP 5xx, parse error).
-
parseSquidEndpoint(
String endpoint) → String - Parse Squid endpoint to ensure correct GraphQL URL format
-
pingActiveClient(
{Duration timeout = const Duration(seconds: 10)}) → Future< bool> - Lightweight liveness probe against the currently active client.
-
selectFastestEndpoint(
List< String> endpoints, {bool skipSyncValidation = false}) → Future<String> - Select the fastest endpoint from a list of endpoints that are synced with Duniter
-
setClient(
String endpoint) → void -
testEndpoint(
String endpoint) → Future< bool> - Test a single endpoint for connectivity, version, schema, and synchronization
Constants
- minimumSquidVersion → const String
- Minimum required Squid indexer version