mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-26 06:08:40 +01:00
* fix android CI * fix: duplicate outgoing tx for jup swaps and stuck pending state * fix solana security risk by handling duplicate token symbols in wallet transactions * feat: implement additional cost handling for pending transactions in Solana wallet. * fix: Items on security audit list for solana wallet * refactor: streamline fee payer index handling and improve error logging * fix: verifySignature for solana and handle wrong mint on default token * fix: token decimals defaulting to zero and breaking amount parsing in solana * fix: use token mask in tx history * refactor: apply lint to modified code * fix: merge conflicts * fix: use Money and mint decimals when parsing sol swaps * test: add unit tests for SPL token amount handling and parsing * test: add more tests * fix: update decimal handling for fetched token and remove unused fields
31 lines
710 B
Dart
31 lines
710 B
Dart
import 'package:cw_core/amount/money.dart';
|
|
|
|
class PendingChange {
|
|
final String address;
|
|
final BigInt amount;
|
|
|
|
PendingChange(this.address, this.amount);
|
|
}
|
|
|
|
mixin PendingTransaction {
|
|
String get id;
|
|
|
|
Money get amount;
|
|
Money get fee;
|
|
Money? get additionalCost => null;
|
|
|
|
String get amountFormatted;
|
|
String get feeFormatted => fee.toStringWithSymbol(fractionalDigits: 8);
|
|
String get feeFormattedValue => fee.toStringWithPrecision(fractionalDigits: 8);
|
|
String? feeRate;
|
|
String get hex;
|
|
String? get evmTxHashFromRawHex => null;
|
|
int? get outputCount => null;
|
|
PendingChange? change;
|
|
|
|
bool shouldCommitUR() => false;
|
|
|
|
Future<void> commit();
|
|
Future<Map<String, String>> commitUR();
|
|
}
|