From bbc377f1193809ff24693a89c19aee479cf843cd Mon Sep 17 00:00:00 2001 From: Kyryl Riabov Date: Fri, 21 Jun 2024 16:02:25 +0300 Subject: [PATCH 01/12] Added QTum Wallet FAQ and Knowledge Doc --- README.md | 40 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 38 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5b9a898..25b571d 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,42 @@ -# Qtum Snap +# QTum Wallet -Qtum Snap is a MetaMask Snap that allows you to work with Qtum network by using ethers js providers. +The QTum Wallet plays the role of an RPC proxy that accepts requests from MetaMask and forwards them to the QTum network using the QTum ethers adapter. + +## QTum Wallet FAQ + +- **Q: What does the QTum Wallet do?** + + **A:** It acts as a proxy between the QTum blockchain and MetaMask. + +- **Q: What does the snap NOT do?** + + **A:** QTum Wallet does not have access to users’ private keys or crypto assets. + +- **Q: How do I use the QTum Wallet's features?** + + **A:** It is mainly used for interaction with the QTum blockchain. You can send any transaction with the snap to the QTum blockchain. + +- **Q: How do I reach out for snap support?** + + **A:** Visit the ... Discord support channel or send an email to [support email]. + +- **Q: How do I interact with the QTum Blockchain via QTum Wallet?** + + **A:** Any DApps integrated with the QTum snap will relay requests to interact with contracts on the QTum blockchain via MetaMask itself (the snap should be installed). + +- **Q: What applications can I use QTum Wallet Snap on?** + + **A:** Currently, you can use the QTum bridge to transfer supported assets from the Ethereum Mainnet. + +## QTum Wallet Knowledge Doc + +- **Q: What happens if I lose the keys for my account?** + + **A:** Please be extremely careful with your keys - there is no way to recover them if they are lost. QTum Wallet does not have access to users’ keys and cannot help you recover them. + +- **Q: Is QTum Wallet secure?** + + **A:** Snap is extremely safe. To ensure the user's complete safety, Snap does not have access to users’ private keys. In addition, a security audit has been conducted by [Sayfer](link). ## Contributing From 0edb6850ffda5a14b230bcdc9721aadfd693db32 Mon Sep 17 00:00:00 2001 From: Kyryl Riabov Date: Fri, 21 Jun 2024 16:39:55 +0300 Subject: [PATCH 02/12] Updated README --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 25b571d..6f9dcd3 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # QTum Wallet -The QTum Wallet plays the role of an RPC proxy that accepts requests from MetaMask and forwards them to the QTum network using the QTum ethers adapter. +The QTum Wallet acts as an RPC proxy that accepts requests from DApps to MetaMask, for example, by using ethers.js or web3.js, and forwards them to the QTum network using the QTum ethers adapter. ## QTum Wallet FAQ @@ -14,7 +14,7 @@ The QTum Wallet plays the role of an RPC proxy that accepts requests from MetaMa - **Q: How do I use the QTum Wallet's features?** - **A:** It is mainly used for interaction with the QTum blockchain. You can send any transaction with the snap to the QTum blockchain. + **A:** It is mainly used for interaction with the QTum blockchain. You can send any EVM transaction with the snap to the QTum network. - **Q: How do I reach out for snap support?** @@ -26,17 +26,17 @@ The QTum Wallet plays the role of an RPC proxy that accepts requests from MetaMa - **Q: What applications can I use QTum Wallet Snap on?** - **A:** Currently, you can use the QTum bridge to transfer supported assets from the Ethereum Mainnet. + **A:** Currently, you can use the QTum bridge to transfer supported assets from the Ethereum Mainnet. Also you can visit [wallet.bridge.qtum.net](https://wallet.bridge.qtum.net) to change networks, send ERC-20 and native tokens, and view balances. ## QTum Wallet Knowledge Doc - **Q: What happens if I lose the keys for my account?** - **A:** Please be extremely careful with your keys - there is no way to recover them if they are lost. QTum Wallet does not have access to users’ keys and cannot help you recover them. + **A:** Please be extremely careful with your keys - there is no way to recover them if they are lost. QTum Wallet does not have access to users’ keys and cannot help you recover them. However, the QTum private key is generated from the MetaMask mnemonic entropy, so it can be recovered if you still have your MetaMask mnemonic (for the first account). - **Q: Is QTum Wallet secure?** - **A:** Snap is extremely safe. To ensure the user's complete safety, Snap does not have access to users’ private keys. In addition, a security audit has been conducted by [Sayfer](link). + **A:** Snap is extremely safe. To ensure the user's complete safety, Snap does not have access to users’ private keys. In addition, a security audit has been conducted by [Sayfer](...). ## Contributing From 7574600589fff52e8c777eb8759823a565f4d694 Mon Sep 17 00:00:00 2001 From: Kyryl Riabov Date: Mon, 24 Jun 2024 13:27:33 +0300 Subject: [PATCH 03/12] Updated README --- README.md | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 6f9dcd3..4e1020f 100644 --- a/README.md +++ b/README.md @@ -1,40 +1,40 @@ -# QTum Wallet +# Qtum Wallet -The QTum Wallet acts as an RPC proxy that accepts requests from DApps to MetaMask, for example, by using ethers.js or web3.js, and forwards them to the QTum network using the QTum ethers adapter. +The Qtum Wallet acts as an RPC proxy that accepts requests from DApps to MetaMask, for example, by using ethers.js or web3.js, and forwards them to the Qtum network using the Qtum ethers adapter. -## QTum Wallet FAQ +## Qtum Wallet FAQ -- **Q: What does the QTum Wallet do?** +- **Q: What does the Qtum Wallet do?** - **A:** It acts as a proxy between the QTum blockchain and MetaMask. + **A:** It acts as a proxy between the Qtum blockchain and MetaMask. - **Q: What does the snap NOT do?** - **A:** QTum Wallet does not have access to users’ private keys or crypto assets. + **A:** Qtum Wallet does not have access to users’ private keys or crypto assets. -- **Q: How do I use the QTum Wallet's features?** +- **Q: How do I use the Qtum Wallet's features?** - **A:** It is mainly used for interaction with the QTum blockchain. You can send any EVM transaction with the snap to the QTum network. + **A:** It is mainly used for interaction with the Qtum blockchain. You can send any EVM transaction with the snap to the Qtum network. - **Q: How do I reach out for snap support?** - **A:** Visit the ... Discord support channel or send an email to [support email]. + **A:** Visit the Qtum Discord support channel or send an email to support@qtum.info. -- **Q: How do I interact with the QTum Blockchain via QTum Wallet?** +- **Q: How do I interact with the Qtum Blockchain via Qtum Wallet?** - **A:** Any DApps integrated with the QTum snap will relay requests to interact with contracts on the QTum blockchain via MetaMask itself (the snap should be installed). + **A:** Any DApps integrated with the Qtum snap will relay requests to interact with contracts on the Qtum blockchain via MetaMask itself (the snap should be installed). -- **Q: What applications can I use QTum Wallet Snap on?** +- **Q: What applications can I use Qtum Wallet Snap on?** - **A:** Currently, you can use the QTum bridge to transfer supported assets from the Ethereum Mainnet. Also you can visit [wallet.bridge.qtum.net](https://wallet.bridge.qtum.net) to change networks, send ERC-20 and native tokens, and view balances. + **A:** Currently, you can use the Qtum bridge to transfer supported assets from the Ethereum Mainnet. Also you can visit [wallet.bridge.qtum.net](https://wallet.bridge.qtum.net) to change networks, send ERC-20 and native tokens, and view balances. -## QTum Wallet Knowledge Doc +## Qtum Wallet Knowledge Doc - **Q: What happens if I lose the keys for my account?** - **A:** Please be extremely careful with your keys - there is no way to recover them if they are lost. QTum Wallet does not have access to users’ keys and cannot help you recover them. However, the QTum private key is generated from the MetaMask mnemonic entropy, so it can be recovered if you still have your MetaMask mnemonic (for the first account). + **A:** Please be extremely careful with your keys - there is no way to recover them if they are lost. Qtum Wallet does not have access to users’ keys and cannot help you recover them. However, the Qtum private key is generated from the MetaMask mnemonic entropy, so it can be recovered if you still have your MetaMask mnemonic (for the first account). -- **Q: Is QTum Wallet secure?** +- **Q: Is Qtum Wallet secure?** **A:** Snap is extremely safe. To ensure the user's complete safety, Snap does not have access to users’ private keys. In addition, a security audit has been conducted by [Sayfer](...). From 9d2778ff6ec8705af18dd5e05eb2065810c2aa65 Mon Sep 17 00:00:00 2001 From: lukachi Date: Mon, 24 Jun 2024 13:28:28 +0300 Subject: [PATCH 04/12] upd package names --- CHANGELOG.md | 11 ++++------- package.json | 8 ++++---- packages/connector/README.md | 4 ++-- packages/connector/package.json | 8 ++++---- packages/connector/src/version.json | 2 +- packages/snap/package.json | 10 +++++----- packages/snap/snap.manifest.json | 12 +++++++----- packages/snap/src/config.ts | 2 +- packages/snap/src/consts/networks.ts | 2 +- packages/snap/src/helpers/networks.ts | 4 ++-- packages/snap/src/helpers/parsers/erc20.ts | 2 +- packages/snap/src/helpers/ui/tx.ts | 7 +++---- packages/snap/src/index.ts | 4 ++-- packages/snap/src/types/storage-types.ts | 2 +- scripts/release-sanity-check.js | 2 +- yarn.lock | 10 +++++----- 16 files changed, 44 insertions(+), 46 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d41fff8..7a4bbf5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,16 +5,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [0.1.0-rc.8] - 2024-06-17 -### Added -- Expose `remove network` method for snap +## [Unreleased] -## [0.1.0-rc.6] - 2024-04-26 +## [0.1.0] - 2024-06-24 ### Added - Initial release of the snap. -[Unreleased]: https://github.com/qtumproject/metamasksnap/compare/0.1.0-rc.8...HEAD -[0.1.0-rc.8]: https://github.com/qtumproject/metamasksnap/compare/0.1.0-rc.6...0.1.0-rc.8 -[0.1.0-rc.6]: https://github.com/qtumproject/metamasksnap/releases/tag/0.1.0-rc.6 +[Unreleased]: https://github.com/qtumproject/qtum-extension-wallet/compare/0.1.0...HEAD +[0.1.0]: https://github.com/qtumproject/qtum-extension-wallet/releases/tag/0.1.0 diff --git a/package.json b/package.json index fe1862d..a878737 100644 --- a/package.json +++ b/package.json @@ -2,16 +2,16 @@ "name": "qtum-snap-monorepo", "private": true, "description": "", - "homepage": "https://github.com/qtumproject/metamasksnap#readme", + "homepage": "https://github.com/qtumproject/qtum-extension-wallet", "bugs": { - "url": "https://github.com/qtumproject/metamasksnap/issues" + "url": "https://github.com/qtumproject/qtum-extension-wallet/issues" }, "repository": { "type": "git", - "url": "git+https://github.com/qtumproject/metamasksnap.git" + "url": "git+https://github.com/qtumproject/qtum-extension-wallet.git" }, "license": "(MIT-0 OR Apache-2.0)", - "author": "Distributed Lab", + "author": "QTum project", "workspaces": [ "packages/*" ], diff --git a/packages/connector/README.md b/packages/connector/README.md index 1f1cdf5..39b2923 100644 --- a/packages/connector/README.md +++ b/packages/connector/README.md @@ -17,7 +17,7 @@ yarn add @qtumproject/wallet-snap-connector ### Define raw provider (object which is similar to window.ethereum) ```typescript -import { QtumWallet } from '@qtumproject/wallet-snap-connector'; +import { QtumWallet } from '@qtumproject/qtum-wallet-connector'; export const qtumSnap = new QtumWallet(); ``` @@ -35,7 +35,7 @@ const init = async () => { ### check if snap or metamask is installed ```typescript -import { isMetamaskInstalled } from '@qtumproject/wallet-snap-connector'; +import { isMetamaskInstalled } from '@qtumproject/qtum-wallet-connector'; import { qtumSnap } from '@/path/to/qtumSnap'; diff --git a/packages/connector/package.json b/packages/connector/package.json index 1006aad..31373ee 100644 --- a/packages/connector/package.json +++ b/packages/connector/package.json @@ -1,10 +1,10 @@ { - "name": "@qtumproject/wallet-snap-connector", - "version": "0.1.0-rc.8", - "description": "A Provider to be used in ethers.js to interact with Qtum's Snap", + "name": "@qtumproject/qtum-wallet-connector", + "version": "0.1.0", + "description": "A Provider to be used in ethers.js to interact with Qtum's wallet", "repository": { "type": "git", - "url": "https://github.com/qtumproject/metamasksnap" + "url": "https://github.com/qtumproject/qtum-extension-wallet.git" }, "license": "(MIT-0 OR Apache-2.0)", "sideEffects": false, diff --git a/packages/connector/src/version.json b/packages/connector/src/version.json index 650cf69..6a3252e 100644 --- a/packages/connector/src/version.json +++ b/packages/connector/src/version.json @@ -1,3 +1,3 @@ { - "version": "0.1.0-rc.8" + "version": "0.1.0" } diff --git a/packages/snap/package.json b/packages/snap/package.json index deeb107..e185046 100644 --- a/packages/snap/package.json +++ b/packages/snap/package.json @@ -1,10 +1,10 @@ { - "name": "@qtumproject/wallet-snap", - "version": "0.1.0-rc.8", - "description": "Qtum Snap is a MetaMask Snap that allows you to work with Qtum network by using ethers js providers.", + "name": "@qtumproject/qtum-wallet", + "version": "0.1.0", + "description": "Qtum Snap is a MetaMask Snap that plays the role of the RPC proxy that accepts requests to the MetaMask and forwards them to the Qtum network with the Qtum ethers adapter.", "repository": { "type": "git", - "url": "https://github.com/qtumproject/metamasksnap.git" + "url": "https://github.com/qtumproject/qtum-extension-wallet.git" }, "license": "(MIT-0 OR Apache-2.0)", "files": [ @@ -42,7 +42,7 @@ "@metamask/snaps-sdk": "^3.0.1", "@metamask/snaps-utils": "^7.0.3", "@metamask/transaction-controller": "^27.0.1", - "@qtumproject/wallet-snap-connector": "workspace:^", + "@qtumproject/qtum-wallet-connector": "workspace:^", "buffer": "6.0.3", "ethers": "5.7.2", "intl": "1.2.5", diff --git a/packages/snap/snap.manifest.json b/packages/snap/snap.manifest.json index 9f1aa98..ba72544 100644 --- a/packages/snap/snap.manifest.json +++ b/packages/snap/snap.manifest.json @@ -1,18 +1,18 @@ { - "version": "0.1.0-rc.8", + "version": "0.1.0", "description": "Securely store and manage all of your identity credentials. Use them across chains with ZK-protected privacy guarantees.", "proposedName": "QtumSnap", "repository": { "type": "git", - "url": "https://github.com/qtumproject/metamasksnap.git" + "url": "https://github.com/qtumproject/qtum-extension-wallet.git" }, "source": { - "shasum": "kYgOXV4uTSClbUxUMXFOaiVEpMELvQlb/eTugGmxGI8=", + "shasum": "RDoretuEsMos4loEqdukCmh8woLbbTVVgVgUaD/ZxA0=", "location": { "npm": { "filePath": "dist/bundle.js", "iconPath": "images/icon.svg", - "packageName": "@qtumproject/wallet-snap", + "packageName": "@qtumproject/qtum-wallet", "registry": "https://registry.npmjs.org/" } } @@ -21,7 +21,9 @@ "snap_dialog": {}, "endowment:rpc": { "dapps": true, - "snaps": true, + "snaps": true + }, + "endowment:transaction-insight": { "maxRequestTime": 180000 }, "snap_manageState": {}, diff --git a/packages/snap/src/config.ts b/packages/snap/src/config.ts index b5aad7c..5054536 100644 --- a/packages/snap/src/config.ts +++ b/packages/snap/src/config.ts @@ -1,4 +1,4 @@ -import { sleep } from '@qtumproject/wallet-snap-connector'; +import { sleep } from '@qtumproject/qtum-wallet-connector'; import { QtumProvider, QtumWallet } from 'qtum-ethers-wrapper'; import { StorageKeys } from '@/enums'; diff --git a/packages/snap/src/consts/networks.ts b/packages/snap/src/consts/networks.ts index 441fd22..8e3c65f 100644 --- a/packages/snap/src/consts/networks.ts +++ b/packages/snap/src/consts/networks.ts @@ -1,4 +1,4 @@ -import type { Chain } from '@qtumproject/wallet-snap-connector'; +import type { Chain } from '@qtumproject/qtum-wallet-connector'; export const DEFAULT_NETWORKS_RPC_URLS: Chain[] = [ { diff --git a/packages/snap/src/helpers/networks.ts b/packages/snap/src/helpers/networks.ts index ae3772e..de7184b 100644 --- a/packages/snap/src/helpers/networks.ts +++ b/packages/snap/src/helpers/networks.ts @@ -1,6 +1,6 @@ import { DialogType, divider, heading, text } from '@metamask/snaps-sdk'; -import type { Chain } from '@qtumproject/wallet-snap-connector'; -import { sleep } from '@qtumproject/wallet-snap-connector'; +import type { Chain } from '@qtumproject/qtum-wallet-connector'; +import { sleep } from '@qtumproject/qtum-wallet-connector'; import { DEFAULT_NETWORKS_RPC_URLS } from '@/consts'; import { StorageKeys } from '@/enums'; diff --git a/packages/snap/src/helpers/parsers/erc20.ts b/packages/snap/src/helpers/parsers/erc20.ts index f67cf53..4cdd70a 100644 --- a/packages/snap/src/helpers/parsers/erc20.ts +++ b/packages/snap/src/helpers/parsers/erc20.ts @@ -1,5 +1,5 @@ // eslint-disable-next-line camelcase -import { Erc20__factory } from '@qtumproject/wallet-snap-connector'; +import { Erc20__factory } from '@qtumproject/qtum-wallet-connector'; import { getProvider } from '@/config'; import { erc20Interface } from '@/helpers'; diff --git a/packages/snap/src/helpers/ui/tx.ts b/packages/snap/src/helpers/ui/tx.ts index c306d30..f01b096 100644 --- a/packages/snap/src/helpers/ui/tx.ts +++ b/packages/snap/src/helpers/ui/tx.ts @@ -14,7 +14,7 @@ import { import type { SnapRequestParams, RPCMethods, -} from '@qtumproject/wallet-snap-connector'; +} from '@qtumproject/qtum-wallet-connector'; import { formatUnits } from '@/helpers/format'; import { @@ -37,13 +37,12 @@ export const buildTxUi = async ( content: panel([ heading('Sending QTUM'), row( - formatUnits(tx.value), + formatUnits((await tx.value)!), image( '', ), ), - text(`**To**:`), - address(String(tx.to)), + ...(tx.to ? [text(`**To**:`), address(tx.to?.toString())] : []), divider(), diff --git a/packages/snap/src/index.ts b/packages/snap/src/index.ts index 2480c7b..283b4ea 100644 --- a/packages/snap/src/index.ts +++ b/packages/snap/src/index.ts @@ -19,8 +19,8 @@ import { text, } from '@metamask/snaps-sdk'; import type { JsonRpcRequest } from '@metamask/utils'; -import type { SnapRequestParams } from '@qtumproject/wallet-snap-connector'; -import { sleep, RPCMethods } from '@qtumproject/wallet-snap-connector'; +import type { SnapRequestParams } from '@qtumproject/qtum-wallet-connector'; +import { sleep, RPCMethods } from '@qtumproject/qtum-wallet-connector'; import { BigNumber, ethers } from 'ethers'; import { QtumWallet } from 'qtum-ethers-wrapper'; diff --git a/packages/snap/src/types/storage-types.ts b/packages/snap/src/types/storage-types.ts index b6ffd6f..dae676c 100644 --- a/packages/snap/src/types/storage-types.ts +++ b/packages/snap/src/types/storage-types.ts @@ -1,4 +1,4 @@ -import type { Chain } from '@qtumproject/wallet-snap-connector'; +import type { Chain } from '@qtumproject/qtum-wallet-connector'; import type { StorageKeys } from '@/enums'; diff --git a/scripts/release-sanity-check.js b/scripts/release-sanity-check.js index fd0aa22..9cb21d5 100644 --- a/scripts/release-sanity-check.js +++ b/scripts/release-sanity-check.js @@ -64,7 +64,7 @@ function validateChangelogHasVersionOnTop () { } function validateChangelogAnchorsLegend () { - const baseRepoUrl = 'https://github.com/qtumproject/metamasksnap' + const baseRepoUrl = 'https://github.com/qtumproject/qtum-extension-wallet' const anyReleaseTagRe = /## \[\d+\.\d+\.\d+((-rc|-x)\.\d+)?\] - \d{4}-\d{2}-\d{2}/gi diff --git a/yarn.lock b/yarn.lock index 16ce3a3..2dd15a9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3672,9 +3672,9 @@ __metadata: languageName: node linkType: hard -"@qtumproject/wallet-snap-connector@workspace:^, @qtumproject/wallet-snap-connector@workspace:packages/connector": +"@qtumproject/qtum-wallet-connector@workspace:^, @qtumproject/qtum-wallet-connector@workspace:packages/connector": version: 0.0.0-use.local - resolution: "@qtumproject/wallet-snap-connector@workspace:packages/connector" + resolution: "@qtumproject/qtum-wallet-connector@workspace:packages/connector" dependencies: "@ethersproject/abstract-provider": "npm:5.7.0" "@ethersproject/properties": "npm:^5.7.0" @@ -3692,9 +3692,9 @@ __metadata: languageName: unknown linkType: soft -"@qtumproject/wallet-snap@workspace:packages/snap": +"@qtumproject/qtum-wallet@workspace:packages/snap": version: 0.0.0-use.local - resolution: "@qtumproject/wallet-snap@workspace:packages/snap" + resolution: "@qtumproject/qtum-wallet@workspace:packages/snap" dependencies: "@ethersproject/abstract-provider": "npm:^5.7.0" "@ethersproject/abstract-signer": "npm:^5.7.0" @@ -3708,7 +3708,7 @@ __metadata: "@metamask/snaps-sdk": "npm:^3.0.1" "@metamask/snaps-utils": "npm:^7.0.3" "@metamask/transaction-controller": "npm:^27.0.1" - "@qtumproject/wallet-snap-connector": "workspace:^" + "@qtumproject/qtum-wallet-connector": "workspace:^" "@types/intl": "npm:1.2.0" "@types/lodash": "npm:^4.14.202" "@types/uuid": "npm:9.0.2" From 1df39dff141d1b8b52cfb91cc36ad8cdf3b6be6e Mon Sep 17 00:00:00 2001 From: lukachi Date: Mon, 24 Jun 2024 13:34:24 +0300 Subject: [PATCH 05/12] upd packge build --- package.json | 4 ++-- packages/connector/README.md | 4 ++-- packages/connector/package.json | 2 +- packages/connector/src/consts/snap.ts | 2 +- packages/connector/src/version.json | 2 +- packages/snap/package.json | 2 +- packages/snap/snap.manifest.json | 4 ++-- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index a878737..40b48ea 100644 --- a/package.json +++ b/package.json @@ -16,9 +16,9 @@ "packages/*" ], "scripts": { - "apply-version": "node scripts/versions.js $0 && yarn build:connector && yarn workspace @qtumproject/wallet-snap preversion", + "apply-version": "node scripts/versions.js $0 && yarn build:connector && yarn workspace @qtumproject/qtum-wallet preversion", "build": "yarn workspaces foreach -pv --topological-dev --verbose --all run build", - "build:connector": "yarn workspace @qtumproject/wallet-snap-connector build", + "build:connector": "yarn workspace @qtumproject/qtum-wallet-connector build", "postinstall": "patch-package", "lint": "yarn lint:eslint && yarn lint:misc --check", "lint:eslint": "eslint . --cache --ext js,ts", diff --git a/packages/connector/README.md b/packages/connector/README.md index 39b2923..2c154c2 100644 --- a/packages/connector/README.md +++ b/packages/connector/README.md @@ -7,11 +7,11 @@ QtumSnap connector is used to install snap and exposes methods for calling snap ### Installation ```bash -npm install @qtumproject/wallet-snap-connector +npm install @qtumproject/qtum-wallet-connector ``` ```bash -yarn add @qtumproject/wallet-snap-connector +yarn add @qtumproject/qtum-wallet-connector ``` ### Define raw provider (object which is similar to window.ethereum) diff --git a/packages/connector/package.json b/packages/connector/package.json index 31373ee..554563b 100644 --- a/packages/connector/package.json +++ b/packages/connector/package.json @@ -1,6 +1,6 @@ { "name": "@qtumproject/qtum-wallet-connector", - "version": "0.1.0", + "version": "0.1.0-rc.0", "description": "A Provider to be used in ethers.js to interact with Qtum's wallet", "repository": { "type": "git", diff --git a/packages/connector/src/consts/snap.ts b/packages/connector/src/consts/snap.ts index 3ee12f5..3672a70 100644 --- a/packages/connector/src/consts/snap.ts +++ b/packages/connector/src/consts/snap.ts @@ -1 +1 @@ -export const defaultSnapOrigin = 'npm:@qtumproject/wallet-snap'; +export const defaultSnapOrigin = 'npm:@qtumproject/qtum-wallet'; diff --git a/packages/connector/src/version.json b/packages/connector/src/version.json index 6a3252e..18ad303 100644 --- a/packages/connector/src/version.json +++ b/packages/connector/src/version.json @@ -1,3 +1,3 @@ { - "version": "0.1.0" + "version": "0.1.0-rc.0" } diff --git a/packages/snap/package.json b/packages/snap/package.json index e185046..46a8c03 100644 --- a/packages/snap/package.json +++ b/packages/snap/package.json @@ -1,6 +1,6 @@ { "name": "@qtumproject/qtum-wallet", - "version": "0.1.0", + "version": "0.1.0-rc.0", "description": "Qtum Snap is a MetaMask Snap that plays the role of the RPC proxy that accepts requests to the MetaMask and forwards them to the Qtum network with the Qtum ethers adapter.", "repository": { "type": "git", diff --git a/packages/snap/snap.manifest.json b/packages/snap/snap.manifest.json index ba72544..14a940b 100644 --- a/packages/snap/snap.manifest.json +++ b/packages/snap/snap.manifest.json @@ -1,5 +1,5 @@ { - "version": "0.1.0", + "version": "0.1.0-rc.0", "description": "Securely store and manage all of your identity credentials. Use them across chains with ZK-protected privacy guarantees.", "proposedName": "QtumSnap", "repository": { @@ -7,7 +7,7 @@ "url": "https://github.com/qtumproject/qtum-extension-wallet.git" }, "source": { - "shasum": "RDoretuEsMos4loEqdukCmh8woLbbTVVgVgUaD/ZxA0=", + "shasum": "Y8eu87M74DuiNnjJmKemX0zQKv9ebGxRF18/kCnWYl8=", "location": { "npm": { "filePath": "dist/bundle.js", From f9407a376aeb08b2255a8b2f64466c1752fa9e27 Mon Sep 17 00:00:00 2001 From: lukachi Date: Mon, 24 Jun 2024 14:16:37 +0300 Subject: [PATCH 06/12] fix readme for snap --- packages/snap/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/snap/README.md b/packages/snap/README.md index 6aab96f..e5cce64 100644 --- a/packages/snap/README.md +++ b/packages/snap/README.md @@ -1,6 +1,6 @@ -# Qtum Snap +# QTum Wallet -Qtum snap is a snap, that allows to interact with Qtum blockchain by implementing metamsk RPC requests handlers https://docs.metamask.io/wallet/reference/json-rpc-api/. +QTum wallet is a snap, that allows to interact with QTum blockchain by implementing metamask RPC requests handlers https://docs.metamask.io/wallet/reference/json-rpc-api/. ## Methods From cb7172ef3e6b2e4b49afd35248350200709e288b Mon Sep 17 00:00:00 2001 From: Kyrylo Riabov Date: Mon, 24 Jun 2024 14:19:13 +0300 Subject: [PATCH 07/12] Update package.json --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 40b48ea..868da53 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "url": "git+https://github.com/qtumproject/qtum-extension-wallet.git" }, "license": "(MIT-0 OR Apache-2.0)", - "author": "QTum project", + "author": "Qtum project", "workspaces": [ "packages/*" ], From e03e9ccd9b078dda49eb43192b64ee48fefde30e Mon Sep 17 00:00:00 2001 From: Kyryl Riabov Date: Mon, 24 Jun 2024 14:50:42 +0300 Subject: [PATCH 08/12] Updated namings --- package.json | 2 +- packages/connector/README.md | 20 ++++++++++---------- packages/snap/package.json | 2 +- packages/snap/snap.manifest.json | 4 ++-- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/package.json b/package.json index 868da53..545af6a 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "qtum-snap-monorepo", + "name": "qtum-wallet-monorepo", "private": true, "description": "", "homepage": "https://github.com/qtumproject/qtum-extension-wallet", diff --git a/packages/connector/README.md b/packages/connector/README.md index 2c154c2..b4ff8cf 100644 --- a/packages/connector/README.md +++ b/packages/connector/README.md @@ -1,6 +1,6 @@ -# QtumSnap Connector +# Qtum Wallet Connector -QtumSnap connector is used to install snap and exposes methods for calling snap on dApps and other applications. +Qtum Wallet connector is used to install snap and exposes methods for calling snap on dApps and other applications. ## Usage @@ -19,30 +19,30 @@ yarn add @qtumproject/qtum-wallet-connector ```typescript import { QtumWallet } from '@qtumproject/qtum-wallet-connector'; -export const qtumSnap = new QtumWallet(); +export const qtumWallet = new QtumWallet(); ``` ### Establish connection ```typescript -import { qtumSnap } from '@/path/to/qtumSnap'; +import { qtumWallet } from '@/path/to/qtumWallet'; const init = async () => { - await qtumSnap.enable(); + await qtumWallet.enable(); }; ``` -### check if snap or metamask is installed +### Check if snap or metamask is installed ```typescript import { isMetamaskInstalled } from '@qtumproject/qtum-wallet-connector'; -import { qtumSnap } from '@/path/to/qtumSnap'; +import { qtumWallet } from '@/path/to/qtumWallet'; const checkSnapStatus = async () => { return { isMetamaskInstalled: await isMetamaskInstalled(), - isSnapInstalled: await qtumSnap.isInstalled(), + isSnapInstalled: await qtumWallet.isInstalled(), }; }; ``` @@ -63,12 +63,12 @@ const provider = new ethers.providers.Web3Provider(connector); import { providers } from 'ethers'; import { useMemo } from 'react'; -import { qtumSnap } from '@/path/to/qtumSnap'; +import { qtumWallet } from '@/path/to/qtumWallet'; export const useProvider = () => { const provider = useMemo(() => { try { - return new providers.Web3Provider(qtumSnap as providers.ExternalProvider); + return new providers.Web3Provider(qtumWallet as providers.ExternalProvider); } catch (error) { return undefined; } diff --git a/packages/snap/package.json b/packages/snap/package.json index 46a8c03..a1efd78 100644 --- a/packages/snap/package.json +++ b/packages/snap/package.json @@ -1,7 +1,7 @@ { "name": "@qtumproject/qtum-wallet", "version": "0.1.0-rc.0", - "description": "Qtum Snap is a MetaMask Snap that plays the role of the RPC proxy that accepts requests to the MetaMask and forwards them to the Qtum network with the Qtum ethers adapter.", + "description": "Qtum Wallet is a MetaMask Snap that plays the role of the RPC proxy that accepts requests to the MetaMask and forwards them to the Qtum network with the Qtum ethers adapter.", "repository": { "type": "git", "url": "https://github.com/qtumproject/qtum-extension-wallet.git" diff --git a/packages/snap/snap.manifest.json b/packages/snap/snap.manifest.json index 14a940b..abdbfae 100644 --- a/packages/snap/snap.manifest.json +++ b/packages/snap/snap.manifest.json @@ -1,7 +1,7 @@ { "version": "0.1.0-rc.0", - "description": "Securely store and manage all of your identity credentials. Use them across chains with ZK-protected privacy guarantees.", - "proposedName": "QtumSnap", + "description": "Qtum Wallet is a MetaMask Snap that plays the role of the RPC proxy that accepts requests to the MetaMask and forwards them to the Qtum network with the Qtum ethers adapter.", + "proposedName": "Qtum Wallet", "repository": { "type": "git", "url": "https://github.com/qtumproject/qtum-extension-wallet.git" From 94bfdf099281633ef4314e271d76655e8ec01370 Mon Sep 17 00:00:00 2001 From: Kyryl Riabov Date: Mon, 24 Jun 2024 15:42:02 +0300 Subject: [PATCH 09/12] Updated manifest --- packages/snap/snap.manifest.json | 2 +- yarn.lock | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/snap/snap.manifest.json b/packages/snap/snap.manifest.json index abdbfae..3cee4cf 100644 --- a/packages/snap/snap.manifest.json +++ b/packages/snap/snap.manifest.json @@ -7,7 +7,7 @@ "url": "https://github.com/qtumproject/qtum-extension-wallet.git" }, "source": { - "shasum": "Y8eu87M74DuiNnjJmKemX0zQKv9ebGxRF18/kCnWYl8=", + "shasum": "BQi39VhbfNaQsnSpCM9+B8c3ZFNdDlaH60RAljEppDs=", "location": { "npm": { "filePath": "dist/bundle.js", diff --git a/yarn.lock b/yarn.lock index 2dd15a9..c490db4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -12560,9 +12560,9 @@ __metadata: languageName: node linkType: hard -"qtum-snap-monorepo@workspace:.": +"qtum-wallet-monorepo@workspace:.": version: 0.0.0-use.local - resolution: "qtum-snap-monorepo@workspace:." + resolution: "qtum-wallet-monorepo@workspace:." dependencies: "@ethersproject/abi": "npm:^5.7.0" "@metamask/eslint-config": "npm:^12.0.0" From a247270ba569ffb5c5b6360c8947dab898d64883 Mon Sep 17 00:00:00 2001 From: Kyryl Riabov Date: Mon, 24 Jun 2024 15:44:01 +0300 Subject: [PATCH 10/12] Fix linting --- packages/connector/README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/connector/README.md b/packages/connector/README.md index b4ff8cf..b10b188 100644 --- a/packages/connector/README.md +++ b/packages/connector/README.md @@ -68,7 +68,9 @@ import { qtumWallet } from '@/path/to/qtumWallet'; export const useProvider = () => { const provider = useMemo(() => { try { - return new providers.Web3Provider(qtumWallet as providers.ExternalProvider); + return new providers.Web3Provider( + qtumWallet as providers.ExternalProvider, + ); } catch (error) { return undefined; } From bcb1ab122ebae5b0adad820e68dff268d12ecfb3 Mon Sep 17 00:00:00 2001 From: Kyryl Riabov Date: Fri, 5 Jul 2024 18:18:47 +0300 Subject: [PATCH 11/12] Updated README --- README.md | 48 ++++++++++++++++++++++++++++++++---------------- 1 file changed, 32 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 4e1020f..b5e7df8 100644 --- a/README.md +++ b/README.md @@ -4,39 +4,55 @@ The Qtum Wallet acts as an RPC proxy that accepts requests from DApps to MetaMas ## Qtum Wallet FAQ -- **Q: What does the Qtum Wallet do?** +### What is MetaMask Snaps? - **A:** It acts as a proxy between the Qtum blockchain and MetaMask. +MetaMask Snaps enhance the wallet experience offered by Consensys by allowing end-users to add extra functionality for Web3 and DeFi purposes above the level provided by a normal MetaMask installation. -- **Q: What does the snap NOT do?** +Because of the rapidly evolving nature of blockchain technology, many new features are being developed and requested by the community. This happens at a pace that far outstrips the ability for MetaMask developers to provide in their core wallet, so by allowing a decentralized and audited framework called “Snaps”, developers can now offer their niche functionality to a greater MetaMask install by allowing “modules” called Snaps. - **A:** Qtum Wallet does not have access to users’ private keys or crypto assets. +In the example of the Qtum Blockchain, there was not a MetaMask/Qtum wallet module to work with Qtum Bridge infrastructure. Users who would like to interface with the Qtum-Ethereum bridge would need to either develop their own wallet, or learn to use complicated command-line interfaces. MetaMask Snaps allows users to seamlessly add this functionality to an existing MetaMask installation and interface with the Qtum bridge in minutes. -- **Q: How do I use the Qtum Wallet's features?** +### What is the Qtum Snap Wallet, and what does it do? - **A:** It is mainly used for interaction with the Qtum blockchain. You can send any EVM transaction with the snap to the Qtum network. +The Qtum Wallet is an extension of your MetaMask wallet. It is a proxy between the Qtum blockchain and MetaMask. The Qtum Snap allows you to hold the QTUM token, manage QRC20 tokens and NFTs, and connect to Qtum’s bridge that allows Web3 and DeFi between the Ethereum and Qtum blockchains. -- **Q: How do I reach out for snap support?** +### Why should I use the Qtum Snap with my MetaMask Wallet? - **A:** Visit the Qtum Discord support channel or send an email to support@qtum.info. +Qtum MetaMask Snap simplifies the integration of MetaMask with the Qtum blockchain. It facilitates the storage and transfer of Ethereum ERC20 assets to and from the Qtum blockchain, using the Qtum Bridge, and other QRC20 assets like Circle Bridged USDC, allowing users to access the Qtum ecosystem seamlessly without needing additional wallets. -- **Q: How do I interact with the Qtum Blockchain via Qtum Wallet?** +The Qtum MetaMask Snap is an audited and non-custodial wallet, meaning that the end user keeps full control of their private keys. The Qtum or MetaMask team have no ability to access an end-user’s wallet whatsoever. - **A:** Any DApps integrated with the Qtum snap will relay requests to interact with contracts on the Qtum blockchain via MetaMask itself (the snap should be installed). +### How does the Qtum MetaMask Snap work? -- **Q: What applications can I use Qtum Wallet Snap on?** +Metamask Snaps are open-source extensions that enhance MetaMask's functionality in a secure manner. Each snap is a JavaScript program that operates in an isolated environment, ensuring a customized and secure wallet experience. - **A:** Currently, you can use the Qtum bridge to transfer supported assets from the Ethereum Mainnet. Also you can visit [wallet.bridge.qtum.net](https://wallet.bridge.qtum.net) to change networks, send ERC-20 and native tokens, and view balances. +These “Snaps” are developed by third parties, in this case, the Qtum Foundation. They are audited by a Consensys-approved auditing team, and submitted to Consensys for review. If approved, the “Snap” will be listed on the [MetaMask Snaps Directory](https://snaps.metamask.io/) + +### Is my private key and recovery phrase exposed when using the Qtum Snap? + +Qtum Snap does not have access to users’ private keys. + +### Can I access all Qtum apps? + +Currently, you can use the Qtum bridge to transfer supported assets, like Circle Bridged USDC from the Ethereum Mainnet. For more information on the Circle set of contracts, please see here: [Introducing Bridged USDC Standard](https://www.circle.com/blog/bridged-usdc-standard) + +### Does the Qtum MetaMask Snap support Qtum NFTs? + +Not currently. The purpose of the Qtum MetaMask Snap was to provide access to the Qtum-Ethereum bridge in order to facilitate DeFi applications. Qtum NFT’s are supported on other Qtum wallets, but not currently the Qtum MetaMask Snap. + +### How do I get help with the Qtum MetaMask Snap? + +Visit Qtum’s official [Discord](https://discord.com/invite/aqkWtb6HVa) channel or send an email to support@qtum.info. ## Qtum Wallet Knowledge Doc -- **Q: What happens if I lose the keys for my account?** +### What happens if I lose the keys for my account? - **A:** Please be extremely careful with your keys - there is no way to recover them if they are lost. Qtum Wallet does not have access to users’ keys and cannot help you recover them. However, the Qtum private key is generated from the MetaMask mnemonic entropy, so it can be recovered if you still have your MetaMask mnemonic (for the first account). +Please be extremely careful with your keys - there is no way to recover them if they are lost. Qtum Wallet does not have access to users’ keys and cannot help you recover them. However, the Qtum private key is generated from the MetaMask mnemonic entropy, so it can be recovered if you still have your MetaMask mnemonic (for the first account). Please be advised that your private keys and mnemonic entropy are the highest sought item from scammers, drainers, impostors, etc. Never click on suspicious links, never respond to random direct messages, and always assume that any application that is asking for this information is trying to steal your tokens. -- **Q: Is Qtum Wallet secure?** +### Is the Qtum MetaMask Snap Secure? - **A:** Snap is extremely safe. To ensure the user's complete safety, Snap does not have access to users’ private keys. In addition, a security audit has been conducted by [Sayfer](...). +The Qtum MetaMask Snap was audited by an approved Consensys auditor called “Sayfer”. The Qtum Blockchain is an EVM-compatible chain that uses technology almost identical to the Ethereum and Bitcoin blockchains. The MetaMask Snap technology is not new, other projects have built and deployed Snaps previously without issue. The Qtum MetaMask Snap is a non-custodial wallet. ## Contributing From ebfe187e3a665f7eb0dfdcb37690372ebfbe831e Mon Sep 17 00:00:00 2001 From: Kyryl Riabov Date: Fri, 5 Jul 2024 18:21:59 +0300 Subject: [PATCH 12/12] Linting --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b5e7df8..d48e1b5 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ Qtum Snap does not have access to users’ private keys. Currently, you can use the Qtum bridge to transfer supported assets, like Circle Bridged USDC from the Ethereum Mainnet. For more information on the Circle set of contracts, please see here: [Introducing Bridged USDC Standard](https://www.circle.com/blog/bridged-usdc-standard) -### Does the Qtum MetaMask Snap support Qtum NFTs? +### Does the Qtum MetaMask Snap support Qtum NFTs? Not currently. The purpose of the Qtum MetaMask Snap was to provide access to the Qtum-Ethereum bridge in order to facilitate DeFi applications. Qtum NFT’s are supported on other Qtum wallets, but not currently the Qtum MetaMask Snap.