Minor nano fixes + abstract nano utils out into package (#1250)

* fixes

* refactors

* fixes

* more fixes

* fixes for monero.com

* update confirmed balance to receivable balance

* fix balance display bug

* remove print statements

* prevent unnecessary writes

* review fixes

* forgot to add pubspec changes

* fix

* fix sync status desyncing on rpc fail

* fix

* update translations + txDetails fixes

* squash balance bug

* add source address on tx info

* fix
This commit is contained in:
Matthew Fosse
2024-01-12 01:00:41 +02:00
committed by GitHub
parent 8d973cf919
commit fe2e26f146
42 changed files with 306 additions and 518 deletions
+2 -17
View File
@@ -759,7 +759,7 @@ import 'package:convert/convert.dart';
import "package:ed25519_hd_key/ed25519_hd_key.dart";
import 'package:libcrypto/libcrypto.dart';
import 'package:nanodart/nanodart.dart' as ND;
import 'package:decimal/decimal.dart';
import 'package:nanoutil/nanoutil.dart';
""";
const nanoCwPart = "part 'cw_nano.dart';";
const nanoContent = """
@@ -795,7 +795,7 @@ abstract class Nano {
Map<String, String> getKeys(Object wallet);
Object createNanoTransactionCredentials(List<Output> outputs);
Future<void> changeRep(Object wallet, String address);
Future<void> updateTransactions(Object wallet);
Future<bool> updateTransactions(Object wallet);
BigInt getTransactionAmountRaw(TransactionInfo transactionInfo);
String getRepresentative(Object wallet);
}
@@ -810,20 +810,6 @@ abstract class NanoAccountList {
}
abstract class NanoUtil {
String seedToPrivate(String seed, int index);
String seedToAddress(String seed, int index);
String seedToMnemonic(String seed);
Future<String> mnemonicToSeed(String mnemonic);
String privateKeyToPublic(String privateKey);
String addressToPublicKey(String publicAddress);
String privateKeyToAddress(String privateKey);
String publicKeyToAddress(String publicKey);
bool isValidSeed(String seed);
Future<String> hdMnemonicListToSeed(List<String> words);
Future<String> hdSeedToPrivate(String seed, int index);
Future<String> hdSeedToAddress(String seed, int index);
Future<String> uniSeedToAddress(String seed, int index, String type);
Future<String> uniSeedToPrivate(String seed, int index, String type);
bool isValidBip39Seed(String seed);
static const int maxDecimalDigits = 6; // Max digits after decimal
BigInt rawPerNano = BigInt.parse("1000000000000000000000000000000");
@@ -831,7 +817,6 @@ abstract class NanoUtil {
BigInt rawPerBanano = BigInt.parse("100000000000000000000000000000");
BigInt rawPerXMR = BigInt.parse("1000000000000");
BigInt convertXMRtoNano = BigInt.parse("1000000000000000000");
String getRawAsDecimalString(String? raw, BigInt? rawPerCur);
String getRawAsUsableString(String? raw, BigInt rawPerCur);
String getRawAccuracy(String? raw, BigInt rawPerCur);
String getAmountAsRaw(String amount, BigInt rawPerCur);