├── .github └── FUNDING.yml ├── .gitignore ├── LICENSE.md ├── PRIVACY.md ├── README.md ├── img ├── icon-128.png ├── icon-16.png └── icon-48.png ├── manifest.json ├── package.json ├── src ├── main.js └── provider.js ├── webpack.config.js └── yarn.lock /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: m1guelpf 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | dist 3 | safari 4 | .ext 5 | build.zip 6 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) Miguel Piedrafita 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /PRIVACY.md: -------------------------------------------------------------------------------- 1 | **Privacy Policy** 2 | 3 | Miguel Piedrafita built the WalletConnect Bridge app as an Open Source app. This SERVICE is provided by Miguel Piedrafita at no cost and is intended for use as is. 4 | 5 | This page is used to inform visitors regarding my policies with the collection, use, and disclosure of Personal Information if anyone decided to use my Service. 6 | 7 | If you choose to use my Service, then you agree to the collection and use of information in relation to this policy. The Personal Information that I collect is used for providing and improving the Service. I will not use or share your information with anyone except as described in this Privacy Policy. 8 | 9 | The terms used in this Privacy Policy have the same meanings as in our Terms and Conditions, which is accessible at WalletConnect Bridge unless otherwise defined in this Privacy Policy. 10 | 11 | **Information Collection and Use** 12 | 13 | We do not collect any kind of personal information. 14 | 15 | **Log Data** 16 | 17 | I want to inform you that whenever you use my Service, in a case of an error in the app I collect data and information (through third party products) on your phone called Log Data. This Log Data may include information such as your device Internet Protocol (“IP”) address, device name, operating system version, the configuration of the app when utilizing my Service, the time and date of your use of the Service, and other statistics. 18 | 19 | **Security** 20 | 21 | I value your trust in providing us your Personal Information, thus we are striving to use commercially acceptable means of protecting it. But remember that no method of transmission over the internet, or method of electronic storage is 100% secure and reliable, and I cannot guarantee its absolute security. 22 | 23 | **Links to Other Sites** 24 | 25 | This Service may contain links to other sites. If you click on a third-party link, you will be directed to that site. Note that these external sites are not operated by me. Therefore, I strongly advise you to review the Privacy Policy of these websites. I have no control over and assume no responsibility for the content, privacy policies, or practices of any third-party sites or services. 26 | 27 | **Changes to This Privacy Policy** 28 | 29 | I may update our Privacy Policy from time to time. Thus, you are advised to review this page periodically for any changes. I will notify you of any changes by posting the new Privacy Policy on this page. 30 | 31 | This policy is effective as of 2021-08-06 32 | 33 | **Contact Us** 34 | 35 | If you have any questions or suggestions about my Privacy Policy, do not hesitate to contact me at soy@miguelpiedrafita.com 36 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # WalletConnect Bridge 2 | 3 | > Use your WalletConnect wallet on sites where only MetaMask is supported. 4 | 5 | This extension injects the WalletConnect web3 provider similarly to how MetaMask does it, allowing you to connect a WalletConnect wallet on pages where only injected providers are supported. 6 | 7 | ## Installation 8 | 9 | I've submitted this extension to the Chrome Web Store, and am planning to submit it to the App Store as well (which should allow you to use it from your iPhone/iPad with iOS 15!) once I figure out the best way of doing that. Once they approve it, I'll post the links here. 10 | 11 | ## Development 12 | 13 | - Clone the repository 14 | - `yarn install && yarn build` 15 | - Visit `chrome://extensions` on your Chromium browser, make sure developer mode is enabled, click _Load Unpacked_ & navigate to this repo. 16 | 17 | ## License 18 | 19 | This project is open-sourced software licensed under the MIT license. See the [License file](LICENSE.md) for more information. 20 | -------------------------------------------------------------------------------- /img/icon-128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/m1guelpf/walletconnect-extension/bf5c6f87a2bda92f4efc3b9eed4cf23a6340a892/img/icon-128.png -------------------------------------------------------------------------------- /img/icon-16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/m1guelpf/walletconnect-extension/bf5c6f87a2bda92f4efc3b9eed4cf23a6340a892/img/icon-16.png -------------------------------------------------------------------------------- /img/icon-48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/m1guelpf/walletconnect-extension/bf5c6f87a2bda92f4efc3b9eed4cf23a6340a892/img/icon-48.png -------------------------------------------------------------------------------- /manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "WalletConnect Bridge", 3 | "version": "1.0", 4 | "description": "Use WalletConnect-compatible wallets (like Rainbow), even when the sites only support MetaMask.", 5 | "icons": { 6 | "128": "img/icon-128.png", 7 | "48": "img/icon-48.png", 8 | "16": "img/icon-16.png" 9 | }, 10 | "content_scripts": [ 11 | { 12 | "matches": ["http://*/*", "https://*/*"], 13 | "run_at": "document_start", 14 | "js": ["/dist/inject.js"], 15 | "all_frames": true 16 | } 17 | ], 18 | "manifest_version": 2 19 | } 20 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "walletconnect-ext", 3 | "version": "1.0.0", 4 | "private": true, 5 | "license": "MIT", 6 | "dependencies": { 7 | "@walletconnect/web3-provider": "^1.5.2", 8 | "eth-provider": "^0.9.1", 9 | "terser-webpack-plugin": "^4.2.3", 10 | "web3": "^1.5.0", 11 | "webpack": "4.x", 12 | "webpack-cli": "3.x" 13 | }, 14 | "scripts": { 15 | "build": "webpack --config webpack.config.js && node src/main.js", 16 | "extract": "mkdir .ext && cp -a dist .ext/ && cp -a img .ext/ && cp manifest.json .ext/ && cd .ext && zip -r ../build.zip . && cd .. && rm -rf .ext" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main.js: -------------------------------------------------------------------------------- 1 | const fs = require("fs"); 2 | const path = require("path"); 3 | 4 | const inject = ` 5 | var frame = unescape('${escape( 6 | fs.readFileSync(path.join(__dirname, "../dist/provider.js")).toString() 7 | )}') 8 | try { 9 | let script = document.createElement('script') 10 | script.setAttribute('type', 'text/javascript') 11 | script.innerText = frame 12 | script.onload = function () { this.remove() } 13 | document.head ? document.head.prepend(script) : document.documentElement.prepend(script) 14 | } catch (e) { 15 | console.log(e) 16 | } 17 | `; 18 | fs.writeFile(path.join(__dirname, "../dist/inject.js"), inject, (err) => { 19 | if (err) throw err; 20 | }); 21 | -------------------------------------------------------------------------------- /src/provider.js: -------------------------------------------------------------------------------- 1 | import WalletConnectProvider from "@walletconnect/web3-provider"; 2 | import provider from "eth-provider"; 3 | 4 | const wcProvider = new WalletConnectProvider({ 5 | infuraId: "8b014620351a4cbe814220743619df5b", 6 | }); 7 | 8 | const fallbackProvider = provider([ 9 | "https://mainnet.infura.io/v3/8b014620351a4cbe814220743619df5b", 10 | ]); 11 | 12 | fallbackProvider.enable = () => { 13 | window.ethereum = wcProvider; 14 | 15 | return wcProvider.enable(); 16 | }; 17 | 18 | window.ethereum = fallbackProvider; 19 | 20 | // window.ethereum = 21 | -------------------------------------------------------------------------------- /webpack.config.js: -------------------------------------------------------------------------------- 1 | const path = require("path"); 2 | const TerserPlugin = require("terser-webpack-plugin"); 3 | 4 | module.exports = { 5 | mode: "production", 6 | entry: "./src/provider.js", 7 | optimization: { 8 | minimizer: [ 9 | new TerserPlugin({ 10 | terserOptions: { keep_classnames: true, keep_fnames: true }, 11 | }), 12 | ], 13 | }, 14 | performance: { 15 | hints: false, 16 | }, 17 | output: { 18 | filename: "provider.js", 19 | path: path.resolve(__dirname, "dist"), 20 | }, 21 | }; 22 | --------------------------------------------------------------------------------