From a5a443538b2a866c75343a839f9b7e7d0294318c Mon Sep 17 00:00:00 2001 From: itskongz Date: Fri, 2 Aug 2024 10:49:27 -0400 Subject: [PATCH 1/4] xodex support --- packages/shared/src/config/presetNetworks.ts | 42 ++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/packages/shared/src/config/presetNetworks.ts b/packages/shared/src/config/presetNetworks.ts index bcc8511e8e8..f0708edffd7 100644 --- a/packages/shared/src/config/presetNetworks.ts +++ b/packages/shared/src/config/presetNetworks.ts @@ -144,6 +144,47 @@ const sepolia: IServerNetwork = { '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': true, + 'logoURI': + 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQjoVCQUqDp2FfBoQm4e0dLqP4u1wMCTgyVdw&s', + 'name': 'Xodex', + 'shortcode': 'xodex', + 'shortname': 'Xodex', + 'symbol': 'TETH', + 'feeMeta': { + 'code': 'sepolia', + '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', @@ -2995,6 +3036,7 @@ export const presetNetworksMap = { sepolia, op, xdai, + xodex, ethw, cfxespace, aurora, From 0c9f92c13cdccea77cda06c4cc512ca58a912d9a Mon Sep 17 00:00:00 2001 From: itskongz Date: Wed, 7 Aug 2024 19:10:52 -0400 Subject: [PATCH 2/4] add xodex testnet & update logo --- packages/shared/src/config/presetNetworks.ts | 62 ++++++++++++++++---- 1 file changed, 52 insertions(+), 10 deletions(-) diff --git a/packages/shared/src/config/presetNetworks.ts b/packages/shared/src/config/presetNetworks.ts index f0708edffd7..80ab1521199 100644 --- a/packages/shared/src/config/presetNetworks.ts +++ b/packages/shared/src/config/presetNetworks.ts @@ -144,6 +144,46 @@ 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', @@ -157,15 +197,15 @@ const xodex: IServerNetwork = { }, 'id': 'evm--2415', 'impl': 'evm', - 'isTestnet': true, + 'isTestnet': false, 'logoURI': - 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQjoVCQUqDp2FfBoQm4e0dLqP4u1wMCTgyVdw&s', + 'https://i.postimg.cc/XqDnc4g2/XODEX-Avatar-02-2-copy.png', 'name': 'Xodex', 'shortcode': 'xodex', 'shortname': 'Xodex', - 'symbol': 'TETH', + 'symbol': 'XODEX', 'feeMeta': { - 'code': 'sepolia', + 'code': 'xodex', 'decimals': 9, 'symbol': 'Gwei', }, @@ -173,10 +213,10 @@ const xodex: IServerNetwork = { '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}', + '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, @@ -184,7 +224,6 @@ const xodex: IServerNetwork = { 'updatedAt': '2023-05-31T00:29:24.951Z', }; - const btc: IServerNetwork = { 'balance2FeeDecimals': 0, 'chainId': '0', @@ -3034,9 +3073,10 @@ export const presetNetworksMap = { // evm eth, sepolia, + xodex, + xodexTestnet, op, xdai, - xodex, ethw, cfxespace, aurora, @@ -3111,6 +3151,8 @@ export const getPresetNetworks = memoFn((): IServerNetwork[] => [ // evm eth, sepolia, + xodex, + xodexTestnet, op, xdai, ethw, From e25a348c064822f6ed7240b85567d1e2aa6765a3 Mon Sep 17 00:00:00 2001 From: itskongz Date: Wed, 7 Aug 2024 20:04:16 -0400 Subject: [PATCH 3/4] add xodex short code --- packages/shared/src/config/networkIds.ts | 1 + 1 file changed, 1 insertion(+) 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' From 28ecf5563e7cd7db97f924e51ac5cc457d1b2726 Mon Sep 17 00:00:00 2001 From: itskongz Date: Thu, 8 Aug 2024 08:24:43 -0400 Subject: [PATCH 4/4] add swap network --- .../types/swap/SwapProvider.constants.ts | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) 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',