-
Notifications
You must be signed in to change notification settings - Fork 0
/
chain.ts
196 lines (184 loc) · 4.67 KB
/
chain.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
// https://github.com/cosmos/chain-registry/blob/master/chain.schema.json
// https://transform.tools/json-schema-to-typescript
import type { Bech32Config } from "./bech32";
import type { ImageType, Status } from "./shared";
export type NetworkType = "mainnet" | "testnet" | "devnet";
export type KeyAlgos = "secp256k1" | "ethsecp256k1" | "ed25519" | "sr25519" | "bn254";
export type ConsensusType = "tendermint" | "cometbft" | "sei-tendermint";
export type IcsType = "ics20-1" | "ics27-1" | "mauth";
export type ExtraCodec = "ethermint" | "injective";
/**
* Cosmos Chain.json is a metadata file that contains information about a cosmos sdk based chain.
*/
export interface Chain {
$schema?: string;
chain_name: string;
chain_id: string;
pre_fork_chain_name?: string;
pretty_name: string;
website?: string;
update_link?: string;
status: Status;
network_type: NetworkType;
/**
* The default prefix for the human-readable part of addresses that identifies the coin type. Must be registered with SLIP-0173. E.g., 'cosmos'
*/
bech32_prefix: string;
/**
* Used to override the bech32_prefix for specific uses.
*/
bech32_config?: Bech32Config;
daemon_name?: string;
node_home?: string;
key_algos?: KeyAlgos[];
slip44: number;
alternative_slip44s?: number[];
fees?: {
fee_tokens: FeeToken[];
};
staking?: {
staking_tokens: StakingToken[];
lock_duration?: {
/**
* The number of blocks for which the staked tokens are locked.
*/
blocks?: number;
/**
* The approximate time for which the staked tokens are locked.
*/
time?: string;
};
};
codebase?: {
git_repo?: string;
recommended_version?: string;
compatible_versions?: string[];
binaries?: {
"linux/amd64"?: string;
"linux/arm64"?: string;
"darwin/amd64"?: string;
"darwin/arm64"?: string;
"windows/amd64"?: string;
"windows/arm64"?: string;
};
cosmos_sdk_version?: string;
consensus?: {
type: ConsensusType;
version?: string;
};
cosmwasm_version?: string;
cosmwasm_enabled?: boolean;
/**
* Relative path to the cosmwasm directory. ex. $HOME/.juno/data/wasm
*/
cosmwasm_path?: string;
ibc_go_version?: string;
/**
* List of IBC apps (usually corresponding to a ICS standard) which have been enabled on the network.
*/
ics_enabled?: IcsType[];
genesis?: {
name?: string;
genesis_url: string;
ics_ccv_url?: string;
};
versions?: {
/**
* Official Upgrade Name
*/
name: string;
/**
* Git Upgrade Tag
*/
tag?: string;
/**
* Block Height
*/
height?: number;
/**
* Proposal that will officially signal community acceptance of the upgrade.
*/
proposal?: number;
/**
* [Optional] Name of the following version
*/
next_version_name?: string;
recommended_version?: string;
compatible_versions?: string[];
cosmos_sdk_version?: string;
consensus?: {
type: ConsensusType;
version?: string;
};
cosmwasm_version?: string;
cosmwasm_enabled?: boolean;
/**
* Relative path to the cosmwasm directory. ex. $HOME/.juno/data/wasm
*/
cosmwasm_path?: string;
ibc_go_version?: string;
/**
* List of IBC apps (usually corresponding to a ICS standard) which have been enabled on the network.
*/
ics_enabled?: IcsType[];
binaries?: {
"linux/amd64"?: string;
"linux/arm64"?: string;
"darwin/amd64"?: string;
"darwin/arm64"?: string;
"windows/amd64"?: string;
"windows/arm64"?: string;
};
}[];
};
images?: ImageType[];
logo_URIs?: {
png?: string;
svg?: string;
};
peers?: {
seeds?: Peer[];
persistent_peers?: Peer[];
};
apis?: {
rpc?: Endpoint[];
rest?: Endpoint[];
grpc?: Endpoint[];
wss?: Endpoint[];
"grpc-web"?: Endpoint[];
"evm-http-jsonrpc"?: Endpoint[];
};
explorers?: Explorer[];
keywords?: string[];
extra_codecs?: ExtraCodec[];
}
export interface FeeToken {
denom: string;
fixed_min_gas_price?: number;
low_gas_price?: number;
average_gas_price?: number;
high_gas_price?: number;
gas_costs?: {
cosmos_send?: number;
ibc_transfer?: number;
};
}
export interface StakingToken {
denom: string;
}
export interface Peer {
id: string;
address: string;
provider?: string;
}
export interface Endpoint {
address: string;
provider?: string;
archive?: boolean;
}
export interface Explorer {
kind?: string;
url?: string;
tx_page?: string;
account_page?: string;
}