diff --git a/apps/remix-ide/project.json b/apps/remix-ide/project.json index 15636c7961..9e4aceebf5 100644 --- a/apps/remix-ide/project.json +++ b/apps/remix-ide/project.json @@ -3,7 +3,7 @@ "$schema": "../../node_modules/nx/schemas/project-schema.json", "sourceRoot": "apps/remix-ide/src", "projectType": "application", - "implicitDependencies": ["doc-gen", "doc-viewer", "etherscan", "vyper"], + "implicitDependencies": ["doc-gen", "doc-viewer", "etherscan", "vyper", "wallet-connect"], "targets": { "build": { "executor": "@nrwl/webpack:webpack", diff --git a/apps/remix-ide/src/remixAppManager.js b/apps/remix-ide/src/remixAppManager.js index 0dc9af7c2e..c6372834d2 100644 --- a/apps/remix-ide/src/remixAppManager.js +++ b/apps/remix-ide/src/remixAppManager.js @@ -17,7 +17,7 @@ const requiredModules = [ // services + layout views + system views // dependentModules shouldn't be manually activated (e.g hardhat is activated by remixd) const dependentModules = ['foundry', 'hardhat', 'truffle', 'slither'] -const loadLocalPlugins = ["doc-gen", "doc-viewer", "etherscan", "vyper"] +const loadLocalPlugins = ["doc-gen", "doc-viewer", "etherscan", "vyper", "wallet-connect"] const sensitiveCalls = { 'fileManager': ['writeFile', 'copyFile', 'rename', 'copyDir'], diff --git a/apps/wallet-connect/project.json b/apps/wallet-connect/project.json index 9d9cd71c6f..3a4f2f1bb1 100644 --- a/apps/wallet-connect/project.json +++ b/apps/wallet-connect/project.json @@ -13,14 +13,14 @@ "compiler": "babel", "outputPath": "dist/apps/wallet-connect", "index": "apps/wallet-connect/src/index.html", - "baseHref": "/", + "baseHref": "./", "main": "apps/wallet-connect/src/main.tsx", "polyfills": "apps/wallet-connect/src/polyfills.ts", "tsConfig": "apps/wallet-connect/tsconfig.app.json", - "assets": ["apps/wallet-connect/src/favicon.ico", "apps/wallet-connect/src/assets"], + "assets": ["apps/wallet-connect/src/profile.json"], "styles": ["apps/wallet-connect/src/css/app.css", "apps/wallet-connect/src/css/index.css"], "scripts": [], - "webpackConfig": "apps/wallet-connect/webpack.config.js" + "webpackConfig": "apps/wallet-connect/webpack.config.js" }, "configurations": { "development": { @@ -40,7 +40,8 @@ "defaultConfiguration": "development", "options": { "buildTarget": "wallet-connect:build", - "hmr": true + "hmr": true, + "baseHref": "/" }, "configurations": { "development": { diff --git a/apps/wallet-connect/src/index.html b/apps/wallet-connect/src/index.html index f748d655e8..f228a9aae8 100644 --- a/apps/wallet-connect/src/index.html +++ b/apps/wallet-connect/src/index.html @@ -6,7 +6,6 @@ - diff --git a/apps/wallet-connect/src/profile.json b/apps/wallet-connect/src/profile.json new file mode 100644 index 0000000000..25cf9d07ea --- /dev/null +++ b/apps/wallet-connect/src/profile.json @@ -0,0 +1,16 @@ +{ + "name": "wallet-connect", + "kind": "provider", + "displayName": "Wallet Connect", + "events": [], + "version": "2.0.0", + "methods": ["sendAsync", "init"], + "url": "", + "description": "Use an external wallet for transacting", + "icon": "data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjUxMiIgdmlld0JveD0iMCAwIDUxMiA1MTIiIHdpZHRoPSI1MTIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPjxyYWRpYWxHcmFkaWVudCBpZD0iYSIgY3g9IjAlIiBjeT0iNTAlIiByPSIxMDAlIj48c3RvcCBvZmZzZXQ9IjAiIHN0b3AtY29sb3I9IiM1ZDlkZjYiLz48c3RvcCBvZmZzZXQ9IjEiIHN0b3AtY29sb3I9IiMwMDZmZmYiLz48L3JhZGlhbEdyYWRpZW50PjxnIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCI+PHBhdGggZD0ibTI1NiAwYzE0MS4zODQ4OTYgMCAyNTYgMTE0LjYxNTEwNCAyNTYgMjU2cy0xMTQuNjE1MTA0IDI1Ni0yNTYgMjU2LTI1Ni0xMTQuNjE1MTA0LTI1Ni0yNTYgMTE0LjYxNTEwNC0yNTYgMjU2LTI1Nnoi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i4wMDAwMTFsLTYwLjQyNjk2ODMgNTguOTU3NDA4Yy0yLjU3NjYxNDEgMi41MTM5NDctNi43NTQxNzQ2IDIuNTEzOTktOS4zMzA4NDA4LjAwMDA5Mi0uMDAwMDE1MS0uMDAwMDE0LS4wMDAwMzA5LS4wMDAwMjktLjAwMDA0NjctLjAwMDA0NmwtODUuMTQzODY3NzQtODMuMDcxNDYzYy0yLjU3NjYzOTI4LTIuNTEzOTIxLTIuNTc2NjM5MjgtNi41ODk3OTUgMC05LjEwMzcxNjNsMTguODgyMzEyNjQtMTguNDIyNjk1NWMyLjU3NjYzOTMtMi41MTM5MjIyIDYuNzU0MTk5My0yLjUxMzkyMjIgOS4zMzA4Mzk3IDBsNjAuNDI5MTM0NyA1OC45NTgyNzU4Yy42NDQxNjA4LjYyODQ4IDEuNjg4NTQ5NS42Mjg0OCAyLjMzMjcxMDMgMCAuMDAwMDA5NS0uMDAwMDA5LjAwMDAxODItLjAwMDAxOC4wMDAwMjc3LS4wMDAwMjVsNjAuNDI2MTA2NS01OC45NTgyNTA4YzIuNTc2NTgxLTIuNTEzOTggNi43NTQxNDItMi41MTQwNzQzIDkuMzMwODQtLjAwMDIxMDMuMDAwMDM3LjAwMDAzNTQuMDAwMDcyLjAwMDA3MDkuMDAwMTA3LjAwMDEwNjNsNjAuNDI5MDU2IDU4Ljk1ODM1NDhjLjY0NDE1OS42Mjg0NzkgMS42ODg1NDkuNjI4NDc5IDIuMzMyNzA5IDBsNjAuNDI4MDc5LTU4Ljk1NzE5MjVjMi41NzY2NC0yLjUxMzkyMzEgNi43NTQxOTktMi41MTM5MjMxIDkuMzMwODM5IDB6IiBmaWxsPSIjZmZmIiBmaWxsLXJ1bGU9Im5vbnplcm8iIHRyYW5zZm9ybT0idHJhbnNsYXRlKDk4IDE2MCkiLz48L2c+PC9zdmc+", + "location": "mainPanel", + "documentation": "", + "repo": "https://github.com/yann300/remix-walletconnect/issues", + "maintainedBy": "Remix", + "authorContact": "" +} \ No newline at end of file diff --git a/apps/wallet-connect/src/services/constant.ts b/apps/wallet-connect/src/services/constant.ts index 993a959ab9..497ddc5357 100644 --- a/apps/wallet-connect/src/services/constant.ts +++ b/apps/wallet-connect/src/services/constant.ts @@ -1 +1,2 @@ -export const PROJECT_ID = 'a4ba105e642ae64cdb5b9a86debc0a66' \ No newline at end of file +// @ts-ignore +export const PROJECT_ID = WALLET_CONNECT_PROJECT_ID \ No newline at end of file diff --git a/apps/wallet-connect/webpack.config.js b/apps/wallet-connect/webpack.config.js index 9feb0dc08d..51de9dd815 100644 --- a/apps/wallet-connect/webpack.config.js +++ b/apps/wallet-connect/webpack.config.js @@ -3,12 +3,10 @@ const webpack = require('webpack') const TerserPlugin = require("terser-webpack-plugin") const CssMinimizerPlugin = require("css-minimizer-webpack-plugin") - // Nx plugins for webpack. module.exports = composePlugins(withNx(), (config) => { // Update the webpack config as needed here. // e.g. `config.plugins.push(new MyPlugin())` - // add fallback for node modules config.resolve.fallback = { ...config.resolve.fallback, @@ -39,9 +37,7 @@ module.exports = composePlugins(withNx(), (config) => { } // add public path - config.output.publicPath = '/' - - + config.output.publicPath = './' // add copy & provide plugin config.plugins.push( @@ -52,6 +48,13 @@ module.exports = composePlugins(withNx(), (config) => { }) ) + // set the define plugin to load the WALLET_CONNECT_PROJECT_ID + config.plugins.push( + new webpack.DefinePlugin({ + WALLET_CONNECT_PROJECT_ID: JSON.stringify(process.env.WALLET_CONNECT_PROJECT_ID), + }) + ) + // souce-map loader config.module.rules.push({ test: /\.js$/,