Adds web3-core types
This commit is contained in:
parent
2ea1608d30
commit
8fb5cf5e63
|
@ -252,6 +252,7 @@
|
|||
"truffle": "5.1.29",
|
||||
"typescript": "^3.9.5",
|
||||
"wait-on": "5.0.1",
|
||||
"web3-core": "^1.2.9",
|
||||
"web3-eth-contract": "^1.2.9",
|
||||
"web3-utils": "^1.2.8"
|
||||
}
|
||||
|
|
|
@ -67,9 +67,9 @@ export const web3ReadOnly =
|
|||
: new Web3(window.web3?.currentProvider || 'ws://localhost:8545')
|
||||
|
||||
let web3 = web3ReadOnly
|
||||
export const getWeb3 = () => web3
|
||||
export const getWeb3 = (): Web3 => web3
|
||||
|
||||
export const resetWeb3 = () => {
|
||||
export const resetWeb3 = (): void => {
|
||||
web3 = web3ReadOnly
|
||||
}
|
||||
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
interface Window {
|
||||
web3: {
|
||||
currentProvider: any
|
||||
import Web3 from 'web3'
|
||||
declare global {
|
||||
interface Window {
|
||||
web3?: Web3
|
||||
testAccountIndex?: string
|
||||
}
|
||||
testAccountIndex: string
|
||||
}
|
||||
declare module '@openzeppelin/contracts/build/contracts/ERC721'
|
||||
declare module 'currency-flags/dist/currency-flags.min.css'
|
||||
|
|
Loading…
Reference in New Issue