@drift-labs/sdk 2.82.0-beta.3 → 2.82.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.82.0-beta.3
1
+ 2.82.0-beta.4
@@ -1,3 +1,13 @@
1
- import { DriftPriorityFeeLevels } from './heliusPriorityFeeMethod';
1
+ import { HeliusPriorityLevel } from './heliusPriorityFeeMethod';
2
+ export type DriftMarketInfo = {
3
+ marketType: string;
4
+ marketIndex: number;
5
+ };
6
+ export type DriftPriorityFeeLevels = {
7
+ [key in HeliusPriorityLevel]: number;
8
+ } & {
9
+ marketType: 'perp' | 'spot';
10
+ marketIndex: number;
11
+ };
2
12
  export type DriftPriorityFeeResponse = DriftPriorityFeeLevels[];
3
13
  export declare function fetchDriftPriorityFee(url: string, marketTypes: string[], marketIndexes: number[]): Promise<DriftPriorityFeeResponse>;
@@ -9,12 +9,6 @@ export declare enum HeliusPriorityLevel {
9
9
  export type HeliusPriorityFeeLevels = {
10
10
  [key in HeliusPriorityLevel]: number;
11
11
  };
12
- export type DriftPriorityFeeLevels = {
13
- [key in HeliusPriorityLevel]: number;
14
- } & {
15
- marketType: 'perp' | 'spot';
16
- marketIndex: number;
17
- };
18
12
  export type HeliusPriorityFeeResponse = {
19
13
  jsonrpc: string;
20
14
  result: {
@@ -4,6 +4,8 @@ export * from './ewmaStrategy';
4
4
  export * from './maxOverSlotsStrategy';
5
5
  export * from './maxStrategy';
6
6
  export * from './priorityFeeSubscriber';
7
+ export * from './priorityFeeSubscriberMap';
7
8
  export * from './solanaPriorityFeeMethod';
8
9
  export * from './heliusPriorityFeeMethod';
10
+ export * from './driftPriorityFeeMethod';
9
11
  export * from './types';
@@ -20,6 +20,8 @@ __exportStar(require("./ewmaStrategy"), exports);
20
20
  __exportStar(require("./maxOverSlotsStrategy"), exports);
21
21
  __exportStar(require("./maxStrategy"), exports);
22
22
  __exportStar(require("./priorityFeeSubscriber"), exports);
23
+ __exportStar(require("./priorityFeeSubscriberMap"), exports);
23
24
  __exportStar(require("./solanaPriorityFeeMethod"), exports);
24
25
  __exportStar(require("./heliusPriorityFeeMethod"), exports);
26
+ __exportStar(require("./driftPriorityFeeMethod"), exports);
25
27
  __exportStar(require("./types"), exports);
@@ -1,8 +1,9 @@
1
1
  import { Connection, PublicKey } from '@solana/web3.js';
2
- import { DriftMarketInfo, PriorityFeeMethod, PriorityFeeStrategy, PriorityFeeSubscriberConfig } from './types';
2
+ import { PriorityFeeMethod, PriorityFeeStrategy, PriorityFeeSubscriberConfig } from './types';
3
3
  import { AverageOverSlotsStrategy } from './averageOverSlotsStrategy';
4
4
  import { MaxOverSlotsStrategy } from './maxOverSlotsStrategy';
5
5
  import { HeliusPriorityFeeLevels, HeliusPriorityLevel } from './heliusPriorityFeeMethod';
6
+ import { DriftMarketInfo } from './driftPriorityFeeMethod';
6
7
  export declare class PriorityFeeSubscriber {
7
8
  connection: Connection;
8
9
  frequencyMs: number;
@@ -1,5 +1,5 @@
1
- import { DriftPriorityFeeLevels } from './heliusPriorityFeeMethod';
2
- import { DriftMarketInfo, PriorityFeeSubscriberMapConfig } from './types';
1
+ import { DriftMarketInfo, DriftPriorityFeeLevels } from './driftPriorityFeeMethod';
2
+ import { PriorityFeeSubscriberMapConfig } from './types';
3
3
  /**
4
4
  * takes advantage of /batchPriorityFees endpoint from drift hosted priority fee service
5
5
  */
@@ -1,7 +1,7 @@
1
1
  import { Connection, PublicKey } from '@solana/web3.js';
2
2
  import { SolanaPriorityFeeResponse } from './solanaPriorityFeeMethod';
3
3
  import { HeliusPriorityFeeResponse } from './heliusPriorityFeeMethod';
4
- import { DriftPriorityFeeResponse } from './driftPriorityFeeMethod';
4
+ import { DriftMarketInfo, DriftPriorityFeeResponse } from './driftPriorityFeeMethod';
5
5
  export declare const DEFAULT_PRIORITY_FEE_MAP_FREQUENCY_MS = 10000;
6
6
  export interface PriorityFeeStrategy {
7
7
  calculate(samples: SolanaPriorityFeeResponse[] | HeliusPriorityFeeResponse | DriftPriorityFeeResponse): number;
@@ -11,10 +11,6 @@ export declare enum PriorityFeeMethod {
11
11
  HELIUS = "helius",
12
12
  DRIFT = "drift"
13
13
  }
14
- export type DriftMarketInfo = {
15
- marketType: string;
16
- marketIndex: number;
17
- };
18
14
  export type PriorityFeeSubscriberConfig = {
19
15
  connection?: Connection;
20
16
  frequencyMs?: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@drift-labs/sdk",
3
- "version": "2.82.0-beta.3",
3
+ "version": "2.82.0-beta.4",
4
4
  "main": "lib/index.js",
5
5
  "types": "lib/index.d.ts",
6
6
  "author": "crispheaney",
@@ -1,5 +1,17 @@
1
1
  import fetch from 'node-fetch';
2
- import { DriftPriorityFeeLevels } from './heliusPriorityFeeMethod';
2
+ import { HeliusPriorityLevel } from './heliusPriorityFeeMethod';
3
+
4
+ export type DriftMarketInfo = {
5
+ marketType: string;
6
+ marketIndex: number;
7
+ };
8
+
9
+ export type DriftPriorityFeeLevels = {
10
+ [key in HeliusPriorityLevel]: number;
11
+ } & {
12
+ marketType: 'perp' | 'spot';
13
+ marketIndex: number;
14
+ };
3
15
 
4
16
  export type DriftPriorityFeeResponse = DriftPriorityFeeLevels[];
5
17
 
@@ -13,13 +13,6 @@ export type HeliusPriorityFeeLevels = {
13
13
  [key in HeliusPriorityLevel]: number;
14
14
  };
15
15
 
16
- export type DriftPriorityFeeLevels = {
17
- [key in HeliusPriorityLevel]: number;
18
- } & {
19
- marketType: 'perp' | 'spot';
20
- marketIndex: number;
21
- };
22
-
23
16
  export type HeliusPriorityFeeResponse = {
24
17
  jsonrpc: string;
25
18
  result: {
@@ -4,6 +4,8 @@ export * from './ewmaStrategy';
4
4
  export * from './maxOverSlotsStrategy';
5
5
  export * from './maxStrategy';
6
6
  export * from './priorityFeeSubscriber';
7
+ export * from './priorityFeeSubscriberMap';
7
8
  export * from './solanaPriorityFeeMethod';
8
9
  export * from './heliusPriorityFeeMethod';
10
+ export * from './driftPriorityFeeMethod';
9
11
  export * from './types';
@@ -1,7 +1,6 @@
1
1
  import { Connection, PublicKey } from '@solana/web3.js';
2
2
  import {
3
3
  DEFAULT_PRIORITY_FEE_MAP_FREQUENCY_MS,
4
- DriftMarketInfo,
5
4
  PriorityFeeMethod,
6
5
  PriorityFeeStrategy,
7
6
  PriorityFeeSubscriberConfig,
@@ -14,7 +13,10 @@ import {
14
13
  HeliusPriorityLevel,
15
14
  fetchHeliusPriorityFee,
16
15
  } from './heliusPriorityFeeMethod';
17
- import { fetchDriftPriorityFee } from './driftPriorityFeeMethod';
16
+ import {
17
+ fetchDriftPriorityFee,
18
+ DriftMarketInfo,
19
+ } from './driftPriorityFeeMethod';
18
20
 
19
21
  export class PriorityFeeSubscriber {
20
22
  connection: Connection;
@@ -1,11 +1,11 @@
1
1
  import {
2
+ DriftMarketInfo,
3
+ DriftPriorityFeeLevels,
2
4
  DriftPriorityFeeResponse,
3
5
  fetchDriftPriorityFee,
4
6
  } from './driftPriorityFeeMethod';
5
- import { DriftPriorityFeeLevels } from './heliusPriorityFeeMethod';
6
7
  import {
7
8
  DEFAULT_PRIORITY_FEE_MAP_FREQUENCY_MS,
8
- DriftMarketInfo,
9
9
  PriorityFeeSubscriberMapConfig,
10
10
  } from './types';
11
11
 
@@ -1,7 +1,10 @@
1
1
  import { Connection, PublicKey } from '@solana/web3.js';
2
2
  import { SolanaPriorityFeeResponse } from './solanaPriorityFeeMethod';
3
3
  import { HeliusPriorityFeeResponse } from './heliusPriorityFeeMethod';
4
- import { DriftPriorityFeeResponse } from './driftPriorityFeeMethod';
4
+ import {
5
+ DriftMarketInfo,
6
+ DriftPriorityFeeResponse,
7
+ } from './driftPriorityFeeMethod';
5
8
 
6
9
  export const DEFAULT_PRIORITY_FEE_MAP_FREQUENCY_MS = 10_000;
7
10
 
@@ -22,11 +25,6 @@ export enum PriorityFeeMethod {
22
25
  DRIFT = 'drift',
23
26
  }
24
27
 
25
- export type DriftMarketInfo = {
26
- marketType: string;
27
- marketIndex: number;
28
- };
29
-
30
28
  export type PriorityFeeSubscriberConfig = {
31
29
  /// rpc connection, optional if using priorityFeeMethod.HELIUS
32
30
  connection?: Connection;