Skip to content

Commit

Permalink
Remove ibc_tokens_total_supply config (#49)
Browse files Browse the repository at this point in the history
* Remove ibc_tokens_total_supply config

* Resolve code comments

* Set node version in github actions workflow

* Add node-gyp as per instructions on github workflow actions

* Add ignore-engines flag for node-gyp add command

* Upgrade carbon-js-sdk

* Set python version to v2.7

* Remove gyp install

* Set node version to 18 on github job

* Set node version to v18

* Rewrite github actions commands

* Remove remnants of ibc supply map + formatting

* Remove ellipsis symbols

---------

Co-authored-by: Thong Yuan Yu Sarah <[email protected]>
  • Loading branch information
kimberlybp and sarah-thong authored Oct 26, 2023
1 parent ee45ae4 commit 1f5ea01
Show file tree
Hide file tree
Showing 12 changed files with 254 additions and 478 deletions.
7 changes: 0 additions & 7 deletions .github/markets/pr_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,5 @@ Each json file under the [configs](../../configs) folder correspond to their res
|`blacklisted_markets` |`string[]` |true |The array of market names that are blacklisted. A market can be blacklisted for a number of reasons, such as it being invalid/duplicate/wrongly-added/etc. |The market names listed here **MUST** match the market names listed under the Carbon [Markets API](https://api.carbon.network/carbon/market/v1/markets?pagination.limit=10000). The market names listed here **CANNOT** be under the `featured_markets` field at the same time. |
|`blacklisted_pools` |`string[]` |true |The array of pool ids that are blacklisted. A pool can be blacklisted for a number of reasons, such as it being invalid/duplicate/wrongly-added/etc. |The pool ids listed here **MUST** match the pool ids listed under the Carbon [Liquidity Pool API](https://api.carbon.network/carbon/liquiditypool/v1/pools?pagination.limit=10000). |
|`blacklisted_tokens` |`string[]` |true |The array of token denoms that are blacklisted. A token can be blacklisted for a number of reasons, such as it being invalid/deprecated/etc. |The token denoms listed here **MUST** match the token denoms listed under the Carbon [Tokens API](https://api.carbon.network/carbon/coin/v1/tokens?pagination.limit=10000). |
|`ibc_tokens_total_supply` |`IBCTotalSuppply[]` |true |The array of IBC fee token denoms with their respective total supply on Coingecko. |Please refer to the [IBC total supply data structure](#ibc-total-supply-data-structure) for the data to include in each `IBCTotalSuppply` object |
|`transfer_options` |`object` |true |A collection of blockchain networks along with their associated priority numbers, used to establish their order in the transfer options list for deposit and withdrawal forms. |Blockchain network listed here **MUST** match the valid chainName of the bridges listed under BridgeAll RPC call.<br /><br /> To view the values of BridgeAll RPC call, simply run `yarn get-bridges [network]` on the command line. Sample for mainnet: `yarn get-bridges mainnet`|
|`network_fees` |`object` |true |List of token denoms along with their associated priority numbers, used to establish their default order in the network fees preference list. |Token denoms listed here **MUST** match the valid denoms listed under MinGasPriceAll RPC call.<br /><br /> To view the values of MinGasPriceAll RPC call, simply run `yarn get-min-gas-prices [network]` on the command line. Sample for mainnet: `yarn get-min-gas-prices mainnet`|

## IBC total supply Data Structure
|Field |Type |Required |Description |Notes |
|---|---|---|---|---|
|`denom` |`string` |true |Denom of IBC fee token on Carbon |This denom **MUST** match the token denoms listed under the Carbon [Tokens API](https://api.carbon.network/carbon/coin/v1/tokens?pagination.limit=10000). |
|`amount` |`string` |true |The total supply amount of the IBC fee token on Coingecko |This value is auto-generated by the script update_ibc_total_supply.ts. To update, simply run `yarn update-total-supply` on the command line and push the updates to a new branch. |
17 changes: 8 additions & 9 deletions .github/workflows/market-config-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,17 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set Node-js version
uses: actions/setup-node@v3
with:
node-version: '18.14.2'

- name: Install Dependencies
uses: borales/[email protected]
with:
cmd: install --ignore-engines # will run `yarn install` command
run: yarn install --ignore-engines # will run `yarn install` command

- name: Validate featured markets schema
uses: borales/[email protected]
with:
cmd: validate # validate using json schema
run: yarn validate # validate using json schema

- name: Test market entries for invalid/duplicate markets
uses: borales/[email protected]
with:
cmd: check-configs mainnet testnet devnet # check using check_configs.ts script
run: yarn check-configs mainnet testnet devnet # check using check_configs.ts script
78 changes: 32 additions & 46 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,57 +8,43 @@ Currently, each JSON file contain the following data on its corresponding networ
- blacklisted markets
- blacklisted pools
- blacklisted tokens
- total supply of IBC fee tokens on Mintscan
- default blockchain transfer option order in deposit/withdrawal forms dropdown
- default network token fee order

More metadata will be added in the future if required by the Demex frontend. Please see below the structure of the JSON file:

```
```json
{
"network": "testnet",
"featured_markets": [
"market_1",
"market_2",
"market_3",
...
],
"blacklisted_markets": [
"blacklisted_market_1",
"blacklisted_market_2",
"blacklisted_market_3",
...
],
"blacklisted_pools": [
"blacklisted_pool_1",
"blacklisted_pool_2",
"blacklisted_pool_3",
...
],
"blacklisted_tokens": [
"blacklisted_token_1",
"blacklisted_token_2",
"blacklisted_token_3",
...
],
"": [{
denom: "ibc-token-denom-1",
amount: "1000000",
}, {
denom: "ibc-token-denom-2",
amount: "1000000000",
}],
"transfer_options": {
"chain_1": 0,
"chain_2": 1,
"chain_3": 2,
...
},
"network_fees": {
"token_denom_1": 0,
"token_denom_2": 1,
"token_denom_3": 2,
...
}
"network": "testnet",
"featured_markets": [
"market_1",
"market_2",
"market_3"
],
"blacklisted_markets": [
"blacklisted_market_1",
"blacklisted_market_2",
"blacklisted_market_3"
],
"blacklisted_pools": [
"blacklisted_pool_1",
"blacklisted_pool_2",
"blacklisted_pool_3"
],
"blacklisted_tokens": [
"blacklisted_token_1",
"blacklisted_token_2",
"blacklisted_token_3"
],
"transfer_options": {
"chain_1": 0,
"chain_2": 1,
"chain_3": 2
},
"network_fees": {
"token_denom_1": 0,
"token_denom_2": 1,
"token_denom_3": 2
}
}
```
191 changes: 83 additions & 108 deletions config.schema.json
Original file line number Diff line number Diff line change
@@ -1,114 +1,89 @@
{
"title": "Demex Webapp Config",
"description": "demex-webapp-config is a repository to allow frontends to fetch metadata associated with Demex",
"type": "object",
"required": [
"network",
"featured_markets",
"blacklisted_markets",
"blacklisted_pools",
"blacklisted_tokens",
"ibc_tokens_total_supply"
],
"properties": {
"network": {
"type": "string",
"enum": [
"mainnet",
"testnet",
"devnet"
]
},
"featured_markets": {
"type": "array",
"items": {
"$ref": "#/$defs/featured_market"
}
},
"blacklisted_markets": {
"type": "array",
"description": "List of blacklisted market names",
"items": {
"$ref": "#/$defs/blacklisted_market"
}
},
"blacklisted_pools": {
"type": "array",
"description": "List of blacklisted pool ids",
"items": {
"$ref": "#/$defs/blacklisted_pool"
}
},
"blacklisted_tokens": {
"type": "array",
"description": "List of blacklisted token denoms",
"items": {
"$ref": "#/$defs/blacklisted_token"
}
},
"ibc_tokens_total_supply": {
"type": "array",
"description": "List of ibc denoms with their respective total supply on Coingecko",
"items": {
"$ref": "#/$defs/ibc_total_supply"
}
},
"transfer_options": {
"type": "object",
"description": "List of blockchain networks and their priority numbers, used to set their order in deposit and withdrawal forms transfer option dropdown",
"patternProperties": {
".*": {
"type": "integer"
}
},
"additionalProperties": false
},
"network_fees": {
"type": "object",
"description": "List of token denoms and their priority numbers, used to set their order in network fee preferences",
"patternProperties": {
".*": {
"type": "integer"
}
},
"additionalProperties": false
"title": "Demex Webapp Config",
"description": "demex-webapp-config is a repository to allow frontends to fetch metadata associated with Demex",
"type": "object",
"required": [
"network",
"featured_markets",
"blacklisted_markets",
"blacklisted_pools",
"blacklisted_tokens",
"transfer_options",
"network_fees"
],
"properties": {
"network": {
"type": "string",
"enum": [
"mainnet",
"testnet",
"devnet"
]
},
"featured_markets": {
"type": "array",
"items": {
"$ref": "#/$defs/featured_market"
}
},
"blacklisted_markets": {
"type": "array",
"description": "List of blacklisted market names",
"items": {
"$ref": "#/$defs/blacklisted_market"
}
},
"blacklisted_pools": {
"type": "array",
"description": "List of blacklisted pool ids",
"items": {
"$ref": "#/$defs/blacklisted_pool"
}
},
"blacklisted_tokens": {
"type": "array",
"description": "List of blacklisted token denoms",
"items": {
"$ref": "#/$defs/blacklisted_token"
}
},
"transfer_options": {
"type": "object",
"description": "List of blockchain networks and their priority numbers, used to set their order in deposit and withdrawal forms transfer option dropdown",
"patternProperties": {
".*": {
"type": "integer"
}
},
"additionalProperties": false
},
"$defs": {
"featured_market": {
"type": "string"
},
"blacklisted_market": {
"type": "string",
"description": "Blacklisted market name"
},
"blacklisted_pool": {
"type": "string",
"description": "Blacklisted pool id (type: string)",
"pattern": "^\\d+$"
},
"blacklisted_token": {
"type": "string",
"description": "Blacklisted token denom"
},
"ibc_total_supply": {
"type": "object",
"description": "Total supply amount of each IBC token listed here",
"required": [
"denom",
"amount"
],
"properties": {
"denom": {
"type": "string",
"description": "Denom of IBC token on Carbon (e.g. ibc/07FA7831E1920D0C87C9388F86B0108677F6ED0C9DE7E4063F05ED675192405C => STARS)"
},
"amount": {
"type": "string",
"description": "total supply of each IBC token on Coingecko",
"pattern": "^\\d+$"
}
}
"network_fees": {
"type": "object",
"description": "List of token denoms and their priority numbers, used to set their order in network fee preferences",
"patternProperties": {
".*": {
"type": "integer"
}
},
"additionalProperties": false
}
},
"$defs": {
"featured_market": {
"type": "string"
},
"blacklisted_market": {
"type": "string",
"description": "Blacklisted market name"
},
"blacklisted_pool": {
"type": "string",
"description": "Blacklisted pool id (type: string)",
"pattern": "^\\d+$"
},
"blacklisted_token": {
"type": "string",
"description": "Blacklisted token denom"
}
}
}
29 changes: 14 additions & 15 deletions configs/devnet.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
{
"network": "devnet",
"featured_markets": [],
"blacklisted_markets": [
"swth_btc2"
],
"blacklisted_pools": [],
"blacklisted_tokens": [],
"ibc_tokens_total_supply": [],
"transfer_options": {},
"network_fees": {
"swth": 0,
"usdc": 1,
"eth": 2
}
}
"network": "devnet",
"featured_markets": [],
"blacklisted_markets": [
"swth_btc2"
],
"blacklisted_pools": [],
"blacklisted_tokens": [],
"transfer_options": {},
"network_fees": {
"swth": 0,
"usdc": 1,
"eth": 2
}
}
Loading

0 comments on commit 1f5ea01

Please sign in to comment.