@delvtech/hyperdrive-appconfig
v0.0.1
Published
Pre-generated metadata for applications that use Hyperdrive.
Downloads
6
Readme
@delvtech/hyperdrive-appconfig
Pre-generated metadata for applications that use Hyperdrive.
Note: The data schema in this package may change at any time, and semantic versioning is not strictly enforced.
Example Usage
import { appConfig } from "@delvtech/hyperdrive-appconfig";
// 1. Grab the first hyperdrive in the app config
const firstHyperdrive = appConfig.hyperdrives[0];
// 2. Lookup its base token
const baseToken = findBaseToken({
hyperdriveChainId: firstHyperdrive.chainId,
hyperdriveAddress: firstHyperdrive.address,
appConfig,
});
// 3. Access token metadata
const { name, symbol, decimals, iconUrl } = baseToken;
Building the package
- Add .env variables for chains where Hyperdrive is deployed
- Run the appropriate, eg:
gen:local
orgen:cloudchain
script (see package.json) - Run the
build
script.
Note: The generated/
folder is checked into the repo. You'll want to
regenerate the app configs whenever there are new addresses to obtain metadata
for.
Once generated, build the package to make it available to other projects in the monorepo.