@cowprotocol/sdk-bridging 1.4.0 → 1.4.1

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.d.mts CHANGED
@@ -1272,6 +1272,7 @@ interface GetAttestationResponse {
1272
1272
  }
1273
1273
  declare class NearIntentsApi {
1274
1274
  private cachedTokens;
1275
+ constructor(apiKey?: string);
1275
1276
  getTokens(): Promise<TokenResponse[]>;
1276
1277
  getQuote(request: QuoteRequest): Promise<QuoteResponse>;
1277
1278
  getStatus(depositAddress: string): Promise<GetExecutionStatusResponse>;
@@ -1291,6 +1292,7 @@ interface NearIntentsQuoteResult extends BridgeQuoteResult {
1291
1292
  }
1292
1293
  interface NearIntentsBridgeProviderOptions {
1293
1294
  cowShedOptions?: CowShedSdkOptions;
1295
+ apiKey?: string;
1294
1296
  }
1295
1297
  declare class NearIntentsBridgeProvider implements ReceiverAccountBridgeProvider<NearIntentsQuoteResult> {
1296
1298
  type: "ReceiverAccountBridgeProvider";
package/dist/index.d.ts CHANGED
@@ -1272,6 +1272,7 @@ interface GetAttestationResponse {
1272
1272
  }
1273
1273
  declare class NearIntentsApi {
1274
1274
  private cachedTokens;
1275
+ constructor(apiKey?: string);
1275
1276
  getTokens(): Promise<TokenResponse[]>;
1276
1277
  getQuote(request: QuoteRequest): Promise<QuoteResponse>;
1277
1278
  getStatus(depositAddress: string): Promise<GetExecutionStatusResponse>;
@@ -1291,6 +1292,7 @@ interface NearIntentsQuoteResult extends BridgeQuoteResult {
1291
1292
  }
1292
1293
  interface NearIntentsBridgeProviderOptions {
1293
1294
  cowShedOptions?: CowShedSdkOptions;
1295
+ apiKey?: string;
1294
1296
  }
1295
1297
  declare class NearIntentsBridgeProvider implements ReceiverAccountBridgeProvider<NearIntentsQuoteResult> {
1296
1298
  type: "ReceiverAccountBridgeProvider";
package/dist/index.js CHANGED
@@ -4976,6 +4976,11 @@ var import_one_click_sdk_typescript2 = require("@defuse-protocol/one-click-sdk-t
4976
4976
  var import_one_click_sdk_typescript = require("@defuse-protocol/one-click-sdk-typescript");
4977
4977
  var NearIntentsApi = class {
4978
4978
  cachedTokens = [];
4979
+ constructor(apiKey) {
4980
+ if (apiKey) {
4981
+ import_one_click_sdk_typescript.OpenAPI.TOKEN = apiKey;
4982
+ }
4983
+ }
4979
4984
  async getTokens() {
4980
4985
  if (this.cachedTokens.length === 0) {
4981
4986
  const response = await import_one_click_sdk_typescript.OneClickService.getTokens();
@@ -5005,11 +5010,15 @@ var NearIntentsApi = class {
5005
5010
  return await import_one_click_sdk_typescript.OneClickService.getExecutionStatus(depositAddress);
5006
5011
  }
5007
5012
  async getAttestation(request) {
5013
+ const headers = {
5014
+ "Content-Type": "application/json"
5015
+ };
5016
+ if (import_one_click_sdk_typescript.OpenAPI.TOKEN) {
5017
+ headers["Authorization"] = `Bearer ${import_one_click_sdk_typescript.OpenAPI.TOKEN}`;
5018
+ }
5008
5019
  const response = await fetch(`${import_one_click_sdk_typescript.OpenAPI.BASE}/v0/attestation`, {
5009
5020
  method: "POST",
5010
- headers: {
5011
- "Content-Type": "application/json"
5012
- },
5021
+ headers,
5013
5022
  body: JSON.stringify(request)
5014
5023
  });
5015
5024
  if (!response.ok) {
@@ -5168,7 +5177,7 @@ var NearIntentsBridgeProvider = class {
5168
5177
  if (adapter) {
5169
5178
  (0, import_sdk_common18.setGlobalAdapter)(adapter);
5170
5179
  }
5171
- this.api = new NearIntentsApi();
5180
+ this.api = new NearIntentsApi(options?.apiKey);
5172
5181
  this.cowShedSdk = new import_sdk_cow_shed3.CowShedSdk(adapter, options?.cowShedOptions?.factoryOptions);
5173
5182
  }
5174
5183
  async getNetworks() {
package/dist/index.mjs CHANGED
@@ -4934,6 +4934,11 @@ import { QuoteRequest } from "@defuse-protocol/one-click-sdk-typescript";
4934
4934
  import { ApiError, OneClickService, OpenAPI } from "@defuse-protocol/one-click-sdk-typescript";
4935
4935
  var NearIntentsApi = class {
4936
4936
  cachedTokens = [];
4937
+ constructor(apiKey) {
4938
+ if (apiKey) {
4939
+ OpenAPI.TOKEN = apiKey;
4940
+ }
4941
+ }
4937
4942
  async getTokens() {
4938
4943
  if (this.cachedTokens.length === 0) {
4939
4944
  const response = await OneClickService.getTokens();
@@ -4963,11 +4968,15 @@ var NearIntentsApi = class {
4963
4968
  return await OneClickService.getExecutionStatus(depositAddress);
4964
4969
  }
4965
4970
  async getAttestation(request) {
4971
+ const headers = {
4972
+ "Content-Type": "application/json"
4973
+ };
4974
+ if (OpenAPI.TOKEN) {
4975
+ headers["Authorization"] = `Bearer ${OpenAPI.TOKEN}`;
4976
+ }
4966
4977
  const response = await fetch(`${OpenAPI.BASE}/v0/attestation`, {
4967
4978
  method: "POST",
4968
- headers: {
4969
- "Content-Type": "application/json"
4970
- },
4979
+ headers,
4971
4980
  body: JSON.stringify(request)
4972
4981
  });
4973
4982
  if (!response.ok) {
@@ -5126,7 +5135,7 @@ var NearIntentsBridgeProvider = class {
5126
5135
  if (adapter) {
5127
5136
  setGlobalAdapter4(adapter);
5128
5137
  }
5129
- this.api = new NearIntentsApi();
5138
+ this.api = new NearIntentsApi(options?.apiKey);
5130
5139
  this.cowShedSdk = new CowShedSdk3(adapter, options?.cowShedOptions?.factoryOptions);
5131
5140
  }
5132
5141
  async getNetworks() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cowprotocol/sdk-bridging",
3
- "version": "1.4.0",
3
+ "version": "1.4.1",
4
4
  "description": "Bridging for CoW Protocol",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -19,11 +19,11 @@
19
19
  "@cowprotocol/sdk-app-data": "4.5.1",
20
20
  "@cowprotocol/sdk-common": "0.5.0",
21
21
  "@cowprotocol/sdk-config": "0.6.3",
22
- "@cowprotocol/sdk-contracts-ts": "1.1.0",
22
+ "@cowprotocol/sdk-contracts-ts": "1.1.1",
23
23
  "@cowprotocol/sdk-order-book": "0.5.1",
24
- "@cowprotocol/sdk-cow-shed": "0.2.10",
24
+ "@cowprotocol/sdk-trading": "0.8.2",
25
25
  "@cowprotocol/sdk-weiroll": "0.1.12",
26
- "@cowprotocol/sdk-trading": "0.8.1"
26
+ "@cowprotocol/sdk-cow-shed": "0.2.11"
27
27
  },
28
28
  "devDependencies": {
29
29
  "@types/jest": "^29.4.0",
@@ -40,9 +40,9 @@
40
40
  "viem": "^2.28.4",
41
41
  "@cow-sdk/typescript-config": "0.0.0-beta.0",
42
42
  "@cowprotocol/sdk-ethers-v5-adapter": "0.3.1",
43
- "@cowprotocol/sdk-order-signing": "0.1.24",
44
- "@cowprotocol/sdk-viem-adapter": "0.3.1",
45
- "@cowprotocol/sdk-ethers-v6-adapter": "0.3.1"
43
+ "@cowprotocol/sdk-ethers-v6-adapter": "0.3.1",
44
+ "@cowprotocol/sdk-order-signing": "0.1.25",
45
+ "@cowprotocol/sdk-viem-adapter": "0.3.1"
46
46
  },
47
47
  "scripts": {
48
48
  "build": "tsup src/index.ts --format esm,cjs --dts",