@drift-labs/sdk 2.31.1-beta.21 → 2.31.1-beta.22

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.31.1-beta.21
1
+ 2.31.1-beta.22
@@ -1589,6 +1589,9 @@ class DriftClient {
1589
1589
  const readablePerpMarketIndex = [];
1590
1590
  const readableSpotMarketIndexes = [];
1591
1591
  for (const param of params) {
1592
+ if (!param.marketType) {
1593
+ throw new Error('must set param.marketType');
1594
+ }
1592
1595
  if ((0, types_1.isVariant)(param.marketType, 'perp')) {
1593
1596
  readablePerpMarketIndex.push(param.marketIndex);
1594
1597
  }
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "2.31.1-beta.20",
2
+ "version": "2.31.1-beta.21",
3
3
  "name": "drift",
4
4
  "instructions": [
5
5
  {
@@ -1,15 +1,15 @@
1
1
  import { OptionalOrderParams, OrderTriggerCondition } from './types';
2
2
  import { BN } from '@coral-xyz/anchor';
3
- export declare function getLimitOrderParams(params: Omit<OptionalOrderParams, 'orderType' | 'marketType'> & {
3
+ export declare function getLimitOrderParams(params: Omit<OptionalOrderParams, 'orderType'> & {
4
4
  price: BN;
5
5
  }): OptionalOrderParams;
6
- export declare function getTriggerMarketOrderParams(params: Omit<OptionalOrderParams, 'orderType' | 'marketType'> & {
6
+ export declare function getTriggerMarketOrderParams(params: Omit<OptionalOrderParams, 'orderType'> & {
7
7
  triggerCondition: OrderTriggerCondition;
8
8
  triggerPrice: BN;
9
9
  }): OptionalOrderParams;
10
- export declare function getTriggerLimitOrderParams(params: Omit<OptionalOrderParams, 'orderType' | 'marketType'> & {
10
+ export declare function getTriggerLimitOrderParams(params: Omit<OptionalOrderParams, 'orderType'> & {
11
11
  triggerCondition: OrderTriggerCondition;
12
12
  triggerPrice: BN;
13
13
  price: BN;
14
14
  }): OptionalOrderParams;
15
- export declare function getMarketOrderParams(params: Omit<OptionalOrderParams, 'orderType' | 'marketType'>): OptionalOrderParams;
15
+ export declare function getMarketOrderParams(params: Omit<OptionalOrderParams, 'orderType'>): OptionalOrderParams;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@drift-labs/sdk",
3
- "version": "2.31.1-beta.21",
3
+ "version": "2.31.1-beta.22",
4
4
  "main": "lib/index.js",
5
5
  "types": "lib/index.d.ts",
6
6
  "author": "crispheaney",
@@ -2863,6 +2863,9 @@ export class DriftClient {
2863
2863
  const readablePerpMarketIndex: number[] = [];
2864
2864
  const readableSpotMarketIndexes: number[] = [];
2865
2865
  for (const param of params) {
2866
+ if (!param.marketType) {
2867
+ throw new Error('must set param.marketType');
2868
+ }
2866
2869
  if (isVariant(param.marketType, 'perp')) {
2867
2870
  readablePerpMarketIndex.push(param.marketIndex);
2868
2871
  } else {
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "2.31.1-beta.21",
2
+ "version": "2.31.1-beta.22",
3
3
  "name": "drift",
4
4
  "instructions": [
5
5
  {
@@ -2,7 +2,7 @@ import { OptionalOrderParams, OrderTriggerCondition, OrderType } from './types';
2
2
  import { BN } from '@coral-xyz/anchor';
3
3
 
4
4
  export function getLimitOrderParams(
5
- params: Omit<OptionalOrderParams, 'orderType' | 'marketType'> & { price: BN }
5
+ params: Omit<OptionalOrderParams, 'orderType'> & { price: BN }
6
6
  ): OptionalOrderParams {
7
7
  return Object.assign({}, params, {
8
8
  orderType: OrderType.LIMIT,
@@ -10,7 +10,7 @@ export function getLimitOrderParams(
10
10
  }
11
11
 
12
12
  export function getTriggerMarketOrderParams(
13
- params: Omit<OptionalOrderParams, 'orderType' | 'marketType'> & {
13
+ params: Omit<OptionalOrderParams, 'orderType'> & {
14
14
  triggerCondition: OrderTriggerCondition;
15
15
  triggerPrice: BN;
16
16
  }
@@ -21,7 +21,7 @@ export function getTriggerMarketOrderParams(
21
21
  }
22
22
 
23
23
  export function getTriggerLimitOrderParams(
24
- params: Omit<OptionalOrderParams, 'orderType' | 'marketType'> & {
24
+ params: Omit<OptionalOrderParams, 'orderType'> & {
25
25
  triggerCondition: OrderTriggerCondition;
26
26
  triggerPrice: BN;
27
27
  price: BN;
@@ -33,7 +33,7 @@ export function getTriggerLimitOrderParams(
33
33
  }
34
34
 
35
35
  export function getMarketOrderParams(
36
- params: Omit<OptionalOrderParams, 'orderType' | 'marketType'>
36
+ params: Omit<OptionalOrderParams, 'orderType'>
37
37
  ): OptionalOrderParams {
38
38
  return Object.assign({}, params, {
39
39
  orderType: OrderType.MARKET,