mirror of
https://github.com/aljazceru/breez-sdk-liquid.git
synced 2025-12-21 16:04:27 +01:00
34 lines
998 B
Dart
34 lines
998 B
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter_breez_liquid/flutter_breez_liquid.dart';
|
|
import 'package:path_provider/path_provider.dart';
|
|
|
|
Future<Config> getConfig({
|
|
Network network = Network.mainnet,
|
|
}) async {
|
|
debugPrint("Getting default SDK config for network: $network");
|
|
final defaultConf = defaultConfig(network: network);
|
|
debugPrint("Getting SDK config");
|
|
final workingDir = await getApplicationDocumentsDirectory();
|
|
return defaultConf.copyWith(
|
|
workingDir: workingDir.path,
|
|
);
|
|
}
|
|
|
|
extension ConfigCopyWith on Config {
|
|
Config copyWith({
|
|
String? boltzUrl,
|
|
String? electrumUrl,
|
|
String? workingDir,
|
|
Network? network,
|
|
BigInt? paymentTimeoutSec,
|
|
}) {
|
|
return Config(
|
|
boltzUrl: boltzUrl ?? this.boltzUrl,
|
|
electrumUrl: electrumUrl ?? this.electrumUrl,
|
|
workingDir: workingDir ?? this.workingDir,
|
|
network: network ?? this.network,
|
|
paymentTimeoutSec: paymentTimeoutSec ?? this.paymentTimeoutSec,
|
|
);
|
|
}
|
|
}
|