@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
|
@@ -8060,6 +8060,13 @@ interface ChainStreamClientOptions {
|
|
|
8060
8060
|
debug?: boolean;
|
|
8061
8061
|
serverUrl?: string;
|
|
8062
8062
|
streamUrl?: string;
|
|
8063
|
+
/**
|
|
8064
|
+
* API key for X-API-KEY header authentication.
|
|
8065
|
+
* Sent as `X-API-KEY: <key>` instead of `Authorization: Bearer <token>`.
|
|
8066
|
+
* Use this OR walletSigner, not both. When set, the accessToken constructor
|
|
8067
|
+
* parameter is ignored.
|
|
8068
|
+
*/
|
|
8069
|
+
apiKey?: string;
|
|
8063
8070
|
/**
|
|
8064
8071
|
* Wallet signer for x402 wallet signature authentication.
|
|
8065
8072
|
* When provided, each request is signed with the wallet's private key
|
|
@@ -8060,6 +8060,13 @@ interface ChainStreamClientOptions {
|
|
|
8060
8060
|
debug?: boolean;
|
|
8061
8061
|
serverUrl?: string;
|
|
8062
8062
|
streamUrl?: string;
|
|
8063
|
+
/**
|
|
8064
|
+
* API key for X-API-KEY header authentication.
|
|
8065
|
+
* Sent as `X-API-KEY: <key>` instead of `Authorization: Bearer <token>`.
|
|
8066
|
+
* Use this OR walletSigner, not both. When set, the accessToken constructor
|
|
8067
|
+
* parameter is ignored.
|
|
8068
|
+
*/
|
|
8069
|
+
apiKey?: string;
|
|
8063
8070
|
/**
|
|
8064
8071
|
* Wallet signer for x402 wallet signature authentication.
|
|
8065
8072
|
* When provided, each request is signed with the wallet's private key
|
package/dist/chainstream.cjs
CHANGED
|
@@ -83,6 +83,8 @@ var configure = (options) => {
|
|
|
83
83
|
Object.entries(walletHeaders).forEach(([key, value]) => {
|
|
84
84
|
config.headers[key] = value;
|
|
85
85
|
});
|
|
86
|
+
} else if (options.apiKey) {
|
|
87
|
+
config.headers["X-API-KEY"] = options.apiKey;
|
|
86
88
|
} else if (options.accessToken) {
|
|
87
89
|
const token = typeof options.accessToken === "string" ? options.accessToken : await options.accessToken.getToken();
|
|
88
90
|
config.headers.Authorization = `Bearer ${token}`;
|
|
@@ -2359,7 +2361,8 @@ var ChainStreamClient = class {
|
|
|
2359
2361
|
const streamUrl = options.streamUrl ?? "wss://realtime-dex.chainstream.io/connection/websocket";
|
|
2360
2362
|
this.requestCtx = { baseUrl, streamUrl, accessToken };
|
|
2361
2363
|
configure({
|
|
2362
|
-
accessToken: options.walletSigner ? void 0 : accessToken,
|
|
2364
|
+
accessToken: options.walletSigner || options.apiKey ? void 0 : accessToken,
|
|
2365
|
+
apiKey: options.apiKey,
|
|
2363
2366
|
walletSigner: options.walletSigner,
|
|
2364
2367
|
basePath: baseUrl,
|
|
2365
2368
|
debugging: options.debug
|