@drift-labs/sdk 2.97.0-beta.4 → 2.97.0-beta.6
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/config.d.ts +1 -1
- package/lib/config.js +5 -3
- package/lib/constants/perpMarkets.js +20 -0
- package/package.json +1 -1
- package/src/config.ts +12 -3
- package/src/constants/perpMarkets.ts +20 -0
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
2.97.0-beta.
|
|
1
|
+
2.97.0-beta.6
|
package/lib/config.d.ts
CHANGED
|
@@ -43,7 +43,7 @@ export declare const initialize: (props: {
|
|
|
43
43
|
env: DriftEnv;
|
|
44
44
|
overrideEnv?: Partial<DriftConfig>;
|
|
45
45
|
}) => DriftConfig;
|
|
46
|
-
export declare function getMarketsAndOraclesForSubscription(env: DriftEnv): {
|
|
46
|
+
export declare function getMarketsAndOraclesForSubscription(env: DriftEnv, perpMarkets?: PerpMarketConfig[], spotMarkets?: SpotMarketConfig[]): {
|
|
47
47
|
perpMarketIndexes: number[];
|
|
48
48
|
spotMarketIndexes: number[];
|
|
49
49
|
oracleInfos: OracleInfo[];
|
package/lib/config.js
CHANGED
|
@@ -66,18 +66,20 @@ const initialize = (props) => {
|
|
|
66
66
|
return currentConfig;
|
|
67
67
|
};
|
|
68
68
|
exports.initialize = initialize;
|
|
69
|
-
function getMarketsAndOraclesForSubscription(env) {
|
|
69
|
+
function getMarketsAndOraclesForSubscription(env, perpMarkets, spotMarkets) {
|
|
70
|
+
const perpMarketsToUse = (perpMarkets === null || perpMarkets === void 0 ? void 0 : perpMarkets.length) > 0 ? perpMarkets : perpMarkets_1.PerpMarkets[env];
|
|
71
|
+
const spotMarketsToUse = (spotMarkets === null || spotMarkets === void 0 ? void 0 : spotMarkets.length) > 0 ? spotMarkets : spotMarkets_1.SpotMarkets[env];
|
|
70
72
|
const perpMarketIndexes = [];
|
|
71
73
|
const spotMarketIndexes = [];
|
|
72
74
|
const oracleInfos = new Map();
|
|
73
|
-
for (const market of
|
|
75
|
+
for (const market of perpMarketsToUse) {
|
|
74
76
|
perpMarketIndexes.push(market.marketIndex);
|
|
75
77
|
oracleInfos.set(market.oracle.toString(), {
|
|
76
78
|
publicKey: market.oracle,
|
|
77
79
|
source: market.oracleSource,
|
|
78
80
|
});
|
|
79
81
|
}
|
|
80
|
-
for (const spotMarket of
|
|
82
|
+
for (const spotMarket of spotMarketsToUse) {
|
|
81
83
|
spotMarketIndexes.push(spotMarket.marketIndex);
|
|
82
84
|
oracleInfos.set(spotMarket.oracle.toString(), {
|
|
83
85
|
publicKey: spotMarket.oracle,
|
|
@@ -820,6 +820,26 @@ exports.MainnetPerpMarkets = [
|
|
|
820
820
|
launchTs: 1727965864000,
|
|
821
821
|
oracleSource: __1.OracleSource.Prelaunch,
|
|
822
822
|
},
|
|
823
|
+
{
|
|
824
|
+
fullName: 'DeBridge',
|
|
825
|
+
category: ['Bridge'],
|
|
826
|
+
symbol: 'DBR-PERP',
|
|
827
|
+
baseAssetSymbol: 'DBR',
|
|
828
|
+
marketIndex: 47,
|
|
829
|
+
oracle: new web3_js_1.PublicKey('AQzxePg2vY52Cw4di1j5xF7BqetNPxogqYPgDBL7HXWn'),
|
|
830
|
+
launchTs: 1728574493000,
|
|
831
|
+
oracleSource: __1.OracleSource.Prelaunch,
|
|
832
|
+
},
|
|
833
|
+
{
|
|
834
|
+
fullName: 'WLF-5B-1W',
|
|
835
|
+
category: ['Prediction'],
|
|
836
|
+
symbol: 'WLF-5B-1W-BET',
|
|
837
|
+
baseAssetSymbol: 'WLF-5B-1W',
|
|
838
|
+
marketIndex: 48,
|
|
839
|
+
oracle: new web3_js_1.PublicKey('7LpRfPaWR7cQqN7CMkCmZjEQpWyqso5LGuKCvDXH5ZAr'),
|
|
840
|
+
launchTs: 1728574493000,
|
|
841
|
+
oracleSource: __1.OracleSource.Prelaunch,
|
|
842
|
+
},
|
|
823
843
|
];
|
|
824
844
|
exports.PerpMarkets = {
|
|
825
845
|
devnet: exports.DevnetPerpMarkets,
|
package/package.json
CHANGED
package/src/config.ts
CHANGED
|
@@ -114,16 +114,25 @@ export const initialize = (props: {
|
|
|
114
114
|
return currentConfig;
|
|
115
115
|
};
|
|
116
116
|
|
|
117
|
-
export function getMarketsAndOraclesForSubscription(
|
|
117
|
+
export function getMarketsAndOraclesForSubscription(
|
|
118
|
+
env: DriftEnv,
|
|
119
|
+
perpMarkets?: PerpMarketConfig[],
|
|
120
|
+
spotMarkets?: SpotMarketConfig[]
|
|
121
|
+
): {
|
|
118
122
|
perpMarketIndexes: number[];
|
|
119
123
|
spotMarketIndexes: number[];
|
|
120
124
|
oracleInfos: OracleInfo[];
|
|
121
125
|
} {
|
|
126
|
+
const perpMarketsToUse =
|
|
127
|
+
perpMarkets?.length > 0 ? perpMarkets : PerpMarkets[env];
|
|
128
|
+
const spotMarketsToUse =
|
|
129
|
+
spotMarkets?.length > 0 ? spotMarkets : SpotMarkets[env];
|
|
130
|
+
|
|
122
131
|
const perpMarketIndexes = [];
|
|
123
132
|
const spotMarketIndexes = [];
|
|
124
133
|
const oracleInfos = new Map<string, OracleInfo>();
|
|
125
134
|
|
|
126
|
-
for (const market of
|
|
135
|
+
for (const market of perpMarketsToUse) {
|
|
127
136
|
perpMarketIndexes.push(market.marketIndex);
|
|
128
137
|
oracleInfos.set(market.oracle.toString(), {
|
|
129
138
|
publicKey: market.oracle,
|
|
@@ -131,7 +140,7 @@ export function getMarketsAndOraclesForSubscription(env: DriftEnv): {
|
|
|
131
140
|
});
|
|
132
141
|
}
|
|
133
142
|
|
|
134
|
-
for (const spotMarket of
|
|
143
|
+
for (const spotMarket of spotMarketsToUse) {
|
|
135
144
|
spotMarketIndexes.push(spotMarket.marketIndex);
|
|
136
145
|
oracleInfos.set(spotMarket.oracle.toString(), {
|
|
137
146
|
publicKey: spotMarket.oracle,
|
|
@@ -896,6 +896,26 @@ export const MainnetPerpMarkets: PerpMarketConfig[] = [
|
|
|
896
896
|
launchTs: 1727965864000,
|
|
897
897
|
oracleSource: OracleSource.Prelaunch,
|
|
898
898
|
},
|
|
899
|
+
{
|
|
900
|
+
fullName: 'DeBridge',
|
|
901
|
+
category: ['Bridge'],
|
|
902
|
+
symbol: 'DBR-PERP',
|
|
903
|
+
baseAssetSymbol: 'DBR',
|
|
904
|
+
marketIndex: 47,
|
|
905
|
+
oracle: new PublicKey('AQzxePg2vY52Cw4di1j5xF7BqetNPxogqYPgDBL7HXWn'),
|
|
906
|
+
launchTs: 1728574493000,
|
|
907
|
+
oracleSource: OracleSource.Prelaunch,
|
|
908
|
+
},
|
|
909
|
+
{
|
|
910
|
+
fullName: 'WLF-5B-1W',
|
|
911
|
+
category: ['Prediction'],
|
|
912
|
+
symbol: 'WLF-5B-1W-BET',
|
|
913
|
+
baseAssetSymbol: 'WLF-5B-1W',
|
|
914
|
+
marketIndex: 48,
|
|
915
|
+
oracle: new PublicKey('7LpRfPaWR7cQqN7CMkCmZjEQpWyqso5LGuKCvDXH5ZAr'),
|
|
916
|
+
launchTs: 1728574493000,
|
|
917
|
+
oracleSource: OracleSource.Prelaunch,
|
|
918
|
+
},
|
|
899
919
|
];
|
|
900
920
|
|
|
901
921
|
export const PerpMarkets: { [key in DriftEnv]: PerpMarketConfig[] } = {
|