From 2178bf4ae16a09ac6543776f6eb85760ea396327 Mon Sep 17 00:00:00 2001 From: Dmitry S Date: Sun, 23 Jul 2023 17:10:01 +0200 Subject: [PATCH] Add BUSD token for BSC --- internal/service/blockchain/currencies.json | 14 ++++++++++++++ ui-dashboard/src/assets/icons/crypto/busd.svg | 12 ++++++++++++ .../src/pages/balance-page/balance-page.tsx | 11 +++-------- ui-dashboard/src/types/index.ts | 8 ++++++-- ui-payment/src/assets/icons/crypto/busd.svg | 12 ++++++++++++ 5 files changed, 47 insertions(+), 10 deletions(-) create mode 100644 ui-dashboard/src/assets/icons/crypto/busd.svg create mode 100644 ui-payment/src/assets/icons/crypto/busd.svg diff --git a/internal/service/blockchain/currencies.json b/internal/service/blockchain/currencies.json index 14d6971..90ed399 100644 --- a/internal/service/blockchain/currencies.json +++ b/internal/service/blockchain/currencies.json @@ -121,6 +121,20 @@ "type": "token", "name": "USDT", "tokenAddress": "0x55d398326f99059fF775485246999027B3197955", + "testTokenAddress": "0x337610d27c682E347C9cD60BD4b3b107C9d34dDd", + "decimals": "18", + "networkId": "56", + "testNetworkId": "97", + "minimal_withdrawal_amount_usd": "10", + "minimal_instant_internal_transfer_amount_usd": "30" + }, + { + "blockchain": "BSC", + "blockchainName": "BNB Chain", + "ticker": "BSC_BUSD", + "type": "token", + "name": "BUSD", + "tokenAddress": "0xe9e7CEA3DedcA5984780Bafc599bD69ADd087D56", "testTokenAddress": "0xed24fc36d5ee211ea25a80239fb8c4cfd80f12ee", "decimals": "18", "networkId": "56", diff --git a/ui-dashboard/src/assets/icons/crypto/busd.svg b/ui-dashboard/src/assets/icons/crypto/busd.svg new file mode 100644 index 0000000..9d3224c --- /dev/null +++ b/ui-dashboard/src/assets/icons/crypto/busd.svg @@ -0,0 +1,12 @@ + + + + + + + + + + diff --git a/ui-dashboard/src/pages/balance-page/balance-page.tsx b/ui-dashboard/src/pages/balance-page/balance-page.tsx index c3e81c1..ce21378 100644 --- a/ui-dashboard/src/pages/balance-page/balance-page.tsx +++ b/ui-dashboard/src/pages/balance-page/balance-page.tsx @@ -39,15 +39,10 @@ const BalancePage: React.FC = () => { const {merchantId} = useSharedMerchantId(); const renderIconName = (name: string) => { - if (name.length < 4) { - return name; - } - - if (name.slice(-4) == "usdt") { - return "usdt"; - } + // ETH or ETH_USDT => "eth" or "usdt" + const lowered = name.toLowerCase(); - return name; + return lowered.includes("_") ? lowered.split("_")[1] : lowered; }; const balancesColumns: ColumnsType = [ diff --git a/ui-dashboard/src/types/index.ts b/ui-dashboard/src/types/index.ts index 3b67533..f70c892 100644 --- a/ui-dashboard/src/types/index.ts +++ b/ui-dashboard/src/types/index.ts @@ -27,7 +27,9 @@ const BLOCKCHAIN_TICKER = [ "MATIC_USDC", "TRON", "TRON_USDT", - "BNB" + "BNB", + "BSC_USDT", + "BSC_BUSD" ] as const; type BlockchainTicker = typeof BLOCKCHAIN_TICKER[number]; @@ -98,7 +100,9 @@ const CURRENCY_SYMBOL: Record = { MATIC_USDC: "", TRON: "", TRON_USDT: "", - BNB: "" + BNB: "", + BSC_USDT: "", + BSC_BUSD: "" }; type PaymentType = "payment" | "withdrawal"; diff --git a/ui-payment/src/assets/icons/crypto/busd.svg b/ui-payment/src/assets/icons/crypto/busd.svg new file mode 100644 index 0000000..9d3224c --- /dev/null +++ b/ui-payment/src/assets/icons/crypto/busd.svg @@ -0,0 +1,12 @@ + + + + + + + + + +