diff --git a/README.md b/README.md
index 1c1d88f..4133b3d 100644
--- a/README.md
+++ b/README.md
@@ -2,11 +2,11 @@
# svelte-web3
-Import the [web3.js library](https://web3js.readthedocs.io/) as a
+Use the [web3.js library](https://web3js.readthedocs.io/) as a
collection of [readable svelte stores](https://svelte.dev/tutorial/readable-stores)
for Svelte, Sapper or Svelte-kit.
-## Svelte, Sapper and Svelte-kit installation
+## Installation
1. add the `svelte-web3` package
@@ -20,65 +20,88 @@ npm i svelte-web3
```
-## Svelte and Sapper basic usage
+## Basic usage (defaultstore connected to one chain)
-Import the `ethStore` main connection helper and needed derived Svelte stores (see list below):
+Import the `defaultChainStore` main connection helper and needed derived Svelte stores (see list below):
```js
-import { ethStore, web3, selectedAccount, connected, chainData } from 'svelte-web3'
+import { defaultChainStore, web3, selectedAccount, connected, chainData } from 'svelte-web3'
```
-To enable connection to the current window provider:
+:exclamation: `defaultChainStore` was named before `ethStore`. The
+former naming still works but will be removed in later versions of
+`svelte-web3` package. Please update your code!
+
+### Connection with the browser provider (wallets like metamask)
+
+To enable a connection with the current window provider:
```js
-ethStore.setBrowserProvider()
+defaultChainStore.setBrowserProvider()
```
-To enable connection using an url string:
+Please note that your code need to be in browser context when
+`setBrowserProvider` is running. So you may want to use `onMount` when
+using Sapper or Svelte-kit. Similarly, you cannot use
+`setBrowserProvider` in SSR context.
```js
-ethStore.setProvider('')
+ onMount(
+ () => {
+ // add a test to return in SSR context
+ defaultChainStore.setBrowserProvider()
+ }
+ )
```
-Please note that if your code is running in SSR context (like with
-Sapper), you can only call `setBrowserProvider` and `setProvider` in
-browser context for example using `onMount` or as an handler of a
-client-side event :
+### Connection with other providers (ws, http, Web3Modal, Walletconnect, etc)
+
+To enable connection using an url string or a valid provider object
+(as returned by web3Modal or WalletConnect for example):
```js
- onMount(
- async () => {
- console.log('Connecting to Ethereum Testnet Görli...')
- ethStore.setProvider('https://rpc.slock.it/goerli')
- })
+defaultChainStore.setProvider()
```
-In SSR context, the stores are defined but no connection has been
-instanciated.
+### Using the Web3 instance $web3 after the connection
If a connection is successful, you can access the instantiated web3.js
-with the current window provider using the `$` svelte store syntax :
+using the `$` svelte store syntax :
```js
$web3.eth.getBalance()
```
+The whole Web3.js API is now usable in the `
- $: checkAccount = $selectedAccount || '0x0000000000000000000000000000000000000000'
- $: balance = $connected ? $web3.eth.getBalance(checkAccount) : ''
+
+
The Web3.js library has been injected in Global window Object (version: {window.Web3.version}).
+ {:else}
+
+ Error! The Web3.js library has not been detected in the Global window Object.
+ Please check that Web3.js has been correctly added in public/index.html
+ with the line:
+