Skip to content

Commit 8709f70

Browse files
authored
Merge pull request #179 from vu3th/fix/computed-provider-target
fix(app): export computed providerTarget
2 parents 989069d + b2d088c commit 8709f70

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

app/content/en/overview.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,15 @@ if(isConnected.value) {
2727
console.log(wallet.error)
2828
console.log(wallet.connectorName)
2929
console.log(wallet.provider)
30-
console.log(wallet.providerInfo) // see EIP-6963
3130
console.log(wallet.connector)
3231
console.log(wallet.address)
3332
console.log(wallet.chainId)
33+
console.log(wallet.providerInfo) // EIP6963ProviderInfo | null
34+
console.log(wallet.providerTarget) // 'window.ethereum' | 'rdns' | null
3435
}
3536
```
3637

37-
The wallet comprises 8 properties, each of which can be obtained from the `useVueDapp` as a [computed](https://vuejs.org/api/reactivity-core.html#computed){:target="_blank"}.
38+
The wallet comprises 9 properties, each of which can be obtained from the `useVueDapp` as a [computed](https://vuejs.org/api/reactivity-core.html#computed){:target="_blank"}.
3839

3940
```ts
4041
const { error, chainId } = useVueDapp()

app/content/zh-TW/overview.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,15 @@ if(isConnected.value) {
2727
console.log(wallet.error)
2828
console.log(wallet.connectorName)
2929
console.log(wallet.provider)
30-
console.log(wallet.providerInfo) // see EIP-6963
3130
console.log(wallet.connector)
3231
console.log(wallet.address)
3332
console.log(wallet.chainId)
33+
console.log(wallet.providerInfo) // EIP6963ProviderInfo | null
34+
console.log(wallet.providerTarget) // 'window.ethereum' | 'rdns' | null
3435
}
3536
```
3637

37-
The wallet comprises 8 properties, each of which can be obtained from the `useVueDapp` as a [computed](https://vuejs.org/api/reactivity-core.html#computed){:target="_blank"}.
38+
The wallet comprises 9 properties, each of which can be obtained from the `useVueDapp` as a [computed](https://vuejs.org/api/reactivity-core.html#computed){:target="_blank"}.
3839

3940
```ts
4041
const { error, chainId } = useVueDapp()

packages/core/src/services/connect.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { computed, readonly } from 'vue'
1+
import { computed, provide, readonly } from 'vue'
22
import { useStore } from '../store'
33
import { ConnectOptions, ConnectorName, ProviderTarget } from '../types'
44
import { AutoConnectError, ConnectError, ConnectorNotFoundError } from '../errors'
@@ -158,10 +158,11 @@ export function useConnect(pinia?: any) {
158158
error: computed(() => walletStore.wallet.error),
159159
connectorName: computed(() => walletStore.wallet.connectorName),
160160
provider: computed(() => walletStore.wallet.provider),
161-
providerInfo: computed(() => walletStore.wallet.providerInfo),
162161
connector: computed(() => walletStore.wallet.connector),
163162
address: computed(() => walletStore.wallet.address),
164163
chainId: computed(() => walletStore.wallet.chainId),
164+
providerInfo: computed(() => walletStore.wallet.providerInfo),
165+
providerTarget: computed(() => walletStore.wallet.providerTarget),
165166

166167
isConnected: computed(() => walletStore.wallet.status === 'connected'),
167168

0 commit comments

Comments
 (0)