Skip to content

Commit

Permalink
Added auto-generated index.ts for chains and PinaxId type from file n…
Browse files Browse the repository at this point in the history
…ames to avoid circular dependency / maintaining an index.
  • Loading branch information
DominicF96 committed Mar 2, 2024
1 parent 290cc54 commit 7c682cd
Show file tree
Hide file tree
Showing 55 changed files with 23,335 additions and 545 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules/
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ If you're unsure about the fields you need to fill, you can have a look at the [

To update an existing chain, you can simply open a PR with the changes you want to make to the chain's metadata.

### Updating the Chain Type

If you want to add a new field to the chain type, you can simply open a PR with the changes you want to make to the chain type and make sure every chain's metadata is updated to include the new field if required.

Removing a field from the chain type is not recommended, as it may break the metadata of the chains. If you want to remove a field, please open an issue to discuss it first.

### Removing a chain

If a chain is no longer supported, simply set the `deprecated_at` field as the date of the deprecation. This allows the different services to know when to stop supporting the chain, and enables us to keep track of the chains we've supported in the past for proper redirects and such.
2 changes: 1 addition & 1 deletion configs.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const IMG_BASE_URL = "https://pinax.network/vector/chain";
export const IMG_BASE_URL = "https://pinax.network/vector/chain";
4 changes: 2 additions & 2 deletions data/blocktypes.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { BlockType } from "../types/block.types";
import { Standard } from "../types/standard.types";

const BLOCKTYPE: { [standard in Standard]: BlockType } = {
const BLOCKTYPES: { [standard in Standard]: BlockType } = {
antelope: {
label: "sf.antelope.type.v1.Block",
url: "https://buf.build/pinax/firehose-antelope/docs/main:sf.antelope.type.v1",
Expand All @@ -27,4 +27,4 @@ const BLOCKTYPE: { [standard in Standard]: BlockType } = {
url: "https://buf.build/streamingfast/firehose-near/docs/main:sf.near.type.v1",
},
};
export default BLOCKTYPE;
export default BLOCKTYPES;
6 changes: 3 additions & 3 deletions data/chains/alfajores.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ const chain: Chain = {
name: "Alfajores",
alt_names: [],
released_at: new Date("2024-01-18"),
deprecated_at: null,
deprecated_at: undefined,
img: new URL(`${IMG_BASE_URL}/alfajores`),
img_invert_color_dt: true,
is_img_dt_invert: true,
mainnet: "celo",
is_testnet: true,
standard: "erc20",
block_type: BLOCKTYPE.erc20,
mainnet: "alfajores",
supported_services: {
firehose: false,
substreams: false,
Expand Down
5 changes: 3 additions & 2 deletions data/chains/arbgoerli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@ const chain: Chain = {
name: "Arbitrum Goerli",
alt_names: [],
released_at: new Date("2024-01-18"),
deprecated_at: undefined,
img: new URL(`${IMG_BASE_URL}/arbgoerli`),
img_invert_color_dt: false,
is_img_dt_invert: false,
mainnet: "arbitrum",
is_testnet: true,
standard: "erc20",
block_type: BLOCKTYPE.erc20,
mainnet: "arbitrum",
supported_services: {
firehose: false,
substreams: false,
Expand Down
5 changes: 3 additions & 2 deletions data/chains/arbone.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@ const chain: Chain = {
name: "Arbitrum One",
alt_names: [],
released_at: new Date("2024-01-18"),
deprecated_at: undefined,
img: new URL(`${IMG_BASE_URL}/arbone`),
img_invert_color_dt: false,
is_img_dt_invert: false,
mainnet: "arbitrum",
is_testnet: true,
standard: "erc20",
block_type: BLOCKTYPE.erc20,
mainnet: "arbitrum",
supported_services: {
firehose: false,
substreams: false,
Expand Down
20 changes: 10 additions & 10 deletions data/chains/arbsepolia.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
import { Chain } from "@/utils/pinax/types";
import BLOCKTYPE from "../../types/block.types";
import Mainnet from "../mainnets";
import Standard from "../standards";
import { IMG_BASE_URL } from "../../configs";
import { Chain } from "../../types/chain.types";
import BLOCKTYPE from "../blocktypes";

const chain: Chain = {
id: "arbsepolia",
index: 4,
graph_id: "arbsepolia",
name: "Arbitrum Sepolia",
alt_names: [],
released_at: "2024-01-18",
img: "arbsepolia",
img_invert_color_dt: false,
released_at: new Date("2024-01-18"),
deprecated_at: undefined,
img: new URL(`${IMG_BASE_URL}/arbsepolia`),
is_img_dt_invert: false,
mainnet: "arbitrum",
is_testnet: true,
standard: Standard.ERC20,
block_type: BLOCKTYPE.ERC20,
mainnet: Mainnet.ARBITRUM,
standard: "erc20",
block_type: BLOCKTYPE.erc20,
supported_services: {
firehose: false,
substreams: false,
Expand Down
27 changes: 13 additions & 14 deletions data/chains/arweave.ts
Original file line number Diff line number Diff line change
@@ -1,27 +1,26 @@
import { Chain } from "@/utils/pinax/types";
import BLOCKTYPE from "../../types/block.types";
import Mainnet from "../mainnets";
import Standard from "../standards";
import GraphId from "../graphids";
import { IMG_BASE_URL } from "../../configs";
import { Chain } from "../../types/chain.types";
import BLOCKTYPE from "../blocktypes";

const chain: Chain = {
id: Mainnet.ARWEAVE,
id: "arweave",
index: 4,
graph_id: GraphId.ARWEAVE,
graph_id: "arweave-mainnet",
name: "Arweave",
alt_names: [],
released_at: "2023-12-01",
img: "arweave",
img_invert_color_dt: true,
released_at: new Date("2023-12-01"),
deprecated_at: undefined,
img: new URL(`${IMG_BASE_URL}/arweave`),
is_img_dt_invert: true,
mainnet: "arweave",
is_testnet: false,
standard: Standard.ERC20,
block_type: BLOCKTYPE.ARWEAVE,
mainnet: Mainnet.ARWEAVE,
standard: "erc20",
block_type: BLOCKTYPE.arweave,
supported_services: {
firehose: true,
substreams: false,
rpc: false,
},
};

export default chain;
export default chain;
22 changes: 11 additions & 11 deletions data/chains/avalanche.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
import { Chain } from "@/utils/pinax/types";
import Mainnet from "../mainnets";
import Standard from "../standards";
import BLOCKTYPE from "../../types/block.types";
import { IMG_BASE_URL } from "../../configs";
import { Chain } from "../../types/chain.types";
import BLOCKTYPE from "../blocktypes";

const chain: Chain = {
id: Mainnet.AVALANCHE,
id: "avalanche",
index: 3,
graph_id: "avalanche",
name: "Avalanche",
alt_names: [],
released_at: "2024-01-18",
img: "avalanche",
img_invert_color_dt: true,
released_at: new Date("2024-01-18"),
deprecated_at: undefined,
img: new URL(`${IMG_BASE_URL}/avalanche`),
is_img_dt_invert: true,
mainnet: "avalanche",
is_testnet: false,
standard: Standard.ERC20,
block_type: BLOCKTYPE.ERC20,
mainnet: Mainnet.AVALANCHE,
standard: "erc20",
block_type: BLOCKTYPE.erc20,
supported_services: {
firehose: false,
substreams: false,
Expand Down
22 changes: 11 additions & 11 deletions data/chains/base.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
import { Chain } from "@/utils/pinax/types";
import Mainnet from "../mainnets";
import Standard from "../standards";
import BLOCKTYPE from "../../types/block.types";
import { IMG_BASE_URL } from "../../configs";
import { Chain } from "../../types/chain.types";
import BLOCKTYPE from "../blocktypes";

const chain: Chain = {
id: Mainnet.BASE,
id: "base",
index: 4,
graph_id: "base",
name: "Base",
alt_names: [],
released_at: "2024-01-18",
img: "base",
img_invert_color_dt: true,
released_at: new Date("2024-01-18"),
deprecated_at: undefined,
img: new URL(`${IMG_BASE_URL}/base`),
is_img_dt_invert: true,
mainnet: "base",
is_testnet: false,
standard: Standard.ERC20,
block_type: BLOCKTYPE.ERC20,
mainnet: Mainnet.BASE,
standard: "erc20",
block_type: BLOCKTYPE.erc20,
supported_services: {
firehose: false,
substreams: false,
Expand Down
24 changes: 12 additions & 12 deletions data/chains/bitcoin.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
import { Chain } from "@/utils/pinax/types";
import Mainnet from "../mainnets";
import Standard from "../standards";
import BLOCKTYPE from "../../types/block.types";
import { IMG_BASE_URL } from "../../configs";
import { Chain } from "../../types/chain.types";
import BLOCKTYPE from "../blocktypes";

const chain: Chain = {
id: Mainnet.BITCOIN,
id: "bitcoin",
index: 2,
graph_id: null,
graph_id: undefined,
name: "Bitcoin",
alt_names: ["btc"],
released_at: "2023-12-21",
img: "bitcoin",
img_invert_color_dt: false,
released_at: new Date("2023-12-21"),
deprecated_at: undefined,
img: new URL(`${IMG_BASE_URL}/bitcoin`),
is_img_dt_invert: false,
mainnet: "bitcoin",
is_testnet: false,
standard: Standard.BRC20,
block_type: BLOCKTYPE.BRC20,
mainnet: Mainnet.BITCOIN,
standard: "brc20",
block_type: BLOCKTYPE.brc20,
supported_services: {
firehose: true,
substreams: true,
Expand Down
27 changes: 13 additions & 14 deletions data/chains/bsc.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
import { Chain } from "@/utils/pinax/types";
import BLOCKTYPE from "../../types/block.types";
import GraphId from "../graphids";
import Mainnet from "../mainnets";
import Standard from "../standards";
import { IMG_BASE_URL } from "../../configs";
import { Chain } from "../../types/chain.types";
import BLOCKTYPE from "../blocktypes";
import { bsc as bscMeta } from "wagmi/chains";

const chain: Chain = {
id: Mainnet.BSC,
id: "bsc",
index: 2,
graph_id: GraphId.BSC,
graph_id: "bsc",
name: "BNB",
alt_names: ["bsc", "binance"],
released_at: "2023-12-01",
img: "bsc",
img_invert_color_dt: false,
released_at: new Date("2023-12-01"),
deprecated_at: undefined,
img: new URL(`${IMG_BASE_URL}/bsc`),
is_img_dt_invert: false,
mainnet: "bsc",
is_testnet: false,
standard: Standard.ERC20,
block_type: BLOCKTYPE.ERC20,
mainnet: Mainnet.BSC,
standard: "erc20",
block_type: BLOCKTYPE.erc20,
supported_services: {
firehose: true,
substreams: true,
Expand All @@ -26,4 +25,4 @@ const chain: Chain = {
metadata: bscMeta,
};

export default chain;
export default chain;
22 changes: 11 additions & 11 deletions data/chains/celo.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
import { Chain } from "@/utils/pinax/types";
import BLOCKTYPE from "../../types/block.types";
import Mainnet from "../mainnets";
import Standard from "../standards";
import { IMG_BASE_URL } from "../../configs";
import { Chain } from "../../types/chain.types";
import BLOCKTYPE from "../blocktypes";

const chain: Chain = {
id: Mainnet.CELO,
id: "celo",
index: 2,
graph_id: "celo",
name: "Celo",
alt_names: [],
released_at: "2024-01-18",
img: "celo",
img_invert_color_dt: true,
released_at: new Date("2024-01-18"),
deprecated_at: undefined,
img: new URL(`${IMG_BASE_URL}/celo`),
is_img_dt_invert: true,
mainnet: "celo",
is_testnet: false,
standard: Standard.ERC20,
block_type: BLOCKTYPE.ERC20,
mainnet: Mainnet.CELO,
standard: "erc20",
block_type: BLOCKTYPE.erc20,
supported_services: {
firehose: false,
substreams: false,
Expand Down
23 changes: 11 additions & 12 deletions data/chains/chapel.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
import { Chain } from "@/utils/pinax/types";
import GraphId from "../graphids";
import Standard from "../standards";
import BLOCKTYPE from "../../types/block.types";
import Mainnet from "../mainnets";
import { IMG_BASE_URL } from "../../configs";
import { Chain } from "../../types/chain.types";
import BLOCKTYPE from "../blocktypes";

const chain: Chain = {
id: "chapel",
index: 2,
graph_id: GraphId.CHAPEL,
graph_id: "chapel",
name: "Chapel",
alt_names: [],
released_at: "2023-12-01",
img: "bsc",
img_invert_color_dt: false,
released_at: new Date("2023-12-01"),
deprecated_at: undefined,
img: new URL(`${IMG_BASE_URL}/bsc`),
is_img_dt_invert: false,
mainnet: "bsc",
is_testnet: true,
standard: Standard.ERC20,
block_type: BLOCKTYPE.ERC20,
mainnet: Mainnet.BSC,
standard: "erc20",
block_type: BLOCKTYPE.erc20,
supported_services: {
firehose: true,
substreams: true,
Expand Down
Loading

0 comments on commit 7c682cd

Please sign in to comment.