-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7585a92
commit 74a6d3a
Showing
5 changed files
with
264 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
interface Asset { | ||
deprecated?: boolean; | ||
description?: string; | ||
extended_description?: string; | ||
denom_units: Denomunit[]; | ||
type_asset?: string; | ||
address?: string; | ||
base: string; | ||
name: string; | ||
display: string; | ||
symbol: string; | ||
traces?: any[]; | ||
ibc?: { | ||
source_channel: string; | ||
dst_channel: string; | ||
source_denom: string; | ||
}; | ||
logo_URIs?: { | ||
png?: string; | ||
svg?: string; | ||
}; | ||
images?: { | ||
image_sync?: Pointer; | ||
png?: string; | ||
svg?: string; | ||
theme?: { | ||
primary_color_hex?: string; | ||
circle?: boolean; | ||
dark_mode?: boolean; | ||
}; | ||
}[]; | ||
coingecko_id?: string; | ||
keywords?: string[]; | ||
socials?: { | ||
website?: string; | ||
twitter?: string; | ||
}; | ||
} | ||
interface Denomunit { | ||
denom: string; | ||
exponent: number; | ||
aliases?: string[]; | ||
} | ||
interface Pointer { | ||
chain_name: string; | ||
base_denom?: string; | ||
} | ||
interface Ibctransition { | ||
type: string; | ||
counterparty: { | ||
chain_name: string; | ||
base_denom: string; | ||
channel_id: string; | ||
}; | ||
chain: { | ||
channel_id: string; | ||
path: string; | ||
}; | ||
} | ||
interface Ibccw20transition { | ||
type: string; | ||
counterparty: { | ||
chain_name: string; | ||
base_denom: string; | ||
port: string; | ||
channel_id: string; | ||
}; | ||
chain: { | ||
port: string; | ||
channel_id: string; | ||
path: string; | ||
}; | ||
} | ||
interface Nonibctransition { | ||
type: string; | ||
counterparty: { | ||
chain_name: string; | ||
base_denom: string; | ||
contract?: string; | ||
}; | ||
chain?: { | ||
contract: string; | ||
}; | ||
provider: string; | ||
} | ||
interface Asset Lists { | ||
$schema?: string; | ||
chain_name: string; | ||
assets: Asset[]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,159 @@ | ||
interface Peer { | ||
id: string; | ||
address: string; | ||
provider?: string; | ||
} | ||
interface Endpoint { | ||
address: string; | ||
provider?: string; | ||
archive?: boolean; | ||
} | ||
interface Explorer { | ||
kind?: string; | ||
url?: string; | ||
tx_page?: string; | ||
account_page?: string; | ||
} | ||
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; | ||
}; | ||
} | ||
interface Stakingtoken { | ||
denom: string; | ||
} | ||
interface Pointer { | ||
chain_name: string; | ||
base_denom?: string; | ||
} | ||
interface Cosmos Chain { | ||
$schema?: string; | ||
chain_name: string; | ||
chain_id: string; | ||
pre_fork_chain_name?: string; | ||
pretty_name?: string; | ||
website?: string; | ||
update_link?: string; | ||
status?: any; | ||
network_type?: any; | ||
bech32_prefix: string; | ||
bech32_config?: { | ||
bech32PrefixAccAddr?: string; | ||
bech32PrefixAccPub?: string; | ||
bech32PrefixValAddr?: string; | ||
bech32PrefixValPub?: string; | ||
bech32PrefixConsAddr?: string; | ||
bech32PrefixConsPub?: string; | ||
}; | ||
daemon_name?: string; | ||
node_home?: string; | ||
key_algos?: string[]; | ||
slip44?: number; | ||
alternative_slip44s?: number[]; | ||
fees?: { | ||
fee_tokens: Feetoken[]; | ||
}; | ||
staking?: { | ||
staking_tokens: Stakingtoken[]; | ||
lock_duration?: { | ||
blocks?: number; | ||
time?: string; | ||
}; | ||
}; | ||
codebase?: { | ||
git_repo?: string; | ||
recommended_version?: string; | ||
go_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: string; | ||
version?: string; | ||
}; | ||
cosmwasm_version?: string; | ||
cosmwasm_enabled?: boolean; | ||
cosmwasm_path?: string; | ||
ibc_go_version?: string; | ||
ics_enabled?: string[]; | ||
genesis?: { | ||
name?: string; | ||
genesis_url: string; | ||
ics_ccv_url?: string; | ||
}; | ||
versions?: { | ||
name: string; | ||
tag?: string; | ||
height?: number; | ||
proposal?: number; | ||
previous_version_name?: string; | ||
next_version_name?: string; | ||
recommended_version?: string; | ||
go_version?: string; | ||
compatible_versions?: string[]; | ||
cosmos_sdk_version?: string; | ||
consensus?: { | ||
type: string; | ||
version?: string; | ||
}; | ||
cosmwasm_version?: string; | ||
cosmwasm_enabled?: boolean; | ||
cosmwasm_path?: string; | ||
ibc_go_version?: string; | ||
ics_enabled?: string[]; | ||
binaries?: { | ||
"'linux/amd64'"?: string; | ||
"'linux/arm64'"?: string; | ||
"'darwin/amd64'"?: string; | ||
"'darwin/arm64'"?: string; | ||
"'windows/amd64'"?: string; | ||
"'windows/arm64'"?: string; | ||
}; | ||
}[]; | ||
}; | ||
images?: { | ||
image_sync?: Pointer; | ||
png?: string; | ||
svg?: string; | ||
theme?: { | ||
primary_color_hex?: string; | ||
circle?: boolean; | ||
dark_mode?: boolean; | ||
}; | ||
layout?: string; | ||
text_position?: string; | ||
}[]; | ||
logo_URIs?: { | ||
png?: string; | ||
svg?: string; | ||
}; | ||
description?: 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?: string[]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,10 @@ | ||
import assetlist from '../__fixtures__/schemas/assetlist.json'; | ||
import { writeFileSync } from 'fs'; | ||
|
||
import schema from '../__fixtures__/schemas/assetlist.json'; | ||
import { generateTypeScript } from '../src'; | ||
|
||
it('assetlist', () => { | ||
expect(generateTypeScript(assetlist as any)).toMatchSnapshot(); | ||
const code = generateTypeScript(schema as any); | ||
expect(code).toMatchSnapshot(); | ||
writeFileSync(__dirname + '/../__fixtures__/output/assetlist.ts', code); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,10 @@ | ||
import chain from '../__fixtures__/schemas/chain.json'; | ||
import { writeFileSync } from 'fs'; | ||
|
||
import schema from '../__fixtures__/schemas/chain.json'; | ||
import { generateTypeScript } from '../src'; | ||
|
||
it('chain', () => { | ||
expect(generateTypeScript(chain as any)).toMatchSnapshot(); | ||
const code = generateTypeScript(schema as any); | ||
expect(code).toMatchSnapshot(); | ||
writeFileSync(__dirname + '/../__fixtures__/output/chain.ts', code); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters