Skip to content

Commit

Permalink
resolve confilicts
Browse files Browse the repository at this point in the history
  • Loading branch information
xiemener committed Apr 6, 2021
2 parents c10dc1e + 53e3659 commit a1787d8
Show file tree
Hide file tree
Showing 11 changed files with 5,111 additions and 88 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@
"decimal.js": "^10.2.1",
"dotenv": "^8.2.0",
"electron-updater": "^4.3.8",
"electron-localshortcut": "^3.2.1",
"element-ui": "^2.15.1",
"express": "^4.17.1",
"ffi-napi": "^4.0.3",
Expand Down
9 changes: 6 additions & 3 deletions src/api/ethereumdapp_imkey_web3.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ const MAINNET_CHAIN_ID = 1

contextBridge.exposeInMainWorld('imKeyManager', {
accounts: () => {
let account = allAccounts.find((x) => x.chain === 'Ethereum')
const res = ipcRenderer.sendSync('message-from-get-address')
const allAccounts = res.result
const account = allAccounts.find((x) => x.chain === 'Ethereum')
return {
accounts: [account.address],
chainId: account.chainId,
Expand All @@ -22,11 +24,12 @@ contextBridge.exposeInMainWorld('imKeyManager', {
}
},
callNativeApi: async (data) => {
const ret = ipcRenderer.sendSync('showMessageBoxSync', JSON.stringify(data))
// const ret = ipcRenderer.sendSync('showMessageBoxSync', JSON.stringify(data))
const ret = ipcRenderer.sendSync('showMessageBoxSync', '')
if (ret === 0) {
return await ipcRenderer.sendSync('message-from-get-api', data)
} else {

}
}
})
Expand Down
3 changes: 2 additions & 1 deletion src/api/polkadotdapp.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,8 @@ class Signer {
}

function sign (json) {
const ret = ipcRenderer.sendSync('showMessageBoxSync', JSON.stringify(json))
// const ret = ipcRenderer.sendSync('showMessageBoxSync', JSON.stringify(json))
const ret = ipcRenderer.sendSync('showMessageBoxSync', '')
if (ret === 0) {
const result = ipcRenderer.sendSync('message-from-get-api', json)
return result.result.signature
Expand Down
14 changes: 14 additions & 0 deletions src/main/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,19 @@ function createMainWindow () {
mainWindow.loadURL(winURL)
mainWindow.once('ready-to-show', () => {
mainWindow.show()
if (process.platform === 'darwin') {
const contents = mainWindow.webContents
const localShortcut = require('electron-localshortcut')
localShortcut.register(mainWindow, 'CommandOrControl+A', () => {
contents.selectAll()
})
localShortcut.register(mainWindow, 'CommandOrControl+C', () => {
contents.copy()
})
localShortcut.register(mainWindow, 'CommandOrControl+V', () => {
contents.paste()
})
}
// 启动http server
sendWindowMessage(workerWindow, 'start-http-server', '')
app.locale = app.getLocale()
Expand Down Expand Up @@ -650,6 +663,7 @@ function createBrowserView (url, isClose) {

view.webContents.on('did-finish-load', (event, input) => {
mainWindow.webContents.send('loading-status', false)
view.setBackgroundColor("white")
})

view.webContents.on('render-process-gone', (event, details) => {
Expand Down
6 changes: 5 additions & 1 deletion src/renderer/common/lang/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,11 @@ export const m = {
HFI_one_desc: '基于 Heco 生态链的去中心化聚合挖矿平台',
Pippi_Shrimp_Swap_desc: '基于火币智能链(Heco)的去中心化交易平台',
HashBridge_desc: '提供一整套完善的数据服务方案',
JulSwap_desc: '提供与 Uniswap 相同的交易引擎和分析功能,以及Sushiswap的一些其他功能'
JulSwap_desc: '币安智能链上的AMM',
Etherscan_desc: '以太坊交易浏览器',
OpenSea_desc: '全球知名加密收藏品交易平台',
Nifty_Gateway_desc: '独一无二的NFT 交易管理平台',
SuperRare_desc: '收集超级珍稀(Super Rare)的数字艺术品'
},
imKeyCoreErrorInfo: {
decoding_failed: 'Decoding failed',
Expand Down
6 changes: 5 additions & 1 deletion src/renderer/common/lang/zh.js
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,11 @@ export const m = {
HFI_one_desc: '基于 Heco 生态链的去中心化聚合挖矿平台',
Pippi_Shrimp_Swap_desc: '基于火币智能链(Heco)的去中心化交易平台',
HashBridge_desc: '提供一整套完善的数据服务方案',
JulSwap_desc: '提供与 Uniswap 相同的交易引擎和分析功能,以及Sushiswap的一些其他功能'
JulSwap_desc: '币安智能链上的AMM',
Etherscan_desc: '以太坊交易浏览器',
OpenSea_desc: '全球知名加密收藏品交易平台',
Nifty_Gateway_desc: '独一无二的NFT 交易管理平台',
SuperRare_desc: '收集超级珍稀(Super Rare)的数字艺术品'
},
imKeyCoreErrorInfo: {
decoding_failed: '解析失败',
Expand Down
38 changes: 35 additions & 3 deletions src/renderer/store/dapps.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,44 @@ export const DAPPS_ETH = [
// desc: 'm.dapp.zksync_desc'
// },
{
id: 10,
id: 9,
urlType: 'ZKSwap',
url: 'https://zks.app/zh/wallet',
title: 'ZKSwap',
iconUrl: 'https://zks.app/favicon.ico',
desc: 'm.dapp.zkswap_desc'
},
{
id: 10,
urlType: 'Etherscan',
url: 'https://cn.etherscan.com',
title: 'Etherscan',
iconUrl: 'https://aws-v2-cdn.token.im/app-production/dapps/app_icons/276/etherscanDapp_3x.png',
desc: 'm.dapp.Etherscan_desc'
},
{
id: 11,
urlType: 'OpenSea',
url: 'https://opensea.io/?ref=0xb9e29984fe50602e7a619662ebed4f90d93824c7"',
title: 'OpenSea',
iconUrl: 'https://aws-v2-cdn.token.im/app-production/dapps/app_icons/78/OpenSea_2_162-162.png',
desc: 'm.dapp.OpenSea_desc'
},
{
id: 12,
urlType: 'Nifty Gateway',
url: 'https://niftygateway.com/',
title: 'Nifty Gateway',
iconUrl: 'https://aws-v2-cdn.token.im/app-production/dapps/app_icons/382/nifty.jpg',
desc: 'm.dapp.Nifty_Gateway_desc'
},
{
id: 13,
urlType: 'SuperRare',
url: 'https://superrare.co/',
title: 'SuperRare',
iconUrl: 'https://aws-v2-cdn.token.im/app-production/dapps/app_icons/293/SuperRare126.jpg',
desc: 'm.dapp.SuperRare_desc'
}

]
Expand Down Expand Up @@ -165,9 +197,9 @@ export const DAPPS_BSC = [
{
id: 10,
urlType: 'JulSwap',
url: 'https://julswap.com/',
url: 'https://julswap.com/#/swap',
title: 'JulSwap',
iconUrl: 'https://www.defibox.com/media/20210308123559-2b91429b0cb9.png',
iconUrl: 'https://aws-v2-cdn.token.im/app-production/dapps/app_icons/416/julswap.jpg',
desc: 'm.dapp.JulSwap_desc'
}
]
Expand Down
Loading

0 comments on commit a1787d8

Please sign in to comment.