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",
|
"name": "@kabbouchi/vue-web3",
|
||||||
"version": "0.2.8",
|
"version": "0.2.10",
|
||||||
"description": "Vue web3 composition api",
|
"description": "Vue web3 composition api",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"main": "dist/cjs/index.js",
|
"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> => {
|
const handleUpdate = async (update: ConnectorUpdate): Promise<void> => {
|
||||||
provider.value = update.provider
|
if (update.provider) {
|
||||||
chainId.value =
|
provider.value = update.provider
|
||||||
|
}
|
||||||
|
|
||||||
|
const cId =
|
||||||
update.chainId === undefined
|
update.chainId === undefined
|
||||||
? undefined
|
? undefined
|
||||||
: normalizeChainId(update.chainId)
|
: normalizeChainId(update.chainId)
|
||||||
account.value =
|
|
||||||
|
if (cId) {
|
||||||
|
chainId.value = cId
|
||||||
|
}
|
||||||
|
|
||||||
|
const acc =
|
||||||
typeof update.account === 'string'
|
typeof update.account === 'string'
|
||||||
? normalizeAccount(update.account)
|
? normalizeAccount(update.account)
|
||||||
: update.account
|
: update.account
|
||||||
|
|
||||||
|
if (acc) {
|
||||||
|
account.value = acc
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleError = (e: Error): void => {
|
const handleError = (e: Error): void => {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user