mirror of
https://github.com/aljazceru/breez-sdk-liquid.git
synced 2026-01-13 02:54:24 +01:00
* Fix relative path on melos.yaml * Mention current version on CHANGELOG.md * Remove symlink for apache license * Address typos & relative path issues on README.md * Ignore Flutter example app on Melos.yaml * Remove obsolete param from Config on example app * Do not treat info messages as critical * Update README of Dart/Flutter packages Revert changes on topmost README * Update pubspec.lock * Make dart output directory if it does not exists * Replace continue-on-error Resume even if previous step fails, this approach displays errors on CI summary. * Install Protoc as part of CI workflow * Added init-sdk as part of just bootstrap recipe which installs protobuf * Pinned freezed to <=2.5.2
36 lines
1.2 KiB
Dart
36 lines
1.2 KiB
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({
|
|
LiquidNetwork network = LiquidNetwork.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? liquidElectrumUrl,
|
|
String? bitcoinElectrumUrl,
|
|
String? workingDir,
|
|
LiquidNetwork? network,
|
|
BigInt? paymentTimeoutSec,
|
|
double? zeroConfMinFeeRate,
|
|
}) {
|
|
return Config(
|
|
liquidElectrumUrl: liquidElectrumUrl ?? this.liquidElectrumUrl,
|
|
bitcoinElectrumUrl: bitcoinElectrumUrl ?? this.bitcoinElectrumUrl,
|
|
workingDir: workingDir ?? this.workingDir,
|
|
network: network ?? this.network,
|
|
paymentTimeoutSec: paymentTimeoutSec ?? this.paymentTimeoutSec,
|
|
zeroConfMinFeeRate: zeroConfMinFeeRate ?? this.zeroConfMinFeeRate,
|
|
);
|
|
}
|
|
}
|