From 989069d014c382f54e4f15d78d97b62e3d0c7732 Mon Sep 17 00:00:00 2001 From: Johnson Chen Date: Thu, 2 May 2024 09:35:54 +0800 Subject: [PATCH] docs: update --- app/content/development.md | 19 ++++++++++++++++ app/content/en/overview.md | 43 +++++++++++++++++++++++++++++++++++ app/content/specifications.md | 10 ++++++++ packages/modal/development.md | 4 ---- 4 files changed, 72 insertions(+), 4 deletions(-) create mode 100644 app/content/development.md create mode 100644 app/content/specifications.md delete mode 100644 packages/modal/development.md diff --git a/app/content/development.md b/app/content/development.md new file mode 100644 index 0000000..de8223e --- /dev/null +++ b/app/content/development.md @@ -0,0 +1,19 @@ +# Development + +## If you update the Wallet state, you also need to update the follows: + +- core/src/types/wallet.ts -> type Wallet +- core/src/store.ts -> wallet +- core/src/services/connect.ts -> resetWallet +- core/src/services/connect.ts -> return Computed +- core/src/types/listeners.ts -> type ConnWallet +- core/src/utils/assert.ts -> assertConnected + +docs updates +- app/content/en/overview.md -> Wallet & isConnected +- app/content/zh-TW/overview.md -> Wallet & isConnected + + +## Git Commit Convention + +If changes affect functionality within the packages, they will be merged using the Github Pull Request. Otherwise, updates for the website (app) or documentations will be pushed directly to the main branch. diff --git a/app/content/en/overview.md b/app/content/en/overview.md index 5d94e1f..447cacd 100644 --- a/app/content/en/overview.md +++ b/app/content/en/overview.md @@ -43,7 +43,50 @@ console.log(error.value) console.log(chainId.value) ``` +## Connect +The following explanation can help you better understand how `` connects to the wallet. + +(If you're using ``, the following code snippet may not be necessary as `` handles this functionality for you. ) + +```ts +const { connectTo } = useVueDapp() +``` + +You can connect to a specific connector as follows: + +```ts +connectTo("BrowserWallet", options) +connectTo("WalletConnect", undefined) +connectTo("CoinbaseWallet", undefined) +``` + +When connecting to a browser wallet, you have the option to use the RDNS specified in EIP-6963 for connection, or use the traditional `window.ethereum`. + +```ts +export enum RdnsEnum { + 'rabby' = 'io.rabby', + 'metamask' = 'io.metamask', + 'brave' = 'com.brave.wallet', + 'coinbase' = 'com.coinbase.wallet', + 'bitget' = 'com.bitget.web3wallet', +} + +export type RDNS = string +``` + +When a dapp is opened in a browser with wallet extensions installed, the provider can be obtained according to the EIP-6963. However, when the dapp is opened within a dapp browser built into a mobile wallet app, `window.ethereum` is used to obtain the provider. + +```ts +connectTo("BrowserWallet", { + target: "rdns", + rdns: RdnsEnum.rabby +}) + +connectTo("BrowserWallet", { + target: "window.ethereum", +}) +``` diff --git a/app/content/specifications.md b/app/content/specifications.md new file mode 100644 index 0000000..5bd20b8 --- /dev/null +++ b/app/content/specifications.md @@ -0,0 +1,10 @@ +# Specifications + +Record of version for significant updates and their corresponding features. For detailed information, please refer to the GitHub release notes. + +## v1.3.0 + +- [Release](https://github.com/vu3th/vue-dapp/releases/tag/v1.3.0) +- [Enable dapp browser in mobile wallet](https://github.com/vu3th/vue-dapp/issues/171) +- [Ensure correct disconnection when browser wallet disconnects manually](https://github.com/vu3th/vue-dapp/pull/175) + diff --git a/packages/modal/development.md b/packages/modal/development.md deleted file mode 100644 index 35bb710..0000000 --- a/packages/modal/development.md +++ /dev/null @@ -1,4 +0,0 @@ -# Development - -## How to test connect error and auto-connect error? -