This commit is contained in:
Georges KABBOUCHI 2021-08-29 14:07:06 +03:00
parent 9cbd0ccffb
commit fab523ac65
2 changed files with 4 additions and 4 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "@kabbouchi/vue-web3", "name": "@kabbouchi/vue-web3",
"version": "0.2.14", "version": "0.2.15",
"description": "Vue web3 composition api", "description": "Vue web3 composition api",
"license": "MIT", "license": "MIT",
"main": "dist/cjs/index.js", "main": "dist/cjs/index.js",

View File

@ -1,7 +1,7 @@
import { AbstractConnector } from '@web3-react/abstract-connector' import { AbstractConnector } from '@web3-react/abstract-connector'
import { normalizeAccount, normalizeChainId } from './normalizers' import { normalizeAccount, normalizeChainId } from './normalizers'
import { ConnectorEvent, ConnectorUpdate } from '@web3-react/types' import { ConnectorEvent, ConnectorUpdate } from '@web3-react/types'
import { computed, onBeforeUnmount, ref, watch } from 'vue-demi' import { computed, onBeforeUnmount, Ref, ref, watch } from 'vue-demi'
export class UnsupportedChainIdError extends Error { export class UnsupportedChainIdError extends Error {
public constructor( public constructor(
@ -36,7 +36,7 @@ export const setWeb3LibraryCallback = (
getLibrary = cb getLibrary = cb
} }
export const useWeb3 = () => { export const useWeb3 = <TLibrary>() => {
const onErrorCb = ref<(error: Error) => void>() const onErrorCb = ref<(error: Error) => void>()
const activate = async ( const activate = async (
@ -180,7 +180,7 @@ export const useWeb3 = () => {
}) })
return { return {
library, library: library as Ref<TLibrary>,
active, active,
activate, activate,
deactivate, deactivate,