@chain-registry/interfaces 0.25.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +74 -0
- package/assetlist.schema.d.ts +87 -0
- package/assetlist.schema.js +2 -0
- package/chain.schema.d.ts +156 -0
- package/chain.schema.js +2 -0
- package/dist/LICENSE +21 -0
- package/dist/README.md +74 -0
- package/dist/package.json +36 -0
- package/esm/assetlist.schema.js +1 -0
- package/esm/chain.schema.js +1 -0
- package/esm/ibc_data.schema.js +1 -0
- package/esm/index.js +6 -0
- package/esm/memo_keys.schema.js +1 -0
- package/esm/shared.js +1 -0
- package/esm/versions.schema.js +1 -0
- package/ibc_data.schema.d.ts +40 -0
- package/ibc_data.schema.js +2 -0
- package/index.d.ts +6 -0
- package/index.js +22 -0
- package/memo_keys.schema.d.ts +11 -0
- package/memo_keys.schema.js +2 -0
- package/package.json +36 -0
- package/shared.d.ts +4 -0
- package/shared.js +2 -0
- package/versions.schema.d.ts +33 -0
- package/versions.schema.js +2 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2022 Dan Lynch <pyramation@gmail.com>
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# @chain-registry/interfaces
|
|
2
|
+
|
|
3
|
+
<p align="center" width="100%">
|
|
4
|
+
<img height="90" src="https://user-images.githubusercontent.com/545047/190171475-b416f99e-2831-4786-9ba3-a7ff4d95b0d3.svg" />
|
|
5
|
+
</p>
|
|
6
|
+
|
|
7
|
+
<p align="center" width="100%">
|
|
8
|
+
<a href="https://github.com/cosmology-tech/chain-registry/actions/workflows/run-tests.yml">
|
|
9
|
+
<img height="20" src="https://github.com/cosmology-tech/chain-registry/actions/workflows/run-tests.yml/badge.svg" />
|
|
10
|
+
</a>
|
|
11
|
+
<a href="https://github.com/cosmology-tech/chain-registry/blob/main/LICENSE"><img height="20" src="https://img.shields.io/badge/license-MIT-blue.svg"></a>
|
|
12
|
+
<a href="https://www.npmjs.com/package/@chain-registry/interfaces"><img height="20" src="https://img.shields.io/npm/dt/@chain-registry/interfaces"></a>
|
|
13
|
+
<a href="https://www.npmjs.com/package/@chain-registry/interfaces"><img height="20" src="https://img.shields.io/github/package-json/v/cosmology-tech/chain-registry?filename=packages%2Ftypes%2Fpackage.json"></a>
|
|
14
|
+
</p>
|
|
15
|
+
|
|
16
|
+
The `@chain-registry/interfaces` module provides TypeScript interfaces that represent the structured data types as defined in the original JSON schema from the [`cosmos/chain-registry`](https://github.com/cosmos/chain-registry) repository. These interfaces are generated to facilitate type-safe development when interacting with chain registry data within TypeScript projects.
|
|
17
|
+
|
|
18
|
+
## Installation
|
|
19
|
+
|
|
20
|
+
To install the `@chain-registry/interfaces` module, run the following command in your project directory:
|
|
21
|
+
|
|
22
|
+
```sh
|
|
23
|
+
npm install @chain-registry/interfaces
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Usage
|
|
27
|
+
|
|
28
|
+
Once installed, you can import the interfaces into your TypeScript project to ensure type safety and auto-completion within your IDE.
|
|
29
|
+
|
|
30
|
+
Example of using an interface:
|
|
31
|
+
|
|
32
|
+
```js
|
|
33
|
+
import { Chain } from '@chain-registry/interfaces';
|
|
34
|
+
|
|
35
|
+
function displayChainInfo(chain: Chain) {
|
|
36
|
+
console.log(`Chain Name: ${chain.chain_name}`);
|
|
37
|
+
console.log(`Chain ID: ${chain.chain_id}`);
|
|
38
|
+
// Add more fields as necessary
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// Example usage with dummy data
|
|
42
|
+
const cosmosHub: Chain = {
|
|
43
|
+
chain_name: "Cosmos Hub",
|
|
44
|
+
chain_id: "cosmoshub-4",
|
|
45
|
+
bech32_prefix: "cosmos",
|
|
46
|
+
// Assume other necessary fields are filled in
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
displayChainInfo(cosmosHub);
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Related
|
|
53
|
+
|
|
54
|
+
Checkout these related projects:
|
|
55
|
+
|
|
56
|
+
* [@cosmology/telescope](https://github.com/cosmology-tech/telescope) Your Frontend Companion for Building with TypeScript with Cosmos SDK Modules.
|
|
57
|
+
* [@cosmwasm/ts-codegen](https://github.com/CosmWasm/ts-codegen) Convert your CosmWasm smart contracts into dev-friendly TypeScript classes.
|
|
58
|
+
* [chain-registry](https://github.com/cosmology-tech/chain-registry) Everything from token symbols, logos, and IBC denominations for all assets you want to support in your application.
|
|
59
|
+
* [cosmos-kit](https://github.com/cosmology-tech/cosmos-kit) Experience the convenience of connecting with a variety of web3 wallets through a single, streamlined interface.
|
|
60
|
+
* [create-cosmos-app](https://github.com/cosmology-tech/create-cosmos-app) Set up a modern Cosmos app by running one command.
|
|
61
|
+
* [interchain-ui](https://github.com/cosmology-tech/interchain-ui) The Interchain Design System, empowering developers with a flexible, easy-to-use UI kit.
|
|
62
|
+
* [starship](https://github.com/cosmology-tech/starship) Unified Testing and Development for the Interchain.
|
|
63
|
+
|
|
64
|
+
## Credits
|
|
65
|
+
|
|
66
|
+
🛠 Built by Cosmology — if you like our tools, please consider delegating to [our validator ⚛️](https://cosmology.zone/validator)
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
## Disclaimer
|
|
70
|
+
|
|
71
|
+
AS DESCRIBED IN THE LICENSES, THE SOFTWARE IS PROVIDED “AS IS”, AT YOUR OWN RISK, AND WITHOUT WARRANTIES OF ANY KIND.
|
|
72
|
+
|
|
73
|
+
No developer or entity involved in creating this software will be liable for any claims or damages whatsoever associated with your use, inability to use, or your interaction with other users of the code, including any direct, indirect, incidental, special, exemplary, punitive or consequential damages, or loss of profits, cryptocurrencies, tokens, or anything else of value.
|
|
74
|
+
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { Pointer } from "./shared";
|
|
2
|
+
export interface Asset {
|
|
3
|
+
deprecated?: boolean;
|
|
4
|
+
description?: string;
|
|
5
|
+
extended_description?: string;
|
|
6
|
+
denom_units: DenomUnit[];
|
|
7
|
+
type_asset?: "sdk.coin" | "cw20" | "erc20" | "ics20" | "snip20" | "snip25" | "bitcoin-like" | "evm-base" | "svm-base" | "substrate";
|
|
8
|
+
address?: string;
|
|
9
|
+
base: string;
|
|
10
|
+
name: string;
|
|
11
|
+
display: string;
|
|
12
|
+
symbol: string;
|
|
13
|
+
traces?: (IbcTransition | IbcCw20Transition | NonIbcTransition)[];
|
|
14
|
+
ibc?: {
|
|
15
|
+
source_channel: string;
|
|
16
|
+
dst_channel: string;
|
|
17
|
+
source_denom: string;
|
|
18
|
+
};
|
|
19
|
+
logo_URIs?: {
|
|
20
|
+
png?: string;
|
|
21
|
+
svg?: string;
|
|
22
|
+
};
|
|
23
|
+
images?: {
|
|
24
|
+
image_sync?: Pointer;
|
|
25
|
+
png?: string;
|
|
26
|
+
svg?: string;
|
|
27
|
+
theme?: {
|
|
28
|
+
primary_color_hex?: string;
|
|
29
|
+
circle?: boolean;
|
|
30
|
+
dark_mode?: boolean;
|
|
31
|
+
};
|
|
32
|
+
}[];
|
|
33
|
+
coingecko_id?: string;
|
|
34
|
+
keywords?: string[];
|
|
35
|
+
socials?: {
|
|
36
|
+
website?: string;
|
|
37
|
+
twitter?: string;
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
export interface DenomUnit {
|
|
41
|
+
denom: string;
|
|
42
|
+
exponent: number;
|
|
43
|
+
aliases?: string[];
|
|
44
|
+
}
|
|
45
|
+
export interface IbcTransition {
|
|
46
|
+
type: "ibc";
|
|
47
|
+
counterparty: {
|
|
48
|
+
chain_name: string;
|
|
49
|
+
base_denom: string;
|
|
50
|
+
channel_id: string;
|
|
51
|
+
};
|
|
52
|
+
chain: {
|
|
53
|
+
channel_id: string;
|
|
54
|
+
path: string;
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
export interface IbcCw20Transition {
|
|
58
|
+
type: "ibc-cw20";
|
|
59
|
+
counterparty: {
|
|
60
|
+
chain_name: string;
|
|
61
|
+
base_denom: string;
|
|
62
|
+
port: string;
|
|
63
|
+
channel_id: string;
|
|
64
|
+
};
|
|
65
|
+
chain: {
|
|
66
|
+
port: string;
|
|
67
|
+
channel_id: string;
|
|
68
|
+
path: string;
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
export interface NonIbcTransition {
|
|
72
|
+
type: "bridge" | "liquid-stake" | "synthetic" | "wrapped" | "additional-mintage" | "test-mintage";
|
|
73
|
+
counterparty: {
|
|
74
|
+
chain_name: string;
|
|
75
|
+
base_denom: string;
|
|
76
|
+
contract?: string;
|
|
77
|
+
};
|
|
78
|
+
chain?: {
|
|
79
|
+
contract: string;
|
|
80
|
+
};
|
|
81
|
+
provider: string;
|
|
82
|
+
}
|
|
83
|
+
export interface AssetList {
|
|
84
|
+
$schema?: string;
|
|
85
|
+
chain_name: string;
|
|
86
|
+
assets: Asset[];
|
|
87
|
+
}
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import { Pointer } from "./shared";
|
|
2
|
+
export interface Peer {
|
|
3
|
+
id: string;
|
|
4
|
+
address: string;
|
|
5
|
+
provider?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface Endpoint {
|
|
8
|
+
address: string;
|
|
9
|
+
provider?: string;
|
|
10
|
+
archive?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export interface Explorer {
|
|
13
|
+
kind?: string;
|
|
14
|
+
url?: string;
|
|
15
|
+
tx_page?: string;
|
|
16
|
+
account_page?: string;
|
|
17
|
+
}
|
|
18
|
+
export interface FeeToken {
|
|
19
|
+
denom: string;
|
|
20
|
+
fixed_min_gas_price?: number;
|
|
21
|
+
low_gas_price?: number;
|
|
22
|
+
average_gas_price?: number;
|
|
23
|
+
high_gas_price?: number;
|
|
24
|
+
gas_costs?: {
|
|
25
|
+
cosmos_send?: number;
|
|
26
|
+
ibc_transfer?: number;
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
export interface StakingToken {
|
|
30
|
+
denom: string;
|
|
31
|
+
}
|
|
32
|
+
export interface Chain {
|
|
33
|
+
$schema?: string;
|
|
34
|
+
chain_name: string;
|
|
35
|
+
chain_id: string;
|
|
36
|
+
pre_fork_chain_name?: string;
|
|
37
|
+
pretty_name?: string;
|
|
38
|
+
website?: string;
|
|
39
|
+
update_link?: string;
|
|
40
|
+
status?: "live" | "upcoming" | "killed";
|
|
41
|
+
network_type?: "mainnet" | "testnet" | "devnet";
|
|
42
|
+
bech32_prefix: string;
|
|
43
|
+
bech32_config?: {
|
|
44
|
+
bech32PrefixAccAddr?: string;
|
|
45
|
+
bech32PrefixAccPub?: string;
|
|
46
|
+
bech32PrefixValAddr?: string;
|
|
47
|
+
bech32PrefixValPub?: string;
|
|
48
|
+
bech32PrefixConsAddr?: string;
|
|
49
|
+
bech32PrefixConsPub?: string;
|
|
50
|
+
};
|
|
51
|
+
daemon_name?: string;
|
|
52
|
+
node_home?: string;
|
|
53
|
+
key_algos?: ("secp256k1" | "ethsecp256k1" | "ed25519" | "sr25519" | "bn254")[];
|
|
54
|
+
slip44?: number;
|
|
55
|
+
alternative_slip44s?: number[];
|
|
56
|
+
fees?: {
|
|
57
|
+
fee_tokens: FeeToken[];
|
|
58
|
+
};
|
|
59
|
+
staking?: {
|
|
60
|
+
staking_tokens: StakingToken[];
|
|
61
|
+
lock_duration?: {
|
|
62
|
+
blocks?: number;
|
|
63
|
+
time?: string;
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
codebase?: {
|
|
67
|
+
git_repo?: string;
|
|
68
|
+
recommended_version?: string;
|
|
69
|
+
go_version?: string;
|
|
70
|
+
compatible_versions?: string[];
|
|
71
|
+
binaries?: {
|
|
72
|
+
"linux/amd64"?: string;
|
|
73
|
+
"linux/arm64"?: string;
|
|
74
|
+
"darwin/amd64"?: string;
|
|
75
|
+
"darwin/arm64"?: string;
|
|
76
|
+
"windows/amd64"?: string;
|
|
77
|
+
"windows/arm64"?: string;
|
|
78
|
+
};
|
|
79
|
+
cosmos_sdk_version?: string;
|
|
80
|
+
consensus?: {
|
|
81
|
+
type: "tendermint" | "cometbft" | "sei-tendermint";
|
|
82
|
+
version?: string;
|
|
83
|
+
};
|
|
84
|
+
cosmwasm_version?: string;
|
|
85
|
+
cosmwasm_enabled?: boolean;
|
|
86
|
+
cosmwasm_path?: string;
|
|
87
|
+
ibc_go_version?: string;
|
|
88
|
+
ics_enabled?: ("ics20-1" | "ics27-1" | "mauth")[];
|
|
89
|
+
genesis?: {
|
|
90
|
+
name?: string;
|
|
91
|
+
genesis_url: string;
|
|
92
|
+
ics_ccv_url?: string;
|
|
93
|
+
};
|
|
94
|
+
versions?: {
|
|
95
|
+
name: string;
|
|
96
|
+
tag?: string;
|
|
97
|
+
height?: number;
|
|
98
|
+
proposal?: number;
|
|
99
|
+
previous_version_name?: string;
|
|
100
|
+
next_version_name?: string;
|
|
101
|
+
recommended_version?: string;
|
|
102
|
+
go_version?: string;
|
|
103
|
+
compatible_versions?: string[];
|
|
104
|
+
cosmos_sdk_version?: string;
|
|
105
|
+
consensus?: {
|
|
106
|
+
type: "tendermint" | "cometbft" | "sei-tendermint";
|
|
107
|
+
version?: string;
|
|
108
|
+
};
|
|
109
|
+
cosmwasm_version?: string;
|
|
110
|
+
cosmwasm_enabled?: boolean;
|
|
111
|
+
cosmwasm_path?: string;
|
|
112
|
+
ibc_go_version?: string;
|
|
113
|
+
ics_enabled?: ("ics20-1" | "ics27-1" | "mauth")[];
|
|
114
|
+
binaries?: {
|
|
115
|
+
"linux/amd64"?: string;
|
|
116
|
+
"linux/arm64"?: string;
|
|
117
|
+
"darwin/amd64"?: string;
|
|
118
|
+
"darwin/arm64"?: string;
|
|
119
|
+
"windows/amd64"?: string;
|
|
120
|
+
"windows/arm64"?: string;
|
|
121
|
+
};
|
|
122
|
+
}[];
|
|
123
|
+
};
|
|
124
|
+
images?: {
|
|
125
|
+
image_sync?: Pointer;
|
|
126
|
+
png?: string;
|
|
127
|
+
svg?: string;
|
|
128
|
+
theme?: {
|
|
129
|
+
primary_color_hex?: string;
|
|
130
|
+
circle?: boolean;
|
|
131
|
+
dark_mode?: boolean;
|
|
132
|
+
};
|
|
133
|
+
layout?: "logo" | "logomark" | "logotype";
|
|
134
|
+
text_position?: "top" | "bottom" | "left" | "right" | "integrated";
|
|
135
|
+
}[];
|
|
136
|
+
logo_URIs?: {
|
|
137
|
+
png?: string;
|
|
138
|
+
svg?: string;
|
|
139
|
+
};
|
|
140
|
+
description?: string;
|
|
141
|
+
peers?: {
|
|
142
|
+
seeds?: Peer[];
|
|
143
|
+
persistent_peers?: Peer[];
|
|
144
|
+
};
|
|
145
|
+
apis?: {
|
|
146
|
+
rpc?: Endpoint[];
|
|
147
|
+
rest?: Endpoint[];
|
|
148
|
+
grpc?: Endpoint[];
|
|
149
|
+
wss?: Endpoint[];
|
|
150
|
+
"grpc-web"?: Endpoint[];
|
|
151
|
+
"evm-http-jsonrpc"?: Endpoint[];
|
|
152
|
+
};
|
|
153
|
+
explorers?: Explorer[];
|
|
154
|
+
keywords?: string[];
|
|
155
|
+
extra_codecs?: ("ethermint" | "injective")[];
|
|
156
|
+
}
|
package/chain.schema.js
ADDED
package/dist/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2022 Dan Lynch <pyramation@gmail.com>
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/dist/README.md
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# @chain-registry/interfaces
|
|
2
|
+
|
|
3
|
+
<p align="center" width="100%">
|
|
4
|
+
<img height="90" src="https://user-images.githubusercontent.com/545047/190171475-b416f99e-2831-4786-9ba3-a7ff4d95b0d3.svg" />
|
|
5
|
+
</p>
|
|
6
|
+
|
|
7
|
+
<p align="center" width="100%">
|
|
8
|
+
<a href="https://github.com/cosmology-tech/chain-registry/actions/workflows/run-tests.yml">
|
|
9
|
+
<img height="20" src="https://github.com/cosmology-tech/chain-registry/actions/workflows/run-tests.yml/badge.svg" />
|
|
10
|
+
</a>
|
|
11
|
+
<a href="https://github.com/cosmology-tech/chain-registry/blob/main/LICENSE"><img height="20" src="https://img.shields.io/badge/license-MIT-blue.svg"></a>
|
|
12
|
+
<a href="https://www.npmjs.com/package/@chain-registry/interfaces"><img height="20" src="https://img.shields.io/npm/dt/@chain-registry/interfaces"></a>
|
|
13
|
+
<a href="https://www.npmjs.com/package/@chain-registry/interfaces"><img height="20" src="https://img.shields.io/github/package-json/v/cosmology-tech/chain-registry?filename=packages%2Ftypes%2Fpackage.json"></a>
|
|
14
|
+
</p>
|
|
15
|
+
|
|
16
|
+
The `@chain-registry/interfaces` module provides TypeScript interfaces that represent the structured data types as defined in the original JSON schema from the [`cosmos/chain-registry`](https://github.com/cosmos/chain-registry) repository. These interfaces are generated to facilitate type-safe development when interacting with chain registry data within TypeScript projects.
|
|
17
|
+
|
|
18
|
+
## Installation
|
|
19
|
+
|
|
20
|
+
To install the `@chain-registry/interfaces` module, run the following command in your project directory:
|
|
21
|
+
|
|
22
|
+
```sh
|
|
23
|
+
npm install @chain-registry/interfaces
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Usage
|
|
27
|
+
|
|
28
|
+
Once installed, you can import the interfaces into your TypeScript project to ensure type safety and auto-completion within your IDE.
|
|
29
|
+
|
|
30
|
+
Example of using an interface:
|
|
31
|
+
|
|
32
|
+
```js
|
|
33
|
+
import { Chain } from '@chain-registry/interfaces';
|
|
34
|
+
|
|
35
|
+
function displayChainInfo(chain: Chain) {
|
|
36
|
+
console.log(`Chain Name: ${chain.chain_name}`);
|
|
37
|
+
console.log(`Chain ID: ${chain.chain_id}`);
|
|
38
|
+
// Add more fields as necessary
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// Example usage with dummy data
|
|
42
|
+
const cosmosHub: Chain = {
|
|
43
|
+
chain_name: "Cosmos Hub",
|
|
44
|
+
chain_id: "cosmoshub-4",
|
|
45
|
+
bech32_prefix: "cosmos",
|
|
46
|
+
// Assume other necessary fields are filled in
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
displayChainInfo(cosmosHub);
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Related
|
|
53
|
+
|
|
54
|
+
Checkout these related projects:
|
|
55
|
+
|
|
56
|
+
* [@cosmology/telescope](https://github.com/cosmology-tech/telescope) Your Frontend Companion for Building with TypeScript with Cosmos SDK Modules.
|
|
57
|
+
* [@cosmwasm/ts-codegen](https://github.com/CosmWasm/ts-codegen) Convert your CosmWasm smart contracts into dev-friendly TypeScript classes.
|
|
58
|
+
* [chain-registry](https://github.com/cosmology-tech/chain-registry) Everything from token symbols, logos, and IBC denominations for all assets you want to support in your application.
|
|
59
|
+
* [cosmos-kit](https://github.com/cosmology-tech/cosmos-kit) Experience the convenience of connecting with a variety of web3 wallets through a single, streamlined interface.
|
|
60
|
+
* [create-cosmos-app](https://github.com/cosmology-tech/create-cosmos-app) Set up a modern Cosmos app by running one command.
|
|
61
|
+
* [interchain-ui](https://github.com/cosmology-tech/interchain-ui) The Interchain Design System, empowering developers with a flexible, easy-to-use UI kit.
|
|
62
|
+
* [starship](https://github.com/cosmology-tech/starship) Unified Testing and Development for the Interchain.
|
|
63
|
+
|
|
64
|
+
## Credits
|
|
65
|
+
|
|
66
|
+
🛠 Built by Cosmology — if you like our tools, please consider delegating to [our validator ⚛️](https://cosmology.zone/validator)
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
## Disclaimer
|
|
70
|
+
|
|
71
|
+
AS DESCRIBED IN THE LICENSES, THE SOFTWARE IS PROVIDED “AS IS”, AT YOUR OWN RISK, AND WITHOUT WARRANTIES OF ANY KIND.
|
|
72
|
+
|
|
73
|
+
No developer or entity involved in creating this software will be liable for any claims or damages whatsoever associated with your use, inability to use, or your interaction with other users of the code, including any direct, indirect, incidental, special, exemplary, punitive or consequential damages, or loss of profits, cryptocurrencies, tokens, or anything else of value.
|
|
74
|
+
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@chain-registry/interfaces",
|
|
3
|
+
"version": "0.25.7",
|
|
4
|
+
"description": "Chain Registry interfaces",
|
|
5
|
+
"author": "Dan Lynch <pyramation@gmail.com>",
|
|
6
|
+
"homepage": "https://github.com/cosmology-tech/chain-registry",
|
|
7
|
+
"license": "SEE LICENSE IN LICENSE",
|
|
8
|
+
"main": "index.js",
|
|
9
|
+
"module": "esm/index.js",
|
|
10
|
+
"types": "index.d.ts",
|
|
11
|
+
"publishConfig": {
|
|
12
|
+
"access": "public",
|
|
13
|
+
"directory": "dist"
|
|
14
|
+
},
|
|
15
|
+
"repository": {
|
|
16
|
+
"type": "git",
|
|
17
|
+
"url": "https://github.com/cosmology-tech/chain-registry"
|
|
18
|
+
},
|
|
19
|
+
"bugs": {
|
|
20
|
+
"url": "https://github.com/cosmology-tech/chain-registry/issues"
|
|
21
|
+
},
|
|
22
|
+
"scripts": {
|
|
23
|
+
"copy": "copyfiles -f LICENSE README.md package.json dist",
|
|
24
|
+
"clean": "del dist/**",
|
|
25
|
+
"prepare": "npm run build",
|
|
26
|
+
"build": "npm run clean; tsc; tsc -p tsconfig.esm.json; npm run copy",
|
|
27
|
+
"test": "jest",
|
|
28
|
+
"test:watch": "jest --watch"
|
|
29
|
+
},
|
|
30
|
+
"keywords": [
|
|
31
|
+
"chain-registry",
|
|
32
|
+
"web3",
|
|
33
|
+
"cosmos",
|
|
34
|
+
"interchain"
|
|
35
|
+
]
|
|
36
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/esm/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/esm/shared.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export interface ChainOperatorInfo {
|
|
2
|
+
address?: string;
|
|
3
|
+
}
|
|
4
|
+
export interface ChainInfo {
|
|
5
|
+
chain_name: string;
|
|
6
|
+
client_id: string;
|
|
7
|
+
connection_id: string;
|
|
8
|
+
}
|
|
9
|
+
export interface ChannelInfo {
|
|
10
|
+
channel_id: string;
|
|
11
|
+
port_id: string;
|
|
12
|
+
client_id?: string;
|
|
13
|
+
connection_id?: string;
|
|
14
|
+
}
|
|
15
|
+
export interface IBCData {
|
|
16
|
+
$schema?: string;
|
|
17
|
+
chain_1: ChainInfo;
|
|
18
|
+
chain_2: ChainInfo;
|
|
19
|
+
channels: {
|
|
20
|
+
chain_1: ChannelInfo;
|
|
21
|
+
chain_2: ChannelInfo;
|
|
22
|
+
ordering: "ordered" | "unordered";
|
|
23
|
+
version: string;
|
|
24
|
+
fee_version?: string;
|
|
25
|
+
description?: string;
|
|
26
|
+
tags?: {
|
|
27
|
+
status?: "live" | "upcoming" | "killed";
|
|
28
|
+
preferred?: boolean;
|
|
29
|
+
dex?: string;
|
|
30
|
+
properties?: string;
|
|
31
|
+
};
|
|
32
|
+
}[];
|
|
33
|
+
operators?: {
|
|
34
|
+
chain_1: ChainOperatorInfo;
|
|
35
|
+
chain_2: ChainOperatorInfo;
|
|
36
|
+
memo: string;
|
|
37
|
+
name: string;
|
|
38
|
+
discord_handle?: string;
|
|
39
|
+
}[];
|
|
40
|
+
}
|
package/index.d.ts
ADDED
package/index.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./assetlist.schema"), exports);
|
|
18
|
+
__exportStar(require("./chain.schema"), exports);
|
|
19
|
+
__exportStar(require("./ibc_data.schema"), exports);
|
|
20
|
+
__exportStar(require("./memo_keys.schema"), exports);
|
|
21
|
+
__exportStar(require("./shared"), exports);
|
|
22
|
+
__exportStar(require("./versions.schema"), exports);
|
package/package.json
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@chain-registry/interfaces",
|
|
3
|
+
"version": "0.25.7",
|
|
4
|
+
"description": "Chain Registry interfaces",
|
|
5
|
+
"author": "Dan Lynch <pyramation@gmail.com>",
|
|
6
|
+
"homepage": "https://github.com/cosmology-tech/chain-registry",
|
|
7
|
+
"license": "SEE LICENSE IN LICENSE",
|
|
8
|
+
"main": "index.js",
|
|
9
|
+
"module": "esm/index.js",
|
|
10
|
+
"types": "index.d.ts",
|
|
11
|
+
"publishConfig": {
|
|
12
|
+
"access": "public",
|
|
13
|
+
"directory": "dist"
|
|
14
|
+
},
|
|
15
|
+
"repository": {
|
|
16
|
+
"type": "git",
|
|
17
|
+
"url": "https://github.com/cosmology-tech/chain-registry"
|
|
18
|
+
},
|
|
19
|
+
"bugs": {
|
|
20
|
+
"url": "https://github.com/cosmology-tech/chain-registry/issues"
|
|
21
|
+
},
|
|
22
|
+
"scripts": {
|
|
23
|
+
"copy": "copyfiles -f LICENSE README.md package.json dist",
|
|
24
|
+
"clean": "del dist/**",
|
|
25
|
+
"prepare": "npm run build",
|
|
26
|
+
"build": "npm run clean; tsc; tsc -p tsconfig.esm.json; npm run copy",
|
|
27
|
+
"test": "jest",
|
|
28
|
+
"test:watch": "jest --watch"
|
|
29
|
+
},
|
|
30
|
+
"keywords": [
|
|
31
|
+
"chain-registry",
|
|
32
|
+
"web3",
|
|
33
|
+
"cosmos",
|
|
34
|
+
"interchain"
|
|
35
|
+
]
|
|
36
|
+
}
|
package/shared.d.ts
ADDED
package/shared.js
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export interface Versions {
|
|
2
|
+
$schema?: string;
|
|
3
|
+
chain_name: string;
|
|
4
|
+
versions: {
|
|
5
|
+
name: string;
|
|
6
|
+
tag?: string;
|
|
7
|
+
height?: number;
|
|
8
|
+
proposal?: number;
|
|
9
|
+
previous_version_name?: string;
|
|
10
|
+
next_version_name?: string;
|
|
11
|
+
recommended_version?: string;
|
|
12
|
+
compatible_versions?: string[];
|
|
13
|
+
cosmos_sdk_version?: string;
|
|
14
|
+
consensus?: {
|
|
15
|
+
type: "tendermint" | "cometbft";
|
|
16
|
+
version?: string;
|
|
17
|
+
};
|
|
18
|
+
cosmwasm_version?: string;
|
|
19
|
+
cosmwasm_enabled?: boolean;
|
|
20
|
+
cosmwasm_path?: string;
|
|
21
|
+
ibc_go_version?: string;
|
|
22
|
+
go_version?: string;
|
|
23
|
+
ics_enabled?: ("ics20-1" | "ics27-1" | "mauth")[];
|
|
24
|
+
binaries?: {
|
|
25
|
+
"linux/amd64"?: string;
|
|
26
|
+
"linux/arm64"?: string;
|
|
27
|
+
"darwin/amd64"?: string;
|
|
28
|
+
"darwin/arm64"?: string;
|
|
29
|
+
"windows/amd64"?: string;
|
|
30
|
+
"windows/arm64"?: string;
|
|
31
|
+
};
|
|
32
|
+
}[];
|
|
33
|
+
}
|