@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.cjs CHANGED
@@ -42314,9 +42314,11 @@ async function apiSignIntentV3(request, opts) {
42314
42314
  async () => {
42315
42315
  let res;
42316
42316
  try {
42317
+ const headers2 = { "Content-Type": "application/json" };
42318
+ if (opts.apiKey) headers2["x-api-key"] = opts.apiKey;
42317
42319
  res = await fetch(url, {
42318
42320
  method: "POST",
42319
- headers: { "Content-Type": "application/json" },
42321
+ headers: headers2,
42320
42322
  body: JSON.stringify(request)
42321
42323
  });
42322
42324
  } catch (error) {
@@ -43061,6 +43063,7 @@ var IntentOperations = class {
43061
43063
  if ((!gatingServiceSignature || !signatureExpiration) && baseApiUrl) {
43062
43064
  const apiOpts = {
43063
43065
  baseApiUrl,
43066
+ apiKey: this.config.getApiKey(),
43064
43067
  timeoutMs: this.config.getApiTimeoutMs()
43065
43068
  };
43066
43069
  const response = await apiSignIntentV3(
@@ -48699,6 +48702,7 @@ var Zkp2pClient = class {
48699
48702
  getChainId: () => this.chainId,
48700
48703
  getRuntimeEnv: () => this.runtimeEnv,
48701
48704
  getBaseApiUrl: () => this.baseApiUrl,
48705
+ getApiKey: () => this.apiKey,
48702
48706
  getApiTimeoutMs: () => this.apiTimeoutMs,
48703
48707
  getProtocolViewerAddress: () => this.protocolViewerAddress,
48704
48708
  getProtocolViewerAbi: () => this.protocolViewerAbi,