Skip to content

Commit

Permalink
Display global quote balance on debug ui (#251)
Browse files Browse the repository at this point in the history
* Display global quote balance on ui

* fmt
  • Loading branch information
brittcyr authored Nov 4, 2024
1 parent 10954d4 commit 1ca9a48
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions debug-ui/app/components/MyStatus.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ const MyStatus = ({
const [quoteMint, setQuoteMint] = useState<string>('');
const [baseExchangeBalance, setBaseExchangeBalance] = useState<number>(0);
const [quoteExchangeBalance, setQuoteExchangeBalance] = useState<number>(0);
const [quoteGlobalBalance, setQuoteGlobalBalance] = useState<number>(0);
const [myBids, setMyBids] = useState<RestingOrder[]>([]);
const [myAsks, setMyAsks] = useState<RestingOrder[]>([]);
const [myWrapperOpenOrders, setMyWrapperOpenOrders] = useState<
Expand Down Expand Up @@ -277,6 +278,11 @@ const MyStatus = ({
setQuoteExchangeBalance(
market.getWithdrawableBalanceTokens(signerPub, false),
);
if (mClient.quoteGlobal) {
setQuoteGlobalBalance(
await mClient.quoteGlobal.getGlobalBalanceTokens(conn, signerPub),
);
}
};

updateState().catch((e) => {
Expand Down Expand Up @@ -315,6 +321,9 @@ const MyStatus = ({
<ul>
<li>Base: {baseExchangeBalance}</li>
<li>Quote: {quoteExchangeBalance}</li>
{quoteGlobalBalance != 0 && (
<li>Global Quote: {quoteGlobalBalance}</li>
)}
</ul>
</pre>

Expand Down

0 comments on commit 1ca9a48

Please sign in to comment.