diff --git a/ts/client/src/client.ts b/ts/client/src/client.ts index 39785c09a..37de30a42 100644 --- a/ts/client/src/client.ts +++ b/ts/client/src/client.ts @@ -537,14 +537,22 @@ export class MangoClient { accountNumber?: number, name?: string, ): Promise { - return await this.program.methods + const transaction = await this.program.methods .accountCreate(accountNumber ?? 0, 8, 0, 0, 0, name ?? '') .accounts({ group: group.publicKey, owner: (this.program.provider as AnchorProvider).wallet.publicKey, payer: (this.program.provider as AnchorProvider).wallet.publicKey, }) - .rpc({ skipPreflight: true }); + .transaction(); + + return await sendTransaction( + this.program.provider as AnchorProvider, + transaction, + { + postSendTxCallback: this.postSendTxCallback, + }, + ); } public async expandMangoAccount( @@ -572,14 +580,22 @@ export class MangoClient { name?: string, delegate?: PublicKey, ): Promise { - return await this.program.methods + const transaction = await this.program.methods .accountEdit(name ?? null, delegate ?? null) .accounts({ group: group.publicKey, account: mangoAccount.publicKey, owner: (this.program.provider as AnchorProvider).wallet.publicKey, }) - .rpc({ skipPreflight: true }); + .transaction(); + + return await sendTransaction( + this.program.provider as AnchorProvider, + transaction, + { + postSendTxCallback: this.postSendTxCallback, + }, + ); } public async getMangoAccount(mangoAccount: MangoAccount) { @@ -762,7 +778,7 @@ export class MangoClient { [bank], ); - return await this.program.methods + const transaction = await this.program.methods .tokenDeposit(new BN(nativeAmount)) .accounts({ group: group.publicKey, @@ -781,7 +797,15 @@ export class MangoClient { .preInstructions(preInstructions) .postInstructions(postInstructions) .signers(additionalSigners) - .rpc({ skipPreflight: true }); + .transaction(); + + return await sendTransaction( + this.program.provider as AnchorProvider, + transaction, + { + postSendTxCallback: this.postSendTxCallback, + }, + ); } public async tokenWithdraw(