diff --git a/app/content/en/overview.md b/app/content/en/overview.md index 447cacd..a18522a 100644 --- a/app/content/en/overview.md +++ b/app/content/en/overview.md @@ -27,14 +27,15 @@ if(isConnected.value) { console.log(wallet.error) console.log(wallet.connectorName) console.log(wallet.provider) - console.log(wallet.providerInfo) // see EIP-6963 console.log(wallet.connector) console.log(wallet.address) console.log(wallet.chainId) + console.log(wallet.providerInfo) // EIP6963ProviderInfo | null + console.log(wallet.providerTarget) // 'window.ethereum' | 'rdns' | null } ``` -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"}. +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"}. ```ts const { error, chainId } = useVueDapp() diff --git a/app/content/zh-TW/overview.md b/app/content/zh-TW/overview.md index 8f60c6d..58ef102 100644 --- a/app/content/zh-TW/overview.md +++ b/app/content/zh-TW/overview.md @@ -27,14 +27,15 @@ if(isConnected.value) { console.log(wallet.error) console.log(wallet.connectorName) console.log(wallet.provider) - console.log(wallet.providerInfo) // see EIP-6963 console.log(wallet.connector) console.log(wallet.address) console.log(wallet.chainId) + console.log(wallet.providerInfo) // EIP6963ProviderInfo | null + console.log(wallet.providerTarget) // 'window.ethereum' | 'rdns' | null } ``` -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"}. +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"}. ```ts const { error, chainId } = useVueDapp() diff --git a/packages/core/src/services/connect.ts b/packages/core/src/services/connect.ts index e22e0ea..b70a300 100644 --- a/packages/core/src/services/connect.ts +++ b/packages/core/src/services/connect.ts @@ -1,4 +1,4 @@ -import { computed, readonly } from 'vue' +import { computed, provide, readonly } from 'vue' import { useStore } from '../store' import { ConnectOptions, ConnectorName, ProviderTarget } from '../types' import { AutoConnectError, ConnectError, ConnectorNotFoundError } from '../errors' @@ -158,10 +158,11 @@ export function useConnect(pinia?: any) { error: computed(() => walletStore.wallet.error), connectorName: computed(() => walletStore.wallet.connectorName), provider: computed(() => walletStore.wallet.provider), - providerInfo: computed(() => walletStore.wallet.providerInfo), connector: computed(() => walletStore.wallet.connector), address: computed(() => walletStore.wallet.address), chainId: computed(() => walletStore.wallet.chainId), + providerInfo: computed(() => walletStore.wallet.providerInfo), + providerTarget: computed(() => walletStore.wallet.providerTarget), isConnected: computed(() => walletStore.wallet.status === 'connected'),