1.3.1 • Published 3 months ago

@zoralabs/chains v1.3.1

Weekly downloads
-
License
MIT
Repository
-
Last release
3 months ago

chains config generator

Get chain information for forge/foundry when deploying

chains cli

The chains cli is command line a utility for getting chain information for forge/foundry when deploying.

installing

1. install cli utility

yarn global add @zoralabs/chains
# or
npm install -g @zoralabs/chains

2. setup dotfiles

(see configuration file below)

mkdir ~/.chains/
echo '{"alchemyApiKey": "API_KEY"}' >> ~/.chains/config.json

using

# alias to `forge zora --rpc` which returns `--rpc-url $RPC_URL`
chains zora --rpc

# gets just rpc url eg: (`https://rpc.optimism.io/`)
chains rpc optimism

# opens optimism block explorer in new browser window
chains explorer optimism

Loads private/custom configuration information from ~/.chains/:

Configuration file format and naming:

  • $chain_name.json -> {"rpcUrl": "https://alchemyapi.io/y/$alchemyApiKey", "etherscanApiKey": "ETHERSCAN_API_KEY"}
  • eg: zora.json -> {"rpcUrl": "https://rpc.zora.energy/"}
  • config.json -> {"alchemyApiKey": ""} (infura and tenderly coming soon)

chains npm package

The chains npm package is an importable module that returns chain information for forge/foundry when deploying.

installing

yarn add @zoralabs/chains

# or
npm install @zoralabs/chains

using

import { getChain } from "@zoralabs/chains";

// pass the snake case chain name to the chain getter:
const chain = await getChain("zora-sepolia");

console.log(chain);
// {
//  id: 7777777,
//  rpcUrl: 'https://rpc.zora.energy',
//  blockExplorer: 'https://explorer.zora.energy',
//  etherscanUrl: undefined,
//  verifierUrl: 'https://explorer.zora.energy/api?'
// }
1.3.1

3 months ago

1.3.0

3 months ago

1.2.0

6 months ago

1.1.0

8 months ago

1.0.3

8 months ago

1.0.2

8 months ago

1.0.1

8 months ago

1.0.0

8 months ago