Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: announcement banner on deposit withdraw screens #297

Merged
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 17 additions & 11 deletions .github/markets/pr_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ 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 `prelaunch_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). |
| `transfer_disabled_tokens` |`TransferDisabledTokens` |true |Object that contains tokens for which deposits and withdrawals are temporarily disabled | |
sarah-thong marked this conversation as resolved.
Show resolved Hide resolved
| `token_name_override_map` |`object` |true |Object that contains token denoms and their respective token name overrides. This is used if we need to override the full token name of the tokens listed here. |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). |
|`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`|
Expand All @@ -26,11 +25,11 @@ Each json file under the [configs](../../configs) folder correspond to their res
|`wswth_contract` |`string` |false |wSWTH ERC-20 contract. |
|`market_banners` |`MarketBanner[]` |true |market banner configs. |
| `native_token_contracts_map` | `object` | false | Map of token denoms to their respective contract addresses on the native chain. | |
| `native_depositor_contracts_map` | `object` | false | Map of axelar connection ids to their respective native depositor contract addresses
| `native_depositor_contracts_map` | `object` | false | Map of axelar connection ids to their respective native depositor contract addresses
|`market_promo` |`MarketPromo` |false |Map of Objects that contains market promo parameters for each market |If the `market_promo` property is omitted, no promo will be shown. The key of each entry is the ids of the market with existing promo. |
|`spot_pool_config` |`SpotPoolConfig` |false |Object that contains the config parameters for the [Spot Pools](https://app.dem.exchange/pools/spot) page on Demex |
|`quick_select_tokens` |`QuickSelectToken[]` |true |List of quick select tokens for deposit and withdrawal forms. |
kylehoang92 marked this conversation as resolved.
Show resolved Hide resolved

|`disabled_transfer_banner_config` |`DisabledTransferBannerConfig` |false |Config parameters for displaying banner to inform users that transfers for the relevant tokens are disabled |
## TransferDisabledTokens Data Structure
|Field |Type |Required |Description |Notes |
|---|---|---|---|---|
Expand Down Expand Up @@ -96,19 +95,19 @@ Each json file under the [configs](../../configs) folder correspond to their res
|---|---|---|---|---|
|`perp_pool_id` |`string` |true |Perp pool id where the banner will be shown. |Perp pool id **MUST** match one of the existing perp pool ids from the PerpPool PoolInfoAll RPC call.<br /><br /> To view the values of PoolInfoAll RPC call, simply run `yarn get-perp-pool-ids [network]` on the command line. Sample for mainnet: `yarn get-perp-pool-ids mainnet` |
|`show_from` |`string` |false |The date and time when the perp pool banner is scheduled to begin displaying. |If not provided, the banner will be shown immediately.<br /><br /> This field **MUST** follow the valid ISO 8601 format <br /> e.g. *2024-01-23T09:00+00:00* (23 Jan 2024, 9am UTC) |
|`show_until` |`string` |false |The date and time when the perp pool banner is scheduled to stop displaying. |If not provided, the banner will continue to display indefinitely.<br /><br /> This field **MUST** follow the valid ISO 8601 format <br /> e.g. *2024-01-23T09:00+00:00* (23 Jan 2024, 9am UTC) |
|`title` |`string` |true |The title shown on the perp pool banner. |
|`show_until` |`string` |false |The date and time when the perp pool banner is scheduled to stop displaying. |If not provided, the banner will continue to display indefinitely.<br /><br /> This field **MUST** follow the valid ISO 8601 format <br /> e.g. *2024-01-23T09:00+00:00* (23 Jan 2024, 9am UTC) |
|`title` |`string` |true |The title shown on the perp pool banner. |
|`removed_markets` |`string` |false |The message describing markets being removed, shown below the perp-pool banner title. | e.g. "BTCETH Perp will be removed on 6 Mar, 09:00AM UTC". If the field is omitted, no message describing markets being removed will be shown. |
|`added_markets` |`string` |false |The message describing markets being added, shown below the markets being removed (if any). | e.g. "ATOM Perp & SOL Perp will be added on 8 Mar, 12:00AM UTC". If the field is omitted, no message describing markets being added will be shown. |
|`subtext` |`string` |false |The subtext shown on the perp pool banner (below the removed and added market descriptions). |
|`added_markets` |`string` |false |The message describing markets being added, shown below the markets being removed (if any). | e.g. "ATOM Perp & SOL Perp will be added on 8 Mar, 12:00AM UTC". If the field is omitted, no message describing markets being added will be shown. |
|`subtext` |`string` |false |The subtext shown on the perp pool banner (below the removed and added market descriptions). |

## MarketBanner
|Field |Type |Required |Description |Notes |
|---|---|---|---|---|
|`market_id` |`string` |true |Market id where the banner will be shown. |Market id **MUST** match one of the existing market ids from the Market MarketAll RPC call.<br /><br /> To view the values of MarketAll RPC call, simply run `yarn get-market-ids [network]` on the command line. Sample for mainnet: `yarn get-market-ids mainnet` |
|`show_from` |`string` |false |The date and time when the market banner is scheduled to begin displaying. |If not provided, the banner will be shown immediately.<br /><br /> This field **MUST** follow the valid ISO 8601 format <br /> e.g. *2024-01-23T09:00+00:00* (23 Jan 2024, 9am UTC) |
|`show_until` |`string` |false |The date and time when the market banner is scheduled to stop displaying. |If not provided, the banner will continue to display indefinitely.<br /><br /> This field **MUST** follow the valid ISO 8601 format <br /> e.g. *2024-01-23T09:00+00:00* (23 Jan 2024, 9am UTC) |
|`content` |`string` |true |The content shown on the market banner. |
|`show_until` |`string` |false |The date and time when the market banner is scheduled to stop displaying. |If not provided, the banner will continue to display indefinitely.<br /><br /> This field **MUST** follow the valid ISO 8601 format <br /> e.g. *2024-01-23T09:00+00:00* (23 Jan 2024, 9am UTC) |
|`content` |`string` |true |The content shown on the market banner. |
|`hideable` |`boolean` |false |Indicates if user can hide the banner by clicking on the close button |If set to `false`, the close button will not be rendered on the banner, and user will not be able to dismiss the banner. |

## MarketPromo Data Structure
Expand All @@ -127,8 +126,8 @@ Each json file under the [configs](../../configs) folder correspond to their res
|Field |Type |Required |Description |Notes |
|---|---|---|---|---|
|`show_from` |`string` |false |The date and time when the market banner is scheduled to begin displaying. |If not provided, the banner will be shown immediately.<br /><br /> This field **MUST** follow the valid ISO 8601 format <br /> e.g. *2024-01-23T09:00+00:00* (23 Jan 2024, 9am UTC) |
|`show_until` |`string` |false |The date and time when the market banner is scheduled to stop displaying. |If not provided, the banner will continue to display indefinitely.<br /><br /> This field **MUST** follow the valid ISO 8601 format <br /> e.g. *2024-01-23T09:00+00:00* (23 Jan 2024, 9am UTC) |
|`content` |`string` |true |The content shown on the market banner. |
|`show_until` |`string` |false |The date and time when the market banner is scheduled to stop displaying. |If not provided, the banner will continue to display indefinitely.<br /><br /> This field **MUST** follow the valid ISO 8601 format <br /> e.g. *2024-01-23T09:00+00:00* (23 Jan 2024, 9am UTC) |
|`content` |`string` |true |The content shown on the market banner. |
|`hideable` |`boolean` |false |Indicates if user can hide the banner by clicking on the close button |If set to `false`, the close button will not be rendered on the banner, and user will not be able to dismiss the banner. |
|`show_only_on` |`string[]` |true |Default is empty list, then banner will be shown on all pages |If list has specified path(s), the banner will be shown on these/that path(s) only, sample: `['/rewards', '/nitron']` |

Expand All @@ -137,3 +136,10 @@ Each json file under the [configs](../../configs) folder correspond to their res
|---|---|---|---|---|
|`label_denom` |`string` |true |The default token will be show on UI deposit/withdrawal forms |
|`target_denom` |`string` |true |The default token will be use to transfer in deposit/withdrawal |

## DisabledTransferBannerConfig Data Structure
|Field |Type |Required |Description |Notes |
|---|---|---|---|---|
|`unsupported_tokens` |`string[]` |false |List of tokens that are no longer supported | 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) |
|`temp_disabled_transfer_tokens` |`object` |false |List of tokens for which deposits and withdrawals have been temporarily disabled | The token denoms listed in this object **MUST** match the token denoms listed under the Carbon [Tokens API](https://api.carbon.network/carbon/coin/v1/tokens?pagination.limit=10000) |
|`temp_disabled_bridges` |`object` |false |List of bridges for which deposits and withdrawals have been temporarily disabled | 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`` |
24 changes: 18 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,6 @@ More metadata will be added in the future if required by the Demex frontend. Ple
"blacklisted_token_2",
"blacklisted_token_3"
],
"transfer_disabled_tokens": [
"transfer_disabled_token_1",
"transfer_disabled_token_2",
"transfer_disabled_token_3"
],
"token_name_override_map": {
"token_1": "token_name_override_1",
"token_2": "token_name_override_2"
Expand Down Expand Up @@ -90,7 +85,7 @@ More metadata will be added in the future if required by the Demex frontend. Ple
"baseDenom": "denom_3",
"chainRoutes": ["blockchain_5", "blockchain_6"],
"denomOnCarbon": "carbon_denom_1"
}],
}],
"demex_trading_league_config": {
"promoMarkets": [
"promo_market_1",
Expand All @@ -99,6 +94,23 @@ More metadata will be added in the future if required by the Demex frontend. Ple
],
"currentPrizeSymbol": "market_symbol",
"currentCompPerpPoolId": 1
},
"disabled_transfer_banner_config": {
"unsupported_tokens": ["denom_1", "denom_2"],
"temp_disabled_transfer_tokens": {
"denom_1": {
"start": "",
"end": ""
}
},
"temp_disabled_bridges": {
"bridge_address_1": {
"start": "",
"end": ""
},
"src_channel": {}, // for ibcBridges
"connectionId": {} // for axelarBridges
}
}
}
```
73 changes: 49 additions & 24 deletions config.schema.json
kylehoang92 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"blacklisted_markets",
"blacklisted_pools",
"blacklisted_tokens",
"transfer_disabled_tokens",
"token_name_override_map",
"transfer_options",
"network_fees",
Expand Down Expand Up @@ -53,27 +52,6 @@
"$ref": "#/$defs/blacklisted_token"
}
},
"transfer_disabled_tokens": {
"type": "object",
"description": "Object containing tokens for which deposits and withdrawals have been temporarily disabled",
"required": ["deposit", "withdraw"],
"properties": {
"deposit": {
"type": "array",
"description": "List of tokens for which deposits have been temporarily disabled",
"items": {
"type": "string"
}
},
"withdraw": {
"type": "array",
"description": "List of tokens for which withdrawals have been temporarily disabled",
"items": {
"type": "string"
}
}
}
},
"token_name_override_map": {
"type": "object",
"description": "Object that contains token denoms and their respective token name overrides.",
Expand Down Expand Up @@ -388,12 +366,12 @@
},
"start": {
"type": "string",
"description": "The start time of perp pool promo",
"description": "The start time of the relevant program (in timestamp format)",
"pattern": "^\\d{4}(-\\d\\d(-\\d\\d(T\\d\\d:\\d\\d(:\\d\\d)?(\\.\\d+)?(([+-]\\d\\d:\\d\\d)|Z)?)?)?)?$"
},
"end": {
"type": "string",
"description": "The end time of perp pool promo",
"description": "The end time of the relevant program (in timestamp format)",
"pattern": "^\\d{4}(-\\d\\d(-\\d\\d(T\\d\\d:\\d\\d(:\\d\\d)?(\\.\\d+)?(([+-]\\d\\d:\\d\\d)|Z)?)?)?)?$"
},
"perpPoolDepositBoost": {
Expand Down Expand Up @@ -584,6 +562,53 @@
"items": {
"$ref": "#/$defs/quick_select_token"
}
},
"disabled_transfer_banner_config": {
"type": "object",
"description": "Config parameters for displaying banner to inform users that transfers for the relevant tokens are disabled",
"properties": {
"unsupported_tokens": {
"type": "array",
"description": "List of tokens are no longer supported",
"items": {
"type": "string"
}
},
"temp_disabled_transfer_tokens": {
"type": "object",
"description": "List of tokens for which deposits and withdrawals have been temporarily disabled",
"patternProperties": {
".*": {
"type": "object",
"properties": {
"start": {
"$ref": "#/$defs/start"
},
"end": {
"$ref": "#/$defs/end"
}
}
}
}
},
"temp_disabled_bridges": {
"type": "object",
"description": "List of bridges for which deposits and withdrawals have been temporarily disabled",
"patternProperties": {
".*": {
"type": "object",
"properties": {
"start": {
"$ref": "#/$defs/start"
},
"end": {
"$ref": "#/$defs/end"
}
}
}
}
sarah-thong marked this conversation as resolved.
Show resolved Hide resolved
}
}
}
}
}
6 changes: 1 addition & 5 deletions configs/devnet.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@
],
"blacklisted_pools": [],
"blacklisted_tokens": [],
"transfer_disabled_tokens": {
"deposit": [],
"withdraw": []
},
"token_name_override_map": {},
"transfer_options": {},
"network_fees": {
Expand Down Expand Up @@ -68,7 +64,7 @@
},
{
"label_denom": "dai",
"target_denom" : "dai"
"target_denom" : "dai"
}
]
}
26 changes: 0 additions & 26 deletions configs/mainnet.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,32 +17,6 @@
"usdc.1.6.e70e14",
"bit.1.2.9d68c4"
],
"transfer_disabled_tokens": {
"deposit": [
"nex.1.17.59c1ba",
"gmx.1.19.70275d",
"wbnb.1.6.ad598c",
"blur.1.2.0c0069",
"brdg/0b02ac3efc9df2e80d00f141133c180cdaee0122f92d3e2e310f704e82425a18",
"brdg/1768794901f8a19c2ec795a5402653cef6cbfe6b3ec6398d39fc37de963cb667",
"brdg/a8bbd91ae3dda9de2e50926a0d93be4d0d5cea34f3080014e5c0c0db6eaf61a4",
"bnb.1.6.773edb",
"zbnb.1.18.c406be",
"usdc.1.17.851a3a"
],
"withdraw": [
"nex.1.17.59c1ba",
"gmx.1.19.70275d",
"wbnb.1.6.ad598c",
"blur.1.2.0c0069",
"brdg/0b02ac3efc9df2e80d00f141133c180cdaee0122f92d3e2e310f704e82425a18",
"brdg/1768794901f8a19c2ec795a5402653cef6cbfe6b3ec6398d39fc37de963cb667",
"brdg/a8bbd91ae3dda9de2e50926a0d93be4d0d5cea34f3080014e5c0c0db6eaf61a4",
"bnb.1.6.773edb",
"zbnb.1.18.c406be",
"usdc.1.17.851a3a"
]
},
"token_name_override_map": {
"brdg/1299d2e94c483e72f64100088886b8a5b7c13595047e53e032c9938d07a98c20": "Ether (Arbitrum)",
"brdg/e3877e2c8ed05e404e04417747e2f430285c11dc839663b943b39ff7cbb56377": "Ether (Ethereum)"
Expand Down
4 changes: 0 additions & 4 deletions configs/testnet.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@
],
"blacklisted_pools": [],
"blacklisted_tokens": [],
"transfer_disabled_tokens": {
"deposit": [],
"withdraw": []
},
"token_name_override_map": {},
"transfer_options": {},
"network_fees": {
Expand Down
Loading
Loading