@ -85,8 +85,9 @@
v - for = "tx in transactions"
: key = "tx.hash"
class = "flex-column align-items-start px-3 px-lg-4"
: href = "getTxUrl(tx.hash)"
: href = "getTxExplorer Url(tx.hash)"
target = "_blank"
@ click = "openTxInExplorer"
>
<!-- Loading Transactions Placeholder -- >
< div
@ -593,8 +594,9 @@
style = "border-radius: 0; border-bottom-left-radius: 1rem; border-bottom-right-radius: 1rem; padding-top: 1rem; padding-bottom: 1rem;"
: disabled = "withdraw.isWithdrawing"
v - else - if = "mode === 'withdrawn'"
: href = "getTxUrl(withdraw.txHash)"
: href = "getTxExplorer Url(withdraw.txHash)"
target = "_blank"
@ click = "openTxInExplorer"
>
< svg
width = "19"
@ -668,7 +670,23 @@ export default {
depositAddress : state => state . bitcoin . depositAddress ,
fees : state => state . bitcoin . fees ,
unit : state => state . system . unit ,
chain : state => state . bitcoin . chain
chain : state => state . bitcoin . chain ,
localExplorerTxUrl : state => {
/ / C h e c k f o r m e m p o o l a p p
const mempool = state . apps . installed . find ( ( { id } ) => id === 'mempool' ) ;
if ( mempool ) {
return window . location . origin . indexOf ( ".onion" ) > 0 ? ` http:// ${ mempool . hiddenService } ${ mempool . path } /tx/ ` : ` http:// ${ window . location . hostname } : ${ mempool . port } ${ mempool . path } /tx/ ` ;
}
/ / C h e c k f o r b t c - r p c - e x p l o r e r a p p
const btcRpcExplorer = state . apps . installed . find ( ( { id } ) => id === 'btc-rpc-explorer' ) ;
if ( btcRpcExplorer ) {
return window . location . origin . indexOf ( ".onion" ) > 0 ? ` http:// ${ btcRpcExplorer . hiddenService } ${ btcRpcExplorer . path } /tx/ ` : ` http:// ${ window . location . hostname } : ${ btcRpcExplorer . port } ${ btcRpcExplorer . path } /tx/ ` ;
}
/ / E l s e r e t u r n e m p t y s t r i n g
return "" ;
}
} ) ,
... mapGetters ( {
transactions : "bitcoin/transactions"
@ -702,13 +720,21 @@ export default {
getReadableTime ( timestamp ) {
return moment ( timestamp ) . format ( "MMMM D, h:mm:ss a" ) ; / / u s e d i n t h e l i s t o f t x s , e g " M a r c h 0 8 , 2 0 2 0 3 : 0 3 : 1 2 p m "
} ,
getTxUrl ( txHash ) {
let url = ` https://mempool.space ` ;
if ( this . chain === "test" ) {
url += "/testnet" ;
getTxExplorerUrl ( txHash ) {
if ( this . localExplorerTxUrl ) {
return ` ${ this . localExplorerTxUrl } ${ txHash } ` ;
}
else {
if ( window . location . origin . indexOf ( ".onion" ) > 0 ) {
return this . chain === "test" ? ` http://mempoolhqx4isw62xs7abwphsq7ldayuidyx2v2oethdhhj6mlo2r6ad.onion/testnet/tx/ ${ txHash } ` : ` http://mempoolhqx4isw62xs7abwphsq7ldayuidyx2v2oethdhhj6mlo2r6ad.onion/tx/ ${ txHash } ` ;
}
return this . chain === "test" ? ` https://mempool.space/testnet/tx/ ${ txHash } ` : ` https://mempool.space/tx/ ${ txHash } ` ;
}
} ,
openTxInExplorer ( event ) {
if ( ! this . localExplorerTxUrl && ! window . confirm ( 'This will open your transaction details in a public explorer (mempool.space). Do you wish to continue?' ) ) {
event . preventDefault ( ) ;
}
return ` ${ url } /tx/ ${ txHash } ` ;
} ,
async changeMode ( mode ) {
/ / c h a n g e b e t w e e n d i f f e r e n t m o d e s / s c r e e n s o f t h e w a l l e t f r o m - t r a n s a c t i o n s ( d e f a u l t ) , w i t h d r a w , w i t h d r a w a n , d e p s o i t
@ -855,6 +881,10 @@ export default {
} ,
async created ( ) {
this . $store . dispatch ( "bitcoin/getStatus" ) ;
/ / t o f e t c h a n y i n s t a l l e d e x p l o r e r s
/ / a n d t h e i r h i d d e n s e r v i c e s
this . $store . dispatch ( "apps/getInstalledApps" ) ;
} ,
components : {
CardWidget ,