Skip to content

Commit

Permalink
Merge pull request #63 from Crelde/master
Browse files Browse the repository at this point in the history
Fixes Error: [svelte-web3] no store named contracts
  • Loading branch information
clbrge authored Jul 17, 2023
2 parents 3ea9212 + efe45b0 commit 88f2157
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/stores.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const getWindowEthereum = () => {
}
}

// always get chainId as number EDIT: Always as hex
// always get chainId as hex (required since web3js 4.x.x)
const alwaysHex = (n) => (Web3.utils.isHex(n) ? n : Web3.utils.toHex(n))

export const createStore = () => {
Expand Down Expand Up @@ -211,7 +211,13 @@ const getData = (id) => {
return noData
}

const subStoreNames = ['web3', 'selectedAccount', 'connected', 'chainId']
const subStoreNames = [
'web3',
'selectedAccount',
'connected',
'chainId',
'contracts'
]

export const makeEvmStores = (name) => {
const evmStore = (allStores[name] = createStore())
Expand Down

0 comments on commit 88f2157

Please sign in to comment.