@drift-labs/sdk 2.86.0-beta.25 → 2.86.0-beta.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/types.ts CHANGED
@@ -1181,6 +1181,23 @@ export type PhoenixV1FulfillmentConfigAccount = {
1181
1181
  status: SpotFulfillmentStatus;
1182
1182
  };
1183
1183
 
1184
+ export type OpenbookV2FulfillmentConfigAccount = {
1185
+ pubkey: PublicKey;
1186
+ openbookV2ProgramId: PublicKey;
1187
+ openbookV2Market: PublicKey;
1188
+ openbookV2MarketAuthority: PublicKey;
1189
+ openbookV2EventHeap: PublicKey;
1190
+ openbookV2Bids: PublicKey;
1191
+ openbookV2Asks: PublicKey;
1192
+ openbookV2BaseVault: PublicKey;
1193
+ openbookV2QuoteVault: PublicKey;
1194
+ marketIndex: number;
1195
+ fulfillmentType: SpotFulfillmentType;
1196
+ status: SpotFulfillmentStatus;
1197
+ // not actually on the account, just used to pass around remaining accounts in ts
1198
+ remainingAccounts?: PublicKey[];
1199
+ };
1200
+
1184
1201
  export type ReferrerNameAccount = {
1185
1202
  name: number[];
1186
1203
  user: PublicKey;
package/src/user.ts CHANGED
@@ -1010,8 +1010,11 @@ export class User {
1010
1010
  const spotMarketAccount: SpotMarketAccount =
1011
1011
  this.driftClient.getSpotMarketAccount(GOV_SPOT_MARKET_INDEX);
1012
1012
 
1013
- const fuelBonusNumeratorUserStats = now.sub(
1014
- BN.max(new BN(userStats.lastFuelIfBonusUpdateTs), FUEL_START_TS)
1013
+ const fuelBonusNumeratorUserStats = BN.max(
1014
+ now.sub(
1015
+ BN.max(new BN(userStats.lastFuelIfBonusUpdateTs), FUEL_START_TS)
1016
+ ),
1017
+ ZERO
1015
1018
  );
1016
1019
 
1017
1020
  result.insuranceFuel = result.insuranceFuel.add(