load delegate accounts

This commit is contained in:
tjs 2023-03-04 12:06:27 -05:00
parent e6fb6da6b0
commit dcace3ee92
1 changed files with 5 additions and 4 deletions

View File

@ -601,10 +601,11 @@ const mangoStore = create<MangoStore>()(
if (!group) throw new Error('Group not loaded')
if (!client) throw new Error('Client not loaded')
const mangoAccounts = await client.getMangoAccountsForOwner(
group,
ownerPk
)
const [ownerMangoAccounts, delegateAccounts] = await Promise.all([
client.getMangoAccountsForOwner(group, ownerPk),
client.getMangoAccountsForDelegate(group, ownerPk),
])
const mangoAccounts = [...ownerMangoAccounts, ...delegateAccounts]
const selectedAccountIsNotInAccountsList = mangoAccounts.find(
(x) =>
x.publicKey.toBase58() ===