format fixes and walletBalance

This commit is contained in:
ryleedavis 2023-09-29 15:46:33 -06:00
parent 53b90fa01d
commit c7608b0ad7

View file

@ -99,7 +99,11 @@ Future<void> executeNative(Map<String, dynamic> arguments) async {
final numberOfBlocks = arguments['numberOfBlocks'] as int?; final numberOfBlocks = arguments['numberOfBlocks'] as int?;
Map<String, dynamic> result = {}; Map<String, dynamic> result = {};
if (!(wallet == null || startHeight == null || numberOfBlocks == null)) { if (!(wallet == null || startHeight == null || numberOfBlocks == null)) {
var outputs = await scanOutPuts(wallet, startHeight, numberOfBlocks); var outputs = await epiccash.LibEpiccash.scanOutputs(
wallet: wallet,
startHeight: startHeight,
numberOfBlocks: numberOfBlocks,
);
result['outputs'] = outputs; result['outputs'] = outputs;
sendPort.send(result); sendPort.send(result);
return; return;
@ -119,7 +123,11 @@ Future<void> executeNative(Map<String, dynamic> arguments) async {
const int refreshFromNode = 1; const int refreshFromNode = 1;
Map<String, dynamic> result = {}; Map<String, dynamic> result = {};
if (!(wallet == null)) { if (!(wallet == null)) {
var res = await getWalletInfo(wallet, refreshFromNode, 10); var res = await epiccash.LibEpiccash.getWalletBalances(
wallet: wallet!,
refreshFromNode: refreshFromNode,
minimumConfirmations: 10,
);
result['result'] = res; result['result'] = res;
sendPort.send(result); sendPort.send(result);
return; return;
@ -172,7 +180,10 @@ Future<String> deleteEpicWallet({
return "Tried to delete non existent epic wallet file with walletId=$walletId"; return "Tried to delete non existent epic wallet file with walletId=$walletId";
} else { } else {
try { try {
return epiccash.LibEpiccash.deleteWallet(wallet: wallet, config: config!); return epiccash.LibEpiccash.deleteWallet(
wallet: wallet,
config: config!,
);
} catch (e, s) { } catch (e, s) {
Logging.instance.log("$e\n$s", level: LogLevel.Error); Logging.instance.log("$e\n$s", level: LogLevel.Error);
return "deleteEpicWallet($walletId) failed..."; return "deleteEpicWallet($walletId) failed...";
@ -703,7 +714,6 @@ class EpicCashWallet extends CoinServiceAPI
var transactionFees = await epiccash.LibEpiccash.getTransactionFees( var transactionFees = await epiccash.LibEpiccash.getTransactionFees(
wallet: wallet!, wallet: wallet!,
amount: satoshiAmount, amount: satoshiAmount,
// todo: double check
minimumConfirmations: MINIMUM_CONFIRMATIONS, minimumConfirmations: MINIMUM_CONFIRMATIONS,
available: available, available: available,
); );
@ -1011,7 +1021,8 @@ class EpicCashWallet extends CoinServiceAPI
config: stringConfig, config: stringConfig,
password: password, password: password,
mnemonic: mnemonic, mnemonic: mnemonic,
name: name); name: name,
);
await Future.wait([ await Future.wait([
epicUpdateRestoreHeight(height), epicUpdateRestoreHeight(height),