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

feat: Expose global web3 instance #118

Merged
merged 1 commit into from
Oct 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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