diff --git a/packages/pancake-uikit/package.json b/packages/pancake-uikit/package.json index 0c5792f..b9ab776 100644 --- a/packages/pancake-uikit/package.json +++ b/packages/pancake-uikit/package.json @@ -60,7 +60,15 @@ "ethers": "^5.1.4", "@web3-react/core": "^6.1.9", "@ethersproject/experimental": "^5.0.1", - "react-transition-group": "^4.4.1" + "react-transition-group": "^4.4.1", + "@uniswap/token-lists": "^1.0.0-beta.19", + "@uniswap/v2-core": "^1.0.0", + "@uniswap/v2-periphery": "^1.1.0-beta.0", + "redux-localstorage-simple": "^2.4.1", + "@web3-react/injected-connector": "^6.0.7", + "@web3-react/walletconnect-connector": "^6.2.4", + "@binance-chain/bsc-connector": "^1.0.0", + "immer": "7.0.15" }, "publishConfig": { "access": "public" diff --git a/packages/pancake-uikit/src/config/abi/erc20.json b/packages/pancake-uikit/src/config/abi/erc20.json new file mode 100644 index 0000000..405d6b3 --- /dev/null +++ b/packages/pancake-uikit/src/config/abi/erc20.json @@ -0,0 +1,222 @@ +[ + { + "constant": true, + "inputs": [], + "name": "name", + "outputs": [ + { + "name": "", + "type": "string" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_spender", + "type": "address" + }, + { + "name": "_value", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_from", + "type": "address" + }, + { + "name": "_to", + "type": "address" + }, + { + "name": "_value", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "decimals", + "outputs": [ + { + "name": "", + "type": "uint8" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "_owner", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "name": "balance", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "symbol", + "outputs": [ + { + "name": "", + "type": "string" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_to", + "type": "address" + }, + { + "name": "_value", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "_owner", + "type": "address" + }, + { + "name": "_spender", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "payable": true, + "stateMutability": "payable", + "type": "fallback" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "from", + "type": "address" + }, + { + "indexed": true, + "name": "to", + "type": "address" + }, + { + "indexed": false, + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + } +] diff --git a/packages/pancake-uikit/src/config/constants/index.ts b/packages/pancake-uikit/src/config/constants/index.ts new file mode 100644 index 0000000..9784523 --- /dev/null +++ b/packages/pancake-uikit/src/config/constants/index.ts @@ -0,0 +1,103 @@ +import { ChainId, JSBI, Percent, Token } from "@doodaswap/sdk"; +import { mainnetTokens, testnetTokens } from "./tokens"; + +export const ROUTER_ADDRESS = "0xF4d81360FC84226816c8711E0Cb432484D301BC7"; + +// a list of tokens by chain +type ChainTokenList = { + readonly [chainId in ChainId]: Token[]; +}; + +// used to construct intermediary pairs for trading +export const BASES_TO_CHECK_TRADES_AGAINST: ChainTokenList = { + [ChainId.MAINNET]: [ + mainnetTokens.wbnb, + mainnetTokens.cake, + mainnetTokens.busd, + mainnetTokens.usdt, + mainnetTokens.btcb, + mainnetTokens.ust, + mainnetTokens.eth, + mainnetTokens.usdc, + ], + [ChainId.TESTNET]: [testnetTokens.wbnb, testnetTokens.cake, testnetTokens.busd], +}; + +/** + * Addittional bases for specific tokens + * @example { [WBTC.address]: [renBTC], [renBTC.address]: [WBTC] } + */ +export const ADDITIONAL_BASES: { [chainId in ChainId]?: { [tokenAddress: string]: Token[] } } = { + [ChainId.MAINNET]: {}, +}; + +/** + * Some tokens can only be swapped via certain pairs, so we override the list of bases that are considered for these + * tokens. + * @example [AMPL.address]: [DAI, WETH[ChainId.MAINNET]] + */ +export const CUSTOM_BASES: { [chainId in ChainId]?: { [tokenAddress: string]: Token[] } } = { + [ChainId.MAINNET]: {}, +}; + +// used for display in the default list when adding liquidity +export const SUGGESTED_BASES: ChainTokenList = { + [ChainId.MAINNET]: [mainnetTokens.busd, mainnetTokens.cake, mainnetTokens.btcb], + [ChainId.TESTNET]: [testnetTokens.wbnb, testnetTokens.cake, testnetTokens.busd], +}; + +// used to construct the list of all pairs we consider by default in the frontend +export const BASES_TO_TRACK_LIQUIDITY_FOR: ChainTokenList = { + [ChainId.MAINNET]: [mainnetTokens.wbnb, mainnetTokens.dai, mainnetTokens.busd, mainnetTokens.usdt], + [ChainId.TESTNET]: [testnetTokens.wbnb, testnetTokens.cake, testnetTokens.busd], +}; + +export const PINNED_PAIRS: { readonly [chainId in ChainId]?: [Token, Token][] } = { + [ChainId.MAINNET]: [ + [mainnetTokens.cake, mainnetTokens.wbnb], + [mainnetTokens.busd, mainnetTokens.usdt], + [mainnetTokens.dai, mainnetTokens.usdt], + ], +}; + +export const NetworkContextName = "NETWORK"; + +// default allowed slippage, in bips +export const INITIAL_ALLOWED_SLIPPAGE = 50; +// 20 minutes, denominated in seconds +export const DEFAULT_DEADLINE_FROM_NOW = 60 * 20; + +export const BIG_INT_ZERO = JSBI.BigInt(0); + +// one basis point +export const ONE_BIPS = new Percent(JSBI.BigInt(1), JSBI.BigInt(10000)); +export const BIPS_BASE = JSBI.BigInt(10000); +// used for warning states +export const ALLOWED_PRICE_IMPACT_LOW: Percent = new Percent(JSBI.BigInt(100), BIPS_BASE); // 1% +export const ALLOWED_PRICE_IMPACT_MEDIUM: Percent = new Percent(JSBI.BigInt(300), BIPS_BASE); // 3% +export const ALLOWED_PRICE_IMPACT_HIGH: Percent = new Percent(JSBI.BigInt(500), BIPS_BASE); // 5% +// if the price slippage exceeds this number, force the user to type 'confirm' to execute +export const PRICE_IMPACT_WITHOUT_FEE_CONFIRM_MIN: Percent = new Percent(JSBI.BigInt(1000), BIPS_BASE); // 10% +// for non expert mode disable swaps above this +export const BLOCKED_PRICE_IMPACT_NON_EXPERT: Percent = new Percent(JSBI.BigInt(1500), BIPS_BASE); // 15% + +// used to ensure the user doesn't send so much BNB so they end up with <.01 +export const MIN_BNB: JSBI = JSBI.exponentiate(JSBI.BigInt(10), JSBI.BigInt(16)); // .01 BNB +export const BETTER_TRADE_LESS_HOPS_THRESHOLD = new Percent(JSBI.BigInt(50), JSBI.BigInt(10000)); + +export const ZERO_PERCENT = new Percent("0"); +export const ONE_HUNDRED_PERCENT = new Percent("1"); + +// SDN OFAC addresses +export const BLOCKED_ADDRESSES: string[] = [ + "0x7F367cC41522cE07553e823bf3be79A889DEbe1B", + "0xd882cFc20F52f2599D84b8e8D58C7FB62cfE344b", + "0x901bb9583b24D97e995513C6778dc6888AB6870e", + "0xA7e5d5A720f06526557c513402f2e6B5fA20b008", + "0x8576aCC5C05D6Ce88f4e49bf65BdF0C62F91353C", +]; + +// export { default as farmsConfig } from "./farms"; +// export { default as oldFarmsConfig } from "./oldFarms"; +// export { default as poolsConfig } from "./pools"; +// export { default as ifosConfig } from "./ifo"; diff --git a/packages/pancake-uikit/src/config/constants/lists.ts b/packages/pancake-uikit/src/config/constants/lists.ts new file mode 100644 index 0000000..b42b355 --- /dev/null +++ b/packages/pancake-uikit/src/config/constants/lists.ts @@ -0,0 +1,14 @@ +const PANCAKE_EXTENDED = "https://tokens.pancakeswap.finance/pancakeswap-extended.json"; +const PANCAKE_TOP100 = "https://tokens.pancakeswap.finance/pancakeswap-top-100.json"; + +export const UNSUPPORTED_LIST_URLS: string[] = []; + +// lower index == higher priority for token import +export const DEFAULT_LIST_OF_LISTS: string[] = [ + PANCAKE_TOP100, + PANCAKE_EXTENDED, + ...UNSUPPORTED_LIST_URLS, // need to load unsupported tokens as well +]; + +// default lists to be 'active' aka searched across +export const DEFAULT_ACTIVE_LIST_URLS: string[] = []; diff --git a/packages/pancake-uikit/src/config/constants/nfts/types.ts b/packages/pancake-uikit/src/config/constants/nfts/types.ts new file mode 100644 index 0000000..7860a1d --- /dev/null +++ b/packages/pancake-uikit/src/config/constants/nfts/types.ts @@ -0,0 +1,39 @@ +import { Address, Images } from "../types"; + +export enum CollectionKey { + PANCAKE = "pancake", +} + +type Collection = { + name: string; + address: Address; +}; + +export type Collections = { + [key in CollectionKey]: Collection; +}; + +export type NftImages = { + blur?: string; +} & Images; + +export type Nft = { + id?: number | string; + name: string; + description: string; + images: NftImages; + video?: { + webm: string; + mp4: string; + }; + + // Uniquely identifies the nft. + // Used for matching an NFT from the config with the data from the NFT's tokenURI + identifier: string; + + attributes?: any; +}; + +export type Nfts = { + [key in CollectionKey]: Nft[]; +}; diff --git a/packages/pancake-uikit/src/config/constants/swapWarningTokens.ts b/packages/pancake-uikit/src/config/constants/swapWarningTokens.ts new file mode 100644 index 0000000..5b3ac07 --- /dev/null +++ b/packages/pancake-uikit/src/config/constants/swapWarningTokens.ts @@ -0,0 +1,15 @@ +import { Token } from "@doodaswap/sdk"; +import tokens from "./tokens"; + +const { bondly, safemoon } = tokens; + +interface WarningTokenList { + [key: string]: Token; +} + +const SwapWarningTokens = { + safemoon, + bondly, +}; + +export default SwapWarningTokens; diff --git a/packages/pancake-uikit/src/config/constants/tokenLists/dooda-default.tokenlist.json b/packages/pancake-uikit/src/config/constants/tokenLists/dooda-default.tokenlist.json new file mode 100644 index 0000000..77468a0 --- /dev/null +++ b/packages/pancake-uikit/src/config/constants/tokenLists/dooda-default.tokenlist.json @@ -0,0 +1,166 @@ +{ + "name": "DoodaSwap Default List", + "timestamp": "2021-05-06T00:00:00Z", + "version": { + "major": 3, + "minor": 0, + "patch": 0 + }, + "tags": {}, + "logoURI": "https://pancakeswap.finance/logo.png", + "keywords": ["pancake", "default"], + "tokens": [ + { + "name": "WBNB Token", + "symbol": "WBNB", + "address": "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c", + "chainId": 56, + "decimals": 18, + "logoURI": "https://pancakeswap.finance/images/tokens/0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c.png" + }, + { + "name": "WBNB Token", + "symbol": "WBNB", + "address": "0xCde538bd8954eAd01C56194F5C9905B310a5bd0E", + "chainId": 97, + "decimals": 18, + "logoURI": "https://pancakeswap.finance/images/tokens/0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c.png" + }, + { + "name": "BUSD Token", + "symbol": "BUSD", + "address": "0xC0063D362A8EA40Cb32A774c75683429c2B4860c", + "chainId": 56, + "decimals": 18, + "logoURI": "https://pancakeswap.finance/images/tokens/0xC0063D362A8EA40Cb32A774c75683429c2B4860c.png" + }, + { + "name": "Ethereum Token", + "symbol": "ETH", + "address": "0x2170Ed0880ac9A755fd29B2688956BD959F933F8", + "chainId": 56, + "decimals": 18, + "logoURI": "https://pancakeswap.finance/images/tokens/0x2170ed0880ac9a755fd29b2688956bd959f933f8.png" + }, + { + "name": "BTCB Token", + "symbol": "BTCB", + "address": "0x7130d2A12B9BCbFAe4f2634d864A1Ee1Ce3Ead9c", + "chainId": 56, + "decimals": 18, + "logoURI": "https://pancakeswap.finance/images/tokens/0x7130d2a12b9bcbfae4f2634d864a1ee1ce3ead9c.png" + }, + { + "name": "Tether USD", + "symbol": "USDT", + "address": "0x55d398326f99059fF775485246999027B3197955", + "chainId": 56, + "decimals": 18, + "logoURI": "https://pancakeswap.finance/images/tokens/0x55d398326f99059ff775485246999027b3197955.png" + }, + { + "name": "PancakeSwap Token", + "symbol": "CAKE", + "address": "0x0E09FaBB73Bd3Ade0a17ECC321fD13a19e81cE82", + "chainId": 56, + "decimals": 18, + "logoURI": "https://pancakeswap.finance/images/tokens/0x0e09fabb73bd3ade0a17ecc321fd13a19e81ce82.png" + }, + { + "name": "Venus", + "symbol": "XVS", + "address": "0xcF6BB5389c92Bdda8a3747Ddb454cB7a64626C63", + "chainId": 56, + "decimals": 18, + "logoURI": "https://pancakeswap.finance/images/tokens/0xcf6bb5389c92bdda8a3747ddb454cb7a64626c63.png" + }, + { + "name": "VAI Stablecoin", + "symbol": "VAI", + "address": "0x4BD17003473389A42DAF6a0a729f6Fdb328BbBd7", + "chainId": 56, + "decimals": 18, + "logoURI": "https://pancakeswap.finance/images/tokens/0x4bd17003473389a42daf6a0a729f6fdb328bbbd7.png" + }, + { + "name": "Pancake Bunny", + "symbol": "BUNNY", + "address": "0xC9849E6fdB743d08fAeE3E34dd2D1bc69EA11a51", + "chainId": 56, + "decimals": 18, + "logoURI": "https://pancakeswap.finance/images/tokens/0xc9849e6fdb743d08faee3e34dd2d1bc69ea11a51.png" + }, + { + "name": "SafeMoon", + "symbol": "SAFEMOON", + "address": "0x8076C74C5e3F5852037F31Ff0093Eeb8c8ADd8D3", + "chainId": 56, + "decimals": 9, + "logoURI": "https://pancakeswap.finance/images/tokens/0x8076c74c5e3f5852037f31ff0093eeb8c8add8d3.png" + }, + { + "name": "Alpaca", + "symbol": "ALPACA", + "address": "0x8F0528cE5eF7B51152A59745bEfDD91D97091d2F", + "chainId": 56, + "decimals": 18, + "logoURI": "https://pancakeswap.finance/images/tokens/0x8f0528ce5ef7b51152a59745befdd91d97091d2f.png" + }, + { + "name": "Belt", + "symbol": "BELT", + "address": "0xE0e514c71282b6f4e823703a39374Cf58dc3eA4f", + "chainId": 56, + "decimals": 18, + "logoURI": "https://pancakeswap.finance/images/tokens/0xE0e514c71282b6f4e823703a39374Cf58dc3eA4f.png" + }, + { + "name": "TokoCrypto", + "symbol": "TKO", + "address": "0x9f589e3eabe42ebC94A44727b3f3531C0c877809", + "chainId": 56, + "decimals": 18, + "logoURI": "https://pancakeswap.finance/images/tokens/0x9f589e3eabe42ebc94a44727b3f3531c0c877809.png" + }, + { + "name": "Nerve Finance", + "symbol": "NRV", + "address": "0x42F6f551ae042cBe50C739158b4f0CAC0Edb9096", + "chainId": 56, + "decimals": 18, + "logoURI": "https://pancakeswap.finance/images/tokens/0x42f6f551ae042cbe50c739158b4f0cac0edb9096.png" + }, + { + "name": "Ellipsis", + "symbol": "EPS", + "address": "0xA7f552078dcC247C2684336020c03648500C6d9F", + "chainId": 56, + "decimals": 18, + "logoURI": "https://pancakeswap.finance/images/tokens/0xa7f552078dcc247c2684336020c03648500c6d9f.png" + }, + { + "name": "Dooda", + "symbol": "DOODA", + "address": "0x5014d0abfc8428f0f8ccd0c5f010fe47569d8d34", + "chainId": 97, + "decimals": 18, + "logoURI": "https://doodaswap.s3.ap-northeast-2.amazonaws.com/images/tokens/0x5014d0abfc8428f0f8ccd0c5f010fe47569d8d34.png" + }, + { + "name": "Troad", + "symbol": "TROAD", + "address": "0x637A86aFf37dF6cD3c6c16439a4bdeE32272Fdc7", + "chainId": 97, + "decimals": 18, + "logoURI": "https://doodaswap.s3.ap-northeast-2.amazonaws.com/images/tokens/0x637A86aFf37dF6cD3c6c16439a4bdeE32272Fdc7.png" + }, + { + "name": "BUSD Token", + "symbol": "BUSD", + "address": "0x78867BbEeF44f2326bF8DDd1941a4439382EF2A7", + "chainId": 97, + "decimals": 18, + "logoURI": "https://pancakeswap.finance/images/tokens/0xC0063D362A8EA40Cb32A774c75683429c2B4860c.png" + } + ] +} diff --git a/packages/pancake-uikit/src/config/constants/tokenLists/dooda-unsupported.tokenlist.json b/packages/pancake-uikit/src/config/constants/tokenLists/dooda-unsupported.tokenlist.json new file mode 100644 index 0000000..8662eeb --- /dev/null +++ b/packages/pancake-uikit/src/config/constants/tokenLists/dooda-unsupported.tokenlist.json @@ -0,0 +1,13 @@ +{ + "name": "Dooda Unsupported List", + "timestamp": "2021-01-05T20:47:02.923Z", + "version": { + "major": 1, + "minor": 0, + "patch": 0 + }, + "tags": {}, + "logoURI": "ipfs://QmNa8mQkrNKp1WEEeGjFezDmDeodkWRevGFN8JCV7b4Xir", + "keywords": ["Dooda", "unsupported"], + "tokens": [] +} diff --git a/packages/pancake-uikit/src/config/constants/tokens.ts b/packages/pancake-uikit/src/config/constants/tokens.ts new file mode 100644 index 0000000..330e9ff --- /dev/null +++ b/packages/pancake-uikit/src/config/constants/tokens.ts @@ -0,0 +1,1740 @@ +import { ChainId, Token } from "@doodaswap/sdk"; +// import { serializeToken } from "state/user/hooks/helpers"; +import { SerializedToken } from "../../pages/state/types"; + +const { MAINNET, TESTNET } = ChainId; + +interface TokenList { + [symbol: string]: Token; +} + +interface SerializedTokenList { + [symbol: string]: SerializedToken; +} + +export const mainnetTokens = { + wbnb: new Token( + MAINNET, + "0xCde538bd8954eAd01C56194F5C9905B310a5bd0E", + 18, + "WBNB", + "Wrapped BNB", + "https://www.binance.com/" + ), + // bnb here points to the wbnb contract. Wherever the currency BNB is required, conditional checks for the symbol 'BNB' can be used + bnb: new Token(MAINNET, "0xCde538bd8954eAd01C56194F5C9905B310a5bd0E", 18, "BNB", "BNB", "https://www.binance.com/"), + cake: new Token( + MAINNET, + "0x0E09FaBB73Bd3Ade0a17ECC321fD13a19e81cE82", + 18, + "CAKE", + "PancakeSwap Token", + "https://pancakeswap.finance/" + ), + tlos: new Token(MAINNET, "0xb6C53431608E626AC81a9776ac3e999c5556717c", 18, "TLOS", "Telos", "https://www.telos.net/"), + nft: new Token(MAINNET, "0x1fC9004eC7E5722891f5f38baE7678efCB11d34D", 6, "NFT", "APENFT", "https://apenft.org"), + stephero: new Token( + MAINNET, + "0xE8176d414560cFE1Bf82Fd73B986823B89E4F545", + 18, + "HERO", + "StepHero", + "https://stephero.io/" + ), + pros: new Token(MAINNET, "0xEd8c8Aa8299C10f067496BB66f8cC7Fb338A3405", 18, "PROS", "Prosper", "https://prosper.so/"), + qbt: new Token(MAINNET, "0x17B7163cf1Dbd286E262ddc68b553D899B93f526", 18, "QBT", "Qubit Token", "https://qbt.fi/"), + cvp: new Token( + MAINNET, + "0x5Ec3AdBDae549Dce842e24480Eb2434769e22B2E", + 18, + "CVP", + "Concentrated Voting Power Token", + "https://powerpool.finance/" + ), + bscdefi: new Token( + MAINNET, + "0x40E46dE174dfB776BB89E04dF1C47d8a66855EB3", + 18, + "BSCDEFI", + "BSC Defi blue chips token", + "https://powerpool.finance/" + ), + busd: new Token( + MAINNET, + "0xC0063D362A8EA40Cb32A774c75683429c2B4860c", + 18, + "BUSD", + "Binance USD", + "https://www.paxos.com/busd/" + ), + dai: new Token( + MAINNET, + "0x1AF3F329e8BE154074D8769D1FFa4eE058B1DBc3", + 18, + "DAI", + "Dai Stablecoin", + "https://www.makerdao.com/" + ), + usdt: new Token( + MAINNET, + "0x55d398326f99059fF775485246999027B3197955", + 18, + "USDT", + "Tether USD", + "https://tether.to/" + ), + btcb: new Token( + MAINNET, + "0x7130d2A12B9BCbFAe4f2634d864A1Ee1Ce3Ead9c", + 18, + "BTCB", + "Binance BTC", + "https://bitcoin.org/" + ), + ust: new Token( + MAINNET, + "0x23396cF899Ca06c4472205fC903bDB4de249D6fC", + 18, + "UST", + "Wrapped UST Token", + "https://mirror.finance/" + ), + eth: new Token( + MAINNET, + "0x2170Ed0880ac9A755fd29B2688956BD959F933F8", + 18, + "ETH", + "Binance-Peg Ethereum Token", + "https://ethereum.org/en/" + ), + usdc: new Token( + MAINNET, + "0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d", + 18, + "USDC", + "Binance-Peg USD Coin", + "https://www.centre.io/usdc" + ), + kalm: new Token( + MAINNET, + "0x4BA0057f784858a48fe351445C672FF2a3d43515", + 18, + "KALM", + "Kalmar Token", + "https://kalmar.io/" + ), + hotcross: new Token( + MAINNET, + "0x4FA7163E153419E0E1064e418dd7A99314Ed27b6", + 18, + "HOTCROSS", + "Hotcross Token", + "https://www.hotcross.com/" + ), + belt: new Token( + MAINNET, + "0xE0e514c71282b6f4e823703a39374Cf58dc3eA4f", + 18, + "BELT", + "Belt Token", + "https://beta.belt.fi/" + ), + watch: new Token( + MAINNET, + "0x7A9f28EB62C791422Aa23CeAE1dA9C847cBeC9b0", + 18, + "WATCH", + "Yieldwatch Token", + "https://yieldwatch.net/" + ), + bry: new Token( + MAINNET, + "0xf859Bf77cBe8699013d6Dbc7C2b926Aaf307F830", + 18, + "BRY", + "Berry Token", + "https://berrydata.co/" + ), + wsote: new Token( + MAINNET, + "0x541E619858737031A1244A5d0Cd47E5ef480342c", + 18, + "wSOTE", + "Soteria Token", + "https://soteria.finance/" + ), + helmet: new Token( + MAINNET, + "0x948d2a81086A075b3130BAc19e4c6DEe1D2E3fE8", + 18, + "Helmet", + "Helmet Token", + "https://www.helmet.insure/" + ), + ten: new Token( + MAINNET, + "0xdFF8cb622790b7F92686c722b02CaB55592f152C", + 18, + "TEN", + "Tenet Token", + "https://www.tenet.farm/" + ), + ditto: new Token( + MAINNET, + "0x233d91A0713155003fc4DcE0AFa871b508B3B715", + 9, + "DITTO", + "Ditto Token", + "https://ditto.money/" + ), + blink: new Token( + MAINNET, + "0x63870A18B6e42b01Ef1Ad8A2302ef50B7132054F", + 6, + "BLINK", + "Blink Token", + "https://blink.wink.org" + ), + syrup: new Token( + MAINNET, + "0x009cF7bC57584b7998236eff51b98A168DceA9B0", + 18, + "SYRUP", + "SyrupBar Token", + "https://pancakeswap.finance/" + ), + pha: new Token( + MAINNET, + "0x0112e557d400474717056C4e6D40eDD846F38351", + 18, + "PHA", + "Phala Token", + "https://phala.network" + ), + babycake: new Token( + MAINNET, + "0xdB8D30b74bf098aF214e862C90E647bbB1fcC58c", + 18, + "BABYCAKE", + "Baby Cake Token", + "https://babycake.app/" + ), + bmon: new Token( + MAINNET, + "0x08ba0619b1e7A582E0BCe5BBE9843322C954C340", + 18, + "BMON", + "Binamon Token", + "https://binamon.org/" + ), + hero: new Token( + MAINNET, + "0xD40bEDb44C081D2935eebA6eF5a3c8A31A1bBE13", + 18, + "HERO", + "Metahero Token", + "https://metahero.io/" + ), + wsg: new Token( + MAINNET, + "0xA58950F05FeA2277d2608748412bf9F802eA4901", + 18, + "WSG", + "Wall Street Games Token", + "https://wsg.gg/" + ), + mcrn: new Token( + MAINNET, + "0xacb2d47827C9813AE26De80965845D80935afd0B", + 18, + "MCRN", + "Macaronswap Token", + "https://www.macaronswap.finance/" + ), + revv: new Token( + MAINNET, + "0x833F307aC507D47309fD8CDD1F835BeF8D702a93", + 18, + "REVV", + "REVV Token", + "https://revvmotorsport.com/" + ), + skill: new Token( + MAINNET, + "0x154A9F9cbd3449AD22FDaE23044319D6eF2a1Fab", + 18, + "SKILL", + "Cryptoblades Token", + "https://www.cryptoblades.io/" + ), + if: new Token( + MAINNET, + "0xB0e1fc65C1a741b4662B813eB787d369b8614Af1", + 18, + "IF", + "Impossible Finance Token", + "https://impossible.finance/" + ), + sps: new Token( + MAINNET, + "0x1633b7157e7638C4d6593436111Bf125Ee74703F", + 18, + "SPS", + "Splinterlands Token", + "https://splinterlands.com" + ), + chess: new Token( + MAINNET, + "0x20de22029ab63cf9A7Cf5fEB2b737Ca1eE4c82A6", + 18, + "CHESS", + "Chess Token", + "https://tranchess.com/" + ), + titan: new Token( + MAINNET, + "0xe898EDc43920F357A93083F1d4460437dE6dAeC2", + 18, + "TITAN", + "Titanswap Token", + "https://titanswap.org" + ), + harmony: new Token( + MAINNET, + "0x03fF0ff224f904be3118461335064bB48Df47938", + 18, + "ONE", + "Harmony ONE Token", + "https://www.harmony.one/" + ), + mask: new Token(MAINNET, "0x2eD9a5C8C13b93955103B9a7C167B67Ef4d568a3", 18, "MASK", "Mask Token", "https://mask.io/"), + dvi: new Token( + MAINNET, + "0x758FB037A375F17c7e195CC634D77dA4F554255B", + 18, + "DVI", + "Dvision Network Token", + "https://dvision.network/" + ), + adx: new Token( + MAINNET, + "0x6bfF4Fb161347ad7de4A625AE5aa3A1CA7077819", + 18, + "ADX", + "Adex Network Token", + "https://www.adex.network" + ), + bscpad: new Token( + MAINNET, + "0x5A3010d4d8D3B5fB49f8B6E57FB9E48063f16700", + 18, + "BSCPAD", + "Bscpad Token", + "https://bscpad.com/" + ), + rabbit: new Token( + MAINNET, + "0x95a1199EBA84ac5f19546519e287d43D2F0E1b41", + 18, + "RABBIT", + "Rabbit Finance Token", + "https://rabbitfinance.io/earn" + ), + form: new Token( + MAINNET, + "0x25A528af62e56512A19ce8c3cAB427807c28CC19", + 18, + "FORM", + "Formation Token", + "https://formation.fi/" + ), + txl: new Token(MAINNET, "0x1FFD0b47127fdd4097E54521C9E2c7f0D66AafC5", 18, "TXL", "Tixl Token", "https://tixl.org/"), + orbs: new Token( + MAINNET, + "0xeBd49b26169e1b52c04cFd19FCf289405dF55F80", + 18, + "ORBS", + "Orbs Token", + "https://www.orbs.com/" + ), + cos: new Token( + MAINNET, + "0x96Dd399F9c3AFda1F194182F71600F1B65946501", + 18, + "COS", + "Contentos Token", + "https://www.contentos.io/" + ), + bunny: new Token( + MAINNET, + "0xC9849E6fdB743d08fAeE3E34dd2D1bc69EA11a51", + 18, + "BUNNY", + "Pancakebunny Token", + "https://pancakebunny.finance/" + ), + alice: new Token( + MAINNET, + "0xAC51066d7bEC65Dc4589368da368b212745d63E8", + 6, + "ALICE", + "My Neighbor Alice Token", + "https://www.myneighboralice.com/" + ), + for: new Token( + MAINNET, + "0x658A109C5900BC6d2357c87549B651670E5b0539", + 18, + "FOR", + "Fortube Token", + "https://www.for.tube/home" + ), + bux: new Token( + MAINNET, + "0x211FfbE424b90e25a15531ca322adF1559779E45", + 18, + "BUX", + "Bux Crypto Token", + "https://getbux.com/bux-crypto/" + ), + nuls: new Token( + MAINNET, + "0x8CD6e29d3686d24d3C2018CEe54621eA0f89313B", + 8, + "NULS", + "Nuls Token", + "https://www.nuls.io/" + ), + ramp: new Token( + MAINNET, + "0x8519EA49c997f50cefFa444d240fB655e89248Aa", + 18, + "RAMP", + "RAMP DEFI Token", + "https://rampdefi.com/" + ), + bfi: new Token( + MAINNET, + "0x81859801b01764D4f0Fa5E64729f5a6C3b91435b", + 18, + "BFI", + "bearn.fi Token", + "https://bearn.fi/" + ), + dexe: new Token( + MAINNET, + "0x039cB485212f996A9DBb85A9a75d898F94d38dA6", + 18, + "DEXE", + "DeXe Token", + "https://dexe.network/" + ), + bel: new Token( + MAINNET, + "0x8443f091997f06a61670B735ED92734F5628692F", + 18, + "BEL", + "Bella Protocol Token", + "https://bella.fi/" + ), + tpt: new Token( + MAINNET, + "0xECa41281c24451168a37211F0bc2b8645AF45092", + 4, + "TPT", + "Tokenpocket Token", + "https://www.tokenpocket.pro/" + ), + xmark: new Token( + MAINNET, + "0x26A5dFab467d4f58fB266648CAe769503CEC9580", + 9, + "xMARK", + "Benchmark Protocol Token", + "https://benchmarkprotocol.finance/" + ), + bmxx: new Token( + MAINNET, + "0x4131b87F74415190425ccD873048C708F8005823", + 18, + "bMXX", + "Multiplier Token", + "https://multiplier.finance/" + ), + iotx: new Token( + MAINNET, + "0x9678E42ceBEb63F23197D726B29b1CB20d0064E5", + 18, + "IOTX", + "Binance-Peg IoTeX Network Token", + "https://iotex.io/" + ), + bor: new Token( + MAINNET, + "0x92D7756c60dcfD4c689290E8A9F4d263b3b32241", + 18, + "BOR", + "BoringDAO Token", + "https://www.boringdao.com/" + ), + bopen: new Token( + MAINNET, + "0xF35262a9d427F96d2437379eF090db986eaE5d42", + 18, + "bOPEN", + "OPEN Governance Token", + "https://opendao.io/" + ), + dodo: new Token( + MAINNET, + "0x67ee3Cb086F8a16f34beE3ca72FAD36F7Db929e2", + 18, + "DODO", + "Dodo Token", + "https://dodoex.io/" + ), + swingby: new Token( + MAINNET, + "0x71DE20e0C4616E7fcBfDD3f875d568492cBE4739", + 18, + "SWINGBY", + "Swingby Network Token", + "https://swingby.network/" + ), + zee: new Token( + MAINNET, + "0x44754455564474A89358B2C2265883DF993b12F0", + 18, + "ZEE", + "Zeroswap Token", + "https://zeroswap.io/" + ), + swgb: new Token( + MAINNET, + "0xE40255C5d7fa7ceEc5120408C78C787CECB4cfdb", + 18, + "SWGb", + "SWGb Token", + "https://swirgepay.com/" + ), + swg: new Token( + MAINNET, + "0xe792f64C582698b8572AAF765bDC426AC3aEfb6B", + 18, + "SWG", + "SWG Token", + "https://swirgepay.com/" + ), + sfp: new Token( + MAINNET, + "0xD41FDb03Ba84762dD66a0af1a6C8540FF1ba5dfb", + 18, + "SFP", + "Safepal Token", + "https://www.safepal.io/" + ), + lina: new Token( + MAINNET, + "0x762539b45A1dCcE3D36d080F74d1AED37844b878", + 18, + "LINA", + "Linear Finance Token", + "https://linear.finance/" + ), + lit: new Token( + MAINNET, + "0xb59490aB09A0f526Cc7305822aC65f2Ab12f9723", + 18, + "LIT", + "Litentry Token", + "https://www.litentry.com/" + ), + hget: new Token( + MAINNET, + "0xC7d8D35EBA58a0935ff2D5a33Df105DD9f071731", + 6, + "HGET", + "Hedget Token", + "https://www.hedget.com/" + ), + bdo: new Token( + MAINNET, + "0x190b589cf9Fb8DDEabBFeae36a813FFb2A702454", + 18, + "BDO", + "Bdollar Token", + "https://bdollar.fi/" + ), + egld: new Token( + MAINNET, + "0xbF7c81FFF98BbE61B40Ed186e4AfD6DDd01337fe", + 18, + "EGLD", + "Elrond Token", + "https://elrond.com/" + ), + front: new Token( + MAINNET, + "0x928e55daB735aa8260AF3cEDadA18B5f70C72f1b", + 18, + "FRONT", + "Frontier Token", + "https://frontier.xyz/" + ), + btcst: new Token( + MAINNET, + "0x78650B139471520656b9E7aA7A5e9276814a38e9", + 17, + "BTCST", + "StandardBTCHashrate Token", + "https://www.1-b.tc/" + ), + bscx: new Token( + MAINNET, + "0x5Ac52EE5b2a633895292Ff6d8A89bB9190451587", + 18, + "BSCX", + "BSCX Token", + "https://bscex.org/" + ), + balbt: new Token( + MAINNET, + "0x72fAa679E1008Ad8382959FF48E392042A8b06f7", + 18, + "bALBT", + "AllianceBlock Token", + "https://allianceblock.io/" + ), + asr: new Token( + MAINNET, + "0x80D5f92C2c8C682070C95495313dDB680B267320", + 2, + "ASR", + "AS Roma Token", + "https://www.chiliz.com" + ), + atm: new Token( + MAINNET, + "0x25E9d05365c867E59C1904E7463Af9F312296f9E", + 2, + "ATM", + "Athletico Madrid Token", + "https://www.chiliz.com" + ), + og: new Token( + MAINNET, + "0xf05E45aD22150677a017Fbd94b84fBB63dc9b44c", + 2, + "OG", + "OG Nice Token", + "https://www.chiliz.com" + ), + reef: new Token( + MAINNET, + "0xF21768cCBC73Ea5B6fd3C687208a7c2def2d966e", + 18, + "REEF", + "Reef.finance Token", + "https://reef.finance/" + ), + juv: new Token( + MAINNET, + "0xC40C9A843E1c6D01b7578284a9028854f6683b1B", + 2, + "JUV", + "Juventus Token", + "https://www.chiliz.com" + ), + psg: new Token( + MAINNET, + "0xBc5609612b7C44BEf426De600B5fd1379DB2EcF1", + 2, + "PSG", + "Paris Saint-Germain Token", + "https://www.chiliz.com" + ), + vai: new Token( + MAINNET, + "0x4BD17003473389A42DAF6a0a729f6Fdb328BbBd7", + 18, + "VAI", + "VAI Stablecoin", + "0x4BD17003473389A42DAF6a0a729f6Fdb328BbBd7" + ), + unfi: new Token( + MAINNET, + "0x728C5baC3C3e370E372Fc4671f9ef6916b814d8B", + 18, + "UNFI", + "UNFI Token", + "https://unifiprotocol.com" + ), + twt: new Token( + MAINNET, + "0x4B0F1812e5Df2A09796481Ff14017e6005508003", + 18, + "TWT", + "Trust Wallet Token", + "https://trustwallet.com/" + ), + hard: new Token( + MAINNET, + "0xf79037F6f6bE66832DE4E7516be52826BC3cBcc4", + 6, + "HARD", + "HARD Token", + "https://hard.kava.io" + ), + broobee: new Token( + MAINNET, + "0xE64F5Cb844946C1F102Bd25bBD87a5aB4aE89Fbe", + 18, + "bROOBEE", + "ROOBEE Token", + "https://roobee.io/" + ), + stax: new Token( + MAINNET, + "0x0Da6Ed8B13214Ff28e9Ca979Dd37439e8a88F6c4", + 18, + "STAX", + "StableX Token", + "https://stablexswap.com/" + ), + nar: new Token( + MAINNET, + "0xA1303E6199b319a891b79685F0537D289af1FC83", + 18, + "NAR", + "Narwhalswap Token", + "https://narwhalswap.org/" + ), + nya: new Token( + MAINNET, + "0xbFa0841F7a90c4CE6643f651756EE340991F99D5", + 18, + "NYA", + "Nyanswop Token", + "https://nyanswop.org/" + ), + ctk: new Token( + MAINNET, + "0xA8c2B8eec3d368C0253ad3dae65a5F2BBB89c929", + 6, + "CTK", + "Certik Token", + "https://www.certik.foundation/" + ), + inj: new Token( + MAINNET, + "0xa2B726B1145A4773F68593CF171187d8EBe4d495", + 18, + "INJ", + "Injective Protocol Token", + "https://injectiveprotocol.com/" + ), + sxp: new Token(MAINNET, "0x47BEAd2563dCBf3bF2c9407fEa4dC236fAbA485A", 18, "SXP", "Swipe Token", "https://swipe.io/"), + alpha: new Token( + MAINNET, + "0xa1faa113cbE53436Df28FF0aEe54275c13B40975", + 18, + "ALPHA", + "Alpha Finance Token", + "https://alphafinance.io/" + ), + xvs: new Token(MAINNET, "0xcF6BB5389c92Bdda8a3747Ddb454cB7a64626C63", 18, "XVS", "Venus Token", "https://venus.io/"), + sushi: new Token( + MAINNET, + "0x947950BcC74888a40Ffa2593C5798F11Fc9124C4", + 18, + "SUSHI", + "Binance-Peg SushiToken", + "https://sushi.com/" + ), + comp: new Token( + MAINNET, + "0x52CE071Bd9b1C4B00A0b92D298c512478CaD67e8", + 18, + "COMP", + "Compound Finance Token", + "https://compound.finance/" + ), + bifi: new Token( + MAINNET, + "0xCa3F508B8e4Dd382eE878A314789373D80A5190A", + 18, + "BIFI", + "Beefy Finance Token", + "https://beefy.finance/" + ), + dusk: new Token( + MAINNET, + "0xB2BD0749DBE21f623d9BABa856D3B0f0e1BFEc9C", + 18, + "DUSK", + "Dusk Network Token", + "https://dusk.network/" + ), + beth: new Token( + MAINNET, + "0x250632378E573c6Be1AC2f97Fcdf00515d0Aa91B", + 18, + "BETH", + "Binance Beacon ETH", + "https://ethereum.org/en/eth2/beacon-chain/" + ), + mamzn: new Token( + MAINNET, + "0x3947B992DC0147D2D89dF0392213781b04B25075", + 18, + "mAMZN", + "Wrapped Mirror AMZN Token", + "https://mirror.finance/" + ), + mgoogl: new Token( + MAINNET, + "0x62D71B23bF15218C7d2D7E48DBbD9e9c650B173f", + 18, + "mGOOGL", + "Wrapped Mirror GOOGL Token", + "https://mirror.finance/" + ), + mnflx: new Token( + MAINNET, + "0xa04F060077D90Fe2647B61e4dA4aD1F97d6649dc", + 18, + "mNFLX", + "Wrapped Mirror NFLX Token", + "https://mirror.finance/" + ), + mtsla: new Token( + MAINNET, + "0xF215A127A196e3988C09d052e16BcFD365Cd7AA3", + 18, + "mTSLA", + "Wrapped Mirror TSLA Token", + "https://mirror.finance/" + ), + ltc: new Token( + MAINNET, + "0x4338665CBB7B2485A8855A139b75D5e34AB0DB94", + 18, + "LTC", + "Binance-Peg Litecoin Token", + "https://litecoin.org/" + ), + ada: new Token( + MAINNET, + "0x3EE2200Efb3400fAbB9AacF31297cBdD1d435D47", + 18, + "ADA", + " Binance-Peg Cardano Token", + "https://www.cardano.org/" + ), + band: new Token( + MAINNET, + "0xAD6cAEb32CD2c308980a548bD0Bc5AA4306c6c18", + 18, + "BAND", + "Binance-Peg Band Protocol Token", + "https://bandprotocol.com/" + ), + dot: new Token( + MAINNET, + "0x7083609fCE4d1d8Dc0C979AAb8c869Ea2C873402", + 18, + "DOT", + "Binance-Peg Polkadot Token", + "https://polkadot.network/" + ), + eos: new Token( + MAINNET, + "0x56b6fB708fC5732DEC1Afc8D8556423A2EDcCbD6", + 18, + "EOS", + "Binance-Peg EOS Token", + "https://eos.io/" + ), + link: new Token( + MAINNET, + "0xF8A0BF9cF54Bb92F17374d9e9A321E6a111a51bD", + 18, + "LINK", + "Binance-Peg Chainlink Token", + "https://chain.link/" + ), + xrp: new Token( + MAINNET, + "0x1D2F0da169ceB9fC7B3144628dB156f3F6c60dBE", + 18, + "XRP", + "Binance-Peg XRP Token", + "https://ripple.com/xrp/" + ), + atom: new Token( + MAINNET, + "0x0Eb3a705fc54725037CC9e008bDede697f62F335", + 18, + "ATOM", + "Binance-Peg Cosmos Token", + "https://cosmos.network/" + ), + yfii: new Token( + MAINNET, + "0x7F70642d88cf1C4a3a7abb072B53B929b653edA5", + 18, + "YFII", + "Binance-Peg YFII.finance Token", + "https://dfi.money/#/" + ), + xtz: new Token( + MAINNET, + "0x16939ef78684453bfDFb47825F8a5F714f12623a", + 18, + "XTZ", + "Binance-Peg Tezos Token", + "https://www.tezos.com/" + ), + bch: new Token( + MAINNET, + "0x8fF795a6F4D97E7887C79beA79aba5cc76444aDf", + 18, + "BCH", + "Binance-Peg Bitcoin Cash Token", + "https://bch.info/" + ), + yfi: new Token( + MAINNET, + "0x88f1A5ae2A3BF98AEAF342D26B30a79438c9142e", + 18, + "YFI", + "Binance-Peg yearn.finance Token", + "https://yearn.finance/" + ), + uni: new Token( + MAINNET, + "0xBf5140A22578168FD562DCcF235E5D43A02ce9B1", + 18, + "UNI", + "Binance-Peg Uniswap Token", + "https://uniswap.org/" + ), + fil: new Token( + MAINNET, + "0x0D8Ce2A99Bb6e3B7Db580eD848240e4a0F9aE153", + 18, + "FIL", + "Binance-Peg Filecoin Token", + "https://filecoin.io/" + ), + bake: new Token( + MAINNET, + "0xE02dF9e3e622DeBdD69fb838bB799E3F168902c5", + 18, + "BAKE", + "Bakeryswap Token", + "https://www.bakeryswap.org/" + ), + burger: new Token( + MAINNET, + "0xAe9269f27437f0fcBC232d39Ec814844a51d6b8f", + 18, + "BURGER", + "Burgerswap Token", + "https://burgerswap.org/" + ), + bdigg: new Token( + MAINNET, + "0x5986D5c77c65e5801a5cAa4fAE80089f870A71dA", + 18, + "bDIGG", + "Badger Sett Digg Token", + "https://badger.finance/" + ), + bbadger: new Token( + MAINNET, + "0x1F7216fdB338247512Ec99715587bb97BBf96eae", + 18, + "bBadger", + "Badger Sett Badger Token", + "https://badger.finance/" + ), + trade: new Token( + MAINNET, + "0x7af173F350D916358AF3e218Bdf2178494Beb748", + 18, + "TRADE", + "Unitrade Token", + "https://unitrade.app/" + ), + pnt: new Token( + MAINNET, + "0xdaacB0Ab6Fb34d24E8a67BfA14BF4D95D4C7aF92", + 18, + "PNT", + "pNetwork Token", + "https://ptokens.io/" + ), + mir: new Token( + MAINNET, + "0x5B6DcF557E2aBE2323c48445E8CC948910d8c2c9", + 18, + "MIR", + "Mirror Protocol Token", + "https://mirror.finance/" + ), + pbtc: new Token( + MAINNET, + "0xeD28A457A5A76596ac48d87C0f577020F6Ea1c4C", + 18, + "pBTC", + "pTokens BTC Token", + "https://ptokens.io/" + ), + lto: new Token( + MAINNET, + "0x857B222Fc79e1cBBf8Ca5f78CB133d1b7CF34BBd", + 18, + "LTO", + "LTO Network Token", + "https://ltonetwork.com/" + ), + pcws: new Token( + MAINNET, + "0xbcf39F0EDDa668C58371E519AF37CA705f2bFcbd", + 18, + "pCWS", + "PolyCrowns Token", + "https://game.seascape.network/" + ), + zil: new Token( + MAINNET, + "0xb86AbCb37C3A4B64f74f59301AFF131a1BEcC787", + 12, + "ZIL", + "Zilliqa Token", + "https://www.zilliqa.com/" + ), + lien: new Token( + MAINNET, + "0x5d684ADaf3FcFe9CFb5ceDe3abf02F0Cdd1012E3", + 8, + "LIEN", + "Lien Finance Token", + "https://lien.finance/" + ), + swth: new Token( + MAINNET, + "0x250b211EE44459dAd5Cd3bCa803dD6a7EcB5d46C", + 8, + "SWTH", + "Switcheo Network Token", + "https://switcheo.network/" + ), + dft: new Token( + MAINNET, + "0x42712dF5009c20fee340B245b510c0395896cF6e", + 18, + "DFT", + "Dfuture Token", + "https://www.dfuture.com/home" + ), + gum: new Token( + MAINNET, + "0xc53708664b99DF348dd27C3Ac0759d2DA9c40462", + 18, + "GUM", + "GourmetGalaxy Token", + "https://gourmetgalaxy.io/" + ), + dego: new Token( + MAINNET, + "0x3FdA9383A84C05eC8f7630Fe10AdF1fAC13241CC", + 18, + "DEGO", + "Dego Finance Token", + "https://bsc.dego.finance/home" + ), + nrv: new Token( + MAINNET, + "0x42F6f551ae042cBe50C739158b4f0CAC0Edb9096", + 18, + "NRV", + "Nerve Finance Token", + "https://nerve.fi/" + ), + easy: new Token( + MAINNET, + "0x7C17c8bED8d14bAccE824D020f994F4880D6Ab3B", + 18, + "EASY", + "EASY Token", + "https://easyfi.network/" + ), + oddz: new Token(MAINNET, "0xCD40F2670CF58720b694968698A5514e924F742d", 18, "ODDZ", "Oddz Token", "https://oddz.fi/"), + hoo: new Token(MAINNET, "0xE1d1F66215998786110Ba0102ef558b22224C016", 8, "HOO", "Hoo Token", "https://hoo.com/"), + apys: new Token( + MAINNET, + "0x37dfACfaeDA801437Ff648A1559d73f4C40aAcb7", + 18, + "APYS", + "APY Swap Token", + "https://apyswap.com/" + ), + bondly: new Token( + MAINNET, + "0x96058f8C3e16576D9BD68766f3836d9A33158f89", + 18, + "BONDLY", + "Bondly Token", + "https://www.bondly.finance/" + ), + tko: new Token( + MAINNET, + "0x9f589e3eabe42ebC94A44727b3f3531C0c877809", + 18, + "TKO", + "Tokocrypto Token", + "https://www.tokocrypto.com/" + ), + itam: new Token( + MAINNET, + "0x04C747b40Be4D535fC83D09939fb0f626F32800B", + 18, + "ITAM", + "Itam Network Token", + "https://itam.network/" + ), + arpa: new Token( + MAINNET, + "0x6F769E65c14Ebd1f68817F5f1DcDb61Cfa2D6f7e", + 18, + "ARPA", + "Arpachain Token", + "https://arpachain.io/" + ), + eps: new Token( + MAINNET, + "0xA7f552078dcC247C2684336020c03648500C6d9F", + 18, + "EPS", + "Ellipsis Finance Token", + "https://ellipsis.finance/" + ), + jgn: new Token( + MAINNET, + "0xC13B7a43223BB9Bf4B69BD68Ab20ca1B79d81C75", + 18, + "JGN", + "Juggernaut DeFi Token", + "https://jgndefi.com/" + ), + tlm: new Token( + MAINNET, + "0x2222227E22102Fe3322098e4CBfE18cFebD57c95", + 4, + "TLM", + "Alien Worlds Trilium Token", + "https://alienworlds.io/" + ), + perl: new Token( + MAINNET, + "0x0F9E4D49f25de22c2202aF916B681FBB3790497B", + 18, + "PERL", + "Perlin", + "https://perlinx.finance/" + ), + alpa: new Token( + MAINNET, + "0xc5E6689C9c8B02be7C49912Ef19e79cF24977f03", + 18, + "ALPA", + "AlpaToken", + "https://bsc.alpaca.city/" + ), + hzn: new Token( + MAINNET, + "0xC0eFf7749b125444953ef89682201Fb8c6A917CD", + 18, + "HZN", + "Horizon Protocol Token", + "https://horizonprotocol.com/" + ), + suter: new Token( + MAINNET, + "0x4CfbBdfBd5BF0814472fF35C72717Bd095ADa055", + 18, + "SUTER", + "Suterusu Token", + "https://shield.suterusu.io/" + ), + cgg: new Token( + MAINNET, + "0x1613957159E9B0ac6c80e824F7Eea748a32a0AE2", + 18, + "CGG", + "pTokens CGG Token", + "https://chainguardians.io/" + ), + mix: new Token( + MAINNET, + "0xB67754f5b4C704A24d2db68e661b2875a4dDD197", + 18, + "MIX", + "Mix Token", + "https://mixie.chainguardians.io/" + ), + hakka: new Token( + MAINNET, + "0x1D1eb8E8293222e1a29d2C0E4cE6C0Acfd89AaaC", + 18, + "HAKKA", + "Hakka Token", + "https://hakka.finance/" + ), + xed: new Token( + MAINNET, + "0x5621b5A3f4a8008c4CCDd1b942B121c8B1944F1f", + 18, + "XED", + "Exeedme Token", + "https://www.exeedme.com/" + ), + τbtc: new Token( + MAINNET, + "0x2cD1075682b0FCCaADd0Ca629e138E64015Ba11c", + 9, + "τBTC", + "τBitcoin Token", + "https://www.btcst.finance/" + ), + alpaca: new Token( + MAINNET, + "0x8F0528cE5eF7B51152A59745bEfDD91D97091d2F", + 18, + "ALPACA", + "AlpacaToken", + "https://www.alpacafinance.org/" + ), + dfd: new Token( + MAINNET, + "0x9899a98b222fCb2f3dbee7dF45d943093a4ff9ff", + 18, + "DFD", + "DefiDollar DAO", + "https://dusd.finance/" + ), + lmt: new Token( + MAINNET, + "0x9617857E191354dbEA0b714d78Bc59e57C411087", + 18, + "LMT", + "Lympo Market Token", + "https://lympo.io/lmt/" + ), + btt: new Token( + MAINNET, + "0x8595F9dA7b868b1822194fAEd312235E43007b49", + 18, + "BTT", + "Binance-Peg BitTorrent Token", + "https://www.bittorrent.com/" + ), + trx: new Token( + MAINNET, + "0x85EAC5Ac2F758618dFa09bDbe0cf174e7d574D5B", + 18, + "TRX", + "TRON Token", + "https://tron.network/" + ), + win: new Token( + MAINNET, + "0xaeF0d72a118ce24feE3cD1d43d383897D05B4e99", + 18, + "WIN", + "WIN Token", + "https://winklink.org/" + ), + mcoin: new Token( + MAINNET, + "0x49022089e78a8D46Ec87A3AF86a1Db6c189aFA6f", + 18, + "MCOIN", + "Wrapped Mirror COIN Token", + "https://mirror.finance/" + ), + math: new Token( + MAINNET, + "0xF218184Af829Cf2b0019F8E6F0b2423498a36983", + 18, + "MATH", + "MATH Token", + "https://mathwallet.org/" + ), + kun: new Token( + MAINNET, + "0x1A2fb0Af670D0234c2857FaD35b789F8Cb725584", + 18, + "KUN", + "QIAN governance token", + "https://chemix.io/home" + ), + qsd: new Token( + MAINNET, + "0x07AaA29E63FFEB2EBf59B33eE61437E1a91A3bb2", + 18, + "QSD", + "QIAN second generation dollar", + "https://chemix.io/home" + ), + hyfi: new Token( + MAINNET, + "0x9a319b959e33369C5eaA494a770117eE3e585318", + 18, + "HYFI", + "HYFI Token", + "https://hyfi.pro/#/" + ), + oin: new Token( + MAINNET, + "0x658E64FFcF40D240A43D52CA9342140316Ae44fA", + 8, + "OIN", + "oinfinance Token", + "https://oin.finance/" + ), + doge: new Token( + MAINNET, + "0xbA2aE424d960c26247Dd6c32edC70B295c744C43", + 8, + "DOGE", + "Binance-Peg Dogecoin", + "https://dogecoin.com/" + ), + fine: new Token( + MAINNET, + "0x4e6415a5727ea08aAE4580057187923aeC331227", + 18, + "FINE", + "Refinable Token", + "https://refinable.com/" + ), + one: new Token( + MAINNET, + "0x04BAf95Fd4C52fd09a56D840bAEe0AB8D7357bf0", + 18, + "ONE", + "BigONE Token", + "https://www.bigone.com/" + ), + pmon: new Token( + MAINNET, + "0x1796ae0b0fa4862485106a0de9b654eFE301D0b2", + 18, + "PMON", + "Polkamon Token", + "https://polkamon.com/" + ), + τdoge: new Token( + MAINNET, + "0xe550a593d09FBC8DCD557b5C88Cea6946A8b404A", + 8, + "τDOGE", + "τDogecoin", + "https://www.btcst.finance/" + ), + btr: new Token( + MAINNET, + "0x5a16E8cE8cA316407c6E6307095dc9540a8D62B3", + 18, + "BTR", + "Bitrue Token", + "https://www.bitrue.com/" + ), + ubxt: new Token( + MAINNET, + "0xBbEB90cFb6FAFa1F69AA130B7341089AbeEF5811", + 18, + "UBXT", + "UpBots Token", + "https://upbots.com/" + ), + wmass: new Token( + MAINNET, + "0x7e396BfC8a2f84748701167c2d622F041A1D7a17", + 8, + "WMASS", + "Wrapped MASS Token", + "https://massnet.org/en/" + ), + rfox: new Token( + MAINNET, + "0x0a3A21356793B49154Fd3BbE91CBc2A16c0457f5", + 18, + "RFOX", + "RFOX Token", + "https://www.redfoxlabs.io/" + ), + xend: new Token( + MAINNET, + "0x4a080377f83D669D7bB83B3184a8A5E61B500608", + 18, + "XEND", + "XEND Token", + "https://xend.finance/" + ), + cyc: new Token(MAINNET, "0x810EE35443639348aDbbC467b33310d2AB43c168", 18, "CYC", "CYC Token", "https://cyclone.xyz/"), + chr: new Token( + MAINNET, + "0xf9CeC8d50f6c8ad3Fb6dcCEC577e05aA32B224FE", + 6, + "CHR", + "Chroma Token", + "https://chromia.com/" + ), + deri: new Token( + MAINNET, + "0xe60eaf5A997DFAe83739e035b005A33AfdCc6df5", + 18, + "DERI", + "Deri Token", + "https://deri.finance/#/index" + ), + well: new Token( + MAINNET, + "0xf07a32Eb035b786898c00bB1C64d8c6F8E7a46D5", + 18, + "WELL", + "BitWell Token", + "https://www.bitwellex.com/" + ), + wex: new Token( + MAINNET, + "0xa9c41A46a6B3531d28d5c32F6633dd2fF05dFB90", + 18, + "WEX", + "WaultSwap Token", + "https://wault.finance/" + ), + waultx: new Token( + MAINNET, + "0xB64E638E60D154B43f660a6BF8fD8a3b249a6a21", + 18, + "WAULTx", + "Wault Token", + "https://wault.finance/" + ), + popen: new Token( + MAINNET, + "0xaBaE871B7E3b67aEeC6B46AE9FE1A91660AadAC5", + 18, + "pOPEN", + "OPEN Governance Token", + "https://opendao.io/" + ), + ez: new Token( + MAINNET, + "0x5512014efa6Cd57764Fa743756F7a6Ce3358cC83", + 18, + "EZ", + "Easy V2 Token", + "https://easyfi.network/" + ), + vrt: new Token( + MAINNET, + "0x5F84ce30DC3cF7909101C69086c50De191895883", + 18, + "VRT", + "Venus Reward Token", + "https://venus.io/" + ), + tusd: new Token( + MAINNET, + "0x14016E85a25aeb13065688cAFB43044C2ef86784", + 18, + "TUSD", + "Binance-Peg TrueUSD Token", + "https://www.trueusd.com/" + ), + mtrg: new Token( + MAINNET, + "0xBd2949F67DcdC549c6Ebe98696449Fa79D988A9F", + 18, + "MTRG", + "Wrapped MTRG Token", + "https://www.meter.io/" + ), + ktn: new Token( + MAINNET, + "0xDAe6c2A48BFAA66b43815c5548b10800919c993E", + 18, + "KTN", + "Kattana Token", + "https://kattana.io/" + ), + qkc: new Token( + MAINNET, + "0xA1434F1FC3F437fa33F7a781E041961C0205B5Da", + 18, + "QKC", + "QuarkChain Token", + "https://quarkchain.io/" + ), + bcfx: new Token( + MAINNET, + "0x045c4324039dA91c52C55DF5D785385Aab073DcF", + 18, + "bCFX", + "BSC Conflux Token", + "https://www.confluxnetwork.org/" + ), + mx: new Token(MAINNET, "0x9F882567A62a5560d147d64871776EeA72Df41D3", 18, "MX", "MX Token", "https://www.mxc.com/"), + ata: new Token( + MAINNET, + "0xA2120b9e674d3fC3875f415A7DF52e382F141225", + 18, + "ATA", + "Automata Token", + "https://www.ata.network/" + ), + mbox: new Token( + MAINNET, + "0x3203c9E46cA618C8C1cE5dC67e7e9D75f5da2377", + 18, + "MBOX", + "Mobox Token", + "https://www.mobox.io/#/" + ), + boring: new Token( + MAINNET, + "0xffEecbf8D7267757c2dc3d13D730E97E15BfdF7F", + 18, + "BORING", + "BoringDAO Token", + "https://www.boringdao.com/" + ), + marsh: new Token( + MAINNET, + "0x2FA5dAF6Fe0708fBD63b1A7D1592577284f52256", + 18, + "MARSH", + "Unmarshal Token", + "https://unmarshal.io/" + ), + ampl: new Token( + MAINNET, + "0xDB021b1B247fe2F1fa57e0A87C748Cc1E321F07F", + 9, + "AMPL", + "AMPL Token", + "https://www.ampleforth.org/" + ), + o3: new Token( + MAINNET, + "0xEe9801669C6138E84bD50dEB500827b776777d28", + 18, + "O3", + "O3 Swap Token", + "https://o3swap.com/" + ), + hai: new Token(MAINNET, "0xaA9E582e5751d703F85912903bacADdFed26484C", 8, "HAI", "Hacken Token", "https://hacken.io/"), + htb: new Token( + MAINNET, + "0x4e840AADD28DA189B9906674B4Afcb77C128d9ea", + 18, + "HTB", + "Hotbit Token", + "https://www.hotbit.io/" + ), + woo: new Token( + MAINNET, + "0x4691937a7508860F876c9c0a2a617E7d9E945D4B", + 18, + "WOO", + "Wootrade Network Token", + "https://woo.network/" + ), + $dg: new Token( + MAINNET, + "0x9Fdc3ae5c814b79dcA2556564047C5e7e5449C19", + 18, + "$DG", + "Decentral Games Token", + "https://decentral.games/" + ), + safemoon: new Token( + MAINNET, + "0x8076C74C5e3F5852037F31Ff0093Eeb8c8ADd8D3", + 9, + "SAFEMOON", + "Safemoon Token", + "https://safemoon.net/" + ), + axs: new Token( + MAINNET, + "0x715D400F88C167884bbCc41C5FeA407ed4D2f8A0", + 18, + "AXS", + "Binance-Pegged Axie Infinity Shard", + "https://axieinfinity.com/" + ), + c98: new Token( + MAINNET, + "0xaEC945e04baF28b135Fa7c640f624f8D90F1C3a6", + 18, + "c98", + "Coin98 Token", + "https://coin98.com/" + ), + pots: new Token( + MAINNET, + "0x3Fcca8648651E5b974DD6d3e50F61567779772A8", + 18, + "POTS", + "Moonpot Token", + "https://moonpot.com/" + ), + gnt: new Token( + MAINNET, + "0xF750A26EB0aCf95556e8529E72eD530f3b60f348", + 18, + "GNT", + "GreenTrust Token", + "https://www.greentrusttoken.com/" + ), + rusd: new Token( + MAINNET, + "0x07663837218A003e66310a01596af4bf4e44623D", + 18, + "rUSD", + "rUSD Token", + "https://appv2.rampdefi.com/#/" + ), + bp: new Token( + MAINNET, + "0xACB8f52DC63BB752a51186D1c55868ADbFfEe9C1", + 18, + "BP", + "BunnyPark Token", + "https://www.bunnypark.com/" + ), + sfund: new Token( + MAINNET, + "0x477bC8d23c634C154061869478bce96BE6045D12", + 18, + "SFUND", + "Seedify Fund Token", + "https://seedify.fund/" + ), + naos: new Token( + MAINNET, + "0x758d08864fB6cCE3062667225ca10b8F00496cc2", + 18, + "NAOS", + "NAOSToken", + "https://naos.finance/" + ), + dooda: new Token( + MAINNET, + "0xa6902946F5F20d875Cb1E337EBA5E769B89D89e2", + 18, + "DOODA", + "Doodaswap Token", + "https://www.doodaswap.finace/" + ), + troad: new Token( + MAINNET, + "0x637A86aFf37dF6cD3c6c16439a4bdeE32272Fdc7", + 18, + "TROAD", + "Techroadaswap Token", + "https://www.techroad.finace/" + ), +}; + +export const testnetTokens = { + bnb: new Token(TESTNET, "0xCde538bd8954eAd01C56194F5C9905B310a5bd0E", 18, "BNB", "BNB", "https://www.binance.com/"), + wbnb: new Token( + TESTNET, + "0xCde538bd8954eAd01C56194F5C9905B310a5bd0E", + 18, + "WBNB", + "Wrapped BNB", + "https://www.binance.com/" + ), + cake: new Token( + TESTNET, + "0xa35062141Fa33BCA92Ce69FeD37D0E8908868AAe", + 18, + "CAKE", + "PancakeSwap Token", + "https://pancakeswap.finance/" + ), + busd: new Token( + TESTNET, + "0x78867BbEeF44f2326bF8DDd1941a4439382EF2A7", + 18, + "BUSD", + "Binance USD", + "https://www.paxos.com/busd/" + ), + syrup: new Token( + TESTNET, + "0x0310ccb6b80f6f9db07ce2e0f67982586000aacd", + 18, + "SYRUP", + "SyrupBar Token", + "https://pancakeswap.finance/" + ), + bake: new Token( + TESTNET, + "0xE02dF9e3e622DeBdD69fb838bB799E3F168902c5", + 18, + "BAKE", + "Bakeryswap Token", + "https://www.bakeryswap.org/" + ), + dooda: new Token( + TESTNET, + "0x5014d0abfc8428f0f8ccd0c5f010fe47569d8d34", + 18, + "DOODA", + "Doodaswap Token", + "https://www.doodaswap.finace/" + ), + troad: new Token( + TESTNET, + "0x637A86aFf37dF6cD3c6c16439a4bdeE32272Fdc7", + 18, + "TROAD", + "Techroadaswap Token", + "https://www.techroad.finace/" + ), +}; + +const tokens = (): TokenList => { + const chainId = process.env.REACT_APP_CHAIN_ID; + + // If testnet - return list comprised of testnetTokens wherever they exist, and mainnetTokens where they don't + // if (parseInt(chainId!, 10) === ChainId.TESTNET) { + // // eslint-disable-next-line @typescript-eslint/ban-types + // return Object.keys(mainnetTokens).reduce((accum, key: any) => { + // return { ...accum, [key]: testnetTokens[key] || mainnetTokens[key] }; + // }, {}); + // } + + return mainnetTokens; +}; + +// export const serializeTokens = (): SerializedTokenList => { +// const unserializedTokens = tokens(); +// const serializedTokens = Object.keys(unserializedTokens).reduce((accum, key) => { +// return { ...accum, [key]: serializeToken(unserializedTokens[key]) }; +// }, {}); + +// return serializedTokens; +// }; + +export default tokens(); diff --git a/packages/pancake-uikit/src/config/constants/types.ts b/packages/pancake-uikit/src/config/constants/types.ts new file mode 100644 index 0000000..ced3198 --- /dev/null +++ b/packages/pancake-uikit/src/config/constants/types.ts @@ -0,0 +1,256 @@ +import BigNumber from "bignumber.js"; +import { Token } from "@doodaswap/sdk"; + +export type TranslatableText = + | string + | { + key: string; + data?: { + [key: string]: string | number; + }; + }; +export interface Address { + 97?: string; + 56: string; +} +export interface oldCustomToken { + symbol: string; + address?: Address; + decimals?: number; + projectLink?: string; + busdPrice?: string; +} + +export interface SerializedToken { + chainId: number; + address: string; + decimals: number; + symbol?: string; + name?: string; + projectLink?: string; +} + +export enum PoolIds { + poolBasic = "poolBasic", + poolUnlimited = "poolUnlimited", +} + +export type IfoStatus = "idle" | "coming_soon" | "live" | "finished"; + +interface IfoPoolInfo { + saleAmount: string; + raiseAmount: string; + cakeToBurn: string; + distributionRatio: number; // Range [0-1] +} + +export interface Ifo { + id: string; + isActive: boolean; + address: string; + name: string; + currency: Token; + token: Token; + releaseBlockNumber: number; + articleUrl: string; + campaignId: string; + tokenOfferingPrice: number; + version: number; + [PoolIds.poolBasic]?: IfoPoolInfo; + [PoolIds.poolUnlimited]: IfoPoolInfo; +} + +export enum PoolCategory { + "COMMUNITY" = "Community", + "CORE" = "Core", + "BINANCE" = "Binance", // Pools using native BNB behave differently than pools using a token + "AUTO" = "Auto", +} + +interface FarmConfigBaseProps { + pid: number; + lpSymbol: string; + lpAddresses: Address; + multiplier?: string; + isCommunity?: boolean; + dual?: { + rewardPerBlock: number; + earnLabel: string; + endBlock: number; + }; +} +export interface FarmConfig { + pid: number; + lpSymbol: string; + lpAddresses: Address; + token: Token; + quoteToken: Token; + multiplier?: string; + isCommunity?: boolean; + dual?: { + rewardPerBlock: number; + earnLabel: string; + endBlock: number; + }; +} +export interface OldFarmConfig { + pid: number; + lpSymbol: string; + lpAddresses: Address; + token: Token; + quoteToken: Token; + multiplier?: string; + isCommunity?: boolean; + dual?: { + rewardPerBlock: number; + earnLabel: string; + endBlock: number; + }; +} + +export interface SerializedFarmConfig extends FarmConfigBaseProps { + token: SerializedToken; + quoteToken: SerializedToken; +} + +export interface DeserializedFarmConfig extends FarmConfigBaseProps { + token: Token; + quoteToken: Token; + // oldQuoteToken: oldCustomToken +} + +interface PoolConfigBaseProps { + sousId: number; + contractAddress: Address; + poolCategory: PoolCategory; + tokenPerBlock: string; + sortOrder?: number; + harvest?: boolean; + isFinished?: boolean; + enableEmergencyWithdraw?: boolean; +} + +export interface SerializedPoolConfig extends PoolConfigBaseProps { + earningToken: SerializedToken; + stakingToken: SerializedToken; +} + +export interface DeserializedPoolConfig extends PoolConfigBaseProps { + earningToken: Token; + stakingToken: Token; +} + +export type Images = { + lg: string; + md: string; + sm: string; + ipfs?: string; +}; + +export type TeamImages = { + alt: string; +} & Images; + +export type Team = { + id: number; + name: string; + description: string; + isJoinable?: boolean; + users: number; + points: number; + images: TeamImages; + background: string; + textColor: string; +}; + +export type CampaignType = "ifo" | "teambattle" | "participation"; + +export type Campaign = { + id: string; + type: CampaignType; + title?: TranslatableText; + description?: TranslatableText; + badge?: string; +}; + +export type PageMeta = { + title: string; + description?: string; + image?: string; +}; + +export enum LotteryStatus { + PENDING = "pending", + OPEN = "open", + CLOSE = "close", + CLAIMABLE = "claimable", +} + +export interface LotteryTicket { + id: string; + number: string; + status: boolean; + rewardBracket?: number; + roundId?: string; + cakeReward?: string; +} + +export interface LotteryTicketClaimData { + ticketsWithUnclaimedRewards: LotteryTicket[]; + allWinningTickets: LotteryTicket[]; + cakeTotal: BigNumber; + roundId: string; +} + +// Farm Auction +export interface FarmAuctionBidderConfig { + account: string; + farmName: string; + tokenAddress: string; + quoteToken: Token; + tokenName: string; + projectSite?: string; + lpAddress?: string; +} + +// Note: this status is slightly different compared to 'status' comfing +// from Farm Auction smart contract +export enum AuctionStatus { + ToBeAnnounced, // No specific dates/blocks to display + Pending, // Auction is scheduled but not live yet (i.e. waiting for startBlock) + Open, // Auction is open for bids + Finished, // Auction end block is reached, bidding is not possible + Closed, // Auction was closed in smart contract +} + +export interface Auction { + id: number; + status: AuctionStatus; + startBlock: number; + startDate: Date; + endBlock: number; + endDate: Date; + auctionDuration: number; + initialBidAmount: number; + topLeaderboard: number; + leaderboardThreshold: BigNumber; +} + +export interface BidderAuction { + id: number; + amount: BigNumber; + claimed: boolean; +} + +export interface Bidder extends FarmAuctionBidderConfig { + position?: number; + isTopPosition: boolean; + samePositionAsAbove: boolean; + amount: BigNumber; +} + +export interface ConnectedBidder { + account: string; + isWhitelisted: boolean; + bidderData?: Bidder; +} diff --git a/packages/pancake-uikit/src/config/index.ts b/packages/pancake-uikit/src/config/index.ts new file mode 100644 index 0000000..3c1f5b8 --- /dev/null +++ b/packages/pancake-uikit/src/config/index.ts @@ -0,0 +1,35 @@ +import { ChainId } from "@doodaswap/sdk"; +import BigNumber from "bignumber.js/bignumber"; +import { BIG_TEN } from "../utils/bigNumber"; + +BigNumber.config({ + EXPONENTIAL_AT: 1000, + DECIMAL_PLACES: 80, +}); + +export const BSC_BLOCK_TIME = 3; + +export const BASE_BSC_SCAN_URLS = { + [ChainId.MAINNET]: "https://bscscan.com", + [ChainId.TESTNET]: "https://testnet.bscscan.com", +}; + +// CAKE_PER_BLOCK details +// 40 CAKE is minted per block +// 20 CAKE per block is sent to Burn pool (A farm just for burning cake) +// 10 CAKE per block goes to CAKE syrup pool +// 9 CAKE per block goes to Yield farms and lottery +// CAKE_PER_BLOCK in config/index.ts = 40 as we only change the amount sent to the burn pool which is effectively a farm. +// CAKE/Block in src/views/Home/components/CakeDataRow.tsx = 15 (40 - Amount sent to burn pool) +export const CAKE_PER_BLOCK = 40; +export const BLOCKS_PER_YEAR = (60 / BSC_BLOCK_TIME) * 60 * 24 * 365; // 10512000 +export const CAKE_PER_YEAR = CAKE_PER_BLOCK * BLOCKS_PER_YEAR; +export const BASE_URL = "https://pancakeswap.finance"; +export const BASE_ADD_LIQUIDITY_URL = `${BASE_URL}/add`; +export const BASE_BSC_SCAN_URL = BASE_BSC_SCAN_URLS[ChainId.MAINNET]; +export const DEFAULT_TOKEN_DECIMAL = BIG_TEN.pow(18); +export const DEFAULT_GAS_LIMIT = 200000; +export const AUCTION_BIDDERS_TO_FETCH = 500; +export const RECLAIM_AUCTIONS_TO_FETCH = 500; +export const AUCTION_WHITELISTED_BIDDERS_TO_FETCH = 500; +export const IPFS_GATEWAY = "https://ipfs.io/ipfs"; diff --git a/packages/pancake-uikit/src/hooks/Tokens.ts b/packages/pancake-uikit/src/hooks/Tokens.ts new file mode 100644 index 0000000..c900156 --- /dev/null +++ b/packages/pancake-uikit/src/hooks/Tokens.ts @@ -0,0 +1,205 @@ +/* eslint-disable no-param-reassign */ +// eslint-disable-next-line import/no-extraneous-dependencies +import { parseBytes32String } from "@ethersproject/strings"; +import { Currency, ETHER, Token, currencyEquals } from "@doodaswap/sdk"; +import { useMemo } from "react"; +import { arrayify } from "ethers/lib/utils"; +import useActiveWeb3React from "./useActiveWeb3React"; +import { + TokenAddressMap, + useDefaultTokenList, + useUnsupportedTokenList, + useCombinedActiveList, + useCombinedInactiveList, +} from "../state/lists/hooks"; + +// import { NEVER_RELOAD, useSingleCallResult } from "../state/multicall/hooks"; +import useUserAddedTokens from "../state/user/hooks/useUserAddedTokens"; +import { NEVER_RELOAD, useSingleCallResult } from "../state/multicall/hooks"; +import { isAddress } from "../utils"; + +import { useBytes32TokenContract, useTokenContract } from "./useContract"; +// import { filterTokens } from "../components/SearchModal/filtering"; + +// reduce token map into standard address <-> Token mapping, optionally include user added tokens +function useTokensFromMap(tokenMap: TokenAddressMap, includeUserAdded: boolean): { [address: string]: Token } { + const { chainId } = useActiveWeb3React(); + const userAddedTokens = useUserAddedTokens(); + + return useMemo(() => { + if (!chainId) return {}; + + // reduce to just tokens + const mapWithoutUrls = Object.keys(tokenMap[56]).reduce<{ [address: string]: Token }>((newMap, address) => { + newMap[address] = tokenMap[56][address].token; + return newMap; + }, {}); + + if (includeUserAdded) { + return ( + userAddedTokens + // reduce into all ALL_TOKENS filtered by the current chain + .reduce<{ [address: string]: Token }>( + (tokenMap_, token) => { + tokenMap_[token.address] = token; + return tokenMap_; + }, + // must make a copy because reduce modifies the map, and we do not + // want to make a copy in every iteration + { ...mapWithoutUrls } + ) + ); + } + + return mapWithoutUrls; + }, [chainId, userAddedTokens, tokenMap, includeUserAdded]); +} + +// export function useDefaultTokens(): { [address: string]: Token } { +// const defaultList = useDefaultTokenList(); +// return useTokensFromMap(defaultList, false); +// } + +export function useAllTokens(): { [address: string]: Token } { + const allTokens = useCombinedActiveList(); + return useTokensFromMap(allTokens, true); +} +export default null; + +// // export function useAllInactiveTokens(): { [address: string]: Token } { +// // // get inactive tokens +// // const inactiveTokensMap = useCombinedInactiveList(); +// // const inactiveTokens = useTokensFromMap(inactiveTokensMap, false); + +// // // filter out any token that are on active list +// // const activeTokensAddresses = Object.keys(useAllTokens()); +// // const filteredInactive = activeTokensAddresses +// // ? Object.keys(inactiveTokens).reduce<{ [address: string]: Token }>((newMap, address) => { +// // if (!activeTokensAddresses.includes(address)) { +// // newMap[address] = inactiveTokens[address]; +// // } +// // return newMap; +// // }, {}) +// // : inactiveTokens; + +// // return filteredInactive; +// // } + +// export function useUnsupportedTokens(): { [address: string]: Token } { +// const unsupportedTokensMap = useUnsupportedTokenList(); +// return useTokensFromMap(unsupportedTokensMap, false); +// } + +// export function useIsTokenActive(token: Token | undefined | null): boolean { +// const activeTokens = useAllTokens(); + +// if (!activeTokens || !token) { +// return false; +// } + +// return !!activeTokens[token.address]; +// } + +// // used to detect extra search results +// export function useFoundOnInactiveList(searchQuery: string): Token[] | undefined { +// const { chainId } = useActiveWeb3React(); +// const inactiveTokens = useAllInactiveTokens(); + +// return useMemo(() => { +// if (!chainId || searchQuery === "") { +// return undefined; +// } +// const tokens = filterTokens(Object.values(inactiveTokens), searchQuery); +// return tokens; +// }, [chainId, inactiveTokens, searchQuery]); +// } + +// // Check if currency is included in custom list from user storage +// export function useIsUserAddedToken(currency: Currency | undefined | null): boolean { +// const userAddedTokens = useUserAddedTokens(); + +// if (!currency) { +// return false; +// } + +// return !!userAddedTokens.find((token) => currencyEquals(currency, token)); +// } + +// // parse a name or symbol from a token response +// const BYTES32_REGEX = /^0x[a-fA-F0-9]{64}$/; + +// function parseStringOrBytes32(str: string | undefined, bytes32: string | undefined, defaultValue: string): string { +// return str && str.length > 0 +// ? str +// : // need to check for proper bytes string and valid terminator +// bytes32 && BYTES32_REGEX.test(bytes32) && arrayify(bytes32)[31] === 0 +// ? parseBytes32String(bytes32) +// : defaultValue; +// } + +// // undefined if invalid or does not exist +// // null if loading +// // otherwise returns the token +export function useToken(tokenAddress?: string): Token | undefined | null { + const { chainId } = useActiveWeb3React(); + const tokens = useAllTokens(); + + const address = isAddress(tokenAddress); + + const tokenContract = useTokenContract(address || undefined, false); + const tokenContractBytes32 = useBytes32TokenContract(address || undefined, false); + const token: Token | undefined = address ? tokens[address] : undefined; + + const tokenName = useSingleCallResult(token ? undefined : tokenContract, "name", undefined, NEVER_RELOAD); + const tokenNameBytes32 = useSingleCallResult( + token ? undefined : tokenContractBytes32, + "name", + undefined, + NEVER_RELOAD + ); + const symbol = useSingleCallResult(token ? undefined : tokenContract, "symbol", undefined, NEVER_RELOAD); + const symbolBytes32 = useSingleCallResult( + token ? undefined : tokenContractBytes32, + "symbol", + undefined, + NEVER_RELOAD + ); + const decimals = useSingleCallResult(token ? undefined : tokenContract, "decimals", undefined, NEVER_RELOAD); + + return useMemo(() => { + if (token) return token; + if (!chainId || !address) return undefined; + if (decimals.loading || symbol.loading || tokenName.loading) return null; + if (decimals.result) { + return new Token( + chainId, + address, + decimals.result[0], + parseStringOrBytes32(symbol.result?.[0], symbolBytes32.result?.[0], "UNKNOWN"), + parseStringOrBytes32(tokenName.result?.[0], tokenNameBytes32.result?.[0], "Unknown Token") + ); + } + return undefined; + }, [ + address, + chainId, + decimals.loading, + decimals.result, + symbol.loading, + symbol.result, + symbolBytes32.result, + token, + tokenName.loading, + tokenName.result, + tokenNameBytes32.result, + ]); +} + +export function useCurrency(currencyId: string | undefined): Currency | null | undefined { + const isBNB = currencyId?.toUpperCase() === "BNB"; + const token = useToken(isBNB ? undefined : currencyId); + return isBNB ? ETHER : token; +} +function parseStringOrBytes32(arg0: any, arg1: any, arg2: string): string | undefined { + throw new Error("Function not implemented."); +} diff --git a/packages/pancake-uikit/src/hooks/Trades.ts b/packages/pancake-uikit/src/hooks/Trades.ts new file mode 100644 index 0000000..1c0f6f6 --- /dev/null +++ b/packages/pancake-uikit/src/hooks/Trades.ts @@ -0,0 +1,207 @@ +/* eslint-disable no-param-reassign */ +// import { isTradeBetter } from "utils/trades"; +import { Currency, CurrencyAmount, Pair, Token, Trade, Percent, currencyEquals } from "@doodaswap/sdk"; +import flatMap from "lodash/flatMap"; +import { useMemo } from "react"; +import useActiveWeb3React from "./useActiveWeb3React"; + +import { useUserSingleHopOnly } from "../state/user/hooks"; +import { + BASES_TO_CHECK_TRADES_AGAINST, + CUSTOM_BASES, + BETTER_TRADE_LESS_HOPS_THRESHOLD, + ADDITIONAL_BASES, + ZERO_PERCENT, + ONE_HUNDRED_PERCENT, +} from "../config/constants"; +import { PairState, usePairs } from "./usePairs"; +import { wrappedCurrency } from "../utils/wrappedCurrency"; + +// import { useUnsupportedTokens } from "./Tokens"; +// eslint-disable-next-line import/no-duplicates +// import { ZERO_PERCENT, ONE_HUNDRED_PERCENT } from "../config/constants/index"; + +function isTradeBetter( + tradeA: Trade | undefined | null, + tradeB: Trade | undefined | null, + minimumDelta: Percent = ZERO_PERCENT +): boolean | undefined { + if (tradeA && !tradeB) return false; + if (tradeB && !tradeA) return true; + if (!tradeA || !tradeB) return undefined; + + if ( + tradeA.tradeType !== tradeB.tradeType || + !currencyEquals(tradeA.inputAmount.currency, tradeB.inputAmount.currency) || + !currencyEquals(tradeB.outputAmount.currency, tradeB.outputAmount.currency) + ) { + throw new Error("Trades are not comparable"); + } + + if (minimumDelta.equalTo(ZERO_PERCENT)) { + return tradeA.executionPrice.lessThan(tradeB.executionPrice); + } + return tradeA.executionPrice.raw.multiply(minimumDelta.add(ONE_HUNDRED_PERCENT)).lessThan(tradeB.executionPrice); +} + +function useAllCommonPairs(currencyA?: Currency, currencyB?: Currency): Pair[] { + const { chainId } = useActiveWeb3React(); + + const [tokenA, tokenB] = chainId + ? [wrappedCurrency(currencyA, chainId), wrappedCurrency(currencyB, chainId)] + : [undefined, undefined]; + + const bases: Token[] = useMemo(() => { + if (!chainId) return []; + + const common = BASES_TO_CHECK_TRADES_AGAINST[56]; + const additionalA = tokenA ? ADDITIONAL_BASES[56]?.[tokenA.address] ?? [] : []; + const additionalB = tokenB ? ADDITIONAL_BASES[56]?.[tokenB.address] ?? [] : []; + + return [...common, ...additionalA, ...additionalB]; + }, [chainId, tokenA, tokenB]); + + const basePairs: [Token, Token][] = useMemo( + () => flatMap(bases, (base): [Token, Token][] => bases.map((otherBase) => [base, otherBase])), + [bases] + ); + + const allPairCombinations: [Token, Token][] = useMemo( + () => + tokenA && tokenB + ? [ + // the direct pair + [tokenA, tokenB], + // token A against all bases + ...bases.map((base): [Token, Token] => [tokenA, base]), + // token B against all bases + ...bases.map((base): [Token, Token] => [tokenB, base]), + // each base against all bases + ...basePairs, + ] + .filter((tokens): tokens is [Token, Token] => Boolean(tokens[0] && tokens[1])) + .filter(([t0, t1]) => t0.address !== t1.address) + .filter(([tokenA_, tokenB_]) => { + if (!chainId) return true; + const customBases = CUSTOM_BASES[56]; + + const customBasesA: Token[] | undefined = customBases?.[tokenA_.address]; + const customBasesB: Token[] | undefined = customBases?.[tokenB_.address]; + + if (!customBasesA && !customBasesB) return true; + + if (customBasesA && !customBasesA.find((base) => tokenB_.equals(base))) return false; + if (customBasesB && !customBasesB.find((base) => tokenA_.equals(base))) return false; + + return true; + }) + : [], + [tokenA, tokenB, bases, basePairs, chainId] + ); + + const allPairs = usePairs(allPairCombinations); + + // only pass along valid pairs, non-duplicated pairs + return useMemo( + () => + Object.values( + allPairs + // filter out invalid pairs + .filter((result): result is [PairState.EXISTS, Pair] => Boolean(result[0] === PairState.EXISTS && result[1])) + // filter out duplicated pairs + .reduce<{ [pairAddress: string]: Pair }>((memo, [, curr]) => { + memo[curr.liquidityToken.address] = memo[curr.liquidityToken.address] ?? curr; + return memo; + }, {}) + ), + [allPairs] + ); +} + +const MAX_HOPS = 3; + +/** + * Returns the best trade for the exact amount of tokens in to the given token out + */ +export function useTradeExactIn(currencyAmountIn?: CurrencyAmount, currencyOut?: Currency): Trade | null { + const allowedPairs = useAllCommonPairs(currencyAmountIn?.currency, currencyOut); + + const [singleHopOnly] = useUserSingleHopOnly(); + + return useMemo(() => { + if (currencyAmountIn && currencyOut && allowedPairs.length > 0) { + if (singleHopOnly) { + return ( + Trade.bestTradeExactIn(allowedPairs, currencyAmountIn, currencyOut, { maxHops: 1, maxNumResults: 1 })[0] ?? + null + ); + } + // search through trades with varying hops, find best trade out of them + let bestTradeSoFar: Trade | null = null; + for (let i = 1; i <= MAX_HOPS; i++) { + const currentTrade: Trade | null = + Trade.bestTradeExactIn(allowedPairs, currencyAmountIn, currencyOut, { maxHops: i, maxNumResults: 1 })[0] ?? + null; + // if current trade is best yet, save it + if (isTradeBetter(bestTradeSoFar, currentTrade, BETTER_TRADE_LESS_HOPS_THRESHOLD)) { + bestTradeSoFar = currentTrade; + } + } + return bestTradeSoFar; + } + + return null; + }, [allowedPairs, currencyAmountIn, currencyOut, singleHopOnly]); +} + +/** + * Returns the best trade for the token in to the exact amount of token out + */ +export function useTradeExactOut(currencyIn?: Currency, currencyAmountOut?: CurrencyAmount): Trade | null { + const allowedPairs = useAllCommonPairs(currencyIn, currencyAmountOut?.currency); + + const [singleHopOnly] = useUserSingleHopOnly(); + + return useMemo(() => { + if (currencyIn && currencyAmountOut && allowedPairs.length > 0) { + if (singleHopOnly) { + return ( + Trade.bestTradeExactOut(allowedPairs, currencyIn, currencyAmountOut, { maxHops: 1, maxNumResults: 1 })[0] ?? + null + ); + } + // search through trades with varying hops, find best trade out of them + let bestTradeSoFar: Trade | null = null; + for (let i = 1; i <= MAX_HOPS; i++) { + const currentTrade = + Trade.bestTradeExactOut(allowedPairs, currencyIn, currencyAmountOut, { maxHops: i, maxNumResults: 1 })[0] ?? + null; + if (isTradeBetter(bestTradeSoFar, currentTrade, BETTER_TRADE_LESS_HOPS_THRESHOLD)) { + bestTradeSoFar = currentTrade; + } + } + return bestTradeSoFar; + } + return null; + }, [currencyIn, currencyAmountOut, allowedPairs, singleHopOnly]); +} + +export function useIsTransactionUnsupported(currencyIn?: Currency, currencyOut?: Currency): boolean { + // const unsupportedTokens: { [address: string]: Token } = useUnsupportedTokens(); + const { chainId } = useActiveWeb3React(); + + const tokenIn = wrappedCurrency(currencyIn, chainId); + const tokenOut = wrappedCurrency(currencyOut, chainId); + + // if unsupported list loaded & either token on list, mark as unsupported + // if (unsupportedTokens) { + // if (tokenIn && Object.keys(unsupportedTokens).includes(tokenIn.address)) { + // return true; + // } + // if (tokenOut && Object.keys(unsupportedTokens).includes(tokenOut.address)) { + // return true; + // } + // } + + return false; +} diff --git a/packages/pancake-uikit/src/hooks/useContract.ts b/packages/pancake-uikit/src/hooks/useContract.ts new file mode 100644 index 0000000..ddc23c2 --- /dev/null +++ b/packages/pancake-uikit/src/hooks/useContract.ts @@ -0,0 +1,32 @@ +import React, { useMemo } from "react"; +// eslint-disable-next-line import/no-extraneous-dependencies +import { Contract } from "@ethersproject/contracts"; +import useActiveWeb3React from "./useActiveWeb3React"; +import { getContract } from "../utils"; + +import ERC20_ABI from "../config/abi/erc20.json"; + +function useContract(address: string | undefined, ABI: any, withSignerIfPossible = true): Contract | null { + const { library, account } = useActiveWeb3React(); + + return useMemo(() => { + if (!address || !ABI || !library) return null; + try { + return getContract(address, ABI, library, withSignerIfPossible && account ? account : undefined); + } catch (error) { + console.error("Failed to get contract", error); + return null; + } + }, [address, ABI, library, withSignerIfPossible, account]); +} + +// token contract Hooks +export function useTokenContract(tokenAddress?: string, withSignerIfPossible?: boolean): Contract | null { + return useContract(tokenAddress, ERC20_ABI, withSignerIfPossible); +} + +export function useBytes32TokenContract(tokenAddress?: string, withSignerIfPossible?: boolean): Contract | null { + return useContract(tokenAddress, ERC20_ABI, withSignerIfPossible); +} + +export default null; diff --git a/packages/pancake-uikit/src/hooks/useIsWindowVisible.ts b/packages/pancake-uikit/src/hooks/useIsWindowVisible.ts new file mode 100644 index 0000000..aaa753b --- /dev/null +++ b/packages/pancake-uikit/src/hooks/useIsWindowVisible.ts @@ -0,0 +1,33 @@ +import { useEffect, useState } from "react"; + +const VISIBILITY_STATE_SUPPORTED = "visibilityState" in document; + +function isWindowVisible() { + if (!VISIBILITY_STATE_SUPPORTED) { + return true; + } + + return document.visibilityState === "visible"; +} + +/** + * Returns whether the window is currently visible to the user. + */ +export default function useIsWindowVisible() { + const [isVisible, setIsVisible] = useState(isWindowVisible()); + + useEffect(() => { + if (!VISIBILITY_STATE_SUPPORTED) return undefined; + + const handleVisibilityChange = () => { + setIsVisible(isWindowVisible()); + }; + + document.addEventListener("visibilitychange", handleVisibilityChange); + return () => { + document.removeEventListener("visibilitychange", handleVisibilityChange); + }; + }, [setIsVisible]); + + return isVisible; +} diff --git a/packages/pancake-uikit/src/hooks/usePairs.ts b/packages/pancake-uikit/src/hooks/usePairs.ts new file mode 100644 index 0000000..dbda72d --- /dev/null +++ b/packages/pancake-uikit/src/hooks/usePairs.ts @@ -0,0 +1,64 @@ +import { TokenAmount, Pair, Currency } from "@doodaswap/sdk"; +import { useMemo } from "react"; +// eslint-disable-next-line import/no-unresolved +import { abi as IUniswapV2PairABI } from "@uniswap/v2-core/build/IUniswapV2Pair.json"; +// eslint-disable-next-line import/no-extraneous-dependencies +import { Interface } from "@ethersproject/abi"; +import useActiveWeb3React from "./useActiveWeb3React"; + +import { useMultipleContractSingleData } from "../state/multicall/hooks"; +import { wrappedCurrency } from "../utils/wrappedCurrency"; + +const PAIR_INTERFACE = new Interface(IUniswapV2PairABI); + +export enum PairState { + LOADING, + NOT_EXISTS, + EXISTS, + INVALID, +} + +export function usePairs(currencies: [Currency | undefined, Currency | undefined][]): [PairState, Pair | null][] { + const { chainId } = useActiveWeb3React(); + + const tokens = useMemo( + () => + currencies.map(([currencyA, currencyB]) => [ + wrappedCurrency(currencyA, chainId), + wrappedCurrency(currencyB, chainId), + ]), + [chainId, currencies] + ); + + const pairAddresses = useMemo( + () => + tokens.map(([tokenA, tokenB]) => { + return tokenA && tokenB && !tokenA.equals(tokenB) ? Pair.getAddress(tokenA, tokenB) : undefined; + }), + [tokens] + ); + + const results = useMultipleContractSingleData(pairAddresses, PAIR_INTERFACE, "getReserves"); + + return useMemo(() => { + return results.map((result, i) => { + const { result: reserves, loading } = result; + const tokenA = tokens[i][0]; + const tokenB = tokens[i][1]; + + if (loading) return [PairState.LOADING, null]; + if (!tokenA || !tokenB || tokenA.equals(tokenB)) return [PairState.INVALID, null]; + if (!reserves) return [PairState.NOT_EXISTS, null]; + const { reserve0, reserve1 } = reserves; + const [token0, token1] = tokenA.sortsBefore(tokenB) ? [tokenA, tokenB] : [tokenB, tokenA]; + return [ + PairState.EXISTS, + new Pair(new TokenAmount(token0, reserve0.toString()), new TokenAmount(token1, reserve1.toString())), + ]; + }); + }, [results, tokens]); +} + +export function usePair(tokenA?: Currency, tokenB?: Currency): [PairState, Pair | null] { + return usePairs([[tokenA, tokenB]])[0]; +} diff --git a/packages/pancake-uikit/src/hooks/useTheme.ts b/packages/pancake-uikit/src/hooks/useTheme.ts new file mode 100644 index 0000000..761cebb --- /dev/null +++ b/packages/pancake-uikit/src/hooks/useTheme.ts @@ -0,0 +1,13 @@ +import React, { useState, useContext } from "react"; +import { ThemeContext as StyledThemeContext } from "styled-components"; +// import { useThemeManager } from "state/user/hooks"; + +const useTheme = () => { + // const [isDark, toggleTheme] = useThemeManager(); + const [isDark, toggleTheme] = useState(false); + + const theme = useContext(StyledThemeContext); + return { isDark, theme, toggleTheme }; +}; + +export default useTheme; diff --git a/packages/pancake-uikit/src/pages/Pools/index.stories.tsx b/packages/pancake-uikit/src/pages/Pools/index.stories.tsx index 5170087..9ec4822 100644 --- a/packages/pancake-uikit/src/pages/Pools/index.stories.tsx +++ b/packages/pancake-uikit/src/pages/Pools/index.stories.tsx @@ -52,14 +52,14 @@ const chosenPools = [ projectLink: "https://dev-doodaswap-frontend.vercel.app/", equals: true, sortBefore: false, - // equals(other: Token): boolean; + // equals(other: Token): boolean; // /** // * Returns true if the address of this token sorts before the address of the other token // * @param other other token to compare // * @throws if the tokens have the same address // * @throws if the tokens are on different chains // */ - // sortsBefore(other: Token): boolean; + // sortsBefore(other: Token): boolean;, }, harvest: true, isAutoVault: false, @@ -93,10 +93,15 @@ export enum ViewMode { export default { title: "Pages/Pools", // component: Pools, - argTypes: {}, + argTypes: { + address: { + options: ["56", "98"], + control: { type: "select" }, + }, + }, } as Meta; -export const Default: React.FC = () => { +const Default: React.FC = (args) => { // const [viewMode, setViewMode] = useState("LIST"); const [viewMode, setViewMode] = useState(undefined); const [query, setQuery] = useState(""); @@ -191,6 +196,9 @@ export const Default: React.FC = () => { ); }; +export const ConnectPool = Default.bind({}); +ConnectPool.args = chosenPools; + const handleClick = noop; // export const WithHandler: React.FC = () => { diff --git a/packages/pancake-uikit/src/pages/Swap/Page.tsx b/packages/pancake-uikit/src/pages/Swap/Page.tsx new file mode 100644 index 0000000..458dacd --- /dev/null +++ b/packages/pancake-uikit/src/pages/Swap/Page.tsx @@ -0,0 +1,46 @@ +import React from "react"; +import styled from "styled-components"; +import { Flex } from "../../index"; +// import Footer from "components/Menu/Footer"; +// import { PageMeta } from "components/Layout/Page"; + +const StyledPage = styled.div` + display: flex; + flex-direction: column; + align-items: center; + width: 100%; + padding: 16px; + padding-bottom: 0; + min-height: calc(100vh - 64px); + background: #fff; + // background: ${({ theme }) => theme.colors.gradients.bubblegum}; + + ${({ theme }) => theme.mediaQueries.xs} { + background-size: auto; + } + + ${({ theme }) => theme.mediaQueries.sm} { + padding: 24px; + padding-bottom: 0; + } + + ${({ theme }) => theme.mediaQueries.lg} { + padding-top: 32px; + min-height: calc(100vh - 64px); + } +`; + +const Page: React.FC> = ({ children, ...props }) => { + return ( + <> + {/* */} + + {children} + + {/*