diff --git a/src/api/ethereumdapp_imkey_web3.js b/src/api/ethereumdapp_imkey_web3.js index 2d6a130..683b937 100644 --- a/src/api/ethereumdapp_imkey_web3.js +++ b/src/api/ethereumdapp_imkey_web3.js @@ -1,11 +1,12 @@ const { contextBridge, ipcRenderer } = require('electron') -// https://chainid.network/ -const MAINNET_RPC_URL = 'https://mainnet.infura.io/v3/819049aeadbe494c80bdb815cf41242e' -const MAINNET_CHAIN_ID = 1 -const KOVAN_RPC_URL = 'https://kovan.infura.io/v3/e35ac016a10548f1b4a835a1cd72d17a' -const KOVAN_CHAIN_ID = 42 +// 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; contextBridge.exposeInMainWorld('imKeyManager', { accounts: () => { @@ -19,8 +20,10 @@ contextBridge.exposeInMainWorld('imKeyManager', { accounts: ethAccounts, chainId: MAINNET_CHAIN_ID, rpcUrl: MAINNET_RPC_URL, - headers: null - } + headers: { + agent: "ios:2.4.2:2", + } + }; }, callNativeApi: async (data) => { return await ipcRenderer.sendSync('message-from-get-api', data) diff --git a/src/renderer/common/lang/en.js b/src/renderer/common/lang/en.js index 3ea4b63..ff826ff 100644 --- a/src/renderer/common/lang/en.js +++ b/src/renderer/common/lang/en.js @@ -270,7 +270,13 @@ export const m = { sushiswap_desc: 'Stake SushiSwap LP tokens to claim your very own yummy SUSHI!', uniswap_desc: 'Guaranteed liquidity for millions of users and hundreds of Ethereum applications.', polkadotJS_desc: 'Cryptocurrency Exchange | Simple Coin Conversion', - multisender_desc: 'Send ERC20 Token or ETH to thousands of addresses out in 1 single transaction...' + multisender_desc: 'Send ERC20 Token or ETH to thousands of addresses out in 1 single transaction...', + 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.", }, imKeyCoreErrorInfo: { decoding_failed: 'Decoding failed', diff --git a/src/renderer/common/lang/zh.js b/src/renderer/common/lang/zh.js index b77ebbc..9c01366 100644 --- a/src/renderer/common/lang/zh.js +++ b/src/renderer/common/lang/zh.js @@ -272,7 +272,13 @@ export const m = { sushiswap_desc: '锁定SushiSwap LP代币,领取属于您的美味SUSHI!', uniswap_desc: '保证数百万用户和数百个Ethereum应用的流动性。', polkadotJS_desc: '加密货币交易所|简单的硬币兑换方式', - multisender_desc: '将ERC20代币或ETH发送到成千上万的地址,只需一次交易......。' + 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 获取稳定收益", }, imKeyCoreErrorInfo: { decoding_failed: '解析失败', diff --git a/src/renderer/store/dapps.js b/src/renderer/store/dapps.js new file mode 100644 index 0000000..9036a17 --- /dev/null +++ b/src/renderer/store/dapps.js @@ -0,0 +1,64 @@ +export const DAPPS = [ + { + 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: "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: "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: "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: "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" + }, + + +] \ No newline at end of file diff --git a/src/renderer/views/dapp.vue b/src/renderer/views/dapp.vue index f7e962f..c206d17 100644 --- a/src/renderer/views/dapp.vue +++ b/src/renderer/views/dapp.vue @@ -385,53 +385,6 @@ - - - - - - - - - - - - - - - - -
-

Sushiswap

-

{{ $t("m.dapp.sushiswap_desc") }}

-
-
- + + + +
+

Rarible

+

{{ $t("m.dapp.rarible_desc") }}

+
+
+ + + +
+

Murall

+

{{ $t("m.dapp.murall_desc") }}

+
+
+ + + + +
+

ZKSwap

+

{{ $t("m.dapp.zkswap_desc") }}

+
+
+ + + + + + + + + + + + + + + + + + +
+

Sushiswap

+

{{ $t("m.dapp.sushiswap_desc") }}

+
+
+ + + + +
+

Compound

+

{{ $t("m.dapp.compound_desc") }}

+
+
+ + + + +
+

AAVE

+

{{ $t("m.dapp.aave_desc") }}

+
+
+ import { ipcRenderer } from 'electron' +import {DAPPS} from '../store/dapps' const { dialog } = require('electron').remote let url @@ -641,8 +687,8 @@ export default { name: this.$t('m.setting.info'), viewInfo: '正在访问你的地址请确认,注意财产安全', showToolBar: false, - iconUrl: 'https://tokenlon.im/images/favico.png', - title: 'xxxxxxx', + iconUrl: '', + title: '', showRightTools: true, isLoading: false } @@ -719,33 +765,13 @@ export default { } } this.isLoading = true - if (urlType === 'Tokenlon') { - // url = 'https://tokenlon.im' - url = 'https://tokenlon.dev.tokenlon.im' - this.title = 'Tokenlon' - this.iconUrl = 'https://tokenlon.im/images/favico.png' - } - if (urlType === 'Sushiswap') { - url = 'https://app.sushi.com' - this.title = 'Sushiswap' - this.iconUrl = 'https://app.sushi.com/favicon.ico' - } - if (urlType === 'Uniswap') { - url = 'https://app.uniswap.org' - this.title = 'Uniswap' - this.iconUrl = 'https://app.uniswap.org/favicon.png' - } - - if (urlType === 'Multisender') { - url = 'https://multisender.app/' - this.title = 'Multisender' - this.iconUrl = 'https://multisender.app/favicon/favicon.ico' - } - if (urlType === 'Compound') { - url = 'https://compound.finance/' - } - if (urlType === 'AAVE') { - url = 'https://aave.com/' + + let dapp = DAPPS.find(x => x.urlType.toLowerCase() == urlType.toLowerCase()); + let url = ""; + if (dapp) { + url = dapp.url; + this.title = dapp.title; + this.iconUrl = dapp.iconUrl; } ipcRenderer.send('openBrowserView', url, false) this.showToolBar = true