-
Notifications
You must be signed in to change notification settings - Fork 0
/
chain.types.ts
199 lines (157 loc) · 5.51 KB
/
chain.types.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
import { BlockType } from './block.types';
import { GraphID } from './graph.types';
import { PinaxID } from './pinax.types';
import {
___InternalConsensusLayerServices,
___InternalSupportedServices,
ConsensusLayerServices,
SupportedServices,
} from './service.types';
import { Standard } from './standard.types';
export type ChainBase = {
// Testnet ID
id: PinaxID;
// Testnet Name
name: string;
// Alternative Names
alt_names: string[];
// The Graph ID
// See docs/retrieve_graph_ids.md
graph_id: GraphID | null;
// Display Priority, lower is higher
index?: number;
// Chain Standard (ie. ERC20)
// One good reference to determine chain standard is
// https://thegraph.com/docs/en/developing/supported-networks/
standard: Standard | null;
// Whether or not the chain supports detailed blocks.
// Not all chains are equal, some uses RPC poller
// which only offer partial blocks.
// See whether or not RPC poller is ticked on the
// Blockchain Service Matrix (https://www.notion.so/pinaxnetwork/Blockchain-Service-Matrix).
is_detailed_blocks: boolean;
// Whether or not the evm is a testnet
is_evm_testnet?: boolean;
// Block Type
block_type: BlockType;
};
export type ___InternalTestnet = ChainBase & {
// Whether or not the chain supports our existing services
supported_services: ___InternalSupportedServices;
metadata?: {
// Chain ID that replaces this (deprecated) chain
deprecated_replacing_chain?: PinaxID;
};
};
export type ___InternalConsensusLayer = ChainBase & {
// Whether or not the chain supports our existing services
// Consensus Layers exist only for services built on top of RPC
// (Firehose, Substreams), and not for the RPC service itself.
supported_services: ___InternalConsensusLayerServices;
};
export type ___InternalEVM = ChainBase & {
// Whether or not the chain supports our existing services
supported_services: ___InternalSupportedServices;
is_evm: boolean;
};
export type ChainIcon = {
// Token Icon ID
// See if icon is available on https://tokenicons.io/, if not create PR to add it.
// Then go on the Github Repo and find the icon ID under /packages/core/src/metadata/
// https://github.com/0xa3k5/token-icons
id: string;
// Theme of the Icon brand
// To avoid placing a dark icon on a dark background.
// If the brand is in midtones or some vibrant color, use 'both'.
brand_theme: 'light' | 'dark' | 'both';
// Generated by ./scripts/generate/data_json.js
variants?: Array<'branded' | 'mono'>;
};
/**
* Describes the Data that needs to be provided for a Chain.
*
* The Chain type theb extends the Chain type to include
* the generated fields.
*/
export interface ___InternalChain extends ChainBase {
// Token Icon
icon: ChainIcon;
// Whether or not the chain supports our existing services
supported_services: ___InternalSupportedServices;
// Merged by ./scripts/generate/data_json.js
testnets?: Array<___InternalTestnet>;
// Merged by ./scripts/generate/data_json.js
consensus?: Array<___InternalConsensusLayer>;
// Merge by ./scripts/generate/data_json.js
evms?: Array<___InternalEVM>;
// Any additional metadata we want to store (ie. Wagmi)
metadata?: {
// Layer of the chain
layer?: 'L0' | 'L1' | 'L2' | 'L3';
// Website of the chain
website?: string;
// Mainchain ID, if the chain is a sidechain
// Either a PinaxID or a string, as the mainchain may not be in the list of chains
mainchain_id?: PinaxID | string;
// tags for the chain
tags?: string[];
// Chain ID that replaces this (deprecated) chain
deprecated_replacing_chain?: PinaxID;
};
}
export type Testnet = ChainBase & {
// Whether or not the chain supports our existing services
supported_services: SupportedServices;
metadata?: {
// Chain ID that replaces this (deprecated) chain
deprecated_replacing_chain?: PinaxID;
};
};
export type ConsensusLayer = ChainBase & {
// Whether or not the chain supports our existing services
// Consensus Layers exist only for services built on top of RPC
// (Firehose, Substreams), and not for the RPC service itself.
supported_services: ConsensusLayerServices;
};
export type EVM = ChainBase & {
// Whether or not the chain supports our existing services
supported_services: SupportedServices;
};
/**
* Describes the Data that needs to be provided for a Chain.
*
* The Chain type theb extends the Chain type to include
* the generated fields.
*/
export interface Chain extends ChainBase {
icon: {
// Token Icon ID
id: string;
// Theme of the Icon brand
brand_theme: 'light' | 'dark' | 'both';
// Generated by ./scripts/generate/data_json.js
variants?: Array<'branded' | 'mono'>;
};
// Whether or not the chain supports our existing services
supported_services: SupportedServices;
// Merged by ./scripts/generate/data_json.js
testnets?: Array<Testnet>;
// Merged by ./scripts/generate/data_json.js
consensus?: Array<ConsensusLayer>;
// Merge by ./scripts/generate/data_json.js
evms?: Array<EVM>;
// Any additional metadata we want to store (ie. Wagmi)
metadata?: {
// Layer of the chain
layer?: 'L0' | 'L1' | 'L2' | 'L3';
// Website of the chain
website?: string;
// Mainchain ID, if the chain is a sidechain
// Either a PinaxID or a string, as the mainchain may not be in the list of chains
mainchain_id?: PinaxID | string;
// tags for the chain
tags?: string[];
// Chain ID that replaces this (deprecated) chain
deprecated_replacing_chain?: PinaxID;
};
}