fix: adding web3 to window
This commit is contained in:
parent
86441aadd9
commit
b5f2838aef
|
@ -3,6 +3,12 @@ import utils from "./utils.js";
|
|||
import mailservers from "./mailservers";
|
||||
import constants from "./constants";
|
||||
|
||||
declare global {
|
||||
interface Window { web3: any; }
|
||||
}
|
||||
|
||||
if(typeof window !== "undefined") window.web3 = window.web3 || {};
|
||||
|
||||
const Web3 = typeof window !== "undefined" && window.web3 ? new web3Lib(window.web3.currentProvider) : web3Lib;
|
||||
const { utils: { asciiToHex, hexToAscii } } = Web3;
|
||||
|
||||
|
|
Loading…
Reference in New Issue