AlgorandOptions constructor

AlgorandOptions({
  1. AlgodClient? algodClient,
  2. IndexerClient? indexerClient,
  3. bool mainnet = false,
  4. Duration connectTimeout = const Duration(seconds: 30),
  5. Duration receiveTimeout = const Duration(seconds: 30),
  6. Duration sendTimeout = const Duration(seconds: 30),
  7. int timeout = 5,
  8. bool debug = false,
  9. bool enableGzip = true,
  10. Interceptor? logInterceptor,
  11. 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,
  );
}