@cowprotocol/cow-sdk 6.0.0-RC.39 → 6.0.0-RC.42

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.
Files changed (211) hide show
  1. package/dist/bridging/BridgingSdk/BridgingSdk.d.ts +90 -90
  2. package/dist/bridging/BridgingSdk/getCrossChainOrder.d.ts +14 -14
  3. package/dist/bridging/BridgingSdk/getErc20Decimals.d.ts +4 -4
  4. package/dist/bridging/BridgingSdk/getQuoteWithBridge.d.ts +32 -32
  5. package/dist/bridging/BridgingSdk/getQuoteWithoutBridge.d.ts +7 -7
  6. package/dist/bridging/BridgingSdk/mock/bridgeRequestMocks.d.ts +20 -20
  7. package/dist/bridging/const.d.ts +2 -2
  8. package/dist/bridging/errors.d.ts +4 -4
  9. package/dist/bridging/index.d.ts +6 -6
  10. package/dist/bridging/providers/across/AcrossApi.d.ts +27 -27
  11. package/dist/bridging/providers/across/AcrossBridgeProvider.d.ts +43 -43
  12. package/dist/bridging/providers/across/abi.d.ts +154 -154
  13. package/dist/bridging/providers/across/const/contracts.d.ts +3 -3
  14. package/dist/bridging/providers/across/const/misc.d.ts +1 -1
  15. package/dist/bridging/providers/across/const/tokens.d.ts +11 -11
  16. package/dist/bridging/providers/across/createAcrossDepositCall.d.ts +9 -9
  17. package/dist/bridging/providers/across/types.d.ts +169 -169
  18. package/dist/bridging/providers/across/util.d.ts +39 -39
  19. package/dist/bridging/providers/mock/MockBridgeProvider.d.ts +21 -21
  20. package/dist/bridging/types.d.ts +287 -287
  21. package/dist/bridging/utils.d.ts +9 -9
  22. package/dist/chains/const/index.d.ts +25 -25
  23. package/dist/chains/const/path.d.ts +1 -1
  24. package/dist/chains/details/arbitrum.d.ts +7 -7
  25. package/dist/chains/details/avalanche.d.ts +2 -2
  26. package/dist/chains/details/base.d.ts +7 -7
  27. package/dist/chains/details/gnosis.d.ts +7 -7
  28. package/dist/chains/details/mainnet.d.ts +7 -7
  29. package/dist/chains/details/optimism.d.ts +2 -2
  30. package/dist/chains/details/polygon.d.ts +2 -2
  31. package/dist/chains/details/sepolia.d.ts +7 -7
  32. package/dist/chains/index.d.ts +3 -3
  33. package/dist/chains/types.d.ts +123 -123
  34. package/dist/chains/utils.d.ts +18 -18
  35. package/dist/common/consts/config.d.ts +9 -9
  36. package/dist/common/consts/contracts.d.ts +34 -34
  37. package/dist/common/consts/ipfs.d.ts +2 -2
  38. package/dist/common/consts/path.d.ts +1 -1
  39. package/dist/common/consts/tokens.d.ts +9 -9
  40. package/dist/common/generated/CoWShed.d.ts +219 -219
  41. package/dist/common/generated/CoWShedFactory.d.ts +191 -191
  42. package/dist/common/generated/ComposableCoW.d.ts +340 -340
  43. package/dist/common/generated/EthFlow.d.ts +117 -117
  44. package/dist/common/generated/ExtensibleFallbackHandler.d.ts +282 -282
  45. package/dist/common/generated/GPv2Settlement.d.ts +107 -107
  46. package/dist/common/generated/TWAP.d.ts +141 -141
  47. package/dist/common/generated/common.d.ts +21 -21
  48. package/dist/common/generated/factories/CoWShedFactory__factory.d.ts +250 -250
  49. package/dist/common/generated/factories/CoWShed__factory.d.ts +254 -254
  50. package/dist/common/generated/factories/ComposableCoW__factory.d.ts +475 -475
  51. package/dist/common/generated/factories/EthFlow__factory.d.ts +124 -124
  52. package/dist/common/generated/factories/ExtensibleFallbackHandler__factory.d.ts +389 -389
  53. package/dist/common/generated/factories/GPv2Settlement__factory.d.ts +81 -81
  54. package/dist/common/generated/factories/TWAP__factory.d.ts +260 -260
  55. package/dist/common/generated/factories/index.d.ts +7 -7
  56. package/dist/common/generated/index.d.ts +15 -15
  57. package/dist/common/index.d.ts +12 -12
  58. package/dist/common/types/config.d.ts +70 -70
  59. package/dist/common/types/cow-error.d.ts +4 -4
  60. package/dist/common/types/ethereum.d.ts +5 -5
  61. package/dist/common/types/tokens.d.ts +12 -12
  62. package/dist/common/types/wallets.d.ts +5 -5
  63. package/dist/common/utils/config.d.ts +4 -4
  64. package/dist/common/utils/log.d.ts +2 -2
  65. package/dist/common/utils/math.d.ts +19 -0
  66. package/dist/common/utils/serialize.d.ts +1 -1
  67. package/dist/common/utils/wallet.d.ts +3 -3
  68. package/dist/composable/ConditionalOrder.d.ts +206 -206
  69. package/dist/composable/ConditionalOrderFactory.d.ts +19 -19
  70. package/dist/composable/Multiplexer.d.ts +174 -174
  71. package/dist/composable/contracts.d.ts +6 -6
  72. package/dist/composable/generated/ComposableCoW.d.ts +340 -340
  73. package/dist/composable/generated/ExtensibleFallbackHandler.d.ts +282 -282
  74. package/dist/composable/generated/TWAP.d.ts +141 -141
  75. package/dist/composable/generated/common.d.ts +21 -21
  76. package/dist/composable/generated/factories/ComposableCoW__factory.d.ts +475 -475
  77. package/dist/composable/generated/factories/ExtensibleFallbackHandler__factory.d.ts +389 -389
  78. package/dist/composable/generated/factories/TWAP__factory.d.ts +260 -260
  79. package/dist/composable/generated/factories/index.d.ts +3 -3
  80. package/dist/composable/generated/index.d.ts +7 -7
  81. package/dist/composable/index.d.ts +6 -6
  82. package/dist/composable/orderTypes/Twap.d.ts +242 -242
  83. package/dist/composable/orderTypes/index.d.ts +3 -3
  84. package/dist/composable/orderTypes/test/TestConditionalOrder.d.ts +25 -25
  85. package/dist/composable/types.d.ts +133 -133
  86. package/dist/composable/utils.d.ts +37 -37
  87. package/dist/cow-shed/CowShedSdk.d.ts +69 -69
  88. package/dist/cow-shed/contracts/CoWShedHooks.d.ts +45 -45
  89. package/dist/cow-shed/contracts/utils.d.ts +4 -4
  90. package/dist/cow-shed/index.d.ts +3 -3
  91. package/dist/cow-shed/types.d.ts +17 -17
  92. package/dist/hooks/utils.d.ts +3 -3
  93. package/dist/index-03853adc.js +29 -0
  94. package/dist/index-03853adc.js.map +1 -0
  95. package/dist/index.d.ts +11 -11
  96. package/dist/index.js +4 -4
  97. package/dist/index.js.map +1 -1
  98. package/dist/index.modern.mjs +1 -1
  99. package/dist/index.module.js +4 -4
  100. package/dist/index.module.js.map +1 -1
  101. package/dist/order-book/api.d.ts +235 -235
  102. package/dist/order-book/generated/index.d.ts +55 -55
  103. package/dist/order-book/generated/models/Address.d.ts +4 -4
  104. package/dist/order-book/generated/models/AppData.d.ts +7 -7
  105. package/dist/order-book/generated/models/AppDataHash.d.ts +6 -6
  106. package/dist/order-book/generated/models/AppDataObject.d.ts +7 -7
  107. package/dist/order-book/generated/models/Auction.d.ts +30 -30
  108. package/dist/order-book/generated/models/AuctionOrder.d.ts +92 -92
  109. package/dist/order-book/generated/models/AuctionPrices.d.ts +6 -6
  110. package/dist/order-book/generated/models/BigUint.d.ts +4 -4
  111. package/dist/order-book/generated/models/BuyTokenDestination.d.ts +7 -7
  112. package/dist/order-book/generated/models/CallData.d.ts +4 -4
  113. package/dist/order-book/generated/models/CompetitionAuction.d.ts +14 -14
  114. package/dist/order-book/generated/models/CompetitionOrderStatus.d.ts +29 -29
  115. package/dist/order-book/generated/models/EcdsaSignature.d.ts +4 -4
  116. package/dist/order-book/generated/models/EcdsaSigningScheme.d.ts +7 -7
  117. package/dist/order-book/generated/models/EthflowData.d.ts +20 -20
  118. package/dist/order-book/generated/models/ExecutedAmounts.d.ts +5 -5
  119. package/dist/order-book/generated/models/ExecutedProtocolFee.d.ts +8 -8
  120. package/dist/order-book/generated/models/FeePolicy.d.ts +7 -7
  121. package/dist/order-book/generated/models/InteractionData.d.ts +11 -11
  122. package/dist/order-book/generated/models/NativePriceResponse.d.ts +10 -10
  123. package/dist/order-book/generated/models/OnchainOrderData.d.ts +24 -24
  124. package/dist/order-book/generated/models/Order.d.ts +3 -3
  125. package/dist/order-book/generated/models/OrderCancellation.d.ts +14 -14
  126. package/dist/order-book/generated/models/OrderCancellationError.d.ts +15 -15
  127. package/dist/order-book/generated/models/OrderCancellations.d.ts +18 -18
  128. package/dist/order-book/generated/models/OrderClass.d.ts +8 -8
  129. package/dist/order-book/generated/models/OrderCreation.d.ts +80 -80
  130. package/dist/order-book/generated/models/OrderKind.d.ts +7 -7
  131. package/dist/order-book/generated/models/OrderMetaData.d.ts +100 -100
  132. package/dist/order-book/generated/models/OrderParameters.d.ts +53 -53
  133. package/dist/order-book/generated/models/OrderPostError.d.ts +35 -35
  134. package/dist/order-book/generated/models/OrderQuoteRequest.d.ts +58 -58
  135. package/dist/order-book/generated/models/OrderQuoteResponse.d.ts +27 -27
  136. package/dist/order-book/generated/models/OrderQuoteSide.d.ts +26 -26
  137. package/dist/order-book/generated/models/OrderQuoteSideKindBuy.d.ts +3 -3
  138. package/dist/order-book/generated/models/OrderQuoteSideKindSell.d.ts +3 -3
  139. package/dist/order-book/generated/models/OrderQuoteValidity.d.ts +14 -14
  140. package/dist/order-book/generated/models/OrderStatus.d.ts +10 -10
  141. package/dist/order-book/generated/models/PreSignature.d.ts +4 -4
  142. package/dist/order-book/generated/models/PriceEstimationError.d.ts +12 -12
  143. package/dist/order-book/generated/models/PriceImprovement.d.ts +12 -12
  144. package/dist/order-book/generated/models/PriceQuality.d.ts +16 -16
  145. package/dist/order-book/generated/models/Quote.d.ts +19 -19
  146. package/dist/order-book/generated/models/SellTokenSource.d.ts +8 -8
  147. package/dist/order-book/generated/models/Signature.d.ts +6 -6
  148. package/dist/order-book/generated/models/SigningScheme.d.ts +9 -9
  149. package/dist/order-book/generated/models/SolverCompetitionResponse.d.ts +30 -30
  150. package/dist/order-book/generated/models/SolverSettlement.d.ts +47 -47
  151. package/dist/order-book/generated/models/Surplus.d.ts +7 -7
  152. package/dist/order-book/generated/models/TokenAmount.d.ts +4 -4
  153. package/dist/order-book/generated/models/TotalSurplus.d.ts +10 -10
  154. package/dist/order-book/generated/models/Trade.d.ts +57 -57
  155. package/dist/order-book/generated/models/TransactionHash.d.ts +4 -4
  156. package/dist/order-book/generated/models/UID.d.ts +8 -8
  157. package/dist/order-book/generated/models/Volume.d.ts +6 -6
  158. package/dist/order-book/index.d.ts +5 -5
  159. package/dist/order-book/mock.d.ts +63 -63
  160. package/dist/order-book/quoteAmountsAndCostsUtils.d.ts +35 -22
  161. package/dist/order-book/request.d.ts +49 -49
  162. package/dist/order-book/transformOrder.d.ts +10 -10
  163. package/dist/order-book/types.d.ts +74 -74
  164. package/dist/order-signing/index.d.ts +2 -2
  165. package/dist/order-signing/orderSigningUtils.d.ts +97 -97
  166. package/dist/order-signing/types.d.ts +55 -55
  167. package/dist/order-signing/utils.d.ts +49 -49
  168. package/dist/package.json +21 -22
  169. package/dist/schemas/trading/LimitTradeParameters.ts +1 -1
  170. package/dist/schemas/trading/QuoteResultsSerialized.ts +6 -1
  171. package/dist/schemas/trading/TradeParameters.ts +1 -1
  172. package/dist/subgraph/api.d.ts +77 -77
  173. package/dist/subgraph/graphql.d.ts +3203 -3203
  174. package/dist/subgraph/index.d.ts +1 -1
  175. package/dist/subgraph/queries.d.ts +14 -14
  176. package/dist/test/utils.d.ts +1 -1
  177. package/dist/trading/appDataUtils.d.ts +5 -5
  178. package/dist/trading/calculateUniqueOrderId.d.ts +5 -5
  179. package/dist/trading/consts.d.ts +10 -10
  180. package/dist/trading/getEthFlowTransaction.d.ts +12 -12
  181. package/dist/trading/getOrderToSign.d.ts +8 -8
  182. package/dist/trading/getOrderTypedData.d.ts +4 -4
  183. package/dist/trading/getPreSignTransaction.d.ts +4 -4
  184. package/dist/trading/getQuote.d.ts +25 -14
  185. package/dist/trading/index.d.ts +20 -19
  186. package/dist/trading/postCoWProtocolTrade.d.ts +4 -4
  187. package/dist/trading/postLimitOrder.d.ts +3 -3
  188. package/dist/trading/postSellNativeCurrencyOrder.d.ts +4 -4
  189. package/dist/trading/postSwapOrder.d.ts +5 -5
  190. package/dist/trading/sample.d.ts +1 -0
  191. package/dist/trading/suggestSlippageBps.d.ts +12 -0
  192. package/dist/trading/suggestSlippageFromFee.d.ts +17 -0
  193. package/dist/trading/suggestSlippageFromVolume.d.ts +10 -0
  194. package/dist/trading/tradingSdk.d.ts +26 -26
  195. package/dist/trading/types.d.ts +210 -201
  196. package/dist/trading/{utils.d.ts → utils/misc.d.ts} +27 -27
  197. package/dist/trading/utils/slippage.d.ts +14 -0
  198. package/dist/{utils-520905ea.js → utils-655d1f34.js} +1 -1
  199. package/dist/utils-655d1f34.js.map +1 -0
  200. package/dist/{utils-3d227fef.js → utils-6c6631d7.js} +1 -1
  201. package/dist/utils-6c6631d7.js.map +1 -0
  202. package/dist/{utils-802f717e.js → utils-728f2693.js} +2 -2
  203. package/dist/utils-728f2693.js.map +1 -0
  204. package/dist/utils.d.ts +3 -3
  205. package/dist/weiroll/index.d.ts +23 -23
  206. package/package.json +21 -22
  207. package/dist/index-8f962c6b.js +0 -29
  208. package/dist/index-8f962c6b.js.map +0 -1
  209. package/dist/utils-3d227fef.js.map +0 -1
  210. package/dist/utils-520905ea.js.map +0 -1
  211. package/dist/utils-802f717e.js.map +0 -1
@@ -1,90 +1,90 @@
1
- import { SwapAdvancedSettings, TradingSdk } from '../../trading';
2
- import { BridgeProvider, BridgeQuoteResult, CrossChainOrder, CrossChainQuoteAndPost, GetErc20Decimals, QuoteBridgeRequest } from '../types';
3
- import { CowEnv, TokenInfo } from '../../common';
4
- import { ChainInfo, SupportedChainId, TargetChainId } from '../../chains';
5
- import { OrderBookApi } from 'src/order-book';
6
- export interface BridgingSdkOptions {
7
- /**
8
- * Providers for the bridging.
9
- */
10
- providers: BridgeProvider<BridgeQuoteResult>[];
11
- /**
12
- * Function to get the decimals of the ERC20 tokens
13
- */
14
- getErc20Decimals?: GetErc20Decimals;
15
- /**
16
- * Trading SDK.
17
- */
18
- tradingSdk?: TradingSdk;
19
- /**
20
- * Order book API.
21
- */
22
- orderBookApi?: OrderBookApi;
23
- /**
24
- * Enable logging for the bridging SDK.
25
- */
26
- enableLogging?: boolean;
27
- }
28
- /**
29
- * Parameters for the `getOrder` method.
30
- */
31
- export interface GetOrderParams {
32
- /**
33
- * The unique identifier of the order.
34
- */
35
- orderId: string;
36
- /**
37
- * The chain ID of the order.
38
- */
39
- chainId: SupportedChainId;
40
- /**
41
- * The environment of the order
42
- */
43
- env?: CowEnv;
44
- }
45
- export type BridgingSdkConfig = Required<Omit<BridgingSdkOptions, 'enableLogging' | 'getErc20Decimals'>> & Pick<BridgingSdkOptions, 'getErc20Decimals'>;
46
- /**
47
- * SDK for bridging for swapping tokens between different chains.
48
- */
49
- export declare class BridgingSdk {
50
- readonly options: BridgingSdkOptions;
51
- protected config: BridgingSdkConfig;
52
- constructor(options: BridgingSdkOptions);
53
- private get provider();
54
- /**
55
- * Get the providers for the bridging.
56
- */
57
- getProviders(): BridgeProvider<BridgeQuoteResult>[];
58
- /**
59
- * Get the available sources networks for the bridging.
60
- */
61
- getSourceNetworks(): Promise<ChainInfo[]>;
62
- /**
63
- * Get the available target networks for the bridging.
64
- */
65
- getTargetNetworks(): Promise<ChainInfo[]>;
66
- /**
67
- * Get the available buy tokens for buying in a specific target chain
68
- *
69
- * @param param
70
- * @returns
71
- */
72
- getBuyTokens(targetChainId: TargetChainId): Promise<TokenInfo[]>;
73
- /**
74
- * Get quote details, including a callback function to post the order on-chain.
75
- *
76
- * This method support both, cross-chain swaps and single-chain swap.
77
- *
78
- * The return type will be either `QuoteAndPost` or `BridgeQuoteAndPost`.
79
- *
80
- * To safely assert the type in Typescript, you can use:
81
- * - `isBridgeQuoteAndPost(result)` utility.
82
- * - `isQuoteAndPost(result)` utility.
83
- * - `assertIsBridgeQuoteAndPost(result)` assertion.
84
- * - `assertIsQuoteAndPost(result)` assertion.
85
- *
86
- * @throws Error if no path is found
87
- */
88
- getQuote(quoteBridgeRequest: QuoteBridgeRequest, advancedSettings?: SwapAdvancedSettings): Promise<CrossChainQuoteAndPost>;
89
- getOrder(params: GetOrderParams): Promise<CrossChainOrder>;
90
- }
1
+ import { SwapAdvancedSettings, TradingSdk } from '../../trading';
2
+ import { BridgeProvider, BridgeQuoteResult, CrossChainOrder, CrossChainQuoteAndPost, GetErc20Decimals, QuoteBridgeRequest } from '../types';
3
+ import { CowEnv, TokenInfo } from '../../common';
4
+ import { ChainInfo, SupportedChainId, TargetChainId } from '../../chains';
5
+ import { OrderBookApi } from 'src/order-book';
6
+ export interface BridgingSdkOptions {
7
+ /**
8
+ * Providers for the bridging.
9
+ */
10
+ providers: BridgeProvider<BridgeQuoteResult>[];
11
+ /**
12
+ * Function to get the decimals of the ERC20 tokens
13
+ */
14
+ getErc20Decimals?: GetErc20Decimals;
15
+ /**
16
+ * Trading SDK.
17
+ */
18
+ tradingSdk?: TradingSdk;
19
+ /**
20
+ * Order book API.
21
+ */
22
+ orderBookApi?: OrderBookApi;
23
+ /**
24
+ * Enable logging for the bridging SDK.
25
+ */
26
+ enableLogging?: boolean;
27
+ }
28
+ /**
29
+ * Parameters for the `getOrder` method.
30
+ */
31
+ export interface GetOrderParams {
32
+ /**
33
+ * The unique identifier of the order.
34
+ */
35
+ orderId: string;
36
+ /**
37
+ * The chain ID of the order.
38
+ */
39
+ chainId: SupportedChainId;
40
+ /**
41
+ * The environment of the order
42
+ */
43
+ env?: CowEnv;
44
+ }
45
+ export type BridgingSdkConfig = Required<Omit<BridgingSdkOptions, 'enableLogging' | 'getErc20Decimals'>> & Pick<BridgingSdkOptions, 'getErc20Decimals'>;
46
+ /**
47
+ * SDK for bridging for swapping tokens between different chains.
48
+ */
49
+ export declare class BridgingSdk {
50
+ readonly options: BridgingSdkOptions;
51
+ protected config: BridgingSdkConfig;
52
+ constructor(options: BridgingSdkOptions);
53
+ private get provider();
54
+ /**
55
+ * Get the providers for the bridging.
56
+ */
57
+ getProviders(): BridgeProvider<BridgeQuoteResult>[];
58
+ /**
59
+ * Get the available sources networks for the bridging.
60
+ */
61
+ getSourceNetworks(): Promise<ChainInfo[]>;
62
+ /**
63
+ * Get the available target networks for the bridging.
64
+ */
65
+ getTargetNetworks(): Promise<ChainInfo[]>;
66
+ /**
67
+ * Get the available buy tokens for buying in a specific target chain
68
+ *
69
+ * @param param
70
+ * @returns
71
+ */
72
+ getBuyTokens(targetChainId: TargetChainId): Promise<TokenInfo[]>;
73
+ /**
74
+ * Get quote details, including a callback function to post the order on-chain.
75
+ *
76
+ * This method support both, cross-chain swaps and single-chain swap.
77
+ *
78
+ * The return type will be either `QuoteAndPost` or `BridgeQuoteAndPost`.
79
+ *
80
+ * To safely assert the type in Typescript, you can use:
81
+ * - `isBridgeQuoteAndPost(result)` utility.
82
+ * - `isQuoteAndPost(result)` utility.
83
+ * - `assertIsBridgeQuoteAndPost(result)` assertion.
84
+ * - `assertIsQuoteAndPost(result)` assertion.
85
+ *
86
+ * @throws Error if no path is found
87
+ */
88
+ getQuote(quoteBridgeRequest: QuoteBridgeRequest, advancedSettings?: SwapAdvancedSettings): Promise<CrossChainQuoteAndPost>;
89
+ getOrder(params: GetOrderParams): Promise<CrossChainOrder>;
90
+ }
@@ -1,14 +1,14 @@
1
- import { BridgeProvider, BridgeQuoteResult, CrossChainOrder } from '../types';
2
- import { SupportedChainId } from '../../chains';
3
- import { OrderBookApi } from 'src/order-book';
4
- import { CowEnv } from '../../common';
5
- /**
6
- * Fetch a cross-chain order and its status.
7
- */
8
- export declare function getCrossChainOrder(params: {
9
- orderId: string;
10
- chainId: SupportedChainId;
11
- orderBookApi: OrderBookApi;
12
- providers: BridgeProvider<BridgeQuoteResult>[];
13
- env: CowEnv;
14
- }): Promise<CrossChainOrder>;
1
+ import { BridgeProvider, BridgeQuoteResult, CrossChainOrder } from '../types';
2
+ import { SupportedChainId } from '../../chains';
3
+ import { OrderBookApi } from 'src/order-book';
4
+ import { CowEnv } from '../../common';
5
+ /**
6
+ * Fetch a cross-chain order and its status.
7
+ */
8
+ export declare function getCrossChainOrder(params: {
9
+ orderId: string;
10
+ chainId: SupportedChainId;
11
+ orderBookApi: OrderBookApi;
12
+ providers: BridgeProvider<BridgeQuoteResult>[];
13
+ env: CowEnv;
14
+ }): Promise<CrossChainOrder>;
@@ -1,4 +1,4 @@
1
- import { Provider } from '@ethersproject/providers';
2
- import { Signer } from '@ethersproject/abstract-signer';
3
- import { GetErc20Decimals } from '../types';
4
- export declare function factoryGetErc20Decimals(provider: Signer | Provider): GetErc20Decimals;
1
+ import { Provider } from '@ethersproject/providers';
2
+ import { Signer } from '@ethersproject/abstract-signer';
3
+ import { GetErc20Decimals } from '../types';
4
+ export declare function factoryGetErc20Decimals(provider: Signer | Provider): GetErc20Decimals;
@@ -1,32 +1,32 @@
1
- import { SwapAdvancedSettings, TradingSdk } from '../../trading';
2
- import { BridgeProvider, BridgeQuoteAndPost, BridgeQuoteResult, GetErc20Decimals, QuoteBridgeRequest } from '../types';
3
- import { SignerLike } from '../../common';
4
- type GetQuoteWithBridgeParams<T extends BridgeQuoteResult> = {
5
- /**
6
- * Overall request for the swap and the bridge.
7
- */
8
- swapAndBridgeRequest: QuoteBridgeRequest;
9
- /**
10
- * Advanced settings for the swap.
11
- */
12
- advancedSettings?: SwapAdvancedSettings;
13
- /**
14
- * Provider for the bridge.
15
- */
16
- provider: BridgeProvider<T>;
17
- /**
18
- * Trading SDK.
19
- */
20
- tradingSdk: TradingSdk;
21
- /**
22
- * Function to get the decimals of the ERC20 tokens.
23
- */
24
- getErc20Decimals: GetErc20Decimals;
25
- /**
26
- * For quote fetching we have to sign bridging hooks.
27
- * But we won't do that using users wallet and will use some static PK.
28
- */
29
- bridgeHookSigner?: SignerLike;
30
- };
31
- export declare function getQuoteWithBridge<T extends BridgeQuoteResult>(params: GetQuoteWithBridgeParams<T>): Promise<BridgeQuoteAndPost>;
32
- export {};
1
+ import { SwapAdvancedSettings, TradingSdk } from '../../trading';
2
+ import { BridgeProvider, BridgeQuoteAndPost, BridgeQuoteResult, GetErc20Decimals, QuoteBridgeRequest } from '../types';
3
+ import { SignerLike } from '../../common';
4
+ type GetQuoteWithBridgeParams<T extends BridgeQuoteResult> = {
5
+ /**
6
+ * Overall request for the swap and the bridge.
7
+ */
8
+ swapAndBridgeRequest: QuoteBridgeRequest;
9
+ /**
10
+ * Advanced settings for the swap.
11
+ */
12
+ advancedSettings?: SwapAdvancedSettings;
13
+ /**
14
+ * Provider for the bridge.
15
+ */
16
+ provider: BridgeProvider<T>;
17
+ /**
18
+ * Trading SDK.
19
+ */
20
+ tradingSdk: TradingSdk;
21
+ /**
22
+ * Function to get the decimals of the ERC20 tokens.
23
+ */
24
+ getErc20Decimals: GetErc20Decimals;
25
+ /**
26
+ * For quote fetching we have to sign bridging hooks.
27
+ * But we won't do that using users wallet and will use some static PK.
28
+ */
29
+ bridgeHookSigner?: SignerLike;
30
+ };
31
+ export declare function getQuoteWithBridge<T extends BridgeQuoteResult>(params: GetQuoteWithBridgeParams<T>): Promise<BridgeQuoteAndPost>;
32
+ export {};
@@ -1,7 +1,7 @@
1
- import { QuoteAndPost, SwapAdvancedSettings, TradingSdk } from '../../trading';
2
- import { QuoteBridgeRequest } from '../types';
3
- export declare function getQuoteWithoutBridge(params: {
4
- quoteBridgeRequest: QuoteBridgeRequest;
5
- advancedSettings?: SwapAdvancedSettings;
6
- tradingSdk: TradingSdk;
7
- }): Promise<QuoteAndPost>;
1
+ import { QuoteAndPost, SwapAdvancedSettings, TradingSdk } from '../../trading';
2
+ import { QuoteBridgeRequest } from '../types';
3
+ export declare function getQuoteWithoutBridge(params: {
4
+ quoteBridgeRequest: QuoteBridgeRequest;
5
+ advancedSettings?: SwapAdvancedSettings;
6
+ tradingSdk: TradingSdk;
7
+ }): Promise<QuoteAndPost>;
@@ -1,20 +1,20 @@
1
- import { BridgeCallDetails, BridgeQuoteResult, QuoteBridgeRequest } from '../../types';
2
- import { OrderQuoteResponse, QuoteAmountsAndCosts } from '../../../order-book';
3
- import { AppDataInfo, OrderTypedData, TradeParameters } from '../../../trading';
4
- import { UnsignedOrder } from '../../../order-signing';
5
- import { Wallet } from '@ethersproject/wallet';
6
- export declare const intermediateToken = "0xDEf1CA1fb7FBcDC777520aa7f396b4E015F497aB";
7
- export declare const intermediateTokenDecimals = 18;
8
- export declare const mockSigner: Wallet;
9
- export declare const cowShedForAccount = "0x1111111111111111111111111111111111111111";
10
- export declare const bridgeQuoteTimestamp = 1742906914061;
11
- export declare const bridgeExpectedFillTimeSeconds = 100;
12
- export declare const quoteBridgeRequest: QuoteBridgeRequest;
13
- export declare const orderQuoteResponse: OrderQuoteResponse;
14
- export declare const amountsAndCosts: QuoteAmountsAndCosts;
15
- export declare const bridgeQuoteResult: BridgeQuoteResult;
16
- export declare const bridgeCallDetails: BridgeCallDetails;
17
- export declare const appDataInfo: AppDataInfo;
18
- export declare const tradeParameters: TradeParameters;
19
- export declare const orderToSign: UnsignedOrder;
20
- export declare const orderTypedData: OrderTypedData;
1
+ import { BridgeCallDetails, BridgeQuoteResult, QuoteBridgeRequest } from '../../types';
2
+ import { OrderQuoteResponse, QuoteAmountsAndCosts } from '../../../order-book';
3
+ import { AppDataInfo, OrderTypedData, TradeParameters } from '../../../trading';
4
+ import { UnsignedOrder } from '../../../order-signing';
5
+ import { Wallet } from '@ethersproject/wallet';
6
+ export declare const intermediateToken = "0xDEf1CA1fb7FBcDC777520aa7f396b4E015F497aB";
7
+ export declare const intermediateTokenDecimals = 18;
8
+ export declare const mockSigner: Wallet;
9
+ export declare const cowShedForAccount = "0x1111111111111111111111111111111111111111";
10
+ export declare const bridgeQuoteTimestamp = 1742906914061;
11
+ export declare const bridgeExpectedFillTimeSeconds = 100;
12
+ export declare const quoteBridgeRequest: QuoteBridgeRequest;
13
+ export declare const orderQuoteResponse: OrderQuoteResponse;
14
+ export declare const amountsAndCosts: QuoteAmountsAndCosts;
15
+ export declare const bridgeQuoteResult: BridgeQuoteResult;
16
+ export declare const bridgeCallDetails: BridgeCallDetails;
17
+ export declare const appDataInfo: AppDataInfo;
18
+ export declare const tradeParameters: TradeParameters;
19
+ export declare const orderToSign: UnsignedOrder;
20
+ export declare const orderTypedData: OrderTypedData;
@@ -1,2 +1,2 @@
1
- export declare const RAW_PROVIDERS_FILES_PATH: string;
2
- export declare const DEFAULT_GAS_COST_FOR_HOOK_ESTIMATION = 110000;
1
+ export declare const RAW_PROVIDERS_FILES_PATH = "https://raw.githubusercontent.com/cowprotocol/cow-sdk/refs/heads/main/src/bridging/providers";
2
+ export declare const DEFAULT_GAS_COST_FOR_HOOK_ESTIMATION = 110000;
@@ -1,4 +1,4 @@
1
- export declare class BridgeProviderQuoteError extends Error {
2
- readonly context: any;
3
- constructor(message: string, context: any);
4
- }
1
+ export declare class BridgeProviderQuoteError extends Error {
2
+ readonly context: unknown;
3
+ constructor(message: string, context: unknown);
4
+ }
@@ -1,6 +1,6 @@
1
- export * from './types';
2
- export * from './errors';
3
- export * from './utils';
4
- export * from './BridgingSdk/BridgingSdk';
5
- export { MockBridgeProvider } from './providers/mock/MockBridgeProvider';
6
- export { AcrossBridgeProvider, AcrossQuoteResult, AcrossBridgeProviderOptions, } from './providers/across/AcrossBridgeProvider';
1
+ export * from './types';
2
+ export * from './errors';
3
+ export * from './utils';
4
+ export * from './BridgingSdk/BridgingSdk';
5
+ export { MockBridgeProvider } from './providers/mock/MockBridgeProvider';
6
+ export { AcrossBridgeProvider, AcrossQuoteResult, AcrossBridgeProviderOptions, } from './providers/across/AcrossBridgeProvider';
@@ -1,27 +1,27 @@
1
- import { AvailableRoutesRequest, Route, SuggestedFeesRequest, SuggestedFeesResponse } from './types';
2
- export interface AcrossApiOptions {
3
- apiBaseUrl?: string;
4
- }
5
- export declare class AcrossApi {
6
- private readonly options;
7
- constructor(options?: AcrossApiOptions);
8
- /**
9
- * Retrieve available routes for transfers
10
- *
11
- * Returns available routes based on specified parameters. If no parameters are provided, available routes on all
12
- * chains are returned.
13
- *
14
- * See https://docs.across.to/reference/api-reference#available-routes
15
- */
16
- getAvailableRoutes({ originChainId, originToken, destinationChainId, destinationToken, }: AvailableRoutesRequest): Promise<Route[]>;
17
- /**
18
- * Retrieve suggested fee quote for a deposit.
19
- *
20
- * Returns suggested fees based inputToken+outputToken, originChainId, destinationChainId, and amount.
21
- * Also includes data used to compute the fees.
22
- *
23
- * * See https://docs.across.to/reference/api-reference#suggested-fees
24
- */
25
- getSuggestedFees(request: SuggestedFeesRequest): Promise<SuggestedFeesResponse>;
26
- protected fetchApi<T>(path: string, params: Record<string, string>, isValidResponse?: (response: unknown) => response is T): Promise<T>;
27
- }
1
+ import { AvailableRoutesRequest, Route, SuggestedFeesRequest, SuggestedFeesResponse } from './types';
2
+ export interface AcrossApiOptions {
3
+ apiBaseUrl?: string;
4
+ }
5
+ export declare class AcrossApi {
6
+ private readonly options;
7
+ constructor(options?: AcrossApiOptions);
8
+ /**
9
+ * Retrieve available routes for transfers
10
+ *
11
+ * Returns available routes based on specified parameters. If no parameters are provided, available routes on all
12
+ * chains are returned.
13
+ *
14
+ * See https://docs.across.to/reference/api-reference#available-routes
15
+ */
16
+ getAvailableRoutes({ originChainId, originToken, destinationChainId, destinationToken, }: AvailableRoutesRequest): Promise<Route[]>;
17
+ /**
18
+ * Retrieve suggested fee quote for a deposit.
19
+ *
20
+ * Returns suggested fees based inputToken+outputToken, originChainId, destinationChainId, and amount.
21
+ * Also includes data used to compute the fees.
22
+ *
23
+ * * See https://docs.across.to/reference/api-reference#suggested-fees
24
+ */
25
+ getSuggestedFees(request: SuggestedFeesRequest): Promise<SuggestedFeesResponse>;
26
+ protected fetchApi<T>(path: string, params: Record<string, string>, isValidResponse?: (response: unknown) => response is T): Promise<T>;
27
+ }
@@ -1,43 +1,43 @@
1
- import { Signer } from 'ethers';
2
- import { latest as latestAppData } from '@cowprotocol/app-data';
3
- import { BridgeDeposit, BridgeHook, BridgeProvider, BridgeProviderInfo, BridgeQuoteResult, BridgeStatusResult, QuoteBridgeRequest } from '../../types';
4
- import { ChainId, ChainInfo, SupportedChainId, TargetChainId } from '../../../chains';
5
- import { EvmCall, TokenInfo } from '../../../common';
6
- import { AcrossApi, AcrossApiOptions } from './AcrossApi';
7
- import { CowShedSdk, CowShedSdkOptions } from '../../../cow-shed';
8
- import { SuggestedFeesResponse } from './types';
9
- export declare const ACROSS_SUPPORTED_NETWORKS: ChainInfo[];
10
- export interface AcrossBridgeProviderOptions {
11
- /**
12
- * Token info provider
13
- * @param chainId - The chain ID
14
- * @param addresses - The addresses of the tokens to get the info for
15
- * @returns The token infos
16
- */
17
- getTokenInfos?: (chainId: ChainId, addresses: string[]) => Promise<TokenInfo[]>;
18
- apiOptions?: AcrossApiOptions;
19
- cowShedOptions?: CowShedSdkOptions;
20
- }
21
- export interface AcrossQuoteResult extends BridgeQuoteResult {
22
- suggestedFees: SuggestedFeesResponse;
23
- }
24
- export declare class AcrossBridgeProvider implements BridgeProvider<AcrossQuoteResult> {
25
- private options;
26
- protected api: AcrossApi;
27
- protected cowShedSdk: CowShedSdk;
28
- constructor(options?: AcrossBridgeProviderOptions);
29
- info: BridgeProviderInfo;
30
- getNetworks(): Promise<ChainInfo[]>;
31
- getBuyTokens(targetChainId: TargetChainId): Promise<TokenInfo[]>;
32
- getIntermediateTokens(request: QuoteBridgeRequest): Promise<string[]>;
33
- getQuote(request: QuoteBridgeRequest): Promise<AcrossQuoteResult>;
34
- getUnsignedBridgeCall(request: QuoteBridgeRequest, quote: AcrossQuoteResult): Promise<EvmCall>;
35
- getGasLimitEstimationForHook(_request: QuoteBridgeRequest): number;
36
- getSignedHook(chainId: SupportedChainId, unsignedCall: EvmCall, signer: Signer): Promise<BridgeHook>;
37
- decodeBridgeHook(_hook: latestAppData.CoWHook): Promise<BridgeDeposit>;
38
- getBridgingId(_orderUid: string, _settlementTx: string, _logIndex: number): Promise<string>;
39
- getExplorerUrl(bridgingId: string): string;
40
- getStatus(_bridgingId: string): Promise<BridgeStatusResult>;
41
- getCancelBridgingTx(_bridgingId: string): Promise<EvmCall>;
42
- getRefundBridgingTx(_bridgingId: string): Promise<EvmCall>;
43
- }
1
+ import { Signer } from 'ethers';
2
+ import { latest as latestAppData } from '@cowprotocol/app-data';
3
+ import { BridgeDeposit, BridgeHook, BridgeProvider, BridgeProviderInfo, BridgeQuoteResult, BridgeStatusResult, QuoteBridgeRequest } from '../../types';
4
+ import { ChainId, ChainInfo, SupportedChainId, TargetChainId } from '../../../chains';
5
+ import { EvmCall, TokenInfo } from '../../../common';
6
+ import { AcrossApi, AcrossApiOptions } from './AcrossApi';
7
+ import { CowShedSdk, CowShedSdkOptions } from '../../../cow-shed';
8
+ import { SuggestedFeesResponse } from './types';
9
+ export declare const ACROSS_SUPPORTED_NETWORKS: ChainInfo[];
10
+ export interface AcrossBridgeProviderOptions {
11
+ /**
12
+ * Token info provider
13
+ * @param chainId - The chain ID
14
+ * @param addresses - The addresses of the tokens to get the info for
15
+ * @returns The token infos
16
+ */
17
+ getTokenInfos?: (chainId: ChainId, addresses: string[]) => Promise<TokenInfo[]>;
18
+ apiOptions?: AcrossApiOptions;
19
+ cowShedOptions?: CowShedSdkOptions;
20
+ }
21
+ export interface AcrossQuoteResult extends BridgeQuoteResult {
22
+ suggestedFees: SuggestedFeesResponse;
23
+ }
24
+ export declare class AcrossBridgeProvider implements BridgeProvider<AcrossQuoteResult> {
25
+ private options;
26
+ protected api: AcrossApi;
27
+ protected cowShedSdk: CowShedSdk;
28
+ constructor(options?: AcrossBridgeProviderOptions);
29
+ info: BridgeProviderInfo;
30
+ getNetworks(): Promise<ChainInfo[]>;
31
+ getBuyTokens(targetChainId: TargetChainId): Promise<TokenInfo[]>;
32
+ getIntermediateTokens(request: QuoteBridgeRequest): Promise<string[]>;
33
+ getQuote(request: QuoteBridgeRequest): Promise<AcrossQuoteResult>;
34
+ getUnsignedBridgeCall(request: QuoteBridgeRequest, quote: AcrossQuoteResult): Promise<EvmCall>;
35
+ getGasLimitEstimationForHook(_request: QuoteBridgeRequest): number;
36
+ getSignedHook(chainId: SupportedChainId, unsignedCall: EvmCall, signer: Signer): Promise<BridgeHook>;
37
+ decodeBridgeHook(_hook: latestAppData.CoWHook): Promise<BridgeDeposit>;
38
+ getBridgingId(_orderUid: string, _settlementTx: string, _logIndex: number): Promise<string>;
39
+ getExplorerUrl(bridgingId: string): string;
40
+ getStatus(_bridgingId: string): Promise<BridgeStatusResult>;
41
+ getCancelBridgingTx(_bridgingId: string): Promise<EvmCall>;
42
+ getRefundBridgingTx(_bridgingId: string): Promise<EvmCall>;
43
+ }