Skip to content
This repository has been archived by the owner on Dec 2, 2024. It is now read-only.

Commit

Permalink
feat: Expose global web3 instance (#118)
Browse files Browse the repository at this point in the history
  • Loading branch information
dzbo authored Oct 24, 2023
1 parent c5c62da commit c3482ea
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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')
}
Expand Down
1 change: 1 addition & 0 deletions types/global.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ declare global {
interface Window {
lukso: any
ethereum: any
web3: any
}
}

Expand Down

0 comments on commit c3482ea

Please sign in to comment.