mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-01-22 18:44:31 +00:00
format fixes and walletBalance
This commit is contained in:
parent
53b90fa01d
commit
c7608b0ad7
1 changed files with 19 additions and 8 deletions
|
@ -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,
|
||||||
);
|
);
|
||||||
|
@ -1008,10 +1018,11 @@ class EpicCashWallet extends CoinServiceAPI
|
||||||
key: '${_walletId}_epicboxConfig', value: epicboxConfig.toString());
|
key: '${_walletId}_epicboxConfig', value: epicboxConfig.toString());
|
||||||
|
|
||||||
await epiccash.LibEpiccash.recoverWallet(
|
await epiccash.LibEpiccash.recoverWallet(
|
||||||
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),
|
||||||
|
|
Loading…
Reference in a new issue