Skip to content

Commit

Permalink
documentation makeContractStore
Browse files Browse the repository at this point in the history
  • Loading branch information
clbrge committed Jun 6, 2021
1 parent 4c5c8bc commit afd8323
Show file tree
Hide file tree
Showing 5 changed files with 127 additions and 59 deletions.
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,20 @@ stores.
}
```

## Create contract stores

The function `makeContractStore` allows you to create a Svelte derived
store of a `web3.eth.Contract` object instance. It takes the same
parameters as a ̀new web3.eth.Contract` call:

```js
makeContractStore(jsonInterface[, address][, options])
```

This store is conveniently and automatically updated after connection
and when the account or chain change.


## Simultaneous multi chain usage

You can also using the library to create several stores, each
Expand Down
108 changes: 55 additions & 53 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@
"@babel/core": "^7.14.3",
"@rollup/plugin-json": "^4.1.0",
"eslint-plugin-svelte3": "^3.2.0",
"release-it": "^14.6.2",
"rollup": "^2.49.0",
"release-it": "^14.8.0",
"rollup": "^2.51.0",
"rollup-plugin-babel": "^4.4.0",
"rollup-plugin-livereload": "^2.0.0",
"rollup-plugin-svelte": "^7.1.0",
"sirv-cli": "^1.0.11",
"sirv-cli": "^1.0.12",
"svelte": "^3.38.2",
"web3": "1.3.6"
},
Expand Down
56 changes: 54 additions & 2 deletions src/chains.json
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,19 @@
"explorers": [],
"infoURL": "https://web3games.org/"
},
{
"name": "Sakura",
"chainId": 1022,
"shortName": "sku",
"chain": "Sakura",
"network": "sakura",
"networkId": 1022,
"nativeCurrency": {"name":"Sakura","symbol":"SKU","decimals":18},
"rpc": [],
"faucets": [],
"explorers": [],
"infoURL": "https://clover.finance/sakura"
},
{
"name": "Clover Testnet",
"chainId": 1023,
Expand Down Expand Up @@ -480,6 +493,19 @@
"explorers": [],
"infoURL": "https://github.com/flare-eng/coston"
},
{
"name": "Catecoin Chain Mainnet",
"chainId": 1618,
"shortName": "cate",
"chain": "Catechain",
"network": "mainnet",
"networkId": 1618,
"nativeCurrency": {"name":"Catecoin","symbol":"CATE","decimals":18},
"rpc": ["https://send.catechain.com"],
"faucets": [],
"explorers": [],
"infoURL": "https://catechain.com"
},
{
"name": "Lightstreams Testnet",
"chainId": 162,
Expand Down Expand Up @@ -747,7 +773,7 @@
"chain": "QKI",
"network": "mainnet",
"networkId": 20181205,
"nativeCurrency": {"name":"quarkblockchain Native Token","symbol":"HT","decimals":18},
"nativeCurrency": {"name":"quarkblockchain Native Token","symbol":"QKI","decimals":18},
"rpc": ["https://hz.rpc.qkiscan.cn","https://jp.rpc.qkiscan.io"],
"faucets": [],
"explorers": [],
Expand Down Expand Up @@ -866,7 +892,7 @@
"networkId": 246,
"nativeCurrency": {"name":"Energy Web Token","symbol":"EWT","decimals":18},
"rpc": ["https://rpc.energyweb.org","wss://rpc.energyweb.org/ws"],
"faucets": [],
"faucets": ["https://faucet.carbonswap.exchange"],
"explorers": [],
"infoURL": "https://energyweb.org"
},
Expand Down Expand Up @@ -1390,6 +1416,19 @@
"explorers": [],
"infoURL": "https://xinfin.org"
},
{
"name": "EraSwap Mainnet",
"chainId": 5197,
"shortName": "es",
"chain": "ESN",
"network": "mainnet",
"networkId": 5197,
"nativeCurrency": {"name":"EraSwap","symbol":"ES","decimals":18},
"rpc": ["https://mainnet.eraswap.network","https://rpc-mumbai.mainnet.eraswap.network"],
"faucets": [],
"explorers": [],
"infoURL": "https://eraswap.info/"
},
{
"name": "CoinEx Smart Chain Mainnet",
"chainId": 52,
Expand Down Expand Up @@ -1975,6 +2014,19 @@
"explorers": [],
"infoURL": "https://ethersocial.org"
},
{
"name": "CryptoKylin Testnet",
"chainId": 95,
"shortName": "Kylin Testnet",
"chain": "EOS",
"network": "testnet",
"networkId": 95,
"nativeCurrency": {"name":"EOS","symbol":"EOS","decimals":18},
"rpc": ["https://kylin.eosargentina.io"],
"faucets": [],
"explorers": [{"name":"eosq","url":"https://kylin.eosargentina.io","standard":"EIP3091"}],
"infoURL": "https://www.cryptokylin.io/"
},
{
"name": "Binance Smart Chain Testnet",
"chainId": 97,
Expand Down
Loading

0 comments on commit afd8323

Please sign in to comment.