@drift-labs/sdk 2.52.0-beta.6 → 2.52.0-beta.8
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/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/priorityFee/index.d.ts +7 -0
- package/lib/priorityFee/index.js +23 -0
- package/lib/user.js +1 -2
- package/package.json +1 -1
- package/src/index.ts +1 -1
- package/src/priorityFee/index.ts +7 -0
- package/src/user.ts +6 -2
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
2.52.0-beta.
|
|
1
|
+
2.52.0-beta.8
|
package/lib/index.d.ts
CHANGED
|
@@ -68,7 +68,7 @@ export * from './constants/numericConstants';
|
|
|
68
68
|
export * from './serum/serumSubscriber';
|
|
69
69
|
export * from './serum/serumFulfillmentConfigMap';
|
|
70
70
|
export * from './phoenix/phoenixSubscriber';
|
|
71
|
-
export * from './priorityFee
|
|
71
|
+
export * from './priorityFee';
|
|
72
72
|
export * from './phoenix/phoenixFulfillmentConfigMap';
|
|
73
73
|
export * from './tx/fastSingleTxSender';
|
|
74
74
|
export * from './tx/retryTxSender';
|
package/lib/index.js
CHANGED
|
@@ -91,7 +91,7 @@ __exportStar(require("./constants/numericConstants"), exports);
|
|
|
91
91
|
__exportStar(require("./serum/serumSubscriber"), exports);
|
|
92
92
|
__exportStar(require("./serum/serumFulfillmentConfigMap"), exports);
|
|
93
93
|
__exportStar(require("./phoenix/phoenixSubscriber"), exports);
|
|
94
|
-
__exportStar(require("./priorityFee
|
|
94
|
+
__exportStar(require("./priorityFee"), exports);
|
|
95
95
|
__exportStar(require("./phoenix/phoenixFulfillmentConfigMap"), exports);
|
|
96
96
|
__exportStar(require("./tx/fastSingleTxSender"), exports);
|
|
97
97
|
__exportStar(require("./tx/retryTxSender"), exports);
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./averageOverSlotsStrategy"), exports);
|
|
18
|
+
__exportStar(require("./averageStrategy"), exports);
|
|
19
|
+
__exportStar(require("./ewmaStrategy"), exports);
|
|
20
|
+
__exportStar(require("./maxOverSlotsStrategy"), exports);
|
|
21
|
+
__exportStar(require("./maxStrategy"), exports);
|
|
22
|
+
__exportStar(require("./priorityFeeSubscriber"), exports);
|
|
23
|
+
__exportStar(require("./types"), exports);
|
package/lib/user.js
CHANGED
|
@@ -768,8 +768,7 @@ class User {
|
|
|
768
768
|
* @returns : Precision QUOTE_PRECISION
|
|
769
769
|
*/
|
|
770
770
|
getPerpPositionValue(marketIndex, oraclePriceData, includeOpenOrders = false) {
|
|
771
|
-
const userPosition = this.getPerpPositionWithLPSettle(marketIndex)[0] ||
|
|
772
|
-
this.getEmptyPosition(marketIndex);
|
|
771
|
+
const userPosition = this.getPerpPositionWithLPSettle(marketIndex, undefined, false, true)[0] || this.getEmptyPosition(marketIndex);
|
|
773
772
|
const market = this.driftClient.getPerpMarketAccount(userPosition.marketIndex);
|
|
774
773
|
return (0, margin_1.calculateBaseAssetValueWithOracle)(market, userPosition, oraclePriceData, includeOpenOrders);
|
|
775
774
|
}
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -69,7 +69,7 @@ export * from './constants/numericConstants';
|
|
|
69
69
|
export * from './serum/serumSubscriber';
|
|
70
70
|
export * from './serum/serumFulfillmentConfigMap';
|
|
71
71
|
export * from './phoenix/phoenixSubscriber';
|
|
72
|
-
export * from './priorityFee
|
|
72
|
+
export * from './priorityFee';
|
|
73
73
|
export * from './phoenix/phoenixFulfillmentConfigMap';
|
|
74
74
|
export * from './tx/fastSingleTxSender';
|
|
75
75
|
export * from './tx/retryTxSender';
|
package/src/user.ts
CHANGED
|
@@ -1401,8 +1401,12 @@ export class User {
|
|
|
1401
1401
|
includeOpenOrders = false
|
|
1402
1402
|
): BN {
|
|
1403
1403
|
const userPosition =
|
|
1404
|
-
this.getPerpPositionWithLPSettle(
|
|
1405
|
-
|
|
1404
|
+
this.getPerpPositionWithLPSettle(
|
|
1405
|
+
marketIndex,
|
|
1406
|
+
undefined,
|
|
1407
|
+
false,
|
|
1408
|
+
true
|
|
1409
|
+
)[0] || this.getEmptyPosition(marketIndex);
|
|
1406
1410
|
const market = this.driftClient.getPerpMarketAccount(
|
|
1407
1411
|
userPosition.marketIndex
|
|
1408
1412
|
);
|