Skip to content

Commit

Permalink
update types
Browse files Browse the repository at this point in the history
  • Loading branch information
pyramation committed Nov 14, 2024
1 parent 1d8eaab commit 8840134
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 82 deletions.
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

0 comments on commit 8840134

Please sign in to comment.