Skip to content

Commit

Permalink
Added handling for unstaking with no subaccount (#915)
Browse files Browse the repository at this point in the history
  • Loading branch information
lukecaan committed Feb 29, 2024
1 parent 6fd8756 commit 1ecdfee
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions sdk/src/driftClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6183,9 +6183,13 @@ export class DriftClient {
}
}

const userAccountExists = !!this.getUser()?.accountSubscriber?.isSubscribed && (await this.checkIfAccountExists(
this.getUser().userAccountPublicKey
));

const remainingAccounts = this.getRemainingAccounts({
userAccounts: [this.getUserAccount()],
useMarketLastSlotCache: true,
userAccounts: userAccountExists ? [this.getUserAccount()] : [],
useMarketLastSlotCache: false,
writableSpotMarketIndexes: [marketIndex],
});

Expand Down

0 comments on commit 1ecdfee

Please sign in to comment.