-
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
a5d32f0
commit 7585a92
Showing
9 changed files
with
1,600 additions
and
756 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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,183 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-04/schema#", | ||
"type": "object", | ||
"required": [ | ||
"chain_1", | ||
"chain_2", | ||
"channels" | ||
], | ||
"properties": { | ||
"$schema": { | ||
"type": "string", | ||
"pattern": "^(\\.\\./)+ibc_data\\.schema\\.json$" | ||
}, | ||
"chain_1": { | ||
"type": "object", | ||
"$ref": "#/$defs/chain_info" | ||
}, | ||
"chain_2": { | ||
"type": "object", | ||
"$ref": "#/$defs/chain_info" | ||
}, | ||
"channels": { | ||
"type": "array", | ||
"items": { | ||
"type": "object", | ||
"required": [ | ||
"chain_1", | ||
"chain_2", | ||
"ordering", | ||
"version" | ||
], | ||
"properties": { | ||
"chain_1": { | ||
"type": "object", | ||
"$ref": "#/$defs/channel_info" | ||
}, | ||
"chain_2": { | ||
"type": "object", | ||
"$ref": "#/$defs/channel_info" | ||
}, | ||
"ordering": { | ||
"enum": [ | ||
"ordered", | ||
"unordered" | ||
], | ||
"description": "Determines if packets from a sending module must be 'ordered' or 'unordered'." | ||
}, | ||
"version": { | ||
"type": "string", | ||
"description": "IBC Version" | ||
}, | ||
"fee_version": { | ||
"type": "string", | ||
"description": "Fee Version" | ||
}, | ||
"description": { | ||
"type": "string", | ||
"description": "Human readable description of the channel." | ||
}, | ||
"tags": { | ||
"type": "object", | ||
"description": "Human readable key:value pairs that help describe and distinguish channels.", | ||
"properties": { | ||
"status": { | ||
"enum": [ | ||
"live", | ||
"upcoming", | ||
"killed" | ||
] | ||
}, | ||
"preferred": { | ||
"type": "boolean" | ||
}, | ||
"dex": { | ||
"type": "string" | ||
}, | ||
"properties": { | ||
"type": "string", | ||
"description": "String that helps describe non-dex use cases ex: interchain accounts(ICA)." | ||
} | ||
}, | ||
"additionalProperties": true | ||
} | ||
}, | ||
"additionalProperties": false | ||
} | ||
}, | ||
"operators": { | ||
"type": "array", | ||
"description": "ibc connection operator information.", | ||
"items": { | ||
"type": "object", | ||
"required": [ | ||
"chain_1", | ||
"chain_2", | ||
"memo", | ||
"name" | ||
], | ||
"properties": { | ||
"chain_1": { | ||
"type": "object", | ||
"$ref": "#/$defs/chain_operator_info" | ||
}, | ||
"chain_2": { | ||
"type": "object", | ||
"$ref": "#/$defs/chain_operator_info" | ||
}, | ||
"memo": { | ||
"type": "string" | ||
}, | ||
"name": { | ||
"type": "string", | ||
"description": "Operator display name" | ||
}, | ||
"discord_handle": { | ||
"type": "string" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"additionalProperties": false, | ||
"$defs": { | ||
"chain_operator_info": { | ||
"type": "object", | ||
"description": "Operator information on a specific chain.", | ||
"properties": { | ||
"address": { | ||
"type": "string" | ||
} | ||
} | ||
}, | ||
"chain_info": { | ||
"type": "object", | ||
"description": "Top level IBC data pertaining to the chain. `chain_1` and `chain_2` should be in alphabetical order.", | ||
"required": [ | ||
"chain_name", | ||
"client_id", | ||
"connection_id" | ||
], | ||
"properties": { | ||
"chain_name": { | ||
"type": "string" | ||
}, | ||
"client_id": { | ||
"type": "string", | ||
"description": "The client ID on the corresponding chain representing the other chain's light client." | ||
}, | ||
"connection_id": { | ||
"type": "string", | ||
"description": "The connection ID on the corresponding chain representing a connection to the other chain." | ||
} | ||
}, | ||
"additionalProperties": false | ||
}, | ||
"channel_info": { | ||
"type": "object", | ||
"required": [ | ||
"channel_id", | ||
"port_id" | ||
], | ||
"properties": { | ||
"channel_id": { | ||
"type": "string", | ||
"description": "The channel ID on the corresponding chain's connection representing a channel on the other chain." | ||
}, | ||
"port_id": { | ||
"type": "string", | ||
"description": "The IBC port ID which a relevant module binds to on the corresponding chain." | ||
}, | ||
"client_id": { | ||
"type": "string", | ||
"description": "Optional. The client ID on the corresponding chain representing the other chain's light client." | ||
}, | ||
"connection_id": { | ||
"type": "string", | ||
"description": "Optional. The connection ID on the corresponding chain representing a connection to the other chain." | ||
} | ||
}, | ||
"additionalProperties": false | ||
} | ||
} | ||
} |
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,42 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema", | ||
"type": "object", | ||
"required": [ | ||
"memo_keys" | ||
], | ||
"properties": { | ||
"$schema": { | ||
"type": "string", | ||
"pattern": "^(\\.\\./)+memo_keys\\.schema\\.json$" | ||
}, | ||
"memo_keys": { | ||
"type": "array", | ||
"items": { | ||
"type": "object", | ||
"required": [ | ||
"key", | ||
"description", | ||
"git_repo", | ||
"memo" | ||
], | ||
"properties": { | ||
"key": { | ||
"type": "string" | ||
}, | ||
"description": { | ||
"type": "string" | ||
}, | ||
"git_repo": { | ||
"type": "string", | ||
"format": "uri" | ||
}, | ||
"memo": { | ||
"type": "object" | ||
} | ||
}, | ||
"additionalProperties": true | ||
} | ||
} | ||
}, | ||
"additionalProperties": false | ||
} |
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,94 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`assetlist 1`] = ` | ||
"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
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,5 @@ | ||
import assetlist from '../__fixtures__/schemas/assetlist.json'; | ||
import { generateTypeScript } from '../src'; | ||
it('assetlist', () => { | ||
expect(generateTypeScript(assetlist as any)).toMatchSnapshot(); | ||
}); |
Oops, something went wrong.