Skip to content

Commit

Permalink
docs: update
Browse files Browse the repository at this point in the history
  • Loading branch information
johnson86tw committed May 2, 2024
1 parent 15470e0 commit 989069d
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 4 deletions.
19 changes: 19 additions & 0 deletions app/content/development.md
Original file line number Diff line number Diff line change
@@ -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.
43 changes: 43 additions & 0 deletions app/content/en/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,50 @@ console.log(error.value)
console.log(chainId.value)
```

## Connect

The following explanation can help you better understand how `<VueDappModal>` connects to the wallet.

(If you're using `<VueDappModal>`, the following code snippet may not be necessary as `<VueDappModal>` 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",
})
```



Expand Down
10 changes: 10 additions & 0 deletions app/content/specifications.md
Original file line number Diff line number Diff line change
@@ -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)

4 changes: 0 additions & 4 deletions packages/modal/development.md

This file was deleted.

0 comments on commit 989069d

Please sign in to comment.