@@ -14,10 +14,8 @@ import {
1414import { createDeepEqualSelector } from '../util' ;
1515import {
1616 Balance ,
17- BtcScope ,
1817 SolScope ,
1918 Transaction as NonEvmTransaction ,
20- TransactionType ,
2119} from '@metamask/keyring-api' ;
2220import { isMainNet } from '../../util/networks' ;
2321import { selectAccountBalanceByChainId } from '../accountTrackerController' ;
@@ -502,65 +500,10 @@ export const selectNonEvmTransactions = createDeepEqualSelector(
502500 }
503501
504502 // For all other cases, return transactions for the selected chain
505- const chainTransactions =
503+ return (
506504 accountTransactions [ selectedNonEvmNetworkChainId ] ??
507- DEFAULT_TRANSACTION_STATE_ENTRY ;
508-
509- // Add hardcoded unconfirmed BTC transaction for testing
510- if ( selectedNonEvmNetworkChainId === BtcScope . Mainnet ) {
511- const hardcodedBtcTransaction : NonEvmTransaction = {
512- id : 'hardcoded-btc-tx-unconfirmed' ,
513- chain : BtcScope . Mainnet ,
514- account : selectedAccount . address ,
515- from : [
516- {
517- address : selectedAccount . address ,
518- asset : {
519- amount : '0.005' ,
520- unit : 'BTC' ,
521- fungible : true ,
522- type : `${ BtcScope . Mainnet } /slip44:0` ,
523- } ,
524- } ,
525- ] ,
526- to : [
527- {
528- address : 'bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh' ,
529- asset : {
530- amount : '0.005' ,
531- unit : 'BTC' ,
532- fungible : true ,
533- type : `${ BtcScope . Mainnet } /slip44:0` ,
534- } ,
535- } ,
536- ] ,
537- type : TransactionType . Send ,
538- timestamp : Math . floor ( Date . now ( ) / 1000 ) - 300 , // 5 minutes ago (in seconds)
539- status : 'unconfirmed' ,
540- events : [ ] ,
541- fees : [
542- {
543- type : 'base' ,
544- asset : {
545- amount : '0.00001' ,
546- unit : 'BTC' ,
547- fungible : true ,
548- type : `${ BtcScope . Mainnet } /slip44:0` ,
549- } ,
550- } ,
551- ] ,
552- } ;
553-
554- return {
555- ...chainTransactions ,
556- transactions : [
557- hardcodedBtcTransaction ,
558- ...chainTransactions . transactions ,
559- ] ,
560- } ;
561- }
562-
563- return chainTransactions ;
505+ DEFAULT_TRANSACTION_STATE_ENTRY
506+ ) ;
564507 } ,
565508) ;
566509
@@ -620,62 +563,6 @@ export const selectNonEvmTransactionsForSelectedAccountGroup =
620563 }
621564 }
622565
623- // Add hardcoded unconfirmed BTC transaction for testing
624- const btcAccount = selectedGroupAccounts . find (
625- ( account ) =>
626- account . type === 'bip122:p2wpkh' ||
627- account . type === 'bip122:p2pkh' ||
628- account . type === 'bip122:p2sh' ||
629- account . type === 'bip122:p2tr' ,
630- ) ;
631-
632- if ( btcAccount ) {
633- const hardcodedBtcTransaction : NonEvmTransaction = {
634- id : 'hardcoded-btc-tx-unconfirmed' ,
635- chain : BtcScope . Mainnet ,
636- account : btcAccount . address ,
637- from : [
638- {
639- address : btcAccount . address ,
640- asset : {
641- amount : '0.005' ,
642- unit : 'BTC' ,
643- fungible : true ,
644- type : `${ BtcScope . Mainnet } /slip44:0` ,
645- } ,
646- } ,
647- ] ,
648- to : [
649- {
650- address : 'bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh' ,
651- asset : {
652- amount : '0.005' ,
653- unit : 'BTC' ,
654- fungible : true ,
655- type : `${ BtcScope . Mainnet } /slip44:0` ,
656- } ,
657- } ,
658- ] ,
659- type : TransactionType . Send ,
660- timestamp : Math . floor ( Date . now ( ) / 1000 ) - 300 , // 5 minutes ago (in seconds)
661- status : 'unconfirmed' ,
662- events : [ ] ,
663- fees : [
664- {
665- type : 'base' ,
666- asset : {
667- amount : '0.00001' ,
668- unit : 'BTC' ,
669- fungible : true ,
670- type : `${ BtcScope . Mainnet } /slip44:0` ,
671- } ,
672- } ,
673- ] ,
674- } ;
675-
676- aggregated . transactions . push ( hardcodedBtcTransaction ) ;
677- }
678-
679566 // Sort by timestamp (non-EVM tx use seconds)
680567 aggregated . transactions . sort (
681568 ( a , b ) => ( b ?. timestamp ?? 0 ) - ( a ?. timestamp ?? 0 ) ,
0 commit comments