Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add QTum Wallet FAQ and Knowledge Doc #1

Merged
merged 12 commits into from
Jul 5, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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


40 changes: 38 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -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 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

- **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 EVM transaction with the snap to the Qtum network.

- **Q: How do I reach out for snap support?**

**A:** Visit the Qtum Discord support channel or send an email to [email protected].

- **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. 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. 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](...).

## Contributing

Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
KyrylR marked this conversation as resolved.
Show resolved Hide resolved
"workspaces": [
"packages/*"
],
Expand Down
4 changes: 2 additions & 2 deletions packages/connector/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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();
```
Expand All @@ -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';

Expand Down
8 changes: 4 additions & 4 deletions packages/connector/package.json
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
2 changes: 1 addition & 1 deletion packages/connector/src/version.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"version": "0.1.0-rc.8"
"version": "0.1.0"
}
10 changes: 5 additions & 5 deletions packages/snap/package.json
Original file line number Diff line number Diff line change
@@ -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": [
Expand Down Expand Up @@ -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",
Expand Down
12 changes: 7 additions & 5 deletions packages/snap/snap.manifest.json
Original file line number Diff line number Diff line change
@@ -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/"
}
}
Expand All @@ -21,7 +21,9 @@
"snap_dialog": {},
"endowment:rpc": {
"dapps": true,
"snaps": true,
"snaps": true
},
"endowment:transaction-insight": {
"maxRequestTime": 180000
},
"snap_manageState": {},
Expand Down
2 changes: 1 addition & 1 deletion packages/snap/src/config.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
2 changes: 1 addition & 1 deletion packages/snap/src/consts/networks.ts
Original file line number Diff line number Diff line change
@@ -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[] = [
{
Expand Down
4 changes: 2 additions & 2 deletions packages/snap/src/helpers/networks.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
2 changes: 1 addition & 1 deletion packages/snap/src/helpers/parsers/erc20.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
7 changes: 3 additions & 4 deletions packages/snap/src/helpers/ui/tx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -37,13 +37,12 @@ export const buildTxUi = async (
content: panel([
heading('Sending QTUM'),
row(
formatUnits(tx.value),
formatUnits((await tx.value)!),
image(
'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2000 1735" width="24" height="24"><path d="M1995 1794.48l-.68-1L1649.69 1482l163.87-506.47.48-1.49v-13.11l-167.71-521.46a11.54 11.54 0 0 0-1.5-4.08v-1.3l-4.54-4.54a11.07 11.07 0 0 0-6.12-5.52L1192.7 101.9l-2.61-1.9h-558c-3.26 0-4 .52-11 5.46-3.34 2.37-8.21 5.86-14.4 10.29-11.69 8.38-28.83 20.71-50.92 36.63-37.21 26.82-89 64.21-154 111.13-110.58 79.9-222.46 160.83-223.58 161.64l-.64.46-8.47 8.47V440L.48 959.42l-.48 1.5v13.17L169.21 1495v.11a13.06 13.06 0 0 0 3.73 9.53l4.74 4.74L618 1827.91a10.65 10.65 0 0 0 8.53 5.39 13.69 13.69 0 0 0 6.57 1.7h553.6l2-2a11.47 11.47 0 0 0 3.44-1.38h.39l428.31-310.4 339 307.71a20.41 20.41 0 0 0 7.85 4.7 30.78 30.78 0 0 0 18 0 16.87 16.87 0 0 0 9.18-7.78 22.57 22.57 0 0 0 5.14-15 29.07 29.07 0 0 0-5.01-16.37zM1615.31 944.2l22.91-370.77 118.83 370.77h-141.74zm141.74 46.6l-118.84 370.77-22.9-370.77h141.74zM433.63 1411l142.52 329.54-337-244.93zm517.26-932l224.48-307.46 153.77 355.12zm429.52 45l-142.52-329.55 337 244.93zm22.05 42.92l193.11-84.66-24.14 394.18-.18 4.3zM242.79 880.74l-.17-4.11-24.15-394.32 114.11 50.38 79 34.27zM1133 148.27L907.83 456.62 681.16 148.27H1133zm418.33 842.53l-180.46 334.88-98.87-211.56-55.63-123.32h335zm-334.83-46.6l154.43-334.77 180.4 334.77H1216.5zM951.56 527.54l382.24 47.77-157.22 340.58zm46.93 800.05l178.11-308.45 157.2 340.54-382.12 47.76zM677.08 944.2l230.71-399 113.76 199.4L1137 944.2H677.08zM1137 990.8l-229.17 399.07-115.37-199.52L677.08 990.8H1137zm-316.49-390l-181.4 315.03-157.2-340.52 380.66-47.77zm42 806.69l-380.66-47.77 118.32-257.39 38.84-83.21zM264.38 944.2l180.38-334.7 98.94 216.39 55.41 118.31H264.38zm334.83 46.6L444.8 1325.57 264.38 990.8h334.83zm972.17 63.2v1l24.16 397.66-114.12-50.38-79-34.27zM239.15 439.38l337-244.93L433.63 524zm172.43 928.7l-193.12 84.66 24.15-397.56.05-1.17zm496.26 110.29L1133 1786.73H681.16zm667.06 17.24l-337 244.93L1380.41 1411zM484.9 526.7l153.77-355.11L863.15 479zM57 944.2l118.82-370.77 22.91 370.77H57zm141.75 46.6l-22.91 370.77L57 990.8h141.73zm664.4 465.2l-224.48 307.41-153.76-355.12zm466-47.66l-153.77 355.12L950.88 1456z" fill="#2e9ad0"/></svg>',
),
),
text(`**To**:`),
address(String(tx.to)),
...(tx.to ? [text(`**To**:`), address(tx.to?.toString())] : []),

divider(),

Expand Down
4 changes: 2 additions & 2 deletions packages/snap/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
2 changes: 1 addition & 1 deletion packages/snap/src/types/storage-types.ts
Original file line number Diff line number Diff line change
@@ -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';

Expand Down
2 changes: 1 addition & 1 deletion scripts/release-sanity-check.js
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
10 changes: 5 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand All @@ -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"
Expand Down
Loading