AlgorandOptions constructor
AlgorandOptions({
- AlgodClient? algodClient,
- IndexerClient? indexerClient,
- bool mainnet = false,
- Duration connectTimeout = const Duration(seconds: 30),
- Duration receiveTimeout = const Duration(seconds: 30),
- Duration sendTimeout = const Duration(seconds: 30),
- int timeout = 5,
- bool debug = false,
- bool enableGzip = true,
- Interceptor? logInterceptor,
- Transformer? transformer,
Implementation
factory AlgorandOptions({
AlgodClient? algodClient,
IndexerClient? indexerClient,
bool mainnet = false,
Duration connectTimeout = const Duration(seconds: 30),
Duration receiveTimeout = const Duration(seconds: 30),
Duration sendTimeout = const Duration(seconds: 30),
int timeout = 5,
bool debug = false,
bool enableGzip = true,
Interceptor? logInterceptor,
Transformer? transformer,
}) {
final _algodClient = algodClient ??
AlgodClient(
apiUrl: mainnet
? AlgoExplorer.MAINNET_ALGOD_API_URL
: AlgoExplorer.TESTNET_ALGOD_API_URL,
connectTimeout: connectTimeout,
receiveTimeout: receiveTimeout,
sendTimeout: sendTimeout,
debug: debug,
enableGzip: enableGzip,
logInterceptor: logInterceptor,
transformer: transformer,
);
final _indexerClient = indexerClient ??
IndexerClient(
apiUrl: mainnet
? AlgoExplorer.MAINNET_INDEXER_API_URL
: AlgoExplorer.TESTNET_INDEXER_API_URL,
connectTimeout: connectTimeout,
receiveTimeout: receiveTimeout,
sendTimeout: sendTimeout,
debug: debug,
enableGzip: enableGzip,
logInterceptor: logInterceptor,
transformer: transformer,
);
return AlgorandOptions._(
algodClient: _algodClient,
indexerClient: _indexerClient,
timeout: timeout,
debug: debug,
);
}