Skip to content

Commit

Permalink
chore: normalize config casing
Browse files Browse the repository at this point in the history
  • Loading branch information
alanrsoares committed Aug 16, 2023
1 parent 550bf76 commit 4c46604
Show file tree
Hide file tree
Showing 7 changed files with 210 additions and 160 deletions.
26 changes: 15 additions & 11 deletions cli/schemas/interchain-tokenlist.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,34 @@ export const IconUrlsSchema = z.object({
});

export const remoteToken = z.object({
chain_id: z.string(),
axelar_chain_id: z.string(),
token_address: address,
chainId: z.string(),
axelarChainId: z.string(),
tokenAddress: address,
});

export const interchainToken = z.object({
token_id: hash,
token_address: address,
tokenId: hash,
tokenAddress: address,
symbol: z.string(),
pretty_symbol: z.string(),
prettySymbol: z.string(),
decimals: z.number().int(),
name: z.string(),
origin_chain_id: z.string(),
origin_axelar_chain_id: z.string(),
transfer_type: z.string(),
originChainId: z.string(),
originAxelarChainId: z.string(),
transferType: z.string(),
iconUrls: IconUrlsSchema,
remote_tokens: z.array(remoteToken),
remoteTokens: z.array(remoteToken),
});

const interchainTokenList = z.object({
$schema: z
.string()
.regex(/^(?:\.\.\/)+schemas\/interchain-tokenlist\.schema\.json$/),
version: z.string(),
version: z.object({
major: z.number().int(),
minor: z.number().int(),
patch: z.number().int(),
}),
items: z.array(interchainToken),
});

Expand Down
71 changes: 71 additions & 0 deletions registry/mainnet/interchain/squid.tokenlist.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
{
"$schema": "../../schemas/interchain-tokenlist.schema.json",
"version": {
"major": 0,
"minor": 1,
"patch": 0
},
"items": [
{
"tokenId": "0x42cf40c325b764af70ce0cef78ab550b212cb66a812e442e425630523b303785",
"tokenAddress": "0xD772a13cf187272e2A914aD90e06c47990014975",
"symbol": "tSUSHI",
"prettySymbol": "tSUSHI",
"decimals": 18,
"name": "Testnet Sushi Token",
"originChainId": "5",
"originAxelarChainId": "ethereum-2",
"transferType": "interchain_token",
"iconUrls": {
"svg": "https://raw.githubusercontent.com/axelarnetwork/public-chain-configs/images/tokens/sushi.svg"
},
"remoteTokens": [
{
"chainId": "80001",
"axelarChainId": "polygon",
"tokenAddress": "0xD772a13cf187272e2A914aD90e06c47990014975"
},
{
"chainId": "43113",
"axelarChainId": "avalance",
"tokenAddress": "0xD772a13cf187272e2A914aD90e06c47990014975"
},
{
"chainId": "97",
"axelarChainId": "binance",
"tokenAddress": "0xD772a13cf187272e2A914aD90e06c47990014975"
},
{
"chainId": "4002",
"axelarChainId": "fantom",
"tokenAddress": "0xD772a13cf187272e2A914aD90e06c47990014975"
},
{
"chainId": "1287",
"axelarChainId": "moonbeam",
"tokenAddress": "0xD772a13cf187272e2A914aD90e06c47990014975"
},
{
"chainId": "421613",
"axelarChainId": "arbitrum",
"tokenAddress": "0xD772a13cf187272e2A914aD90e06c47990014975"
},
{
"chainId": "84531",
"axelarChainId": "base",
"tokenAddress": "0xD772a13cf187272e2A914aD90e06c47990014975"
},
{
"chainId": "2221",
"axelarChainId": "kava",
"tokenAddress": "0xD772a13cf187272e2A914aD90e06c47990014975"
},
{
"chainId": "44787",
"axelarChainId": "celo",
"tokenAddress": "0xD772a13cf187272e2A914aD90e06c47990014975"
}
]
}
]
}
66 changes: 0 additions & 66 deletions registry/mainnet/interchain_tokens/squid.json

This file was deleted.

49 changes: 29 additions & 20 deletions registry/schemas/interchain-tokenlist.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,16 @@
"type": "string",
"pattern": "^(?:\\.\\.\\/)+schemas\\/interchain-tokenlist\\.schema\\.json$"
},
"version": { "type": "string" },
"version": {
"type": "object",
"properties": {
"major": { "type": "integer" },
"minor": { "type": "integer" },
"patch": { "type": "integer" }
},
"required": ["major", "minor", "patch"],
"additionalProperties": false
},
"items": {
"type": "array",
"items": { "$ref": "#/definitions/interchainToken" }
Expand All @@ -25,46 +34,46 @@
"interchainToken": {
"type": "object",
"properties": {
"token_id": { "type": "string", "pattern": "^0x[a-fA-F0-9]{64}$" },
"token_address": { "type": "string", "pattern": "^0x[a-fA-F0-9]{40}$" },
"tokenId": { "type": "string", "pattern": "^0x[a-fA-F0-9]{64}$" },
"tokenAddress": { "type": "string", "pattern": "^0x[a-fA-F0-9]{40}$" },
"symbol": { "type": "string" },
"pretty_symbol": { "type": "string" },
"prettySymbol": { "type": "string" },
"decimals": { "type": "integer" },
"name": { "type": "string" },
"origin_chain_id": { "type": "string" },
"origin_axelar_chain_id": { "type": "string" },
"transfer_type": { "type": "string" },
"originChainId": { "type": "string" },
"originAxelarChainId": { "type": "string" },
"transferType": { "type": "string" },
"iconUrls": { "$ref": "#/definitions/IconUrlsSchema" },
"remote_tokens": {
"remoteTokens": {
"type": "array",
"items": { "$ref": "#/definitions/remoteToken" }
}
},
"required": [
"token_id",
"token_address",
"tokenId",
"tokenAddress",
"symbol",
"pretty_symbol",
"prettySymbol",
"decimals",
"name",
"origin_chain_id",
"origin_axelar_chain_id",
"transfer_type",
"originChainId",
"originAxelarChainId",
"transferType",
"iconUrls",
"remote_tokens"
"remoteTokens"
],
"additionalProperties": false
},
"remoteToken": {
"type": "object",
"properties": {
"chain_id": { "type": "string" },
"axelar_chain_id": { "type": "string" },
"token_address": {
"$ref": "#/definitions/interchainToken/properties/token_address"
"chainId": { "type": "string" },
"axelarChainId": { "type": "string" },
"tokenAddress": {
"$ref": "#/definitions/interchainToken/properties/tokenAddress"
}
},
"required": ["chain_id", "axelar_chain_id", "token_address"],
"required": ["chainId", "axelarChainId", "tokenAddress"],
"additionalProperties": false
}
}
Expand Down
71 changes: 71 additions & 0 deletions registry/testnet/interchain/squid.tokenlist.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
{
"$schema": "../../schemas/interchain-tokenlist.schema.json",
"version": {
"major": 0,
"minor": 1,
"patch": 0
},
"items": [
{
"tokenId": "0x42cf40c325b764af70ce0cef78ab550b212cb66a812e442e425630523b303785",
"tokenAddress": "0xD772a13cf187272e2A914aD90e06c47990014975",
"symbol": "tSUSHI",
"prettySymbol": "tSUSHI",
"decimals": 18,
"name": "Testnet Sushi Token",
"originChainId": "5",
"originAxelarChainId": "ethereum-2",
"transferType": "interchain_token",
"iconUrls": {
"svg": "https://raw.githubusercontent.com/axelarnetwork/public-chain-configs/images/tokens/sushi.svg"
},
"remoteTokens": [
{
"chainId": "80001",
"axelarChainId": "polygon",
"tokenAddress": "0xD772a13cf187272e2A914aD90e06c47990014975"
},
{
"chainId": "43113",
"axelarChainId": "avalance",
"tokenAddress": "0xD772a13cf187272e2A914aD90e06c47990014975"
},
{
"chainId": "97",
"axelarChainId": "binance",
"tokenAddress": "0xD772a13cf187272e2A914aD90e06c47990014975"
},
{
"chainId": "4002",
"axelarChainId": "fantom",
"tokenAddress": "0xD772a13cf187272e2A914aD90e06c47990014975"
},
{
"chainId": "1287",
"axelarChainId": "moonbeam",
"tokenAddress": "0xD772a13cf187272e2A914aD90e06c47990014975"
},
{
"chainId": "421613",
"axelarChainId": "arbitrum",
"tokenAddress": "0xD772a13cf187272e2A914aD90e06c47990014975"
},
{
"chainId": "84531",
"axelarChainId": "base",
"tokenAddress": "0xD772a13cf187272e2A914aD90e06c47990014975"
},
{
"chainId": "2221",
"axelarChainId": "kava",
"tokenAddress": "0xD772a13cf187272e2A914aD90e06c47990014975"
},
{
"chainId": "44787",
"axelarChainId": "celo",
"tokenAddress": "0xD772a13cf187272e2A914aD90e06c47990014975"
}
]
}
]
}
Loading

0 comments on commit 4c46604

Please sign in to comment.