From d4b1929f6b364f304db757c238a07bdc15e6c8ce Mon Sep 17 00:00:00 2001 From: Nelson Taveras <4562733+nvtaveras@users.noreply.github.com> Date: Wed, 6 Mar 2024 22:01:51 +0100 Subject: [PATCH] feat: add native USDC to Baklava --- src/config/exchanges.ts | 25 +++++++++++++++++++ src/config/tokens.ts | 18 +++++++++---- src/images/tokens/TokenIcon.tsx | 10 +++++--- src/images/tokens/USDC.svg | 6 ++++- src/images/tokens/{EUROC.svg => axlEUROC.svg} | 0 src/images/tokens/axlUSDC.svg | 1 + 6 files changed, 50 insertions(+), 10 deletions(-) rename src/images/tokens/{EUROC.svg => axlEUROC.svg} (100%) create mode 100644 src/images/tokens/axlUSDC.svg diff --git a/src/config/exchanges.ts b/src/config/exchanges.ts index bc96c5d..e028e0f 100644 --- a/src/config/exchanges.ts +++ b/src/config/exchanges.ts @@ -154,7 +154,32 @@ export const BaklavaExchanges: Exchange[] = [ '0x6f90ac394b1F45290d3023e4Ba0203005cAF2A4B', ], }, + { + providerAddr: '0xFF9a3da00F42839CD6D33AD7adf50bCc97B41411', + id: '0xd8573fd7c4151f38cde9b2349a26a6bb03be4b3791105bc625731ad2d71c54ba', + assets: [ + '0x62492A644A588FD904270BeD06ad52B9abfEA1aE', + '0xB407D37d76c417B6343310D42611FCA106B2abB8', + ], + }, + { + providerAddr: '0xFF9a3da00F42839CD6D33AD7adf50bCc97B41411', + id: '0x3839dd748e34fa87f5cd928e10d3e0ecafd9230ac9932c6cb2b0d5a358b72618', + assets: [ + '0xf9ecE301247aD2CE21894941830A2470f4E774ca', + '0xB407D37d76c417B6343310D42611FCA106B2abB8', + ], + }, + { + providerAddr: '0xFF9a3da00F42839CD6D33AD7adf50bCc97B41411', + id: '0xbfd96ed0ed5098d2b2bff8b9d8423dc47001fccf2391ee6e532618ef79c12075', + assets: [ + '0x6a0EEf2bed4C30Dc2CB42fe6c5f01F80f7EF16d1', + '0xB407D37d76c417B6343310D42611FCA106B2abB8', + ], + }, ] + export const CeloExchanges: Exchange[] = [ { providerAddr: '0x22d9db95E6Ae61c104A7B6F6C78D7993B94ec901', diff --git a/src/config/tokens.ts b/src/config/tokens.ts index d47d703..ed05149 100644 --- a/src/config/tokens.ts +++ b/src/config/tokens.ts @@ -20,6 +20,7 @@ export enum TokenId { cUSD = 'cUSD', cEUR = 'cEUR', cREAL = 'cREAL', + USDC = 'USDC', axlUSDC = 'axlUSDC', axlEUROC = 'axlEUROC', eXOF = 'eXOF', @@ -57,6 +58,13 @@ export const cREAL: Token = Object.freeze({ color: Color.celoGreen, decimals: 18, }) +export const USDC: Token = Object.freeze({ + id: TokenId.USDC, + symbol: TokenId.USDC, + name: 'USDC', + color: Color.usdcBlue, + decimals: 6, +}) export const axlUSDC: Token = Object.freeze({ id: TokenId.axlUSDC, symbol: TokenId.axlUSDC, @@ -76,7 +84,7 @@ export const eXOF: Token = Object.freeze({ id: TokenId.eXOF, symbol: TokenId.eXOF, name: 'eXOF', - color: Color.usdcBlue, // TODO: Change to EUROC + color: Color.usdcBlue, decimals: 18, }) @@ -85,6 +93,7 @@ export const Tokens: Record = { cUSD, cEUR, cREAL, + USDC, axlUSDC, axlEUROC, eXOF, @@ -96,6 +105,7 @@ export const TokenAddresses: Record> = Object. [TokenId.cUSD]: '0x874069Fa1Eb16D44d622F2e0Ca25eeA172369bC1', [TokenId.cEUR]: '0x10c892A6EC43a53E45D0B916B4b7D383B1b78C0F', [TokenId.cREAL]: '0xE4D517785D091D3c54818832dB6094bcc2744545', + [TokenId.USDC]: '', [TokenId.axlUSDC]: '0x87D61dA3d668797786D73BC674F053f87111570d', [TokenId.axlEUROC]: '0x6e673502c5b55F3169657C004e5797fFE5be6653', [TokenId.eXOF]: '0xB0FA15e002516d0301884059c0aaC0F0C72b019D', @@ -105,6 +115,7 @@ export const TokenAddresses: Record> = Object. [TokenId.cUSD]: '0x62492A644A588FD904270BeD06ad52B9abfEA1aE', [TokenId.cEUR]: '0xf9ecE301247aD2CE21894941830A2470f4E774ca', [TokenId.cREAL]: '0x6a0EEf2bed4C30Dc2CB42fe6c5f01F80f7EF16d1', + [TokenId.USDC]: '0xB407D37d76c417B6343310D42611FCA106B2abB8', [TokenId.axlUSDC]: '0xD4079B322c392D6b196f90AA4c439fC2C16d6770', [TokenId.axlEUROC]: '0x6f90ac394b1F45290d3023e4Ba0203005cAF2A4B', [TokenId.eXOF]: '0x64c1D812673E93Bc036AdC3D547d9950696DA5Af', @@ -114,16 +125,13 @@ export const TokenAddresses: Record> = Object. [TokenId.cUSD]: '0x765DE816845861e75A25fCA122bb6898B8B1282a', [TokenId.cEUR]: '0xD8763CBa276a3738E6DE85b4b3bF5FDed6D6cA73', [TokenId.cREAL]: '0xe8537a3d056DA446677B9E9d6c5dB704EaAb4787', + [TokenId.USDC]: '', [TokenId.axlUSDC]: '0xEB466342C4d449BC9f53A865D5Cb90586f405215', [TokenId.axlEUROC]: '0x061cc5a2C863E0C1Cb404006D559dB18A34C762d', [TokenId.eXOF]: '0x73F93dcc49cB8A239e2032663e9475dd5ef29A08', }, }) -export function isUSDCVariant(tokenId: string) { - return USDCVariantIds.includes(tokenId as TokenId) -} - export function isNativeToken(tokenId: string) { return Object.keys(Tokens).includes(tokenId) } diff --git a/src/images/tokens/TokenIcon.tsx b/src/images/tokens/TokenIcon.tsx index 04295df..944ad6a 100644 --- a/src/images/tokens/TokenIcon.tsx +++ b/src/images/tokens/TokenIcon.tsx @@ -1,9 +1,10 @@ import Image from 'next/image' import { memo } from 'react' -import { Token, TokenId, isUSDCVariant } from 'src/config/tokens' +import { Token, TokenId } from 'src/config/tokens' import CeloIcon from 'src/images/tokens/CELO.svg' -import EUROCIcon from 'src/images/tokens/EUROC.svg' import USDCIcon from 'src/images/tokens/USDC.svg' +import axlEUROCIcon from 'src/images/tokens/axlEUROC.svg' +import axlUSDCIcon from 'src/images/tokens/axlUSDC.svg' import cEURIcon from 'src/images/tokens/cEUR.svg' import cREALIcon from 'src/images/tokens/cREAL.svg' import cUSDIcon from 'src/images/tokens/cUSD.svg' @@ -34,8 +35,9 @@ function _TokenIcon({ token, size = 'm' }: Props) { else if (token?.id === TokenId.cUSD) imgSrc = cUSDIcon else if (token?.id === TokenId.cEUR) imgSrc = cEURIcon else if (token?.id === TokenId.cREAL) imgSrc = cREALIcon - else if (isUSDCVariant(token?.id)) imgSrc = USDCIcon - else if (token?.id === TokenId.axlEUROC) imgSrc = EUROCIcon + else if (token?.id === TokenId.USDC) imgSrc = USDCIcon + else if (token?.id === TokenId.axlUSDC) imgSrc = axlUSDCIcon + else if (token?.id === TokenId.axlEUROC) imgSrc = axlEUROCIcon else if (token?.id === TokenId.eXOF) imgSrc = eXOFIcon if (imgSrc) { diff --git a/src/images/tokens/USDC.svg b/src/images/tokens/USDC.svg index 14f4677..5dfea92 100644 --- a/src/images/tokens/USDC.svg +++ b/src/images/tokens/USDC.svg @@ -1 +1,5 @@ - \ No newline at end of file + + + + + diff --git a/src/images/tokens/EUROC.svg b/src/images/tokens/axlEUROC.svg similarity index 100% rename from src/images/tokens/EUROC.svg rename to src/images/tokens/axlEUROC.svg diff --git a/src/images/tokens/axlUSDC.svg b/src/images/tokens/axlUSDC.svg new file mode 100644 index 0000000..14f4677 --- /dev/null +++ b/src/images/tokens/axlUSDC.svg @@ -0,0 +1 @@ + \ No newline at end of file