mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-03-25 08:39:06 +00:00
removed the duplicate
This commit is contained in:
parent
9228d91daa
commit
75f1f3f7cc
2 changed files with 3 additions and 15 deletions
|
@ -23,7 +23,7 @@ typedef _IsWalletExist = int Function(Pointer<Utf8>);
|
||||||
|
|
||||||
// void close_wallet(uint64_t hwallet)
|
// void close_wallet(uint64_t hwallet)
|
||||||
typedef _close_wallet = Void Function(Int64);
|
typedef _close_wallet = Void Function(Int64);
|
||||||
typedef _closeWalletStatus = void Function(int hWallet);
|
typedef _closeWallet = void Function(int hWallet);
|
||||||
|
|
||||||
// uint64_t get_current_tx_fee(uint64_t priority)
|
// uint64_t get_current_tx_fee(uint64_t priority)
|
||||||
typedef _get_current_tx_fee = Int64 Function(Int64);
|
typedef _get_current_tx_fee = Int64 Function(Int64);
|
||||||
|
@ -157,7 +157,7 @@ class ApiCalls {
|
||||||
return isExist;
|
return isExist;
|
||||||
}
|
}
|
||||||
|
|
||||||
static final _closeWalletNative = zanoApi.lookup<NativeFunction<_close_wallet>>('close_wallet').asFunction<_closeWalletStatus>();
|
static final _closeWalletNative = zanoApi.lookup<NativeFunction<_close_wallet>>('close_wallet').asFunction<_closeWallet>();
|
||||||
|
|
||||||
static void closeWallet({required int hWallet}) => _closeWalletNative(hWallet);
|
static void closeWallet({required int hWallet}) => _closeWalletNative(hWallet);
|
||||||
|
|
||||||
|
|
|
@ -465,25 +465,13 @@ abstract class ZanoWalletBase extends WalletBase<ZanoBalance, ZanoTransactionHis
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
final _loadWalletNative = zanoApi.lookup<NativeFunction<_load_wallet>>('load_wallet').asFunction<_LoadWallet>();
|
|
||||||
|
|
||||||
String loadWallet(String path, String password) {
|
String loadWallet(String path, String password) {
|
||||||
print('load_wallet path $path password $password');
|
print('load_wallet path $path password $password');
|
||||||
final pathPointer = path.toNativeUtf8();
|
final result = ApiCalls.loadWallet(path: path, password: password);
|
||||||
final passwordPointer = password.toNativeUtf8();
|
|
||||||
final result = _convertUTF8ToString(
|
|
||||||
pointer: _loadWalletNative(pathPointer, passwordPointer, 0),
|
|
||||||
);
|
|
||||||
print('load_wallet result $result');
|
print('load_wallet result $result');
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
String _convertUTF8ToString({required Pointer<Utf8> pointer}) {
|
|
||||||
final str = pointer.toDartString();
|
|
||||||
calloc.free(pointer);
|
|
||||||
return str;
|
|
||||||
}
|
|
||||||
|
|
||||||
Future<String> invokeMethod(String methodName, Object params) async {
|
Future<String> invokeMethod(String methodName, Object params) async {
|
||||||
var invokeResult = ApiCalls.asyncCall(methodName: 'invoke', hWallet: hWallet, params: '{"method": "$methodName","params": ${jsonEncode(params)}}');
|
var invokeResult = ApiCalls.asyncCall(methodName: 'invoke', hWallet: hWallet, params: '{"method": "$methodName","params": ${jsonEncode(params)}}');
|
||||||
var map = jsonDecode(invokeResult) as Map<String, dynamic>;
|
var map = jsonDecode(invokeResult) as Map<String, dynamic>;
|
||||||
|
|
Loading…
Reference in a new issue