@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/VERSION +1 -1
- package/lib/addresses/pda.d.ts +1 -0
- package/lib/addresses/pda.js +8 -1
- package/lib/adminClient.d.ts +2 -0
- package/lib/adminClient.js +26 -0
- package/lib/driftClient.d.ts +7 -4
- package/lib/driftClient.js +102 -0
- package/lib/idl/drift.json +179 -0
- package/lib/types.d.ts +18 -2
- package/lib/types.js +3 -2
- package/lib/user.js +1 -1
- package/package.json +1 -1
- package/src/addresses/pda.ts +15 -0
- package/src/adminClient.ts +51 -0
- package/src/driftClient.ts +132 -2
- package/src/idl/drift.json +179 -0
- package/src/idl/openbook.json +3854 -0
- package/src/types.ts +20 -2
- package/src/user.ts +5 -2
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
|
-
|
|
48
|
-
|
|
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 =
|
|
1014
|
-
|
|
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(
|