Skip to content

Commit

Permalink
getChainDataByChainId
Browse files Browse the repository at this point in the history
  • Loading branch information
clbrge committed Jul 27, 2022
1 parent c6ad3b9 commit fc38b2f
Show file tree
Hide file tree
Showing 3 changed files with 411 additions and 41 deletions.
21 changes: 20 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,6 @@ connected with the Ethereum Mainnet :
}
```


You might want to access all chains CAIP-2 data directly without using the
`chainData` store. In this case, use the getter `allChainsData`, it returns
the list of all CAIP-2 data available.
Expand All @@ -282,6 +281,15 @@ import { allChainsData } from 'svelte-web3'
console.log( allChainsData )
```

Alternatively, You might also use the helper function
`getChainDataByChainId` that takes the chainId as argument and returns
CAIP-2 data for that chain.

```js
import { getChainDataByChainId } from 'svelte-web3'

console.log( getChainDataByChainId(4) )
```

## Create contract stores

Expand Down Expand Up @@ -357,6 +365,17 @@ stores this way :
({ web3: web3_A, ...evmStores_A } = makeEvmStores('<id_A>'))
({ web3: web3_B, ...evmStores_B } = makeEvmStores('<id_B>'))
```
## FAQ

### *how to auto-connect on page load?*

It is out of scope of this package to implement this function but it
generally depends on the type of provider you are using and a way to
store connection information between page loads (for example by using
localStorage).




## Examples

Expand Down
Loading

0 comments on commit fc38b2f

Please sign in to comment.