@daohaus/keychain-utils v0.5.0
@daohaus/keychain-utils
keychain-utils is a comprehensive reference point for managing chain-specific DAO data. It provides an easy way to retrieve a list of constants for any given chain. These constants include contract addresses, API endpoints, TheGraph endpoints, and block explorers. The keychain-utils are structured as objects, with chain IDs serving as the keys to these objects.
View on NPM
Usage
Installation
yarn add @daohaus/keychain-utils
Examples
How to create a link to the block explorer for an address or transaction
import { generateExplorerLink } from '@daohaus/keychain-utils';
const contractLink = generateExplorerLink({ chainId: '0x1', address: '0x0address', type: 'address' });
const txLink = generateExplorerLink({ chainId: '0x5', address: '0x0TxHash', type: 'tx' });
How to get contract addresses for each supported network
import { CONTRACT_KEYCHAINS } from '@daohaus/keychain-utils';
const vaultSummoner = CONTRACT_KEYCHAINS['VAULT_SUMMONER']['0x1'];
How to get subgraph endpoints for each supported network
import { ENDPOINTS } from '@daohaus/keychain-utils';
const arbitrumGraph = ENDPOINTS['V3_SUBGRAPH']['0xa'];
const hydratedEndpoints = addApiKeyToGraphEnpoints({ '0x1': 'someGraphApiKey' }, ENDPOINTS);
const mainnetGraph = hydratedEndpoints['V3_SUBGRAPH']['0x1'];
How to get the name of a network from the id
import { getNetworkName } from '@daohaus/keychain-utils';
const name = getNetworkName('0x64');
Building
Run nx run keychain-utils:build
to build the library.
6 days ago
7 days ago
1 month ago
2 months ago
3 months ago
4 months ago
4 months ago
5 months ago
10 months ago
10 months ago
9 months ago
9 months ago
9 months ago
9 months ago
7 months ago
9 months ago
9 months ago
6 months ago
8 months ago
7 months ago
8 months ago
11 months ago
11 months ago
12 months ago
12 months ago
11 months ago
12 months ago
12 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago