Skip to content

Commit

Permalink
Merge pull request #1460 from drift-labs/wphan/fix_protected_maker_ix
Browse files Browse the repository at this point in the history
sdk: allow specifying authority for updateUserProtectedMakerOrders
  • Loading branch information
wphan authored Feb 4, 2025
2 parents db22881 + 5bff9db commit f2858f3
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions sdk/src/driftClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9209,13 +9209,15 @@ export class DriftClient {
public async updateUserProtectedMakerOrders(
subAccountId: number,
protectedOrders: boolean,
authority?: PublicKey,
txParams?: TxParams
): Promise<TransactionSignature> {
const { txSig } = await this.sendTransaction(
await this.buildTransaction(
await this.getUpdateUserProtectedMakerOrdersIx(
subAccountId,
protectedOrders
protectedOrders,
authority
),
txParams
),
Expand All @@ -9227,7 +9229,8 @@ export class DriftClient {

public async getUpdateUserProtectedMakerOrdersIx(
subAccountId: number,
protectedOrders: boolean
protectedOrders: boolean,
authority?: PublicKey
): Promise<TransactionInstruction> {
const ix = await this.program.instruction.updateUserProtectedMakerOrders(
subAccountId,
Expand All @@ -9237,7 +9240,7 @@ export class DriftClient {
state: await this.getStatePublicKey(),
user: getUserAccountPublicKeySync(
this.program.programId,
this.wallet.publicKey,
authority ?? this.authority,
subAccountId
),
authority: this.wallet.publicKey,
Expand Down

0 comments on commit f2858f3

Please sign in to comment.