@unlock-protocol/networks
v0.0.23
Published
Unlock Protocol's contract addressess for various networks
Downloads
4,378
Keywords
Readme
Networks
Contains useful addresses and info about Unlock on different networks.
Usage
// by name
import { goerli } from '@unlock-protocol/networks'
// prefix by chain id
import networks from '@unlock-protocol/networks'
console.log(networks[1].name) // mainnet
Dev
yarn start
Localhost
You can create a localhost
network file with the following command:
# create file
yarn create-localhost <unlockAddress> <subgraphEnpoint>
# export file by appending to network index
echo "export * from './localhost'" >> src/networks/index.ts
# rebuild
yarn build
Read Unlock Address from a file
Optionally, you can parse the Unlock address from a subgraph manifest file formatted as follow
{
"localhost": {
"Unlock": { "address": "0x2279B7A0a67DB372996a5FaB50D91eAA73d2eBe6" }
}
}
with the following command
yarn workspace @unlock-protocol/networks unlock-address <filepath>.json
Scripts
Check that networks are configured correctly:
yarn run check
. Some networks might be missing some properties.Check that all tokens have the right values (symbol, name, decimals):
yarn run check-tokens
(Use this Dune Dashboard to find popular coins!)