Skip to content

Commit

Permalink
updating docs
Browse files Browse the repository at this point in the history
  • Loading branch information
clbrge committed Jan 9, 2022
1 parent d13b94a commit 6c6cdd3
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ import { connected, web3, selectedAccount, chainId, chainData } from 'svelte-web
* chainId: store value is the current chainId when connected.
* chainData: store value is the current blokchain CAIP-2 data (when connected), see below.

For these stores to be useful in your Svelte application, a connection to an EVM
blockchain first need to established . The abstract helper
`defaultEvmStores` can be used to initiate the connection and automatically
instanciate all stores.
For these stores to be useful in your Svelte application, a connection
to an EVM blockchain first need to established . The abstract helper
`defaultEvmStores` can be used to initiate the connection and
automatically instanciate all stores.

```js
import { defaultEvmStores } from 'svelte-web3'
Expand Down Expand Up @@ -109,7 +109,7 @@ To connect to non injected EIP-1193 providers like :
* WalletConnect
* Web3Modal

Call `setProvider` on the library abstract helper with the js provider
Call `setProvider` on the library abstract helper with the JavaScript provider
instance object of the library. For example with Web3Modal :

```js
Expand Down Expand Up @@ -144,6 +144,15 @@ var net = require('net')
defaultEvmStores.setProvider(new Web3.providers.IpcProvider('/Users/myuser/Library/Ethereum/geth.ipc', net))
// etc...
```
### Selecting a specific account


You can also pass `Index` as the second argument of `setProvider()` to
select another account than the default when possible.

```js
defaultEvmStores.setProvider(<provider>, <Index>)
```

### Using the stores

Expand Down

0 comments on commit 6c6cdd3

Please sign in to comment.