@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.
@@ -1,2 +1,2 @@
1
- export { C as ChainStreamClient, y as ChainStreamClientOptions, z as ChainStreamRequestContext, gI as PostOptions, T as TokenProvider } from './chainstream-Dwm2QHpn.cjs';
1
+ export { C as ChainStreamClient, y as ChainStreamClientOptions, z as ChainStreamRequestContext, gI as PostOptions, T as TokenProvider } from './chainstream-LmorAvq7.cjs';
2
2
  import 'axios';
@@ -1,2 +1,2 @@
1
- export { C as ChainStreamClient, y as ChainStreamClientOptions, z as ChainStreamRequestContext, gI as PostOptions, T as TokenProvider } from './chainstream-Dwm2QHpn.js';
1
+ export { C as ChainStreamClient, y as ChainStreamClientOptions, z as ChainStreamRequestContext, gI as PostOptions, T as TokenProvider } from './chainstream-LmorAvq7.js';
2
2
  import 'axios';
@@ -55,6 +55,8 @@ var configure = (options) => {
55
55
  Object.entries(walletHeaders).forEach(([key, value]) => {
56
56
  config.headers[key] = value;
57
57
  });
58
+ } else if (options.apiKey) {
59
+ config.headers["X-API-KEY"] = options.apiKey;
58
60
  } else if (options.accessToken) {
59
61
  const token = typeof options.accessToken === "string" ? options.accessToken : await options.accessToken.getToken();
60
62
  config.headers.Authorization = `Bearer ${token}`;
@@ -2331,7 +2333,8 @@ var ChainStreamClient = class {
2331
2333
  const streamUrl = options.streamUrl ?? "wss://realtime-dex.chainstream.io/connection/websocket";
2332
2334
  this.requestCtx = { baseUrl, streamUrl, accessToken };
2333
2335
  configure({
2334
- accessToken: options.walletSigner ? void 0 : accessToken,
2336
+ accessToken: options.walletSigner || options.apiKey ? void 0 : accessToken,
2337
+ apiKey: options.apiKey,
2335
2338
  walletSigner: options.walletSigner,
2336
2339
  basePath: baseUrl,
2337
2340
  debugging: options.debug