|
1 | 1 | import 'dart:ffi'; |
2 | | -import 'package:ffi/ffi.dart'; |
3 | | -import 'package:flutter/foundation.dart'; |
| 2 | + |
4 | 3 | import 'package:cw_monero/api/convert_utf8_to_string.dart'; |
5 | | -import 'package:cw_monero/api/signatures.dart'; |
6 | | -import 'package:cw_monero/api/types.dart'; |
7 | | -import 'package:cw_monero/api/monero_api.dart'; |
8 | | -import 'package:cw_monero/api/wallet.dart'; |
9 | | -import 'package:cw_monero/api/exceptions/wallet_opening_exception.dart'; |
10 | 4 | import 'package:cw_monero/api/exceptions/wallet_creation_exception.dart'; |
| 5 | +import 'package:cw_monero/api/exceptions/wallet_opening_exception.dart'; |
11 | 6 | import 'package:cw_monero/api/exceptions/wallet_restore_from_keys_exception.dart'; |
12 | 7 | import 'package:cw_monero/api/exceptions/wallet_restore_from_seed_exception.dart'; |
| 8 | +import 'package:cw_monero/api/monero_api.dart'; |
| 9 | +import 'package:cw_monero/api/signatures.dart'; |
| 10 | +import 'package:cw_monero/api/types.dart'; |
| 11 | +import 'package:ffi/ffi.dart'; |
13 | 12 | import 'package:ffi/ffi.dart' as pkgffi; |
| 13 | +import 'package:flutter/foundation.dart'; |
14 | 14 |
|
15 | 15 | final createWalletNative = moneroApi |
16 | 16 | .lookup<NativeFunction<create_wallet>>('create_wallet') |
@@ -39,7 +39,10 @@ final errorStringNative = moneroApi |
39 | 39 | .asFunction<ErrorString>(); |
40 | 40 |
|
41 | 41 | void createWalletSync( |
42 | | - {required String path, required String password, required String language, int nettype = 0}) { |
| 42 | + {required String path, |
| 43 | + required String password, |
| 44 | + required String language, |
| 45 | + int nettype = 0}) { |
43 | 46 | final pathPointer = path.toNativeUtf8(); |
44 | 47 | final passwordPointer = password.toNativeUtf8(); |
45 | 48 | final languagePointer = language.toNativeUtf8(); |
@@ -142,7 +145,8 @@ void restoreWalletFromKeysSync( |
142 | 145 | } |
143 | 146 | } |
144 | 147 |
|
145 | | -void loadWallet({required String path, required String password, int nettype = 0}) { |
| 148 | +void loadWallet( |
| 149 | + {required String path, required String password, int nettype = 0}) { |
146 | 150 | final pathPointer = path.toNativeUtf8(); |
147 | 151 | final passwordPointer = password.toNativeUtf8(); |
148 | 152 | final loaded = loadWalletNative(pathPointer, passwordPointer, nettype) != 0; |
@@ -197,7 +201,8 @@ Future<void> _openWallet(Map<String, String> args) async => |
197 | 201 |
|
198 | 202 | bool _isWalletExist(String? path) => isWalletExistSync(path: path!); |
199 | 203 |
|
200 | | -void openWallet({required String path, required String password, int nettype = 0}) async => |
| 204 | +void openWallet( |
| 205 | + {required String path, required String password, int nettype = 0}) => |
201 | 206 | loadWallet(path: path, password: password, nettype: nettype); |
202 | 207 |
|
203 | 208 | Future<void> openWalletAsync(Map<String, String> args) async => |
|
0 commit comments