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

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
@@ -44,8 +44,9 @@ export enum PerpOperation {
44
44
  export enum SpotOperation {
45
45
  UPDATE_CUMULATIVE_INTEREST = 1,
46
46
  FILL = 2,
47
- WITHDRAW = 4,
48
- LIQUIDATION = 8,
47
+ DEPOSIT = 4,
48
+ WITHDRAW = 8,
49
+ LIQUIDATION = 16,
49
50
  }
50
51
 
51
52
  export enum InsuranceFundOperation {
@@ -1181,6 +1182,23 @@ export type PhoenixV1FulfillmentConfigAccount = {
1181
1182
  status: SpotFulfillmentStatus;
1182
1183
  };
1183
1184
 
1185
+ export type OpenbookV2FulfillmentConfigAccount = {
1186
+ pubkey: PublicKey;
1187
+ openbookV2ProgramId: PublicKey;
1188
+ openbookV2Market: PublicKey;
1189
+ openbookV2MarketAuthority: PublicKey;
1190
+ openbookV2EventHeap: PublicKey;
1191
+ openbookV2Bids: PublicKey;
1192
+ openbookV2Asks: PublicKey;
1193
+ openbookV2BaseVault: PublicKey;
1194
+ openbookV2QuoteVault: PublicKey;
1195
+ marketIndex: number;
1196
+ fulfillmentType: SpotFulfillmentType;
1197
+ status: SpotFulfillmentStatus;
1198
+ // not actually on the account, just used to pass around remaining accounts in ts
1199
+ remainingAccounts?: PublicKey[];
1200
+ };
1201
+
1184
1202
  export type ReferrerNameAccount = {
1185
1203
  name: number[];
1186
1204
  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(