@cowprotocol/sdk-bridging 0.2.3-beta.0 → 0.2.5-beta.0

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
@@ -1011,6 +1011,7 @@ declare class BungeeApi {
1011
1011
  }): Promise<BungeeEvent[]>;
1012
1012
  getAcrossStatus(depositTxHash: string): Promise<AcrossStatus>;
1013
1013
  private getSupportedBridges;
1014
+ private shouldAddAffiliate;
1014
1015
  private makeApiCall;
1015
1016
  }
1016
1017
 
package/dist/index.d.ts CHANGED
@@ -1011,6 +1011,7 @@ declare class BungeeApi {
1011
1011
  }): Promise<BungeeEvent[]>;
1012
1012
  getAcrossStatus(depositTxHash: string): Promise<AcrossStatus>;
1013
1013
  private getSupportedBridges;
1014
+ private shouldAddAffiliate;
1014
1015
  private makeApiCall;
1015
1016
  }
1016
1017
 
package/dist/index.js CHANGED
@@ -3680,6 +3680,10 @@ var BungeeApi = class {
3680
3680
  getSupportedBridges(bridges) {
3681
3681
  return bridges ?? this.options.includeBridges ?? SUPPORTED_BRIDGES;
3682
3682
  }
3683
+ shouldAddAffiliate(apiType, baseUrl) {
3684
+ const isBungeeApi = apiType === "bungee" || apiType === "bungee-manual";
3685
+ return !baseUrl.includes(BUNGEE_BASE_URL) && isBungeeApi;
3686
+ }
3683
3687
  async makeApiCall(apiType, path, params, isValidResponse) {
3684
3688
  const baseUrlMap = {
3685
3689
  bungee: this.options.apiBaseUrl || BUNGEE_API_URL,
@@ -3690,7 +3694,7 @@ var BungeeApi = class {
3690
3694
  const baseUrl = baseUrlMap[apiType];
3691
3695
  const url = `${baseUrl}${path}?${new URLSearchParams(params).toString()}`;
3692
3696
  const headers = {};
3693
- if (this.options.affiliate && !baseUrl.includes(BUNGEE_BASE_URL)) {
3697
+ if (this.shouldAddAffiliate(apiType, baseUrl) && this.options.affiliate) {
3694
3698
  headers["affiliate"] = this.options.affiliate;
3695
3699
  }
3696
3700
  (0, import_sdk_common12.log)(`Fetching ${apiType} API: GET ${url}. Params: ${JSON.stringify(params)}`);
package/dist/index.mjs CHANGED
@@ -3644,6 +3644,10 @@ var BungeeApi = class {
3644
3644
  getSupportedBridges(bridges) {
3645
3645
  return bridges ?? this.options.includeBridges ?? SUPPORTED_BRIDGES;
3646
3646
  }
3647
+ shouldAddAffiliate(apiType, baseUrl) {
3648
+ const isBungeeApi = apiType === "bungee" || apiType === "bungee-manual";
3649
+ return !baseUrl.includes(BUNGEE_BASE_URL) && isBungeeApi;
3650
+ }
3647
3651
  async makeApiCall(apiType, path, params, isValidResponse) {
3648
3652
  const baseUrlMap = {
3649
3653
  bungee: this.options.apiBaseUrl || BUNGEE_API_URL,
@@ -3654,7 +3658,7 @@ var BungeeApi = class {
3654
3658
  const baseUrl = baseUrlMap[apiType];
3655
3659
  const url = `${baseUrl}${path}?${new URLSearchParams(params).toString()}`;
3656
3660
  const headers = {};
3657
- if (this.options.affiliate && !baseUrl.includes(BUNGEE_BASE_URL)) {
3661
+ if (this.shouldAddAffiliate(apiType, baseUrl) && this.options.affiliate) {
3658
3662
  headers["affiliate"] = this.options.affiliate;
3659
3663
  }
3660
3664
  log5(`Fetching ${apiType} API: GET ${url}. Params: ${JSON.stringify(params)}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cowprotocol/sdk-bridging",
3
- "version": "0.2.3-beta.0",
3
+ "version": "0.2.5-beta.0",
4
4
  "description": "Bridging for CoW Protocol",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -14,14 +14,14 @@
14
14
  "access": "public"
15
15
  },
16
16
  "dependencies": {
17
- "@cowprotocol/sdk-app-data": "4.1.2-beta.0",
18
17
  "@cowprotocol/sdk-common": "0.3.0-beta.0",
19
- "@cowprotocol/sdk-config": "0.3.0-beta.0",
20
- "@cowprotocol/sdk-contracts-ts": "2.1.4-beta.0",
21
- "@cowprotocol/sdk-cow-shed": "0.2.2-beta.0",
22
- "@cowprotocol/sdk-order-book": "0.2.2-beta.0",
23
- "@cowprotocol/sdk-weiroll": "0.2.2-beta.0",
24
- "@cowprotocol/sdk-trading": "0.2.3-beta.0"
18
+ "@cowprotocol/sdk-config": "0.3.1-beta.0",
19
+ "@cowprotocol/sdk-app-data": "4.1.3-beta.0",
20
+ "@cowprotocol/sdk-contracts-ts": "2.1.6-beta.0",
21
+ "@cowprotocol/sdk-cow-shed": "0.2.4-beta.0",
22
+ "@cowprotocol/sdk-order-book": "0.2.3-beta.0",
23
+ "@cowprotocol/sdk-trading": "0.2.5-beta.0",
24
+ "@cowprotocol/sdk-weiroll": "0.2.3-beta.0"
25
25
  },
26
26
  "devDependencies": {
27
27
  "ethers-v5": "npm:ethers@^5.7.2",
@@ -36,11 +36,11 @@
36
36
  "ts-jest": "^29.0.0",
37
37
  "ethers": "^5.7.2",
38
38
  "viem": "^2.28.4",
39
- "@cowprotocol/sdk-order-signing": "0.2.2-beta.0",
40
- "@cowprotocol/sdk-ethers-v5-adapter": "0.2.2-beta.0",
41
- "@cowprotocol/sdk-viem-adapter": "0.2.2-beta.0",
39
+ "@cowprotocol/sdk-order-signing": "0.2.4-beta.0",
40
+ "@cow-sdk/typescript-config": "0.0.0-beta.0",
42
41
  "@cowprotocol/sdk-ethers-v6-adapter": "0.2.2-beta.0",
43
- "@cow-sdk/typescript-config": "0.0.0-beta.0"
42
+ "@cowprotocol/sdk-ethers-v5-adapter": "0.2.2-beta.0",
43
+ "@cowprotocol/sdk-viem-adapter": "0.2.2-beta.0"
44
44
  },
45
45
  "scripts": {
46
46
  "build": "tsup src/index.ts --format esm,cjs --dts",