mirror of
https://github.com/Instadapp/vue-web3.git
synced 2024-07-29 21:48:25 +00:00
wip
This commit is contained in:
parent
e562a91b2e
commit
cc8faf253d
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@kabbouchi/vue-web3",
|
||||
"version": "0.2.8",
|
||||
"version": "0.2.10",
|
||||
"description": "Vue web3 composition api",
|
||||
"license": "MIT",
|
||||
"main": "dist/cjs/index.js",
|
||||
|
|
|
|||
18
src/index.ts
18
src/index.ts
|
|
@ -80,15 +80,27 @@ export const useWeb3 = () => {
|
|||
}
|
||||
|
||||
const handleUpdate = async (update: ConnectorUpdate): Promise<void> => {
|
||||
provider.value = update.provider
|
||||
chainId.value =
|
||||
if (update.provider) {
|
||||
provider.value = update.provider
|
||||
}
|
||||
|
||||
const cId =
|
||||
update.chainId === undefined
|
||||
? undefined
|
||||
: normalizeChainId(update.chainId)
|
||||
account.value =
|
||||
|
||||
if (cId) {
|
||||
chainId.value = cId
|
||||
}
|
||||
|
||||
const acc =
|
||||
typeof update.account === 'string'
|
||||
? normalizeAccount(update.account)
|
||||
: update.account
|
||||
|
||||
if (acc) {
|
||||
account.value = acc
|
||||
}
|
||||
}
|
||||
|
||||
const handleError = (e: Error): void => {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user