From a588aab7bec4de49edcb1c61f3819d9117b67958 Mon Sep 17 00:00:00 2001 From: myf <> Date: Mon, 13 Jun 2022 12:57:37 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=87=E6=8D=A2=E5=9C=B0=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 12 +- .env.production | 12 +- src/config/constants/contracts.ts | 24 ++++ src/config/constants/networks.ts | 4 +- src/config/constants/tokens.ts | 121 ++++++++++++++++++ src/config/constants/types.ts | 1 + src/hooks/Tokens.ts | 2 +- src/views/BlindBox/component/SeriesDetail.tsx | 49 +++---- src/views/BlindBox/component/ShopList.tsx | 33 ++--- 9 files changed, 209 insertions(+), 49 deletions(-) diff --git a/.env.development b/.env.development index 7de0eab..328bc1a 100644 --- a/.env.development +++ b/.env.development @@ -1,14 +1,18 @@ -REACT_APP_CHAIN_ID = "97" +# REACT_APP_CHAIN_ID = "97" +REACT_APP_CHAIN_ID = "5" REACT_APP_GTAG = "GTM-PXLD3XW" # 10+ nodes balanced, US/EU -REACT_APP_NODE_1 = "https://data-seed-prebsc-1-s1.binance.org:8545" +# REACT_APP_NODE_1 = "https://data-seed-prebsc-1-s1.binance.org:8545" +REACT_APP_NODE_1 = "https://goerli.infura.io/v3/9aa3d95b3bc440fa88ea12eaa4456161" # 10+ nodes balanced, US/EU -REACT_APP_NODE_2 = "https://data-seed-prebsc-1-s1.binance.org:8545" +# REACT_APP_NODE_2 = "https://data-seed-prebsc-1-s1.binance.org:8545" +REACT_APP_NODE_2 = "https://goerli.infura.io/v3/9aa3d95b3bc440fa88ea12eaa4456161" # 10+ nodes balanced in each region, global -REACT_APP_NODE_3 = "https://data-seed-prebsc-1-s1.binance.org:8545" +# REACT_APP_NODE_3 = "https://data-seed-prebsc-1-s1.binance.org:8545" +REACT_APP_NODE_3 = "https://goerli.infura.io/v3/9aa3d95b3bc440fa88ea12eaa4456161" REACT_APP_GRAPH_API_PROFILE = "https://api.thegraph.com/subgraphs/name/pancakeswap/profile" REACT_APP_GRAPH_API_PREDICTION = "https://api.thegraph.com/subgraphs/name/pancakeswap/prediction" diff --git a/.env.production b/.env.production index b9fa4d6..0a77afd 100644 --- a/.env.production +++ b/.env.production @@ -1,14 +1,18 @@ -REACT_APP_CHAIN_ID = "97" +# REACT_APP_CHAIN_ID = "97" +REACT_APP_CHAIN_ID = "5" REACT_APP_GTAG = "GTM-PXLD3XW" # 10+ nodes balanced, US/EU -REACT_APP_NODE_1 = "https://data-seed-prebsc-1-s1.binance.org:8545" +# REACT_APP_NODE_1 = "https://data-seed-prebsc-1-s1.binance.org:8545" +REACT_APP_NODE_1 = "https://goerli.infura.io/v3/9aa3d95b3bc440fa88ea12eaa4456161" # 10+ nodes balanced, US/EU -REACT_APP_NODE_2 = "https://data-seed-prebsc-1-s1.binance.org:8545" +# REACT_APP_NODE_2 = "https://data-seed-prebsc-1-s1.binance.org:8545" +REACT_APP_NODE_2 = "https://goerli.infura.io/v3/9aa3d95b3bc440fa88ea12eaa4456161" # 10+ nodes balanced in each region, global -REACT_APP_NODE_3 = "https://data-seed-prebsc-1-s1.binance.org:8545" +# REACT_APP_NODE_3 = "https://data-seed-prebsc-1-s1.binance.org:8545" +REACT_APP_NODE_3 = "https://goerli.infura.io/v3/9aa3d95b3bc440fa88ea12eaa4456161" REACT_APP_GRAPH_API_PROFILE = "https://api.thegraph.com/subgraphs/name/pancakeswap/profile" REACT_APP_GRAPH_API_PREDICTION = "https://api.thegraph.com/subgraphs/name/pancakeswap/prediction" diff --git a/src/config/constants/contracts.ts b/src/config/constants/contracts.ts index 081051f..20b0088 100644 --- a/src/config/constants/contracts.ts +++ b/src/config/constants/contracts.ts @@ -2,97 +2,121 @@ export default { masterChef: { 97: '0x1d32c2945C8FDCBc7156c553B7cEa4325a17f4f9', 56: '0x73feaa1eE314F8c655E354234017bE2193C9E24E', + 5: '0x1d32c2945C8FDCBc7156c553B7cEa4325a17f4f9', }, sousChef: { 97: '0xd3af5fe61dbaf8f73149bfcfa9fb653ff096029a', 56: '0x6ab8463a4185b80905e05a9ff80a2d6b714b9e95', + 5: '0xd3af5fe61dbaf8f73149bfcfa9fb653ff096029a', }, boardChef: { 97: '0x82ab2659c3de15f48cd67f12668dca514b44070f', 56: '0x82ab2659c3de15f48cd67f12668dca514b44070f', // NEED CHANGE 节点董事会合约 + 5: '0x82ab2659c3de15f48cd67f12668dca514b44070f', }, boardRewardChef: { 97: '0x44a7b703a90b87e54abff5ae0861e917c828d062', 56: '0x44a7b703a90b87e54abff5ae0861e917c828d062', // NEED CHANGE 节点董事会分红合约 + 5: '0x44a7b703a90b87e54abff5ae0861e917c828d062', }, holderChef: { 97: '0xe3031f378f201dca46361a34e3fd12e50bdd202f', 56: '0xe3031f378f201dca46361a34e3fd12e50bdd202f', // NEED CHANGE 持币人 + 5: '0xe3031f378f201dca46361a34e3fd12e50bdd202f', }, holderRewardChef: { 97: '0x9ee1c805a9508c0799b157ebbe3108d57c8d8588', 56: '0x9ee1c805a9508c0799b157ebbe3108d57c8d8588', // NEED CHANGE 持币人分红 + 5: '0x9ee1c805a9508c0799b157ebbe3108d57c8d8588', }, referralChef: { 97: '0x0866962d208e91ea8804db3f547cccf22fe39ea7', 56: '0x0866962d208e91ea8804db3f547cccf22fe39ea7', // NEED CHANGE 邀请或则军团长 + 5: '0x0866962d208e91ea8804db3f547cccf22fe39ea7', }, referralRewardChef: { 97: '0x0fb12ffe4b38730b80c26f44fa540eabfd03a30e', 56: '0x0fb12ffe4b38730b80c26f44fa540eabfd03a30e', // NEED CHANGE 邀请或则军团长收益 + 5: '0x0fb12ffe4b38730b80c26f44fa540eabfd03a30e', }, idoPurchase: { 97: '0x2f562A9fE0325501A6Aa92cd9e2081B026fC35aa', 56: '0x2f562A9fE0325501A6Aa92cd9e2081B026fC35aa', // NEED CHANGE IDO兑换 + 5: '0x2f562A9fE0325501A6Aa92cd9e2081B026fC35aa', }, lotteryV2: { 97: '0x5790c3534F30437641541a0FA04C992799602998', 56: '0x5aF6D33DE2ccEC94efb1bDF8f92Bd58085432d2c', + 5: '0x5790c3534F30437641541a0FA04C992799602998', }, multiCall: { 56: '0xfF6FD90A470Aaa0c1B8A54681746b07AcdFedc9B', 97: '0x8F3273Fb89B075b1645095ABaC6ed17B2d4Bc576', + 5: '0xfF6FD90A470Aaa0c1B8A54681746b07AcdFedc9B', }, pancakeProfile: { 56: '0xDf4dBf6536201370F95e06A0F8a7a70fE40E388a', 97: '0x4B683C7E13B6d5D7fd1FeA9530F451954c1A7c8A', + 5: '0x4B683C7E13B6d5D7fd1FeA9530F451954c1A7c8A', }, pancakeRabbits: { 56: '0xDf7952B35f24aCF7fC0487D01c8d5690a60DBa07', 97: '0x60935F36e4631F73f0f407e68642144e07aC7f5E', + 5: '0x60935F36e4631F73f0f407e68642144e07aC7f5E', }, bunnyFactory: { 56: '0xfa249Caa1D16f75fa159F7DFBAc0cC5EaB48CeFf', 97: '0x707CBF373175fdB601D34eeBF2Cf665d08f01148', + 5: '0x707CBF373175fdB601D34eeBF2Cf665d08f01148', }, claimRefund: { 56: '0xE7e53A7e9E3Cf6b840f167eF69519175c497e149', 97: '', + 5: '', }, pointCenterIfo: { 56: '0x3C6919b132462C1FEc572c6300E83191f4F0012a', 97: '0xd2Ac1B1728Bb1C11ae02AB6e75B76Ae41A2997e3', + 5: '0xd2Ac1B1728Bb1C11ae02AB6e75B76Ae41A2997e3', }, bunnySpecial: { 56: '0xFee8A195570a18461146F401d6033f5ab3380849', 97: '0x7b7b1583De1DeB32Ce6605F6deEbF24A0671c17C', + 5: '0x7b7b1583De1DeB32Ce6605F6deEbF24A0671c17C', }, tradingCompetition: { 56: '0xd718baa0B1F4f70dcC8458154042120FFE0DEFFA', 97: '0xC787F45B833721ED3aC46E99b703B3E1E01abb97', + 5: '0xC787F45B833721ED3aC46E99b703B3E1E01abb97', }, easterNft: { 56: '0x23c41D28A239dDCAABd1bb1deF8d057189510066', 97: '0x24ec6962dbe874F6B67B5C50857565667fA0854F', + 5: '0x24ec6962dbe874F6B67B5C50857565667fA0854F', }, cakeVault: { 56: '0xa80240Eb5d7E05d3F250cF000eEc0891d00b51CC', 97: '', + 5: '', }, predictions: { 56: '0x516ffd7D1e0Ca40b1879935B2De87cb20Fc1124b', 97: '0x4f3140C74789F1D809420343ea83BcE52B7bbAA5', + 5: '0x4f3140C74789F1D809420343ea83BcE52B7bbAA5', }, chainlinkOracle: { 56: '0x0567F2323251f0Aab15c8dFb1967E4e8A7D42aeE', 97: '', + 5: '', }, bunnySpecialCakeVault: { 56: '0x5B4a770Abe7Eafb2601CA4dF9d73EA99363E60a4', 97: '', + 5: '', }, bunnySpecialPrediction: { 56: '0x342c99e9aC24157657095eC69CB04b73257e7A9C', 97: '', + 5: '', }, } diff --git a/src/config/constants/networks.ts b/src/config/constants/networks.ts index f042a93..ed407ea 100644 --- a/src/config/constants/networks.ts +++ b/src/config/constants/networks.ts @@ -2,7 +2,9 @@ import { ChainId } from '@pancakeswap/sdk' const NETWORK_URLS: { [chainId in ChainId]: string } = { [ChainId.MAINNET]: 'https://bsc-dataseed1.defibit.io', - [ChainId.TESTNET]: 'https://data-seed-prebsc-1-s1.binance.org:8545', + // [ChainId.TESTNET]: 'https://data-seed-prebsc-1-s1.binance.org:8545', + + [ChainId.TESTNET]: 'https://goerli.infura.io/v3/9aa3d95b3bc440fa88ea12eaa4456161', } export default NETWORK_URLS diff --git a/src/config/constants/tokens.ts b/src/config/constants/tokens.ts index 790884e..7060b20 100644 --- a/src/config/constants/tokens.ts +++ b/src/config/constants/tokens.ts @@ -65,6 +65,7 @@ const tokens = { address: { 56: '0x55d398326f99059fF775485246999027B3197955', 97: '0xaC893B498E2005Af4cb8b03D710F187EC23a8f5f', + 5: '0xac893b498e2005af4cb8b03d710f187ec23a8f5f', }, decimals: 18, projectLink: 'https://tether.to/', @@ -74,6 +75,7 @@ const tokens = { address: { 56: '0x20de22029ab63cf9A7Cf5fEB2b737Ca1eE4c82A6', 97: '0x5554c56e94bf07a85206dfeb584c7cb7f7d21227', + 5: '0x71d239b4564dc00d994abf6e6cd7582dd873649e', }, decimals: 18, projectLink: 'https://tranchess.com/', @@ -88,6 +90,7 @@ const tokens = { address: { 56: '0x0E09FaBB73Bd3Ade0a17ECC321fD13a19e81cE82', 97: '0xa35062141Fa33BCA92Ce69FeD37D0E8908868AAe', + 5: '0xa35062141Fa33BCA92Ce69FeD37D0E8908868AAe', }, decimals: 18, projectLink: 'https://pancakeswap.finance/', @@ -97,6 +100,7 @@ const tokens = { address: { 56: '0x20de22029ab63cf9A7Cf5fEB2b737Ca1eE4c82A6', 97: '', + 5: '', }, decimals: 18, projectLink: 'https://tranchess.com/', @@ -106,6 +110,7 @@ const tokens = { address: { 56: '0xe898EDc43920F357A93083F1d4460437dE6dAeC2', 97: '', + 5: '', }, decimals: 18, projectLink: 'https://titanswap.org', @@ -115,6 +120,7 @@ const tokens = { address: { 56: '0x03fF0ff224f904be3118461335064bB48Df47938', 97: '', + 5: '', }, decimals: 18, projectLink: 'https://www.harmony.one/', @@ -124,6 +130,7 @@ const tokens = { address: { 56: '0x2eD9a5C8C13b93955103B9a7C167B67Ef4d568a3', 97: '', + 5: '', }, decimals: 18, projectLink: 'https://mask.io/', @@ -133,6 +140,7 @@ const tokens = { address: { 56: '0x758FB037A375F17c7e195CC634D77dA4F554255B', 97: '', + 5: '', }, decimals: 18, projectLink: 'https://dvision.network/', @@ -142,6 +150,7 @@ const tokens = { address: { 56: '0x6bfF4Fb161347ad7de4A625AE5aa3A1CA7077819', 97: '', + 5: '', }, decimals: 18, projectLink: 'https://www.adex.network', @@ -151,6 +160,7 @@ const tokens = { address: { 56: '0x5A3010d4d8D3B5fB49f8B6E57FB9E48063f16700', 97: '', + 5: '', }, decimals: 18, projectLink: 'https://bscpad.com/', @@ -160,6 +170,7 @@ const tokens = { address: { 56: '0x95a1199EBA84ac5f19546519e287d43D2F0E1b41', 97: '', + 5: '', }, decimals: 18, projectLink: 'https://rabbitfinance.io/earn', @@ -169,6 +180,7 @@ const tokens = { address: { 56: '0x25A528af62e56512A19ce8c3cAB427807c28CC19', 97: '', + 5: '', }, decimals: 18, projectLink: 'https://formation.fi/', @@ -178,6 +190,7 @@ const tokens = { address: { 56: '0x1FFD0b47127fdd4097E54521C9E2c7f0D66AafC5', 97: '', + 5: '', }, decimals: 18, projectLink: 'https://tixl.org/', @@ -187,6 +200,7 @@ const tokens = { address: { 56: '0xeBd49b26169e1b52c04cFd19FCf289405dF55F80', 97: '', + 5: '', }, decimals: 18, projectLink: 'https://www.orbs.com/', @@ -196,6 +210,7 @@ const tokens = { address: { 56: '0x96Dd399F9c3AFda1F194182F71600F1B65946501', 97: '', + 5: '', }, decimals: 18, projectLink: 'https://www.contentos.io/', @@ -205,6 +220,7 @@ const tokens = { address: { 56: '0xC9849E6fdB743d08fAeE3E34dd2D1bc69EA11a51', 97: '', + 5: '', }, decimals: 18, projectLink: 'https://pancakebunny.finance/', @@ -214,6 +230,7 @@ const tokens = { address: { 56: '0xAC51066d7bEC65Dc4589368da368b212745d63E8', 97: '', + 5: '', }, decimals: 6, projectLink: 'https://www.myneighboralice.com/', @@ -223,6 +240,7 @@ const tokens = { address: { 56: '0x658A109C5900BC6d2357c87549B651670E5b0539', 97: '', + 5: '', }, decimals: 18, projectLink: 'https://www.for.tube/home', @@ -232,6 +250,7 @@ const tokens = { address: { 56: '0x211FfbE424b90e25a15531ca322adF1559779E45', 97: '', + 5: '', }, decimals: 18, projectLink: 'https://getbux.com/bux-crypto/', @@ -241,6 +260,7 @@ const tokens = { address: { 56: '0x8CD6e29d3686d24d3C2018CEe54621eA0f89313B', 97: '', + 5: '', }, decimals: 8, projectLink: 'https://www.nuls.io/', @@ -250,6 +270,7 @@ const tokens = { address: { 56: '0xE0e514c71282b6f4e823703a39374Cf58dc3eA4f', 97: '', + 5: '', }, decimals: 18, projectLink: 'https://beta.belt.fi/', @@ -259,6 +280,7 @@ const tokens = { address: { 56: '0x8519EA49c997f50cefFa444d240fB655e89248Aa', 97: '', + 5: '', }, decimals: 18, projectLink: 'https://rampdefi.com/', @@ -268,6 +290,7 @@ const tokens = { address: { 56: '0x81859801b01764D4f0Fa5E64729f5a6C3b91435b', 97: '', + 5: '', }, decimals: 18, projectLink: 'https://bearn.fi/', @@ -277,6 +300,7 @@ const tokens = { address: { 56: '0x039cB485212f996A9DBb85A9a75d898F94d38dA6', 97: '', + 5: '', }, decimals: 18, projectLink: 'https://dexe.network/', @@ -286,6 +310,7 @@ const tokens = { address: { 56: '0x8443f091997f06a61670B735ED92734F5628692F', 97: '', + 5: '', }, decimals: 18, projectLink: 'https://bella.fi/', @@ -295,6 +320,7 @@ const tokens = { address: { 56: '0xECa41281c24451168a37211F0bc2b8645AF45092', 97: '', + 5: '', }, decimals: 4, projectLink: 'https://www.tokenpocket.pro/', @@ -304,6 +330,7 @@ const tokens = { address: { 56: '0x7A9f28EB62C791422Aa23CeAE1dA9C847cBeC9b0', 97: '', + 5: '', }, decimals: 18, projectLink: 'https://yieldwatch.net/', @@ -313,6 +340,7 @@ const tokens = { address: { 56: '0x26A5dFab467d4f58fB266648CAe769503CEC9580', 97: '', + 5: '', }, decimals: 9, projectLink: 'https://benchmarkprotocol.finance/', @@ -322,6 +350,7 @@ const tokens = { address: { 56: '0x4131b87F74415190425ccD873048C708F8005823', 97: '', + 5: '', }, decimals: 18, projectLink: 'https://multiplier.finance/', @@ -331,6 +360,7 @@ const tokens = { address: { 56: '0x9678E42ceBEb63F23197D726B29b1CB20d0064E5', 97: '', + 5: '', }, decimals: 18, projectLink: 'https://iotex.io/', @@ -340,6 +370,7 @@ const tokens = { address: { 56: '0x92D7756c60dcfD4c689290E8A9F4d263b3b32241', 97: '', + 5: '', }, decimals: 18, projectLink: 'https://www.boringdao.com/', @@ -349,6 +380,7 @@ const tokens = { address: { 56: '0xF35262a9d427F96d2437379eF090db986eaE5d42', 97: '', + 5: '', }, decimals: 18, projectLink: 'https://opendao.io/', @@ -358,6 +390,7 @@ const tokens = { address: { 56: '0x67ee3Cb086F8a16f34beE3ca72FAD36F7Db929e2', 97: '', + 5: '', }, decimals: 18, projectLink: 'https://dodoex.io/', @@ -980,6 +1013,7 @@ const tokens = { address: { 56: '0xBf5140A22578168FD562DCcF235E5D43A02ce9B1', 97: '0xE02dF9e3e622DeBdD69fb838bB799E3F168902c5', + 5: '0xE02dF9e3e622DeBdD69fb838bB799E3F168902c5', }, decimals: 18, projectLink: 'https://uniswap.org/', @@ -989,6 +1023,7 @@ const tokens = { address: { 56: '0x0D8Ce2A99Bb6e3B7Db580eD848240e4a0F9aE153', 97: '0xE02dF9e3e622DeBdD69fb838bB799E3F168902c5', + 5: '0xE02dF9e3e622DeBdD69fb838bB799E3F168902c5', }, decimals: 18, projectLink: 'https://filecoin.io/', @@ -998,6 +1033,7 @@ const tokens = { address: { 56: '0xE02dF9e3e622DeBdD69fb838bB799E3F168902c5', 97: '', + 5: '', }, decimals: 18, projectLink: 'https://www.bakeryswap.org/', @@ -1007,6 +1043,7 @@ const tokens = { address: { 56: '0xAe9269f27437f0fcBC232d39Ec814844a51d6b8f', 97: '0xE02dF9e3e622DeBdD69fb838bB799E3F168902c5', + 5: '0xE02dF9e3e622DeBdD69fb838bB799E3F168902c5', }, decimals: 18, projectLink: 'https://burgerswap.org/', @@ -1016,6 +1053,7 @@ const tokens = { address: { 56: '0x5986D5c77c65e5801a5cAa4fAE80089f870A71dA', 97: '', + 5: '', }, decimals: 18, projectLink: 'https://badger.finance/', @@ -1025,6 +1063,7 @@ const tokens = { address: { 56: '0x1F7216fdB338247512Ec99715587bb97BBf96eae', 97: '', + 5: '', }, decimals: 18, projectLink: 'https://badger.finance/', @@ -1034,6 +1073,7 @@ const tokens = { address: { 56: '0x7af173F350D916358AF3e218Bdf2178494Beb748', 97: '', + 5: '', }, decimals: 18, projectLink: 'https://unitrade.app/', @@ -1043,6 +1083,7 @@ const tokens = { address: { 56: '0xdaacB0Ab6Fb34d24E8a67BfA14BF4D95D4C7aF92', 97: '', + 5: '', }, decimals: 18, projectLink: 'https://ptokens.io/', @@ -1052,6 +1093,7 @@ const tokens = { address: { 56: '0x5B6DcF557E2aBE2323c48445E8CC948910d8c2c9', 97: '', + 5: '', }, decimals: 18, projectLink: 'https://mirror.finance/', @@ -1061,6 +1103,7 @@ const tokens = { address: { 56: '0xeD28A457A5A76596ac48d87C0f577020F6Ea1c4C', 97: '', + 5: '', }, decimals: 18, projectLink: 'https://ptokens.io/', @@ -1070,6 +1113,7 @@ const tokens = { address: { 56: '0x857B222Fc79e1cBBf8Ca5f78CB133d1b7CF34BBd', 97: '', + 5: '', }, decimals: 18, projectLink: 'https://ltonetwork.com/', @@ -1079,6 +1123,7 @@ const tokens = { address: { 56: '0xbcf39F0EDDa668C58371E519AF37CA705f2bFcbd', 97: '', + 5: '', }, decimals: 18, projectLink: 'https://game.seascape.network/', @@ -1088,6 +1133,7 @@ const tokens = { address: { 56: '0xb86AbCb37C3A4B64f74f59301AFF131a1BEcC787', 97: '', + 5: '', }, decimals: 12, projectLink: 'https://www.zilliqa.com/', @@ -1097,6 +1143,7 @@ const tokens = { address: { 56: '0x5d684ADaf3FcFe9CFb5ceDe3abf02F0Cdd1012E3', 97: '', + 5: '', }, decimals: 8, projectLink: 'https://lien.finance/', @@ -1106,6 +1153,7 @@ const tokens = { address: { 56: '0x250b211EE44459dAd5Cd3bCa803dD6a7EcB5d46C', 97: '', + 5: '', }, decimals: 8, projectLink: 'https://switcheo.network/', @@ -1115,6 +1163,7 @@ const tokens = { address: { 56: '0x42712dF5009c20fee340B245b510c0395896cF6e', 97: '', + 5: '', }, decimals: 18, projectLink: 'https://www.dfuture.com/home', @@ -1124,6 +1173,7 @@ const tokens = { address: { 56: '0xc53708664b99DF348dd27C3Ac0759d2DA9c40462', 97: '', + 5: '', }, decimals: 18, projectLink: 'https://gourmetgalaxy.io/', @@ -1133,6 +1183,7 @@ const tokens = { address: { 56: '0x3FdA9383A84C05eC8f7630Fe10AdF1fAC13241CC', 97: '', + 5: '', }, decimals: 18, projectLink: 'https://bsc.dego.finance/home', @@ -1142,6 +1193,7 @@ const tokens = { address: { 56: '0x42F6f551ae042cBe50C739158b4f0CAC0Edb9096', 97: '', + 5: '', }, decimals: 18, projectLink: 'https://nerve.fi/', @@ -1151,6 +1203,7 @@ const tokens = { address: { 56: '0x7C17c8bED8d14bAccE824D020f994F4880D6Ab3B', 97: '', + 5: '', }, decimals: 18, projectLink: 'https://easyfi.network/', @@ -1160,6 +1213,7 @@ const tokens = { address: { 56: '0xCD40F2670CF58720b694968698A5514e924F742d', 97: '', + 5: '', }, decimals: 18, projectLink: 'https://oddz.fi/', @@ -1169,6 +1223,7 @@ const tokens = { address: { 56: '0xE1d1F66215998786110Ba0102ef558b22224C016', 97: '', + 5: '', }, decimals: 8, projectLink: 'https://hoo.com/', @@ -1178,6 +1233,7 @@ const tokens = { address: { 56: '0x37dfACfaeDA801437Ff648A1559d73f4C40aAcb7', 97: '', + 5: '', }, decimals: 18, projectLink: 'https://apyswap.com/', @@ -1187,6 +1243,7 @@ const tokens = { address: { 56: '0x96058f8C3e16576D9BD68766f3836d9A33158f89', 97: '', + 5: '', }, decimals: 18, projectLink: 'https://www.bondly.finance/', @@ -1196,6 +1253,7 @@ const tokens = { address: { 56: '0x9f589e3eabe42ebC94A44727b3f3531C0c877809', 97: '', + 5: '', }, decimals: 18, projectLink: 'https://www.tokocrypto.com/', @@ -1205,6 +1263,7 @@ const tokens = { address: { 56: '0x04C747b40Be4D535fC83D09939fb0f626F32800B', 97: '', + 5: '', }, decimals: 18, projectLink: 'https://itam.network/', @@ -1214,6 +1273,7 @@ const tokens = { address: { 56: '0x6F769E65c14Ebd1f68817F5f1DcDb61Cfa2D6f7e', 97: '', + 5: '', }, decimals: 18, projectLink: 'https://arpachain.io/', @@ -1223,6 +1283,7 @@ const tokens = { address: { 56: '0xA7f552078dcC247C2684336020c03648500C6d9F', 97: '', + 5: '', }, decimals: 18, projectLink: 'https://ellipsis.finance/', @@ -1232,6 +1293,7 @@ const tokens = { address: { 56: '0xC13B7a43223BB9Bf4B69BD68Ab20ca1B79d81C75', 97: '', + 5: '', }, decimals: 18, projectLink: 'https://jgndefi.com/', @@ -1241,6 +1303,7 @@ const tokens = { address: { 56: '0x2222227E22102Fe3322098e4CBfE18cFebD57c95', 97: '', + 5: '', }, decimals: 4, projectLink: 'https://alienworlds.io/', @@ -1250,6 +1313,7 @@ const tokens = { address: { 56: '0x0F9E4D49f25de22c2202aF916B681FBB3790497B', 97: '', + 5: '', }, decimals: 18, projectLink: 'https://perlinx.finance/', @@ -1259,6 +1323,7 @@ const tokens = { address: { 56: '0xc5E6689C9c8B02be7C49912Ef19e79cF24977f03', 97: '', + 5: '', }, decimals: 18, projectLink: 'https://bsc.alpaca.city/', @@ -1268,6 +1333,7 @@ const tokens = { address: { 56: '0xC0eFf7749b125444953ef89682201Fb8c6A917CD', 97: '', + 5: '', }, decimals: 18, projectLink: 'https://horizonprotocol.com/', @@ -1277,6 +1343,7 @@ const tokens = { address: { 56: '0x4CfbBdfBd5BF0814472fF35C72717Bd095ADa055', 97: '', + 5: '', }, decimals: 18, projectLink: 'https://shield.suterusu.io/', @@ -1286,6 +1353,7 @@ const tokens = { address: { 56: '0x1613957159E9B0ac6c80e824F7Eea748a32a0AE2', 97: '', + 5: '', }, decimals: 18, projectLink: 'https://chainguardians.io/', @@ -1295,6 +1363,7 @@ const tokens = { address: { 56: '0xB67754f5b4C704A24d2db68e661b2875a4dDD197', 97: '', + 5: '', }, decimals: 18, projectLink: 'https://mixie.chainguardians.io/', @@ -1304,6 +1373,7 @@ const tokens = { address: { 56: '0x1D1eb8E8293222e1a29d2C0E4cE6C0Acfd89AaaC', 97: '', + 5: '', }, decimals: 18, projectLink: 'https://hakka.finance/', @@ -1313,6 +1383,7 @@ const tokens = { address: { 56: '0x5621b5A3f4a8008c4CCDd1b942B121c8B1944F1f', 97: '', + 5: '', }, decimals: 18, projectLink: 'https://www.exeedme.com/', @@ -1322,6 +1393,7 @@ const tokens = { address: { 56: '0x2cD1075682b0FCCaADd0Ca629e138E64015Ba11c', 97: '', + 5: '', }, decimals: 9, projectLink: 'https://www.btcst.finance/', @@ -1331,6 +1403,7 @@ const tokens = { address: { 56: '0x8F0528cE5eF7B51152A59745bEfDD91D97091d2F', 97: '', + 5: '', }, decimals: 18, projectLink: 'https://www.alpacafinance.org/', @@ -1340,6 +1413,7 @@ const tokens = { address: { 56: '0x9899a98b222fCb2f3dbee7dF45d943093a4ff9ff', 97: '', + 5: '', }, decimals: 18, projectLink: 'https://dusd.finance/', @@ -1349,6 +1423,7 @@ const tokens = { address: { 56: '0x9617857E191354dbEA0b714d78Bc59e57C411087', 97: '', + 5: '', }, decimals: 18, projectLink: 'https://lympo.io/lmt/', @@ -1358,6 +1433,7 @@ const tokens = { address: { 56: '0x8595F9dA7b868b1822194fAEd312235E43007b49', 97: '', + 5: '', }, decimals: 18, projectLink: 'https://www.bittorrent.com/', @@ -1367,6 +1443,7 @@ const tokens = { address: { 56: '0x85EAC5Ac2F758618dFa09bDbe0cf174e7d574D5B', 97: '', + 5: '', }, decimals: 18, projectLink: 'https://tron.network/', @@ -1376,6 +1453,7 @@ const tokens = { address: { 56: '0xaeF0d72a118ce24feE3cD1d43d383897D05B4e99', 97: '', + 5: '', }, decimals: 18, projectLink: 'https://winklink.org/', @@ -1385,6 +1463,7 @@ const tokens = { address: { 56: '0x49022089e78a8D46Ec87A3AF86a1Db6c189aFA6f', 97: '', + 5: '', }, decimals: 18, projectLink: 'https://mirror.finance/', @@ -1394,6 +1473,7 @@ const tokens = { address: { 56: '0xF218184Af829Cf2b0019F8E6F0b2423498a36983', 97: '', + 5: '', }, decimals: 18, projectLink: 'https://mathwallet.org/', @@ -1403,6 +1483,7 @@ const tokens = { address: { 56: '0x1A2fb0Af670D0234c2857FaD35b789F8Cb725584', 97: '', + 5: '', }, decimals: 18, projectLink: 'https://chemix.io/home', @@ -1412,6 +1493,7 @@ const tokens = { address: { 56: '0x07AaA29E63FFEB2EBf59B33eE61437E1a91A3bb2', 97: '', + 5: '', }, decimals: 18, projectLink: 'https://chemix.io/home', @@ -1421,6 +1503,7 @@ const tokens = { address: { 56: '0x9a319b959e33369C5eaA494a770117eE3e585318', 97: '', + 5: '', }, decimals: 18, projectLink: 'https://hyfi.pro/#/', @@ -1430,6 +1513,7 @@ const tokens = { address: { 56: '0x658E64FFcF40D240A43D52CA9342140316Ae44fA', 97: '', + 5: '', }, decimals: 8, projectLink: 'https://oin.finance/', @@ -1439,6 +1523,7 @@ const tokens = { address: { 56: '0xbA2aE424d960c26247Dd6c32edC70B295c744C43', 97: '', + 5: '', }, decimals: 8, projectLink: 'https://dogecoin.com/', @@ -1448,6 +1533,7 @@ const tokens = { address: { 56: '0x4e6415a5727ea08aAE4580057187923aeC331227', 97: '', + 5: '', }, decimals: 18, projectLink: 'https://refinable.com/', @@ -1457,6 +1543,7 @@ const tokens = { address: { 56: '0x04BAf95Fd4C52fd09a56D840bAEe0AB8D7357bf0', 97: '', + 5: '', }, decimals: 18, projectLink: 'https://www.bigone.com/', @@ -1466,6 +1553,7 @@ const tokens = { address: { 56: '0x1796ae0b0fa4862485106a0de9b654eFE301D0b2', 97: '', + 5: '', }, decimals: 18, projectLink: 'https://polkamon.com/', @@ -1475,6 +1563,7 @@ const tokens = { address: { 56: '0x4FA7163E153419E0E1064e418dd7A99314Ed27b6', 97: '', + 5: '', }, decimals: 18, projectLink: 'https://www.hotcross.com/', @@ -1484,6 +1573,7 @@ const tokens = { address: { 56: '0xe550a593d09FBC8DCD557b5C88Cea6946A8b404A', 97: '', + 5: '', }, decimals: 8, projectLink: 'https://www.btcst.finance/', @@ -1493,6 +1583,7 @@ const tokens = { address: { 56: '0x5a16E8cE8cA316407c6E6307095dc9540a8D62B3', 97: '', + 5: '', }, decimals: 18, projectLink: 'https://www.bitrue.com/', @@ -1502,6 +1593,7 @@ const tokens = { address: { 56: '0xBbEB90cFb6FAFa1F69AA130B7341089AbeEF5811', 97: '', + 5: '', }, decimals: 18, projectLink: 'https://upbots.com/', @@ -1511,6 +1603,7 @@ const tokens = { address: { 56: '0x7e396BfC8a2f84748701167c2d622F041A1D7a17', 97: '', + 5: '', }, decimals: 8, projectLink: 'https://massnet.org/en/', @@ -1520,6 +1613,7 @@ const tokens = { address: { 56: '0x0a3A21356793B49154Fd3BbE91CBc2A16c0457f5', 97: '', + 5: '', }, decimals: 18, projectLink: 'https://www.redfoxlabs.io/', @@ -1529,6 +1623,7 @@ const tokens = { address: { 56: '0x4a080377f83D669D7bB83B3184a8A5E61B500608', 97: '', + 5: '', }, decimals: 18, projectLink: 'https://xend.finance/', @@ -1538,6 +1633,7 @@ const tokens = { address: { 56: '0x810EE35443639348aDbbC467b33310d2AB43c168', 97: '', + 5: '', }, decimals: 18, projectLink: 'https://cyclone.xyz/', @@ -1547,6 +1643,7 @@ const tokens = { address: { 56: '0xf9CeC8d50f6c8ad3Fb6dcCEC577e05aA32B224FE', 97: '', + 5: '', }, decimals: 6, projectLink: 'https://chromia.com/', @@ -1556,6 +1653,7 @@ const tokens = { address: { 56: '0x4BA0057f784858a48fe351445C672FF2a3d43515', 97: '', + 5: '', }, decimals: 18, projectLink: 'https://kalmar.io/', @@ -1565,6 +1663,7 @@ const tokens = { address: { 56: '0xe60eaf5A997DFAe83739e035b005A33AfdCc6df5', 97: '', + 5: '', }, decimals: 18, projectLink: 'https://deri.finance/#/index', @@ -1574,6 +1673,7 @@ const tokens = { address: { 56: '0xf07a32Eb035b786898c00bB1C64d8c6F8E7a46D5', 97: '', + 5: '', }, decimals: 18, projectLink: 'https://www.bitwellex.com/', @@ -1583,6 +1683,7 @@ const tokens = { address: { 56: '0xa9c41A46a6B3531d28d5c32F6633dd2fF05dFB90', 97: '', + 5: '', }, decimals: 18, projectLink: 'https://wault.finance/', @@ -1592,6 +1693,7 @@ const tokens = { address: { 56: '0xB64E638E60D154B43f660a6BF8fD8a3b249a6a21', 97: '', + 5: '', }, decimals: 18, projectLink: 'https://wault.finance/', @@ -1601,6 +1703,7 @@ const tokens = { address: { 56: '0xaBaE871B7E3b67aEeC6B46AE9FE1A91660AadAC5', 97: '', + 5: '', }, decimals: 18, projectLink: 'https://opendao.io/', @@ -1610,6 +1713,7 @@ const tokens = { address: { 56: '0x5512014efa6Cd57764Fa743756F7a6Ce3358cC83', 97: '', + 5: '', }, decimals: 18, projectLink: 'https://easyfi.network/', @@ -1619,6 +1723,7 @@ const tokens = { address: { 56: '0x5F84ce30DC3cF7909101C69086c50De191895883', 97: '', + 5: '', }, decimals: 18, projectLink: 'https://venus.io/', @@ -1628,6 +1733,7 @@ const tokens = { address: { 56: '0x14016E85a25aeb13065688cAFB43044C2ef86784', 97: '', + 5: '', }, decimals: 18, projectLink: 'https://www.trueusd.com/', @@ -1637,6 +1743,7 @@ const tokens = { address: { 56: '0xBd2949F67DcdC549c6Ebe98696449Fa79D988A9F', 97: '', + 5: '', }, decimals: 18, projectLink: 'https://www.meter.io/', @@ -1646,6 +1753,7 @@ const tokens = { address: { 56: '0xDAe6c2A48BFAA66b43815c5548b10800919c993E', 97: '', + 5: '', }, decimals: 18, projectLink: 'https://kattana.io/', @@ -1655,6 +1763,7 @@ const tokens = { address: { 56: '0xA1434F1FC3F437fa33F7a781E041961C0205B5Da', 97: '', + 5: '', }, decimals: 18, projectLink: 'https://quarkchain.io/', @@ -1664,6 +1773,7 @@ const tokens = { address: { 56: '0x045c4324039dA91c52C55DF5D785385Aab073DcF', 97: '', + 5: '', }, decimals: 18, projectLink: 'https://www.confluxnetwork.org/', @@ -1673,6 +1783,7 @@ const tokens = { address: { 56: '0x9F882567A62a5560d147d64871776EeA72Df41D3', 97: '', + 5: '', }, decimals: 18, projectLink: 'https://www.mxc.com/', @@ -1682,6 +1793,7 @@ const tokens = { address: { 56: '0xA2120b9e674d3fC3875f415A7DF52e382F141225', 97: '', + 5: '', }, decimals: 18, projectLink: 'https://www.ata.network/', @@ -1691,6 +1803,7 @@ const tokens = { address: { 56: '0x3203c9E46cA618C8C1cE5dC67e7e9D75f5da2377', 97: '', + 5: '', }, decimals: 18, projectLink: 'https://www.mobox.io/#/', @@ -1700,6 +1813,7 @@ const tokens = { address: { 56: '0xffEecbf8D7267757c2dc3d13D730E97E15BfdF7F', 97: '', + 5: '', }, decimals: 18, projectLink: 'https://www.boringdao.com/', @@ -1709,6 +1823,7 @@ const tokens = { address: { 56: '0x2FA5dAF6Fe0708fBD63b1A7D1592577284f52256', 97: '', + 5: '', }, decimals: 18, projectLink: 'https://unmarshal.io/', @@ -1718,6 +1833,7 @@ const tokens = { address: { 56: '0xDB021b1B247fe2F1fa57e0A87C748Cc1E321F07F', 97: '', + 5: '', }, decimals: 9, projectLink: 'https://www.ampleforth.org/', @@ -1727,6 +1843,7 @@ const tokens = { address: { 56: '0xEe9801669C6138E84bD50dEB500827b776777d28', 97: '', + 5: '', }, decimals: 18, projectLink: 'https://o3swap.com/', @@ -1736,6 +1853,7 @@ const tokens = { address: { 56: '0xaA9E582e5751d703F85912903bacADdFed26484C', 97: '', + 5: '', }, decimals: 8, projectLink: 'https://hacken.io/', @@ -1745,6 +1863,7 @@ const tokens = { address: { 56: '0x4e840AADD28DA189B9906674B4Afcb77C128d9ea', 97: '', + 5: '', }, decimals: 18, projectLink: 'https://www.hotbit.io/', @@ -1754,6 +1873,7 @@ const tokens = { address: { 56: '0x4691937a7508860F876c9c0a2a617E7d9E945D4B', 97: '', + 5: '', }, decimals: 18, projectLink: 'https://woo.network/', @@ -1763,6 +1883,7 @@ const tokens = { address: { 56: '0x9Fdc3ae5c814b79dcA2556564047C5e7e5449C19', 97: '', + 5: '', }, decimals: 18, projectLink: 'https://decentral.games/', diff --git a/src/config/constants/types.ts b/src/config/constants/types.ts index 9c1c89a..d3f6846 100644 --- a/src/config/constants/types.ts +++ b/src/config/constants/types.ts @@ -3,6 +3,7 @@ import { SerializedBigNumber, TranslatableText } from 'state/types' export interface Address { 97?: string + 5?: string 56: string } diff --git a/src/hooks/Tokens.ts b/src/hooks/Tokens.ts index ab7d7c1..a9aeb3f 100644 --- a/src/hooks/Tokens.ts +++ b/src/hooks/Tokens.ts @@ -32,7 +32,7 @@ function useTokensFromMap(tokenMap: TokenAddressMap, includeUserAdded: boolean): newMap[address] = tokenMap[chainId][address].token return newMap }, {}) - + console.log(mapWithoutUrls) if (includeUserAdded) { return ( userAddedTokens diff --git a/src/views/BlindBox/component/SeriesDetail.tsx b/src/views/BlindBox/component/SeriesDetail.tsx index 0699f23..cdab1ed 100644 --- a/src/views/BlindBox/component/SeriesDetail.tsx +++ b/src/views/BlindBox/component/SeriesDetail.tsx @@ -1,4 +1,4 @@ -import React, { useEffect } from 'react' +import React, { useEffect, useState } from 'react' import styled from 'styled-components' import { useTranslation } from 'contexts/Localization' import { Modal, Flex, Text, Image } from '@pancakeswap/uikit' @@ -109,27 +109,25 @@ const ShopMain = styled.div` const SeriesDetail: React.FC = ({ name, value, onDismiss, detail }) => { const { t } = useTranslation() - const list = [ - { - label: t('epic'), - type: '1', - list: [ - { label: 'Cat goddess Emerald ', id: 1, type: 1, probability: 1 }, - { label: 'Cat goddess Emerald ', id: 1, type: 1, probability: 2 }, - { label: 'Cat goddess Emerald ', id: 1, type: 1, probability: 3 }, - { label: 'Cat goddess Emerald ', id: 1, type: 1, probability: 4 }, - { label: 'Cat goddess Emerald ', id: 1, type: 1, probability: 5 }, - ], - }, - { label: t('legend'), type: '2', list: [{ label: 'Cat goddess Emerald ', id: 2, type: 2, probability: 6 }] }, - { label: t('uncommon'), type: '3', list: [{ label: 'Cat goddess Emerald ', id: 3, type: 3, probability: 7 }] }, - { label: t('common'), type: '4', list: [{ label: 'Cat goddess Emerald ', id: 4, type: 4, probability: 8 }] }, - ] - + const [list, setList] = useState([]) + const [totalNum, setTotal] = useState(0) const getDetail = useGetBoxDetail() const getData = async () => { - const data = await getDetail(detail.id) - console.log(data) + const { contentList, total } = await getDetail(detail.id) + setTotal(total) + const dataList = [] + contentList.forEach((item, index) => { + const has = dataList.findIndex((o) => o.grade === item.grade) + if (has === -1) { + dataList.push({ + grade: item.grade, + list: [item], + }) + } else { + dataList[has].list.push(item) + } + }) + setList(dataList) } useEffect(() => { @@ -137,10 +135,10 @@ const SeriesDetail: React.FC = ({ name, value, onDismiss, deta }, []) return ( -
+
{t('limit the quantity of')} - 10000 + {totalNum} @@ -151,10 +149,13 @@ const SeriesDetail: React.FC = ({ name, value, onDismiss, deta {list.map((item) => { return ( - {item.label} + {item.grade === 'EPIC' && {t('epic')}} + {item.grade === 'LEGEND' && {t('legend')}} + {item.grade === 'RARE' && {t('uncommon')}} + {item.grade === 'NORMAL' && {t('common')}} {item.list.map((childItem) => { - return + return })} diff --git a/src/views/BlindBox/component/ShopList.tsx b/src/views/BlindBox/component/ShopList.tsx index ebc8a2d..ad70cb2 100644 --- a/src/views/BlindBox/component/ShopList.tsx +++ b/src/views/BlindBox/component/ShopList.tsx @@ -82,31 +82,34 @@ const ProbabilityTitle = styled(Flex)` interface ShopListItemProps { item?: Detail + grade?: string } interface Detail { - label?: string - type?: number | string - id?: number | string - probability?: number | string + goodsId?: string + grade?: string + id?: string + name?: string + proportion?: number | string } -const ShopList: React.FC = ({ item }) => { +const ShopList: React.FC = ({ item, grade }) => { const { t } = useTranslation() return (
- {item.type === 1 &&
{t('epic')}
} - {item.type === 2 &&
{t('legend')}
} - {item.type === 3 &&
{t('uncommon')}
} - {item.type === 4 &&
{t('common')}
} + {grade === 'EPIC' &&
{t('epic')}
} + {grade === 'LEGEND' &&
{t('legend')}
} + {grade === 'RARE' &&
{t('uncommon')}
} + {grade === 'NORMAL' &&
{t('common')}
}
- {item.type === 1 && } - {item.type === 2 && } - {item.type === 3 && } - {item.type === 4 && } - {item.label} - {item.probability}% + {/* */} + {grade === 'EPIC' && } + {grade === 'LEGEND' && } + {grade === 'RARE' && } + {grade === 'NORMAL' && } + {item.name} + {item.proportion}% {t('The rate of')}
)