From 17df68c633a7354ec2c1a4565099af661b878503 Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Wed, 13 Nov 2024 18:09:02 -0800 Subject: [PATCH 1/3] added json --- .gitmodules | 3 +++ Makefile | 14 +++++++++++--- repos/registry-json | 1 + 3 files changed, 15 insertions(+), 3 deletions(-) create mode 160000 repos/registry-json diff --git a/.gitmodules b/.gitmodules index 450b2f32e..3c9c61e6f 100644 --- a/.gitmodules +++ b/.gitmodules @@ -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 diff --git a/Makefile b/Makefile index 03819438f..343010ef0 100644 --- a/Makefile +++ b/Makefile @@ -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 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 && \ diff --git a/repos/registry-json b/repos/registry-json new file mode 160000 index 000000000..e1ecfc4ff --- /dev/null +++ b/repos/registry-json @@ -0,0 +1 @@ +Subproject commit e1ecfc4ff17222fd14a1fb3b6edcad8024ad1b01 From 1d8eaabcf212cd85520af607eb2fb436da13e19b Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Wed, 13 Nov 2024 18:10:25 -0800 Subject: [PATCH 2/3] make --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 343010ef0..31f0af1fb 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ .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 chain-registry submodule to latest in repos/registry-json" From 88401346566fdd678a4950184bfa5f85fa7636f9 Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Wed, 13 Nov 2024 18:18:50 -0800 Subject: [PATCH 3/3] update types --- v2/packages/types/src/assetlist.schema.ts | 38 ++++---- v2/packages/types/src/chain.schema.ts | 102 ++++++++++------------ v2/packages/types/src/ibc_data.schema.ts | 14 +-- v2/workflows/generate-types/package.json | 2 +- 4 files changed, 74 insertions(+), 82 deletions(-) diff --git a/v2/packages/types/src/assetlist.schema.ts b/v2/packages/types/src/assetlist.schema.ts index e8148595e..81c1a6ce3 100644 --- a/v2/packages/types/src/assetlist.schema.ts +++ b/v2/packages/types/src/assetlist.schema.ts @@ -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; @@ -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; @@ -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: { @@ -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: { @@ -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: { @@ -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; @@ -110,6 +110,6 @@ export interface NonIbcTransition { } export interface AssetList { $schema?: string; - chainName: string; assets: Asset[]; + chainName: string; } \ No newline at end of file diff --git a/v2/packages/types/src/chain.schema.ts b/v2/packages/types/src/chain.schema.ts index 769c9aa62..e3be499ff 100644 --- a/v2/packages/types/src/chain.schema.ts +++ b/v2/packages/types/src/chain.schema.ts @@ -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; @@ -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[]; }; @@ -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?: { @@ -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[]; @@ -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")[]; } \ No newline at end of file diff --git a/v2/packages/types/src/ibc_data.schema.ts b/v2/packages/types/src/ibc_data.schema.ts index 00adc5dcb..65c1c995c 100644 --- a/v2/packages/types/src/ibc_data.schema.ts +++ b/v2/packages/types/src/ibc_data.schema.ts @@ -14,14 +14,9 @@ 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"; @@ -29,12 +24,17 @@ export interface IBCData { 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; } \ No newline at end of file diff --git a/v2/workflows/generate-types/package.json b/v2/workflows/generate-types/package.json index 0dcff2fc8..ea13b866c 100644 --- a/v2/workflows/generate-types/package.json +++ b/v2/workflows/generate-types/package.json @@ -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": {