diff --git a/packages/shared/src/config/networkIds.ts b/packages/shared/src/config/networkIds.ts index 8fd93e3b463..907db143b17 100644 --- a/packages/shared/src/config/networkIds.ts +++ b/packages/shared/src/config/networkIds.ts @@ -11,6 +11,7 @@ export type INetworkShortCode = | 'onekeyall' | 'eth' | 'goerli' + | 'xodex' | 'arbitrum' | 'optimism' | 'avalanche' diff --git a/packages/shared/src/config/presetNetworks.ts b/packages/shared/src/config/presetNetworks.ts index bcc8511e8e8..80ab1521199 100644 --- a/packages/shared/src/config/presetNetworks.ts +++ b/packages/shared/src/config/presetNetworks.ts @@ -144,6 +144,86 @@ const sepolia: IServerNetwork = { 'updatedAt': '2023-05-31T00:29:24.951Z', }; +const xodexTestnet: IServerNetwork = { + 'balance2FeeDecimals': 9, + 'chainId': '2416', + 'code': 'xodex', + 'decimals': 18, + 'extensions': { + 'providerOptions': { + 'EIP1559Enabled': true, + 'preferMetamask': true, + }, + }, + 'id': 'evm--2416', + 'impl': 'evm', + 'isTestnet': true, + 'logoURI': + 'https://i.postimg.cc/XqDnc4g2/XODEX-Avatar-02-2-copy.png', + 'name': 'Xodex Testnet', + 'shortcode': 'xodex', + 'shortname': 'Xodex', + 'symbol': 'XODEX', + 'feeMeta': { + 'code': 'xodex', + 'decimals': 9, + 'symbol': 'Gwei', + }, + 'defaultEnabled': false, + 'priceConfigs': [], + 'explorers': [ + { + 'address': 'https://explorer.xo-dex.com/address/{address}', + 'block': 'https://explorer.xo-dex.com/block/{block}', + 'name': 'https://explorer.xo-dex.com/', + 'transaction': 'https://explorer.xo-dex.com/tx/{transaction}', + }, + ], + 'status': ENetworkStatus.LISTED, + 'createdAt': '2023-05-31T00:29:24.951Z', + 'updatedAt': '2023-05-31T00:29:24.951Z', +}; + +const xodex: IServerNetwork = { + 'balance2FeeDecimals': 9, + 'chainId': '2415', + 'code': 'xodex', + 'decimals': 18, + 'extensions': { + 'providerOptions': { + 'EIP1559Enabled': true, + 'preferMetamask': true, + }, + }, + 'id': 'evm--2415', + 'impl': 'evm', + 'isTestnet': false, + 'logoURI': + 'https://i.postimg.cc/XqDnc4g2/XODEX-Avatar-02-2-copy.png', + 'name': 'Xodex', + 'shortcode': 'xodex', + 'shortname': 'Xodex', + 'symbol': 'XODEX', + 'feeMeta': { + 'code': 'xodex', + 'decimals': 9, + 'symbol': 'Gwei', + }, + 'defaultEnabled': false, + 'priceConfigs': [], + 'explorers': [ + { + 'address': 'https://explorer.xo-dex.com/address/{address}', + 'block': 'https://explorer.xo-dex.com/block/{block}', + 'name': 'https://explorer.xo-dex.com/', + 'transaction': 'https://explorer.xo-dex.com/tx/{transaction}', + }, + ], + 'status': ENetworkStatus.LISTED, + 'createdAt': '2023-05-31T00:29:24.951Z', + 'updatedAt': '2023-05-31T00:29:24.951Z', +}; + const btc: IServerNetwork = { 'balance2FeeDecimals': 0, 'chainId': '0', @@ -2993,6 +3073,8 @@ export const presetNetworksMap = { // evm eth, sepolia, + xodex, + xodexTestnet, op, xdai, ethw, @@ -3069,6 +3151,8 @@ export const getPresetNetworks = memoFn((): IServerNetwork[] => [ // evm eth, sepolia, + xodex, + xodexTestnet, op, xdai, ethw, diff --git a/packages/shared/types/swap/SwapProvider.constants.ts b/packages/shared/types/swap/SwapProvider.constants.ts index a96196a6f5f..00b4ba84bc8 100644 --- a/packages/shared/types/swap/SwapProvider.constants.ts +++ b/packages/shared/types/swap/SwapProvider.constants.ts @@ -268,6 +268,29 @@ export const swapDefaultSetTokens: Record< 'isNative': false, }, }, + 'evm--2415': { + fromToken: { + 'networkId': 'evm--2415', + 'contractAddress': '', + 'name': 'Xodex', + 'symbol': 'xodex', + 'decimals': 18, + 'logoURI': + 'https://i.postimg.cc/XqDnc4g2/XODEX-Avatar-02-2-copy.png', + + 'isNative': true, + }, + toToken: { + 'networkId': 'evm--2415', + 'contractAddress': '0x04068da6c83afcfa0e13ba15a6696662335d5b75', + 'name': 'USD Coin', + 'symbol': 'USDC', + 'decimals': 6, + 'logoURI': + 'https://uni-test.onekey-asset.com/server-service-onchain/evm--250/tokens/0x04068da6c83afcfa0e13ba15a6696662335d5b75.png', + 'isNative': false, + }, + }, 'evm--324': { fromToken: { 'networkId': 'evm--324',