@drift-labs/sdk 2.0.4 → 2.0.5
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/lib/idl/drift.json +3 -0
- package/lib/types.d.ts +5 -2
- package/lib/types.js +5 -2
- package/lib/user.js +1 -1
- package/package.json +1 -1
- package/src/idl/drift.json +3 -0
- package/src/types.ts +5 -2
- package/src/user.ts +1 -1
package/lib/idl/drift.json
CHANGED
package/lib/types.d.ts
CHANGED
|
@@ -217,14 +217,17 @@ export declare class OrderActionExplanation {
|
|
|
217
217
|
liquidation: {};
|
|
218
218
|
};
|
|
219
219
|
static readonly ORDER_FILLED_WITH_AMM: {
|
|
220
|
-
|
|
220
|
+
orderFilledWithAmm: {};
|
|
221
221
|
};
|
|
222
222
|
static readonly ORDER_FILLED_WITH_AMM_JIT: {
|
|
223
|
-
|
|
223
|
+
orderFilledWithAmmJit: {};
|
|
224
224
|
};
|
|
225
225
|
static readonly ORDER_FILLED_WITH_MATCH: {
|
|
226
226
|
orderFilledWithMatch: {};
|
|
227
227
|
};
|
|
228
|
+
static readonly ORDER_FILLED_WITH_MATCH_JIT: {
|
|
229
|
+
orderFilledWithMatchJit: {};
|
|
230
|
+
};
|
|
228
231
|
static readonly MARKET_EXPIRED: {
|
|
229
232
|
marketExpired: {};
|
|
230
233
|
};
|
package/lib/types.js
CHANGED
|
@@ -123,14 +123,17 @@ OrderActionExplanation.LIQUIDATION = {
|
|
|
123
123
|
liquidation: {},
|
|
124
124
|
};
|
|
125
125
|
OrderActionExplanation.ORDER_FILLED_WITH_AMM = {
|
|
126
|
-
|
|
126
|
+
orderFilledWithAmm: {},
|
|
127
127
|
};
|
|
128
128
|
OrderActionExplanation.ORDER_FILLED_WITH_AMM_JIT = {
|
|
129
|
-
|
|
129
|
+
orderFilledWithAmmJit: {},
|
|
130
130
|
};
|
|
131
131
|
OrderActionExplanation.ORDER_FILLED_WITH_MATCH = {
|
|
132
132
|
orderFilledWithMatch: {},
|
|
133
133
|
};
|
|
134
|
+
OrderActionExplanation.ORDER_FILLED_WITH_MATCH_JIT = {
|
|
135
|
+
orderFilledWithMatchJit: {},
|
|
136
|
+
};
|
|
134
137
|
OrderActionExplanation.MARKET_EXPIRED = {
|
|
135
138
|
marketExpired: {},
|
|
136
139
|
};
|
package/lib/user.js
CHANGED
|
@@ -602,7 +602,7 @@ class User {
|
|
|
602
602
|
return totalAssetValue.mul(numericConstants_1.TEN_THOUSAND).div(totalLiabilityValue);
|
|
603
603
|
}
|
|
604
604
|
canBeLiquidated() {
|
|
605
|
-
const totalCollateral = this.getTotalCollateral(
|
|
605
|
+
const totalCollateral = this.getTotalCollateral();
|
|
606
606
|
// if user being liq'd, can continue to be liq'd until total collateral above the margin requirement plus buffer
|
|
607
607
|
let liquidationBuffer = undefined;
|
|
608
608
|
const isBeingLiquidated = (0, types_1.isVariant)(this.getUserAccount().status, 'beingLiquidated');
|
package/package.json
CHANGED
package/src/idl/drift.json
CHANGED
package/src/types.ts
CHANGED
|
@@ -122,14 +122,17 @@ export class OrderActionExplanation {
|
|
|
122
122
|
liquidation: {},
|
|
123
123
|
};
|
|
124
124
|
static readonly ORDER_FILLED_WITH_AMM = {
|
|
125
|
-
|
|
125
|
+
orderFilledWithAmm: {},
|
|
126
126
|
};
|
|
127
127
|
static readonly ORDER_FILLED_WITH_AMM_JIT = {
|
|
128
|
-
|
|
128
|
+
orderFilledWithAmmJit: {},
|
|
129
129
|
};
|
|
130
130
|
static readonly ORDER_FILLED_WITH_MATCH = {
|
|
131
131
|
orderFilledWithMatch: {},
|
|
132
132
|
};
|
|
133
|
+
static readonly ORDER_FILLED_WITH_MATCH_JIT = {
|
|
134
|
+
orderFilledWithMatchJit: {},
|
|
135
|
+
};
|
|
133
136
|
static readonly MARKET_EXPIRED = {
|
|
134
137
|
marketExpired: {},
|
|
135
138
|
};
|
package/src/user.ts
CHANGED
|
@@ -1021,7 +1021,7 @@ export class User {
|
|
|
1021
1021
|
}
|
|
1022
1022
|
|
|
1023
1023
|
public canBeLiquidated(): boolean {
|
|
1024
|
-
const totalCollateral = this.getTotalCollateral(
|
|
1024
|
+
const totalCollateral = this.getTotalCollateral();
|
|
1025
1025
|
|
|
1026
1026
|
// if user being liq'd, can continue to be liq'd until total collateral above the margin requirement plus buffer
|
|
1027
1027
|
let liquidationBuffer = undefined;
|