0.5.0 • Published 6 days ago

@daohaus/keychain-utils v0.5.0

Weekly downloads
-
License
-
Repository
github
Last release
6 days ago

@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.

0.5.0

6 days ago

0.4.5

7 days ago

0.4.4

1 month ago

0.4.3

2 months ago

0.4.2

3 months ago

0.4.1

4 months ago

0.4.0

4 months ago

0.3.3

5 months ago

0.1.32

10 months ago

0.2.0-alpha.0

10 months ago

0.2.0-alpha.4

9 months ago

0.2.0-alpha.3

9 months ago

0.2.0-alpha.6

9 months ago

0.2.0-alpha.5

9 months ago

0.3.0

7 months ago

0.2.1

9 months ago

0.2.0

9 months ago

0.3.2

6 months ago

0.2.3

8 months ago

0.3.1

7 months ago

0.2.2

8 months ago

0.1.31

11 months ago

0.1.30

11 months ago

0.1.27

12 months ago

0.1.28

12 months ago

0.1.29

11 months ago

0.1.25

12 months ago

0.1.26

12 months ago

0.1.21

1 year ago

0.1.22

1 year ago

0.1.23

1 year ago

0.1.24

1 year ago

0.1.20

1 year ago

0.1.19

1 year ago

0.1.16

1 year ago

0.1.17

1 year ago

0.1.18

1 year ago

0.1.4

1 year ago

0.1.5

1 year ago

0.1.3

1 year ago

0.1.2

1 year ago

0.1.1

1 year ago

0.1.0

1 year ago

0.0.8

1 year ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago