diff --git a/modules/bitgo/src/v2/coinFactory.ts b/modules/bitgo/src/v2/coinFactory.ts index ae11d8158e..0f2c815457 100644 --- a/modules/bitgo/src/v2/coinFactory.ts +++ b/modules/bitgo/src/v2/coinFactory.ts @@ -1020,6 +1020,16 @@ export function getTokenConstructor(tokenConfig: TokenConfig): CoinConstructor | case 'ton': case 'tton': return JettonToken.createTokenConstructor(tokenConfig as JettonTokenConfig); + case 'mon': + case 'tmon': { + const coinNames = { Mainnet: 'mon', Testnet: 'tmon' }; + return EthLikeErc20Token.createTokenConstructor(tokenConfig as EthLikeTokenConfig, coinNames); + } + case 'xdc': + case 'txdc': { + const coinNames = { Mainnet: 'xdc', Testnet: 'txdc' }; + return EthLikeErc20Token.createTokenConstructor(tokenConfig as EthLikeTokenConfig, coinNames); + } default: return undefined; } diff --git a/modules/statics/src/allCoinsAndTokens.ts b/modules/statics/src/allCoinsAndTokens.ts index 9404d99b17..18c617a2be 100644 --- a/modules/statics/src/allCoinsAndTokens.ts +++ b/modules/statics/src/allCoinsAndTokens.ts @@ -2534,6 +2534,65 @@ export const allCoinsAndTokens = [ UnderlyingAsset['baseeth:wbrly'], Networks.main.basechain ), + + // XDC mainnet tokens + erc20Token( + 'b820932d-5772-49ae-a055-a59760f3e4cf', + 'xdc:usdc', + 'USD Coin', + 6, + '0xfa2958cb79b0491cc627c1557f441ef849ca8eb1', + UnderlyingAsset['xdc:usdc'], + Networks.main.xdc + ), + erc20Token( + '8914a1bd-1495-46df-84da-445c6d49edb2', + 'xdc:lbt', + 'Law Block Token', + 18, + '0x05940b2df33d6371201e7ae099ced4c363855dfe', + UnderlyingAsset['xdc:lbt'], + Networks.main.xdc + ), + erc20Token( + 'f03302de-b06b-4ddc-94a2-ad7e89896725', + 'xdc:gama', + 'Gama Token', + 18, + '0x3a170c7c987f55c84f28733bfa27962d8cdd5d3b', + UnderlyingAsset['xdc:gama'], + Networks.main.xdc + ), + erc20Token( + 'bdf602ea-3a6c-407a-8afd-33d6c04a8bc3', + 'xdc:srx', + 'STORX', + 18, + '0x5d5f074837f5d4618b3916ba74de1bf9662a3fed', + UnderlyingAsset['xdc:srx'], + Networks.main.xdc + ), + erc20Token( + 'd42c9497-0987-497d-97f2-8b19c539e350', + 'xdc:weth', + 'Wrapped Ether', + 18, + '0xa7348290de5cf01772479c48d50dec791c3fc212', + UnderlyingAsset['xdc:weth'], + Networks.main.xdc + ), + + // MON mainnet tokens + erc20Token( + '5f15df50-7409-45b8-a7a8-00294a113fcb', + 'mon:wmon', + 'Wrapped MON', + 18, + '0x3bd359c1119da7da1d913d1c4d2b7c461115433a', + UnderlyingAsset['mon:wmon'], + Networks.main.mon + ), + hederaCoin( '98aad956-27ee-45dd-aa43-6a23c9a1d1d0', 'hbar', diff --git a/modules/statics/src/base.ts b/modules/statics/src/base.ts index 2c7b5ec5a5..d478353f46 100644 --- a/modules/statics/src/base.ts +++ b/modules/statics/src/base.ts @@ -2865,6 +2865,17 @@ export enum UnderlyingAsset { 'flow:usdf' = 'flow:usdf', 'flow:wflow' = 'flow:wflow', + // Monad mainnet tokens + 'mon:usdc' = 'mon:usdc', + 'mon:wmon' = 'mon:wmon', + + // XDC mainnet tokens + 'xdc:usdc' = 'xdc:usdc', + 'xdc:lbt' = 'xdc:lbt', + 'xdc:gama' = 'xdc:gama', + 'xdc:srx' = 'xdc:srx', + 'xdc:weth' = 'xdc:weth', + // Arbitrum testnet tokens 'tarbeth:link' = 'tarbeth:link', 'tarbeth:xsgd' = 'tarbeth:xsgd', diff --git a/modules/statics/src/coinFeatures.ts b/modules/statics/src/coinFeatures.ts index 8dad83b0d5..8469517e77 100644 --- a/modules/statics/src/coinFeatures.ts +++ b/modules/statics/src/coinFeatures.ts @@ -657,7 +657,11 @@ export const VET_TOKEN_FEATURES = VET_FEATURES.filter((feature) => feature !== C export const EVM_NON_EIP1559_FEATURES = [...EVM_FEATURES.filter((feature) => feature !== CoinFeature.EIP1559)]; -export const XDC_FEATURES = [...EVM_NON_EIP1559_FEATURES, CoinFeature.ERC20_BULK_TRANSACTION]; +export const XDC_FEATURES = [ + ...EVM_NON_EIP1559_FEATURES, + CoinFeature.ERC20_BULK_TRANSACTION, + CoinFeature.SUPPORTS_ERC20, +]; export const SGB_FEATURES = [...EVM_FEATURES, CoinFeature.ERC20_BULK_TRANSACTION]; diff --git a/modules/statics/src/coins.ts b/modules/statics/src/coins.ts index b3ce3533d7..af0ebb04e0 100644 --- a/modules/statics/src/coins.ts +++ b/modules/statics/src/coins.ts @@ -58,6 +58,8 @@ export function createToken(token: AmsTokenConfig): Readonly | undefin flow: erc20Token, lineaeth: erc20Token, seievm: erc20Token, + mon: erc20Token, + xdc: erc20Token, bsc: bscToken, celo: celoToken, cosmos: cosmosToken, @@ -121,6 +123,8 @@ export function createToken(token: AmsTokenConfig): Readonly | undefin case 'flow': case 'lineaeth': case 'seievm': + case 'mon': + case 'xdc': case 'celo': case 'eth': case 'opeth': diff --git a/modules/statics/src/tokenConfig.ts b/modules/statics/src/tokenConfig.ts index 4ca194f27e..65140bc873 100644 --- a/modules/statics/src/tokenConfig.ts +++ b/modules/statics/src/tokenConfig.ts @@ -266,6 +266,12 @@ export interface Tokens { bera: { tokens: EthLikeTokenConfig[]; }; + mon: { + tokens: EthLikeTokenConfig[]; + }; + xdc: { + tokens: EthLikeTokenConfig[]; + }; apt: { tokens: AptTokenConfig[]; nftCollections: AptNFTCollectionConfig[]; @@ -307,6 +313,12 @@ export interface Tokens { bsc: { tokens: EthLikeTokenConfig[]; }; + mon: { + tokens: EthLikeTokenConfig[]; + }; + xdc: { + tokens: EthLikeTokenConfig[]; + }; eos: { tokens: EosTokenConfig[]; }; @@ -756,6 +768,43 @@ const getFormattedSeievmTokens = (customCoinMap = coins) => return acc; }, []); +function getMonadTokenConfig(coin: EthLikeERC20Token): EthLikeTokenConfig { + return { + type: coin.name, + coin: coin.network.type === NetworkType.MAINNET ? 'mon' : 'tmon', + network: coin.network.type === NetworkType.MAINNET ? 'Mainnet' : 'Testnet', + name: coin.fullName, + tokenContractAddress: coin.contractAddress.toString().toLowerCase(), + decimalPlaces: coin.decimalPlaces, + }; +} +const getFormattedMonadTokens = (customCoinMap = coins) => + customCoinMap.reduce((acc: EthLikeTokenConfig[], coin) => { + if (coin instanceof EthLikeERC20Token && (coin.name.includes('mon:') || coin.name.includes('tmon:'))) { + acc.push(getMonadTokenConfig(coin)); + } + return acc; + }, []); + +function getXdcTokenConfig(coin: EthLikeERC20Token): EthLikeTokenConfig { + return { + type: coin.name, + coin: coin.network.type === NetworkType.MAINNET ? 'xdc' : 'txdc', + network: coin.network.type === NetworkType.MAINNET ? 'Mainnet' : 'Testnet', + name: coin.fullName, + tokenContractAddress: coin.contractAddress.toString().toLowerCase(), + decimalPlaces: coin.decimalPlaces, + }; +} + +const getFormattedXdcTokens = (customCoinMap = coins) => + customCoinMap.reduce((acc: EthLikeTokenConfig[], coin) => { + if (coin instanceof EthLikeERC20Token && (coin.name.includes('xdc:') || coin.name.includes('txdc:'))) { + acc.push(getXdcTokenConfig(coin)); + } + return acc; + }, []); + function getFlowTokenConfig(coin: EthLikeERC20Token): EthLikeTokenConfig { return { type: coin.name, @@ -1258,6 +1307,12 @@ export const getFormattedTokens = (coinMap = coins): Tokens => { flow: { tokens: getFormattedFlowTokens(coinMap).filter((token) => token.network === 'Mainnet'), }, + mon: { + tokens: getFormattedMonadTokens(coinMap).filter((token) => token.network === 'Mainnet'), + }, + xdc: { + tokens: getFormattedXdcTokens(coinMap).filter((token) => token.network === 'Mainnet'), + }, lineaeth: { tokens: getFormattedLineaethTokens(coinMap).filter((token) => token.network === 'Mainnet'), }, @@ -1377,6 +1432,12 @@ export const getFormattedTokens = (coinMap = coins): Tokens => { flow: { tokens: getFormattedFlowTokens(coinMap).filter((token) => token.network === 'Testnet'), }, + mon: { + tokens: getFormattedMonadTokens(coinMap).filter((token) => token.network === 'Testnet'), + }, + xdc: { + tokens: getFormattedXdcTokens(coinMap).filter((token) => token.network === 'Testnet'), + }, lineaeth: { tokens: getFormattedLineaethTokens(coinMap).filter((token) => token.network === 'Testnet'), },