@cowprotocol/sdk-bridging 0.3.1 → 0.3.2

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
@@ -5,29 +5,6 @@ import { QuoterParameters, TraderParameters, TradeOptionalParameters, QuoteAndPo
5
5
  import { AccountAddress, SignerLike, AbstractProviderAdapter } from '@cowprotocol/sdk-common';
6
6
  import { CowShedSdk, CowShedSdkOptions } from '@cowprotocol/sdk-cow-shed';
7
7
 
8
- declare enum BridgeQuoteErrors {
9
- NO_INTERMEDIATE_TOKENS = "NO_INTERMEDIATE_TOKENS",
10
- API_ERROR = "API_ERROR",
11
- INVALID_API_JSON_RESPONSE = "INVALID_API_JSON_RESPONSE",
12
- ONLY_SELL_ORDER_SUPPORTED = "ONLY_SELL_ORDER_SUPPORTED",
13
- TX_BUILD_ERROR = "TX_BUILD_ERROR",
14
- QUOTE_ERROR = "QUOTE_ERROR",
15
- NO_ROUTES = "NO_ROUTES",
16
- INVALID_BRIDGE = "INVALID_BRIDGE"
17
- }
18
- declare class BridgeProviderQuoteError extends Error {
19
- readonly context?: unknown | undefined;
20
- constructor(message: BridgeQuoteErrors, context?: unknown | undefined);
21
- }
22
- declare class BridgeProviderError extends Error {
23
- readonly context: unknown;
24
- constructor(message: string, context: unknown);
25
- }
26
- declare class BridgeOrderParsingError extends Error {
27
- readonly context?: unknown | undefined;
28
- constructor(message: string, context?: unknown | undefined);
29
- }
30
-
31
8
  interface BridgeProviderInfo {
32
9
  name: string;
33
10
  logoUrl: string;
@@ -353,7 +330,7 @@ interface CrossChainOrder {
353
330
  interface MultiQuoteResult {
354
331
  providerDappId: string;
355
332
  quote: BridgeQuoteAndPost | null;
356
- error?: BridgeProviderQuoteError | BridgeProviderError;
333
+ error?: Error;
357
334
  }
358
335
  /**
359
336
  * Callback function called when a quote result is available from a provider
@@ -410,6 +387,29 @@ interface BestQuoteProviderContext extends MultiQuoteContext {
410
387
  };
411
388
  }
412
389
 
390
+ declare enum BridgeQuoteErrors {
391
+ NO_INTERMEDIATE_TOKENS = "NO_INTERMEDIATE_TOKENS",
392
+ API_ERROR = "API_ERROR",
393
+ INVALID_API_JSON_RESPONSE = "INVALID_API_JSON_RESPONSE",
394
+ ONLY_SELL_ORDER_SUPPORTED = "ONLY_SELL_ORDER_SUPPORTED",
395
+ TX_BUILD_ERROR = "TX_BUILD_ERROR",
396
+ QUOTE_ERROR = "QUOTE_ERROR",
397
+ NO_ROUTES = "NO_ROUTES",
398
+ INVALID_BRIDGE = "INVALID_BRIDGE"
399
+ }
400
+ declare class BridgeProviderQuoteError extends Error {
401
+ readonly context?: unknown | undefined;
402
+ constructor(message: BridgeQuoteErrors, context?: unknown | undefined);
403
+ }
404
+ declare class BridgeProviderError extends Error {
405
+ readonly context: unknown;
406
+ constructor(message: string, context: unknown);
407
+ }
408
+ declare class BridgeOrderParsingError extends Error {
409
+ readonly context?: unknown | undefined;
410
+ constructor(message: string, context?: unknown | undefined);
411
+ }
412
+
413
413
  declare function isBridgeQuoteAndPost(quote: CrossChainQuoteAndPost): quote is BridgeQuoteAndPost;
414
414
  declare function isQuoteAndPost(quote: CrossChainQuoteAndPost): quote is QuoteAndPost;
415
415
  declare function assertIsBridgeQuoteAndPost(quote: CrossChainQuoteAndPost): asserts quote is BridgeQuoteAndPost;
package/dist/index.d.ts CHANGED
@@ -5,29 +5,6 @@ import { QuoterParameters, TraderParameters, TradeOptionalParameters, QuoteAndPo
5
5
  import { AccountAddress, SignerLike, AbstractProviderAdapter } from '@cowprotocol/sdk-common';
6
6
  import { CowShedSdk, CowShedSdkOptions } from '@cowprotocol/sdk-cow-shed';
7
7
 
8
- declare enum BridgeQuoteErrors {
9
- NO_INTERMEDIATE_TOKENS = "NO_INTERMEDIATE_TOKENS",
10
- API_ERROR = "API_ERROR",
11
- INVALID_API_JSON_RESPONSE = "INVALID_API_JSON_RESPONSE",
12
- ONLY_SELL_ORDER_SUPPORTED = "ONLY_SELL_ORDER_SUPPORTED",
13
- TX_BUILD_ERROR = "TX_BUILD_ERROR",
14
- QUOTE_ERROR = "QUOTE_ERROR",
15
- NO_ROUTES = "NO_ROUTES",
16
- INVALID_BRIDGE = "INVALID_BRIDGE"
17
- }
18
- declare class BridgeProviderQuoteError extends Error {
19
- readonly context?: unknown | undefined;
20
- constructor(message: BridgeQuoteErrors, context?: unknown | undefined);
21
- }
22
- declare class BridgeProviderError extends Error {
23
- readonly context: unknown;
24
- constructor(message: string, context: unknown);
25
- }
26
- declare class BridgeOrderParsingError extends Error {
27
- readonly context?: unknown | undefined;
28
- constructor(message: string, context?: unknown | undefined);
29
- }
30
-
31
8
  interface BridgeProviderInfo {
32
9
  name: string;
33
10
  logoUrl: string;
@@ -353,7 +330,7 @@ interface CrossChainOrder {
353
330
  interface MultiQuoteResult {
354
331
  providerDappId: string;
355
332
  quote: BridgeQuoteAndPost | null;
356
- error?: BridgeProviderQuoteError | BridgeProviderError;
333
+ error?: Error;
357
334
  }
358
335
  /**
359
336
  * Callback function called when a quote result is available from a provider
@@ -410,6 +387,29 @@ interface BestQuoteProviderContext extends MultiQuoteContext {
410
387
  };
411
388
  }
412
389
 
390
+ declare enum BridgeQuoteErrors {
391
+ NO_INTERMEDIATE_TOKENS = "NO_INTERMEDIATE_TOKENS",
392
+ API_ERROR = "API_ERROR",
393
+ INVALID_API_JSON_RESPONSE = "INVALID_API_JSON_RESPONSE",
394
+ ONLY_SELL_ORDER_SUPPORTED = "ONLY_SELL_ORDER_SUPPORTED",
395
+ TX_BUILD_ERROR = "TX_BUILD_ERROR",
396
+ QUOTE_ERROR = "QUOTE_ERROR",
397
+ NO_ROUTES = "NO_ROUTES",
398
+ INVALID_BRIDGE = "INVALID_BRIDGE"
399
+ }
400
+ declare class BridgeProviderQuoteError extends Error {
401
+ readonly context?: unknown | undefined;
402
+ constructor(message: BridgeQuoteErrors, context?: unknown | undefined);
403
+ }
404
+ declare class BridgeProviderError extends Error {
405
+ readonly context: unknown;
406
+ constructor(message: string, context: unknown);
407
+ }
408
+ declare class BridgeOrderParsingError extends Error {
409
+ readonly context?: unknown | undefined;
410
+ constructor(message: string, context?: unknown | undefined);
411
+ }
412
+
413
413
  declare function isBridgeQuoteAndPost(quote: CrossChainQuoteAndPost): quote is BridgeQuoteAndPost;
414
414
  declare function isQuoteAndPost(quote: CrossChainQuoteAndPost): quote is QuoteAndPost;
415
415
  declare function assertIsBridgeQuoteAndPost(quote: CrossChainQuoteAndPost): asserts quote is BridgeQuoteAndPost;
package/dist/index.js CHANGED
@@ -656,7 +656,7 @@ var MultiQuoteStrategyImpl = class {
656
656
  const result = {
657
657
  providerDappId: provider.info.dappId,
658
658
  quote: null,
659
- error: error instanceof BridgeProviderQuoteError ? error : new BridgeProviderError(String(error), {})
659
+ error: error instanceof Error ? error : new BridgeProviderError(String(error), {})
660
660
  };
661
661
  results[index] = result;
662
662
  safeCallProgressiveCallback(onQuoteResult, result);
@@ -726,7 +726,7 @@ var BestQuoteStrategyImpl = class {
726
726
  const errorResult = {
727
727
  providerDappId: provider.info.dappId,
728
728
  quote: null,
729
- error: error instanceof BridgeProviderQuoteError ? error : new BridgeProviderError(String(error), {})
729
+ error: error instanceof Error ? error : new BridgeProviderError(String(error), {})
730
730
  };
731
731
  if (!firstError.current) {
732
732
  firstError.current = errorResult;
package/dist/index.mjs CHANGED
@@ -614,7 +614,7 @@ var MultiQuoteStrategyImpl = class {
614
614
  const result = {
615
615
  providerDappId: provider.info.dappId,
616
616
  quote: null,
617
- error: error instanceof BridgeProviderQuoteError ? error : new BridgeProviderError(String(error), {})
617
+ error: error instanceof Error ? error : new BridgeProviderError(String(error), {})
618
618
  };
619
619
  results[index] = result;
620
620
  safeCallProgressiveCallback(onQuoteResult, result);
@@ -684,7 +684,7 @@ var BestQuoteStrategyImpl = class {
684
684
  const errorResult = {
685
685
  providerDappId: provider.info.dappId,
686
686
  quote: null,
687
- error: error instanceof BridgeProviderQuoteError ? error : new BridgeProviderError(String(error), {})
687
+ error: error instanceof Error ? error : new BridgeProviderError(String(error), {})
688
688
  };
689
689
  if (!firstError.current) {
690
690
  firstError.current = errorResult;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cowprotocol/sdk-bridging",
3
- "version": "0.3.1",
3
+ "version": "0.3.2",
4
4
  "description": "Bridging for CoW Protocol",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -15,13 +15,13 @@
15
15
  },
16
16
  "dependencies": {
17
17
  "@cowprotocol/sdk-app-data": "4.0.0",
18
+ "@cowprotocol/sdk-common": "0.1.0",
18
19
  "@cowprotocol/sdk-config": "0.1.0",
19
20
  "@cowprotocol/sdk-contracts-ts": "0.2.1",
20
- "@cowprotocol/sdk-cow-shed": "0.1.3",
21
- "@cowprotocol/sdk-trading": "0.1.3",
22
21
  "@cowprotocol/sdk-order-book": "0.1.0",
22
+ "@cowprotocol/sdk-trading": "0.1.3",
23
23
  "@cowprotocol/sdk-weiroll": "0.1.0",
24
- "@cowprotocol/sdk-common": "0.1.0"
24
+ "@cowprotocol/sdk-cow-shed": "0.1.3"
25
25
  },
26
26
  "devDependencies": {
27
27
  "ethers-v5": "npm:ethers@^5.7.2",
@@ -36,9 +36,9 @@
36
36
  "ts-jest": "^29.0.0",
37
37
  "ethers": "^5.7.2",
38
38
  "viem": "^2.28.4",
39
- "@cow-sdk/typescript-config": "0.0.0-beta.0",
40
39
  "@cowprotocol/sdk-ethers-v5-adapter": "0.1.0",
41
40
  "@cowprotocol/sdk-order-signing": "0.1.3",
41
+ "@cow-sdk/typescript-config": "0.0.0-beta.0",
42
42
  "@cowprotocol/sdk-ethers-v6-adapter": "0.1.0",
43
43
  "@cowprotocol/sdk-viem-adapter": "0.1.0"
44
44
  },