@chainstream-io/sdk 2.0.8 → 2.0.9
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/dist/{chainstream-Dwm2QHpn.d.cts → chainstream-LmorAvq7.d.cts} +7 -0
- package/dist/{chainstream-Dwm2QHpn.d.ts → chainstream-LmorAvq7.d.ts} +7 -0
- package/dist/chainstream.cjs +4 -1
- package/dist/chainstream.cjs.map +1 -1
- package/dist/chainstream.d.cts +1 -1
- package/dist/chainstream.d.ts +1 -1
- package/dist/chainstream.mjs +4 -1
- package/dist/chainstream.mjs.map +1 -1
- package/dist/index.cjs +4 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +4 -1
- package/dist/index.mjs.map +1 -1
- package/dist/stream/index.d.cts +1 -1
- package/dist/stream/index.d.ts +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -234,6 +234,8 @@ var configure = (options) => {
|
|
|
234
234
|
Object.entries(walletHeaders).forEach(([key, value]) => {
|
|
235
235
|
config.headers[key] = value;
|
|
236
236
|
});
|
|
237
|
+
} else if (options.apiKey) {
|
|
238
|
+
config.headers["X-API-KEY"] = options.apiKey;
|
|
237
239
|
} else if (options.accessToken) {
|
|
238
240
|
const token = typeof options.accessToken === "string" ? options.accessToken : await options.accessToken.getToken();
|
|
239
241
|
config.headers.Authorization = `Bearer ${token}`;
|
|
@@ -2553,7 +2555,8 @@ var ChainStreamClient = class {
|
|
|
2553
2555
|
const streamUrl = options.streamUrl ?? "wss://realtime-dex.chainstream.io/connection/websocket";
|
|
2554
2556
|
this.requestCtx = { baseUrl, streamUrl, accessToken };
|
|
2555
2557
|
configure({
|
|
2556
|
-
accessToken: options.walletSigner ? void 0 : accessToken,
|
|
2558
|
+
accessToken: options.walletSigner || options.apiKey ? void 0 : accessToken,
|
|
2559
|
+
apiKey: options.apiKey,
|
|
2557
2560
|
walletSigner: options.walletSigner,
|
|
2558
2561
|
basePath: baseUrl,
|
|
2559
2562
|
debugging: options.debug
|