@drift-labs/sdk 2.98.0-beta.3 → 2.98.0-beta.4

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 CHANGED
@@ -1 +1 @@
1
- 2.98.0-beta.3
1
+ 2.98.0-beta.4
@@ -1,6 +1,6 @@
1
1
  /// <reference types="node" />
2
2
  import { Commitment, PublicKey, TransactionSignature } from '@solana/web3.js';
3
- import { DepositRecord, FundingPaymentRecord, FundingRateRecord, LiquidationRecord, NewUserRecord, OrderActionRecord, OrderRecord, SettlePnlRecord, LPRecord, InsuranceFundRecord, SpotInterestRecord, InsuranceFundStakeRecord, CurveRecord, SwapRecord, SpotMarketVaultDepositRecord } from '../index';
3
+ import { DepositRecord, FundingPaymentRecord, FundingRateRecord, LiquidationRecord, NewUserRecord, OrderActionRecord, OrderRecord, SettlePnlRecord, LPRecord, InsuranceFundRecord, SpotInterestRecord, InsuranceFundStakeRecord, CurveRecord, SwapRecord, SpotMarketVaultDepositRecord, SwiftOrderRecord } from '../index';
4
4
  import { EventEmitter } from 'events';
5
5
  export type EventSubscriptionOptions = {
6
6
  address?: PublicKey;
@@ -41,9 +41,10 @@ export type EventMap = {
41
41
  CurveRecord: Event<CurveRecord>;
42
42
  SwapRecord: Event<SwapRecord>;
43
43
  SpotMarketVaultDepositRecord: Event<SpotMarketVaultDepositRecord>;
44
+ SwiftOrderRecord: Event<SwiftOrderRecord>;
44
45
  };
45
46
  export type EventType = keyof EventMap;
46
- export type DriftEvent = Event<DepositRecord> | Event<FundingPaymentRecord> | Event<LiquidationRecord> | Event<FundingRateRecord> | Event<OrderRecord> | Event<OrderActionRecord> | Event<SettlePnlRecord> | Event<NewUserRecord> | Event<LPRecord> | Event<InsuranceFundRecord> | Event<SpotInterestRecord> | Event<InsuranceFundStakeRecord> | Event<CurveRecord> | Event<SwapRecord> | Event<SpotMarketVaultDepositRecord>;
47
+ export type DriftEvent = Event<DepositRecord> | Event<FundingPaymentRecord> | Event<LiquidationRecord> | Event<FundingRateRecord> | Event<OrderRecord> | Event<OrderActionRecord> | Event<SettlePnlRecord> | Event<NewUserRecord> | Event<LPRecord> | Event<InsuranceFundRecord> | Event<SpotInterestRecord> | Event<InsuranceFundStakeRecord> | Event<CurveRecord> | Event<SwapRecord> | Event<SpotMarketVaultDepositRecord> | Event<SwiftOrderRecord>;
47
48
  export interface EventSubscriberEvents {
48
49
  newEvent: (event: WrappedEvent<EventType>) => void;
49
50
  }
@@ -18,6 +18,7 @@ exports.DefaultEventSubscriptionOptions = {
18
18
  'CurveRecord',
19
19
  'SwapRecord',
20
20
  'SpotMarketVaultDepositRecord',
21
+ 'SwiftOrderRecord',
21
22
  ],
22
23
  maxEventsPerType: 4096,
23
24
  orderBy: 'blockchain',
@@ -11529,6 +11529,38 @@
11529
11529
  }
11530
11530
  ]
11531
11531
  },
11532
+ {
11533
+ "name": "SwiftOrderRecord",
11534
+ "fields": [
11535
+ {
11536
+ "name": "user",
11537
+ "type": "publicKey",
11538
+ "index": false
11539
+ },
11540
+ {
11541
+ "name": "hash",
11542
+ "type": "string",
11543
+ "index": false
11544
+ },
11545
+ {
11546
+ "name": "matchingOrderParams",
11547
+ "type": {
11548
+ "defined": "OrderParams"
11549
+ },
11550
+ "index": false
11551
+ },
11552
+ {
11553
+ "name": "swiftOrderSlot",
11554
+ "type": "u64",
11555
+ "index": false
11556
+ },
11557
+ {
11558
+ "name": "userNextOrderId",
11559
+ "type": "u32",
11560
+ "index": false
11561
+ }
11562
+ ]
11563
+ },
11532
11564
  {
11533
11565
  "name": "OrderRecord",
11534
11566
  "fields": [
@@ -642,6 +642,13 @@ export type SettlePnlRecord = {
642
642
  settlePrice: BN;
643
643
  explanation: SettlePnlExplanation;
644
644
  };
645
+ export type SwiftOrderRecord = {
646
+ user: PublicKey;
647
+ hash: string;
648
+ matchingOrderParams: OrderParams;
649
+ swiftOrderSlot: BN;
650
+ userNextOrderId: number;
651
+ };
645
652
  export type OrderRecord = {
646
653
  ts: BN;
647
654
  user: PublicKey;
@@ -1,6 +1,6 @@
1
1
  /// <reference types="node" />
2
2
  import { Commitment, PublicKey, TransactionSignature } from '@solana/web3.js';
3
- import { DepositRecord, FundingPaymentRecord, FundingRateRecord, LiquidationRecord, NewUserRecord, OrderActionRecord, OrderRecord, SettlePnlRecord, LPRecord, InsuranceFundRecord, SpotInterestRecord, InsuranceFundStakeRecord, CurveRecord, SwapRecord, SpotMarketVaultDepositRecord } from '../index';
3
+ import { DepositRecord, FundingPaymentRecord, FundingRateRecord, LiquidationRecord, NewUserRecord, OrderActionRecord, OrderRecord, SettlePnlRecord, LPRecord, InsuranceFundRecord, SpotInterestRecord, InsuranceFundStakeRecord, CurveRecord, SwapRecord, SpotMarketVaultDepositRecord, SwiftOrderRecord } from '../index';
4
4
  import { EventEmitter } from 'events';
5
5
  export type EventSubscriptionOptions = {
6
6
  address?: PublicKey;
@@ -41,9 +41,10 @@ export type EventMap = {
41
41
  CurveRecord: Event<CurveRecord>;
42
42
  SwapRecord: Event<SwapRecord>;
43
43
  SpotMarketVaultDepositRecord: Event<SpotMarketVaultDepositRecord>;
44
+ SwiftOrderRecord: Event<SwiftOrderRecord>;
44
45
  };
45
46
  export type EventType = keyof EventMap;
46
- export type DriftEvent = Event<DepositRecord> | Event<FundingPaymentRecord> | Event<LiquidationRecord> | Event<FundingRateRecord> | Event<OrderRecord> | Event<OrderActionRecord> | Event<SettlePnlRecord> | Event<NewUserRecord> | Event<LPRecord> | Event<InsuranceFundRecord> | Event<SpotInterestRecord> | Event<InsuranceFundStakeRecord> | Event<CurveRecord> | Event<SwapRecord> | Event<SpotMarketVaultDepositRecord>;
47
+ export type DriftEvent = Event<DepositRecord> | Event<FundingPaymentRecord> | Event<LiquidationRecord> | Event<FundingRateRecord> | Event<OrderRecord> | Event<OrderActionRecord> | Event<SettlePnlRecord> | Event<NewUserRecord> | Event<LPRecord> | Event<InsuranceFundRecord> | Event<SpotInterestRecord> | Event<InsuranceFundStakeRecord> | Event<CurveRecord> | Event<SwapRecord> | Event<SpotMarketVaultDepositRecord> | Event<SwiftOrderRecord>;
47
48
  export interface EventSubscriberEvents {
48
49
  newEvent: (event: WrappedEvent<EventType>) => void;
49
50
  }
@@ -18,6 +18,7 @@ exports.DefaultEventSubscriptionOptions = {
18
18
  'CurveRecord',
19
19
  'SwapRecord',
20
20
  'SpotMarketVaultDepositRecord',
21
+ 'SwiftOrderRecord',
21
22
  ],
22
23
  maxEventsPerType: 4096,
23
24
  orderBy: 'blockchain',
@@ -11529,6 +11529,38 @@
11529
11529
  }
11530
11530
  ]
11531
11531
  },
11532
+ {
11533
+ "name": "SwiftOrderRecord",
11534
+ "fields": [
11535
+ {
11536
+ "name": "user",
11537
+ "type": "publicKey",
11538
+ "index": false
11539
+ },
11540
+ {
11541
+ "name": "hash",
11542
+ "type": "string",
11543
+ "index": false
11544
+ },
11545
+ {
11546
+ "name": "matchingOrderParams",
11547
+ "type": {
11548
+ "defined": "OrderParams"
11549
+ },
11550
+ "index": false
11551
+ },
11552
+ {
11553
+ "name": "swiftOrderSlot",
11554
+ "type": "u64",
11555
+ "index": false
11556
+ },
11557
+ {
11558
+ "name": "userNextOrderId",
11559
+ "type": "u32",
11560
+ "index": false
11561
+ }
11562
+ ]
11563
+ },
11532
11564
  {
11533
11565
  "name": "OrderRecord",
11534
11566
  "fields": [
@@ -642,6 +642,13 @@ export type SettlePnlRecord = {
642
642
  settlePrice: BN;
643
643
  explanation: SettlePnlExplanation;
644
644
  };
645
+ export type SwiftOrderRecord = {
646
+ user: PublicKey;
647
+ hash: string;
648
+ matchingOrderParams: OrderParams;
649
+ swiftOrderSlot: BN;
650
+ userNextOrderId: number;
651
+ };
645
652
  export type OrderRecord = {
646
653
  ts: BN;
647
654
  user: PublicKey;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@drift-labs/sdk",
3
- "version": "2.98.0-beta.3",
3
+ "version": "2.98.0-beta.4",
4
4
  "main": "lib/node/index.js",
5
5
  "types": "lib/node/index.d.ts",
6
6
  "browser": "./lib/browser/index.js",
@@ -15,6 +15,7 @@ import {
15
15
  CurveRecord,
16
16
  SwapRecord,
17
17
  SpotMarketVaultDepositRecord,
18
+ SwiftOrderRecord,
18
19
  } from '../index';
19
20
  import { EventEmitter } from 'events';
20
21
 
@@ -49,6 +50,7 @@ export const DefaultEventSubscriptionOptions: EventSubscriptionOptions = {
49
50
  'CurveRecord',
50
51
  'SwapRecord',
51
52
  'SpotMarketVaultDepositRecord',
53
+ 'SwiftOrderRecord',
52
54
  ],
53
55
  maxEventsPerType: 4096,
54
56
  orderBy: 'blockchain',
@@ -92,6 +94,7 @@ export type EventMap = {
92
94
  CurveRecord: Event<CurveRecord>;
93
95
  SwapRecord: Event<SwapRecord>;
94
96
  SpotMarketVaultDepositRecord: Event<SpotMarketVaultDepositRecord>;
97
+ SwiftOrderRecord: Event<SwiftOrderRecord>;
95
98
  };
96
99
 
97
100
  export type EventType = keyof EventMap;
@@ -111,7 +114,8 @@ export type DriftEvent =
111
114
  | Event<InsuranceFundStakeRecord>
112
115
  | Event<CurveRecord>
113
116
  | Event<SwapRecord>
114
- | Event<SpotMarketVaultDepositRecord>;
117
+ | Event<SpotMarketVaultDepositRecord>
118
+ | Event<SwiftOrderRecord>;
115
119
 
116
120
  export interface EventSubscriberEvents {
117
121
  newEvent: (event: WrappedEvent<EventType>) => void;
@@ -11529,6 +11529,38 @@
11529
11529
  }
11530
11530
  ]
11531
11531
  },
11532
+ {
11533
+ "name": "SwiftOrderRecord",
11534
+ "fields": [
11535
+ {
11536
+ "name": "user",
11537
+ "type": "publicKey",
11538
+ "index": false
11539
+ },
11540
+ {
11541
+ "name": "hash",
11542
+ "type": "string",
11543
+ "index": false
11544
+ },
11545
+ {
11546
+ "name": "matchingOrderParams",
11547
+ "type": {
11548
+ "defined": "OrderParams"
11549
+ },
11550
+ "index": false
11551
+ },
11552
+ {
11553
+ "name": "swiftOrderSlot",
11554
+ "type": "u64",
11555
+ "index": false
11556
+ },
11557
+ {
11558
+ "name": "userNextOrderId",
11559
+ "type": "u32",
11560
+ "index": false
11561
+ }
11562
+ ]
11563
+ },
11532
11564
  {
11533
11565
  "name": "OrderRecord",
11534
11566
  "fields": [
package/src/types.ts CHANGED
@@ -541,6 +541,14 @@ export type SettlePnlRecord = {
541
541
  explanation: SettlePnlExplanation;
542
542
  };
543
543
 
544
+ export type SwiftOrderRecord = {
545
+ user: PublicKey;
546
+ hash: string;
547
+ matchingOrderParams: OrderParams;
548
+ swiftOrderSlot: BN;
549
+ userNextOrderId: number;
550
+ };
551
+
544
552
  export type OrderRecord = {
545
553
  ts: BN;
546
554
  user: PublicKey;