@zkp2p/sdk 0.5.7 → 0.5.8

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/index.mjs CHANGED
@@ -371,9 +371,11 @@ async function apiSignIntentV3(request, opts) {
371
371
  async () => {
372
372
  let res;
373
373
  try {
374
+ const headers2 = { "Content-Type": "application/json" };
375
+ if (opts.apiKey) headers2["x-api-key"] = opts.apiKey;
374
376
  res = await fetch(url, {
375
377
  method: "POST",
376
- headers: { "Content-Type": "application/json" },
378
+ headers: headers2,
377
379
  body: JSON.stringify(request)
378
380
  });
379
381
  } catch (error) {
@@ -1105,6 +1107,7 @@ var IntentOperations = class {
1105
1107
  if ((!gatingServiceSignature || !signatureExpiration) && baseApiUrl) {
1106
1108
  const apiOpts = {
1107
1109
  baseApiUrl,
1110
+ apiKey: this.config.getApiKey(),
1108
1111
  timeoutMs: this.config.getApiTimeoutMs()
1109
1112
  };
1110
1113
  const response = await apiSignIntentV3(
@@ -6729,6 +6732,7 @@ var Zkp2pClient = class {
6729
6732
  getChainId: () => this.chainId,
6730
6733
  getRuntimeEnv: () => this.runtimeEnv,
6731
6734
  getBaseApiUrl: () => this.baseApiUrl,
6735
+ getApiKey: () => this.apiKey,
6732
6736
  getApiTimeoutMs: () => this.apiTimeoutMs,
6733
6737
  getProtocolViewerAddress: () => this.protocolViewerAddress,
6734
6738
  getProtocolViewerAbi: () => this.protocolViewerAbi,