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
9cbd0ccffb
commit
fab523ac65
|
|
@ -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",
|
||||||
|
|
|
||||||
|
|
@ -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,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user