@drift-labs/sdk 2.82.0-beta.15 → 2.82.0-beta.16
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/math/exchangeStatus.d.ts +2 -2
- package/lib/types.d.ts +7 -0
- package/lib/types.js +8 -1
- package/package.json +1 -1
- package/src/math/exchangeStatus.ts +2 -1
- package/src/types.ts +9 -0
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
2.82.0-beta.
|
|
1
|
+
2.82.0-beta.16
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { PerpMarketAccount, PerpOperation, SpotMarketAccount, SpotOperation, StateAccount } from '../types';
|
|
1
|
+
import { PerpMarketAccount, PerpOperation, SpotMarketAccount, SpotOperation, StateAccount, InsuranceFundOperation } from '../types';
|
|
2
2
|
export declare function exchangePaused(state: StateAccount): boolean;
|
|
3
3
|
export declare function fillPaused(state: StateAccount, market: PerpMarketAccount | SpotMarketAccount): boolean;
|
|
4
4
|
export declare function ammPaused(state: StateAccount, market: PerpMarketAccount | SpotMarketAccount): boolean;
|
|
5
|
-
export declare function isOperationPaused(pausedOperations: number, operation: PerpOperation | SpotOperation): boolean;
|
|
5
|
+
export declare function isOperationPaused(pausedOperations: number, operation: PerpOperation | SpotOperation | InsuranceFundOperation): boolean;
|
|
6
6
|
export declare function isAmmDrawdownPause(market: PerpMarketAccount): boolean;
|
package/lib/types.d.ts
CHANGED
|
@@ -55,6 +55,12 @@ export declare enum SpotOperation {
|
|
|
55
55
|
WITHDRAW = 4,
|
|
56
56
|
LIQUIDATION = 8
|
|
57
57
|
}
|
|
58
|
+
export declare enum InsuranceFundOperation {
|
|
59
|
+
INIT = 1,
|
|
60
|
+
ADD = 2,
|
|
61
|
+
REQUEST_REMOVE = 4,
|
|
62
|
+
REMOVE = 8
|
|
63
|
+
}
|
|
58
64
|
export declare enum UserStatus {
|
|
59
65
|
BEING_LIQUIDATED = 1,
|
|
60
66
|
BANKRUPT = 2,
|
|
@@ -780,6 +786,7 @@ export type SpotMarketAccount = {
|
|
|
780
786
|
flashLoanInitialTokenAmount: BN;
|
|
781
787
|
ordersEnabled: boolean;
|
|
782
788
|
pausedOperations: number;
|
|
789
|
+
ifPausedOperations: number;
|
|
783
790
|
};
|
|
784
791
|
export type PoolBalance = {
|
|
785
792
|
scaledBalance: BN;
|
package/lib/types.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SwapReduceOnly = exports.DefaultOrderParams = exports.ModifyOrderPolicy = exports.PostOnlyParams = exports.LiquidationType = exports.LPAction = exports.TradeSide = exports.getVariant = exports.isOneOfVariant = exports.isVariant = exports.StakeAction = exports.SpotFulfillmentConfigStatus = exports.SettlePnlExplanation = exports.DepositExplanation = exports.SpotFulfillmentStatus = exports.SpotFulfillmentType = exports.OrderTriggerCondition = exports.OrderActionExplanation = exports.OrderAction = exports.OrderStatus = exports.MarketType = exports.OrderType = exports.OracleSource = exports.DepositDirection = exports.PositionDirection = exports.SpotBalanceType = exports.SwapDirection = exports.AssetTier = exports.ContractTier = exports.ContractType = exports.UserStatus = exports.SpotOperation = exports.PerpOperation = exports.MarketStatus = exports.ExchangeStatus = void 0;
|
|
3
|
+
exports.SwapReduceOnly = exports.DefaultOrderParams = exports.ModifyOrderPolicy = exports.PostOnlyParams = exports.LiquidationType = exports.LPAction = exports.TradeSide = exports.getVariant = exports.isOneOfVariant = exports.isVariant = exports.StakeAction = exports.SpotFulfillmentConfigStatus = exports.SettlePnlExplanation = exports.DepositExplanation = exports.SpotFulfillmentStatus = exports.SpotFulfillmentType = exports.OrderTriggerCondition = exports.OrderActionExplanation = exports.OrderAction = exports.OrderStatus = exports.MarketType = exports.OrderType = exports.OracleSource = exports.DepositDirection = exports.PositionDirection = exports.SpotBalanceType = exports.SwapDirection = exports.AssetTier = exports.ContractTier = exports.ContractType = exports.UserStatus = exports.InsuranceFundOperation = exports.SpotOperation = exports.PerpOperation = exports.MarketStatus = exports.ExchangeStatus = void 0;
|
|
4
4
|
const _1 = require(".");
|
|
5
5
|
// # Utility Types / Enums / Constants
|
|
6
6
|
var ExchangeStatus;
|
|
@@ -43,6 +43,13 @@ var SpotOperation;
|
|
|
43
43
|
SpotOperation[SpotOperation["WITHDRAW"] = 4] = "WITHDRAW";
|
|
44
44
|
SpotOperation[SpotOperation["LIQUIDATION"] = 8] = "LIQUIDATION";
|
|
45
45
|
})(SpotOperation = exports.SpotOperation || (exports.SpotOperation = {}));
|
|
46
|
+
var InsuranceFundOperation;
|
|
47
|
+
(function (InsuranceFundOperation) {
|
|
48
|
+
InsuranceFundOperation[InsuranceFundOperation["INIT"] = 1] = "INIT";
|
|
49
|
+
InsuranceFundOperation[InsuranceFundOperation["ADD"] = 2] = "ADD";
|
|
50
|
+
InsuranceFundOperation[InsuranceFundOperation["REQUEST_REMOVE"] = 4] = "REQUEST_REMOVE";
|
|
51
|
+
InsuranceFundOperation[InsuranceFundOperation["REMOVE"] = 8] = "REMOVE";
|
|
52
|
+
})(InsuranceFundOperation = exports.InsuranceFundOperation || (exports.InsuranceFundOperation = {}));
|
|
46
53
|
var UserStatus;
|
|
47
54
|
(function (UserStatus) {
|
|
48
55
|
UserStatus[UserStatus["BEING_LIQUIDATED"] = 1] = "BEING_LIQUIDATED";
|
package/package.json
CHANGED
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
SpotOperation,
|
|
12
12
|
StateAccount,
|
|
13
13
|
isVariant,
|
|
14
|
+
InsuranceFundOperation,
|
|
14
15
|
} from '../types';
|
|
15
16
|
import { BN } from '@coral-xyz/anchor';
|
|
16
17
|
|
|
@@ -65,7 +66,7 @@ export function ammPaused(
|
|
|
65
66
|
|
|
66
67
|
export function isOperationPaused(
|
|
67
68
|
pausedOperations: number,
|
|
68
|
-
operation: PerpOperation | SpotOperation
|
|
69
|
+
operation: PerpOperation | SpotOperation | InsuranceFundOperation
|
|
69
70
|
): boolean {
|
|
70
71
|
return (pausedOperations & operation) > 0;
|
|
71
72
|
}
|
package/src/types.ts
CHANGED
|
@@ -43,6 +43,13 @@ export enum SpotOperation {
|
|
|
43
43
|
LIQUIDATION = 8,
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
+
export enum InsuranceFundOperation {
|
|
47
|
+
INIT = 1,
|
|
48
|
+
ADD = 2,
|
|
49
|
+
REQUEST_REMOVE = 4,
|
|
50
|
+
REMOVE = 8,
|
|
51
|
+
}
|
|
52
|
+
|
|
46
53
|
export enum UserStatus {
|
|
47
54
|
BEING_LIQUIDATED = 1,
|
|
48
55
|
BANKRUPT = 2,
|
|
@@ -708,6 +715,8 @@ export type SpotMarketAccount = {
|
|
|
708
715
|
ordersEnabled: boolean;
|
|
709
716
|
|
|
710
717
|
pausedOperations: number;
|
|
718
|
+
|
|
719
|
+
ifPausedOperations: number;
|
|
711
720
|
};
|
|
712
721
|
|
|
713
722
|
export type PoolBalance = {
|