\n}\n\nexport default function AssetList({\n vestingAddress,\n walletIsPending,\n walletId,\n assets,\n vestingData,\n addCustomToken,\n}: AssetListProps) {\n const [sortField, setSortField] = useState('')\n\n const handleSortClick = useCallback((field: string) => {\n setSortField((oldSortField) => {\n if (oldSortField === field) {\n return `-${field}`\n }\n\n if (oldSortField === `-${field}`) {\n return ''\n }\n\n return field\n })\n }, [])\n\n const sortInfo = sortField.split('-')\n const sortDirection = sortInfo[0] === '' ? 'asc' : 'desc'\n const sortColumnName = sortInfo[0] === '' ? sortInfo[1] : sortInfo[0]\n\n function compare(a: BigNumber | undefined, b: BigNumber | undefined) {\n if (a && b) return a.comparedTo(b) // both are BigNumber\n if (a === b) return 0 // both are undefined\n return a ? 1 : -1 // a or b are undefined\n }\n\n const sortedAssets =\n sortColumnName === 'fiatBalance'\n ? assets.sort((a, b) => {\n const cmp = compare(a.fiatBalance, b.fiatBalance)\n return sortDirection === 'asc' ? cmp : -cmp\n })\n : orderBy(assets, [sortColumnName], [sortDirection])\n\n return (\n <>\n \n \n {vestingData && vestingAddress && walletId && (\n \n )}\n\n {sortedAssets.length > 0 &&\n sortedAssets.map((asset) => (\n \n ))}\n\n {sortedAssets.length === 0 && (\n \n )}\n \n >\n )\n}\n","import { WalletListItem } from './WalletListItem'\nimport { Wallet } from 'crypto/interface'\n\ninterface WalletListProps {\n wallets: Wallet[]\n selectedWallet: Wallet | undefined\n onSelectedWallet: (wallet: Wallet) => void\n}\n\nexport function WalletList({\n wallets,\n selectedWallet,\n onSelectedWallet,\n}: WalletListProps) {\n return (\n \n {wallets.map((wallet) => (\n onSelectedWallet(wallet)}\n />\n ))}\n
\n )\n}\n","import * as S from './styles'\nimport {\n Asset,\n VestingData,\n Wallet,\n LinkResult,\n LinkWalletStatus,\n WalletId,\n AssetType,\n ChainType,\n} from 'crypto/interface'\nimport React, { useMemo } from 'react'\nimport Box from 'ui/Common/components/Box'\nimport { Grid, Row, Column } from 'ui/Common/components/Grid'\nimport Text from 'ui/Common/components/Text'\nimport { supportedWalletIds } from 'ui/Common/config'\nimport { AddWallet } from 'ui/CreateWallet/components/AddWallet'\nimport AssetList from 'ui/Wallet/components/AssetList/AssetList'\nimport { WalletList } from 'ui/Wallet/components/WalletList/WalletList'\n\nfunction WalletsHeader() {\n return (\n \n Wallets\n Balance\n \n )\n}\n\nexport function WalletContainer({\n wallets,\n selectedWallet,\n onSelectedWallet,\n linkMetamask,\n linkNami,\n linkEternl,\n metamaskStatus,\n namiStatus,\n eternlStatus,\n isWalletConnected,\n vestingData,\n allAssets,\n addCustomToken,\n}: {\n wallets: Wallet[]\n selectedWallet: Wallet | undefined\n onSelectedWallet: (wallet: Wallet) => void\n linkMetamask: () => Promise\n linkNami: () => Promise\n linkEternl: () => Promise\n metamaskStatus: LinkWalletStatus\n namiStatus: LinkWalletStatus\n eternlStatus: LinkWalletStatus\n isWalletConnected: (walletId: WalletId) => boolean\n vestingData: VestingData | undefined\n allAssets: Asset[]\n addCustomToken?: (\n walletId: WalletId,\n chain: ChainType,\n assetId: AssetType\n ) => Promise\n}) {\n // has any connected wallets\n const hasWallets = !!wallets.length\n\n // are all supported wallets already connected\n const allWalletsConnected = useMemo(() => {\n return supportedWalletIds.every(isWalletConnected)\n }, [isWalletConnected])\n\n const walletAssets = useMemo(() => {\n return (\n (selectedWallet?.assets ?? [])\n // filter only assets with balance >0\n .filter((asset) => asset.unitBalance.gt(0))\n )\n }, [selectedWallet])\n\n return (\n \n \n \n {wallets.length ? (\n <>\n \n My wallets\n \n \n More wallets. More freedom. Easy.\n \n >\n ) : (\n <>\n \n No wallets\n \n \n connected yet\n \n \n Select action\n \n >\n )}\n \n
\n\n \n \n The MELD token has an ongoing migration to a new version of the token. You can read all about the migration here.\n
The tokens you withdraw below will need to be migrated, you can do so in app.meld.com.\n
Please be aware that non-migrated tokens are NOT SUPPORTED on centralised exchanges. Always check the token policy ID before transferring to any protocol.\n \n
\n\n \n \n {hasWallets && }\n \n \n \n\n {!allWalletsConnected && (\n \n )}\n \n\n \n {selectedWallet ? (\n \n ) : (\n \n )}\n \n
\n \n )\n}\n","import React from 'react'\n\nexport const BrowserIcon = (props: React.SVGProps) => (\n \n)\n","import { useState } from 'react'\nimport Box from 'ui/Common/components/Box'\nimport InfoBox from 'ui/Common/components/InfoBox'\nimport { Popup } from 'ui/Common/components/Popup'\nimport Text from 'ui/Common/components/Text'\nimport { BrowserIcon } from 'ui/Icons/components/BrowserIcon'\n\nfunction SupportedBrowsers({\n showBrowserWarning,\n}: {\n showBrowserWarning: boolean\n}) {\n const [isOpen, setIsOpen] = useState(showBrowserWarning)\n\n if (!isOpen) return null\n\n return (\n setIsOpen(false)}>\n \n \n }\n >\n Note: Some wallets might not be supported in the current browser you\n are using. Please use one of the following browsers for optimal user\n experience.\n \n\n \n
\n \n\n \n Nami is available on\n \n \n \n
\n \n Chrome\n \n \n\n \n
\n \n Brave\n \n \n\n \n
\n \n Edge\n \n \n \n \n and any other chrome-based browser\n \n \n \n \n )\n}\n\nexport default SupportedBrowsers\n","import { WalletContainer } from 'app/containers/Wallet'\nimport {\n useAllAssets,\n useLinkEternl,\n useLinkMetamask,\n useLinkNami,\n useMeldState,\n useAddCustomToken,\n useVestingData,\n useSelectedWallet,\n} from 'crypto/hooks'\nimport Layout from 'ui/Common/components/Layout'\nimport SupportedBrowsers from 'ui/Wallet/components/SupportedBrowsers'\n\nlet IS_FIRST_PASS = true\nconst IS_BROWSER = typeof window !== 'undefined'\n\nconst isDesktop = () => {\n const ua = navigator.userAgent\n if (/(tablet|ipad|playbook|silk)|(android(?!.*mobi))/i.test(ua)) {\n return false\n } else if (\n /Mobile|Android|iP(hone|od)|IEMobile|BlackBerry|Kindle|Silk-Accelerated|(hpw|web)OS|Opera M(obi|ini)/.test(\n ua\n )\n ) {\n return false\n }\n return true\n}\n\n/**\n * Check (only on startup) whether the app is running in one of the supported browsers.\n *\n * Do not trigger this on mobile since mobile for now only has placeholder UI.\n */\nfunction shouldShowBrowserWarning() {\n if (!(IS_BROWSER && IS_FIRST_PASS && isDesktop())) {\n return false\n }\n\n IS_FIRST_PASS = false\n const isSupportedBrowser = navigator.userAgent.match(\n /chrome|chromium|crios|edg|brave/i\n )\n\n return !isSupportedBrowser\n}\n\nexport default function WalletPage() {\n const {\n wallets,\n metamaskStatus,\n namiStatus,\n eternlStatus,\n isWalletConnected,\n } = useMeldState()\n const [selectedWallet, setSelectedWallet] = useSelectedWallet()\n const linkMetamask = useLinkMetamask()\n const linkNami = useLinkNami()\n const linkEternl = useLinkEternl()\n const addCustomToken = useAddCustomToken()\n const vestingData = useVestingData(selectedWallet)\n const allAssets = useAllAssets()\n\n const showBrowserWarning = shouldShowBrowserWarning()\n\n return (\n <>\n \n \n \n\n \n >\n )\n}\n","import styled from 'styled-components'\nimport Box from 'ui/Common/components/Box'\n\nexport const InfoBox = styled(Box)`\n // align text content\n > :not(svg) {\n align-self: center;\n }\n\n // align icon section\n > :first-child {\n align-self: flex-start;\n }\n`\n","import * as S from './styles'\nimport React from 'react'\nimport Box from 'ui/Common/components/Box'\nimport Text from 'ui/Common/components/Text'\n\n/**\n * InfoBox public interface\n */\ntype InfoBoxProps = {\n /**\n * Textual content of the InfoBox.\n */\n children: React.ReactNode\n /**\n * Icon renderd before InfoBox text.\n */\n icon?: React.ReactElement>\n /**\n * Override container styling using inline styles.\n */\n style: React.CSSProperties\n /**\n * Override icon container styling using inline styles.\n */\n iconContainerStyle?: React.CSSProperties\n}\n\n/**\n * InfoBox component\n */\nfunction InfoBox(props: InfoBoxProps) {\n return (\n \n {/* ICON SECTION */}\n {props.icon && (\n \n {props.icon}\n \n )}\n {/* TEXT SECTION */}\n \n {props.children}\n \n \n )\n}\n\nInfoBox.defaultProps = {\n style: {},\n}\n\nexport default InfoBox\n","import styled from 'styled-components'\nimport { LARGE_BREAKPOINT } from 'ui/Common/components/Grid'\n\nexport const Wrapper = styled.div`\n height: 88px;\n position: relative;\n border-radius: 8px;\n display: flex;\n padding: 32px 48px;\n background-color: ${(p) => p.theme.colors.white.white100};\n margin-top: 4px;\n justify-content: space-between;\n align-items: center;\n\n @media (max-width: ${LARGE_BREAKPOINT}px) {\n height: 76px;\n padding: 24px 36px;\n }\n`\n","import LinkWallet from '../LinkWallet'\nimport * as S from './styles'\nimport { LinkResult, LinkWalletStatus } from 'crypto/interface'\nimport { useRouter } from 'next/router'\nimport { memo, useState } from 'react'\nimport Box from 'ui/Common/components/Box'\nimport { Button, ButtonVariant } from 'ui/Common/components/Button'\nimport { Popup } from 'ui/Common/components/Popup'\nimport Text from 'ui/Common/components/Text'\n\nfunction _AddWallet({\n linkMetamask,\n linkNami,\n linkEternl,\n metamaskStatus,\n namiStatus,\n eternlStatus,\n}: {\n linkMetamask: () => Promise\n linkNami: () => Promise\n linkEternl: () => Promise\n metamaskStatus: LinkWalletStatus\n namiStatus: LinkWalletStatus\n eternlStatus: LinkWalletStatus\n}) {\n const [linkPopupOpen, setLinkPopupOpen] = useState(false)\n const router = useRouter()\n\n return (\n <>\n \n \n ADD WALLET\n \n \n {\n //TODO: not used currently\n false && (\n <>\n \n \n >\n )\n }\n \n \n \n {linkPopupOpen && (\n setLinkPopupOpen(false)}>\n setLinkPopupOpen(false)}\n />\n \n )}\n >\n )\n}\n\nexport const AddWallet = memo(_AddWallet)\n","import React from 'react'\n\nexport const BorrowIcon = (props: React.SVGProps) => (\n \n)\n","import React from 'react'\n\nexport const VestingLockIcon = (props: React.SVGProps) => (\n \n)\n","import * as S from './styles'\nimport { FontWeight } from 'app/styles/typography'\nimport React from 'react'\nimport Text from 'ui/Common/components/Text'\nimport Tooltip from 'ui/Common/components/Tooltip/Tooltip'\nimport { BorrowIcon } from 'ui/Icons/components/BorrowIcon'\nimport { LockIcon } from 'ui/Icons/components/LockIcon'\n\nexport interface ProgressBarProps {\n active: number\n total: number\n rewardIndex: number\n}\n\nexport default function ProgressBar({\n active,\n total,\n rewardIndex,\n}: ProgressBarProps) {\n return (\n \n {/* */}\n\n \n \n Bonus? You’ll get 12%\n more if you hold MELD tokens until Dec 8th 2022.\n \n }\n >\n \n \n \n\n {[...Array(total)].map((e, i) => (\n \n ))}\n \n )\n}\n"],"names":["window","__NEXT_P","push","ListHeader","styled","p","walletHeader","LARGE_BREAKPOINT","AssetListHeader","sortField","onSortChange","S","Box","d","style","cursor","onClick","$highlightUp","$highlightDown","props","DropdownContainer","OverlayContainer","theme","colors","white","white100","container","borderRadius","s","isOpened","css","DropdownOverlay","createPortal","opened","ref","containerRef","overlay","document","body","Dropdown","placement","useState","useRef","overlayRef","useEffect","handleOutsideClick","evt","current","contains","target","setOpened","disabled","addEventListener","removeEventListener","placeElements","useElementPlacement","console","warn","handleClick","useCallback","getEventHandler","eventType","trigger","children","DropdownOveray","MenuContainer","MenuItemContainer","spacing","xs","grey","grey3","Menu","handleItemClick","key","role","items","map","item","label","svg","xmlns","width","height","fill","className","viewBox","path","MenuItemKey","AssetItemActionMenu","useNotifications","addNotification","handleActionMenuClick","walletId","addCustomToken","asset","chain","id","then","catch","err","content","ticker","type","NotificationType","assetItemActions","useMemo","length","ThreeDotsVert","AssetListItem","router","useRouter","isEmpty","unitBalance","isZero","pendingCache","isPending","isFlashing","initial","ChainDisplay","toggleName","AssetLogo","assetId","name","hasGraph","hasSpinner","fiatBalanceHistory","formatBalanceAmount","AnimatedSpinnerIcon","div","AssetStats","fiatBalance","unitPrice","change","singleItem","Button","variant","ButtonVariant","FiatBalance","points","VestingListItem","address","walletIsPending","rewardIndex","totalAmount","pendingAmount","stakedAmount","withdrawingAmount","percentVested","BigNumber","minus","activeProgressPeriods","Math","floor","multipliedBy","toNumber","totalBalance","plus","isWithdrawingOrPending","canWithdraw","VestingLockIcon","ProgressBar","active","total","withdrawing","span","AssetList","vestingAddress","assets","vestingData","handleSortClick","field","setSortField","oldSortField","sortInfo","split","sortDirection","sortColumnName","sortedAssets","sort","a","b","cmp","comparedTo","compare","orderBy","AssetListStyles","EmptyListMessage","message","WalletList","wallets","selectedWallet","onSelectedWallet","wallet","WalletListItem","isActive","WalletsHeader","WalletContainer","linkMetamask","linkNami","linkEternl","metamaskStatus","namiStatus","eternlStatus","isWalletConnected","allAssets","hasWallets","allWalletsConnected","supportedWalletIds","walletAssets","filter","gt","Grid","Row","Column","base","Text","marginTop","block","color","fontSize","fontWeight","lh","mt","href","br","strong","u","marginBottom","AddWallet","offset","addresses","cardano","BrowserIcon","g","fillRule","showBrowserWarning","isOpen","Popup","onClose","setIsOpen","w","h","bg","justifyContent","flexDirection","alignItems","InfoBox","padding","icon","mb","img","alt","src","textAlign","IS_FIRST_PASS","shouldShowBrowserWarning","ua","navigator","userAgent","test","isDesktop","match","WalletPage","useMeldState","useSelectedWallet","setSelectedWallet","useLinkMetamask","useLinkNami","useLinkEternl","useAddCustomToken","useVestingData","useAllAssets","Layout","SupportedBrowsers","mr","iconContainerStyle","defaultProps","Wrapper","_AddWallet","gap","setLinkPopupOpen","linkPopupOpen","LinkWallet","onSuccess","memo","BorrowIcon","stroke","strokeWidth","transform","Tooltip","multiline","text","FontWeight","Array","e","i","isBorrow"],"sourceRoot":""}