diff --git a/components/account/AccountOrders.tsx b/components/account/AccountOrders.tsx index 4516b0ef..1ffbf41b 100644 --- a/components/account/AccountOrders.tsx +++ b/components/account/AccountOrders.tsx @@ -12,7 +12,7 @@ const AccountOrders = () => { const tabsWithCount: [string, number][] = useMemo(() => { const stopOrdersCount = - mangoAccount?.tokenConditionalSwaps.filter((tcs) => tcs.hasData) + mangoAccount?.tokenConditionalSwaps.filter((tcs) => tcs.isConfigured) ?.length || 0 const tabs: [string, number][] = [ ['trade:limit', Object.values(openOrders).flat().length], diff --git a/components/account/AccountTabs.tsx b/components/account/AccountTabs.tsx index f32d7ee2..9c25bb62 100644 --- a/components/account/AccountTabs.tsx +++ b/components/account/AccountTabs.tsx @@ -29,7 +29,7 @@ const AccountTabs = () => { unsettledPerpPositions?.length const stopOrdersCount = - mangoAccount?.tokenConditionalSwaps.filter((tcs) => tcs.hasData) + mangoAccount?.tokenConditionalSwaps.filter((tcs) => tcs.isConfigured) ?.length || 0 const tabs: [string, number][] = [ diff --git a/components/swap/SwapInfoTabs.tsx b/components/swap/SwapInfoTabs.tsx index 67a283f2..074766ee 100644 --- a/components/swap/SwapInfoTabs.tsx +++ b/components/swap/SwapInfoTabs.tsx @@ -20,7 +20,7 @@ const SwapInfoTabs = () => { ['swap:swap-history', 0], ] const stopOrdersCount = - mangoAccount?.tokenConditionalSwaps.filter((tcs) => tcs.hasData) + mangoAccount?.tokenConditionalSwaps.filter((tcs) => tcs.isConfigured) ?.length || 0 tabs.splice(1, 0, ['trade:trigger-orders', stopOrdersCount]) return tabs diff --git a/components/swap/SwapTriggerOrders.tsx b/components/swap/SwapTriggerOrders.tsx index da959bd1..4af79164 100644 --- a/components/swap/SwapTriggerOrders.tsx +++ b/components/swap/SwapTriggerOrders.tsx @@ -136,7 +136,7 @@ const SwapOrders = () => { const orders = useMemo(() => { if (!mangoAccount) return [] - return mangoAccount.tokenConditionalSwaps.filter((tcs) => tcs.hasData) + return mangoAccount.tokenConditionalSwaps.filter((tcs) => tcs.isConfigured) }, [mangoAccount]) const formattedTableData = useCallback(() => { diff --git a/components/trade/TradeInfoTabs.tsx b/components/trade/TradeInfoTabs.tsx index a984d79e..900148c9 100644 --- a/components/trade/TradeInfoTabs.tsx +++ b/components/trade/TradeInfoTabs.tsx @@ -36,7 +36,7 @@ const TradeInfoTabs = () => { unsettledPerpPositions?.length const stopOrdersCount = - mangoAccount?.tokenConditionalSwaps.filter((tcs) => tcs.hasData) + mangoAccount?.tokenConditionalSwaps.filter((tcs) => tcs.isConfigured) ?.length || 0 return [ diff --git a/components/trade/TradingViewChart.tsx b/components/trade/TradingViewChart.tsx index 07caffa5..9becb66c 100644 --- a/components/trade/TradingViewChart.tsx +++ b/components/trade/TradingViewChart.tsx @@ -80,7 +80,7 @@ const getTriggerOrders = () => { const mangoAccount = mangoStore.getState().mangoAccount.current if (!mangoAccount) return [] const triggerOrders = mangoAccount.tokenConditionalSwaps.filter( - (tcs) => tcs.hasData, + (tcs) => tcs.isConfigured, ) return triggerOrders } @@ -821,7 +821,7 @@ const TradingViewChart = () => { const openOrders = account.openOrders const triggerOrders = account.current?.tokenConditionalSwaps.filter( - (tcs) => tcs.hasData, + (tcs) => tcs.isConfigured, ) || [] const orderLines = mangoStore.getState().tradingView.orderLines tvWidgetRef.current?.onChartReady(() => { diff --git a/hooks/useMangoAccountAccounts.ts b/hooks/useMangoAccountAccounts.ts index 8e1c44f7..28fdec27 100644 --- a/hooks/useMangoAccountAccounts.ts +++ b/hooks/useMangoAccountAccounts.ts @@ -73,7 +73,7 @@ export default function useMangoAccountAccounts() { const usedPerpOo: PerpOo[] = perpOpenOrders.filter( (p) => p.orderMarket !== 65535, ) - const usedTcs = tokenConditionalSwaps.filter((tcs) => tcs.hasData) + const usedTcs = tokenConditionalSwaps.filter((tcs) => tcs.isConfigured) const emptyPerps = usedPerps.filter( (p) => diff --git a/package.json b/package.json index 68b48722..7bdab308 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ "dependencies": { "@blockworks-foundation/mango-feeds": "0.1.7", "@blockworks-foundation/mango-mints-redemption": "^0.0.10", - "@blockworks-foundation/mango-v4": "0.20.4", + "@blockworks-foundation/mango-v4": "0.20.6", "@blockworks-foundation/mango-v4-settings": "0.2.18", "@blockworks-foundation/mangolana": "0.0.1-beta.15", "@headlessui/react": "1.6.6", diff --git a/yarn.lock b/yarn.lock index 9a533037..d143b943 100644 --- a/yarn.lock +++ b/yarn.lock @@ -17,7 +17,7 @@ resolved "https://registry.yarnpkg.com/@apocentre/alias-sampling/-/alias-sampling-0.5.3.tgz#897ff181b48ad7b2bcb4ecf29400214888244f08" integrity sha512-7UDWIIF9hIeJqfKXkNIzkVandlwLf1FWTSdrb9iXvOP8oF544JRXQjCbiTmCv2c9n44n/FIWtehhBfNuAx2CZA== -"@babel/runtime@^7.1.2", "@babel/runtime@^7.10.5", "@babel/runtime@^7.17.2", "@babel/runtime@^7.20.13", "@babel/runtime@^7.20.7", "@babel/runtime@^7.21.0", "@babel/runtime@^7.22.5", "@babel/runtime@^7.22.6", "@babel/runtime@^7.23.2": +"@babel/runtime@^7.1.2", "@babel/runtime@^7.10.5", "@babel/runtime@^7.17.2", "@babel/runtime@^7.20.13", "@babel/runtime@^7.20.7", "@babel/runtime@^7.21.0", "@babel/runtime@^7.22.5", "@babel/runtime@^7.23.2": version "7.23.4" resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.23.4.tgz#36fa1d2b36db873d25ec631dcc4923fdc1cf2e2e" integrity sha512-2Yv65nlWnWlSpe3fXEyX5i7fx5kIKo4Qbcj+hMO0odwaneFjfXw5fdum+4yL20O0QiaHpia0cYQ9xpNMqrBwHg== @@ -50,10 +50,10 @@ bn.js "^5.2.1" eslint-config-prettier "^9.0.0" -"@blockworks-foundation/mango-v4@0.20.4": - version "0.20.4" - resolved "https://registry.yarnpkg.com/@blockworks-foundation/mango-v4/-/mango-v4-0.20.4.tgz#0123fa4fede9b4e47917ebade99c8918971aaddd" - integrity sha512-Dcea6cyLMGCEcw3oNMyvK9DbFqZVqlD6bjvs0UnO++zVzFrbK5KcyGDQoZPKF4JnfBEO1J7P++zJLmBAammFOQ== +"@blockworks-foundation/mango-v4@0.20.6": + version "0.20.6" + resolved "https://registry.yarnpkg.com/@blockworks-foundation/mango-v4/-/mango-v4-0.20.6.tgz#c94e1c38ef9fde4a0e87aa139f3e942ddfcb7403" + integrity sha512-SlikGVoFXEnFNsbUKaZvrgpmfDSQ4A29rRhPdiPiU3XuS0gEMEvMCl8lr0C9euByhGfIzCv7CK0pdknP3Il8sw== dependencies: "@blockworks-foundation/mango-v4-settings" "^0.2.16" "@coral-xyz/anchor" "^0.28.1-beta.2" @@ -1041,7 +1041,7 @@ dependencies: "@noble/hashes" "1.3.1" -"@noble/curves@^1.0.0", "@noble/curves@^1.1.0", "@noble/curves@^1.2.0": +"@noble/curves@^1.1.0", "@noble/curves@^1.2.0": version "1.2.0" resolved "https://registry.yarnpkg.com/@noble/curves/-/curves-1.2.0.tgz#92d7e12e4e49b23105a2555c6984d41733d65c35" integrity sha512-oYclrNgRaM9SsBUBVbb8M6DTV7ZHRTKugureoYEncY5c65HOmRzvSiTE3y5CYaPYJA/GVkrhXEoF0M3Ya9PMnw==