optional args should be sent as null

Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
This commit is contained in:
microwavedcola1 2022-08-08 21:04:19 +02:00
parent c490ab6965
commit c3b6db4a3c
1 changed files with 3 additions and 3 deletions

View File

@ -232,7 +232,7 @@ export class MangoClient {
tokenName: string,
oracle: PublicKey,
oracleConfFilter: number,
groupInsuranceFund: boolean,
groupInsuranceFund: boolean | undefined,
adjustmentFactor: number,
util0: number,
rate0: number,
@ -259,7 +259,7 @@ export class MangoClient {
val: I80F48.fromNumber(oracleConfFilter).getData(),
},
} as any, // future: nested custom types dont typecheck, fix if possible?
groupInsuranceFund,
groupInsuranceFund ?? null,
{ adjustmentFactor, util0, rate0, util1, rate1, maxRate },
loanFeeRate,
loanOriginationFeeRate,
@ -516,7 +516,7 @@ export class MangoClient {
delegate?: PublicKey,
): Promise<TransactionSignature> {
return await this.program.methods
.accountEdit(name, delegate)
.accountEdit(name ?? null, delegate ?? null)
.accounts({
group: group.publicKey,
account: mangoAccount.publicKey,