File tree Expand file tree Collapse file tree
packages/neuron-wallet/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ import { UpdateController } from 'controllers'
66import { showWindow } from './show-window'
77import NetworksService from 'services/networks'
88import WalletsService from 'services/wallets'
9+ import ChainInfo from 'models/chain-info'
910import CommandSubject from 'models/subjects/command'
1011
1112enum URL {
@@ -437,7 +438,7 @@ const contextMenuTemplate: {
437438 } ,
438439 {
439440 label : i18n . t ( 'contextMenu.view-on-explorer' ) ,
440- click : ( ) => { shell . openExternal ( `${ env . explorer } /address/${ address } ` ) }
441+ click : ( ) => { shell . openExternal ( `${ ChainInfo . getInstance ( ) . explorerUrl ( ) } /address/${ address } ` ) }
441442 } ,
442443 ]
443444 } ,
@@ -455,7 +456,7 @@ const contextMenuTemplate: {
455456 } ,
456457 {
457458 label : i18n . t ( 'contextMenu.view-on-explorer' ) ,
458- click : ( ) => { shell . openExternal ( `${ env . explorer } /transaction/${ hash } ` ) }
459+ click : ( ) => { shell . openExternal ( `${ ChainInfo . getInstance ( ) . explorerUrl ( ) } /transaction/${ hash } ` ) }
459460 } ,
460461 ]
461462 } ,
Original file line number Diff line number Diff line change @@ -39,7 +39,6 @@ interface ENV {
3939 current : 'testnet'
4040 list : NetworkWithID [ ]
4141 }
42- explorer : string
4342 isTestMode : boolean
4443}
4544const env : ENV = {
@@ -66,7 +65,6 @@ const env: ENV = {
6665 } ,
6766 ] ,
6867 } ,
69- explorer : 'https://explorer.nervos.org' ,
7068 isTestMode,
7169}
7270
Original file line number Diff line number Diff line change @@ -22,4 +22,11 @@ export default class ChainInfo {
2222 public isMainnet = ( ) : boolean => {
2323 return this . chain === 'ckb'
2424 }
25+
26+ public explorerUrl = ( ) : string => {
27+ if ( this . isMainnet ( ) ) {
28+ return "https://explorer.nervos.org"
29+ }
30+ return "https://explorer.nervos.org" // TODO: change this to proper testnet explorer URL
31+ }
2532}
You can’t perform that action at this time.
0 commit comments