Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/feature/dapp' into feature/dapp
Browse files Browse the repository at this point in the history
  • Loading branch information
wofwq committed Mar 29, 2021
2 parents 0ac76cf + 818b7b0 commit 74d29f9
Show file tree
Hide file tree
Showing 15 changed files with 114 additions and 336 deletions.
9 changes: 4 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,9 @@
},
"dependencies": {
"@fortawesome/fontawesome-free": "^5.15.2",
"@polkadot/api": "^4.0.3",
"@imkey/web3-provider": "file:../imkey-web3-provider",
"@polkadot/api": "^4.2.1",
"@polkadot/extension-dapp": "^0.37.2",
"@polkadot/types": "^4.0.3",
"@polkadot/types": "^4.2.1",
"@polkadot/util": "^6.0.5",
"@polkadot/util-crypto": "^6.0.5",
"@sentry/electron": "^2.4.0",
Expand All @@ -117,12 +116,12 @@
"electron-updater": "^4.3.8",
"element-ui": "^2.15.1",
"express": "^4.17.1",
"ffi-napi": "^4.0.1",
"ffi-napi": "^4.0.3",
"fs-extra": "^9.1.0",
"is-online": "^9.0.0",
"lodash": "^4.17.21",
"lodash-id": "^0.14.0",
"ref-napi": "^3.0.1",
"ref-napi": "^3.0.2",
"sa-sdk-javascript": "^1.16.6",
"sa-sdk-node": "^1.2.3",
"vue": "^2.6.12",
Expand Down
12 changes: 6 additions & 6 deletions src/api/ethereumdapp.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ const createEthereumProviderScript = function () {
return response
}

function createJsonrpcError (payload, error) {
const response = payload
response.error = error
response.result = null
return response
}
// function createJsonrpcError (payload, error) {
// const response = payload
// response.error = error
// response.result = null
// return response
// }

function inherits (ctor, superCtor) {
ctor.super_ = superCtor
Expand Down
16 changes: 8 additions & 8 deletions src/api/ethereumdapp_imkey_web3.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@

const { contextBridge, ipcRenderer } = require('electron')

// https://chainid.network/
// https://chainid.network/
// const MAINNET_RPC_URL = "https://mainnet.infura.io/v3/819049aeadbe494c80bdb815cf41242e"
const MAINNET_RPC_URL = "https://mainnet-eth.token.im"
const MAINNET_CHAIN_ID = 1;
const KOVAN_RPC_URL = "https://kovan.infura.io/v3/e35ac016a10548f1b4a835a1cd72d17a"
const KOVAN_CHAIN_ID = 42;
const MAINNET_RPC_URL = 'https://mainnet-eth.token.im'
const MAINNET_CHAIN_ID = 1
// const KOVAN_RPC_URL = 'https://kovan.infura.io/v3/e35ac016a10548f1b4a835a1cd72d17a'
// const KOVAN_CHAIN_ID = 42

contextBridge.exposeInMainWorld('imKeyManager', {
accounts: () => {
Expand All @@ -21,9 +21,9 @@ contextBridge.exposeInMainWorld('imKeyManager', {
chainId: MAINNET_CHAIN_ID,
rpcUrl: MAINNET_RPC_URL,
headers: {
agent: "ios:2.4.2:2",
}
};
agent: 'ios:2.4.2:2'
}
}
},
callNativeApi: async (data) => {
return await ipcRenderer.sendSync('message-from-get-api', data)
Expand Down
27 changes: 0 additions & 27 deletions src/ethereumdapp.ejs

This file was deleted.

26 changes: 0 additions & 26 deletions src/ethereumdapp_imkey_web3.ejs

This file was deleted.

26 changes: 0 additions & 26 deletions src/imkey_web3_provider.ejs

This file was deleted.

6 changes: 2 additions & 4 deletions src/main/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ import {
shell,
Tray,
dialog,
crashReporter,
ipcRenderer,
screen
crashReporter
} from 'electron'
// 自动更新相关
import { autoUpdater } from 'electron-updater'
Expand All @@ -19,7 +17,6 @@ import * as Sentry from '@sentry/electron'
// test.json
import pkg from '../../package.json'
import SensorsAnalytics from 'sa-sdk-node'
import { api } from '../api/apirouter'
const fs = require('fs')
const url =
'https://imtoken.datasink.sensorsdata.cn/sa?project=production&token=27d69b3e7fd25949'
Expand Down Expand Up @@ -586,6 +583,7 @@ function createBrowserView (url, isClose) {
// url= "https://murall.art/home"//imtoken 主网
// url= "https://play.decentraland.org/" //主网
// url = "https://trade.dydx.exchange/margin"//连接有问题一直转圈
// url = "https://danfinlay.github.io/js-eth-personal-sign-examples/"
view.webContents.loadURL(url, options)

// view.webContents.on('did-frame-finish-load', () => {
Expand Down
26 changes: 0 additions & 26 deletions src/polkadotdapp.ejs

This file was deleted.

6 changes: 3 additions & 3 deletions src/renderer/common/lang/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -274,9 +274,9 @@ export const m = {
rarible_desc: 'Create and sell digital collectibles',
murall_desc: 'A digital, immutable, collaborative mural that anyone anywhere can draw on.',
zksync_desc: "Ethereum's first and most user-centric ZK rollup.",
zkswap_desc: "A ZK-Rollups based layer-2 DEX with AMM model.",
compound_desc: "An autonomous interest rate protocol to unlock open financial applications.",
aave_desc: "An protocol to earn interest on deposits and borrow assets.",
zkswap_desc: 'A ZK-Rollups based layer-2 DEX with AMM model.',
compound_desc: 'An autonomous interest rate protocol to unlock open financial applications.',
aave_desc: 'An protocol to earn interest on deposits and borrow assets.'
},
imKeyCoreErrorInfo: {
decoding_failed: 'Decoding failed',
Expand Down
8 changes: 4 additions & 4 deletions src/renderer/common/lang/zh.js
Original file line number Diff line number Diff line change
Expand Up @@ -275,10 +275,10 @@ export const m = {
multisender_desc: '将ERC20代币或ETH发送到成千上万的地址,只需一次交易......。',
rarible_desc: 'Create and sell digital collectibles',
murall_desc: '在线创作加密艺术作品',
zksync_desc: "安全、去信任化的以太坊二层网络",
zkswap_desc: "基于 zkRollup Layer2 并采用 AMM 的去中心化交易所",
compound_desc: "能够同时管理 MakerDAO 与 Compound 的理财神器",
aave_desc: "去中心化理财, 抵押 DAI 获取稳定收益",
zksync_desc: '安全、去信任化的以太坊二层网络',
zkswap_desc: '基于 zkRollup Layer2 并采用 AMM 的去中心化交易所',
compound_desc: '能够同时管理 MakerDAO 与 Compound 的理财神器',
aave_desc: '去中心化理财, 抵押 DAI 获取稳定收益'
},
imKeyCoreErrorInfo: {
decoding_failed: '解析失败',
Expand Down
85 changes: 42 additions & 43 deletions src/renderer/store/dapps.js
Original file line number Diff line number Diff line change
@@ -1,64 +1,63 @@
export const DAPPS = [
{
urlType: "Tokenlon",
url: "https://tokenlon.im/instant",
title: "Tokenlon",
iconUrl: "https://tokenlon.im/images/favico.png"
urlType: 'Tokenlon',
url: 'https://tokenlon.im/instant',
title: 'Tokenlon',
iconUrl: 'https://tokenlon.im/images/favico.png'
},
{
urlType: "Sushiswap",
url: "https://app.sushi.com",
title: "Sushiswap",
iconUrl: "https://app.sushi.com/favicon.ico"
urlType: 'Sushiswap',
url: 'https://app.sushi.com',
title: 'Sushiswap',
iconUrl: 'https://app.sushi.com/favicon.ico'
},
{
urlType: "Uniswap",
url: "https://app.uniswap.org",
title: "Uniswap",
iconUrl: "https://app.uniswap.org/favicon.png"
urlType: 'Uniswap',
url: 'https://app.uniswap.org',
title: 'Uniswap',
iconUrl: 'https://app.uniswap.org/favicon.png'
},
{
urlType: "Multisender",
url: "https://multisender.app",
title: "Multisender",
iconUrl: "https://multisender.app/favicon/favicon.ico"
urlType: 'Multisender',
url: 'https://multisender.app',
title: 'Multisender',
iconUrl: 'https://multisender.app/favicon/favicon.ico'
},
{
urlType: "Compound",
url: "https://app.compound.finance/",
title: "Compound",
iconUrl: "https://compound.finance/favicon.ico"
urlType: 'Compound',
url: 'https://app.compound.finance/',
title: 'Compound',
iconUrl: 'https://compound.finance/favicon.ico'
},
{
urlType: "AAVE",
url: "https://app.aave.com/",
title: "AAVE",
iconUrl: "https://aave.com/favicon.ico"
urlType: 'AAVE',
url: 'https://app.aave.com/',
title: 'AAVE',
iconUrl: 'https://aave.com/favicon.ico'
},
{
urlType: "Rarible",
url: "https://rarible.com",
title: "Rarible",
iconUrl: "https://rarible.com/favicon.png"
urlType: 'Rarible',
url: 'https://rarible.com',
title: 'Rarible',
iconUrl: 'https://rarible.com/favicon.png'
},
{
urlType: "Murall",
url: "https://murall.art",
title: "Murall",
iconUrl: "https://murall.art/images/murall_top_logo_mobile.svg"
urlType: 'Murall',
url: 'https://murall.art',
title: 'Murall',
iconUrl: 'https://murall.art/images/murall_top_logo_mobile.svg'
},
{
urlType: "zkSync",
url: "https://wallet.zksync.io/accounts",
title: "zkSync",
iconUrl: "https://zksync.io/favicon.ico"
urlType: 'zkSync',
url: 'https://wallet.zksync.io/accounts',
title: 'zkSync',
iconUrl: 'https://zksync.io/favicon.ico'
},
{
urlType: "ZKSwap",
url: "https://zks.app/zh/wallet",
title: "ZKSwap",
iconUrl: "https://zks.app/favicon.ico"
},

urlType: 'ZKSwap',
url: 'https://zks.app/zh/wallet',
title: 'ZKSwap',
iconUrl: 'https://zks.app/favicon.ico'
}

]
]
Loading

0 comments on commit 74d29f9

Please sign in to comment.