Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/json #177

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@
[submodule "repos/chain-registry"]
path = repos/chain-registry
url = https://github.com/cosmos/chain-registry.git
[submodule "repos/registry-json"]
path = repos/registry-json
url = https://github.com/chain-registry/chain-registry.git
16 changes: 12 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,17 +1,25 @@
.PHONY: def update-registry update-fixtures submodule-status
.PHONY: def update-registry update-fixtures submodule-status update-json

def: update-registry update-fixtures
def: update-registry update-fixtures update-json

update-registry:
@echo "Updating cosmos/chain-registry submodule to latest"
git submodule update --remote --init --recursive repos/chain-registry
@echo "Updating chain-registry submodule to latest in repos/registry-json"
git submodule update --remote --init --recursive repos/registry-json

update-fixtures:
@echo "Updating chain-registry/chain-registry-fixtures submodule"
git submodule update --remote --init --recursive repos/chain-registry-fixtures

update-json:
@echo "Updating only the registry-json submodule"
git submodule update --remote --init --recursive repos/registry-json

submodule-status:
@echo "Checking submodule statuses..."
@cd repos/registry-json && \
echo "Last 2 commits in repos/registry-json:" && \
git log -n 2 --oneline && \
cd - >/dev/null
@cd repos/chain-registry && \
echo "Last 2 commits in repos/chain-registry:" && \
git log -n 2 --oneline && \
Expand Down
1 change: 1 addition & 0 deletions repos/registry-json
Submodule registry-json added at e1ecfc
38 changes: 19 additions & 19 deletions v2/packages/types/src/assetlist.schema.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
export interface Asset {
deprecated?: boolean;
description?: string;
extendedDescription?: string;
denomUnits: DenomUnit[];
typeAsset: "sdk.coin" | "cw20" | "erc20" | "ics20" | "snip20" | "snip25" | "bitcoin-like" | "evm-base" | "svm-base" | "substrate" | "unknown";
address?: string;
base: string;
name: string;
Expand All @@ -15,23 +12,18 @@ export interface Asset {
dstChannel: string;
sourceDenom: string;
};
logoURIs?: {
png?: string;
svg?: string;
};
images?: {
imageSync?: Pointer;
png?: string;
svg?: string;
theme?: {
circle?: boolean;
monochrome?: boolean;
primaryColorHex?: string;
backgroundColorHex?: string;
circle?: boolean;
darkMode?: boolean;
monochrome?: boolean;
};
imageSync?: Pointer;
}[];
coingeckoId?: string;
keywords?: string[];
socials?: {
website?: string;
Expand All @@ -42,16 +34,24 @@ export interface Asset {
medium?: string;
reddit?: string;
};
assetType: "sdk.coin" | "cw20" | "erc20" | "ics20" | "snip20" | "snip25" | "bitcoin-like" | "evm-base" | "svm-base" | "substrate" | "unknown" | "sdk.factory" | "bitsong";
extendedDescription?: string;
denomUnits: DenomUnit[];
logoURIs?: {
png?: string;
svg?: string;
};
coingeckoId?: string;
}
export interface Pointer {
chainName: string;
baseDenom?: string;
}
export interface DenomUnit {
denom: string;
exponent: number;
aliases?: string[];
}
export interface Pointer {
chainName: string;
baseDenom?: string;
}
export interface IbcTransition {
type: "ibc";
counterparty: {
Expand All @@ -68,9 +68,9 @@ export interface IbcTransition {
export interface IbcCw20Transition {
type: "ibc-cw20";
counterparty: {
port: string;
chainName: string;
baseDenom: string;
port: string;
channelId: string;
};
chain: {
Expand All @@ -83,9 +83,9 @@ export interface IbcCw20Transition {
export interface IbcBridgeTransition {
type: "ibc-bridge";
counterparty: {
port?: string;
chainName: string;
baseDenom: string;
port?: string;
channelId: string;
};
chain: {
Expand All @@ -99,9 +99,9 @@ export interface IbcBridgeTransition {
export interface NonIbcTransition {
type: "bridge" | "liquid-stake" | "synthetic" | "wrapped" | "additional-mintage" | "test-mintage" | "legacy-mintage";
counterparty: {
contract?: string;
chainName: string;
baseDenom: string;
contract?: string;
};
chain?: {
contract: string;
Expand All @@ -110,6 +110,6 @@ export interface NonIbcTransition {
}
export interface AssetList {
$schema?: string;
chainName: string;
assets: Asset[];
chainName: string;
}
102 changes: 47 additions & 55 deletions v2/packages/types/src/chain.schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,6 @@ export interface Explorer {
proposalPage?: string;
blockPage?: string;
}
export interface FeeToken {
denom: string;
fixedMinGasPrice?: number;
lowGasPrice?: number;
averageGasPrice?: number;
highGasPrice?: number;
gasCosts?: {
cosmosSend?: number;
ibcTransfer?: number;
};
}
export interface StakingToken {
denom: string;
}
export type Repo = string;
export type Version = string;
export type Tag = string;
Expand Down Expand Up @@ -78,30 +64,25 @@ export interface Pointer {
chainName: string;
baseDenom?: string;
}
export interface FeeToken {
denom: string;
fixedMinGasPrice?: number;
lowGasPrice?: number;
averageGasPrice?: number;
highGasPrice?: number;
gasCosts?: {
cosmosSend?: number;
ibcTransfer?: number;
};
}
export interface StakingToken {
denom: string;
}
export interface Chain {
$schema?: string;
chainName: string;
chainType: "cosmos" | "eip155" | "bip122" | "polkadot" | "solana" | "algorand" | "arweave" | "ergo" | "fil" | "hedera" | "monero" | "reef" | "stacks" | "starknet" | "stellar" | "tezos" | "vechain" | "waves" | "xrpl" | "unknown";
chainId?: string;
preForkChainName?: string;
prettyName?: string;
website?: string;
status?: "live" | "upcoming" | "killed";
networkType?: "mainnet" | "testnet" | "devnet";
bech32Prefix?: string;
bech32Config?: {
bech32PrefixAccAddr?: string;
bech32PrefixAccPub?: string;
bech32PrefixValAddr?: string;
bech32PrefixValPub?: string;
bech32PrefixConsAddr?: string;
bech32PrefixConsPub?: string;
};
daemonName?: string;
nodeHome?: string;
keyAlgos?: ("secp256k1" | "ethsecp256k1" | "ed25519" | "sr25519" | "bn254")[];
slip44?: number;
alternativeSlip44s?: number[];
fees?: {
feeTokens: FeeToken[];
};
Expand All @@ -113,17 +94,10 @@ export interface Chain {
};
};
codebase?: {
gitRepo?: string;
recommendedVersion?: string;
compatibleVersions?: string[];
language?: Language;
binaries?: Binaries;
cosmosSdkVersion?: string;
sdk?: Sdk;
consensus?: Consensus;
cosmwasmVersion?: string;
cosmwasmEnabled?: boolean;
cosmwasmPath?: string;
cosmwasm?: Cosmwasm;
ibc?: Ibc;
genesis?: {
Expand All @@ -136,38 +110,33 @@ export interface Chain {
tag?: string;
height?: number;
proposal?: number;
previousVersionName?: string;
nextVersionName?: string;
recommendedVersion?: string;
compatibleVersions?: string[];
language?: Language;
cosmosSdkVersion?: string;
sdk?: Sdk;
consensus?: Consensus;
cosmwasmVersion?: string;
cosmwasmEnabled?: boolean;
cosmwasmPath?: string;
cosmwasm?: Cosmwasm;
ibc?: Ibc;
binaries?: Binaries;
previousVersionName?: string;
nextVersionName?: string;
recommendedVersion?: string;
compatibleVersions?: string[];
}[];
gitRepo?: string;
recommendedVersion?: string;
compatibleVersions?: string[];
};
images?: {
imageSync?: Pointer;
png?: string;
svg?: string;
theme?: {
circle?: boolean;
monochrome?: boolean;
primaryColorHex?: string;
backgroundColorHex?: string;
circle?: boolean;
darkMode?: boolean;
monochrome?: boolean;
};
imageSync?: Pointer;
}[];
logoURIs?: {
png?: string;
svg?: string;
};
description?: string;
peers?: {
seeds?: Peer[];
Expand All @@ -183,5 +152,28 @@ export interface Chain {
};
explorers?: Explorer[];
keywords?: string[];
chainName: string;
chainType: "cosmos" | "eip155" | "bip122" | "polkadot" | "solana" | "algorand" | "arweave" | "ergo" | "fil" | "hedera" | "monero" | "reef" | "stacks" | "starknet" | "stellar" | "tezos" | "vechain" | "waves" | "xrpl" | "unknown";
chainId?: string;
preForkChainName?: string;
prettyName?: string;
networkType?: "mainnet" | "testnet" | "devnet";
bech32Prefix?: string;
bech32Config?: {
bech32PrefixAccAddr?: string;
bech32PrefixAccPub?: string;
bech32PrefixValAddr?: string;
bech32PrefixValPub?: string;
bech32PrefixConsAddr?: string;
bech32PrefixConsPub?: string;
};
daemonName?: string;
nodeHome?: string;
keyAlgos?: ("secp256k1" | "ethsecp256k1" | "ed25519" | "sr25519" | "bn254")[];
alternativeSlip44s?: number[];
logoURIs?: {
png?: string;
svg?: string;
};
extraCodecs?: ("ethermint" | "injective")[];
}
14 changes: 7 additions & 7 deletions v2/packages/types/src/ibc_data.schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +14,27 @@ export interface ChannelInfo {
}
export interface IBCData {
$schema?: string;
chain1: ChainInfo;
chain2: ChainInfo;
channels: {
chain1: ChannelInfo;
chain2: ChannelInfo;
ordering: "ordered" | "unordered";
version: string;
feeVersion?: string;
description?: string;
tags?: {
status?: "live" | "upcoming" | "killed";
preferred?: boolean;
dex?: string;
properties?: string;
};
chain1: ChannelInfo;
chain2: ChannelInfo;
feeVersion?: string;
}[];
operators?: {
chain1: ChainOperatorInfo;
chain2: ChainOperatorInfo;
memo: string;
name: string;
chain1: ChainOperatorInfo;
chain2: ChainOperatorInfo;
discordHandle?: string;
}[];
chain1: ChainInfo;
chain2: ChainInfo;
}
2 changes: 1 addition & 1 deletion v2/workflows/generate-types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
},
"scripts": {
"generate:interfaces": "chain-registry codegen --outputDir ../../../v2/packages/interfaces/src/ --no-camelCase --registryDir ../../../repos/chain-registry",
"generate:types": "chain-registry codegen --outputDir ../../../v2/packages/types/src/ --camelCase --registryDir ../../../repos/chain-registry",
"generate:types": "chain-registry codegen --outputDir ../../../v2/packages/types/src/ --camelCase --registryDir ../../../repos/registry-json/registries/full",
"generate:legacy": "chain-registry codegen --outputDir ../../../v1/packages/types/src/ --no-camelCase --registryDir ../../../repos/chain-registry"
},
"devDependencies": {
Expand Down
Loading