2021-12-24 12:52:08 +00:00
|
|
|
import 'package:cw_core/wallet_base.dart';
|
|
|
|
import 'package:cw_core/wallet_credentials.dart';
|
|
|
|
import 'package:cw_core/wallet_type.dart';
|
|
|
|
|
2023-05-07 07:27:54 +00:00
|
|
|
import 'node.dart';
|
|
|
|
|
2021-12-24 12:52:08 +00:00
|
|
|
abstract class WalletService<N extends WalletCredentials,
|
2023-05-07 07:27:54 +00:00
|
|
|
RFS extends WalletCredentials,
|
|
|
|
RFK extends WalletCredentials> {
|
2021-12-24 12:52:08 +00:00
|
|
|
WalletType getType();
|
|
|
|
|
|
|
|
Future<WalletBase> create(N credentials);
|
|
|
|
|
|
|
|
Future<WalletBase> restoreFromSeed(RFS credentials);
|
|
|
|
|
|
|
|
Future<WalletBase> restoreFromKeys(RFK credentials);
|
|
|
|
|
2023-05-18 03:15:55 +00:00
|
|
|
Future<Map<String, dynamic>> sweepAllFunds(Node node, String address, String paymentId);
|
2023-05-07 07:27:54 +00:00
|
|
|
|
2021-12-24 12:52:08 +00:00
|
|
|
Future<WalletBase> openWallet(String name, String password);
|
|
|
|
|
|
|
|
Future<bool> isWalletExit(String name);
|
|
|
|
|
|
|
|
Future<void> remove(String wallet);
|
|
|
|
}
|