@cowprotocol/cow-sdk 6.0.0-RC.9 → 6.0.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/README.md +3 -1
- package/dist/README.md +3 -1
- package/dist/bridging/BridgingSdk/BridgingSdk.d.ts +87 -63
- package/dist/bridging/BridgingSdk/findBridgeProviderFromHook.d.ts +2 -0
- package/dist/bridging/BridgingSdk/getBridgeSignedHook.d.ts +8 -0
- package/dist/bridging/BridgingSdk/getCrossChainOrder.d.ts +16 -0
- package/dist/bridging/BridgingSdk/getQuoteWithBridge.d.ts +3 -0
- package/dist/bridging/BridgingSdk/getQuoteWithoutBridge.d.ts +7 -7
- package/dist/bridging/BridgingSdk/mock/bridgeRequestMocks.d.ts +20 -0
- package/dist/bridging/BridgingSdk/types.d.ts +43 -0
- package/dist/bridging/const.d.ts +4 -2
- package/dist/bridging/errors.d.ts +22 -0
- package/dist/bridging/index.d.ts +8 -5
- package/dist/bridging/providers/across/AcrossApi.d.ts +30 -195
- package/dist/bridging/providers/across/AcrossBridgeProvider.d.ts +44 -41
- package/dist/bridging/providers/across/abi.d.ts +154 -154
- package/dist/bridging/providers/across/const/contracts.d.ts +3 -3
- package/dist/bridging/providers/across/const/interfaces.d.ts +3 -0
- package/dist/bridging/providers/across/const/misc.d.ts +2 -0
- package/dist/bridging/providers/across/const/tokens.d.ts +11 -11
- package/dist/bridging/providers/across/createAcrossDepositCall.d.ts +9 -9
- package/dist/bridging/providers/across/getDepositParams.d.ts +4 -0
- package/dist/bridging/providers/across/types.d.ts +242 -0
- package/dist/bridging/providers/across/util.d.ts +43 -39
- package/dist/bridging/providers/bungee/BungeeApi.d.ts +67 -0
- package/dist/bridging/providers/bungee/BungeeBridgeProvider.d.ts +44 -0
- package/dist/bridging/providers/bungee/abi.d.ts +203 -0
- package/dist/bridging/providers/bungee/const/contracts.d.ts +4 -0
- package/dist/bridging/providers/bungee/const/misc.d.ts +8 -0
- package/dist/bridging/providers/bungee/createBungeeDepositCall.d.ts +7 -0
- package/dist/bridging/providers/bungee/getBridgingStatusFromEvents.d.ts +3 -0
- package/dist/bridging/providers/bungee/types.d.ts +267 -0
- package/dist/bridging/providers/bungee/util.d.ts +62 -0
- package/dist/bridging/providers/mock/MockBridgeProvider.d.ts +26 -20
- package/dist/bridging/providers/utils/getGasLimitEstimationForHook.d.ts +4 -0
- package/dist/bridging/types.d.ts +323 -251
- package/dist/bridging/utils.d.ts +9 -6
- package/dist/chains/const/index.d.ts +25 -25
- package/dist/chains/const/path.d.ts +1 -1
- package/dist/chains/details/arbitrum.d.ts +7 -7
- package/dist/chains/details/avalanche.d.ts +2 -0
- package/dist/chains/details/base.d.ts +7 -7
- package/dist/chains/details/gnosis.d.ts +7 -7
- package/dist/chains/details/index.d.ts +8 -0
- package/dist/chains/details/mainnet.d.ts +7 -7
- package/dist/chains/details/optimism.d.ts +2 -2
- package/dist/chains/details/polygon.d.ts +2 -2
- package/dist/chains/details/sepolia.d.ts +7 -7
- package/dist/chains/index.d.ts +4 -3
- package/dist/chains/types.d.ts +127 -122
- package/dist/chains/utils.d.ts +18 -18
- package/dist/common/consts/config.d.ts +9 -9
- package/dist/common/consts/contracts.d.ts +43 -34
- package/dist/common/consts/ipfs.d.ts +2 -2
- package/dist/common/consts/order.d.ts +1 -0
- package/dist/common/consts/path.d.ts +1 -1
- package/dist/common/consts/tokens.d.ts +9 -9
- package/dist/common/generated/CoWShed.d.ts +219 -219
- package/dist/common/generated/CoWShedFactory.d.ts +191 -191
- package/dist/common/generated/ComposableCoW.d.ts +340 -340
- package/dist/common/generated/EthFlow.d.ts +117 -117
- package/dist/common/generated/ExtensibleFallbackHandler.d.ts +282 -282
- package/dist/common/generated/GPv2Settlement.d.ts +107 -107
- package/dist/common/generated/TWAP.d.ts +141 -141
- package/dist/common/generated/common.d.ts +21 -21
- package/dist/common/generated/factories/CoWShedFactory__factory.d.ts +250 -250
- package/dist/common/generated/factories/CoWShed__factory.d.ts +254 -254
- package/dist/common/generated/factories/ComposableCoW__factory.d.ts +475 -475
- package/dist/common/generated/factories/EthFlow__factory.d.ts +124 -124
- package/dist/common/generated/factories/ExtensibleFallbackHandler__factory.d.ts +389 -389
- package/dist/common/generated/factories/GPv2Settlement__factory.d.ts +81 -81
- package/dist/common/generated/factories/TWAP__factory.d.ts +260 -260
- package/dist/common/generated/factories/index.d.ts +7 -7
- package/dist/common/generated/index.d.ts +15 -15
- package/dist/common/index.d.ts +12 -10
- package/dist/common/types/config.d.ts +70 -70
- package/dist/common/types/cow-error.d.ts +4 -4
- package/dist/common/types/ethereum.d.ts +5 -5
- package/dist/common/types/tokens.d.ts +12 -12
- package/dist/common/types/wallets.d.ts +5 -5
- package/dist/common/utils/common.d.ts +1 -0
- package/dist/common/utils/config.d.ts +4 -4
- package/dist/common/utils/log.d.ts +2 -0
- package/dist/common/utils/math.d.ts +19 -0
- package/dist/common/utils/order.d.ts +4 -0
- package/dist/common/utils/serialize.d.ts +1 -1
- package/dist/common/utils/wallet.d.ts +3 -3
- package/dist/composable/ConditionalOrder.d.ts +206 -206
- package/dist/composable/ConditionalOrderFactory.d.ts +19 -19
- package/dist/composable/Multiplexer.d.ts +174 -174
- package/dist/composable/contracts.d.ts +6 -6
- package/dist/composable/generated/ComposableCoW.d.ts +340 -340
- package/dist/composable/generated/ExtensibleFallbackHandler.d.ts +282 -282
- package/dist/composable/generated/TWAP.d.ts +141 -141
- package/dist/composable/generated/common.d.ts +21 -21
- package/dist/composable/generated/factories/ComposableCoW__factory.d.ts +475 -475
- package/dist/composable/generated/factories/ExtensibleFallbackHandler__factory.d.ts +389 -389
- package/dist/composable/generated/factories/TWAP__factory.d.ts +260 -260
- package/dist/composable/generated/factories/index.d.ts +3 -3
- package/dist/composable/generated/index.d.ts +7 -7
- package/dist/composable/index.d.ts +6 -6
- package/dist/composable/orderTypes/Twap.d.ts +242 -242
- package/dist/composable/orderTypes/index.d.ts +3 -3
- package/dist/composable/orderTypes/test/TestConditionalOrder.d.ts +25 -25
- package/dist/composable/types.d.ts +133 -133
- package/dist/composable/utils.d.ts +37 -37
- package/dist/cow-shed/CowShedSdk.d.ts +74 -69
- package/dist/cow-shed/contracts/CoWShedHooks.d.ts +47 -45
- package/dist/cow-shed/contracts/utils.d.ts +4 -4
- package/dist/cow-shed/index.d.ts +3 -2
- package/dist/cow-shed/types.d.ts +17 -17
- package/dist/hooks/utils.d.ts +3 -2
- package/dist/index-847d9333.js +29 -0
- package/dist/index-847d9333.js.map +1 -0
- package/dist/index.d.ts +11 -10
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/dist/index.modern.mjs +1 -1
- package/dist/index.module.js +4 -4
- package/dist/index.module.js.map +1 -1
- package/dist/order-book/api.d.ts +235 -235
- package/dist/order-book/generated/index.d.ts +55 -55
- package/dist/order-book/generated/models/Address.d.ts +4 -4
- package/dist/order-book/generated/models/AppData.d.ts +7 -7
- package/dist/order-book/generated/models/AppDataHash.d.ts +6 -6
- package/dist/order-book/generated/models/AppDataObject.d.ts +7 -7
- package/dist/order-book/generated/models/Auction.d.ts +30 -30
- package/dist/order-book/generated/models/AuctionOrder.d.ts +92 -92
- package/dist/order-book/generated/models/AuctionPrices.d.ts +6 -6
- package/dist/order-book/generated/models/BigUint.d.ts +4 -4
- package/dist/order-book/generated/models/BuyTokenDestination.d.ts +7 -7
- package/dist/order-book/generated/models/CallData.d.ts +4 -4
- package/dist/order-book/generated/models/CompetitionAuction.d.ts +14 -14
- package/dist/order-book/generated/models/CompetitionOrderStatus.d.ts +29 -29
- package/dist/order-book/generated/models/EcdsaSignature.d.ts +4 -4
- package/dist/order-book/generated/models/EcdsaSigningScheme.d.ts +7 -7
- package/dist/order-book/generated/models/EthflowData.d.ts +20 -20
- package/dist/order-book/generated/models/ExecutedAmounts.d.ts +5 -5
- package/dist/order-book/generated/models/ExecutedProtocolFee.d.ts +8 -8
- package/dist/order-book/generated/models/FeePolicy.d.ts +7 -7
- package/dist/order-book/generated/models/InteractionData.d.ts +11 -11
- package/dist/order-book/generated/models/NativePriceResponse.d.ts +10 -10
- package/dist/order-book/generated/models/OnchainOrderData.d.ts +24 -24
- package/dist/order-book/generated/models/Order.d.ts +3 -3
- package/dist/order-book/generated/models/OrderCancellation.d.ts +14 -14
- package/dist/order-book/generated/models/OrderCancellationError.d.ts +15 -15
- package/dist/order-book/generated/models/OrderCancellations.d.ts +18 -18
- package/dist/order-book/generated/models/OrderClass.d.ts +8 -8
- package/dist/order-book/generated/models/OrderCreation.d.ts +80 -80
- package/dist/order-book/generated/models/OrderKind.d.ts +7 -7
- package/dist/order-book/generated/models/OrderMetaData.d.ts +100 -100
- package/dist/order-book/generated/models/OrderParameters.d.ts +53 -53
- package/dist/order-book/generated/models/OrderPostError.d.ts +35 -35
- package/dist/order-book/generated/models/OrderQuoteRequest.d.ts +58 -58
- package/dist/order-book/generated/models/OrderQuoteResponse.d.ts +27 -27
- package/dist/order-book/generated/models/OrderQuoteSide.d.ts +26 -26
- package/dist/order-book/generated/models/OrderQuoteSideKindBuy.d.ts +3 -3
- package/dist/order-book/generated/models/OrderQuoteSideKindSell.d.ts +3 -3
- package/dist/order-book/generated/models/OrderQuoteValidity.d.ts +14 -14
- package/dist/order-book/generated/models/OrderStatus.d.ts +10 -10
- package/dist/order-book/generated/models/PreSignature.d.ts +4 -4
- package/dist/order-book/generated/models/PriceEstimationError.d.ts +12 -12
- package/dist/order-book/generated/models/PriceImprovement.d.ts +12 -12
- package/dist/order-book/generated/models/PriceQuality.d.ts +16 -16
- package/dist/order-book/generated/models/Quote.d.ts +19 -19
- package/dist/order-book/generated/models/SellTokenSource.d.ts +8 -8
- package/dist/order-book/generated/models/Signature.d.ts +6 -6
- package/dist/order-book/generated/models/SigningScheme.d.ts +9 -9
- package/dist/order-book/generated/models/SolverCompetitionResponse.d.ts +30 -30
- package/dist/order-book/generated/models/SolverSettlement.d.ts +47 -47
- package/dist/order-book/generated/models/Surplus.d.ts +7 -7
- package/dist/order-book/generated/models/TokenAmount.d.ts +4 -4
- package/dist/order-book/generated/models/TotalSurplus.d.ts +10 -10
- package/dist/order-book/generated/models/Trade.d.ts +57 -57
- package/dist/order-book/generated/models/TransactionHash.d.ts +4 -4
- package/dist/order-book/generated/models/UID.d.ts +8 -8
- package/dist/order-book/generated/models/Volume.d.ts +6 -6
- package/dist/order-book/index.d.ts +5 -5
- package/dist/order-book/mock.d.ts +63 -63
- package/dist/order-book/quoteAmountsAndCostsUtils.d.ts +35 -22
- package/dist/order-book/request.d.ts +49 -49
- package/dist/order-book/transformOrder.d.ts +10 -10
- package/dist/order-book/types.d.ts +74 -74
- package/dist/order-signing/index.d.ts +2 -2
- package/dist/order-signing/orderSigningUtils.d.ts +97 -97
- package/dist/order-signing/types.d.ts +55 -55
- package/dist/order-signing/utils.d.ts +49 -49
- package/dist/package.json +31 -32
- package/dist/schemas/trading/LimitOrderAdvancedSettings.ts +151 -12
- package/dist/schemas/trading/LimitTradeParameters.ts +136 -15
- package/dist/schemas/trading/QuoteResultsSerialized.ts +292 -27
- package/dist/schemas/trading/QuoterParameters.ts +10 -0
- package/dist/schemas/trading/SwapAdvancedSettings.ts +331 -12
- package/dist/schemas/trading/TradeParameters.ts +136 -15
- package/dist/src/trading/README.md +99 -7
- package/dist/subgraph/api.d.ts +77 -77
- package/dist/subgraph/graphql.d.ts +3203 -3203
- package/dist/subgraph/index.d.ts +1 -1
- package/dist/subgraph/queries.d.ts +14 -14
- package/dist/test/utils.d.ts +1 -0
- package/dist/trading/appDataUtils.d.ts +5 -4
- package/dist/trading/calculateUniqueOrderId.d.ts +5 -5
- package/dist/trading/consts.d.ts +6 -14
- package/dist/trading/getEthFlowTransaction.d.ts +12 -7
- package/dist/trading/getOrderToSign.d.ts +11 -8
- package/dist/trading/getOrderTypedData.d.ts +4 -4
- package/dist/trading/getPreSignTransaction.d.ts +4 -4
- package/dist/trading/getQuote.d.ts +26 -14
- package/dist/trading/index.d.ts +21 -19
- package/dist/trading/postCoWProtocolTrade.d.ts +4 -4
- package/dist/trading/postLimitOrder.d.ts +3 -3
- package/dist/trading/postSellNativeCurrencyOrder.d.ts +4 -7
- package/dist/trading/postSwapOrder.d.ts +5 -5
- package/dist/trading/suggestSlippageBps.d.ts +13 -0
- package/dist/trading/suggestSlippageFromFee.d.ts +19 -0
- package/dist/trading/suggestSlippageFromVolume.d.ts +10 -0
- package/dist/trading/tradingSdk.d.ts +26 -26
- package/dist/trading/types.d.ts +221 -190
- package/dist/trading/utils/getPartnerFeeBps.d.ts +2 -0
- package/dist/trading/{utils.d.ts → utils/misc.d.ts} +27 -27
- package/dist/trading/utils/slippage.d.ts +16 -0
- package/dist/utils-09dadb80.js +2 -0
- package/dist/utils-09dadb80.js.map +1 -0
- package/dist/utils-0ff3f95e.js +2 -0
- package/dist/utils-0ff3f95e.js.map +1 -0
- package/dist/utils-ddcfac77.js +2 -0
- package/dist/utils-ddcfac77.js.map +1 -0
- package/dist/utils.d.ts +3 -3
- package/dist/weiroll/index.d.ts +23 -23
- package/package.json +31 -32
- package/dist/bridging/BridgingSdk/getErc20Decimals.d.ts +0 -4
- package/dist/bridging/BridgingSdk/getQuoteWithBridging.d.ts +0 -9
- package/dist/index-317c25f1.js +0 -29
- package/dist/index-317c25f1.js.map +0 -1
- package/dist/utils-204a9cbe.js +0 -2
- package/dist/utils-204a9cbe.js.map +0 -1
- package/dist/utils-762ee9c3.js +0 -2
- package/dist/utils-762ee9c3.js.map +0 -1
- package/dist/utils-de2eb543.js +0 -2
- package/dist/utils-de2eb543.js.map +0 -1
package/README.md
CHANGED
|
@@ -146,7 +146,7 @@ Since the API supports different networks and environments, there are some optio
|
|
|
146
146
|
|
|
147
147
|
#### Environment configuration
|
|
148
148
|
|
|
149
|
-
`chainId` - can be one of `SupportedChainId.MAINNET`, `SupportedChainId.GNOSIS_CHAIN`, `SupportedChainId.ARBITRUM_ONE`, `SupportedChainId.BASE` or `SupportedChainId.SEPOLIA`
|
|
149
|
+
`chainId` - can be one of `SupportedChainId.MAINNET`, `SupportedChainId.GNOSIS_CHAIN`, `SupportedChainId.ARBITRUM_ONE`, `SupportedChainId.BASE`, `SupportedChainId.AVALANCHE`, `SupportedChainId.POLYGON`, or `SupportedChainId.SEPOLIA`
|
|
150
150
|
|
|
151
151
|
`env` - this parameter affects which environment will be used:
|
|
152
152
|
|
|
@@ -178,6 +178,8 @@ const orderBookApi = new OrderBookApi({
|
|
|
178
178
|
[SupportedChainId.ARBITRUM]: 'https://YOUR_ENDPOINT/arbitrum_one',
|
|
179
179
|
[SupportedChainId.BASE]: 'https://YOUR_ENDPOINT/base',
|
|
180
180
|
[SupportedChainId.SEPOLIA]: 'https://YOUR_ENDPOINT/sepolia',
|
|
181
|
+
[SupportedChainId.POLYGON]: 'https://YOUR_ENDPOINT/polygon',
|
|
182
|
+
[SupportedChainId.AVALANCHE]: 'https://YOUR_ENDPOINT/avalanche',
|
|
181
183
|
},
|
|
182
184
|
})
|
|
183
185
|
```
|
package/dist/README.md
CHANGED
|
@@ -146,7 +146,7 @@ Since the API supports different networks and environments, there are some optio
|
|
|
146
146
|
|
|
147
147
|
#### Environment configuration
|
|
148
148
|
|
|
149
|
-
`chainId` - can be one of `SupportedChainId.MAINNET`, `SupportedChainId.GNOSIS_CHAIN`, `SupportedChainId.ARBITRUM_ONE`, `SupportedChainId.BASE` or `SupportedChainId.SEPOLIA`
|
|
149
|
+
`chainId` - can be one of `SupportedChainId.MAINNET`, `SupportedChainId.GNOSIS_CHAIN`, `SupportedChainId.ARBITRUM_ONE`, `SupportedChainId.BASE`, `SupportedChainId.AVALANCHE`, `SupportedChainId.POLYGON`, or `SupportedChainId.SEPOLIA`
|
|
150
150
|
|
|
151
151
|
`env` - this parameter affects which environment will be used:
|
|
152
152
|
|
|
@@ -178,6 +178,8 @@ const orderBookApi = new OrderBookApi({
|
|
|
178
178
|
[SupportedChainId.ARBITRUM]: 'https://YOUR_ENDPOINT/arbitrum_one',
|
|
179
179
|
[SupportedChainId.BASE]: 'https://YOUR_ENDPOINT/base',
|
|
180
180
|
[SupportedChainId.SEPOLIA]: 'https://YOUR_ENDPOINT/sepolia',
|
|
181
|
+
[SupportedChainId.POLYGON]: 'https://YOUR_ENDPOINT/polygon',
|
|
182
|
+
[SupportedChainId.AVALANCHE]: 'https://YOUR_ENDPOINT/avalanche',
|
|
181
183
|
},
|
|
182
184
|
})
|
|
183
185
|
```
|
|
@@ -1,63 +1,87 @@
|
|
|
1
|
-
import { SwapAdvancedSettings, TradingSdk } from '../../trading';
|
|
2
|
-
import { BridgeProvider, BridgeQuoteResult,
|
|
3
|
-
import { TokenInfo } from '../../common';
|
|
4
|
-
import { ChainInfo } from '../../chains';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
*
|
|
30
|
-
*/
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
*
|
|
34
|
-
*/
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
*
|
|
38
|
-
*/
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
*
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
*
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
*
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
1
|
+
import { SwapAdvancedSettings, TradingSdk } from '../../trading';
|
|
2
|
+
import { BridgeProvider, BridgeQuoteResult, BridgeStatusResult, BuyTokensParams, CrossChainOrder, CrossChainQuoteAndPost, QuoteBridgeRequest } from '../types';
|
|
3
|
+
import { CowEnv, TokenInfo } from '../../common';
|
|
4
|
+
import { ChainInfo, SupportedChainId } from '../../chains';
|
|
5
|
+
import { OrderBookApi } from '../../order-book';
|
|
6
|
+
export interface BridgingSdkOptions {
|
|
7
|
+
/**
|
|
8
|
+
* Providers for the bridging.
|
|
9
|
+
*/
|
|
10
|
+
providers: BridgeProvider<BridgeQuoteResult>[];
|
|
11
|
+
/**
|
|
12
|
+
* Trading SDK.
|
|
13
|
+
*/
|
|
14
|
+
tradingSdk?: TradingSdk;
|
|
15
|
+
/**
|
|
16
|
+
* Order book API.
|
|
17
|
+
*/
|
|
18
|
+
orderBookApi?: OrderBookApi;
|
|
19
|
+
/**
|
|
20
|
+
* Enable logging for the bridging SDK.
|
|
21
|
+
*/
|
|
22
|
+
enableLogging?: boolean;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Parameters for the `getOrder` method.
|
|
26
|
+
*/
|
|
27
|
+
export interface GetOrderParams {
|
|
28
|
+
/**
|
|
29
|
+
* Id of a network where order was settled
|
|
30
|
+
*/
|
|
31
|
+
chainId: SupportedChainId;
|
|
32
|
+
/**
|
|
33
|
+
* The unique identifier of the order.
|
|
34
|
+
*/
|
|
35
|
+
orderId: string;
|
|
36
|
+
/**
|
|
37
|
+
* The environment of the order
|
|
38
|
+
*/
|
|
39
|
+
env?: CowEnv;
|
|
40
|
+
}
|
|
41
|
+
export type BridgingSdkConfig = Required<Omit<BridgingSdkOptions, 'enableLogging'>>;
|
|
42
|
+
/**
|
|
43
|
+
* SDK for bridging for swapping tokens between different chains.
|
|
44
|
+
*/
|
|
45
|
+
export declare class BridgingSdk {
|
|
46
|
+
readonly options: BridgingSdkOptions;
|
|
47
|
+
protected config: BridgingSdkConfig;
|
|
48
|
+
constructor(options: BridgingSdkOptions);
|
|
49
|
+
private get provider();
|
|
50
|
+
/**
|
|
51
|
+
* Get the providers for the bridging.
|
|
52
|
+
*/
|
|
53
|
+
getProviders(): BridgeProvider<BridgeQuoteResult>[];
|
|
54
|
+
/**
|
|
55
|
+
* Get the available sources networks for the bridging.
|
|
56
|
+
*/
|
|
57
|
+
getSourceNetworks(): Promise<ChainInfo[]>;
|
|
58
|
+
/**
|
|
59
|
+
* Get the available target networks for the bridging.
|
|
60
|
+
*/
|
|
61
|
+
getTargetNetworks(): Promise<ChainInfo[]>;
|
|
62
|
+
/**
|
|
63
|
+
* Get the available buy tokens for buying in a specific target chain
|
|
64
|
+
|
|
65
|
+
* @param params
|
|
66
|
+
*/
|
|
67
|
+
getBuyTokens(params: BuyTokensParams): Promise<TokenInfo[]>;
|
|
68
|
+
/**
|
|
69
|
+
* Get quote details, including a callback function to post the order on-chain.
|
|
70
|
+
*
|
|
71
|
+
* This method support both, cross-chain swaps and single-chain swap.
|
|
72
|
+
*
|
|
73
|
+
* The return type will be either `QuoteAndPost` or `BridgeQuoteAndPost`.
|
|
74
|
+
*
|
|
75
|
+
* To safely assert the type in Typescript, you can use:
|
|
76
|
+
* - `isBridgeQuoteAndPost(result)` utility.
|
|
77
|
+
* - `isQuoteAndPost(result)` utility.
|
|
78
|
+
* - `assertIsBridgeQuoteAndPost(result)` assertion.
|
|
79
|
+
* - `assertIsQuoteAndPost(result)` assertion.
|
|
80
|
+
*
|
|
81
|
+
* @throws Error if no path is found
|
|
82
|
+
*/
|
|
83
|
+
getQuote(quoteBridgeRequest: QuoteBridgeRequest, advancedSettings?: SwapAdvancedSettings): Promise<CrossChainQuoteAndPost>;
|
|
84
|
+
getOrder(params: GetOrderParams): Promise<CrossChainOrder | null>;
|
|
85
|
+
getOrderBridgingStatus(bridgingId: string, originChainId: SupportedChainId): Promise<BridgeStatusResult>;
|
|
86
|
+
getProviderFromAppData(fullAppData: string): BridgeProvider<BridgeQuoteResult> | undefined;
|
|
87
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { EvmCall } from '../../common';
|
|
2
|
+
import { BridgeHook, BridgeQuoteResult, QuoteBridgeRequest } from '../types';
|
|
3
|
+
import { BridgeResultContext } from './types';
|
|
4
|
+
export declare function getBridgeSignedHook(bridgeRequest: QuoteBridgeRequest, { provider, signer, hookGasLimit, swapResult, validToOverride }: BridgeResultContext): Promise<{
|
|
5
|
+
hook: BridgeHook;
|
|
6
|
+
unsignedBridgeCall: EvmCall;
|
|
7
|
+
bridgingQuote: BridgeQuoteResult;
|
|
8
|
+
}>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { BridgeProvider, BridgeQuoteResult, CrossChainOrder } from '../types';
|
|
2
|
+
import { CowEnv } from '../../common';
|
|
3
|
+
import { SupportedChainId } from '../../chains';
|
|
4
|
+
import { OrderBookApi } from '../../order-book';
|
|
5
|
+
interface GetCrossChainOrderParams {
|
|
6
|
+
chainId: SupportedChainId;
|
|
7
|
+
orderId: string;
|
|
8
|
+
orderBookApi: OrderBookApi;
|
|
9
|
+
providers: BridgeProvider<BridgeQuoteResult>[];
|
|
10
|
+
env: CowEnv;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Fetch a cross-chain order and its status.
|
|
14
|
+
*/
|
|
15
|
+
export declare function getCrossChainOrder(params: GetCrossChainOrderParams): Promise<CrossChainOrder | null>;
|
|
16
|
+
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { QuoteAndPost, SwapAdvancedSettings, TradingSdk } from '../../trading';
|
|
2
|
-
import { QuoteBridgeRequest } from '../types';
|
|
3
|
-
export declare function getQuoteWithoutBridge(params: {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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>;
|
|
@@ -0,0 +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;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { BridgeHook, BridgeProvider, BridgeQuoteResult, BridgeQuoteResults, QuoteBridgeRequest, QuoteBridgeRequestWithoutAmount } from '../types';
|
|
2
|
+
import { AppDataInfo, QuoteResults, SwapAdvancedSettings, TradingSdk } from '../../trading';
|
|
3
|
+
import { SignerLike } from '../../common';
|
|
4
|
+
import { Signer } from '@ethersproject/abstract-signer';
|
|
5
|
+
export type GetQuoteWithBridgeParams<T extends BridgeQuoteResult> = {
|
|
6
|
+
/**
|
|
7
|
+
* Overall request for the swap and the bridge.
|
|
8
|
+
*/
|
|
9
|
+
swapAndBridgeRequest: QuoteBridgeRequest;
|
|
10
|
+
/**
|
|
11
|
+
* Advanced settings for the swap.
|
|
12
|
+
*/
|
|
13
|
+
advancedSettings?: SwapAdvancedSettings;
|
|
14
|
+
/**
|
|
15
|
+
* Provider for the bridge.
|
|
16
|
+
*/
|
|
17
|
+
provider: BridgeProvider<T>;
|
|
18
|
+
/**
|
|
19
|
+
* Trading SDK.
|
|
20
|
+
*/
|
|
21
|
+
tradingSdk: TradingSdk;
|
|
22
|
+
/**
|
|
23
|
+
* For quote fetching we have to sign bridging hooks.
|
|
24
|
+
* But we won't do that using users wallet and will use some static PK.
|
|
25
|
+
*/
|
|
26
|
+
bridgeHookSigner?: SignerLike;
|
|
27
|
+
};
|
|
28
|
+
export interface GetBridgeResultResult {
|
|
29
|
+
bridgeResult: BridgeQuoteResults;
|
|
30
|
+
bridgeHook: BridgeHook;
|
|
31
|
+
appDataInfo: AppDataInfo;
|
|
32
|
+
}
|
|
33
|
+
export interface BridgeResultContext<T extends BridgeQuoteResult = BridgeQuoteResult> {
|
|
34
|
+
swapAndBridgeRequest: QuoteBridgeRequest;
|
|
35
|
+
swapResult: QuoteResults;
|
|
36
|
+
intermediateTokenAmount: bigint;
|
|
37
|
+
bridgeRequestWithoutAmount: QuoteBridgeRequestWithoutAmount;
|
|
38
|
+
provider: BridgeProvider<T>;
|
|
39
|
+
signer: Signer;
|
|
40
|
+
hookGasLimit: number;
|
|
41
|
+
validToOverride?: number;
|
|
42
|
+
appDataOverride?: SwapAdvancedSettings['appData'];
|
|
43
|
+
}
|
package/dist/bridging/const.d.ts
CHANGED
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
export declare const RAW_PROVIDERS_FILES_PATH
|
|
2
|
-
export declare const DEFAULT_GAS_COST_FOR_HOOK_ESTIMATION =
|
|
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 = 240000;
|
|
3
|
+
export declare const COW_SHED_PROXY_CREATION_GAS = 360000;
|
|
4
|
+
export declare const HOOK_DAPP_BRIDGE_PROVIDER_PREFIX = "cow-sdk://bridging/providers";
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export declare enum BridgeQuoteErrors {
|
|
2
|
+
NO_INTERMEDIATE_TOKENS = "NO_INTERMEDIATE_TOKENS",
|
|
3
|
+
API_ERROR = "API_ERROR",
|
|
4
|
+
INVALID_API_JSON_RESPONSE = "INVALID_API_JSON_RESPONSE",
|
|
5
|
+
ONLY_SELL_ORDER_SUPPORTED = "ONLY_SELL_ORDER_SUPPORTED",
|
|
6
|
+
TX_BUILD_ERROR = "TX_BUILD_ERROR",
|
|
7
|
+
QUOTE_ERROR = "QUOTE_ERROR",
|
|
8
|
+
NO_ROUTES = "NO_ROUTES",
|
|
9
|
+
INVALID_BRIDGE = "INVALID_BRIDGE"
|
|
10
|
+
}
|
|
11
|
+
export declare class BridgeProviderQuoteError extends Error {
|
|
12
|
+
readonly context?: unknown | undefined;
|
|
13
|
+
constructor(message: BridgeQuoteErrors, context?: unknown | undefined);
|
|
14
|
+
}
|
|
15
|
+
export declare class BridgeProviderError extends Error {
|
|
16
|
+
readonly context: unknown;
|
|
17
|
+
constructor(message: string, context: unknown);
|
|
18
|
+
}
|
|
19
|
+
export declare class BridgeOrderParsingError extends Error {
|
|
20
|
+
readonly context?: unknown | undefined;
|
|
21
|
+
constructor(message: string, context?: unknown | undefined);
|
|
22
|
+
}
|
package/dist/bridging/index.d.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
export * from './types';
|
|
2
|
-
export * from './
|
|
3
|
-
export * from './
|
|
4
|
-
export
|
|
5
|
-
export
|
|
1
|
+
export * from './types';
|
|
2
|
+
export * from './errors';
|
|
3
|
+
export * from './utils';
|
|
4
|
+
export * from './BridgingSdk/BridgingSdk';
|
|
5
|
+
export * from './const';
|
|
6
|
+
export { getCrossChainOrder } from './BridgingSdk/getCrossChainOrder';
|
|
7
|
+
export { AcrossBridgeProvider, AcrossQuoteResult, AcrossBridgeProviderOptions, } from './providers/across/AcrossBridgeProvider';
|
|
8
|
+
export { BungeeBridgeProvider, BungeeQuoteResult, BungeeBridgeProviderOptions, } from './providers/bungee/BungeeBridgeProvider';
|
|
@@ -1,195 +1,30 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* Recipient of the deposit. Can be an EOA or a contract. If this is an EOA and message is defined, then the API will throw a 4xx error.
|
|
33
|
-
*
|
|
34
|
-
* Example: 0xc186fA914353c44b2E33eBE05f21846F1048bEda
|
|
35
|
-
*/
|
|
36
|
-
recipient?: string;
|
|
37
|
-
/**
|
|
38
|
-
* The quote timestamp used to compute the LP fees. When bridging with across, the user only specifies the quote
|
|
39
|
-
* timestamp in their transaction. The relayer then determines the utilization at that timestamp to determine the
|
|
40
|
-
* user's fee. This timestamp must be close (within 10 minutes or so) to the current time on the chain where the
|
|
41
|
-
* user is depositing funds and it should be <= the current block timestamp on mainnet. This allows the user to know
|
|
42
|
-
* exactly what LP fee they will pay before sending the transaction.
|
|
43
|
-
*
|
|
44
|
-
* If this value isn't provided in the request, the API will assume the latest block timestamp on mainnet.
|
|
45
|
-
*
|
|
46
|
-
* Example: 1653547649
|
|
47
|
-
*/
|
|
48
|
-
timestamp?: number;
|
|
49
|
-
/**
|
|
50
|
-
* Optionally override the relayer address used to simulate the fillRelay() call that estimates the gas costs
|
|
51
|
-
* needed to fill a deposit. This simulation result impacts the returned suggested-fees. The reason to customize the
|
|
52
|
-
* EOA would be primarily if the recipientAddress is a contract and requires a certain relayer to submit the fill,
|
|
53
|
-
* or if one specific relayer has the necessary token balance to make the fill.
|
|
54
|
-
*
|
|
55
|
-
* Example: 0x428AB2BA90Eba0a4Be7aF34C9Ac451ab061AC010
|
|
56
|
-
*/
|
|
57
|
-
relayer?: string;
|
|
58
|
-
}
|
|
59
|
-
export interface SuggestedFeesLimits {
|
|
60
|
-
/**
|
|
61
|
-
* The minimum deposit size in the tokens' units.
|
|
62
|
-
*
|
|
63
|
-
* Note: USDC has 6 decimals, so this value would be the number of USDC multiplied by 1e6. For WETH, that would be 1e18.
|
|
64
|
-
*/
|
|
65
|
-
minDeposit: string;
|
|
66
|
-
/**
|
|
67
|
-
* The maximum deposit size in the tokens' units. Note: The formatting of this number is the same as minDeposit.
|
|
68
|
-
*/
|
|
69
|
-
maxDeposit: string;
|
|
70
|
-
/**
|
|
71
|
-
* The max deposit size that can be relayed "instantly" on the destination chain.
|
|
72
|
-
*
|
|
73
|
-
* Instantly means that there is relayer capital readily available and that a relayer is expected to relay within
|
|
74
|
-
* seconds to 5 minutes of the deposit.
|
|
75
|
-
*/
|
|
76
|
-
maxDepositInstant: string;
|
|
77
|
-
/**
|
|
78
|
-
* The max deposit size that can be relayed with a "short delay" on the destination chain.
|
|
79
|
-
*
|
|
80
|
-
* This means that there is relayer capital available on mainnet and that a relayer will immediately begin moving
|
|
81
|
-
* that capital over the canonical bridge to relay the deposit. Depending on the chain, the time for this can vary.
|
|
82
|
-
*
|
|
83
|
-
* Polygon is the worst case where it can take between 20 and 35 minutes for the relayer to receive the funds
|
|
84
|
-
* and relay.
|
|
85
|
-
*
|
|
86
|
-
* Arbitrum is much faster, with a range between 5 and 15 minutes. Note: if the transfer size is greater than this,
|
|
87
|
-
* the estimate should be between 2-4 hours for a slow relay to be processed from the mainnet pool.
|
|
88
|
-
*/
|
|
89
|
-
maxDepositShortDelay: string;
|
|
90
|
-
/**
|
|
91
|
-
* The recommended deposit size that can be relayed "instantly" on the destination chain.
|
|
92
|
-
*
|
|
93
|
-
* Instantly means that there is relayer capital readily available and that a relayer is expected to relay
|
|
94
|
-
* within seconds to 5 minutes of the deposit. Value is in the smallest unit of the respective token.
|
|
95
|
-
*/
|
|
96
|
-
recommendedDepositInstant: string;
|
|
97
|
-
}
|
|
98
|
-
export interface SuggestedFeesResponse {
|
|
99
|
-
/**
|
|
100
|
-
* Percentage of the transfer amount that should go to the relayer as a fee in total. The value is inclusive of lpFee.pct.
|
|
101
|
-
*
|
|
102
|
-
* This is the strongly recommended minimum value to ensure a relayer will perform the transfer under the current
|
|
103
|
-
* network conditions.
|
|
104
|
-
*
|
|
105
|
-
* The value returned in this field is guaranteed to be at least 0.03% in order to meet minimum relayer fee requirements
|
|
106
|
-
*/
|
|
107
|
-
totalRelayFee: PctFee;
|
|
108
|
-
/**
|
|
109
|
-
* The percentage of the transfer amount that should go the relayer as a fee to cover relayer capital costs.
|
|
110
|
-
*/
|
|
111
|
-
relayerCapitalFee: PctFee;
|
|
112
|
-
/**
|
|
113
|
-
* The percentage of the transfer amount that should go the relayer as a fee to cover relayer gas costs.
|
|
114
|
-
*/
|
|
115
|
-
relayerGasFee: PctFee;
|
|
116
|
-
/**
|
|
117
|
-
* The percent of the amount that will go to the LPs as a fee for borrowing their funds.
|
|
118
|
-
*/
|
|
119
|
-
lpFee: PctFee;
|
|
120
|
-
/**
|
|
121
|
-
* The quote timestamp that was used to compute the lpFeePct. To pay the quoted LP fee, the user would need to pass
|
|
122
|
-
* this quote timestamp to the protocol when sending their bridge transaction.
|
|
123
|
-
*/
|
|
124
|
-
timestamp: string;
|
|
125
|
-
/**
|
|
126
|
-
* Is the input amount below the minimum transfer amount.
|
|
127
|
-
*/
|
|
128
|
-
isAmountTooLow: boolean;
|
|
129
|
-
/**
|
|
130
|
-
* The block used associated with this quote, used to compute lpFeePct.
|
|
131
|
-
*/
|
|
132
|
-
quoteBlock: string;
|
|
133
|
-
/**
|
|
134
|
-
* The contract address of the origin SpokePool.
|
|
135
|
-
*/
|
|
136
|
-
spokePoolAddress: string;
|
|
137
|
-
/**
|
|
138
|
-
* The relayer that is suggested to be set as the exclusive relayer for in the depositV3 call for the fastest fill.
|
|
139
|
-
*
|
|
140
|
-
* Note: when set to "0x0000000000000000000000000000000000000000", relayer exclusivity will be disabled.
|
|
141
|
-
* This value is returned in cases where using an exclusive relayer is not recommended.
|
|
142
|
-
*/
|
|
143
|
-
exclusiveRelayer: string;
|
|
144
|
-
/**
|
|
145
|
-
* The suggested exclusivity period (in seconds) the exclusive relayer should be given to fill before other relayers
|
|
146
|
-
* are allowed to take the fill. Note: when set to "0", relayer exclusivity will be disabled.
|
|
147
|
-
*
|
|
148
|
-
* This value is returned in cases where using an exclusive relayer is not recommended.
|
|
149
|
-
*/
|
|
150
|
-
exclusivityDeadline: string;
|
|
151
|
-
/**
|
|
152
|
-
* The expected time (in seconds) for a fill to be made. Represents 75th percentile of the 7-day rolling average of times (updated daily). Times are dynamic by origin/destination token/chain for a given amount.
|
|
153
|
-
*/
|
|
154
|
-
expectedFillTimeSec: string;
|
|
155
|
-
/**
|
|
156
|
-
* The recommended deadline (UNIX timestamp in seconds) for the relayer to fill the deposit. After this destination chain timestamp, the fill will revert on the destination chain.
|
|
157
|
-
*/
|
|
158
|
-
fillDeadline: string;
|
|
159
|
-
limits: SuggestedFeesLimits;
|
|
160
|
-
}
|
|
161
|
-
export interface PctFee {
|
|
162
|
-
/**
|
|
163
|
-
* Note: 1% is represented as 1e16, 100% is 1e18, 50% is 5e17, etc. These values are in the same format that the contract understands.
|
|
164
|
-
*
|
|
165
|
-
* Example: 100200000000000
|
|
166
|
-
*/
|
|
167
|
-
pct: string;
|
|
168
|
-
total: string;
|
|
169
|
-
}
|
|
170
|
-
export interface AcrossApiOptions {
|
|
171
|
-
apiBaseUrl?: string;
|
|
172
|
-
}
|
|
173
|
-
export declare class AcrossApi {
|
|
174
|
-
private readonly options;
|
|
175
|
-
constructor(options?: AcrossApiOptions);
|
|
176
|
-
/**
|
|
177
|
-
* Retrieve available routes for transfers
|
|
178
|
-
*
|
|
179
|
-
* Returns available routes based on specified parameters. If no parameters are provided, available routes on all
|
|
180
|
-
* chains are returned.
|
|
181
|
-
*
|
|
182
|
-
* See https://docs.across.to/reference/api-reference#available-routes
|
|
183
|
-
*/
|
|
184
|
-
getAvailableRoutes({ originChainId, originToken, destinationChainId, destinationToken, }: AvailableRoutesRequest): Promise<Route[]>;
|
|
185
|
-
/**
|
|
186
|
-
* Retrieve suggested fee quote for a deposit.
|
|
187
|
-
*
|
|
188
|
-
* Returns suggested fees based inputToken+outputToken, originChainId, destinationChainId, and amount.
|
|
189
|
-
* Also includes data used to compute the fees.
|
|
190
|
-
*
|
|
191
|
-
* * See https://docs.across.to/reference/api-reference#suggested-fees
|
|
192
|
-
*/
|
|
193
|
-
getSuggestedFees(request: SuggestedFeesRequest): Promise<SuggestedFeesResponse>;
|
|
194
|
-
protected fetchApi<T>(path: string, params: Record<string, string>, isValidResponse?: (response: unknown) => response is T): Promise<T>;
|
|
195
|
-
}
|
|
1
|
+
import { AvailableRoutesRequest, DepositStatusRequest, DepositStatusResponse, Route, SuggestedFeesRequest, SuggestedFeesResponse } from './types';
|
|
2
|
+
import { TokenInfo } from '../../../common';
|
|
3
|
+
export interface AcrossApiOptions {
|
|
4
|
+
apiBaseUrl?: string;
|
|
5
|
+
}
|
|
6
|
+
export declare class AcrossApi {
|
|
7
|
+
private readonly options;
|
|
8
|
+
constructor(options?: AcrossApiOptions);
|
|
9
|
+
/**
|
|
10
|
+
* Retrieve available routes for transfers
|
|
11
|
+
*
|
|
12
|
+
* Returns available routes based on specified parameters. If no parameters are provided, available routes on all
|
|
13
|
+
* chains are returned.
|
|
14
|
+
*
|
|
15
|
+
* See https://docs.across.to/reference/api-reference#available-routes
|
|
16
|
+
*/
|
|
17
|
+
getAvailableRoutes({ originChainId, originToken, destinationChainId, destinationToken, }: AvailableRoutesRequest): Promise<Route[]>;
|
|
18
|
+
/**
|
|
19
|
+
* Retrieve suggested fee quote for a deposit.
|
|
20
|
+
*
|
|
21
|
+
* Returns suggested fees based inputToken+outputToken, originChainId, destinationChainId, and amount.
|
|
22
|
+
* Also includes data used to compute the fees.
|
|
23
|
+
*
|
|
24
|
+
* * See https://docs.across.to/reference/api-reference#suggested-fees
|
|
25
|
+
*/
|
|
26
|
+
getSuggestedFees(request: SuggestedFeesRequest): Promise<SuggestedFeesResponse>;
|
|
27
|
+
getSupportedTokens(): Promise<TokenInfo[]>;
|
|
28
|
+
getDepositStatus(request: DepositStatusRequest): Promise<DepositStatusResponse>;
|
|
29
|
+
protected fetchApi<T>(path: string, params: Record<string, string>, isValidResponse?: (response: unknown) => response is T): Promise<T>;
|
|
30
|
+
}
|