Skip to content

Commit

Permalink
Saved how to file...
Browse files Browse the repository at this point in the history
  • Loading branch information
DominicF96 committed Aug 1, 2024
1 parent 433fa14 commit 6bc4a17
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 8 deletions.
2 changes: 1 addition & 1 deletion data/chains/V2/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// This file is auto-generated on pre-commit to avoid maintaining it.
// Do not modify manually as it will be overwritten.
// Last generation on 8/1/2024, 6:21:38 PM.
// Last generation on 8/1/2024, 6:22:44 PM.

export { default as arbone } from './arbone/meta';
export { default as arbgoerli } from './arbone/testnets/arbgoerli/meta';
Expand Down
2 changes: 1 addition & 1 deletion data/index.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Chains under ordered were manually placed, to manage the z-index (priority order) of chains.
// Chains under missing are generated from available data, make sure to order them.
// Include deprecated or future chains.
// Last generation on 8/1/2024, 6:21:38 PM.
// Last generation on 8/1/2024, 6:22:44 PM.

export default {
ordered: {
Expand Down
22 changes: 18 additions & 4 deletions docs/how_to_use.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
# How to Use the Chains Repository

**Content**
This file is the best place to learn everything there is to know about the chains repository! Feel free to use this as a quickstart guide or as a reference as you work inside the project.

## Content

- [Metadata Updates](#metadata-updates)
- [Adding a new chain](#adding-a-new-chain)
- [Updating an Existing Chain](#updating-an-existing-chain)
- [Deprecating a Chain](#deprecating-a-chain)
- [Scripts](#scripts)
- [Script: Copy Token Icons](#script-copy-token-icons)
- [Script: Data Index](#script-data-index)
- [Script: Index Config Check](#script-index-config-check)
- [Script: Graph IDs Type](#script-graph-ids-type)
- [Script: Pinax IDs Type](#script-pinax-ids-type)
- [Types](#types)
- [Typing & Updating Auto-Generated Types](#typing--updating-auto-generated-types)
- [Updating the Chain Type](#updating-the-chain-type)
Expand Down Expand Up @@ -72,13 +79,20 @@ This script maintains the index.ts file exporting all `meta.ts` from the `/data/

This script validates that every chain was placed in the `index.config.ts`, to be given a unique, prioritized index relative to other chains. If any chains are found in the `/data/chains/V2` folder but isn't configured in the `index.config.ts` file, it will throw an error and add those missing chains in the `missing` array of the file.

#### Script: Graph IDs
#### Script: Graph IDs Type

This script fetches The Graph endpoint of supported chains and updates our type definition for valid Graph network IDs.

#### Script: Pinax IDs
#### Script: Pinax IDs Type

This script iterates through the files in the `/data/chains/V2` and updates our type definition for valid Pinax network IDs.


#### Script Automation

All of those scripts are defined in the `package.json`, so you can run them manually by using NPM commands. You may find that you need to need some scripts manually, one good example being `generate:type_pinaxid` and `generate:type_graphid` while adding new chains.

This script iterates through the files in the `/data/chains/V2` and updates our type definition for valid Pinax network IDs.
But in most cases, you shouldn't have to worry to much about those scripts, they're run pre-commit, so everything _**should**_ update automagically, otherwise you'll receive errors explaning the steps that needs to be taken.

### Verification Scripts

Expand Down
2 changes: 1 addition & 1 deletion types/graph.types.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// This file is auto-generated on pre-commit to avoid maintaining it.
// Do not modify manually as it will be overwritten.
// Last generation on 8/1/2024, 6:21:39 PM.
// Last generation on 8/1/2024, 6:22:44 PM.
export type GraphID =
| 'arbitrum-one'
| 'arbitrum-sepolia'
Expand Down
2 changes: 1 addition & 1 deletion types/pinax.types.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// This file is auto-generated on pre-commit to avoid maintaining it / circular dependencies.
// Do not modify manually as it will be overwritten.
// Last generation on 8/1/2024, 6:21:39 PM.
// Last generation on 8/1/2024, 6:22:44 PM.
export type PinaxID =
| 'arbone'
| 'arbgoerli'
Expand Down

0 comments on commit 6bc4a17

Please sign in to comment.