mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-01-22 02:24:30 +00:00
add serialized amount string to transaction
This commit is contained in:
parent
3ab605c065
commit
b2b9accee1
15 changed files with 124 additions and 10 deletions
|
@ -5,6 +5,7 @@ import 'package:isar/isar.dart';
|
|||
import 'package:stackwallet/models/isar/models/blockchain_data/address.dart';
|
||||
import 'package:stackwallet/models/isar/models/blockchain_data/input.dart';
|
||||
import 'package:stackwallet/models/isar/models/blockchain_data/output.dart';
|
||||
import 'package:stackwallet/utilities/amount.dart';
|
||||
import 'package:tuple/tuple.dart';
|
||||
|
||||
part 'transaction.g.dart';
|
||||
|
@ -18,6 +19,7 @@ class Transaction {
|
|||
required this.type,
|
||||
required this.subType,
|
||||
required this.amount,
|
||||
required this.amountString,
|
||||
required this.fee,
|
||||
required this.height,
|
||||
required this.isCancelled,
|
||||
|
@ -35,6 +37,7 @@ class Transaction {
|
|||
TransactionType? type,
|
||||
TransactionSubType? subType,
|
||||
int? amount,
|
||||
String? amountString,
|
||||
int? fee,
|
||||
int? height,
|
||||
bool? isCancelled,
|
||||
|
@ -54,6 +57,7 @@ class Transaction {
|
|||
type: type ?? this.type,
|
||||
subType: subType ?? this.subType,
|
||||
amount: amount ?? this.amount,
|
||||
amountString: amountString ?? this.amountString,
|
||||
fee: fee ?? this.fee,
|
||||
height: height ?? this.height,
|
||||
isCancelled: isCancelled ?? this.isCancelled,
|
||||
|
@ -86,6 +90,8 @@ class Transaction {
|
|||
|
||||
late final int amount;
|
||||
|
||||
late String? amountString;
|
||||
|
||||
late final int fee;
|
||||
|
||||
late final int? height;
|
||||
|
@ -105,6 +111,13 @@ class Transaction {
|
|||
@Backlink(to: "transactions")
|
||||
final address = IsarLink<Address>();
|
||||
|
||||
@ignore
|
||||
Amount? _cachedAmount;
|
||||
|
||||
@ignore
|
||||
Amount get realAmount =>
|
||||
_cachedAmount ??= Amount.fromSerializedJsonString(amountString!);
|
||||
|
||||
int getConfirmations(int currentChainHeight) {
|
||||
if (height == null || height! <= 0) return 0;
|
||||
return max(0, currentChainHeight - (height! - 1));
|
||||
|
@ -124,6 +137,7 @@ class Transaction {
|
|||
"type: ${type.name}, "
|
||||
"subType: ${subType.name}, "
|
||||
"amount: $amount, "
|
||||
"amountString: $amountString, "
|
||||
"fee: $fee, "
|
||||
"height: $height, "
|
||||
"isCancelled: $isCancelled, "
|
||||
|
@ -143,6 +157,7 @@ class Transaction {
|
|||
"type": type.name,
|
||||
"subType": subType.name,
|
||||
"amount": amount,
|
||||
"amountString": amountString,
|
||||
"fee": fee,
|
||||
"height": height,
|
||||
"isCancelled": isCancelled,
|
||||
|
@ -168,6 +183,7 @@ class Transaction {
|
|||
type: TransactionType.values.byName(json["type"] as String),
|
||||
subType: TransactionSubType.values.byName(json["subType"] as String),
|
||||
amount: json["amount"] as int,
|
||||
amountString: json["amountString"] as String,
|
||||
fee: json["fee"] as int,
|
||||
height: json["height"] as int?,
|
||||
isCancelled: json["isCancelled"] as bool,
|
||||
|
|
|
@ -34,6 +34,7 @@ import 'package:stackwallet/services/node_service.dart';
|
|||
import 'package:stackwallet/services/notifications_api.dart';
|
||||
import 'package:stackwallet/services/transaction_notification_tracker.dart';
|
||||
import 'package:stackwallet/utilities/address_utils.dart';
|
||||
import 'package:stackwallet/utilities/amount.dart';
|
||||
import 'package:stackwallet/utilities/assets.dart';
|
||||
import 'package:stackwallet/utilities/bip32_utils.dart';
|
||||
import 'package:stackwallet/utilities/constants.dart';
|
||||
|
@ -1335,6 +1336,10 @@ class BitcoinWallet extends CoinServiceAPI
|
|||
type: isar_models.TransactionType.outgoing,
|
||||
subType: isar_models.TransactionSubType.none,
|
||||
amount: txData["recipientAmt"] as int,
|
||||
amountString: Amount(
|
||||
rawValue: BigInt.from(txData["recipientAmt"] as int),
|
||||
fractionDigits: coin.decimals,
|
||||
).toJsonString(),
|
||||
fee: txData["fee"] as int,
|
||||
height: null,
|
||||
isCancelled: false,
|
||||
|
|
|
@ -31,6 +31,7 @@ import 'package:stackwallet/services/node_service.dart';
|
|||
import 'package:stackwallet/services/notifications_api.dart';
|
||||
import 'package:stackwallet/services/transaction_notification_tracker.dart';
|
||||
import 'package:stackwallet/utilities/address_utils.dart';
|
||||
import 'package:stackwallet/utilities/amount.dart';
|
||||
import 'package:stackwallet/utilities/assets.dart';
|
||||
import 'package:stackwallet/utilities/bip32_utils.dart';
|
||||
import 'package:stackwallet/utilities/constants.dart';
|
||||
|
@ -1250,6 +1251,10 @@ class BitcoinCashWallet extends CoinServiceAPI
|
|||
type: isar_models.TransactionType.outgoing,
|
||||
subType: isar_models.TransactionSubType.none,
|
||||
amount: txData["recipientAmt"] as int,
|
||||
amountString: Amount(
|
||||
rawValue: BigInt.from(txData["recipientAmt"] as int),
|
||||
fractionDigits: coin.decimals,
|
||||
).toJsonString(),
|
||||
fee: txData["fee"] as int,
|
||||
height: null,
|
||||
isCancelled: false,
|
||||
|
@ -2309,6 +2314,10 @@ class BitcoinCashWallet extends CoinServiceAPI
|
|||
type: type,
|
||||
subType: isar_models.TransactionSubType.none,
|
||||
amount: amount,
|
||||
amountString: Amount(
|
||||
rawValue: BigInt.from(amount),
|
||||
fractionDigits: coin.decimals,
|
||||
).toJsonString(),
|
||||
fee: fee,
|
||||
height: txData["height"] as int?,
|
||||
isCancelled: false,
|
||||
|
|
|
@ -33,6 +33,7 @@ import 'package:stackwallet/services/node_service.dart';
|
|||
import 'package:stackwallet/services/notifications_api.dart';
|
||||
import 'package:stackwallet/services/transaction_notification_tracker.dart';
|
||||
import 'package:stackwallet/utilities/address_utils.dart';
|
||||
import 'package:stackwallet/utilities/amount.dart';
|
||||
import 'package:stackwallet/utilities/assets.dart';
|
||||
import 'package:stackwallet/utilities/bip32_utils.dart';
|
||||
import 'package:stackwallet/utilities/constants.dart';
|
||||
|
@ -1117,6 +1118,10 @@ class DogecoinWallet extends CoinServiceAPI
|
|||
type: isar_models.TransactionType.outgoing,
|
||||
subType: isar_models.TransactionSubType.none,
|
||||
amount: txData["recipientAmt"] as int,
|
||||
amountString: Amount(
|
||||
rawValue: BigInt.from(txData["recipientAmt"] as int),
|
||||
fractionDigits: coin.decimals,
|
||||
).toJsonString(),
|
||||
fee: txData["fee"] as int,
|
||||
height: null,
|
||||
isCancelled: false,
|
||||
|
|
|
@ -27,6 +27,7 @@ import 'package:stackwallet/services/mixins/epic_cash_hive.dart';
|
|||
import 'package:stackwallet/services/mixins/wallet_cache.dart';
|
||||
import 'package:stackwallet/services/mixins/wallet_db.dart';
|
||||
import 'package:stackwallet/services/node_service.dart';
|
||||
import 'package:stackwallet/utilities/amount.dart';
|
||||
import 'package:stackwallet/utilities/constants.dart';
|
||||
import 'package:stackwallet/utilities/default_epicboxes.dart';
|
||||
import 'package:stackwallet/utilities/default_nodes.dart';
|
||||
|
@ -1688,6 +1689,10 @@ class EpicCashWallet extends CoinServiceAPI
|
|||
: isar_models.TransactionType.outgoing,
|
||||
subType: isar_models.TransactionSubType.none,
|
||||
amount: amt,
|
||||
amountString: Amount(
|
||||
rawValue: BigInt.from(amt),
|
||||
fractionDigits: coin.decimals,
|
||||
).toJsonString(),
|
||||
fee: (tx["fee"] == null) ? 0 : int.parse(tx["fee"] as String),
|
||||
height: height,
|
||||
isCancelled: tx["tx_type"] == "TxSentCancelled" ||
|
||||
|
|
|
@ -22,6 +22,7 @@ import 'package:stackwallet/services/mixins/wallet_db.dart';
|
|||
import 'package:stackwallet/services/node_service.dart';
|
||||
import 'package:stackwallet/services/notifications_api.dart';
|
||||
import 'package:stackwallet/services/transaction_notification_tracker.dart';
|
||||
import 'package:stackwallet/utilities/amount.dart';
|
||||
import 'package:stackwallet/utilities/assets.dart';
|
||||
import 'package:stackwallet/utilities/constants.dart';
|
||||
import 'package:stackwallet/utilities/default_nodes.dart';
|
||||
|
@ -881,6 +882,10 @@ class EthereumWallet extends CoinServiceAPI with WalletCache, WalletDB {
|
|||
isIncoming ? TransactionType.incoming : TransactionType.outgoing,
|
||||
subType: TransactionSubType.none,
|
||||
amount: transactionAmount,
|
||||
amountString: Amount(
|
||||
rawValue: BigInt.from(transactionAmount),
|
||||
fractionDigits: coin.decimals,
|
||||
).toJsonString(),
|
||||
fee: txFee,
|
||||
height: height,
|
||||
isCancelled: txFailed,
|
||||
|
|
|
@ -32,6 +32,7 @@ import 'package:stackwallet/services/node_service.dart';
|
|||
import 'package:stackwallet/services/notifications_api.dart';
|
||||
import 'package:stackwallet/services/transaction_notification_tracker.dart';
|
||||
import 'package:stackwallet/utilities/address_utils.dart';
|
||||
import 'package:stackwallet/utilities/amount.dart';
|
||||
import 'package:stackwallet/utilities/assets.dart';
|
||||
import 'package:stackwallet/utilities/bip32_utils.dart';
|
||||
import 'package:stackwallet/utilities/constants.dart';
|
||||
|
@ -472,6 +473,10 @@ Future<Map<dynamic, dynamic>> staticProcessRestore(
|
|||
type: element.type,
|
||||
subType: isar_models.TransactionSubType.mint,
|
||||
amount: element.amount,
|
||||
amountString: Amount(
|
||||
rawValue: BigInt.from(element.amount),
|
||||
fractionDigits: Coin.firo.decimals,
|
||||
).toJsonString(),
|
||||
fee: sharedFee,
|
||||
height: element.height,
|
||||
isCancelled: false,
|
||||
|
@ -899,6 +904,10 @@ class FiroWallet extends CoinServiceAPI with WalletCache, WalletDB, FiroHive {
|
|||
type: isar_models.TransactionType.outgoing,
|
||||
subType: isar_models.TransactionSubType.none,
|
||||
amount: txData["recipientAmt"] as int,
|
||||
amountString: Amount(
|
||||
rawValue: BigInt.from(txData["recipientAmt"] as int),
|
||||
fractionDigits: Coin.firo.decimals,
|
||||
).toJsonString(),
|
||||
fee: txData["fee"] as int,
|
||||
height: null,
|
||||
isCancelled: false,
|
||||
|
@ -3072,6 +3081,11 @@ class FiroWallet extends CoinServiceAPI with WalletCache, WalletDB, FiroHive {
|
|||
}
|
||||
await firoUpdateLelantusCoins(coins);
|
||||
|
||||
final amount = Format.decimalAmountToSatoshis(
|
||||
Decimal.parse(transactionInfo["amount"].toString()),
|
||||
coin,
|
||||
);
|
||||
|
||||
// add the send transaction
|
||||
final transaction = isar_models.Transaction(
|
||||
walletId: walletId,
|
||||
|
@ -3086,10 +3100,11 @@ class FiroWallet extends CoinServiceAPI with WalletCache, WalletDB, FiroHive {
|
|||
: transactionInfo["subType"] == "join"
|
||||
? isar_models.TransactionSubType.join
|
||||
: isar_models.TransactionSubType.none,
|
||||
amount: Format.decimalAmountToSatoshis(
|
||||
Decimal.parse(transactionInfo["amount"].toString()),
|
||||
coin,
|
||||
),
|
||||
amount: amount,
|
||||
amountString: Amount(
|
||||
rawValue: BigInt.from(amount),
|
||||
fractionDigits: Coin.firo.decimals,
|
||||
).toJsonString(),
|
||||
fee: Format.decimalAmountToSatoshis(
|
||||
Decimal.parse(transactionInfo["fees"].toString()),
|
||||
coin,
|
||||
|
@ -3649,6 +3664,10 @@ class FiroWallet extends CoinServiceAPI with WalletCache, WalletDB, FiroHive {
|
|||
type: type,
|
||||
subType: subType,
|
||||
amount: amount,
|
||||
amountString: Amount(
|
||||
rawValue: BigInt.from(amount),
|
||||
fractionDigits: Coin.firo.decimals,
|
||||
).toJsonString(),
|
||||
fee: fees,
|
||||
height: txObject["height"] as int? ?? 0,
|
||||
isCancelled: false,
|
||||
|
@ -4969,6 +4988,11 @@ class FiroWallet extends CoinServiceAPI with WalletCache, WalletDB, FiroHive {
|
|||
tx["address"] = tx["vout"][sendIndex]["scriptPubKey"]["addresses"][0];
|
||||
tx["fees"] = tx["vin"][0]["nFees"];
|
||||
|
||||
final amount = Format.decimalAmountToSatoshis(
|
||||
Decimal.parse(tx["amount"].toString()),
|
||||
coin,
|
||||
);
|
||||
|
||||
final txn = isar_models.Transaction(
|
||||
walletId: walletId,
|
||||
txid: tx["txid"] as String,
|
||||
|
@ -4976,10 +5000,11 @@ class FiroWallet extends CoinServiceAPI with WalletCache, WalletDB, FiroHive {
|
|||
(DateTime.now().millisecondsSinceEpoch ~/ 1000),
|
||||
type: isar_models.TransactionType.outgoing,
|
||||
subType: isar_models.TransactionSubType.join,
|
||||
amount: Format.decimalAmountToSatoshis(
|
||||
Decimal.parse(tx["amount"].toString()),
|
||||
coin,
|
||||
),
|
||||
amount: amount,
|
||||
amountString: Amount(
|
||||
rawValue: BigInt.from(amount),
|
||||
fractionDigits: Coin.firo.decimals,
|
||||
).toJsonString(),
|
||||
fee: Format.decimalAmountToSatoshis(
|
||||
Decimal.parse(tx["fees"].toString()),
|
||||
coin,
|
||||
|
|
|
@ -31,6 +31,7 @@ import 'package:stackwallet/services/mixins/wallet_db.dart';
|
|||
import 'package:stackwallet/services/node_service.dart';
|
||||
import 'package:stackwallet/services/notifications_api.dart';
|
||||
import 'package:stackwallet/services/transaction_notification_tracker.dart';
|
||||
import 'package:stackwallet/utilities/amount.dart';
|
||||
import 'package:stackwallet/utilities/assets.dart';
|
||||
import 'package:stackwallet/utilities/bip32_utils.dart';
|
||||
import 'package:stackwallet/utilities/constants.dart';
|
||||
|
@ -1242,6 +1243,10 @@ class LitecoinWallet extends CoinServiceAPI
|
|||
type: isar_models.TransactionType.outgoing,
|
||||
subType: isar_models.TransactionSubType.none,
|
||||
amount: txData["recipientAmt"] as int,
|
||||
amountString: Amount(
|
||||
rawValue: BigInt.from(txData["recipientAmt"] as int),
|
||||
fractionDigits: coin.decimals,
|
||||
).toJsonString(),
|
||||
fee: txData["fee"] as int,
|
||||
height: null,
|
||||
isCancelled: false,
|
||||
|
|
|
@ -38,6 +38,7 @@ import 'package:stackwallet/services/event_bus/global_event_bus.dart';
|
|||
import 'package:stackwallet/services/mixins/wallet_cache.dart';
|
||||
import 'package:stackwallet/services/mixins/wallet_db.dart';
|
||||
import 'package:stackwallet/services/node_service.dart';
|
||||
import 'package:stackwallet/utilities/amount.dart';
|
||||
import 'package:stackwallet/utilities/constants.dart';
|
||||
import 'package:stackwallet/utilities/default_nodes.dart';
|
||||
import 'package:stackwallet/utilities/enums/coin_enum.dart';
|
||||
|
@ -926,6 +927,10 @@ class MoneroWallet extends CoinServiceAPI with WalletCache, WalletDB {
|
|||
type: type,
|
||||
subType: isar_models.TransactionSubType.none,
|
||||
amount: tx.value.amount ?? 0,
|
||||
amountString: Amount(
|
||||
rawValue: BigInt.from(tx.value.amount ?? 0),
|
||||
fractionDigits: coin.decimals,
|
||||
).toJsonString(),
|
||||
fee: tx.value.fee ?? 0,
|
||||
height: tx.value.height,
|
||||
isCancelled: false,
|
||||
|
|
|
@ -31,6 +31,7 @@ import 'package:stackwallet/services/mixins/wallet_db.dart';
|
|||
import 'package:stackwallet/services/node_service.dart';
|
||||
import 'package:stackwallet/services/notifications_api.dart';
|
||||
import 'package:stackwallet/services/transaction_notification_tracker.dart';
|
||||
import 'package:stackwallet/utilities/amount.dart';
|
||||
import 'package:stackwallet/utilities/assets.dart';
|
||||
import 'package:stackwallet/utilities/bip32_utils.dart';
|
||||
import 'package:stackwallet/utilities/constants.dart';
|
||||
|
@ -1232,6 +1233,10 @@ class NamecoinWallet extends CoinServiceAPI
|
|||
type: isar_models.TransactionType.outgoing,
|
||||
subType: isar_models.TransactionSubType.none,
|
||||
amount: txData["recipientAmt"] as int,
|
||||
amountString: Amount(
|
||||
rawValue: BigInt.from(txData["recipientAmt"] as int),
|
||||
fractionDigits: coin.decimals,
|
||||
).toJsonString(),
|
||||
fee: txData["fee"] as int,
|
||||
height: null,
|
||||
isCancelled: false,
|
||||
|
|
|
@ -44,6 +44,8 @@ import 'package:stackwallet/utilities/prefs.dart';
|
|||
import 'package:tuple/tuple.dart';
|
||||
import 'package:uuid/uuid.dart';
|
||||
|
||||
import '../../../utilities/amount.dart';
|
||||
|
||||
const int MINIMUM_CONFIRMATIONS = 1;
|
||||
const int DUST_LIMIT = 294;
|
||||
|
||||
|
@ -1160,6 +1162,10 @@ class ParticlWallet extends CoinServiceAPI
|
|||
type: isar_models.TransactionType.outgoing,
|
||||
subType: isar_models.TransactionSubType.none,
|
||||
amount: txData["recipientAmt"] as int,
|
||||
amountString: Amount(
|
||||
rawValue: BigInt.from(txData["recipientAmt"] as int),
|
||||
fractionDigits: coin.decimals,
|
||||
).toJsonString(),
|
||||
fee: txData["fee"] as int,
|
||||
height: null,
|
||||
isCancelled: false,
|
||||
|
@ -2351,6 +2357,10 @@ class ParticlWallet extends CoinServiceAPI
|
|||
type: type,
|
||||
subType: isar_models.TransactionSubType.none,
|
||||
amount: amount,
|
||||
amountString: Amount(
|
||||
rawValue: BigInt.from(amount),
|
||||
fractionDigits: coin.decimals,
|
||||
).toJsonString(),
|
||||
fee: fee,
|
||||
height: txObject["height"] as int,
|
||||
inputs: inputs,
|
||||
|
|
|
@ -40,6 +40,7 @@ import 'package:stackwallet/services/event_bus/global_event_bus.dart';
|
|||
import 'package:stackwallet/services/mixins/wallet_cache.dart';
|
||||
import 'package:stackwallet/services/mixins/wallet_db.dart';
|
||||
import 'package:stackwallet/services/node_service.dart';
|
||||
import 'package:stackwallet/utilities/amount.dart';
|
||||
import 'package:stackwallet/utilities/constants.dart';
|
||||
import 'package:stackwallet/utilities/default_nodes.dart';
|
||||
import 'package:stackwallet/utilities/enums/coin_enum.dart';
|
||||
|
@ -204,8 +205,7 @@ class WowneroWallet extends CoinServiceAPI with WalletCache, WalletDB {
|
|||
try {
|
||||
aprox = (await prepareSend(
|
||||
// This address is only used for getting an approximate fee, never for sending
|
||||
address:
|
||||
"WW3iVcnoAY6K9zNdU4qmdvZELefx6xZz4PMpTwUifRkvMQckyadhSPYMVPJhBdYE8P9c27fg9RPmVaWNFx1cDaj61HnetqBiy",
|
||||
address: "WW3iVcnoAY6K9zNdU4qmdvZELefx6xZz4PMpTwUifRkvMQckyadhSPYMVPJhBdYE8P9c27fg9RPmVaWNFx1cDaj61HnetqBiy",
|
||||
satoshiAmount: satoshiAmount,
|
||||
args: {"feeRate": feeRateType}))['fee'];
|
||||
await Future.delayed(const Duration(milliseconds: 500));
|
||||
|
@ -1006,6 +1006,10 @@ class WowneroWallet extends CoinServiceAPI with WalletCache, WalletDB {
|
|||
type: type,
|
||||
subType: isar_models.TransactionSubType.none,
|
||||
amount: tx.value.amount ?? 0,
|
||||
amountString: Amount(
|
||||
rawValue: BigInt.from(tx.value.amount ?? 0),
|
||||
fractionDigits: coin.decimals,
|
||||
).toJsonString(),
|
||||
fee: tx.value.fee ?? 0,
|
||||
height: tx.value.height,
|
||||
isCancelled: false,
|
||||
|
|
|
@ -21,6 +21,7 @@ import 'package:stackwallet/services/event_bus/global_event_bus.dart';
|
|||
import 'package:stackwallet/services/mixins/eth_token_cache.dart';
|
||||
import 'package:stackwallet/services/node_service.dart';
|
||||
import 'package:stackwallet/services/transaction_notification_tracker.dart';
|
||||
import 'package:stackwallet/utilities/amount.dart';
|
||||
import 'package:stackwallet/utilities/default_nodes.dart';
|
||||
import 'package:stackwallet/utilities/enums/coin_enum.dart';
|
||||
import 'package:stackwallet/utilities/enums/fee_rate_type_enum.dart';
|
||||
|
@ -436,6 +437,10 @@ class EthTokenWallet extends ChangeNotifier with EthTokenCache {
|
|||
type: isIncoming ? TransactionType.incoming : TransactionType.outgoing,
|
||||
subType: TransactionSubType.ethToken,
|
||||
amount: amount,
|
||||
amountString: Amount(
|
||||
rawValue: BigInt.from(amount),
|
||||
fractionDigits: tokenContract.decimals,
|
||||
).toJsonString(),
|
||||
fee: tuple.item2.gasUsed * tuple.item2.gasPrice.toInt(),
|
||||
height: tuple.item1.blockNumber,
|
||||
isCancelled: false,
|
||||
|
|
|
@ -4,6 +4,7 @@ import 'package:bip47/src/util.dart';
|
|||
import 'package:decimal/decimal.dart';
|
||||
import 'package:stackwallet/models/isar/models/isar_models.dart';
|
||||
import 'package:stackwallet/services/mixins/paynym_wallet_interface.dart';
|
||||
import 'package:stackwallet/utilities/amount.dart';
|
||||
import 'package:stackwallet/utilities/enums/coin_enum.dart';
|
||||
import 'package:stackwallet/utilities/format.dart';
|
||||
import 'package:tuple/tuple.dart';
|
||||
|
@ -220,6 +221,10 @@ mixin ElectrumXParsing {
|
|||
type: type,
|
||||
subType: txSubType,
|
||||
amount: amount,
|
||||
amountString: Amount(
|
||||
rawValue: BigInt.from(amount),
|
||||
fractionDigits: coin.decimals,
|
||||
).toJsonString(),
|
||||
fee: fee,
|
||||
height: txData["height"] as int?,
|
||||
isCancelled: false,
|
||||
|
|
|
@ -12,6 +12,7 @@ import 'package:stackwallet/models/node_model.dart';
|
|||
import 'package:stackwallet/services/mixins/wallet_db.dart';
|
||||
import 'package:stackwallet/services/node_service.dart';
|
||||
import 'package:stackwallet/services/wallets_service.dart';
|
||||
import 'package:stackwallet/utilities/amount.dart';
|
||||
import 'package:stackwallet/utilities/constants.dart';
|
||||
import 'package:stackwallet/utilities/default_nodes.dart';
|
||||
import 'package:stackwallet/utilities/enums/coin_enum.dart';
|
||||
|
@ -327,6 +328,10 @@ class DbVersionMigrator with WalletDB {
|
|||
: isar_models.TransactionType.outgoing,
|
||||
subType: isar_models.TransactionSubType.none,
|
||||
amount: tx.amount,
|
||||
amountString: Amount(
|
||||
rawValue: BigInt.from(tx.amount),
|
||||
fractionDigits: info.coin.decimals,
|
||||
).toJsonString(),
|
||||
fee: tx.fees,
|
||||
height: tx.height,
|
||||
isCancelled: tx.isCancelled,
|
||||
|
|
Loading…
Reference in a new issue