@drift-labs/sdk 2.142.0-beta.6 → 2.142.0-beta.7
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.142.0-beta.
|
|
1
|
+
2.142.0-beta.7
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@drift-labs/sdk",
|
|
3
|
-
"version": "2.142.0-beta.
|
|
3
|
+
"version": "2.142.0-beta.7",
|
|
4
4
|
"main": "lib/node/index.js",
|
|
5
5
|
"types": "lib/node/index.d.ts",
|
|
6
|
-
"
|
|
6
|
+
"module": "./lib/browser/index.js",
|
|
7
7
|
"author": "crispheaney",
|
|
8
8
|
"homepage": "https://www.drift.trade/",
|
|
9
9
|
"repository": {
|
|
@@ -137,5 +137,11 @@
|
|
|
137
137
|
"chalk-template": "<1.1.1",
|
|
138
138
|
"supports-hyperlinks": "<4.1.1",
|
|
139
139
|
"has-ansi": "<6.0.1"
|
|
140
|
+
},
|
|
141
|
+
"browser": {
|
|
142
|
+
"helius-laserstream": false,
|
|
143
|
+
"@triton-one/yellowstone-grpc": false,
|
|
144
|
+
"@grpc/grpc-js": false,
|
|
145
|
+
"zstddec": false
|
|
140
146
|
}
|
|
141
147
|
}
|
|
@@ -27,8 +27,8 @@ export class grpcDriftClientAccountSubscriberV2 extends WebSocketDriftClientAcco
|
|
|
27
27
|
private perpMarketsSubscriber?: grpcMultiAccountSubscriber<PerpMarketAccount>;
|
|
28
28
|
private spotMarketsSubscriber?: grpcMultiAccountSubscriber<SpotMarketAccount>;
|
|
29
29
|
private oracleMultiSubscriber?: grpcMultiAccountSubscriber<OraclePriceData>;
|
|
30
|
-
private perpMarketIndexToAccountPubkeyMap = new Map<number,
|
|
31
|
-
private spotMarketIndexToAccountPubkeyMap = new Map<number,
|
|
30
|
+
private perpMarketIndexToAccountPubkeyMap = new Map<number, string>();
|
|
31
|
+
private spotMarketIndexToAccountPubkeyMap = new Map<number, string>();
|
|
32
32
|
|
|
33
33
|
constructor(
|
|
34
34
|
grpcConfigs: GrpcConfigs,
|
|
@@ -213,7 +213,7 @@ export class grpcDriftClientAccountSubscriberV2 extends WebSocketDriftClientAcco
|
|
|
213
213
|
marketIndex,
|
|
214
214
|
accountPubkey,
|
|
215
215
|
] of perpMarketIndexToAccountPubkeys) {
|
|
216
|
-
this.perpMarketIndexToAccountPubkeyMap.set(marketIndex, accountPubkey);
|
|
216
|
+
this.perpMarketIndexToAccountPubkeyMap.set(marketIndex, accountPubkey.toBase58());
|
|
217
217
|
}
|
|
218
218
|
|
|
219
219
|
const perpMarketPubkeys = perpMarketIndexToAccountPubkeys.map(
|
|
@@ -272,7 +272,7 @@ export class grpcDriftClientAccountSubscriberV2 extends WebSocketDriftClientAcco
|
|
|
272
272
|
marketIndex,
|
|
273
273
|
accountPubkey,
|
|
274
274
|
] of spotMarketIndexToAccountPubkeys) {
|
|
275
|
-
this.spotMarketIndexToAccountPubkeyMap.set(marketIndex, accountPubkey);
|
|
275
|
+
this.spotMarketIndexToAccountPubkeyMap.set(marketIndex, accountPubkey.toBase58());
|
|
276
276
|
}
|
|
277
277
|
|
|
278
278
|
const spotMarketPubkeys = spotMarketIndexToAccountPubkeys.map(
|
|
@@ -97,8 +97,8 @@ export class grpcMultiAccountSubscriber<T> {
|
|
|
97
97
|
this.dataMap.set(accountPubkey.toBase58(), { data, slot });
|
|
98
98
|
}
|
|
99
99
|
|
|
100
|
-
getAccountData(accountPubkey:
|
|
101
|
-
return this.dataMap.get(accountPubkey
|
|
100
|
+
getAccountData(accountPubkey: string): DataAndSlot<T> | undefined {
|
|
101
|
+
return this.dataMap.get(accountPubkey);
|
|
102
102
|
}
|
|
103
103
|
|
|
104
104
|
getAccountDataMap(): Map<string, DataAndSlot<T>> {
|