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
4df5a4f942
commit
1f689f6f19
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@kabbouchi/vue-web3",
|
"name": "@kabbouchi/vue-web3",
|
||||||
"version": "0.2.12",
|
"version": "0.2.13",
|
||||||
"description": "Vue web3 composition api",
|
"description": "Vue web3 composition api",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"main": "dist/cjs/index.js",
|
"main": "dist/cjs/index.js",
|
||||||
|
|
21
src/index.ts
21
src/index.ts
|
@ -85,19 +85,32 @@ export const useWeb3 = () => {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if (update.provider) {
|
|
||||||
provider.value = update.provider
|
|
||||||
}
|
|
||||||
|
|
||||||
const cId =
|
const cId =
|
||||||
update.chainId === undefined
|
update.chainId === undefined
|
||||||
? undefined
|
? undefined
|
||||||
: normalizeChainId(update.chainId)
|
: normalizeChainId(update.chainId)
|
||||||
|
|
||||||
|
if (
|
||||||
|
cId !== undefined &&
|
||||||
|
!!connector.value.supportedChainIds &&
|
||||||
|
!connector.value.supportedChainIds.includes(cId)
|
||||||
|
) {
|
||||||
|
const e = new UnsupportedChainIdError(
|
||||||
|
cId,
|
||||||
|
connector.value.supportedChainIds,
|
||||||
|
)
|
||||||
|
onErrorCb.value ? onErrorCb.value(e) : handleError(e)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
if (cId) {
|
if (cId) {
|
||||||
chainId.value = cId
|
chainId.value = cId
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (update.provider) {
|
||||||
|
provider.value = update.provider
|
||||||
|
}
|
||||||
|
|
||||||
const acc =
|
const acc =
|
||||||
typeof update.account === 'string'
|
typeof update.account === 'string'
|
||||||
? normalizeAccount(update.account)
|
? normalizeAccount(update.account)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user