@@ -1587,6 +1587,26 @@ export class DriftClient {
15871587 return txSig ;
15881588 }
15891589
1590+ public async getUpdateUserDelegateIx (
1591+ delegate : PublicKey ,
1592+ overrides : {
1593+ subAccountId ?: number ,
1594+ userAccountPublicKey ?: PublicKey ,
1595+ authority ?: PublicKey ,
1596+ }
1597+ ) : Promise < TransactionInstruction > {
1598+ const subAccountId = overrides . subAccountId ?? this . activeSubAccountId ;
1599+ const userAccountPublicKey = overrides . userAccountPublicKey ?? await this . getUserAccountPublicKey ( ) ;
1600+ const authority = overrides . authority ?? this . wallet . publicKey ;
1601+
1602+ return await this . program . instruction . updateUserDelegate ( subAccountId , delegate , {
1603+ accounts : {
1604+ user : userAccountPublicKey ,
1605+ authority,
1606+ } ,
1607+ } ) ;
1608+ }
1609+
15901610 public async updateUserDelegate (
15911611 delegate : PublicKey ,
15921612 subAccountId = 0
@@ -7406,7 +7426,10 @@ export class DriftClient {
74067426 settleeUserAccountPublicKey : PublicKey ,
74077427 settleeUserAccount : UserAccount ,
74087428 marketIndexes : number [ ] ,
7409- mode : SettlePnlMode
7429+ mode : SettlePnlMode ,
7430+ overrides ?: {
7431+ authority ?: PublicKey ;
7432+ }
74107433 ) : Promise < TransactionInstruction > {
74117434 const remainingAccounts = this . getRemainingAccounts ( {
74127435 userAccounts : [ settleeUserAccount ] ,
@@ -7420,7 +7443,7 @@ export class DriftClient {
74207443 {
74217444 accounts : {
74227445 state : await this . getStatePublicKey ( ) ,
7423- authority : this . wallet . publicKey ,
7446+ authority : overrides ?. authority ?? this . wallet . publicKey ,
74247447 user : settleeUserAccountPublicKey ,
74257448 spotMarketVault : this . getQuoteSpotMarketAccount ( ) . vault ,
74267449 } ,
0 commit comments