diff --git a/ts/client/src/client.ts b/ts/client/src/client.ts index c81847637..93ecdf557 100644 --- a/ts/client/src/client.ts +++ b/ts/client/src/client.ts @@ -602,10 +602,14 @@ export class MangoClient { ); } - public async getMangoAccount(mangoAccount: MangoAccount) { + public async getMangoAccount(mangoAccount: MangoAccount | PublicKey) { + const mangoAccountPk = + mangoAccount instanceof MangoAccount + ? mangoAccount.publicKey + : mangoAccount; return MangoAccount.from( - mangoAccount.publicKey, - await this.program.account.mangoAccount.fetch(mangoAccount.publicKey), + mangoAccountPk, + await this.program.account.mangoAccount.fetch(mangoAccountPk), ); }