From 1ca9a48a5b9b28d5dc498030ae81782c995c8d40 Mon Sep 17 00:00:00 2001 From: Britt Cyr Date: Mon, 4 Nov 2024 12:14:30 -0500 Subject: [PATCH] Display global quote balance on debug ui (#251) * Display global quote balance on ui * fmt --- debug-ui/app/components/MyStatus.tsx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/debug-ui/app/components/MyStatus.tsx b/debug-ui/app/components/MyStatus.tsx index a49a624af..dd87d40c8 100644 --- a/debug-ui/app/components/MyStatus.tsx +++ b/debug-ui/app/components/MyStatus.tsx @@ -44,6 +44,7 @@ const MyStatus = ({ const [quoteMint, setQuoteMint] = useState(''); const [baseExchangeBalance, setBaseExchangeBalance] = useState(0); const [quoteExchangeBalance, setQuoteExchangeBalance] = useState(0); + const [quoteGlobalBalance, setQuoteGlobalBalance] = useState(0); const [myBids, setMyBids] = useState([]); const [myAsks, setMyAsks] = useState([]); const [myWrapperOpenOrders, setMyWrapperOpenOrders] = useState< @@ -277,6 +278,11 @@ const MyStatus = ({ setQuoteExchangeBalance( market.getWithdrawableBalanceTokens(signerPub, false), ); + if (mClient.quoteGlobal) { + setQuoteGlobalBalance( + await mClient.quoteGlobal.getGlobalBalanceTokens(conn, signerPub), + ); + } }; updateState().catch((e) => { @@ -315,6 +321,9 @@ const MyStatus = ({
  • Base: {baseExchangeBalance}
  • Quote: {quoteExchangeBalance}
  • + {quoteGlobalBalance != 0 && ( +
  • Global Quote: {quoteGlobalBalance}
  • + )}