From c3482ea21d8f4aab6ed28b0a25b8996fade7ada8 Mon Sep 17 00:00:00 2001 From: Dominik Zborowski Date: Tue, 24 Oct 2023 11:50:37 +0200 Subject: [PATCH] feat: Expose global web3 instance (#118) --- app.vue | 2 ++ types/global.d.ts | 1 + 2 files changed, 3 insertions(+) diff --git a/app.vue b/app.vue index 3670f1e4..a0b60c0c 100644 --- a/app.vue +++ b/app.vue @@ -31,6 +31,8 @@ const setupWeb3Instances = () => { // for chain interactions through wallet web3Store.addWeb3(PROVIDERS.INJECTED, provider) addProviderEvents(provider) + // expose web3 instance to global scope for console access + window.web3 = web3Store.getWeb3(PROVIDERS.INJECTED) } else { console.error('No browser extension provider found') } diff --git a/types/global.d.ts b/types/global.d.ts index 9827c765..d78399c1 100644 --- a/types/global.d.ts +++ b/types/global.d.ts @@ -6,6 +6,7 @@ declare global { interface Window { lukso: any ethereum: any + web3: any } }