move amount_converter to cw_core (#588)

Co-authored-by: Serhii <borodenko.sv@gmail.com>
This commit is contained in:
mkyq 2022-11-03 14:45:50 -04:00 committed by GitHub
parent b27b55388c
commit 8e70b611d0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 19 deletions

View file

@ -2,7 +2,7 @@ import 'package:cw_haven/api/structs/pending_transaction.dart';
import 'package:cw_haven/api/transaction_history.dart'
as haven_transaction_history;
import 'package:cw_core/crypto_currency.dart';
// import 'package:cake_wallet/core/amount_converter.dart';
import 'package:cw_core/amount_converter.dart';
import 'package:cw_core/pending_transaction.dart';
class DoubleSpendException implements Exception {
@ -25,17 +25,13 @@ class PendingHavenTransaction with PendingTransaction {
@override
String get hex => '';
// FIX-ME: AmountConverter
@override
String get amountFormatted => '';
// AmountConverter.amountIntToString(
// cryptoCurrency, pendingTransactionDescription.amount);
String get amountFormatted => AmountConverter.amountIntToString(
cryptoCurrency, pendingTransactionDescription.amount);
// FIX-ME: AmountConverter
@override
String get feeFormatted => '';
// AmountConverter.amountIntToString(
// cryptoCurrency, pendingTransactionDescription.fee);
String get feeFormatted => AmountConverter.amountIntToString(
cryptoCurrency, pendingTransactionDescription.fee);
@override
Future<void> commit() async {

View file

@ -2,7 +2,7 @@ import 'package:cw_monero/api/structs/pending_transaction.dart';
import 'package:cw_monero/api/transaction_history.dart'
as monero_transaction_history;
import 'package:cw_core/crypto_currency.dart';
// import 'package:cake_wallet/core/amount_converter.dart';
import 'package:cw_core/amount_converter.dart';
import 'package:cw_core/pending_transaction.dart';
@ -27,17 +27,13 @@ class PendingMoneroTransaction with PendingTransaction {
String get txKey => pendingTransactionDescription.txKey;
// FIX-ME: AmountConverter
@override
String get amountFormatted => '';
// AmountConverter.amountIntToString(
// CryptoCurrency.xmr, pendingTransactionDescription.amount);
String get amountFormatted => AmountConverter.amountIntToString(
CryptoCurrency.xmr, pendingTransactionDescription.amount);
// FIX-ME: AmountConverter
@override
String get feeFormatted => '';
// AmountConverter.amountIntToString(
// CryptoCurrency.xmr, pendingTransactionDescription.fee);
String get feeFormatted => AmountConverter.amountIntToString(
CryptoCurrency.xmr, pendingTransactionDescription.fee);
@override
Future<void> commit() async {

View file

@ -1,5 +1,5 @@
import 'dart:convert';
import 'package:cake_wallet/core/amount_converter.dart';
import 'package:cw_core/amount_converter.dart';
import 'package:hive/hive.dart';
import 'package:cake_wallet/exchange/trade_not_found_exeption.dart';
import 'package:flutter/foundation.dart';