@drift-labs/sdk 0.1.25-master.0 → 0.1.26

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.
@@ -1,6 +1,8 @@
1
1
  /// <reference types="bn.js" />
2
2
  import { BN, OracleSource } from '../';
3
3
  export declare type MarketConfig = {
4
+ fullName?: string;
5
+ category?: string[];
4
6
  symbol: string;
5
7
  baseAssetSymbol: string;
6
8
  marketIndex: BN;
@@ -4,6 +4,8 @@ exports.Markets = void 0;
4
4
  const __1 = require("../");
5
5
  exports.Markets = [
6
6
  {
7
+ fullName: 'Solana',
8
+ category: ['L1', 'Infra'],
7
9
  symbol: 'SOL-PERP',
8
10
  baseAssetSymbol: 'SOL',
9
11
  marketIndex: new __1.BN(0),
@@ -13,6 +15,8 @@ exports.Markets = [
13
15
  oracleSource: __1.OracleSource.PYTH,
14
16
  },
15
17
  {
18
+ fullName: 'Bitcoin',
19
+ category: ['L1', 'Payment'],
16
20
  symbol: 'BTC-PERP',
17
21
  baseAssetSymbol: 'BTC',
18
22
  marketIndex: new __1.BN(1),
@@ -22,6 +26,8 @@ exports.Markets = [
22
26
  oracleSource: __1.OracleSource.PYTH,
23
27
  },
24
28
  {
29
+ fullName: 'Ethereum',
30
+ category: ['L1', 'Infra'],
25
31
  symbol: 'ETH-PERP',
26
32
  baseAssetSymbol: 'ETH',
27
33
  marketIndex: new __1.BN(2),
@@ -31,6 +37,8 @@ exports.Markets = [
31
37
  oracleSource: __1.OracleSource.PYTH,
32
38
  },
33
39
  {
40
+ fullName: 'Terra',
41
+ category: ['L1', 'Infra'],
34
42
  symbol: 'LUNA-PERP',
35
43
  baseAssetSymbol: 'LUNA',
36
44
  marketIndex: new __1.BN(3),
@@ -41,6 +49,7 @@ exports.Markets = [
41
49
  },
42
50
  {
43
51
  symbol: 'AVAX-PERP',
52
+ category: ['L1', 'Infra'],
44
53
  baseAssetSymbol: 'AVAX',
45
54
  marketIndex: new __1.BN(4),
46
55
  devnetPythOracle: 'FVb5h1VmHPfVb1RfqZckchq18GxRv4iKt8T4eVTQAqdz',
@@ -49,7 +58,9 @@ exports.Markets = [
49
58
  oracleSource: __1.OracleSource.PYTH,
50
59
  },
51
60
  {
61
+ fullName: 'Binance Coin',
52
62
  symbol: 'BNB-PERP',
63
+ category: ['L1', 'Exchange'],
53
64
  baseAssetSymbol: 'BNB',
54
65
  marketIndex: new __1.BN(5),
55
66
  devnetPythOracle: 'GwzBgrXb4PG59zjce24SF2b9JXbLEjJJTBkmytuEZj1b',
@@ -58,6 +69,8 @@ exports.Markets = [
58
69
  oracleSource: __1.OracleSource.PYTH,
59
70
  },
60
71
  {
72
+ fullName: 'Polygon',
73
+ category: ['L1', 'Infra'],
61
74
  symbol: 'MATIC-PERP',
62
75
  baseAssetSymbol: 'MATIC',
63
76
  marketIndex: new __1.BN(6),
@@ -67,6 +80,8 @@ exports.Markets = [
67
80
  oracleSource: __1.OracleSource.PYTH,
68
81
  },
69
82
  {
83
+ fullName: 'Cosmos',
84
+ category: ['L1', 'Infra'],
70
85
  symbol: 'ATOM-PERP',
71
86
  baseAssetSymbol: 'ATOM',
72
87
  marketIndex: new __1.BN(7),
@@ -76,6 +91,7 @@ exports.Markets = [
76
91
  oracleSource: __1.OracleSource.PYTH,
77
92
  },
78
93
  {
94
+ fullName: 'Polkadot',
79
95
  symbol: 'DOT-PERP',
80
96
  baseAssetSymbol: 'DOT',
81
97
  marketIndex: new __1.BN(8),
@@ -85,6 +101,8 @@ exports.Markets = [
85
101
  oracleSource: __1.OracleSource.PYTH,
86
102
  },
87
103
  {
104
+ fullName: 'Cardano',
105
+ category: ['L1', 'Infra'],
88
106
  symbol: 'ADA-PERP',
89
107
  baseAssetSymbol: 'ADA',
90
108
  marketIndex: new __1.BN(9),
@@ -94,6 +112,8 @@ exports.Markets = [
94
112
  oracleSource: __1.OracleSource.PYTH,
95
113
  },
96
114
  {
115
+ fullName: 'Algorand',
116
+ category: ['L1', 'Infra'],
97
117
  symbol: 'ALGO-PERP',
98
118
  baseAssetSymbol: 'ALGO',
99
119
  marketIndex: new __1.BN(10),
@@ -103,6 +123,8 @@ exports.Markets = [
103
123
  oracleSource: __1.OracleSource.PYTH,
104
124
  },
105
125
  {
126
+ fullName: 'FTX Coin',
127
+ category: ['L1', 'Exchange'],
106
128
  symbol: 'FTT-PERP',
107
129
  baseAssetSymbol: 'FTT',
108
130
  marketIndex: new __1.BN(11),
@@ -112,6 +134,8 @@ exports.Markets = [
112
134
  oracleSource: __1.OracleSource.PYTH,
113
135
  },
114
136
  {
137
+ fullName: 'Litecoin',
138
+ category: ['L1', 'Payments'],
115
139
  symbol: 'LTC-PERP',
116
140
  baseAssetSymbol: 'LTC',
117
141
  marketIndex: new __1.BN(12),
@@ -121,6 +145,8 @@ exports.Markets = [
121
145
  oracleSource: __1.OracleSource.PYTH,
122
146
  },
123
147
  {
148
+ fullName: 'Ripple',
149
+ category: ['L1', 'Payments'],
124
150
  symbol: 'XRP-PERP',
125
151
  baseAssetSymbol: 'XRP',
126
152
  marketIndex: new __1.BN(13),
@@ -4180,6 +4180,11 @@
4180
4180
  "code": 6057,
4181
4181
  "name": "InvalidMarginRatio",
4182
4182
  "msg": "Invalid Margin Ratio"
4183
+ },
4184
+ {
4185
+ "code": 6058,
4186
+ "name": "CantCancelPostOnlyOrder",
4187
+ "msg": "Cant Cancel Post Only Order"
4183
4188
  }
4184
4189
  ]
4185
4190
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@drift-labs/sdk",
3
- "version": "0.1.25-master.0",
3
+ "version": "0.1.26",
4
4
  "main": "lib/index.js",
5
5
  "types": "lib/index.d.ts",
6
6
  "author": "crispheaney",
@@ -1,6 +1,8 @@
1
1
  import { BN, OracleSource } from '../';
2
2
 
3
3
  export type MarketConfig = {
4
+ fullName?: string;
5
+ category?: string[];
4
6
  symbol: string;
5
7
  baseAssetSymbol: string;
6
8
  marketIndex: BN;
@@ -12,6 +14,8 @@ export type MarketConfig = {
12
14
 
13
15
  export const Markets: MarketConfig[] = [
14
16
  {
17
+ fullName: 'Solana',
18
+ category: ['L1', 'Infra'],
15
19
  symbol: 'SOL-PERP',
16
20
  baseAssetSymbol: 'SOL',
17
21
  marketIndex: new BN(0),
@@ -21,6 +25,8 @@ export const Markets: MarketConfig[] = [
21
25
  oracleSource: OracleSource.PYTH,
22
26
  },
23
27
  {
28
+ fullName: 'Bitcoin',
29
+ category: ['L1', 'Payment'],
24
30
  symbol: 'BTC-PERP',
25
31
  baseAssetSymbol: 'BTC',
26
32
  marketIndex: new BN(1),
@@ -30,6 +36,8 @@ export const Markets: MarketConfig[] = [
30
36
  oracleSource: OracleSource.PYTH,
31
37
  },
32
38
  {
39
+ fullName: 'Ethereum',
40
+ category: ['L1', 'Infra'],
33
41
  symbol: 'ETH-PERP',
34
42
  baseAssetSymbol: 'ETH',
35
43
  marketIndex: new BN(2),
@@ -39,6 +47,8 @@ export const Markets: MarketConfig[] = [
39
47
  oracleSource: OracleSource.PYTH,
40
48
  },
41
49
  {
50
+ fullName: 'Terra',
51
+ category: ['L1', 'Infra'],
42
52
  symbol: 'LUNA-PERP',
43
53
  baseAssetSymbol: 'LUNA',
44
54
  marketIndex: new BN(3),
@@ -49,6 +59,7 @@ export const Markets: MarketConfig[] = [
49
59
  },
50
60
  {
51
61
  symbol: 'AVAX-PERP',
62
+ category: ['L1', 'Infra'],
52
63
  baseAssetSymbol: 'AVAX',
53
64
  marketIndex: new BN(4),
54
65
  devnetPythOracle: 'FVb5h1VmHPfVb1RfqZckchq18GxRv4iKt8T4eVTQAqdz',
@@ -57,7 +68,9 @@ export const Markets: MarketConfig[] = [
57
68
  oracleSource: OracleSource.PYTH,
58
69
  },
59
70
  {
71
+ fullName: 'Binance Coin',
60
72
  symbol: 'BNB-PERP',
73
+ category: ['L1', 'Exchange'],
61
74
  baseAssetSymbol: 'BNB',
62
75
  marketIndex: new BN(5),
63
76
  devnetPythOracle: 'GwzBgrXb4PG59zjce24SF2b9JXbLEjJJTBkmytuEZj1b',
@@ -66,6 +79,8 @@ export const Markets: MarketConfig[] = [
66
79
  oracleSource: OracleSource.PYTH,
67
80
  },
68
81
  {
82
+ fullName: 'Polygon',
83
+ category: ['L1', 'Infra'],
69
84
  symbol: 'MATIC-PERP',
70
85
  baseAssetSymbol: 'MATIC',
71
86
  marketIndex: new BN(6),
@@ -75,6 +90,8 @@ export const Markets: MarketConfig[] = [
75
90
  oracleSource: OracleSource.PYTH,
76
91
  },
77
92
  {
93
+ fullName: 'Cosmos',
94
+ category: ['L1', 'Infra'],
78
95
  symbol: 'ATOM-PERP',
79
96
  baseAssetSymbol: 'ATOM',
80
97
  marketIndex: new BN(7),
@@ -84,6 +101,7 @@ export const Markets: MarketConfig[] = [
84
101
  oracleSource: OracleSource.PYTH,
85
102
  },
86
103
  {
104
+ fullName: 'Polkadot',
87
105
  symbol: 'DOT-PERP',
88
106
  baseAssetSymbol: 'DOT',
89
107
  marketIndex: new BN(8),
@@ -93,6 +111,8 @@ export const Markets: MarketConfig[] = [
93
111
  oracleSource: OracleSource.PYTH,
94
112
  },
95
113
  {
114
+ fullName: 'Cardano',
115
+ category: ['L1', 'Infra'],
96
116
  symbol: 'ADA-PERP',
97
117
  baseAssetSymbol: 'ADA',
98
118
  marketIndex: new BN(9),
@@ -102,6 +122,8 @@ export const Markets: MarketConfig[] = [
102
122
  oracleSource: OracleSource.PYTH,
103
123
  },
104
124
  {
125
+ fullName: 'Algorand',
126
+ category: ['L1', 'Infra'],
105
127
  symbol: 'ALGO-PERP',
106
128
  baseAssetSymbol: 'ALGO',
107
129
  marketIndex: new BN(10),
@@ -111,6 +133,8 @@ export const Markets: MarketConfig[] = [
111
133
  oracleSource: OracleSource.PYTH,
112
134
  },
113
135
  {
136
+ fullName: 'FTX Coin',
137
+ category: ['L1', 'Exchange'],
114
138
  symbol: 'FTT-PERP',
115
139
  baseAssetSymbol: 'FTT',
116
140
  marketIndex: new BN(11),
@@ -120,6 +144,8 @@ export const Markets: MarketConfig[] = [
120
144
  oracleSource: OracleSource.PYTH,
121
145
  },
122
146
  {
147
+ fullName: 'Litecoin',
148
+ category: ['L1', 'Payments'],
123
149
  symbol: 'LTC-PERP',
124
150
  baseAssetSymbol: 'LTC',
125
151
  marketIndex: new BN(12),
@@ -129,6 +155,8 @@ export const Markets: MarketConfig[] = [
129
155
  oracleSource: OracleSource.PYTH,
130
156
  },
131
157
  {
158
+ fullName: 'Ripple',
159
+ category: ['L1', 'Payments'],
132
160
  symbol: 'XRP-PERP',
133
161
  baseAssetSymbol: 'XRP',
134
162
  marketIndex: new BN(13),
@@ -4180,6 +4180,11 @@
4180
4180
  "code": 6057,
4181
4181
  "name": "InvalidMarginRatio",
4182
4182
  "msg": "Invalid Margin Ratio"
4183
+ },
4184
+ {
4185
+ "code": 6058,
4186
+ "name": "CantCancelPostOnlyOrder",
4187
+ "msg": "Cant Cancel Post Only Order"
4183
4188
  }
4184
4189
  ]
4185
4190
  }