File tree Expand file tree Collapse file tree 4 files changed +35
-0
lines changed
models/isar/models/blockchain_data/v2
pages/wallet_view/transaction_views/tx_v2 Expand file tree Collapse file tree 4 files changed +35
-0
lines changed Original file line number Diff line number Diff line change @@ -87,6 +87,9 @@ class TransactionV2 {
8787 );
8888 }
8989
90+ @ignore
91+ String ? get memo => _getFromOtherData (key: TxV2OdKeys .memo) as String ? ;
92+
9093 @ignore
9194 int ? get size => _getFromOtherData (key: TxV2OdKeys .size) as int ? ;
9295
@@ -447,4 +450,5 @@ abstract final class TxV2OdKeys {
447450 static const isInstantLock = "isInstantLock" ;
448451 static const salviumTypeInt = "salviumTypeInt" ;
449452 static const salviumTypeString = "salviumTypeString" ;
453+ static const memo = "onChainMemo" ;
450454}
Original file line number Diff line number Diff line change @@ -1264,6 +1264,15 @@ class _TransactionV2DetailsViewState
12641264 label: "Nonce" ,
12651265 detail: _transaction.nonce.toString (),
12661266 ),
1267+ if (_transaction.memo != null )
1268+ isDesktop
1269+ ? const _Divider ()
1270+ : const SizedBox (height: 12 ),
1271+ if (_transaction.memo != null )
1272+ _DetailItem (
1273+ label: "Memo" ,
1274+ detail: _transaction.memo! ,
1275+ ),
12671276 if (coin is Salvium &&
12681277 _transaction.salviumTypeString != null )
12691278 isDesktop
Original file line number Diff line number Diff line change @@ -579,6 +579,16 @@ class SolanaWallet extends Bip39Wallet<Solana> {
579579 txType = isar.TransactionType .unknown;
580580 }
581581
582+ // check for memo
583+ final memos = parsedTx.message.instructions
584+ .map ((e) => e.toJson ())
585+ .where (
586+ (e) => e["parsed" ] is String && e["program" ] == "spl-memo" ,
587+ );
588+ final String ? memo = memos.isEmpty
589+ ? null
590+ : memos.first["parsed" ] as String ;
591+
582592 // Create TransactionV2 object.
583593 final txn = TransactionV2 (
584594 walletId: walletId,
@@ -615,6 +625,7 @@ class SolanaWallet extends Bip39Wallet<Solana> {
615625 subType: isar.TransactionSubType .none,
616626 otherData: jsonEncode ({
617627 TxV2OdKeys .overrideFee: tx.meta! .fee.toString (),
628+ if (memo != null ) TxV2OdKeys .memo: memo,
618629 }),
619630 );
620631
Original file line number Diff line number Diff line change @@ -544,6 +544,16 @@ class SolanaTokenWallet extends Wallet {
544544 txType = TransactionType .unknown;
545545 }
546546
547+ // check for memo
548+ final memos = parsedTx.message.instructions
549+ .map ((e) => e.toJson ())
550+ .where (
551+ (e) => e["parsed" ] is String && e["program" ] == "spl-memo" ,
552+ );
553+ final String ? memo = memos.isEmpty
554+ ? null
555+ : memos.first["parsed" ] as String ;
556+
547557 // Create placeholder TransactionV2 object.
548558 final txn = TransactionV2 (
549559 walletId: walletId,
@@ -583,6 +593,7 @@ class SolanaTokenWallet extends Wallet {
583593 TxV2OdKeys .contractAddress: tokenMint,
584594 TxV2OdKeys .isCancelled: (txDetails.meta! .err != null ),
585595 TxV2OdKeys .overrideFee: txDetails.meta! .fee.toString (),
596+ if (memo != null ) TxV2OdKeys .memo: memo,
586597 }),
587598 );
588599
You can’t perform that action at this time.
0 commit comments