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/README.md b/README.md index 5b9a898..d48e1b5 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,58 @@ -# 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 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 + +### What is MetaMask Snaps? + +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. + +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. + +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. + +### What is the Qtum Snap Wallet, and what does it do? + +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. + +### Why should I use the Qtum Snap with my MetaMask Wallet? + +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. + +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. + +### How does the Qtum MetaMask Snap work? + +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. + +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 + +### What happens if I lose the keys for my 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. + +### Is the Qtum MetaMask Snap Secure? + +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 diff --git a/package.json b/package.json index fe1862d..545af6a 100644 --- a/package.json +++ b/package.json @@ -1,24 +1,24 @@ { - "name": "qtum-snap-monorepo", + "name": "qtum-wallet-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/*" ], "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 1f1cdf5..b10b188 100644 --- a/packages/connector/README.md +++ b/packages/connector/README.md @@ -1,48 +1,48 @@ -# 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 ### 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) ```typescript -import { QtumWallet } from '@qtumproject/wallet-snap-connector'; +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/wallet-snap-connector'; +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,14 @@ 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/connector/package.json b/packages/connector/package.json index 1006aad..554563b 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-rc.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/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 650cf69..18ad303 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-rc.0" } 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 diff --git a/packages/snap/package.json b/packages/snap/package.json index deeb107..a1efd78 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-rc.0", + "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/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..3cee4cf 100644 --- a/packages/snap/snap.manifest.json +++ b/packages/snap/snap.manifest.json @@ -1,18 +1,18 @@ { - "version": "0.1.0-rc.8", - "description": "Securely store and manage all of your identity credentials. Use them across chains with ZK-protected privacy guarantees.", - "proposedName": "QtumSnap", + "version": "0.1.0-rc.0", + "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/metamasksnap.git" + "url": "https://github.com/qtumproject/qtum-extension-wallet.git" }, "source": { - "shasum": "kYgOXV4uTSClbUxUMXFOaiVEpMELvQlb/eTugGmxGI8=", + "shasum": "BQi39VhbfNaQsnSpCM9+B8c3ZFNdDlaH60RAljEppDs=", "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..c490db4 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" @@ -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"