Asset for APT accounts being Populated as `undefined` instead of `APT`
thekeviv opened this issue · 4 comments
thekeviv commented
When depositing funds into an APT account, after looking at the asset field corresponding to the margin account, it shows up as undefined
and not APT
. Is this a bug or is this expected? If not a bug, can you explain the significance of undefined please.
filipzeta commented
Which SDK version are you using?
thekeviv commented
I'm using 0.23.0
filipzeta commented
I'm unable to reproduce this, can you paste your code here? And margin account pubkey if possible
My code:
let accs = await Exchange.program.account.marginAccount.all();
for (var acc of accs) {
let accDecoded = acc.account as unknown as programTypes.MarginAccount;
console.log(accDecoded.asset, assets.fromProgramAsset(accDecoded.asset));
}
shows me { apt: {} } APT
for some margin accounts and no undefined
s. I'm also on SDK 0.23.0.
thekeviv commented
Thank you! My SDK was up to date and it was the IDL which wasn't. Updating to the newest IDL from your repo fixed the issue. Thank you for all your help:pray: