From b36b3c0e1a37dd523b5919a219143c13e13681a1 Mon Sep 17 00:00:00 2001 From: tjs Date: Sat, 9 Apr 2022 20:13:12 -0400 Subject: [PATCH 01/27] show position details on trade page when viewing mngo accts --- components/AccountInfo.tsx | 7 ++++++- components/FloatingElement.tsx | 5 ++++- components/MarketBalances.tsx | 5 ++++- components/MarketPosition.tsx | 5 ++++- 4 files changed, 18 insertions(+), 4 deletions(-) diff --git a/components/AccountInfo.tsx b/components/AccountInfo.tsx index dfbbfcda..9f4bcc8a 100644 --- a/components/AccountInfo.tsx +++ b/components/AccountInfo.tsx @@ -30,6 +30,7 @@ import useMangoAccount from '../hooks/useMangoAccount' import Loading from './Loading' import CreateAlertModal from './CreateAlertModal' import { useWallet } from '@solana/wallet-adapter-react' +import { useRouter } from 'next/router' const I80F48_100 = I80F48.fromString('100') @@ -48,6 +49,8 @@ export default function AccountInfo() { const [showDepositModal, setShowDepositModal] = useState(false) const [showWithdrawModal, setShowWithdrawModal] = useState(false) const [showAlertsModal, setShowAlertsModal] = useState(false) + const router = useRouter() + const { pubkey } = router.query const canWithdraw = mangoAccount?.owner && publicKey @@ -154,7 +157,9 @@ export default function AccountInfo() { return ( <>
{!isMobile ? ( diff --git a/components/FloatingElement.tsx b/components/FloatingElement.tsx index fb3f5f04..78bad5d8 100644 --- a/components/FloatingElement.tsx +++ b/components/FloatingElement.tsx @@ -6,6 +6,7 @@ import EmptyState from './EmptyState' import { useTranslation } from 'next-i18next' import { handleWalletConnect } from 'components/ConnectWalletButton' import { useWallet } from '@solana/wallet-adapter-react' +import { useRouter } from 'next/router' interface FloatingElementProps { className?: string @@ -21,6 +22,8 @@ const FloatingElement: FunctionComponent = ({ const { wallet, connected } = useWallet() const { uiLocked } = useMangoStore((s) => s.settings) const mangoGroup = useMangoStore((s) => s.selectedMangoGroup.current) + const router = useRouter() + const { pubkey } = router.query const handleConnect = useCallback(() => { if (wallet) { @@ -32,7 +35,7 @@ const FloatingElement: FunctionComponent = ({
- {!connected && showConnect ? ( + {!connected && showConnect && !pubkey ? (
{ if (!selectedMarket || !mangoGroup || !mangoGroupCache) return @@ -63,7 +66,7 @@ export default function MarketBalances() { if (!mangoGroup || !selectedMarket || !mangoGroupCache) return null return ( -
+
{!isMobile ? ( {t('balances')} ) : null} diff --git a/components/MarketPosition.tsx b/components/MarketPosition.tsx index 2dd0ba60..7c028935 100644 --- a/components/MarketPosition.tsx +++ b/components/MarketPosition.tsx @@ -21,6 +21,7 @@ import { breakpoints } from './TradePageGrid' import { useTranslation } from 'next-i18next' import useMangoAccount from '../hooks/useMangoAccount' import { useWallet, Wallet } from '@solana/wallet-adapter-react' +import { useRouter } from 'next/router' export const settlePosPnl = async ( perpMarkets: PerpMarket[], @@ -154,6 +155,8 @@ export default function MarketPosition() { const perpAccounts = useMangoStore((s) => s.selectedMangoAccount.perpAccounts) const baseSymbol = marketConfig.baseSymbol const marketName = marketConfig.name + const router = useRouter() + const { pubkey } = router.query const [showMarketCloseModal, setShowMarketCloseModal] = useState(false) const [settling, setSettling] = useState(false) @@ -230,7 +233,7 @@ export default function MarketPosition() { return ( <>
{!isMobile ? ( From 94fbca60ee7c3984cf2a472cd6f385fa41efeac4 Mon Sep 17 00:00:00 2001 From: tjs Date: Tue, 12 Apr 2022 10:53:50 -0400 Subject: [PATCH 02/27] notification timeout should match client timeout --- components/Notification.tsx | 9 +++++++-- stores/useMangoStore.tsx | 3 ++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/components/Notification.tsx b/components/Notification.tsx index 6d0d2708..74f83f5b 100644 --- a/components/Notification.tsx +++ b/components/Notification.tsx @@ -5,7 +5,10 @@ import { InformationCircleIcon, XCircleIcon, } from '@heroicons/react/outline' -import useMangoStore, { CLUSTER } from '../stores/useMangoStore' +import useMangoStore, { + CLIENT_TX_TIMEOUT, + CLUSTER, +} from '../stores/useMangoStore' import { Notification, notify } from '../utils/notifications' import { useTranslation } from 'next-i18next' import Loading from './Loading' @@ -104,7 +107,9 @@ const Notification = ({ notification }: { notification: Notification }) => { hideNotification() } }, - parsedTitle || type === 'confirm' || type === 'error' ? 40000 : 8000 + parsedTitle || type === 'confirm' || type === 'error' + ? CLIENT_TX_TIMEOUT + : 8000 ) return () => { diff --git a/stores/useMangoStore.tsx b/stores/useMangoStore.tsx index e9f934a8..aa0a598b 100644 --- a/stores/useMangoStore.tsx +++ b/stores/useMangoStore.tsx @@ -86,6 +86,7 @@ export const serumProgramId = new PublicKey( const mangoGroupPk = new PublicKey(defaultMangoGroupIds!.publicKey) export const SECONDS = 1000 +export const CLIENT_TX_TIMEOUT = 45000 // Used to retry loading the MangoGroup and MangoAccount if an rpc node error occurs let mangoGroupRetryAttempt = 0 @@ -262,7 +263,7 @@ const useMangoStore = create< const connection = new Connection(rpcUrl, 'processed' as Commitment) const client = new MangoClient(connection, programId, { - timeout: 45000, + timeout: CLIENT_TX_TIMEOUT, postSendTxCallback: ({ txid }: { txid: string }) => { notify({ title: 'Transaction sent', From fa58e458883b3211829f6c6c68bd4083b6387c34 Mon Sep 17 00:00:00 2001 From: tjs Date: Tue, 12 Apr 2022 13:24:58 -0400 Subject: [PATCH 03/27] allow setting price with slide limit orders --- components/trade_form/AdvancedTradeForm.tsx | 22 ++++++++------------- public/locales/en/common.json | 2 +- public/locales/es/common.json | 1 + public/locales/zh/common.json | 1 + public/locales/zh_tw/common.json | 1 + 5 files changed, 12 insertions(+), 15 deletions(-) diff --git a/components/trade_form/AdvancedTradeForm.tsx b/components/trade_form/AdvancedTradeForm.tsx index 81cb8ba3..55f17a59 100644 --- a/components/trade_form/AdvancedTradeForm.tsx +++ b/components/trade_form/AdvancedTradeForm.tsx @@ -741,7 +741,7 @@ export default function AdvancedTradeForm({ : baseSize > spotMax*/ const disabledTradeButton = - (!price && isLimitOrder && !postOnlySlide) || + (!price && isLimitOrder) || !baseSize || !connected || !mangoAccount || @@ -806,21 +806,15 @@ export default function AdvancedTradeForm({ min="0" step={tickSize} onChange={(e) => onSetPrice(e.target.value)} - value={postOnlySlide && tradeType === 'Limit' ? '' : price} - disabled={ - isMarketOrder || (postOnlySlide && tradeType === 'Limit') - } + value={price} + disabled={isMarketOrder} placeholder={tradeType === 'Market' ? markPrice : ''} prefix={ - <> - {postOnlySlide && tradeType === 'Limit' ? null : ( - - )} - + } /> diff --git a/public/locales/en/common.json b/public/locales/en/common.json index d8815d26..3f5cc04f 100644 --- a/public/locales/en/common.json +++ b/public/locales/en/common.json @@ -401,7 +401,7 @@ "tooltip-lock-layout": "Lock Layout", "tooltip-name-onchain": "Account names are stored on-chain", "tooltip-post": "Post orders are guaranteed to be the maker order or else it will be canceled.", - "tooltip-post-and-slide": "Post and slide is a limit order that will set your price one tick more/less than the opposite side of the book.", + "tooltip-post-and-slide": "Post and slide is a limit order that if crosses the book will set your price one tick more/less than the opposite side of the book.", "tooltip-projected-leverage": "Projected Leverage", "tooltip-reduce": "Reduce only orders will only reduce your overall position.", "tooltip-reset-layout": "Reset Layout", diff --git a/public/locales/es/common.json b/public/locales/es/common.json index 60c9ea1c..e8dad641 100644 --- a/public/locales/es/common.json +++ b/public/locales/es/common.json @@ -401,6 +401,7 @@ "tooltip-lock-layout": "Diseño de bloqueo", "tooltip-name-onchain": "Los nombres de las cuentas se almacenan en cadena", "tooltip-post": "Se garantiza que las órdenes de envío solo serán el pedido del fabricante o, de lo contrario, se cancelará.", + "tooltip-post-and-slide": "Post and slide is a limit order that if crosses the book will set your price one tick more/less than the opposite side of the book.", "tooltip-projected-leverage": "Apalancamiento proyectado", "tooltip-reduce": "Reducir solamente ordenes solo reducirá su posición general.", "tooltip-reset-layout": "Restablecer diseño", diff --git a/public/locales/zh/common.json b/public/locales/zh/common.json index f143a591..97205015 100644 --- a/public/locales/zh/common.json +++ b/public/locales/zh/common.json @@ -401,6 +401,7 @@ "tooltip-lock-layout": "锁定页面布局", "tooltip-name-onchain": "帐户标签是在区块链上存保的", "tooltip-post": "Post交易若不挂单就会被取消。", + "tooltip-post-and-slide": "Post and slide is a limit order that if crosses the book will set your price one tick more/less than the opposite side of the book.", "tooltip-projected-leverage": "预计杠杆", "tooltip-reduce": "Reduce交易只能减少您的持仓。", "tooltip-reset-layout": "重置页面布局", diff --git a/public/locales/zh_tw/common.json b/public/locales/zh_tw/common.json index b331906d..c54a1e2b 100644 --- a/public/locales/zh_tw/common.json +++ b/public/locales/zh_tw/common.json @@ -401,6 +401,7 @@ "tooltip-lock-layout": "鎖定頁面佈局", "tooltip-name-onchain": "帳戶標籤是在區塊鏈上存保的", "tooltip-post": "Post交易若不掛單就會被取消。", + "tooltip-post-and-slide": "Post and slide is a limit order that if crosses the book will set your price one tick more/less than the opposite side of the book.", "tooltip-projected-leverage": "預計槓桿", "tooltip-reduce": "Reduce交易只能減少您的持倉。", "tooltip-reset-layout": "重置頁面佈局", From 5472fbaeedbbdde75755f198e5842eacb3cd9074 Mon Sep 17 00:00:00 2001 From: tjs Date: Thu, 14 Apr 2022 14:22:10 -0400 Subject: [PATCH 04/27] fee discount doesnt apply to maker side --- pages/fees.tsx | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/pages/fees.tsx b/pages/fees.tsx index ed2618ee..a4e28abc 100644 --- a/pages/fees.tsx +++ b/pages/fees.tsx @@ -59,25 +59,6 @@ export default function Fees() { {percentFormat.format(makerFee)}
-
-

- {t('if-referred', { - fee: percentFormat.format( - makerFee < 0 - ? makerFee + makerFee * 0.04 - : makerFee - makerFee * 0.04 - ), - })} -

- - -
- -
-
-
{t('taker-fee')}
From 54fe21f5f6f897c59c85fc67df4cfce6ff552561 Mon Sep 17 00:00:00 2001 From: tjs Date: Thu, 14 Apr 2022 15:12:54 -0400 Subject: [PATCH 05/27] update fees page --- hooks/useFees.tsx | 17 +++++++++++++++-- pages/fees.tsx | 16 +++++++++++----- public/locales/en/common.json | 4 ++-- public/locales/es/common.json | 4 ++-- 4 files changed, 30 insertions(+), 11 deletions(-) diff --git a/hooks/useFees.tsx b/hooks/useFees.tsx index d97ca71a..9dcdcb0d 100644 --- a/hooks/useFees.tsx +++ b/hooks/useFees.tsx @@ -8,7 +8,12 @@ import useSrmAccount from '../hooks/useSrmAccount' import { mangoGroupConfigSelector } from '../stores/selectors' import useMangoStore from '../stores/useMangoStore' -export default function useFees(): { makerFee: number; takerFee: number } { +export default function useFees(): { + makerFee: number + takerFee: number + takerFeeBeforeDiscount: number + takerFeeWithMaxDiscount: number +} { const { rates } = useSrmAccount() const mangoGroup = useMangoStore((s) => s.selectedMangoGroup.current) const mangoGroupConfig = useMangoStore((s) => s.selectedMangoGroup.config) @@ -23,7 +28,13 @@ export default function useFees(): { makerFee: number; takerFee: number } { marketConfig.baseSymbol ) - if (!mangoGroup || !market) return { makerFee: 0, takerFee: 0 } + if (!mangoGroup || !market) + return { + makerFee: 0, + takerFee: 0, + takerFeeBeforeDiscount: 0, + takerFeeWithMaxDiscount: 0, + } let takerFee: number, makerFee: number let discount = 0 @@ -72,5 +83,7 @@ export default function useFees(): { makerFee: number; takerFee: number } { return { makerFee: makerFee, takerFee: takerFee + refSurcharge - discount, + takerFeeBeforeDiscount: takerFee + refSurcharge, + takerFeeWithMaxDiscount: takerFee - discount, } } diff --git a/pages/fees.tsx b/pages/fees.tsx index a4e28abc..13576c59 100644 --- a/pages/fees.tsx +++ b/pages/fees.tsx @@ -31,7 +31,8 @@ export async function getStaticProps({ locale }) { export default function Fees() { const { t } = useTranslation('common') const { totalSrm, totalMsrm, rates } = useSrmAccount() - const { takerFee, makerFee } = useFees() + const { takerFeeBeforeDiscount, takerFeeWithMaxDiscount, makerFee } = + useFees() const { connected } = useWallet() const [showDeposit, setShowDeposit] = useState(false) const [showWithdraw, setShowWithdraw] = useState(false) @@ -64,16 +65,16 @@ export default function Fees() {
{t('taker-fee')}
- {percentFormat.format(takerFee)} + {percentFormat.format(takerFeeBeforeDiscount)}

{t('if-referred', { fee: percentFormat.format( - takerFee < 0 - ? takerFee + takerFee * 0.04 - : takerFee - takerFee * 0.04 + takerFeeBeforeDiscount < 0 + ? takerFeeBeforeDiscount + takerFeeBeforeDiscount * 0.04 + : takerFeeBeforeDiscount - takerFeeBeforeDiscount * 0.04 ), })}

@@ -86,6 +87,11 @@ export default function Fees() {
+
+

+ {percentFormat.format(takerFeeWithMaxDiscount)} if 10k MNGO +

+

{t('serum-fees')}

diff --git a/public/locales/en/common.json b/public/locales/en/common.json index 3f5cc04f..2825436c 100644 --- a/public/locales/en/common.json +++ b/public/locales/en/common.json @@ -163,8 +163,8 @@ "hourly-borrow-interest": "Hourly Borrow Interest", "hourly-deposit-interest": "Hourly Deposit Interest", "hourly-funding": "Hourly Funding", - "if-referred": "{{fee}} if referred or 10k MNGO", - "if-referred-tooltip": "If you create your Mango Account from a referral link or have 10k MNGO in your Mango Account you get a 0.04% discount off futures fees.", + "if-referred": "{{fee}} if referred", + "if-referred-tooltip": "If you create your Mango Account from a referral link or have 10k MNGO in your Mango Account you get a 4% discount off futures fees.", "in-orders": "In Orders", "include-perp": "Include Perp", "include-spot": "Include Spot", diff --git a/public/locales/es/common.json b/public/locales/es/common.json index e8dad641..df7f9fdb 100644 --- a/public/locales/es/common.json +++ b/public/locales/es/common.json @@ -163,8 +163,8 @@ "hourly-borrow-interest": "Interés por préstamo por hora", "hourly-deposit-interest": "Interés por depósito por hora", "hourly-funding": "Financiamiento por hora", - "if-referred": "{{fee}} if referred or 10k MNGO", - "if-referred-tooltip": "If you create your Mango Account from a referral link or have 10k MNGO in your Mango Account you get a 0.04% discount off futures fees.", + "if-referred": "{{fee}} if referred", + "if-referred-tooltip": "If you create your Mango Account from a referral link or have 10k MNGO in your Mango Account you get a 4% discount off futures fees.", "in-orders": "En órdenes", "include-perp": "Include Perp", "include-spot": "Include Spot", From 2cd4b110568eed2fed3cb9ffefadcfd5ca165dff Mon Sep 17 00:00:00 2001 From: tjs Date: Fri, 15 Apr 2022 16:55:39 -0400 Subject: [PATCH 06/27] add check that url param exists --- components/SettingsModal.tsx | 2 +- pages/index.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/components/SettingsModal.tsx b/components/SettingsModal.tsx index 81491d0d..b8e34d33 100644 --- a/components/SettingsModal.tsx +++ b/components/SettingsModal.tsx @@ -48,7 +48,7 @@ export const LANGS = [ const CUSTOM_NODE = NODE_URLS.find((n) => n.label === 'Custom') -export const NODE_URL_KEY = 'node-url-key-0.6' +export const NODE_URL_KEY = 'node-url-key-0.7' export const DEFAULT_MARKET_KEY = 'defaultMarket-0.3' export const ORDERBOOK_FLASH_KEY = 'showOrderbookFlash' export const DEFAULT_SPOT_MARGIN_KEY = 'defaultSpotMargin' diff --git a/pages/index.tsx b/pages/index.tsx index 791aea06..25c39fe3 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -89,7 +89,7 @@ const PerpMarket: React.FC = () => { if (name && groupConfig) { marketQueryParam = name.toString().split(/-|\//) marketBaseSymbol = marketQueryParam[0] - marketType = marketQueryParam[1].includes('PERP') ? 'perp' : 'spot' + marketType = marketQueryParam[1]?.includes('PERP') ? 'perp' : 'spot' newMarket = getMarketByBaseSymbolAndKind( groupConfig, From ef27cae29d8e937d3b1ddd6b0ab80e8d71c6990e Mon Sep 17 00:00:00 2001 From: tjs Date: Mon, 18 Apr 2022 20:48:26 -0400 Subject: [PATCH 07/27] use latest mango client --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index ba8d9387..927cad95 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "analyze": "ANALYZE=true yarn build" }, "dependencies": { - "@blockworks-foundation/mango-client": "^3.4.0", + "@blockworks-foundation/mango-client": "^3.4.4", "@headlessui/react": "^0.0.0-insiders.2dbc38c", "@heroicons/react": "^1.0.0", "@jup-ag/react-hook": "^1.0.0-beta.19", diff --git a/yarn.lock b/yarn.lock index 966a1e87..1c07c090 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1008,10 +1008,10 @@ "@babel/helper-validator-identifier" "^7.16.7" to-fast-properties "^2.0.0" -"@blockworks-foundation/mango-client@^3.4.0": - version "3.4.2" - resolved "https://registry.yarnpkg.com/@blockworks-foundation/mango-client/-/mango-client-3.4.2.tgz#42c1752bc5a949d2eec1aea51fd94eddfd9e0d64" - integrity sha512-CcypTdoHxIojxWAzDF6v6BqasfvCzP2Wv0nJ5yZuY5ofIWnlKJGWbHxU5sHClo3GHt8bbDjeKXeQth3az84koA== +"@blockworks-foundation/mango-client@^3.4.4": + version "3.4.4" + resolved "https://registry.yarnpkg.com/@blockworks-foundation/mango-client/-/mango-client-3.4.4.tgz#5ccf688432c54c88b513499edde0dcb9af945a8f" + integrity sha512-r4qBcPbxgtfpTWO8Z/ChIY8bQKXXEG+4Bzce+IjHWN32g+UP0tVydMvfYi6WNN9JNrKccR58MujUWvEo7HyniQ== dependencies: "@project-serum/anchor" "^0.21.0" "@project-serum/serum" "0.13.55" From 9287985d0051e6a84ce2c0472b05bd10805fa931 Mon Sep 17 00:00:00 2001 From: tjs Date: Wed, 20 Apr 2022 11:27:12 -0400 Subject: [PATCH 08/27] remove genesysgo until new auth is implemented --- components/SettingsModal.tsx | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/components/SettingsModal.tsx b/components/SettingsModal.tsx index b8e34d33..064acb18 100644 --- a/components/SettingsModal.tsx +++ b/components/SettingsModal.tsx @@ -22,10 +22,6 @@ require('dayjs/locale/zh-tw') const NODE_URLS = [ { label: 'Triton (RPC Pool)', value: 'https://mango.rpcpool.com' }, - { - label: 'Genesys Go', - value: 'https://mango.genesysgo.net/', - }, { label: 'Project Serum', value: 'https://solana-api.projectserum.com/', @@ -48,7 +44,7 @@ export const LANGS = [ const CUSTOM_NODE = NODE_URLS.find((n) => n.label === 'Custom') -export const NODE_URL_KEY = 'node-url-key-0.7' +export const NODE_URL_KEY = 'node-url-key-0.8' export const DEFAULT_MARKET_KEY = 'defaultMarket-0.3' export const ORDERBOOK_FLASH_KEY = 'showOrderbookFlash' export const DEFAULT_SPOT_MARGIN_KEY = 'defaultSpotMargin' From 13925d6eff62bf39b7c1fa3c8fff59945e809f55 Mon Sep 17 00:00:00 2001 From: tjshipe Date: Wed, 20 Apr 2022 15:32:12 -0400 Subject: [PATCH 09/27] Merge pull request #261 from blockworks-foundation/ts/wallet-update update to the latest wallet adapter pkgs --- components/ConnectWalletButton.tsx | 2 +- package.json | 8 +- pages/_app.tsx | 14 +- yarn.lock | 713 ++++++++++++++++++++++++++++- 4 files changed, 705 insertions(+), 32 deletions(-) diff --git a/components/ConnectWalletButton.tsx b/components/ConnectWalletButton.tsx index ac281da1..409a0e17 100644 --- a/components/ConnectWalletButton.tsx +++ b/components/ConnectWalletButton.tsx @@ -58,7 +58,7 @@ export const ConnectWalletButton: React.FC = () => { } } - return installed + return installed?.length ? installed : wallets }, [wallets]) const displayedWallets = useMemo(() => { diff --git a/package.json b/package.json index 927cad95..c93532d3 100644 --- a/package.json +++ b/package.json @@ -26,17 +26,11 @@ "@sentry/react": "^6.19.2", "@sentry/tracing": "^6.19.2", "@solana/wallet-adapter-base": "^0.9.5", - "@solana/wallet-adapter-bitpie": "^0.5.3", - "@solana/wallet-adapter-glow": "^0.1.1", "@solana/wallet-adapter-huobi": "^0.1.0", - "@solana/wallet-adapter-phantom": "^0.9.3", "@solana/wallet-adapter-react": "^0.15.4", - "@solana/wallet-adapter-slope": "^0.5.4", - "@solana/wallet-adapter-solflare": "^0.6.6", - "@solana/wallet-adapter-sollet": "^0.11.1", + "@solana/wallet-adapter-wallets": "^0.16.0", "@solana/web3.js": "^1.36.0", "@solflare-wallet/pfp": "^0.0.6", - "@solflare-wallet/sdk": "^1.0.10", "@tippyjs/react": "^4.2.5", "big.js": "^6.1.1", "bignumber.js": "^9.0.2", diff --git a/pages/_app.tsx b/pages/_app.tsx index de2715c4..60ae1f3b 100644 --- a/pages/_app.tsx +++ b/pages/_app.tsx @@ -31,13 +31,15 @@ import * as Sentry from '@sentry/react' import { BrowserTracing } from '@sentry/tracing' import { WalletProvider, WalletListener } from 'components/WalletAdapter' -import { PhantomWalletAdapter } from '@solana/wallet-adapter-phantom' -import { SolflareWalletAdapter } from '@solana/wallet-adapter-solflare' -import { SolletWalletAdapter } from '@solana/wallet-adapter-sollet' -import { SlopeWalletAdapter } from '@solana/wallet-adapter-slope' -import { BitpieWalletAdapter } from '@solana/wallet-adapter-bitpie' +import { + PhantomWalletAdapter, + SolflareWalletAdapter, + SolletWalletAdapter, + SlopeWalletAdapter, + BitpieWalletAdapter, + GlowWalletAdapter, +} from '@solana/wallet-adapter-wallets' import { HuobiWalletAdapter } from '@solana/wallet-adapter-huobi' -import { GlowWalletAdapter } from '@solana/wallet-adapter-glow' const SENTRY_URL = process.env.NEXT_PUBLIC_SENTRY_URL if (SENTRY_URL) { diff --git a/yarn.lock b/yarn.lock index 1c07c090..42c60bf8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -968,7 +968,7 @@ dependencies: regenerator-runtime "^0.13.4" -"@babel/runtime@^7.10.5", "@babel/runtime@^7.11.2", "@babel/runtime@^7.12.5": +"@babel/runtime@^7.10.5", "@babel/runtime@^7.11.2", "@babel/runtime@^7.12.5", "@babel/runtime@^7.16.0", "@babel/runtime@^7.6.2": version "7.17.9" resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.17.9.tgz#d19fbf802d01a8cb6cf053a64e472d42c434ba72" integrity sha512-lSiBBvodq29uShpWGNbgFdKYNiFDo5/HIYsaCEY9ff4sb10x9jizo2+pRrSyF4jKZCXqgzuqBOQKbUm90gQwJg== @@ -1026,6 +1026,16 @@ toformat "^2.0.0" yargs "^17.0.1" +"@blocto/sdk@^0.2.21": + version "0.2.22" + resolved "https://registry.yarnpkg.com/@blocto/sdk/-/sdk-0.2.22.tgz#c7fe62809de0640a0a3f7a043c5bbceb8be17e38" + integrity sha512-Ro1AiISSlOiri/It932NEFxnDuF83Ide+z0p3KHs5+CdYYLYgCMmyroQnfRtoh3mbXdrTvI+EAuSkr+meWNqrg== + dependencies: + bs58 "^4.0.1" + buffer "^6.0.3" + eip1193-provider "^1.0.1" + js-sha3 "^0.8.0" + "@eslint/eslintrc@^0.4.3": version "0.4.3" resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-0.4.3.tgz#9e42981ef035beb3dd49add17acb96e8ff6f394c" @@ -1115,6 +1125,31 @@ "@jridgewell/resolve-uri" "^3.0.3" "@jridgewell/sourcemap-codec" "^1.4.10" +"@json-rpc-tools/provider@^1.5.5": + version "1.7.6" + resolved "https://registry.yarnpkg.com/@json-rpc-tools/provider/-/provider-1.7.6.tgz#8a17c34c493fa892632e278fd9331104e8491ec6" + integrity sha512-z7D3xvJ33UfCGv77n40lbzOYjZKVM3k2+5cV7xS8G6SCvKTzMkhkUYuD/qzQUNT4cG/lv0e9mRToweEEVLVVmA== + dependencies: + "@json-rpc-tools/utils" "^1.7.6" + axios "^0.21.0" + safe-json-utils "^1.1.1" + ws "^7.4.0" + +"@json-rpc-tools/types@^1.7.6": + version "1.7.6" + resolved "https://registry.yarnpkg.com/@json-rpc-tools/types/-/types-1.7.6.tgz#5abd5fde01364a130c46093b501715bcce5bdc0e" + integrity sha512-nDSqmyRNEqEK9TZHtM15uNnDljczhCUdBmRhpNZ95bIPKEDQ+nTDmGMFd2lLin3upc5h2VVVd9tkTDdbXUhDIQ== + dependencies: + keyvaluestorage-interface "^1.0.0" + +"@json-rpc-tools/utils@^1.7.6": + version "1.7.6" + resolved "https://registry.yarnpkg.com/@json-rpc-tools/utils/-/utils-1.7.6.tgz#67f04987dbaa2e7adb6adff1575367b75a9a9ba1" + integrity sha512-HjA8x/U/Q78HRRe19yh8HVKoZ+Iaoo3YZjakJYxR+rw52NHo6jM+VE9b8+7ygkCFXl/EHID5wh/MkXaE/jGyYw== + dependencies: + "@json-rpc-tools/types" "^1.7.6" + "@pedrouid/environment" "^1.0.1" + "@jup-ag/core@1.0.0-beta.19": version "1.0.0-beta.19" resolved "https://registry.yarnpkg.com/@jup-ag/core/-/core-1.0.0-beta.19.tgz#fa461d20cf35391360a04fe24dcc8306aeae5b37" @@ -1177,6 +1212,45 @@ dependencies: "@jup-ag/core" "1.0.0-beta.19" +"@ledgerhq/devices@^6.27.1": + version "6.27.1" + resolved "https://registry.yarnpkg.com/@ledgerhq/devices/-/devices-6.27.1.tgz#3b13ab1d1ba8201e9e74a08f390560483978c962" + integrity sha512-jX++oy89jtv7Dp2X6gwt3MMkoajel80JFWcdc0HCouwDsV1mVJ3SQdwl/bQU0zd8HI6KebvUP95QTwbQLLK/RQ== + dependencies: + "@ledgerhq/errors" "^6.10.0" + "@ledgerhq/logs" "^6.10.0" + rxjs "6" + semver "^7.3.5" + +"@ledgerhq/errors@^6.10.0": + version "6.10.0" + resolved "https://registry.yarnpkg.com/@ledgerhq/errors/-/errors-6.10.0.tgz#dda9127b65f653fbb2f74a55e8f0e550d69de6e4" + integrity sha512-fQFnl2VIXh9Yd41lGjReCeK+Q2hwxQJvLZfqHnKqWapTz68NHOv5QcI0OHuZVNEbv0xhgdLhi5b65kgYeQSUVg== + +"@ledgerhq/hw-transport-webhid@^6.11.2": + version "6.27.1" + resolved "https://registry.yarnpkg.com/@ledgerhq/hw-transport-webhid/-/hw-transport-webhid-6.27.1.tgz#8fd1710d23b6bd7cbe2382dd02054dfabe788447" + integrity sha512-u74rBYlibpbyGblSn74fRs2pMM19gEAkYhfVibq0RE1GNFjxDMFC1n7Sb+93Jqmz8flyfB4UFJsxs8/l1tm2Kw== + dependencies: + "@ledgerhq/devices" "^6.27.1" + "@ledgerhq/errors" "^6.10.0" + "@ledgerhq/hw-transport" "^6.27.1" + "@ledgerhq/logs" "^6.10.0" + +"@ledgerhq/hw-transport@^6.11.2", "@ledgerhq/hw-transport@^6.27.1": + version "6.27.1" + resolved "https://registry.yarnpkg.com/@ledgerhq/hw-transport/-/hw-transport-6.27.1.tgz#88072278f69c279cb6569352acd4ae2fec33ace3" + integrity sha512-hnE4/Fq1YzQI4PA1W0H8tCkI99R3UWDb3pJeZd6/Xs4Qw/q1uiQO+vNLC6KIPPhK0IajUfuI/P2jk0qWcMsuAQ== + dependencies: + "@ledgerhq/devices" "^6.27.1" + "@ledgerhq/errors" "^6.10.0" + events "^3.3.0" + +"@ledgerhq/logs@^6.10.0": + version "6.10.0" + resolved "https://registry.yarnpkg.com/@ledgerhq/logs/-/logs-6.10.0.tgz#c012c1ecc1a0e53d50e6af381618dca5268461c1" + integrity sha512-lLseUPEhSFUXYTKj6q7s2O3s2vW2ebgA11vMAlKodXGf5AFw4zUoEbTz9CoFOC9jS6xY4Qr8BmRnxP/odT4Uuw== + "@mercurial-finance/optimist@~0.1.2": version "0.1.2" resolved "https://registry.yarnpkg.com/@mercurial-finance/optimist/-/optimist-0.1.2.tgz#0837f8d5edd0e09df3c04be4ee251d49de0f9a58" @@ -1287,6 +1361,11 @@ "@nodelib/fs.scandir" "2.1.5" fastq "^1.6.0" +"@pedrouid/environment@^1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@pedrouid/environment/-/environment-1.0.1.tgz#858f0f8a057340e0b250398b75ead77d6f4342ec" + integrity sha512-HaW78NszGzRZd9SeoI3JD11JqY+lubnaOx7Pewj5pfjqWXOEATpeKIFb9Z4t2WBUK2iryiXX3lzWwmYWgUL0Ug== + "@polka/url@^1.0.0-next.20": version "1.0.0-next.21" resolved "https://registry.yarnpkg.com/@polka/url/-/url-1.0.0-next.21.tgz#5de5a2385a35309427f6011992b544514d559aa1" @@ -1578,7 +1657,15 @@ "@solana/web3.js" "^1.36.0" eventemitter3 "^4.0.0" -"@solana/wallet-adapter-bitpie@^0.5.3": +"@solana/wallet-adapter-bitkeep@^0.3.2": + version "0.3.3" + resolved "https://registry.yarnpkg.com/@solana/wallet-adapter-bitkeep/-/wallet-adapter-bitkeep-0.3.3.tgz#a531f3ba98918708ee885bee07897b13c1911313" + integrity sha512-4oUqAANJ0smSj+ukjzZyjSf+nM6/vN6aPT9OppP8zZegUHoVp0TeHs5/AZ+s+nxs0Wiv1Es8x8GXAy1FLrSAxg== + dependencies: + "@solana/wallet-adapter-base" "^0.9.3" + "@solana/web3.js" "^1.20.0" + +"@solana/wallet-adapter-bitpie@^0.5.2": version "0.5.3" resolved "https://registry.yarnpkg.com/@solana/wallet-adapter-bitpie/-/wallet-adapter-bitpie-0.5.3.tgz#af6740a4ec9c531e55f6adcdb45dfda0191c4267" integrity sha512-hRD91Pfj47taJgIwYaqLVNZ3bJqmlL9SpvL2RVWBqKDIRZ0zwSuiv0+QyOWfcwAJUCxZh4qT1Hr4Fd9EnC1OOQ== @@ -1586,7 +1673,41 @@ "@solana/wallet-adapter-base" "^0.9.3" "@solana/web3.js" "^1.20.0" -"@solana/wallet-adapter-glow@^0.1.1": +"@solana/wallet-adapter-blocto@^0.5.2": + version "0.5.4" + resolved "https://registry.yarnpkg.com/@solana/wallet-adapter-blocto/-/wallet-adapter-blocto-0.5.4.tgz#a122b40a1cd6a0443033ab7256ed3bfbdc39763d" + integrity sha512-P4CDZtdnt2hkLEU3foNhj4vm/lGsrHcE1ljAUKRZnS+jhI81q7592o07Sbp1xFYO+OTDu6rI9hS5JfngDzrK7Q== + dependencies: + "@blocto/sdk" "^0.2.21" + "@solana/wallet-adapter-base" "^0.9.4" + "@solana/web3.js" "^1.20.0" + +"@solana/wallet-adapter-clover@^0.4.2": + version "0.4.4" + resolved "https://registry.yarnpkg.com/@solana/wallet-adapter-clover/-/wallet-adapter-clover-0.4.4.tgz#5951147fdb6e789b62ec2098b6f36c2106c7b8b5" + integrity sha512-QNU3/gR/ODbwlFPis+wNrQbSS5lgaownlz9V4Af4iC2AZlbuUSArxk6pCGt+3o6hxBBd+gk+lnadt1uICOfc5w== + dependencies: + "@solana/wallet-adapter-base" "^0.9.3" + "@solana/web3.js" "^1.20.0" + +"@solana/wallet-adapter-coin98@^0.5.2": + version "0.5.4" + resolved "https://registry.yarnpkg.com/@solana/wallet-adapter-coin98/-/wallet-adapter-coin98-0.5.4.tgz#0bbc4ae1ffac7566f29c14a3de6669a005c39ed6" + integrity sha512-sVcJnoy9tcq5X362812OW7dIuppYSXQvDAVoh783odWLNZsEHaGSGNXLNf2PM4xYfZEU6ZddW77IwIabFim/zg== + dependencies: + "@solana/wallet-adapter-base" "^0.9.4" + "@solana/web3.js" "^1.36.0" + bs58 "^4.0.0" + +"@solana/wallet-adapter-coinhub@^0.3.2": + version "0.3.3" + resolved "https://registry.yarnpkg.com/@solana/wallet-adapter-coinhub/-/wallet-adapter-coinhub-0.3.3.tgz#9a6e1cfc96b5eca5340de4df8f5023f13e7b141a" + integrity sha512-6TDj2/uObM/MoPO4DS/0qsKI/JIRUVl/KKST31HYIGWvQeP+oLRWMvCXwgczCxvLvxe/xAndtwxA4PbaiwhG3g== + dependencies: + "@solana/wallet-adapter-base" "^0.9.3" + "@solana/web3.js" "^1.20.0" + +"@solana/wallet-adapter-glow@^0.1.0": version "0.1.1" resolved "https://registry.yarnpkg.com/@solana/wallet-adapter-glow/-/wallet-adapter-glow-0.1.1.tgz#4db395b2ccf73eb2d6c1d9362e26cbfd260fc19f" integrity sha512-ZYVNtplMAbUQUAzWQ+bhPpIiUO2Jz8Pvx6Ypas+xuZJBgc0vb+iaYFGLHEdg+SE19P20QIPQE75qPRQvsMqpCQ== @@ -1602,7 +1723,26 @@ "@solana/wallet-adapter-base" "^0.9.4" "@solana/web3.js" "^1.20.0" -"@solana/wallet-adapter-phantom@^0.9.3": +"@solana/wallet-adapter-ledger@^0.9.8": + version "0.9.9" + resolved "https://registry.yarnpkg.com/@solana/wallet-adapter-ledger/-/wallet-adapter-ledger-0.9.9.tgz#5f24e8275c9b3420f9c91da08440eaf974b669c7" + integrity sha512-eROwgjycBq54FaVlHEdkb+M7TwE06gnhH6YzjLNF+hJydUpErCRxRgrVUsUehxQIbFSJ0YdvF181arLvxG/X2A== + dependencies: + "@ledgerhq/hw-transport" "^6.11.2" + "@ledgerhq/hw-transport-webhid" "^6.11.2" + "@solana/wallet-adapter-base" "^0.9.4" + "@solana/web3.js" "^1.20.0" + buffer "^6.0.3" + +"@solana/wallet-adapter-mathwallet@^0.9.2": + version "0.9.3" + resolved "https://registry.yarnpkg.com/@solana/wallet-adapter-mathwallet/-/wallet-adapter-mathwallet-0.9.3.tgz#fada9c5aafec74fcb872baea02de04cb9784209c" + integrity sha512-V0YIzhFwITy6mezLXjQKMK6XWkHUOwtMZO2Ar7MoFGWizD/lHvMYPbcyLCL5NVzQO1f/YCV2UfG5E6sdVpyEBQ== + dependencies: + "@solana/wallet-adapter-base" "^0.9.3" + "@solana/web3.js" "^1.20.0" + +"@solana/wallet-adapter-phantom@^0.9.2": version "0.9.3" resolved "https://registry.yarnpkg.com/@solana/wallet-adapter-phantom/-/wallet-adapter-phantom-0.9.3.tgz#68832deccf43af0043d70498fcd11a9006e27b46" integrity sha512-XBDgG5BzxRolHW2OchaIccvsPeQ0PKl/Xy303x7oHS3rW+HUwjIMqaKKpmV66A6rMr1x+ytL+tp6p7t3M2oD3Q== @@ -1618,7 +1758,15 @@ "@solana/wallet-adapter-base" "^0.9.4" "@solana/web3.js" "^1.36.0" -"@solana/wallet-adapter-slope@^0.5.4": +"@solana/wallet-adapter-safepal@^0.5.2": + version "0.5.3" + resolved "https://registry.yarnpkg.com/@solana/wallet-adapter-safepal/-/wallet-adapter-safepal-0.5.3.tgz#01c8e9be225e420bc6000968c0cf84355605a4ad" + integrity sha512-30EOCDYJ/bq1HqKSkBlzCHsWITa82WJml2O46/CMUl1mOhxOJ1ghFSmIhqyHlgqQPcd5Orqvp1db+uj8v/i58w== + dependencies: + "@solana/wallet-adapter-base" "^0.9.3" + "@solana/web3.js" "^1.20.0" + +"@solana/wallet-adapter-slope@^0.5.2": version "0.5.4" resolved "https://registry.yarnpkg.com/@solana/wallet-adapter-slope/-/wallet-adapter-slope-0.5.4.tgz#41056cbd870b8a0866e4e908cfe6575773fb0383" integrity sha512-I8WgeomiQSnhxn1ebsPNhiHqzNx0clWGwQG0fOEFcoxxE3puKpNF27Vk+XFx8XS1igWPTPntFbiOUocKT3A63A== @@ -1627,7 +1775,7 @@ "@solana/web3.js" "^1.20.0" bs58 "^4.0.0" -"@solana/wallet-adapter-solflare@^0.6.6": +"@solana/wallet-adapter-solflare@^0.6.3": version "0.6.6" resolved "https://registry.yarnpkg.com/@solana/wallet-adapter-solflare/-/wallet-adapter-solflare-0.6.6.tgz#70ffd87db78e65bd7f53910996f8c50c032a0b54" integrity sha512-4H4FbRpvUeCGQ9HevLpCc9hCtwjRL4pf7kk/4QoGdu+jLbXo1doKTiT8sY1svksNS8JWrcr0kn7SpePmiy7xhg== @@ -1636,7 +1784,7 @@ "@solana/web3.js" "^1.20.0" "@solflare-wallet/sdk" "^1.0.11" -"@solana/wallet-adapter-sollet@^0.11.1": +"@solana/wallet-adapter-sollet@^0.11.0": version "0.11.1" resolved "https://registry.yarnpkg.com/@solana/wallet-adapter-sollet/-/wallet-adapter-sollet-0.11.1.tgz#021ec1c8f402601c8898175e1fb39b504a25cb43" integrity sha512-lRgz8+57g2piBqxYHA4HqKuHY/gDCVY5vCqEa2pColfKtIETqKRcpF1P34R4MD5mLuMjLEQP9Hjt285NIOeVjQ== @@ -1645,6 +1793,59 @@ "@solana/wallet-adapter-base" "^0.9.4" "@solana/web3.js" "^1.20.0" +"@solana/wallet-adapter-solong@^0.9.2": + version "0.9.3" + resolved "https://registry.yarnpkg.com/@solana/wallet-adapter-solong/-/wallet-adapter-solong-0.9.3.tgz#272e11b3b3c8ef596a223eda42657d1b6441a76d" + integrity sha512-TFdKK7/Vsta9ajY6+cQ9NGuhmhgsEJ8PR4Y9GWb9ao9OdcLhTFIwOV+IOeD1Ats1ORyukpzjSjsW/VA2UZkTVQ== + dependencies: + "@solana/wallet-adapter-base" "^0.9.3" + "@solana/web3.js" "^1.20.0" + +"@solana/wallet-adapter-tokenpocket@^0.4.2": + version "0.4.3" + resolved "https://registry.yarnpkg.com/@solana/wallet-adapter-tokenpocket/-/wallet-adapter-tokenpocket-0.4.3.tgz#21cad947dc082b064602ed917b24d91d31253292" + integrity sha512-D40nNp92bFwcDw/aQ3bKZMvoxk2s65PJiR9t3JBb4DOtlEafa9GFhwmRYkSH6SB7gRGFUKWWjBWpACRRirFjDA== + dependencies: + "@solana/wallet-adapter-base" "^0.9.3" + "@solana/web3.js" "^1.20.0" + +"@solana/wallet-adapter-torus@^0.11.10": + version "0.11.11" + resolved "https://registry.yarnpkg.com/@solana/wallet-adapter-torus/-/wallet-adapter-torus-0.11.11.tgz#74092f409df97eab964b73b8992a59a6d97f1c56" + integrity sha512-U6qt2QEkMwOVUV19jbsXlzW8a2ff/vo34SXEGekFXe8hg847u2N8GmByDRdnEyAqbQ9TZPbbiPjID7xhLZY6Wg== + dependencies: + "@solana/wallet-adapter-base" "^0.9.4" + "@solana/web3.js" "^1.20.0" + "@toruslabs/solana-embed" "^0.1.5" + assert "^2.0.0" + process "^0.11.10" + stream-browserify "^3.0.0" + +"@solana/wallet-adapter-wallets@^0.16.0": + version "0.16.0" + resolved "https://registry.yarnpkg.com/@solana/wallet-adapter-wallets/-/wallet-adapter-wallets-0.16.0.tgz#0a30eaac10b04ac3e8aa7f3e001d7fd69f92c22a" + integrity sha512-blg/0eGDvQlvPkfaLD24vgB3+RxbksjLoKPRVF/4/Dj+XTc0Yx8PxXUDwCQSC5Xic51Q7ZfLhMxj8caXN+RM/Q== + dependencies: + "@solana/wallet-adapter-base" "^0.9.4" + "@solana/wallet-adapter-bitkeep" "^0.3.2" + "@solana/wallet-adapter-bitpie" "^0.5.2" + "@solana/wallet-adapter-blocto" "^0.5.2" + "@solana/wallet-adapter-clover" "^0.4.2" + "@solana/wallet-adapter-coin98" "^0.5.2" + "@solana/wallet-adapter-coinhub" "^0.3.2" + "@solana/wallet-adapter-glow" "^0.1.0" + "@solana/wallet-adapter-huobi" "^0.1.0" + "@solana/wallet-adapter-ledger" "^0.9.8" + "@solana/wallet-adapter-mathwallet" "^0.9.2" + "@solana/wallet-adapter-phantom" "^0.9.2" + "@solana/wallet-adapter-safepal" "^0.5.2" + "@solana/wallet-adapter-slope" "^0.5.2" + "@solana/wallet-adapter-solflare" "^0.6.3" + "@solana/wallet-adapter-sollet" "^0.11.0" + "@solana/wallet-adapter-solong" "^0.9.2" + "@solana/wallet-adapter-tokenpocket" "^0.4.2" + "@solana/wallet-adapter-torus" "^0.11.10" + "@solana/web3.js@1.31.0": version "1.31.0" resolved "https://registry.yarnpkg.com/@solana/web3.js/-/web3.js-1.31.0.tgz#7a313d4c1a90b77f27ddbfe845a10d6883e06452" @@ -1705,6 +1906,26 @@ superstruct "^0.14.2" tweetnacl "^1.0.0" +"@solana/web3.js@^1.35.0": + version "1.39.1" + resolved "https://registry.yarnpkg.com/@solana/web3.js/-/web3.js-1.39.1.tgz#858ecd42ff2a5bcba3a4bb642a50194d77e2a578" + integrity sha512-Q7XnWTAiU7n7GcoINDAAMLO7CJHpm5kPK46HKwJi2x0cusHQ3WFa7QEp6aPzH7tuf7yl/Kw1lYitcwTVOvqARA== + dependencies: + "@babel/runtime" "^7.12.5" + "@ethersproject/sha2" "^5.5.0" + "@solana/buffer-layout" "^4.0.0" + bn.js "^5.0.0" + borsh "^0.7.0" + bs58 "^4.0.1" + buffer "6.0.1" + cross-fetch "^3.1.4" + jayson "^3.4.4" + js-sha3 "^0.8.0" + rpc-websockets "^7.4.2" + secp256k1 "^4.0.2" + superstruct "^0.14.2" + tweetnacl "^1.0.0" + "@solflare-wallet/pfp@^0.0.6": version "0.0.6" resolved "https://registry.yarnpkg.com/@solflare-wallet/pfp/-/pfp-0.0.6.tgz#0dc360e7ebb11029977f5cd5593b5dc5e6074bab" @@ -1718,7 +1939,7 @@ cross-fetch "^3.1.4" jdenticon "^3.1.1" -"@solflare-wallet/sdk@^1.0.10", "@solflare-wallet/sdk@^1.0.11": +"@solflare-wallet/sdk@^1.0.11": version "1.0.11" resolved "https://registry.yarnpkg.com/@solflare-wallet/sdk/-/sdk-1.0.11.tgz#2eaf3d5935f96dc4286ae356c4c83f6866947ff2" integrity sha512-zm+snfxpxfEvPytz0CdPn+LSMLrtYIl8qDjC2jhey4hWTkkZmumgKMKfNb9w6cpHtGgWiQkxSP2KI48xuKmuxw== @@ -1861,6 +2082,70 @@ dependencies: tippy.js "^6.3.1" +"@toruslabs/base-controllers@^1.6.1": + version "1.6.14" + resolved "https://registry.yarnpkg.com/@toruslabs/base-controllers/-/base-controllers-1.6.14.tgz#5061a10bdb6b4e2038d99535d4641317bd52d81f" + integrity sha512-GYBaI/f2o6kEl1bJtlBhYTJvWONJJjZaKUKMsjGMYWDljWpsTrsvqgh29WI/7fh8n0VMKSS8z2Rn3+GTeygB4g== + dependencies: + "@toruslabs/http-helpers" "^2.2.0" + "@toruslabs/openlogin-jrpc" "^1.7.3" + async-mutex "^0.3.2" + bignumber.js "^9.0.2" + bowser "^2.11.0" + broadcast-channel "^4.10.0" + eth-rpc-errors "^4.0.3" + ethereumjs-util "^7.1.4" + json-rpc-random-id "^1.0.1" + lodash "^4.17.21" + loglevel "^1.8.0" + +"@toruslabs/http-helpers@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@toruslabs/http-helpers/-/http-helpers-2.2.0.tgz#c494984701ff60eb93c0eaef279daa93b5bcea81" + integrity sha512-xkzZZuE+DmWmJBTYneCrMJY24izNQCOdoJMpsXKQx20Va/rTQvNPbdkpx9LBf/pisk8jOwETNAfFQ8YTBc/bZw== + dependencies: + lodash.merge "^4.6.2" + loglevel "^1.8.0" + +"@toruslabs/openlogin-jrpc@^1.4.0", "@toruslabs/openlogin-jrpc@^1.7.3": + version "1.7.3" + resolved "https://registry.yarnpkg.com/@toruslabs/openlogin-jrpc/-/openlogin-jrpc-1.7.3.tgz#0bbdc2f7989b4a1f19b8a54d3e66721d424d185f" + integrity sha512-xjixDKPLZN7T5hCjwmGTU58NttdZiHn3YlK6II2z4v8IifPUwoquYP08XfaE79ksxamgDYkGERf7bQGkV5Wf5w== + dependencies: + "@toruslabs/openlogin-utils" "^1.7.0" + end-of-stream "^1.4.4" + eth-rpc-errors "^4.0.3" + events "^3.3.0" + fast-safe-stringify "^2.1.1" + once "^1.4.0" + pump "^3.0.0" + readable-stream "^3.6.0" + +"@toruslabs/openlogin-utils@^1.7.0": + version "1.7.0" + resolved "https://registry.yarnpkg.com/@toruslabs/openlogin-utils/-/openlogin-utils-1.7.0.tgz#1762e2f1f67590d0c6cb8e4c4ade82d59ba13a18" + integrity sha512-y+j22v+h6EfzN4sfFnmtmMrcxEdkScdJOAgbtvX42BpUYOuFa1Tv0SZjdtsGGDE4g5szmL3rb9NGMHdBF1rZtg== + dependencies: + base64url "^3.0.1" + keccak "^3.0.2" + randombytes "^2.1.0" + +"@toruslabs/solana-embed@^0.1.5": + version "0.1.6" + resolved "https://registry.yarnpkg.com/@toruslabs/solana-embed/-/solana-embed-0.1.6.tgz#c21ba9fe485ce33975577cb909cc2a168485e6cb" + integrity sha512-+WcF97qLTyW6xJ/oDmsLRc4KUN0w8/0pPx2QstcUV0OPgV3VON9LXgRFmSLXNvBVjFzie7aOWJFORUIL6Odqhw== + dependencies: + "@solana/web3.js" "^1.35.0" + "@toruslabs/base-controllers" "^1.6.1" + "@toruslabs/http-helpers" "^2.2.0" + "@toruslabs/openlogin-jrpc" "^1.4.0" + eth-rpc-errors "^4.0.3" + fast-deep-equal "^3.1.3" + is-stream "^2.0.0" + lodash-es "^4.17.21" + loglevel "^1.8.0" + pump "^3.0.0" + "@trysound/sax@0.2.0": version "0.2.0" resolved "https://registry.yarnpkg.com/@trysound/sax/-/sax-0.2.0.tgz#cccaab758af56761eb7bf37af6f03f326dd798ad" @@ -1871,7 +2156,7 @@ resolved "https://registry.yarnpkg.com/@types/aria-query/-/aria-query-4.2.2.tgz#ed4e0ad92306a704f9fb132a0cfcf77486dbe2bc" integrity sha512-HnYpAE1Y6kRyKM/XkEuiRQhTHvkzMBurTHnpFLYLBGPIylZNPs9jJcuOOYWxPLJCSEtmZT0Y8rHDokKN7rRTig== -"@types/bn.js@5.1.0", "@types/bn.js@^4.11.5": +"@types/bn.js@5.1.0", "@types/bn.js@^4.11.5", "@types/bn.js@^5.1.0": version "5.1.0" resolved "https://registry.yarnpkg.com/@types/bn.js/-/bn.js-5.1.0.tgz#32c5d271503a12653c62cf4d2b45e6eab8cebc68" integrity sha512-QSSVYj7pYFN49kW77o2s9xTCwZ8F2xLbjLLSEVh8D2F4JUhZtPAGOFLTD+ffqksBx/u4cE/KImFjyhqCjn/LIA== @@ -1987,6 +2272,13 @@ resolved "https://registry.yarnpkg.com/@types/parse-json/-/parse-json-4.0.0.tgz#2f8bb441434d163b35fb8ffdccd7138927ffb8c0" integrity sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA== +"@types/pbkdf2@^3.0.0": + version "3.1.0" + resolved "https://registry.yarnpkg.com/@types/pbkdf2/-/pbkdf2-3.1.0.tgz#039a0e9b67da0cdc4ee5dab865caa6b267bb66b1" + integrity sha512-Cf63Rv7jCQ0LaL8tNXmEyqTHuIJxRdlS5vMh1mj5voN4+QFhVZnlZruezqpWYDiJ8UTzhP0VmeLXCmBk66YrMQ== + dependencies: + "@types/node" "*" + "@types/promise-retry@^1.1.3": version "1.1.3" resolved "https://registry.yarnpkg.com/@types/promise-retry/-/promise-retry-1.1.3.tgz#baab427419da9088a1d2f21bf56249c21b3dd43c" @@ -2033,6 +2325,13 @@ resolved "https://registry.yarnpkg.com/@types/scheduler/-/scheduler-0.16.2.tgz#1a62f89525723dde24ba1b01b092bf5df8ad4d39" integrity sha512-hppQEBDmlwhFAXKJX2KnWLYu5yMfi91yazPb2l+lbJiwW+wdo1gNeRA+3RgNSO39WYX2euey41KEwnqesU2Jew== +"@types/secp256k1@^4.0.1": + version "4.0.3" + resolved "https://registry.yarnpkg.com/@types/secp256k1/-/secp256k1-4.0.3.tgz#1b8e55d8e00f08ee7220b4d59a6abe89c37a901c" + integrity sha512-Da66lEIFeIz9ltsdMZcpQvmrmmoqrfju8pm1BH8WbYjZSwUgCwXLb9C+9XYogwBITnbsSaMdVPb2ekf7TV+03w== + dependencies: + "@types/node" "*" + "@types/ws@^7.4.4": version "7.4.7" resolved "https://registry.yarnpkg.com/@types/ws/-/ws-7.4.7.tgz#f7c390a36f7a0679aa69de2d501319f4f8d9b702" @@ -2312,6 +2611,13 @@ astral-regex@^2.0.0: resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-2.0.0.tgz#483143c567aeed4785759c0865786dc77d7d2e31" integrity sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ== +async-mutex@^0.3.2: + version "0.3.2" + resolved "https://registry.yarnpkg.com/async-mutex/-/async-mutex-0.3.2.tgz#1485eda5bda1b0ec7c8df1ac2e815757ad1831df" + integrity sha512-HuTK7E7MT7jZEh1P9GtRW9+aTWiDWWi9InbZ5hjxrnRa39KS4BW04+xLBhYNS2aXhHUIKZSw3gj4Pn1pj+qGAA== + dependencies: + tslib "^2.3.1" + autoprefixer@^10.2.5, autoprefixer@^10.4.2: version "10.4.4" resolved "https://registry.yarnpkg.com/autoprefixer/-/autoprefixer-10.4.4.tgz#3e85a245b32da876a893d3ac2ea19f01e7ea5a1e" @@ -2329,6 +2635,13 @@ available-typed-arrays@^1.0.5: resolved "https://registry.yarnpkg.com/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz#92f95616501069d07d10edb2fc37d3e1c65123b7" integrity sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw== +axios@^0.21.0: + version "0.21.4" + resolved "https://registry.yarnpkg.com/axios/-/axios-0.21.4.tgz#c67b90dc0568e5c1cf2b0b858c43ba28e2eda575" + integrity sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg== + dependencies: + follow-redirects "^1.14.0" + babel-plugin-dynamic-import-node@^2.3.3: version "2.3.3" resolved "https://registry.yarnpkg.com/babel-plugin-dynamic-import-node/-/babel-plugin-dynamic-import-node-2.3.3.tgz#84fda19c976ec5c6defef57f9427b3def66e17a3" @@ -2386,6 +2699,11 @@ base64-js@^1.3.1, base64-js@^1.5.1: resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a" integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA== +base64url@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/base64url/-/base64url-3.0.1.tgz#6399d572e2bc3f90a9a8b22d5dbb0a32d33f788d" + integrity sha512-ir1UPr3dkwexU7FdV8qBBbNDRUhMmIekYMFZfi+C/sLNnRESKPl23nB9b2pltqfOQNnGzsDdId90AEtG5tCx4A== + big.js@^6.1.1: version "6.1.1" resolved "https://registry.yarnpkg.com/big.js/-/big.js-6.1.1.tgz#63b35b19dc9775c94991ee5db7694880655d5537" @@ -2401,6 +2719,11 @@ binary-extensions@^2.0.0: resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.2.0.tgz#75f502eeaf9ffde42fc98829645be4ea76bd9e2d" integrity sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA== +blakejs@^1.1.0: + version "1.2.1" + resolved "https://registry.yarnpkg.com/blakejs/-/blakejs-1.2.1.tgz#5057e4206eadb4a97f7c0b6e197a505042fc3814" + integrity sha512-QXUSXI3QVc/gJME0dBpXrag1kbzOqCjCX8/b54ntNyW6sjtoqxqRk3LTmXzaJoh71zMsDCjM+47jS7XiwN/+fQ== + bn.js@5.1.3, bn.js@^4.11.9, bn.js@^5.0.0, bn.js@^5.1.0, bn.js@^5.1.2, bn.js@^5.2.0, bn.js@~5.2.0: version "5.1.3" resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.1.3.tgz#beca005408f642ebebea80b042b4d18d2ac0ee6b" @@ -2430,6 +2753,11 @@ borsh@^0.7.0: bs58 "^4.0.0" text-encoding-utf-8 "^1.0.2" +bowser@^2.11.0: + version "2.11.0" + resolved "https://registry.yarnpkg.com/bowser/-/bowser-2.11.0.tgz#5ca3c35757a7aa5771500c70a73a9f91ef420a8f" + integrity sha512-AlcaJBi/pqqJBIQ8U9Mcpc9i8Aqxn88Skv5d+xBX006BY5u8N3mGLHa5Lgppa7L/HfwgwLgZ6NYs+Ag6uUmJRA== + brace-expansion@^1.1.7: version "1.1.11" resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" @@ -2445,11 +2773,36 @@ braces@^3.0.2, braces@~3.0.2: dependencies: fill-range "^7.0.1" +broadcast-channel@^4.10.0: + version "4.11.0" + resolved "https://registry.yarnpkg.com/broadcast-channel/-/broadcast-channel-4.11.0.tgz#b9ebc7ce1326120088e61d2197477496908a1a9e" + integrity sha512-4FS1Zk+ttekfXHq5I2R7KhN9AsnZUFVV5SczrTtnZPuf5w+jw+fqM1PJHuHzwEXJezJeCbJxoZMDcFqsIN2c1Q== + dependencies: + "@babel/runtime" "^7.16.0" + detect-node "^2.1.0" + microtime "3.0.0" + oblivious-set "1.0.0" + p-queue "6.6.2" + rimraf "3.0.2" + unload "2.3.1" + brorand@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/brorand/-/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f" integrity sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8= +browserify-aes@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/browserify-aes/-/browserify-aes-1.2.0.tgz#326734642f403dabc3003209853bb70ad428ef48" + integrity sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA== + dependencies: + buffer-xor "^1.0.3" + cipher-base "^1.0.0" + create-hash "^1.1.0" + evp_bytestokey "^1.0.3" + inherits "^2.0.1" + safe-buffer "^5.0.1" + browserslist@^4.17.5, browserslist@^4.19.1, browserslist@^4.20.2: version "4.20.2" resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.20.2.tgz#567b41508757ecd904dab4d1c646c612cd3d4f88" @@ -2468,6 +2821,15 @@ bs58@^4.0.0, bs58@^4.0.1: dependencies: base-x "^3.0.2" +bs58check@^2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/bs58check/-/bs58check-2.1.2.tgz#53b018291228d82a5aa08e7d796fdafda54aebfc" + integrity sha512-0TS1jicxdU09dwJMNZtVAfzPi6Q6QeN0pM1Fkzrjn+XYHvzMKPU3pHVpva+769iNVSfIYWf7LJ6WR+BuuMf8cA== + dependencies: + bs58 "^4.0.0" + create-hash "^1.1.0" + safe-buffer "^5.1.2" + btoa@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/btoa/-/btoa-1.2.1.tgz#01a9909f8b2c93f6bf680ba26131eb30f7fa3d73" @@ -2478,6 +2840,11 @@ buffer-layout@^1.2.0, buffer-layout@^1.2.1, buffer-layout@^1.2.2: resolved "https://registry.yarnpkg.com/buffer-layout/-/buffer-layout-1.2.2.tgz#b9814e7c7235783085f9ca4966a0cfff112259d5" integrity sha512-kWSuLN694+KTk8SrYvCqwP2WcgQjoRCiF5b4QDvkkz8EmgD+aWAIceGFKMIAdmF/pH+vpgNV3d3kAKorcdAmWA== +buffer-xor@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/buffer-xor/-/buffer-xor-1.0.3.tgz#26e61ed1422fb70dd42e6e36729ed51d855fe8d9" + integrity sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk= + buffer@6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/buffer/-/buffer-6.0.1.tgz#3cbea8c1463e5a0779e30b66d4c88c6ffa182ac2" @@ -2583,6 +2950,14 @@ chokidar@^3.5.2, chokidar@^3.5.3: optionalDependencies: fsevents "~2.3.2" +cipher-base@^1.0.0, cipher-base@^1.0.1, cipher-base@^1.0.3: + version "1.0.4" + resolved "https://registry.yarnpkg.com/cipher-base/-/cipher-base-1.0.4.tgz#8760e4ecc272f4c363532f926d874aae2c1397de" + integrity sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q== + dependencies: + inherits "^2.0.1" + safe-buffer "^5.0.1" + circular-json@^0.5.9: version "0.5.9" resolved "https://registry.yarnpkg.com/circular-json/-/circular-json-0.5.9.tgz#932763ae88f4f7dead7a0d09c8a51a4743a53b1d" @@ -2765,6 +3140,29 @@ cosmiconfig@^7.0.1: path-type "^4.0.0" yaml "^1.10.0" +create-hash@^1.1.0, create-hash@^1.1.2, create-hash@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/create-hash/-/create-hash-1.2.0.tgz#889078af11a63756bcfb59bd221996be3a9ef196" + integrity sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg== + dependencies: + cipher-base "^1.0.1" + inherits "^2.0.1" + md5.js "^1.3.4" + ripemd160 "^2.0.1" + sha.js "^2.4.0" + +create-hmac@^1.1.4, create-hmac@^1.1.7: + version "1.1.7" + resolved "https://registry.yarnpkg.com/create-hmac/-/create-hmac-1.1.7.tgz#69170c78b3ab957147b2b8b04572e47ead2243ff" + integrity sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg== + dependencies: + cipher-base "^1.0.3" + create-hash "^1.1.0" + inherits "^2.0.1" + ripemd160 "^2.0.0" + safe-buffer "^5.0.1" + sha.js "^2.4.8" + cross-fetch@3.0.6: version "3.0.6" resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-3.0.6.tgz#3a4040bc8941e653e0e9cf17f29ebcd177d3365c" @@ -2966,6 +3364,11 @@ delay@^5.0.0: resolved "https://registry.yarnpkg.com/delay/-/delay-5.0.0.tgz#137045ef1b96e5071060dd5be60bf9334436bd1d" integrity sha512-ReEBKkIfe4ya47wlPYf/gu5ib6yUG0/Aez0JQZQz94kiWtRQvZIQbTiehsnwHvLSWJnQdhVeqYue7Id1dKr0qw== +detect-node@2.1.0, detect-node@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/detect-node/-/detect-node-2.1.0.tgz#c9c70775a49c3d03bc2c06d9a73be550f978f8b1" + integrity sha512-T0NIuQpnTvFDATNuHN5roPwSBG83rFsuO+MXXH9/3N1eFbn4wcPjttvjMLEPWJ0RGUYgQE7cGgS3tNxbqCGM7g== + detective@^5.2.0: version "5.2.0" resolved "https://registry.yarnpkg.com/detective/-/detective-5.2.0.tgz#feb2a77e85b904ecdea459ad897cc90a99bd2a7b" @@ -3081,6 +3484,13 @@ eastasianwidth@^0.2.0: resolved "https://registry.yarnpkg.com/eastasianwidth/-/eastasianwidth-0.2.0.tgz#696ce2ec0aa0e6ea93a397ffcf24aa7840c827cb" integrity sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA== +eip1193-provider@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/eip1193-provider/-/eip1193-provider-1.0.1.tgz#420d29cf4f6c443e3f32e718fb16fafb250637c3" + integrity sha512-kSuqwQ26d7CzuS/t3yRXo2Su2cVH0QfvyKbr2H7Be7O5YDyIq4hQGCNTo5wRdP07bt+E2R/8nPCzey4ojBHf7g== + dependencies: + "@json-rpc-tools/provider" "^1.5.5" + electron-to-chromium@^1.4.84: version "1.4.93" resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.93.tgz#2e87ac28721cb31d472ec2bd04f7daf9f2e13de2" @@ -3116,6 +3526,13 @@ encoding@^0.1.13: dependencies: iconv-lite "^0.6.2" +end-of-stream@^1.1.0, end-of-stream@^1.4.4: + version "1.4.4" + resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.4.tgz#5ae64a5f45057baf3626ec14da0ca5e4b2431eb0" + integrity sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q== + dependencies: + once "^1.4.0" + enquirer@^2.3.5: version "2.3.6" resolved "https://registry.yarnpkg.com/enquirer/-/enquirer-2.3.6.tgz#2a7fe5dd634a1e4125a975ec994ff5456dc3734d" @@ -3363,11 +3780,63 @@ esutils@^2.0.2: resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64" integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g== +eth-rpc-errors@^4.0.3: + version "4.0.3" + resolved "https://registry.yarnpkg.com/eth-rpc-errors/-/eth-rpc-errors-4.0.3.tgz#6ddb6190a4bf360afda82790bb7d9d5e724f423a" + integrity sha512-Z3ymjopaoft7JDoxZcEb3pwdGh7yiYMhOwm2doUt6ASXlMavpNlK6Cre0+IMl2VSGyEU9rkiperQhp5iRxn5Pg== + dependencies: + fast-safe-stringify "^2.0.6" + +ethereum-cryptography@^0.1.3: + version "0.1.3" + resolved "https://registry.yarnpkg.com/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz#8d6143cfc3d74bf79bbd8edecdf29e4ae20dd191" + integrity sha512-w8/4x1SGGzc+tO97TASLja6SLd3fRIK2tLVcV2Gx4IB21hE19atll5Cq9o3d0ZmAYC/8aw0ipieTSiekAea4SQ== + dependencies: + "@types/pbkdf2" "^3.0.0" + "@types/secp256k1" "^4.0.1" + blakejs "^1.1.0" + browserify-aes "^1.2.0" + bs58check "^2.1.2" + create-hash "^1.2.0" + create-hmac "^1.1.7" + hash.js "^1.1.7" + keccak "^3.0.0" + pbkdf2 "^3.0.17" + randombytes "^2.1.0" + safe-buffer "^5.1.2" + scrypt-js "^3.0.0" + secp256k1 "^4.0.1" + setimmediate "^1.0.5" + +ethereumjs-util@^7.1.4: + version "7.1.4" + resolved "https://registry.yarnpkg.com/ethereumjs-util/-/ethereumjs-util-7.1.4.tgz#a6885bcdd92045b06f596c7626c3e89ab3312458" + integrity sha512-p6KmuPCX4mZIqsQzXfmSx9Y0l2hqf+VkAiwSisW3UKUFdk8ZkAt+AYaor83z2nSi6CU2zSsXMlD80hAbNEGM0A== + dependencies: + "@types/bn.js" "^5.1.0" + bn.js "^5.1.2" + create-hash "^1.1.2" + ethereum-cryptography "^0.1.3" + rlp "^2.2.4" + eventemitter3@^4.0.0, eventemitter3@^4.0.1, eventemitter3@^4.0.4, eventemitter3@^4.0.7: version "4.0.7" resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-4.0.7.tgz#2de9b68f6528d5644ef5c59526a1b4a07306169f" integrity sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw== +events@^3.3.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/events/-/events-3.3.0.tgz#31a95ad0a924e2d2c419a813aeb2c4e878ea7400" + integrity sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q== + +evp_bytestokey@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz#7fcbdb198dc71959432efe13842684e0525acb02" + integrity sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA== + dependencies: + md5.js "^1.3.4" + safe-buffer "^5.1.1" + execa@^5.1.1: version "5.1.1" resolved "https://registry.yarnpkg.com/execa/-/execa-5.1.1.tgz#f80ad9cbf4298f7bd1d4c9555c21e93741c411dd" @@ -3424,6 +3893,11 @@ fast-levenshtein@^2.0.6: resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc= +fast-safe-stringify@^2.0.6, fast-safe-stringify@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/fast-safe-stringify/-/fast-safe-stringify-2.1.1.tgz#c406a83b6e70d9e35ce3b30a81141df30aeba884" + integrity sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA== + fastq@^1.6.0: version "1.13.0" resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.13.0.tgz#616760f88a7526bdfc596b7cab8c18938c36b98c" @@ -3465,6 +3939,11 @@ flatted@^3.1.0: resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.5.tgz#76c8584f4fc843db64702a6bd04ab7a8bd666da3" integrity sha512-WIWGi2L3DyTUvUrwRKgGi9TwxQMUEqPOPQBVi71R96jZXJdFskXEmf54BoZaS1kknGODoIGASGEzBUYdyMCBJg== +follow-redirects@^1.14.0: + version "1.14.9" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.14.9.tgz#dd4ea157de7bfaf9ea9b3fbd85aa16951f78d8d7" + integrity sha512-MQDfihBQYMcyy5dhRDJUHcw7lb2Pv/TuE6xP1vyraLukNDHKbDxDNaOE3NbCAdKQApno+GPRyo1YAp89yCjK4w== + foreach@^2.0.5: version "2.0.5" resolved "https://registry.yarnpkg.com/foreach/-/foreach-2.0.5.tgz#0bee005018aeb260d0a3af3ae658dd0136ec1b99" @@ -3637,7 +4116,16 @@ has@^1.0.3: dependencies: function-bind "^1.1.1" -hash.js@1.1.7, hash.js@^1.0.0, hash.js@^1.0.3: +hash-base@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/hash-base/-/hash-base-3.1.0.tgz#55c381d9e06e1d2997a883b4a3fddfe7f0d3af33" + integrity sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA== + dependencies: + inherits "^2.0.4" + readable-stream "^3.6.0" + safe-buffer "^5.2.0" + +hash.js@1.1.7, hash.js@^1.0.0, hash.js@^1.0.3, hash.js@^1.1.7: version "1.1.7" resolved "https://registry.yarnpkg.com/hash.js/-/hash.js-1.1.7.tgz#0babca538e8d4ee4a0f8988d68866537a003cf42" integrity sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA== @@ -3775,7 +4263,7 @@ inflight@^1.0.4: once "^1.3.0" wrappy "1" -inherits@2, inherits@^2.0.3, inherits@^2.0.4: +inherits@2, inherits@^2.0.1, inherits@^2.0.3, inherits@^2.0.4, inherits@~2.0.4: version "2.0.4" resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== @@ -4060,6 +4548,11 @@ json-parse-even-better-errors@^2.3.0: resolved "https://registry.yarnpkg.com/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz#7c47805a94319928e05777405dc12e1f7a4ee02d" integrity sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w== +json-rpc-random-id@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/json-rpc-random-id/-/json-rpc-random-id-1.0.1.tgz#ba49d96aded1444dbb8da3d203748acbbcdec8c8" + integrity sha1-uknZat7RRE27jaPSA3SKy7zeyMg= + json-schema-traverse@^0.4.1: version "0.4.1" resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" @@ -4107,11 +4600,25 @@ jsonparse@^1.2.0: array-includes "^3.1.3" object.assign "^4.1.2" +keccak@^3.0.0, keccak@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/keccak/-/keccak-3.0.2.tgz#4c2c6e8c54e04f2670ee49fa734eb9da152206e0" + integrity sha512-PyKKjkH53wDMLGrvmRGSNWgmSxZOUqbnXwKL9tmgbFYA1iAYqW21kfR7mZXV0MlESiefxQQE9X9fTa3X+2MPDQ== + dependencies: + node-addon-api "^2.0.0" + node-gyp-build "^4.2.0" + readable-stream "^3.6.0" + keycode@^2.1.7: version "2.2.1" resolved "https://registry.yarnpkg.com/keycode/-/keycode-2.2.1.tgz#09c23b2be0611d26117ea2501c2c391a01f39eff" integrity sha512-Rdgz9Hl9Iv4QKi8b0OlCRQEzp4AgVxyCtz5S/+VIHezDmrDhkp2N2TqBWOLz0/gbeREXOOiI9/4b8BY9uw2vFg== +keyvaluestorage-interface@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/keyvaluestorage-interface/-/keyvaluestorage-interface-1.0.0.tgz#13ebdf71f5284ad54be94bd1ad9ed79adad515ff" + integrity sha512-8t6Q3TclQ4uZynJY9IGr2+SsIGwK9JHcO6ootkHCGA0CrQCRy+VkouYNO2xicET6b9al7QKzpebNow+gkpCL8g== + levn@^0.4.1: version "0.4.1" resolved "https://registry.yarnpkg.com/levn/-/levn-0.4.1.tgz#ae4562c007473b932a6200d403268dd2fffc6ade" @@ -4169,6 +4676,11 @@ listr2@^4.0.1: through "^2.3.8" wrap-ansi "^7.0.0" +lodash-es@^4.17.21: + version "4.17.21" + resolved "https://registry.yarnpkg.com/lodash-es/-/lodash-es-4.17.21.tgz#43e626c46e6591b7750beb2b50117390c609e3ee" + integrity sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw== + lodash.debounce@^4.0.8: version "4.0.8" resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af" @@ -4224,6 +4736,11 @@ log-update@^4.0.0: slice-ansi "^4.0.0" wrap-ansi "^6.2.0" +loglevel@^1.8.0: + version "1.8.0" + resolved "https://registry.yarnpkg.com/loglevel/-/loglevel-1.8.0.tgz#e7ec73a57e1e7b419cb6c6ac06bf050b67356114" + integrity sha512-G6A/nJLRgWOuuwdNuA6koovfEV1YpqqAG4pRUlFaz3jj2QNZ8M4vBqnVA+HBTmU/AMNUtlOsMmSpF6NyOjztbA== + loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" @@ -4250,6 +4767,15 @@ lz-string@^1.4.4: resolved "https://registry.yarnpkg.com/lz-string/-/lz-string-1.4.4.tgz#c0d8eaf36059f705796e1e344811cf4c498d3a26" integrity sha1-wNjq82BZ9wV5bh40SBHPTEmNOiY= +md5.js@^1.3.4: + version "1.3.5" + resolved "https://registry.yarnpkg.com/md5.js/-/md5.js-1.3.5.tgz#b5d07b8e3216e3e27cd728d72f70d1e6a342005f" + integrity sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg== + dependencies: + hash-base "^3.0.0" + inherits "^2.0.1" + safe-buffer "^5.1.2" + mdn-data@2.0.14: version "2.0.14" resolved "https://registry.yarnpkg.com/mdn-data/-/mdn-data-2.0.14.tgz#7113fc4281917d63ce29b43446f701e68c25ba50" @@ -4278,6 +4804,14 @@ micromatch@^4.0.4: braces "^3.0.2" picomatch "^2.3.1" +microtime@3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/microtime/-/microtime-3.0.0.tgz#d140914bde88aa89b4f9fd2a18620b435af0f39b" + integrity sha512-SirJr7ZL4ow2iWcb54bekS4aWyBQNVcEDBiwAz9D/sTgY59A+uE8UJU15cp5wyZmPBwg/3zf8lyCJ5NUe1nVlQ== + dependencies: + node-addon-api "^1.2.0" + node-gyp-build "^3.8.0" + mimic-fn@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" @@ -4379,6 +4913,11 @@ no-case@^3.0.4: lower-case "^2.0.2" tslib "^2.0.3" +node-addon-api@^1.2.0: + version "1.7.2" + resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-1.7.2.tgz#3df30b95720b53c24e59948b49532b662444f54d" + integrity sha512-ibPK3iA+vaY1eEjESkQkM0BbCqFOaZMiXRTtdB0u7b4djtY6JnsjvPdUHVMg6xQt3B8fpTTWHI9A+ADjM9frzg== + node-addon-api@^2.0.0: version "2.0.2" resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-2.0.2.tgz#432cfa82962ce494b132e9d72a15b29f71ff5d32" @@ -4403,6 +4942,11 @@ node-fetch@2.6.7: dependencies: whatwg-url "^5.0.0" +node-gyp-build@^3.8.0: + version "3.9.0" + resolved "https://registry.yarnpkg.com/node-gyp-build/-/node-gyp-build-3.9.0.tgz#53a350187dd4d5276750da21605d1cb681d09e25" + integrity sha512-zLcTg6P4AbcHPq465ZMFNXx7XpKKJh+7kkN699NiQWisR2uWYOWNWqRHAmbnmKiL4e9aLSlmy5U7rEMUXV59+A== + node-gyp-build@^4.2.0, node-gyp-build@^4.3.0: version "4.4.0" resolved "https://registry.yarnpkg.com/node-gyp-build/-/node-gyp-build-4.4.0.tgz#42e99687ce87ddeaf3a10b99dc06abc11021f3f4" @@ -4510,7 +5054,12 @@ object.values@^1.1.5: define-properties "^1.1.3" es-abstract "^1.19.1" -once@^1.3.0: +oblivious-set@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/oblivious-set/-/oblivious-set-1.0.0.tgz#c8316f2c2fb6ff7b11b6158db3234c49f733c566" + integrity sha512-z+pI07qxo4c2CulUHCDf9lcqDlMSo72N/4rLUpRXf6fu+q8vjt8y0xS+Tlf8NTJDdTXHbdeO1n3MlbctwEoXZw== + +once@^1.3.0, once@^1.3.1, once@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= @@ -4541,6 +5090,11 @@ optionator@^0.9.1: type-check "^0.4.0" word-wrap "^1.2.3" +p-finally@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" + integrity sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4= + p-map@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/p-map/-/p-map-4.0.0.tgz#bb2f95a5eda2ec168ec9274e06a747c3e2904d2b" @@ -4548,6 +5102,21 @@ p-map@^4.0.0: dependencies: aggregate-error "^3.0.0" +p-queue@6.6.2: + version "6.6.2" + resolved "https://registry.yarnpkg.com/p-queue/-/p-queue-6.6.2.tgz#2068a9dcf8e67dd0ec3e7a2bcb76810faa85e426" + integrity sha512-RwFpb72c/BhQLEXIZ5K2e+AhgNVmIejGlTgiB9MzZ0e93GRvqZ7uSi0dvRF7/XIXDeNkra2fNHBxTyPDGySpjQ== + dependencies: + eventemitter3 "^4.0.4" + p-timeout "^3.2.0" + +p-timeout@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/p-timeout/-/p-timeout-3.2.0.tgz#c7e17abc971d2a7962ef83626b35d635acf23dfe" + integrity sha512-rhIwUycgwwKcP9yTOOFK/AKsAopjjCakVqLHePO3CC6Mir1Z99xT+R63jZxAT5lFZLa2inS5h+ZS2GvR99/FBg== + dependencies: + p-finally "^1.0.0" + pako@^2.0.3: version "2.0.4" resolved "https://registry.yarnpkg.com/pako/-/pako-2.0.4.tgz#6cebc4bbb0b6c73b0d5b8d7e8476e2b2fbea576d" @@ -4590,6 +5159,17 @@ path-type@^4.0.0: resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b" integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw== +pbkdf2@^3.0.17: + version "3.1.2" + resolved "https://registry.yarnpkg.com/pbkdf2/-/pbkdf2-3.1.2.tgz#dd822aa0887580e52f1a039dc3eda108efae3075" + integrity sha512-iuh7L6jA7JEGu2WxDwtQP1ddOpaJNC4KlDEFfdQajSGgGPNi4OyDc2R7QnbY2bR9QjBVGwgvTdNJZoE7RaxUMA== + dependencies: + create-hash "^1.1.2" + create-hmac "^1.1.4" + ripemd160 "^2.0.1" + safe-buffer "^5.0.1" + sha.js "^2.4.8" + performance-now@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" @@ -4706,6 +5286,11 @@ pretty-hrtime@^1.0.3: resolved "https://registry.yarnpkg.com/pretty-hrtime/-/pretty-hrtime-1.0.3.tgz#b7e3ea42435a4c9b2759d99e0f201eb195802ee1" integrity sha1-t+PqQkNaTJsnWdmeDyAesZWALuE= +process@^0.11.10: + version "0.11.10" + resolved "https://registry.yarnpkg.com/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182" + integrity sha1-czIwDoQBYb2j5podHZGn1LwW8YI= + progress@^2.0.0: version "2.0.3" resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8" @@ -4728,6 +5313,14 @@ prop-types@15.x, prop-types@^15.5.4, prop-types@^15.5.8, prop-types@^15.6.0, pro object-assign "^4.1.1" react-is "^16.13.1" +pump@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/pump/-/pump-3.0.0.tgz#b4a2116815bde2f4e1ea602354e8c75565107a64" + integrity sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww== + dependencies: + end-of-stream "^1.1.0" + once "^1.3.1" + punycode@^2.1.0: version "2.1.1" resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" @@ -4760,6 +5353,13 @@ raf@^3.4.0: dependencies: performance-now "^2.1.0" +randombytes@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a" + integrity sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ== + dependencies: + safe-buffer "^5.1.0" + rc-align@^4.0.0: version "4.0.11" resolved "https://registry.yarnpkg.com/rc-align/-/rc-align-4.0.11.tgz#8198c62db266bc1b8ef05e56c13275bf72628a5e" @@ -4993,6 +5593,15 @@ react@^17.0.2: loose-envify "^1.1.0" object-assign "^4.1.1" +readable-stream@^3.5.0, readable-stream@^3.6.0: + version "3.6.0" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.0.tgz#337bbda3adc0706bd3e024426a286d4b4b2c9198" + integrity sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA== + dependencies: + inherits "^2.0.3" + string_decoder "^1.1.1" + util-deprecate "^1.0.1" + readdirp@~3.6.0: version "3.6.0" resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.6.0.tgz#74a370bd857116e245b29cc97340cd431a02a6c7" @@ -5176,13 +5785,28 @@ rgba-regex@^1.0.0: resolved "https://registry.yarnpkg.com/rgba-regex/-/rgba-regex-1.0.0.tgz#43374e2e2ca0968b0ef1523460b7d730ff22eeb3" integrity sha1-QzdOLiyglosO8VI0YLfXMP8i7rM= -rimraf@^3.0.0, rimraf@^3.0.2: +rimraf@3.0.2, rimraf@^3.0.0, rimraf@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-3.0.2.tgz#f1a5402ba6220ad52cc1282bac1ae3aa49fd061a" integrity sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA== dependencies: glob "^7.1.3" +ripemd160@^2.0.0, ripemd160@^2.0.1: + version "2.0.2" + resolved "https://registry.yarnpkg.com/ripemd160/-/ripemd160-2.0.2.tgz#a1c1a6f624751577ba5d07914cbc92850585890c" + integrity sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA== + dependencies: + hash-base "^3.0.0" + inherits "^2.0.1" + +rlp@^2.2.4: + version "2.2.7" + resolved "https://registry.yarnpkg.com/rlp/-/rlp-2.2.7.tgz#33f31c4afac81124ac4b283e2bd4d9720b30beaf" + integrity sha512-d5gdPmgQ0Z+AklL2NVXr/IoSjNZFfTVvQWzL/AM2AOcSzYP2xjlb0AC8YyCLc41MSNf6P6QVtjgPdmVtzb+4lQ== + dependencies: + bn.js "^5.2.0" + rpc-websockets@^7.4.2: version "7.4.17" resolved "https://registry.yarnpkg.com/rpc-websockets/-/rpc-websockets-7.4.17.tgz#f38845dd96db0442bff9e15fba9df781beb44cc0" @@ -5204,6 +5828,13 @@ run-parallel@^1.1.9: dependencies: queue-microtask "^1.2.2" +rxjs@6: + version "6.6.7" + resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.6.7.tgz#90ac018acabf491bf65044235d5863c4dab804c9" + integrity sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ== + dependencies: + tslib "^1.9.0" + rxjs@^7.5.5: version "7.5.5" resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-7.5.5.tgz#2ebad89af0f560f460ad5cc4213219e1f7dd4e9f" @@ -5211,7 +5842,7 @@ rxjs@^7.5.5: dependencies: tslib "^2.1.0" -safe-buffer@^5.0.1, safe-buffer@^5.1.2: +safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@^5.2.0, safe-buffer@~5.2.0: version "5.2.1" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== @@ -5221,6 +5852,11 @@ safe-buffer@~5.1.1: resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== +safe-json-utils@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/safe-json-utils/-/safe-json-utils-1.1.1.tgz#0e883874467d95ab914c3f511096b89bfb3e63b1" + integrity sha512-SAJWGKDs50tAbiDXLf89PDwt9XYkWyANFWVzn4dTXl5QyI8t2o/bW5/OJl3lvc2WVU4MEpTo9Yz5NVFNsp+OJQ== + "safer-buffer@>= 2.1.2 < 3.0.0": version "2.1.2" resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" @@ -5234,7 +5870,12 @@ scheduler@^0.20.2: loose-envify "^1.1.0" object-assign "^4.1.1" -secp256k1@^4.0.2: +scrypt-js@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/scrypt-js/-/scrypt-js-3.0.1.tgz#d314a57c2aef69d1ad98a138a21fe9eafa9ee312" + integrity sha512-cdwTTnqPu0Hyvf5in5asVdZocVDTNRmR7XEcJuIzMjJeSHybHl7vpB66AzwTaIg6CLSbtjcxc8fqcySfnTkccA== + +secp256k1@^4.0.1, secp256k1@^4.0.2: version "4.0.3" resolved "https://registry.yarnpkg.com/secp256k1/-/secp256k1-4.0.3.tgz#c4559ecd1b8d3c1827ed2d1b94190d69ce267303" integrity sha512-NLZVf+ROMxwtEj3Xa562qgv2BK5e2WNmXPiOdVIPLgs6lyTzMvBq0aWTYMI5XCP9jZMVKOcqZLw/Wc4vDkuxhA== @@ -5260,6 +5901,19 @@ semver@^7.2.1, semver@^7.3.5: dependencies: lru-cache "^6.0.0" +setimmediate@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285" + integrity sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU= + +sha.js@^2.4.0, sha.js@^2.4.8: + version "2.4.11" + resolved "https://registry.yarnpkg.com/sha.js/-/sha.js-2.4.11.tgz#37a5cf0b81ecbc6943de109ba2960d1b26584ae7" + integrity sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ== + dependencies: + inherits "^2.0.1" + safe-buffer "^5.0.1" + shallow-equal@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/shallow-equal/-/shallow-equal-1.2.1.tgz#4c16abfa56043aa20d050324efa68940b0da79da" @@ -5376,6 +6030,14 @@ stable@^0.1.8: resolved "https://registry.yarnpkg.com/stable/-/stable-0.1.8.tgz#836eb3c8382fe2936feaf544631017ce7d47a3cf" integrity sha512-ji9qxRnOVfcuLDySj9qzhGSEFVobyt1kIOSkj1qZzYLzq7Tos/oUUWvotUPQLlrsidqsK6tBH89Bc9kL5zHA6w== +stream-browserify@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/stream-browserify/-/stream-browserify-3.0.0.tgz#22b0a2850cdf6503e73085da1fc7b7d0c2122f2f" + integrity sha512-H73RAHsVBapbim0tU2JwwOiXUj+fikfiaoYAKHF3VJfA0pe2BCzkhAHBlLG6REzE+2WNZcxOXjK7lkso+9euLA== + dependencies: + inherits "~2.0.4" + readable-stream "^3.5.0" + string-argv@^0.3.1: version "0.3.1" resolved "https://registry.yarnpkg.com/string-argv/-/string-argv-0.3.1.tgz#95e2fbec0427ae19184935f816d74aaa4c5c19da" @@ -5434,6 +6096,13 @@ string.prototype.trimstart@^1.0.4: call-bind "^1.0.2" define-properties "^1.1.3" +string_decoder@^1.1.1: + version "1.3.0" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.3.0.tgz#42f114594a46cf1a8e30b0a84f56c78c3edac21e" + integrity sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA== + dependencies: + safe-buffer "~5.2.0" + strip-ansi@^6.0.0, strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" @@ -5667,7 +6336,7 @@ tsc-files@^1.1.3: resolved "https://registry.yarnpkg.com/tsc-files/-/tsc-files-1.1.3.tgz#ef4cfcb7affc9b90577d707a879dc53bb105be83" integrity sha512-G6uXkTNofGU9EE1fYBaCpR72x/aqXW4PDAuznWj4JYlDwhcaKnUn4CiCHBMc89lDxLmikK+hhaEWLoTPEKKvXg== -tslib@^1.8.1, tslib@^1.9.3: +tslib@^1.8.1, tslib@^1.9.0, tslib@^1.9.3: version "1.14.1" resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== @@ -5770,6 +6439,14 @@ universalify@^2.0.0: resolved "https://registry.yarnpkg.com/universalify/-/universalify-2.0.0.tgz#75a4984efedc4b08975c5aeb73f530d02df25717" integrity sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ== +unload@2.3.1: + version "2.3.1" + resolved "https://registry.yarnpkg.com/unload/-/unload-2.3.1.tgz#9d16862d372a5ce5cb630ad1309c2fd6e35dacfe" + integrity sha512-MUZEiDqvAN9AIDRbbBnVYVvfcR6DrjCqeU2YQMmliFZl9uaBUjTkhuDQkBiyAy8ad5bx1TXVbqZ3gg7namsWjA== + dependencies: + "@babel/runtime" "^7.6.2" + detect-node "2.1.0" + uri-js@^4.2.2: version "4.4.1" resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.4.1.tgz#9b1a52595225859e55f669d928f88c6c57f2a77e" @@ -5791,7 +6468,7 @@ utf-8-validate@^5.0.2: dependencies: node-gyp-build "^4.3.0" -util-deprecate@^1.0.2: +util-deprecate@^1.0.1, util-deprecate@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8= @@ -5916,7 +6593,7 @@ wrappy@1: resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= -ws@^7.3.1, ws@^7.4.5: +ws@^7.3.1, ws@^7.4.0, ws@^7.4.5: version "7.5.7" resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.7.tgz#9e0ac77ee50af70d58326ecff7e85eb3fa375e67" integrity sha512-KMvVuFzpKBuiIXW3E4u3mySRO2/mCHSyZDJQM5NQ9Q9KHWHWh0NHgfbRMLLrceUK5qAL4ytALJbpRMjixFZh8A== From 5f901052760036e420bf907f543c492ef581e50a Mon Sep 17 00:00:00 2001 From: tjs Date: Wed, 20 Apr 2022 17:04:16 -0400 Subject: [PATCH 10/27] upgrade to latest jup-ag pkg --- components/JupiterForm.tsx | 21 ++-- package.json | 2 +- yarn.lock | 229 +++++++++++++++++++++++-------------- 3 files changed, 158 insertions(+), 94 deletions(-) diff --git a/components/JupiterForm.tsx b/components/JupiterForm.tsx index 4af8deeb..c2b1f590 100644 --- a/components/JupiterForm.tsx +++ b/components/JupiterForm.tsx @@ -640,6 +640,8 @@ const JupiterForm: FunctionComponent = () => {
{selectedRoute?.marketInfos.map((info, index) => { + console.log('info', info) + let includeSeparator = false if ( selectedRoute?.marketInfos.length > 1 && @@ -648,9 +650,9 @@ const JupiterForm: FunctionComponent = () => { includeSeparator = true } return ( - {`${ - info.marketMeta.amm.label - } ${includeSeparator ? 'x ' : ''}`} + {`${info.amm.label} ${ + includeSeparator ? 'x ' : '' + }`} ) })} @@ -815,8 +817,7 @@ const JupiterForm: FunctionComponent = () => {
{t('swap:fees-paid-to', { - feeRecipient: - info.marketMeta?.amm?.label, + feeRecipient: info?.amm?.label, })} {feeToken?.decimals && ( @@ -851,7 +852,7 @@ const JupiterForm: FunctionComponent = () => {
{t('swap:fees-paid-to', { - feeRecipient: info.marketMeta?.amm?.label, + feeRecipient: info?.amm?.label, })} {feeToken?.decimals && ( @@ -1099,9 +1100,9 @@ const JupiterForm: FunctionComponent = () => { includeSeparator = true } return ( - {`${ - info.marketMeta.amm.label - } ${includeSeparator ? 'x ' : ''}`} + {`${info.amm.label} ${ + includeSeparator ? 'x ' : '' + }`} ) })}
@@ -1184,7 +1185,7 @@ const JupiterForm: FunctionComponent = () => { {t('swap:get-started')}
- {t('swap-in-wallet')} + {t('swap:swap-in-wallet')}
diff --git a/package.json b/package.json index c93532d3..1f0beadd 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "@blockworks-foundation/mango-client": "^3.4.4", "@headlessui/react": "^0.0.0-insiders.2dbc38c", "@heroicons/react": "^1.0.0", - "@jup-ag/react-hook": "^1.0.0-beta.19", + "@jup-ag/react-hook": "^1.0.0-beta.22", "@project-serum/serum": "0.13.55", "@project-serum/sol-wallet-adapter": "0.2.0", "@sentry/react": "^6.19.2", diff --git a/yarn.lock b/yarn.lock index 42c60bf8..2dc3227f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1036,6 +1036,18 @@ eip1193-provider "^1.0.1" js-sha3 "^0.8.0" +"@cykura/sdk-core@npm:@jup-ag/cykura-sdk-core@0.1.7", "@jup-ag/cykura-sdk-core@0.1.7": + version "0.1.7" + resolved "https://registry.yarnpkg.com/@jup-ag/cykura-sdk-core/-/cykura-sdk-core-0.1.7.tgz#995a446fb8b9134fed3e7fe0c0a58557f9fc9939" + integrity sha512-lA5UXUaauLdBYTmMY0eO9O6HrhBrnaX8vfk6Dbx3OhdfFzIKPrTB8i4d6aRyzU7tgka2ibZZnPaX+B6cj1nsrA== + dependencies: + "@project-serum/anchor" "^0.22.0" + big.js "^5.2.2" + decimal.js "^10.3.1" + jsbi "^4.1.0" + tiny-invariant "^1.1.0" + toformat "^2.0.0" + "@eslint/eslintrc@^0.4.3": version "0.4.3" resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-0.4.3.tgz#9e42981ef035beb3dd49add17acb96e8ff6f394c" @@ -1150,26 +1162,27 @@ "@json-rpc-tools/types" "^1.7.6" "@pedrouid/environment" "^1.0.1" -"@jup-ag/core@1.0.0-beta.19": - version "1.0.0-beta.19" - resolved "https://registry.yarnpkg.com/@jup-ag/core/-/core-1.0.0-beta.19.tgz#fa461d20cf35391360a04fe24dcc8306aeae5b37" - integrity sha512-FDfwl0iTlabZBbW1E6Ox8kzlQsh8i+5jPl0DouDQBT3necvaqfvQ1j2Cm5Ceu5aF92uhpfep6uv4QBtLiSMqRw== +"@jup-ag/core@1.0.0-beta.22": + version "1.0.0-beta.22" + resolved "https://registry.yarnpkg.com/@jup-ag/core/-/core-1.0.0-beta.22.tgz#97e77ff11aac42c5c4bea7ec9c9729e2cb2c7234" + integrity sha512-Xmk7/tuNYOqMOKLXTtTGN2j6AINXi22iD3Y5bjQNTfMmU+H23NrtYa78AtBiHM0yjTB01b1ZH9LOHsISO1+Ybw== dependencies: "@jup-ag/crema-sdk" "~1.1.10" + "@jup-ag/cykura-sdk" "0.1.24" + "@jup-ag/cykura-sdk-core" "0.1.7" "@jup-ag/lifinity-sdk" "~0.1.16" - "@jup-ag/math" "1.0.0-beta.19" - "@mercurial-finance/optimist" "~0.1.2" + "@jup-ag/math" "1.0.0-beta.22" + "@jup-ag/whirlpool-sdk" "~0.0.33" + "@mercurial-finance/optimist" "~0.1.3" "@project-serum/anchor" "~0.23.0" - "@project-serum/serum" "~0.13.61" - "@saberhq/stableswap-sdk" "~1.12.55" + "@project-serum/serum" "~0.13.64" + "@saberhq/stableswap-sdk" "~1.12.62" "@solana/spl-token" "~0.1.8" - "@solana/web3.js" "1.31.0" bn.js "~5.2.0" - cross-fetch "3.1.4" + cross-fetch "^3.1.5" decimal.js "~10.3.1" - jsbi "~4.1.0" + jsbi "~4.3.0" promise-retry "~2.0.1" - tiny-invariant "~1.2.0" "@jup-ag/crema-sdk@~1.1.10": version "1.1.10" @@ -1181,6 +1194,16 @@ decimal.js "^10.3.1" tiny-invariant "^1.2.0" +"@jup-ag/cykura-sdk@0.1.24": + version "0.1.24" + resolved "https://registry.yarnpkg.com/@jup-ag/cykura-sdk/-/cykura-sdk-0.1.24.tgz#6f8cc6092d859f8642881dbae8211dd5ac134101" + integrity sha512-9DFN47D6UP8+pZJHlUxve626u73sjXrhIGblHqnTkmCJZ7GicbXBV+lBcfex8xqin/u0xZSoHSfEOir63JFgIg== + dependencies: + "@cykura/sdk-core" "npm:@jup-ag/cykura-sdk-core@0.1.7" + "@project-serum/anchor" "^0.22.1" + "@solana/web3.js" "^1.32.0" + tiny-invariant "^1.1.0" + "@jup-ag/lifinity-sdk@~0.1.16": version "0.1.16" resolved "https://registry.yarnpkg.com/@jup-ag/lifinity-sdk/-/lifinity-sdk-0.1.16.tgz#23dc0024451266b8e8f84187a98ce3fe9211278b" @@ -1194,23 +1217,33 @@ "@solana/web3.js" "1.31.0" decimal.js "^10.3.1" -"@jup-ag/math@1.0.0-beta.19": - version "1.0.0-beta.19" - resolved "https://registry.yarnpkg.com/@jup-ag/math/-/math-1.0.0-beta.19.tgz#ad5b54d393daa2383c8154e88ee858a44cc6c34a" - integrity sha512-0A7NCCVa29OCxfXI7T2kZu++iRmhpm0lmuGjqmThJIWRlC5W0tl+ILjOAOssqbbqMtSbekV0f07NJou464WqZQ== +"@jup-ag/math@1.0.0-beta.22": + version "1.0.0-beta.22" + resolved "https://registry.yarnpkg.com/@jup-ag/math/-/math-1.0.0-beta.22.tgz#41e2293cdf8feb6906e9618f3aa0116ffc22fe2f" + integrity sha512-L1Y9oN/2rXaRpUmr0stznN/goSSWnIToMa2C60J996dywheM1o0wi+e434R6OpulAWejaGe8kiP+QBgWqfSTaw== dependencies: - "@solana/spl-token-registry" "~0.2.1105" - "@solana/web3.js" "1.31.0" - builder-pattern "~1.3.0" decimal.js "~10.3.1" - jsbi "~4.1.0" + jsbi "~4.3.0" -"@jup-ag/react-hook@^1.0.0-beta.19": - version "1.0.0-beta.19" - resolved "https://registry.yarnpkg.com/@jup-ag/react-hook/-/react-hook-1.0.0-beta.19.tgz#2bf77af5e397d43a4513d9d9d03eab26ae4675af" - integrity sha512-C/PNLiPCynTlbr+ZGWQCmZttQVhUbs2TsWXdy7mf4lvhtyOr4FM+MZ6j5WS0tTSnXyRHwH4rPeKvsSYlGZYA0A== +"@jup-ag/react-hook@^1.0.0-beta.22": + version "1.0.0-beta.22" + resolved "https://registry.yarnpkg.com/@jup-ag/react-hook/-/react-hook-1.0.0-beta.22.tgz#a00e30c0e0f06990e44c5736660f735501e412e0" + integrity sha512-JKHAM7AsJHnsVbx3IE/tWlx8gG7RYSddpU67DeL1MOte3eFbjxwhY364PHS5QlKLr6b+pffJrY7HBq3Pg7Khrg== dependencies: - "@jup-ag/core" "1.0.0-beta.19" + "@jup-ag/core" "1.0.0-beta.22" + +"@jup-ag/whirlpool-sdk@~0.0.33": + version "0.0.33" + resolved "https://registry.yarnpkg.com/@jup-ag/whirlpool-sdk/-/whirlpool-sdk-0.0.33.tgz#244e30fa021c767bcb92f63107ca001a69925716" + integrity sha512-KxkvJ2TOce+odZIoZnGTkFuANqhfGF2QZ+JVT1uN+f8W/f4Y9gt1VxTrnyK2YlfrLqI8LzwFwz0asGZ/wsUKtQ== + dependencies: + "@orca-so/whirlpool-client-sdk" "npm:@jup-ag/whirlpool-client-sdk@0.0.7" + "@project-serum/anchor" "~0.23.0" + "@solana/spl-token" "~0.1.8" + axios "^0.25.0" + bn.js "~5.2.0" + decimal.js "~10.3.1" + tiny-invariant "~1.2.0" "@ledgerhq/devices@^6.27.1": version "6.27.1" @@ -1251,10 +1284,10 @@ resolved "https://registry.yarnpkg.com/@ledgerhq/logs/-/logs-6.10.0.tgz#c012c1ecc1a0e53d50e6af381618dca5268461c1" integrity sha512-lLseUPEhSFUXYTKj6q7s2O3s2vW2ebgA11vMAlKodXGf5AFw4zUoEbTz9CoFOC9jS6xY4Qr8BmRnxP/odT4Uuw== -"@mercurial-finance/optimist@~0.1.2": - version "0.1.2" - resolved "https://registry.yarnpkg.com/@mercurial-finance/optimist/-/optimist-0.1.2.tgz#0837f8d5edd0e09df3c04be4ee251d49de0f9a58" - integrity sha512-4BgvQxTpJoHnzIDaMdHwZn5Iw9NGo92ms/i17nU1yXtVzleoVNhgRjW+p1EY+kiIC+spfP0xwgUajk+D9G3ZDA== +"@mercurial-finance/optimist@~0.1.3": + version "0.1.3" + resolved "https://registry.yarnpkg.com/@mercurial-finance/optimist/-/optimist-0.1.3.tgz#93ffb4acd2ff7e609f5bcdbe14f837bd5241c8c4" + integrity sha512-WC3HynwbUOloIH1Q4+NQd5yqrRQ8QZG4PQOhragh/tNIRbgu0EnIfm52rQDy3Spwq1xCjLkPbr3RYZfMXbT0aw== "@metaplex-foundation/mpl-core@^0.0.2": version "0.0.2" @@ -1361,6 +1394,17 @@ "@nodelib/fs.scandir" "2.1.5" fastq "^1.6.0" +"@orca-so/whirlpool-client-sdk@npm:@jup-ag/whirlpool-client-sdk@0.0.7": + version "0.0.7" + resolved "https://registry.yarnpkg.com/@jup-ag/whirlpool-client-sdk/-/whirlpool-client-sdk-0.0.7.tgz#dabb35e9cccc4069d17c3299f7c6ff8b7d0f4bfa" + integrity sha512-RDBd9nOHfIr/x7DqJ+KpbYaTZWgsjdsxAY8NUzg6EEoYzg/BLjrtfl2Ec9pHjWIrsJdaMi2h6nR2pX0c5BRO2w== + dependencies: + "@project-serum/anchor" "~0.23.0" + "@solana/spl-token" "~0.1.8" + "@tsconfig/recommended" "^1.0.1" + bn.js "~5.2.0" + decimal.js "~10.3.1" + "@pedrouid/environment@^1.0.1": version "1.0.1" resolved "https://registry.yarnpkg.com/@pedrouid/environment/-/environment-1.0.1.tgz#858f0f8a057340e0b250398b75ead77d6f4342ec" @@ -1437,6 +1481,27 @@ snake-case "^3.0.4" toml "^3.0.0" +"@project-serum/anchor@^0.22.0", "@project-serum/anchor@^0.22.1": + version "0.22.1" + resolved "https://registry.yarnpkg.com/@project-serum/anchor/-/anchor-0.22.1.tgz#698a9620f94691de0a12bbc650a5c8380e2f0e8a" + integrity sha512-5pHeyvQhzLahIQ8aZymmDMZJAJFklN0joZdI+YIqFkK2uU/mlKr6rBLQjxysf/j1mLLiNG00tdyLfUtTAdQz7w== + dependencies: + "@project-serum/borsh" "^0.2.5" + "@solana/web3.js" "^1.17.0" + base64-js "^1.5.1" + bn.js "^5.1.2" + bs58 "^4.0.1" + buffer-layout "^1.2.2" + camelcase "^5.3.1" + cross-fetch "^3.1.5" + crypto-hash "^1.3.0" + eventemitter3 "^4.0.7" + find "^0.3.0" + js-sha256 "^0.9.0" + pako "^2.0.3" + snake-case "^3.0.4" + toml "^3.0.0" + "@project-serum/anchor@~0.23.0": version "0.23.0" resolved "https://registry.yarnpkg.com/@project-serum/anchor/-/anchor-0.23.0.tgz#2b2eb6b51601b073e8db26663aa2d6c2f2841771" @@ -1477,7 +1542,7 @@ bn.js "^5.1.2" buffer-layout "^1.2.0" -"@project-serum/serum@^0.13.61", "@project-serum/serum@~0.13.61": +"@project-serum/serum@^0.13.61": version "0.13.61" resolved "https://registry.yarnpkg.com/@project-serum/serum/-/serum-0.13.61.tgz#1f0e6dfa7786a71e4317593911e9915d8b2a06e6" integrity sha512-aebaRGQ0/K7a5kJ9UXO59BAQFJILVu5jbGobU8GD2CTSy6SPceprB6/pgZmZLQIabhXWUHaZRF/wXIClgWataA== @@ -1488,6 +1553,17 @@ bn.js "^5.1.2" buffer-layout "^1.2.0" +"@project-serum/serum@~0.13.64": + version "0.13.64" + resolved "https://registry.yarnpkg.com/@project-serum/serum/-/serum-0.13.64.tgz#d5a9009ded8d2539ebfd12e1ff58b9028cfcdf45" + integrity sha512-33d8K3qcbiFnL1Azv5k6IYMtJYjCqqmFkf95w5W8MPB0A+5zQfOwhEfXQuBw0ExZ8ft5s9Vy8sReLyx0SsINWA== + dependencies: + "@project-serum/anchor" "^0.11.1" + "@solana/spl-token" "^0.1.6" + "@solana/web3.js" "^1.21.0" + bn.js "^5.1.2" + buffer-layout "^1.2.0" + "@project-serum/sol-wallet-adapter@0.2.0": version "0.2.0" resolved "https://registry.yarnpkg.com/@project-serum/sol-wallet-adapter/-/sol-wallet-adapter-0.2.0.tgz#e1fa5508bf13110429bf26e10b818182015f2161" @@ -1513,11 +1589,12 @@ assert "^2.0.0" buffer "^6.0.1" -"@saberhq/solana-contrib@^1.12.56": - version "1.12.56" - resolved "https://registry.yarnpkg.com/@saberhq/solana-contrib/-/solana-contrib-1.12.56.tgz#0472ba6960d9993c37808697d7afff5b63e11b14" - integrity sha512-b6Szv+XqJE9pFqQ6QfQluRyvQIXAdmLk/KrZ2Ks/XtQVMX2ZxdBf5mGozGNa8NzuzgeOzj/BQ8akbAazfll5dw== +"@saberhq/solana-contrib@^1.12.64": + version "1.12.64" + resolved "https://registry.yarnpkg.com/@saberhq/solana-contrib/-/solana-contrib-1.12.64.tgz#baafefb09fee97e903a6b15073b4b28cf5c24343" + integrity sha512-L9ClBTPM9nGq7bXu+/L7eRTbBRACCH4IKSj/bDY3gWscY5fobfOslZqlCKMWd/96uDUCriwnLP8RZ5Ccp11QSQ== dependencies: + "@solana/buffer-layout" "^4.0.0" "@types/promise-retry" "^1.1.3" "@types/retry" "^0.12.1" promise-retry "^2.0.1" @@ -1525,23 +1602,23 @@ tiny-invariant "^1.2.0" tslib "^2.3.1" -"@saberhq/stableswap-sdk@~1.12.55": - version "1.12.56" - resolved "https://registry.yarnpkg.com/@saberhq/stableswap-sdk/-/stableswap-sdk-1.12.56.tgz#993c2baa39ce5dd65c0a9c738570bc26ed4b0435" - integrity sha512-zNx7NQN91CqMQz03pu+zyEoN8pcS0QBvbie71YELW39yD/okILCvOXV11xGiaEHID3mQrZfOzq1cdSRI2Rrx7Q== +"@saberhq/stableswap-sdk@~1.12.62": + version "1.12.64" + resolved "https://registry.yarnpkg.com/@saberhq/stableswap-sdk/-/stableswap-sdk-1.12.64.tgz#7b642f6d918b6cda9e0d2c87baf0d0a66c94aa7e" + integrity sha512-nBa+A5ryuNpMdezvmhehJdWX4iUm0ZMLdXLJYBduwoN0TpDHv7ag+RiS1pjxkc3LcskmLy4N6sSrbSL4PW51aQ== dependencies: - "@saberhq/solana-contrib" "^1.12.56" - "@saberhq/token-utils" "^1.12.56" + "@saberhq/solana-contrib" "^1.12.64" + "@saberhq/token-utils" "^1.12.64" "@solana/buffer-layout" "^4.0.0" lodash.mapvalues "^4.6.0" tslib "^2.3.1" -"@saberhq/token-utils@^1.12.56": - version "1.12.56" - resolved "https://registry.yarnpkg.com/@saberhq/token-utils/-/token-utils-1.12.56.tgz#c86e5e14f1525502c51243cd6f5ddbb0ba118316" - integrity sha512-2lSsKCyVIXSv4ebT6qD+CIKkMASp31BaEirS0Vg4Hi6hV96siNy+HBrM1Jq7CO38pr2/Gp4X9kOfY02axDuBeg== +"@saberhq/token-utils@^1.12.64": + version "1.12.64" + resolved "https://registry.yarnpkg.com/@saberhq/token-utils/-/token-utils-1.12.64.tgz#7b8f73f6f3a5752238843b862697428c2f065747" + integrity sha512-JAcQpJigDE7/bQm5GbYtoQSJJe1YS3JwyC52l+7OkTEMwSqGS1hcOhCl6DonVoQtDz9sGoJXt/aZxOY1uipTgg== dependencies: - "@saberhq/solana-contrib" "^1.12.56" + "@saberhq/solana-contrib" "^1.12.64" "@solana/buffer-layout" "^4.0.0" "@solana/spl-token" "^0.1.8" "@ubeswap/token-math" "^4.4.6" @@ -1630,13 +1707,6 @@ dependencies: buffer "~6.0.3" -"@solana/spl-token-registry@~0.2.1105": - version "0.2.3027" - resolved "https://registry.yarnpkg.com/@solana/spl-token-registry/-/spl-token-registry-0.2.3027.tgz#9d2d8a725c7be8ccd3a75bc816fa092a20c91d80" - integrity sha512-Lc2N22EZ2R58LzxRos+VCJefYnAhfQDILJm9Q8U6r6juXp+9sk9nVgqdzzVoEnJTtcC2OmF4Cb9WOsNNhWBgfQ== - dependencies: - cross-fetch "3.0.6" - "@solana/spl-token@^0.1.6", "@solana/spl-token@^0.1.8", "@solana/spl-token@~0.1.8": version "0.1.8" resolved "https://registry.yarnpkg.com/@solana/spl-token/-/spl-token-0.1.8.tgz#f06e746341ef8d04165e21fc7f555492a2a0faa6" @@ -1906,7 +1976,7 @@ superstruct "^0.14.2" tweetnacl "^1.0.0" -"@solana/web3.js@^1.35.0": +"@solana/web3.js@^1.32.0", "@solana/web3.js@^1.35.0": version "1.39.1" resolved "https://registry.yarnpkg.com/@solana/web3.js/-/web3.js-1.39.1.tgz#858ecd42ff2a5bcba3a4bb642a50194d77e2a578" integrity sha512-Q7XnWTAiU7n7GcoINDAAMLO7CJHpm5kPK46HKwJi2x0cusHQ3WFa7QEp6aPzH7tuf7yl/Kw1lYitcwTVOvqARA== @@ -2151,6 +2221,11 @@ resolved "https://registry.yarnpkg.com/@trysound/sax/-/sax-0.2.0.tgz#cccaab758af56761eb7bf37af6f03f326dd798ad" integrity sha512-L7z9BgrNEcYyUYtF+HaEfiS5ebkh9jXqbszz7pC0hRBPaatV0XjSD3+eHrpqFemQfgwiFF0QPIarnIihIDn7OA== +"@tsconfig/recommended@^1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@tsconfig/recommended/-/recommended-1.0.1.tgz#7619bad397e06ead1c5182926c944e0ca6177f52" + integrity sha512-2xN+iGTbPBEzGSnVp/Hd64vKJCJWxsi9gfs88x4PPMyEjHJoA3o5BY9r5OLPHIZU2pAQxkSAsJFqn6itClP8mQ== + "@types/aria-query@^4.2.0": version "4.2.2" resolved "https://registry.yarnpkg.com/@types/aria-query/-/aria-query-4.2.2.tgz#ed4e0ad92306a704f9fb132a0cfcf77486dbe2bc" @@ -2642,6 +2717,13 @@ axios@^0.21.0: dependencies: follow-redirects "^1.14.0" +axios@^0.25.0: + version "0.25.0" + resolved "https://registry.yarnpkg.com/axios/-/axios-0.25.0.tgz#349cfbb31331a9b4453190791760a8d35b093e0a" + integrity sha512-cD8FOb0tRH3uuEe6+evtAbgJtfxr7ly3fQjYcMcuPlgkwVS9xboaVIpcDV+cYQe+yGykgwZCs1pzjntcGa6l5g== + dependencies: + follow-redirects "^1.14.7" + babel-plugin-dynamic-import-node@^2.3.3: version "2.3.3" resolved "https://registry.yarnpkg.com/babel-plugin-dynamic-import-node/-/babel-plugin-dynamic-import-node-2.3.3.tgz#84fda19c976ec5c6defef57f9427b3def66e17a3" @@ -2704,6 +2786,11 @@ base64url@^3.0.1: resolved "https://registry.yarnpkg.com/base64url/-/base64url-3.0.1.tgz#6399d572e2bc3f90a9a8b22d5dbb0a32d33f788d" integrity sha512-ir1UPr3dkwexU7FdV8qBBbNDRUhMmIekYMFZfi+C/sLNnRESKPl23nB9b2pltqfOQNnGzsDdId90AEtG5tCx4A== +big.js@^5.2.2: + version "5.2.2" + resolved "https://registry.yarnpkg.com/big.js/-/big.js-5.2.2.tgz#65f0af382f578bcdc742bd9c281e9cb2d7768328" + integrity sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ== + big.js@^6.1.1: version "6.1.1" resolved "https://registry.yarnpkg.com/big.js/-/big.js-6.1.1.tgz#63b35b19dc9775c94991ee5db7694880655d5537" @@ -2868,11 +2955,6 @@ bufferutil@^4.0.1: dependencies: node-gyp-build "^4.3.0" -builder-pattern@~1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/builder-pattern/-/builder-pattern-1.3.0.tgz#a70dd297340a630cc88bc987e2fd80c85b8455c2" - integrity sha512-Et/hsZtdEQig6744zDzkkhFnnb/i2H/3d1iAb46cIIcFQnmLVw2Hes5JIMiPe/Jh4dovDJO+x88yC0Omd2OcRw== - bytes@^3.0.0: version "3.1.2" resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.2.tgz#8b0beeb98605adf1b128fa4386403c009e0221a5" @@ -3163,20 +3245,6 @@ create-hmac@^1.1.4, create-hmac@^1.1.7: safe-buffer "^5.0.1" sha.js "^2.4.8" -cross-fetch@3.0.6: - version "3.0.6" - resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-3.0.6.tgz#3a4040bc8941e653e0e9cf17f29ebcd177d3365c" - integrity sha512-KBPUbqgFjzWlVcURG+Svp9TlhA5uliYtiNx/0r8nv0pdypeQCRJ9IaSIc3q/x3q8t3F75cHuwxVql1HFGHCNJQ== - dependencies: - node-fetch "2.6.1" - -cross-fetch@3.1.4: - version "3.1.4" - resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-3.1.4.tgz#9723f3a3a247bf8b89039f3a380a9244e8fa2f39" - integrity sha512-1eAtFWdIubi6T4XPy6ei9iUFoKpUkIF971QLN8lIvvvwueI65+Nw5haMNKUwfJxabqlIIDODJKGrQ66gxC0PbQ== - dependencies: - node-fetch "2.6.1" - cross-fetch@^3.1.4, cross-fetch@^3.1.5: version "3.1.5" resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-3.1.5.tgz#e1389f44d9e7ba767907f7af8454787952ab534f" @@ -3939,7 +4007,7 @@ flatted@^3.1.0: resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.5.tgz#76c8584f4fc843db64702a6bd04ab7a8bd666da3" integrity sha512-WIWGi2L3DyTUvUrwRKgGi9TwxQMUEqPOPQBVi71R96jZXJdFskXEmf54BoZaS1kknGODoIGASGEzBUYdyMCBJg== -follow-redirects@^1.14.0: +follow-redirects@^1.14.0, follow-redirects@^1.14.7: version "1.14.9" resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.14.9.tgz#dd4ea157de7bfaf9ea9b3fbd85aa16951f78d8d7" integrity sha512-MQDfihBQYMcyy5dhRDJUHcw7lb2Pv/TuE6xP1vyraLukNDHKbDxDNaOE3NbCAdKQApno+GPRyo1YAp89yCjK4w== @@ -4528,10 +4596,10 @@ js-yaml@^3.13.1: argparse "^1.0.7" esprima "^4.0.0" -jsbi@~4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/jsbi/-/jsbi-4.1.0.tgz#f0c25ed8881bc09891334b03a3952efaa7add337" - integrity sha512-384Z4keIsJtYpnVggsxaB255MZctILbxv+ihtwoWPF7KNOlYHn1LFpRnUw5qsAspUAA2+I7qzjVJxVYtHVjxNw== +jsbi@^4.1.0, jsbi@~4.3.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/jsbi/-/jsbi-4.3.0.tgz#b54ee074fb6fcbc00619559305c8f7e912b04741" + integrity sha512-SnZNcinB4RIcnEyZqFPdGPVgrg2AcnykiBy0sHVJQKHYeaLUvi3Exj+iaPpLnFVkDPZIV4U0yvgC9/R4uEAZ9g== jsesc@^2.5.1: version "2.5.2" @@ -4930,11 +4998,6 @@ node-emoji@^1.11.0: dependencies: lodash "^4.17.21" -node-fetch@2.6.1: - version "2.6.1" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.1.tgz#045bd323631f76ed2e2b55573394416b639a0052" - integrity sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw== - node-fetch@2.6.7: version "2.6.7" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.7.tgz#24de9fba827e3b4ae44dc8b20256a379160052ad" @@ -6275,7 +6338,7 @@ timsort@^0.3.0: resolved "https://registry.yarnpkg.com/timsort/-/timsort-0.3.0.tgz#405411a8e7e6339fe64db9a234de11dc31e02bd4" integrity sha1-QFQRqOfmM5/mTbmiNN4R3DHgK9Q= -tiny-invariant@^1.2.0, tiny-invariant@~1.2.0: +tiny-invariant@^1.1.0, tiny-invariant@^1.2.0, tiny-invariant@~1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/tiny-invariant/-/tiny-invariant-1.2.0.tgz#a1141f86b672a9148c72e978a19a73b9b94a15a9" integrity sha512-1Uhn/aqw5C6RI4KejVeTg6mIS7IqxnLJ8Mv2tV5rTc0qWobay7pDUz6Wi392Cnc8ak1H0F2cjoRzb2/AW4+Fvg== From 42c2f3a33b962276924b1e0a15489e8a85bffee0 Mon Sep 17 00:00:00 2001 From: Maximilian Schneider Date: Mon, 25 Apr 2022 12:36:42 -0400 Subject: [PATCH 11/27] Revert "Mango <> Notifi integration (#192)" This reverts commit 2f189fb3e3bdfd5fd5ef98c069d5993ecb973632. --- components/CreateAlertModal.tsx | 302 ++----------------------------- components/Modal.tsx | 5 - components/icons.tsx | 63 ------- package.json | 2 - public/locales/en/alerts.json | 6 +- public/locales/en/common.json | 2 - public/locales/es/alerts.json | 6 +- public/locales/es/common.json | 2 - public/locales/zh/alerts.json | 6 +- public/locales/zh/common.json | 2 - public/locales/zh_tw/alerts.json | 6 +- public/locales/zh_tw/common.json | 2 - stores/useMangoStore.tsx | 7 +- utils/index.ts | 1 - yarn.lock | 109 ++--------- 15 files changed, 47 insertions(+), 474 deletions(-) diff --git a/components/CreateAlertModal.tsx b/components/CreateAlertModal.tsx index 66f690e1..cab56e04 100644 --- a/components/CreateAlertModal.tsx +++ b/components/CreateAlertModal.tsx @@ -1,23 +1,14 @@ -import React, { FunctionComponent, useEffect, useMemo, useState } from 'react' +import React, { FunctionComponent, useEffect, useState } from 'react' import { PlusCircleIcon, TrashIcon } from '@heroicons/react/outline' -import { Source } from '@notifi-network/notifi-core' import Modal from './Modal' import Input, { Label } from './Input' import { ElementTitle } from './styles' -import useMangoStore, { AlertRequest, programId } from '../stores/useMangoStore' +import useMangoStore, { AlertRequest } from '../stores/useMangoStore' import Button, { LinkButton } from './Button' import { notify } from '../utils/notifications' import { useTranslation } from 'next-i18next' import ButtonGroup from './ButtonGroup' import InlineNotification from './InlineNotification' -import { NotifiIcon } from './icons' -import { - BlockchainEnvironment, - GqlError, - useNotifiClient, - isAlertObsolete, -} from '@notifi-network/notifi-react-hooks' -import { useWallet } from '@solana/wallet-adapter-react' interface CreateAlertModalProps { onClose: () => void @@ -25,8 +16,6 @@ interface CreateAlertModalProps { repayAmount?: string tokenSymbol?: string } -const nameForAlert = (health: number, email: string, phone: string, telegram: string): string => - `Alert for Email: ${email} Phone: ${phone} Telegram: ${telegram} When Health <= ${health}` const CreateAlertModal: FunctionComponent = ({ isOpen, @@ -40,172 +29,13 @@ const CreateAlertModal: FunctionComponent = ({ const loading = useMangoStore((s) => s.alerts.loading) const submitting = useMangoStore((s) => s.alerts.submitting) const error = useMangoStore((s) => s.alerts.error) - const cluster = useMangoStore((s) => s.connection.cluster) + const [email, setEmail] = useState('') const [invalidAmountMessage, setInvalidAmountMessage] = useState('') const [health, setHealth] = useState('') const [showCustomHealthForm, setShowCustomHealthForm] = useState(false) const [showAlertForm, setShowAlertForm] = useState(false) - // notifi error message - const [errorMessage, setErrorMessage] = useState('') const healthPresets = ['5', '10', '15', '25', '30'] - const ALERT_LIMIT = 5 - - let env = BlockchainEnvironment.MainNetBeta - switch (cluster) { - case 'mainnet': - break - case 'devnet': - env = BlockchainEnvironment.DevNet - break - } - const { publicKey, connected, signMessage } = useWallet() - const { data, fetchData, logIn, isAuthenticated, createAlert, deleteAlert } = - useNotifiClient({ - dappAddress: programId.toBase58(), - walletPublicKey: publicKey?.toString() ?? '', - env, - }) - const [email, setEmail] = useState('') - const [phone, setPhone] = useState('+') - const [telegramId, setTelegramId] = useState('') - - const handleError = (errors: { message: string }[]) => { - const err = errors.length > 0 ? errors[0] : null - if (err instanceof GqlError) { - setErrorMessage(`${err.message}: ${err.getErrorMessages().join(', ')}`) - } else { - setErrorMessage(err?.message ?? 'Unknown error') - } - } - - const getSourceToUse = (sources) => { - return sources?.find((it) => { - const filter = it.applicableFilters?.find((filter) => { - return filter.filterType === 'VALUE_THRESHOLD' - }) - return filter !== undefined - }) - } - - let { alerts, sources } = data || {} - let sourceToUse: Source | undefined = useMemo(() => { - return getSourceToUse(sources) - }, [sources]) - - const handlePhone = (e: React.ChangeEvent) => { - let val = e.target.value - if (val.length > 0) { - val = val.substring(1) - } - - const re = /^[0-9\b]+$/ - if (val === '' || (re.test(val) && val.length <= 15)) { - setPhone('+' + val) - } - } - - const handleTelegramId = (e: React.ChangeEvent) => { - setTelegramId(e.target.value) - } - - const createNotifiAlert = async function () { - // user is not authenticated - if (!isAuthenticated() && publicKey) { - try { - if (signMessage === undefined) { - throw new Error('signMessage is not defined') - } - await logIn({ signMessage }) - } catch (e) { - handleError([e]) - throw e - } - // refresh data after login - ({ alerts, sources } = await fetchData()) - sourceToUse = getSourceToUse(sources) - } - - if (connected && isAuthenticated()) { - if (!sourceToUse || !sourceToUse.id) return - const filter = sourceToUse?.applicableFilters.find( - (f) => f.filterType === 'VALUE_THRESHOLD' - ) - if (!filter || !filter.id) return - try { - const healthInt = parseInt(health, 10) - const res = await createAlert({ - filterId: filter.id, - sourceId: sourceToUse.id, - groupName: mangoAccount?.publicKey.toBase58(), - name: nameForAlert(healthInt, email, phone, telegramId), - emailAddress: email === '' ? null : email, - phoneNumber: phone.length < 12 || phone.length > 16 ? null : phone, - telegramId: telegramId === '' ? null: telegramId, - filterOptions: { - alertFrequency: 'SINGLE', - threshold: healthInt, - }, - }) - - if (telegramId) { - const telegramTarget = res.targetGroup?.telegramTargets.find( - telegramTarget => telegramTarget.telegramId === telegramId - ) - if (telegramTarget && !telegramTarget.isConfirmed && telegramTarget.confirmationUrl) { - window.open(telegramTarget.confirmationUrl, '_blank') - } - } - - // return notifiAlertId - return res.id - } catch (e) { - handleError([e]) - throw e - } - } - } - - const deleteNotifiAlert = async function (alert) { - // user is not authenticated - if (!isAuthenticated() && publicKey) { - try { - if (signMessage === undefined) { - throw new Error('signMessage is not defined') - } - await logIn({ signMessage }) - } catch (e) { - handleError([e]) - throw e - } - } - - if (connected && isAuthenticated()) { - try { - await deleteAlert({ alertId: alert.notifiAlertId }) - } catch (e) { - handleError([e]) - throw e - } - } - } - - // Clean up alerts that don't exist in DB - const consolidateNotifiAlerts = async function () { - const alertsToCleanUp = alerts?.filter((alert) => { - const isAlertExist = activeAlerts?.some( - (a) => a.notifiAlertId === alert.id - ) - return !isAlertExist - }) - - if (alertsToCleanUp === undefined) return - alertsToCleanUp.forEach((alert) => { - if (alert.id) { - deleteAlert({ alertId: alert.id }) - } - }) - } const validateEmailInput = (amount) => { if (Number(amount) <= 0) { @@ -221,10 +51,9 @@ const CreateAlertModal: FunctionComponent = ({ async function onCreateAlert() { if (!mangoGroup || !mangoAccount) return const parsedHealth = parseFloat(health) - - if (!email && !phone && !telegramId) { + if (!email) { notify({ - title: t('alerts:notifi-type-required'), + title: t('alerts:email-address-required'), type: 'error', }) return @@ -235,58 +64,19 @@ const CreateAlertModal: FunctionComponent = ({ }) return } - - let notifiAlertId - // send alert to Notifi - try { - notifiAlertId = await createNotifiAlert() - } catch (e) { - handleError([e]) - return + const body: AlertRequest = { + mangoGroupPk: mangoGroup.publicKey.toString(), + mangoAccountPk: mangoAccount.publicKey.toString(), + health: parsedHealth, + alertProvider: 'mail', + email, } - - if (notifiAlertId) { - const body: AlertRequest = { - mangoGroupPk: mangoGroup.publicKey.toString(), - mangoAccountPk: mangoAccount.publicKey.toString(), - health: parsedHealth, - alertProvider: 'notifi', - email, - notifiAlertId, - } - const success: any = await actions.createAlert(body) - if (success) { - setErrorMessage('') - setShowAlertForm(false) - } + const success: any = await actions.createAlert(body) + if (success) { + setShowAlertForm(false) } } - async function onDeleteAlert(alert) { - // delete alert from db - actions.deleteAlert(alert._id) - - // delete alert from Notifi - try { - await deleteNotifiAlert(alert) - } catch (e) { - handleError([e]) - } - } - - async function onNewAlert() { - if (connected && isAuthenticated()) { - try { - await consolidateNotifiAlerts() - } catch (e) { - handleError([e]) - throw e - } - } - - setShowAlertForm(true) - } - const handleCancelCreateAlert = () => { if (activeAlerts.length > 0) { setShowAlertForm(false) @@ -301,15 +91,6 @@ const CreateAlertModal: FunctionComponent = ({ } }, []) - // Delete notifi Alerts that have fired - useEffect(() => { - const firedAlert = alerts?.find(isAlertObsolete) - - if (firedAlert !== undefined && firedAlert.id !== null) { - deleteAlert({ alertId: firedAlert.id }) - } - }, [alerts, deleteAlert]) - return ( {!loading && !submitting ? ( @@ -324,8 +105,8 @@ const CreateAlertModal: FunctionComponent = ({
- {activeAlerts.length >= ALERT_LIMIT ? ( + {activeAlerts.length >= 3 ? (
{t('alerts:alerts-max')}
@@ -384,10 +160,6 @@ const CreateAlertModal: FunctionComponent = ({ value={email || ''} onChange={(e) => onChangeEmailInput(e.target.value)} /> - - - -
@@ -425,22 +197,7 @@ const CreateAlertModal: FunctionComponent = ({ )}
- {errorMessage.length > 0 ? ( -
- {errorMessage} -
- ) : ( - !isAuthenticated() && ( -
- {t('alerts:prompted-to-sign-transaction')} -
- ) - )} - = ({ @@ -488,25 +245,6 @@ const CreateAlertModal: FunctionComponent = ({
)} - -
-
- {t('alerts:powered-by')} - - - -
- -
-
) } diff --git a/components/Modal.tsx b/components/Modal.tsx index 13f1eca5..14ccee2f 100644 --- a/components/Modal.tsx +++ b/components/Modal.tsx @@ -70,11 +70,6 @@ const Header = ({ children }) => { return
{children}
} -const Footer = ({ children }) => { - return
{children}
-} - Modal.Header = Header -Modal.Footer = Footer export default Modal diff --git a/components/icons.tsx b/components/icons.tsx index 7ea5b1a7..b6495ace 100644 --- a/components/icons.tsx +++ b/components/icons.tsx @@ -891,66 +891,3 @@ export const AnchorIcon = ({ className }) => { ) } - -export const NotifiIcon = ({ className }) => { - return ( - - - - - - - - - - - - - - - - - ) -} diff --git a/package.json b/package.json index d2255138..3b104b1a 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,6 @@ "@headlessui/react": "^0.0.0-insiders.2dbc38c", "@heroicons/react": "^1.0.0", "@jup-ag/react-hook": "^1.0.0-beta.22", - "@notifi-network/notifi-react-hooks": "^0.12.1", "@project-serum/serum": "0.13.55", "@project-serum/sol-wallet-adapter": "0.2.0", "@sentry/react": "^6.19.2", @@ -65,7 +64,6 @@ }, "devDependencies": { "@next/bundle-analyzer": "^12.1.0", - "@notifi-network/notifi-core": "^0.8.0", "@svgr/webpack": "^6.1.2", "@testing-library/react": "^11.2.5", "@types/node": "^14.14.25", diff --git a/public/locales/en/alerts.json b/public/locales/en/alerts.json index c2d4645f..5d3fd3d6 100644 --- a/public/locales/en/alerts.json +++ b/public/locales/en/alerts.json @@ -6,10 +6,8 @@ "alerts-disclaimer": "Do not rely solely on alerts to protect your account. We can't guarantee they will be delivered.", "alerts-max": "You've reached the maximum number of active alerts.", "create-alert": "Create Alert", + "email-address-required": "An email address is required", "new-alert": "New Alert", "no-alerts": "No Active Alerts", - "no-alerts-desc": "Create an alert to be notified when your account health is low.", - "notifi-type-required": "An email address, a phone number or a telegram id is required", - "powered-by": "Powered by", - "prompted-to-sign-transaction": "When prompted, sign the transaction." + "no-alerts-desc": "Create an alert to be notified when your account health is low." } \ No newline at end of file diff --git a/public/locales/en/common.json b/public/locales/en/common.json index 424af0da..2825436c 100644 --- a/public/locales/en/common.json +++ b/public/locales/en/common.json @@ -298,7 +298,6 @@ "perp-positions-tip-title": "Perp Position Details", "perpetual-futures": "Perpetual Futures", "perps": "Perps", - "phone-number": "Phone Number", "pnl": "PnL", "pnl-error": "Error redeeming", "pnl-help": "Redeeming will update your USDC balance to reflect the redeemed PnL amount.", @@ -379,7 +378,6 @@ "taker": "Taker", "taker-fee": "Taker Fee", "target-period-length": "Target Period Length", - "telegram": "Telegram", "theme": "Theme", "themes-tip-desc": "Mango, Dark or Light (if you're that way inclined).", "themes-tip-title": "Color Themes", diff --git a/public/locales/es/alerts.json b/public/locales/es/alerts.json index 102c8706..78d970dd 100644 --- a/public/locales/es/alerts.json +++ b/public/locales/es/alerts.json @@ -6,10 +6,8 @@ "alerts-disclaimer": "Has alcanzado el número máximo de alertas activas.", "alerts-max": "You've reached the maximum number of active alerts.", "create-alert": "Crear alerta", + "email-address-required": "An email address is required", "new-alert": "Alerta nueva", "no-alerts": "No hay alertas activas", - "no-alerts-desc": "Cree una alerta para recibir una notificación cuando el estado de su cuenta sea bajo.", - "notifi-type-required": "Se requiere una dirección de correo electrónico, un número de teléfono o una identificación de Telegram", - "powered-by": "Desarrollada por", - "prompted-to-sign-transaction": "Cuando se le solicite, firme la transacción." + "no-alerts-desc": "Cree una alerta para recibir una notificación cuando el estado de su cuenta sea bajo." } \ No newline at end of file diff --git a/public/locales/es/common.json b/public/locales/es/common.json index 81704124..df7f9fdb 100644 --- a/public/locales/es/common.json +++ b/public/locales/es/common.json @@ -298,7 +298,6 @@ "perp-positions-tip-title": "Detalles de la posición de perp", "perpetual-futures": "Futuros perpetuos", "perps": "perpetuos", - "phone-number": "Número de teléfono", "pnl": "PnL", "pnl-error": "Solución de errores PNL", "pnl-help": "La liquidación actualizará su saldo en USDC para reflejar el monto de PnL pendiente.", @@ -379,7 +378,6 @@ "taker": "Receptor", "taker-fee": "Tarifa del receptor", "target-period-length": "Duración del período objetivo", - "telegram": "Telegram", "theme": "Theme", "themes-tip-desc": "Mango, Oscuro o Claro (si te gusta eso).", "themes-tip-title": "Temas de color", diff --git a/public/locales/zh/alerts.json b/public/locales/zh/alerts.json index 4f26af74..6b8560d2 100644 --- a/public/locales/zh/alerts.json +++ b/public/locales/zh/alerts.json @@ -6,10 +6,8 @@ "alerts-disclaimer": "请别全靠警报来保护资产。我们无法保证会准时发出。", "alerts-max": "您已达到警报数量最多限制", "create-alert": "创建警报", + "email-address-required": "您必须输入电子邮件地址", "new-alert": "创建警报", "no-alerts": "您没有活动警报", - "no-alerts-desc": "以创建警报而收到健康度通知。", - "notifi-type-required": "您必须输入电子邮件地址、电话号码或电报号", - "powered-by": "技术支持由", - "prompted-to-sign-transaction": "出現提示時,簽署交易。" + "no-alerts-desc": "以创建警报而收到健康度通知。" } \ No newline at end of file diff --git a/public/locales/zh/common.json b/public/locales/zh/common.json index 30a1678c..d898863d 100644 --- a/public/locales/zh/common.json +++ b/public/locales/zh/common.json @@ -298,7 +298,6 @@ "perp-positions-tip-title": "永续合约当前持仓细节", "perpetual-futures": "永续合约", "perps": "永续合约", - "phone-number": "电话号码", "pnl": "盈亏", "pnl-error": "结清盈亏出错了", "pnl-help": "结清会更新USDC余额来处理尚未结清的盈亏量。", @@ -379,7 +378,6 @@ "taker": "吃单者", "taker-fee": "吃单费率", "target-period-length": "目标期间长度", - "telegram": "电报", "theme": "模式", "themes-tip-desc": "Mango,黑暗或明亮(看您偏向)。", "themes-tip-title": "颜色模式", diff --git a/public/locales/zh_tw/alerts.json b/public/locales/zh_tw/alerts.json index b5638e37..981f8f51 100644 --- a/public/locales/zh_tw/alerts.json +++ b/public/locales/zh_tw/alerts.json @@ -6,10 +6,8 @@ "alerts-disclaimer": "請別全靠警報來保護資產。我們無法保證會準時發出。", "alerts-max": "您已達到警報數量最多限制", "create-alert": "創建警報", + "email-address-required": "您必須輸入電子郵件地址", "new-alert": "創建警報", "no-alerts": "您沒有活動警報", - "no-alerts-desc": "以創建警報而收到健康度通知。", - "notifi-type-required": "您必須輸入電子郵件地址、電話號碼或電報號", - "powered-by": "技術支持由", - "prompted-to-sign-transaction": "出現提示時,簽署交易。" + "no-alerts-desc": "以創建警報而收到健康度通知。" } \ No newline at end of file diff --git a/public/locales/zh_tw/common.json b/public/locales/zh_tw/common.json index b004a7d0..5440cc08 100644 --- a/public/locales/zh_tw/common.json +++ b/public/locales/zh_tw/common.json @@ -298,7 +298,6 @@ "perp-positions-tip-title": "永續合約當前持倉細節", "perpetual-futures": "永續合約", "perps": "永續合約", - "phone-number": "電話號碼", "pnl": "盈虧", "pnl-error": "實現盈虧出錯了", "pnl-help": "實現會更新USDC餘額來處理尚未實現的盈虧。", @@ -379,7 +378,6 @@ "taker": "吃單者", "taker-fee": "吃單費率", "target-period-length": "目標期間長度", - "telegram": "電報", "theme": "模式", "themes-tip-desc": "Mango,黑暗或明亮(看您偏向)。", "themes-tip-title": "顏色模式", diff --git a/stores/useMangoStore.tsx b/stores/useMangoStore.tsx index 2befdada..aa0a598b 100644 --- a/stores/useMangoStore.tsx +++ b/stores/useMangoStore.tsx @@ -112,22 +112,20 @@ export interface Orderbook { export interface Alert { acc: PublicKey - alertProvider: 'mail' | 'notifi' + alertProvider: 'mail' health: number _id: string open: boolean timestamp: number triggeredTimestamp: number | undefined - notifiAlertId: string | undefined } export interface AlertRequest { - alertProvider: 'mail' | 'notifi' + alertProvider: 'mail' health: number mangoGroupPk: string mangoAccountPk: string email: string | undefined - notifiAlertId: string | undefined } export type MangoStore = { @@ -837,7 +835,6 @@ const useMangoStore = create< health: req.health, open: true, timestamp: Date.now(), - notifiAlertId: req.notifiAlertId, } set((state) => { diff --git a/utils/index.ts b/utils/index.ts index e066a5d4..991e3c12 100644 --- a/utils/index.ts +++ b/utils/index.ts @@ -67,7 +67,6 @@ export function getTokenMultiplierFromDecimals(decimals: number): BN { } export function abbreviateAddress(address: PublicKey, size = 5) { - if (!address) return const base58 = address.toBase58() return base58.slice(0, size) + '…' + base58.slice(-size) } diff --git a/yarn.lock b/yarn.lock index 1d0c319a..2cce8450 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1394,35 +1394,6 @@ "@nodelib/fs.scandir" "2.1.5" fastq "^1.6.0" -"@notifi-network/notifi-axios-adapter@^0.12.1": - version "0.12.1" - resolved "https://registry.yarnpkg.com/@notifi-network/notifi-axios-adapter/-/notifi-axios-adapter-0.12.1.tgz#aae412465230b7a3d7e86c93a7d43210568282c6" - integrity sha512-vRVPN1uJHXNrxMzZ1F4OsmwbkytXy2kYBCnq+riRHKIgPykun51LGi5Y2ljW545j1YedtafY4vpPJNmMOhTuFw== - dependencies: - "@notifi-network/notifi-axios-utils" "^0.12.0" - -"@notifi-network/notifi-axios-utils@^0.12.0": - version "0.12.0" - resolved "https://registry.yarnpkg.com/@notifi-network/notifi-axios-utils/-/notifi-axios-utils-0.12.0.tgz#4eea3088cab39c9a2c1482e94c9d020296f42339" - integrity sha512-NVyS7x+z5wSLdNOSyxfB7XePZ1sSaSEKVPGEBnJuH5xpXkLBz1o+WlJTkA9/IcQFdSwLeLCdXGEb8jQPSjEWrA== - -"@notifi-network/notifi-core@^0.8.0": - version "0.8.0" - resolved "https://registry.yarnpkg.com/@notifi-network/notifi-core/-/notifi-core-0.8.0.tgz#e3a3eed8a6e2995d75a736239959bf42bbf32fe1" - integrity sha512-az+ux5QhvBS+AZnjb9+RBuzh0MWWOIUdmpVzOiNazBxX1O1XVnokfaCImeTpYpe7eEoAvwOLirTnFMsfvF0gdQ== - -"@notifi-network/notifi-react-hooks@^0.12.1": - version "0.12.1" - resolved "https://registry.yarnpkg.com/@notifi-network/notifi-react-hooks/-/notifi-react-hooks-0.12.1.tgz#e84dcb751a0f0bbd9ceb2e0378b46014a9570bc7" - integrity sha512-77bxZ/r19023x+yPjzW3LBMYxL4VyP7aR6owak51x76dEUqgi/oqzOh9+YSNXXeTvwr37jhtjYE+DHMVXD+y+g== - dependencies: - "@notifi-network/notifi-axios-adapter" "^0.12.1" - "@notifi-network/notifi-axios-utils" "^0.12.0" - axios "^0.26.0" - localforage "^1.10.0" - typedoc-plugin-missing-exports "^0.22.6" - typescript "^4.5.5" - "@orca-so/whirlpool-client-sdk@npm:@jup-ag/whirlpool-client-sdk@0.0.7": version "0.0.7" resolved "https://registry.yarnpkg.com/@jup-ag/whirlpool-client-sdk/-/whirlpool-client-sdk-0.0.7.tgz#dabb35e9cccc4069d17c3299f7c6ff8b7d0f4bfa" @@ -1571,7 +1542,18 @@ bn.js "^5.1.2" buffer-layout "^1.2.0" -"@project-serum/serum@^0.13.61", "@project-serum/serum@~0.13.64": +"@project-serum/serum@^0.13.61": + version "0.13.61" + resolved "https://registry.yarnpkg.com/@project-serum/serum/-/serum-0.13.61.tgz#1f0e6dfa7786a71e4317593911e9915d8b2a06e6" + integrity sha512-aebaRGQ0/K7a5kJ9UXO59BAQFJILVu5jbGobU8GD2CTSy6SPceprB6/pgZmZLQIabhXWUHaZRF/wXIClgWataA== + dependencies: + "@project-serum/anchor" "^0.11.1" + "@solana/spl-token" "^0.1.6" + "@solana/web3.js" "^1.21.0" + bn.js "^5.1.2" + buffer-layout "^1.2.0" + +"@project-serum/serum@~0.13.64": version "0.13.64" resolved "https://registry.yarnpkg.com/@project-serum/serum/-/serum-0.13.64.tgz#d5a9009ded8d2539ebfd12e1ff58b9028cfcdf45" integrity sha512-33d8K3qcbiFnL1Azv5k6IYMtJYjCqqmFkf95w5W8MPB0A+5zQfOwhEfXQuBw0ExZ8ft5s9Vy8sReLyx0SsINWA== @@ -2742,13 +2724,6 @@ axios@^0.25.0: dependencies: follow-redirects "^1.14.7" -axios@^0.26.0: - version "0.26.0" - resolved "https://registry.yarnpkg.com/axios/-/axios-0.26.0.tgz#9a318f1c69ec108f8cd5f3c3d390366635e13928" - integrity sha512-lKoGLMYtHvFrPVt3r+RBMp9nh34N0M8zEfCWqdWZx6phynIEhQqAdydpyBAAG211zlhX9Rgu08cOamy6XjE5Og== - dependencies: - follow-redirects "^1.14.8" - babel-plugin-dynamic-import-node@^2.3.3: version "2.3.3" resolved "https://registry.yarnpkg.com/babel-plugin-dynamic-import-node/-/babel-plugin-dynamic-import-node-2.3.3.tgz#84fda19c976ec5c6defef57f9427b3def66e17a3" @@ -3667,33 +3642,7 @@ error-ex@^1.3.1: dependencies: is-arrayish "^0.2.1" -es-abstract@^1.18.5: - version "1.19.2" - resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.19.2.tgz#8f7b696d8f15b167ae3640b4060670f3d054143f" - integrity sha512-gfSBJoZdlL2xRiOCy0g8gLMryhoe1TlimjzU99L/31Z8QEGIhVQI+EWwt5lT+AuU9SnorVupXFqqOGqGfsyO6w== - dependencies: - call-bind "^1.0.2" - es-to-primitive "^1.2.1" - function-bind "^1.1.1" - get-intrinsic "^1.1.1" - get-symbol-description "^1.0.0" - has "^1.0.3" - has-symbols "^1.0.3" - internal-slot "^1.0.3" - is-callable "^1.2.4" - is-negative-zero "^2.0.2" - is-regex "^1.1.4" - is-shared-array-buffer "^1.0.1" - is-string "^1.0.7" - is-weakref "^1.0.2" - object-inspect "^1.12.0" - object-keys "^1.1.1" - object.assign "^4.1.2" - string.prototype.trimend "^1.0.4" - string.prototype.trimstart "^1.0.4" - unbox-primitive "^1.0.1" - -es-abstract@^1.19.0, es-abstract@^1.19.1: +es-abstract@^1.18.5, es-abstract@^1.19.0, es-abstract@^1.19.1: version "1.19.1" resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.19.1.tgz#d4885796876916959de78edaa0df456627115ec3" integrity sha512-2vJ6tjA/UfqLm2MPs7jxVybLoB8i1t1Jd9R3kISld20sIxPcTbLuggQOUxeWeAvIUkduv/CfMjuh4WmiXr2v9w== @@ -4070,7 +4019,7 @@ flatted@^3.1.0: resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.5.tgz#76c8584f4fc843db64702a6bd04ab7a8bd666da3" integrity sha512-WIWGi2L3DyTUvUrwRKgGi9TwxQMUEqPOPQBVi71R96jZXJdFskXEmf54BoZaS1kknGODoIGASGEzBUYdyMCBJg== -follow-redirects@^1.14.0, follow-redirects@^1.14.7, follow-redirects@^1.14.8: +follow-redirects@^1.14.0, follow-redirects@^1.14.7: version "1.14.9" resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.14.9.tgz#dd4ea157de7bfaf9ea9b3fbd85aa16951f78d8d7" integrity sha512-MQDfihBQYMcyy5dhRDJUHcw7lb2Pv/TuE6xP1vyraLukNDHKbDxDNaOE3NbCAdKQApno+GPRyo1YAp89yCjK4w== @@ -4371,11 +4320,6 @@ ignore@^5.1.8, ignore@^5.2.0: resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.2.0.tgz#6d3bac8fa7fe0d45d9f9be7bac2fc279577e345a" integrity sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ== -immediate@~3.0.5: - version "3.0.6" - resolved "https://registry.yarnpkg.com/immediate/-/immediate-3.0.6.tgz#9db1dbd0faf8de6fbe0f5dd5e56bb606280de69b" - integrity sha1-nbHb0Pr43m++D13V5Wu2BigN5ps= - immer@^9.0.1: version "9.0.12" resolved "https://registry.yarnpkg.com/immer/-/immer-9.0.12.tgz#2d33ddf3ee1d247deab9d707ca472c8c942a0f20" @@ -4544,7 +4488,7 @@ is-nan@^1.2.1: call-bind "^1.0.0" define-properties "^1.1.3" -is-negative-zero@^2.0.1, is-negative-zero@^2.0.2: +is-negative-zero@^2.0.1: version "2.0.2" resolved "https://registry.yarnpkg.com/is-negative-zero/-/is-negative-zero-2.0.2.tgz#7bf6f03a28003b8b3965de3ac26f664d765f3150" integrity sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA== @@ -4604,7 +4548,7 @@ is-typed-array@^1.1.3, is-typed-array@^1.1.7: foreach "^2.0.5" has-tostringtag "^1.0.0" -is-weakref@^1.0.1, is-weakref@^1.0.2: +is-weakref@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/is-weakref/-/is-weakref-1.0.2.tgz#9529f383a9338205e89765e0392efc2f100f06f2" integrity sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ== @@ -4771,13 +4715,6 @@ levn@^0.4.1: prelude-ls "^1.2.1" type-check "~0.4.0" -lie@3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/lie/-/lie-3.1.1.tgz#9a436b2cc7746ca59de7a41fa469b3efb76bd87e" - integrity sha1-mkNrLMd0bKWd56QfpGmz77dr2H4= - dependencies: - immediate "~3.0.5" - lilconfig@2.0.4: version "2.0.4" resolved "https://registry.yarnpkg.com/lilconfig/-/lilconfig-2.0.4.tgz#f4507d043d7058b380b6a8f5cb7bcd4b34cee082" @@ -4832,13 +4769,6 @@ lodash-es@^4.17.21: resolved "https://registry.yarnpkg.com/lodash-es/-/lodash-es-4.17.21.tgz#43e626c46e6591b7750beb2b50117390c609e3ee" integrity sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw== -localforage@^1.10.0: - version "1.10.0" - resolved "https://registry.yarnpkg.com/localforage/-/localforage-1.10.0.tgz#5c465dc5f62b2807c3a84c0c6a1b1b3212781dd4" - integrity sha512-14/H1aX7hzBBmmh7sGPd+AOMkkIrHM3Z1PAyGgZigA1H1p5O5ANnMyWzvpAETtG68/dC4pC0ncy3+PPGzXZHPg== - dependencies: - lie "3.1.1" - lodash.debounce@^4.0.8: version "4.0.8" resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af" @@ -6569,12 +6499,7 @@ type-fest@^0.21.3: resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.21.3.tgz#d260a24b0198436e133fa26a524a6d65fa3b2e37" integrity sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w== -typedoc-plugin-missing-exports@^0.22.6: - version "0.22.6" - resolved "https://registry.yarnpkg.com/typedoc-plugin-missing-exports/-/typedoc-plugin-missing-exports-0.22.6.tgz#7467c60f1cd26507124103f0b9bca271d5aa8d71" - integrity sha512-1uguGQqa+c5f33nWS3v1mm0uAx4Ii1lw4Kx2zQksmYFKNEWTmrmMXbMNBoBg4wu0p4dFCNC7JIWPoRzpNS6pFA== - -typescript@^4.5.5, typescript@^4.6.3: +typescript@^4.6.3: version "4.6.3" resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.6.3.tgz#eefeafa6afdd31d725584c67a0eaba80f6fc6c6c" integrity sha512-yNIatDa5iaofVozS/uQJEl3JRWLKKGJKh6Yaiv0GLGSuhpFJe7P3SbHZ8/yjAHRQwKRoA6YZqlfjXWmVzoVSMw== From 6b6c183eda0257cab440e2e3d84c29fb55515fc1 Mon Sep 17 00:00:00 2001 From: tjs Date: Thu, 28 Apr 2022 12:38:03 -0400 Subject: [PATCH 12/27] fix remove from favorites --- components/TradeNavMenu.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/TradeNavMenu.tsx b/components/TradeNavMenu.tsx index 3197d314..38939152 100644 --- a/components/TradeNavMenu.tsx +++ b/components/TradeNavMenu.tsx @@ -56,7 +56,7 @@ const TradeNavMenu = () => { : activeMenuCategory === 'Spot' ? spotMarketsInfo : marketsInfo.filter((mkt) => favoriteMarkets.includes(mkt.name)), - [activeMenuCategory, marketsInfo] + [activeMenuCategory, marketsInfo, favoriteMarkets] ) const handleMenuCategoryChange = (categoryName) => { @@ -235,7 +235,7 @@ export const FavoriteMarketButton = ({ market }) => { } const removeFromFavorites = (mkt) => { - setFavoriteMarkets(favoriteMarkets.filter((m) => m.name !== mkt)) + setFavoriteMarkets(favoriteMarkets.filter((m) => m !== mkt)) } return favoriteMarkets.find((mkt) => mkt === market.name) ? ( From f4785f6d26d0a654f3bb4b005248548cda9bc7ae Mon Sep 17 00:00:00 2001 From: tjs Date: Fri, 29 Apr 2022 14:57:13 -0400 Subject: [PATCH 13/27] Fix swap input form for jup pkg v22 --- components/JupiterForm.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/JupiterForm.tsx b/components/JupiterForm.tsx index c2b1f590..0c87b9f8 100644 --- a/components/JupiterForm.tsx +++ b/components/JupiterForm.tsx @@ -552,7 +552,7 @@ const JupiterForm: FunctionComponent = () => { setFormValue((val) => ({ ...val, - amount: newValue, + amount: Number(newValue), })) }} /> From d4169c3c4fb86121d6b47ad93f7445bacd839e5e Mon Sep 17 00:00:00 2001 From: tjs Date: Sun, 1 May 2022 10:03:27 -0400 Subject: [PATCH 14/27] use latest mango client --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 1f0beadd..b135ace3 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "analyze": "ANALYZE=true yarn build" }, "dependencies": { - "@blockworks-foundation/mango-client": "^3.4.4", + "@blockworks-foundation/mango-client": "^3.4.5", "@headlessui/react": "^0.0.0-insiders.2dbc38c", "@heroicons/react": "^1.0.0", "@jup-ag/react-hook": "^1.0.0-beta.22", diff --git a/yarn.lock b/yarn.lock index 2dc3227f..5e32770e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1008,10 +1008,10 @@ "@babel/helper-validator-identifier" "^7.16.7" to-fast-properties "^2.0.0" -"@blockworks-foundation/mango-client@^3.4.4": - version "3.4.4" - resolved "https://registry.yarnpkg.com/@blockworks-foundation/mango-client/-/mango-client-3.4.4.tgz#5ccf688432c54c88b513499edde0dcb9af945a8f" - integrity sha512-r4qBcPbxgtfpTWO8Z/ChIY8bQKXXEG+4Bzce+IjHWN32g+UP0tVydMvfYi6WNN9JNrKccR58MujUWvEo7HyniQ== +"@blockworks-foundation/mango-client@^3.4.5": + version "3.4.5" + resolved "https://registry.yarnpkg.com/@blockworks-foundation/mango-client/-/mango-client-3.4.5.tgz#9ba8e8450e7a834c4067885eef2c21dc1a7d4fb7" + integrity sha512-RQ8WAcUMKtV72TGZ3qLFqcZW17WbDyDMcnCZrzSHp0rWpuThXcKb17/YBJY7TugVRvc6JnV1aJtlibI/oF15Gw== dependencies: "@project-serum/anchor" "^0.21.0" "@project-serum/serum" "0.13.55" From d6d48b54912d8e87569c8b1e6a69ec3826e230bc Mon Sep 17 00:00:00 2001 From: tjs Date: Sun, 1 May 2022 10:04:01 -0400 Subject: [PATCH 15/27] use long book delay to show orders while network clock is behind --- hooks/useHydrateStore.tsx | 4 +++- hooks/useOpenOrders.tsx | 16 ++++++++++++++-- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/hooks/useHydrateStore.tsx b/hooks/useHydrateStore.tsx index 4e0f63a9..7124a1d6 100644 --- a/hooks/useHydrateStore.tsx +++ b/hooks/useHydrateStore.tsx @@ -33,7 +33,9 @@ function decodeBookL2(market, accInfo: AccountInfo): number[][] { // @ts-ignore null, market, - BookSideLayout.decode(accInfo.data) + BookSideLayout.decode(accInfo.data), + undefined, + 100000 ) return book.getL2Ui(depth) } diff --git a/hooks/useOpenOrders.tsx b/hooks/useOpenOrders.tsx index bad5503c..3f0269ec 100644 --- a/hooks/useOpenOrders.tsx +++ b/hooks/useOpenOrders.tsx @@ -71,7 +71,13 @@ function parsePerpOpenOrders( const bidData = accountInfos[market.bids.toBase58()]?.data bidOrderBook = market && bidData - ? new BookSide(market.bids, market, BookSideLayout.decode(bidData)) + ? new BookSide( + market.bids, + market, + BookSideLayout.decode(bidData), + undefined, + 100000 + ) : [] } @@ -79,7 +85,13 @@ function parsePerpOpenOrders( const askData = accountInfos[market.asks.toBase58()]?.data askOrderBook = market && askData - ? new BookSide(market.asks, market, BookSideLayout.decode(askData)) + ? new BookSide( + market.asks, + market, + BookSideLayout.decode(askData), + undefined, + 100000 + ) : [] } From 4ae62b618fa8348540b6ccf84e415f3a1854a509 Mon Sep 17 00:00:00 2001 From: tjs Date: Sun, 1 May 2022 10:09:12 -0400 Subject: [PATCH 16/27] add maxbookdelay to see open orders while clock is behind --- hooks/useHydrateStore.tsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/hooks/useHydrateStore.tsx b/hooks/useHydrateStore.tsx index 7124a1d6..93640f9b 100644 --- a/hooks/useHydrateStore.tsx +++ b/hooks/useHydrateStore.tsx @@ -52,8 +52,14 @@ export function decodeBook( return SpotOrderBook.decode(market, accInfo.data) } else if (market instanceof PerpMarket) { // FIXME: Review the null being passed here - // @ts-ignore - return new BookSide(null, market, BookSideLayout.decode(accInfo.data)) + return new BookSide( + // @ts-ignore + null, + market, + BookSideLayout.decode(accInfo.data), + undefined, + 100000 + ) } } } From f4ea5181e5c5e7ca4e4c72977723e4308e410c23 Mon Sep 17 00:00:00 2001 From: tjs Date: Sun, 1 May 2022 12:59:19 -0400 Subject: [PATCH 17/27] walletreadystate is unreliable, always try to connect --- components/ConnectWalletButton.tsx | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/components/ConnectWalletButton.tsx b/components/ConnectWalletButton.tsx index 409a0e17..f464d5c4 100644 --- a/components/ConnectWalletButton.tsx +++ b/components/ConnectWalletButton.tsx @@ -26,19 +26,16 @@ export const handleWalletConnect = (wallet: Wallet) => { if (!wallet) { return } - if (wallet.readyState === WalletReadyState.NotDetected) { - window.open(wallet.adapter.url, '_blank') - } else { - wallet?.adapter?.connect().catch((e) => { - if (e.name.includes('WalletLoadError')) { - notify({ - title: `${wallet.adapter.name} Error`, - type: 'error', - description: `Please install ${wallet.adapter.name} and then reload this page.`, - }) - } - }) - } + + wallet?.adapter?.connect().catch((e) => { + if (e.name.includes('WalletLoadError')) { + notify({ + title: `${wallet.adapter.name} Error`, + type: 'error', + description: `Please install ${wallet.adapter.name} and then reload this page.`, + }) + } + }) } export const ConnectWalletButton: React.FC = () => { From ecb29bf1f5807294ef389facf19dd82d11b32c1e Mon Sep 17 00:00:00 2001 From: rjpeterson Date: Mon, 9 May 2022 21:04:00 -0700 Subject: [PATCH 18/27] fix chinese typo --- public/locales/zh/common.json | 2 +- public/locales/zh_tw/common.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/public/locales/zh/common.json b/public/locales/zh/common.json index 30a1678c..b70cfd4e 100644 --- a/public/locales/zh/common.json +++ b/public/locales/zh/common.json @@ -1,5 +1,5 @@ { - "about-to-withdraw": "您正在存款", + "about-to-withdraw": "您正在取款", "above": "高于", "accept": "接受", "accept-terms": "我明白并接受使用此平台的风险", diff --git a/public/locales/zh_tw/common.json b/public/locales/zh_tw/common.json index b004a7d0..323e79a0 100644 --- a/public/locales/zh_tw/common.json +++ b/public/locales/zh_tw/common.json @@ -1,5 +1,5 @@ { - "about-to-withdraw": "您正在存款", + "about-to-withdraw": "您正在取款", "above": "高於", "accept": "接受", "accept-terms": "我明白並接受使用此平台的風險", From 9bace7925d8d2c09ab0862ccbd96aa2c8648b515 Mon Sep 17 00:00:00 2001 From: rjpeterson Date: Mon, 9 May 2022 21:09:37 -0700 Subject: [PATCH 19/27] add names values to account graph buttongroup --- components/account_page/PerformanceChart.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/account_page/PerformanceChart.tsx b/components/account_page/PerformanceChart.tsx index 951cae73..433bb62e 100644 --- a/components/account_page/PerformanceChart.tsx +++ b/components/account_page/PerformanceChart.tsx @@ -247,7 +247,8 @@ const PerformanceChart = ({ activeValue={chartToShow} className="pb-2 pt-2 text-sm" onChange={(v) => setChartToShow(v)} - values={[t('value'), t('pnl')]} + values={['Value', 'PnL']} + names={[t('value'), t('pnl')]} />
From c52d7765934e1a318d4435ad9dd480d9c7b2fb10 Mon Sep 17 00:00:00 2001 From: rjpeterson Date: Tue, 10 May 2022 10:20:48 -0700 Subject: [PATCH 20/27] clarify "settle pnl" vs "redeem value" --- public/locales/zh/common.json | 4 ++-- public/locales/zh_tw/common.json | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/public/locales/zh/common.json b/public/locales/zh/common.json index b70cfd4e..ed63535f 100644 --- a/public/locales/zh/common.json +++ b/public/locales/zh/common.json @@ -324,7 +324,7 @@ "recent-trades": "最近成交", "redeem-all": "现实所有盈亏", "redeem-failure": "收获MNGO奖励出错了", - "redeem-pnl": "结清", + "redeem-pnl": "领取", "redeem-positive": "现实正数", "redeem-success": "已收获MNGO奖励了", "referrals": "推荐", @@ -435,7 +435,7 @@ "type": "类型", "unrealized-pnl": "未实现盈亏", "unsettled": "未结清", - "unsettled-balance": "未实现盈亏", + "unsettled-balance": "可领取价值", "unsettled-balances": "未结清余额", "unsettled-positions": "未结清持仓", "update-filters": "更新过滤", diff --git a/public/locales/zh_tw/common.json b/public/locales/zh_tw/common.json index 323e79a0..060d46ca 100644 --- a/public/locales/zh_tw/common.json +++ b/public/locales/zh_tw/common.json @@ -324,7 +324,7 @@ "recent-trades": "最近成交", "redeem-all": "現實所有盈虧", "redeem-failure": "收穫MNGO獎勵出錯了", - "redeem-pnl": "實現盈虧", + "redeem-pnl": "領取", "redeem-positive": "現實正數", "redeem-success": "已收穫MNGO獎勵了", "referrals": "推薦", @@ -435,7 +435,7 @@ "type": "類型", "unrealized-pnl": "未實現盈虧", "unsettled": "未結清", - "unsettled-balance": "未實現盈虧", + "unsettled-balance": "可領取價值", "unsettled-balances": "未結清餘額", "unsettled-positions": "未結清持倉", "update-filters": "更新過濾", From 11aaf85d3d723e7a89789fb8296b968ce784d109 Mon Sep 17 00:00:00 2001 From: tjs Date: Wed, 11 May 2022 11:29:09 -0400 Subject: [PATCH 21/27] raise tps threshold for warning --- components/GlobalNotification.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/GlobalNotification.tsx b/components/GlobalNotification.tsx index 427e602a..69769a59 100644 --- a/components/GlobalNotification.tsx +++ b/components/GlobalNotification.tsx @@ -16,7 +16,7 @@ const getRecentPerformance = async (setShow, setTps) => { const totalTransactions = sumBy(response, 'numTransactions') const tps = totalTransactions / totalSecs - if (tps < 1500) { + if (tps < 1800) { setShow(true) setTps(tps) } else { From 2b798ac216ff7bb0da64e7c7de88a2ea83cc74e1 Mon Sep 17 00:00:00 2001 From: Riordan Panayides Date: Thu, 12 May 2022 13:37:47 +0100 Subject: [PATCH 22/27] Make luna reduce only --- components/trade_form/AdvancedTradeForm.tsx | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/components/trade_form/AdvancedTradeForm.tsx b/components/trade_form/AdvancedTradeForm.tsx index 55f17a59..3dbe7c5b 100644 --- a/components/trade_form/AdvancedTradeForm.tsx +++ b/components/trade_form/AdvancedTradeForm.tsx @@ -118,6 +118,7 @@ export default function AdvancedTradeForm({ const [postOnlySlide, setPostOnlySlide] = useState(false) const [postOnly, setPostOnly] = useState(false) const [ioc, setIoc] = useState(false) + const [isLuna, setIsLuna] = useState(false) const orderBookRef = useRef(useMangoStore.getState().selectedMarket.orderBook) const orderbook = orderBookRef.current @@ -223,6 +224,11 @@ export default function AdvancedTradeForm({ : availableBalance } + if (marketConfig.baseSymbol == 'LUNA') { + setIsLuna(true) + setReduceOnly(true) + } + const { max: maxQuote, deposits, @@ -781,6 +787,16 @@ export default function AdvancedTradeForm({ {initLeverage}x + { isLuna ? ( + LUNA is currently in reduce only mode. No new positions may be entered. +
+ } + > + + ) : null } + {insufficientSol ? (
@@ -963,7 +979,7 @@ export default function AdvancedTradeForm({ auto updating the reduceOnly state when doing a market order: && showReduceOnly(perpAccount?.basePosition.toNumber()) */} - {marketConfig.kind === 'perp' ? ( + {marketConfig.kind === 'perp' || isLuna ? (
reduceOnChange(e.target.checked)} - disabled={isTriggerOrder} + disabled={isTriggerOrder || isLuna} > Reduce Only From 9a83a22239465ddc9ae90fd52c8121fce83665a7 Mon Sep 17 00:00:00 2001 From: tjs Date: Thu, 12 May 2022 10:31:50 -0400 Subject: [PATCH 23/27] Disable luna borrow on withdraw --- components/WithdrawModal.tsx | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/components/WithdrawModal.tsx b/components/WithdrawModal.tsx index 709af24e..2d4b184d 100644 --- a/components/WithdrawModal.tsx +++ b/components/WithdrawModal.tsx @@ -93,6 +93,9 @@ const WithdrawModal: FunctionComponent = ({ .add(maxWithoutBorrows) .mul(I80F48.fromString('0.995')) // handle rounding errors when borrowing + if (withdrawTokenSymbol == 'LUNA') { + setIncludeBorrow(false) + } // get max withdraw amount let maxWithdraw = maxWithoutBorrows if (includeBorrow) { @@ -356,7 +359,7 @@ const WithdrawModal: FunctionComponent = ({ ))} -
+ { withdrawTokenSymbol != 'LUNA' ? (
{t('borrow-funds')} @@ -370,14 +373,14 @@ const WithdrawModal: FunctionComponent = ({ className="ml-auto" onChange={(checked) => handleIncludeBorrowSwitch(checked)} /> -
+
) : null }
setInputAmount(maxAmount.toString())} > - {includeBorrow ? t('max-with-borrow') : t('max')} + {includeBorrow && withdrawTokenSymbol != 'LUNA' ? t('max-with-borrow') : t('max')}
@@ -417,9 +420,7 @@ const WithdrawModal: FunctionComponent = ({
- } - > - - ) : null } - + {isLuna ? ( + + LUNA is currently in reduce only mode. No new positions may be + entered. +
+ } + > + + + ) : null} {insufficientSol ? (
From 19482d38e18191c66f9a2048d19be6d3fb1f65c3 Mon Sep 17 00:00:00 2001 From: tjs Date: Fri, 13 May 2022 16:48:22 -0400 Subject: [PATCH 25/27] Add exodus wallet support --- package.json | 2 +- pages/_app.tsx | 4 +++- yarn.lock | 26 +++++++++++++++++--------- 3 files changed, 21 insertions(+), 11 deletions(-) diff --git a/package.json b/package.json index d2255138..28409bc4 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ "@solana/wallet-adapter-base": "^0.9.5", "@solana/wallet-adapter-huobi": "^0.1.0", "@solana/wallet-adapter-react": "^0.15.4", - "@solana/wallet-adapter-wallets": "^0.16.0", + "@solana/wallet-adapter-wallets": "^0.16.1", "@solana/web3.js": "^1.36.0", "@solflare-wallet/pfp": "^0.0.6", "@tippyjs/react": "^4.2.5", diff --git a/pages/_app.tsx b/pages/_app.tsx index 60ae1f3b..9cec646d 100644 --- a/pages/_app.tsx +++ b/pages/_app.tsx @@ -32,6 +32,7 @@ import { BrowserTracing } from '@sentry/tracing' import { WalletProvider, WalletListener } from 'components/WalletAdapter' import { + ExodusWalletAdapter, PhantomWalletAdapter, SolflareWalletAdapter, SolletWalletAdapter, @@ -142,11 +143,12 @@ function App({ Component, pageProps }) { () => [ new PhantomWalletAdapter(), new SolflareWalletAdapter(), + new ExodusWalletAdapter(), new SolletWalletAdapter(), + new GlowWalletAdapter(), new SlopeWalletAdapter(), new BitpieWalletAdapter(), new HuobiWalletAdapter(), - new GlowWalletAdapter(), ], [] ) diff --git a/yarn.lock b/yarn.lock index 1d0c319a..5ecfba97 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1795,6 +1795,13 @@ "@solana/wallet-adapter-base" "^0.9.3" "@solana/web3.js" "^1.20.0" +"@solana/wallet-adapter-exodus@^0.1.0": + version "0.1.0" + resolved "https://registry.yarnpkg.com/@solana/wallet-adapter-exodus/-/wallet-adapter-exodus-0.1.0.tgz#8d1d375fa2f3e43499ab0d763d4e04298ede3d57" + integrity sha512-dfkiIDiPwPD+ueU3DXJOn2TY+s0/1IKUA6/8Vi2HvRaCeZ75Ol8YE8CG2tHe49Hiz6iy+Fd+Nl9voEhQeYML1g== + dependencies: + "@solana/wallet-adapter-base" "^0.9.4" + "@solana/wallet-adapter-glow@^0.1.0": version "0.1.1" resolved "https://registry.yarnpkg.com/@solana/wallet-adapter-glow/-/wallet-adapter-glow-0.1.1.tgz#4db395b2ccf73eb2d6c1d9362e26cbfd260fc19f" @@ -1909,10 +1916,10 @@ process "^0.11.10" stream-browserify "^3.0.0" -"@solana/wallet-adapter-wallets@^0.16.0": - version "0.16.0" - resolved "https://registry.yarnpkg.com/@solana/wallet-adapter-wallets/-/wallet-adapter-wallets-0.16.0.tgz#0a30eaac10b04ac3e8aa7f3e001d7fd69f92c22a" - integrity sha512-blg/0eGDvQlvPkfaLD24vgB3+RxbksjLoKPRVF/4/Dj+XTc0Yx8PxXUDwCQSC5Xic51Q7ZfLhMxj8caXN+RM/Q== +"@solana/wallet-adapter-wallets@^0.16.1": + version "0.16.1" + resolved "https://registry.yarnpkg.com/@solana/wallet-adapter-wallets/-/wallet-adapter-wallets-0.16.1.tgz#cf151debda130044a0a72c3c50e8632764d797ff" + integrity sha512-ztrR9ieXpMVKx95JrH4MOtvhz048UmbiVJvEM97MhdKL6zpP09DNeqAQ9uuGjvjKy1WVJQ8r5+TK7+lLCgMimw== dependencies: "@solana/wallet-adapter-base" "^0.9.4" "@solana/wallet-adapter-bitkeep" "^0.3.2" @@ -1921,6 +1928,7 @@ "@solana/wallet-adapter-clover" "^0.4.2" "@solana/wallet-adapter-coin98" "^0.5.2" "@solana/wallet-adapter-coinhub" "^0.3.2" + "@solana/wallet-adapter-exodus" "^0.1.0" "@solana/wallet-adapter-glow" "^0.1.0" "@solana/wallet-adapter-huobi" "^0.1.0" "@solana/wallet-adapter-ledger" "^0.9.8" @@ -4827,11 +4835,6 @@ listr2@^4.0.1: through "^2.3.8" wrap-ansi "^7.0.0" -lodash-es@^4.17.21: - version "4.17.21" - resolved "https://registry.yarnpkg.com/lodash-es/-/lodash-es-4.17.21.tgz#43e626c46e6591b7750beb2b50117390c609e3ee" - integrity sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw== - localforage@^1.10.0: version "1.10.0" resolved "https://registry.yarnpkg.com/localforage/-/localforage-1.10.0.tgz#5c465dc5f62b2807c3a84c0c6a1b1b3212781dd4" @@ -4839,6 +4842,11 @@ localforage@^1.10.0: dependencies: lie "3.1.1" +lodash-es@^4.17.21: + version "4.17.21" + resolved "https://registry.yarnpkg.com/lodash-es/-/lodash-es-4.17.21.tgz#43e626c46e6591b7750beb2b50117390c609e3ee" + integrity sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw== + lodash.debounce@^4.0.8: version "4.0.8" resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af" From a6082b92a03b6acdee1d0bf2145e8ce3b005d69e Mon Sep 17 00:00:00 2001 From: saml33 <30796577+saml33@users.noreply.github.com> Date: Fri, 15 Apr 2022 22:07:38 +1000 Subject: [PATCH 26/27] Revert "add tradingview chart attribution link (#257)" This reverts commit be0995af25bb66e7354783abc223819bb16d6d83. --- components/TradingView/index.tsx | 22 ++-------------------- styles/index.css | 2 +- 2 files changed, 3 insertions(+), 21 deletions(-) diff --git a/components/TradingView/index.tsx b/components/TradingView/index.tsx index 2d132c2e..3082cb82 100755 --- a/components/TradingView/index.tsx +++ b/components/TradingView/index.tsx @@ -1,4 +1,4 @@ -import { useEffect, useMemo, useRef, useState } from 'react' +import { useEffect, useRef, useState } from 'react' import { useTheme } from 'next-themes' import { widget, @@ -623,25 +623,7 @@ const TVChartContainer = () => { } }, [chartReady, openOrders, showOrderLines]) - const attributionUrl = useMemo( - () => - `https://tradingview.com/symbols/${defaultProps.symbol?.slice(0, -5)}USD`, - [defaultProps] - ) - - return ( - <> -
- - Chart by TradingView - - - ) + return
} export default TVChartContainer diff --git a/styles/index.css b/styles/index.css index 9b5151fb..55520b01 100644 --- a/styles/index.css +++ b/styles/index.css @@ -135,7 +135,7 @@ button.transition-none { } .tradingview-chart { - height: calc(100% - 24px); + display: contents; } /* Grid */ From ea8fbe450137f358d07812f836210eae5b0bcaa7 Mon Sep 17 00:00:00 2001 From: tjs Date: Sun, 15 May 2022 16:53:13 -0400 Subject: [PATCH 27/27] fix share modal calculation for shorts --- components/ShareModal.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/ShareModal.tsx b/components/ShareModal.tsx index fa37890b..20455295 100644 --- a/components/ShareModal.tsx +++ b/components/ShareModal.tsx @@ -36,7 +36,7 @@ const calculatePositionPercentage = (position, maxLeverage) => { return returnsPercentage * maxLeverage } else { const returnsPercentage = - (position.avgEntryPrice / position.indexPrice - 1) * 100 + (position.indexPrice / position.avgEntryPrice - 1) * -100 return returnsPercentage * maxLeverage } }