@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/dist/order-book/api.d.ts
CHANGED
|
@@ -1,235 +1,235 @@
|
|
|
1
|
-
import 'cross-fetch/polyfill';
|
|
2
|
-
import { ApiBaseUrls, ApiContext, PartialApiContext } from '../common/types/config';
|
|
3
|
-
import { Address, AppDataHash, AppDataObject, CompetitionOrderStatus, NativePriceResponse, OrderCancellations, OrderCreation, OrderQuoteRequest, OrderQuoteResponse, SolverCompetitionResponse, TotalSurplus, Trade, TransactionHash, UID } from './generated';
|
|
4
|
-
import { EnrichedOrder } from './types';
|
|
5
|
-
/**
|
|
6
|
-
* An object containing *production* environment base URLs for each supported `chainId`.
|
|
7
|
-
* @see {@link https://api.cow.fi/docs/#/}
|
|
8
|
-
*/
|
|
9
|
-
export declare const ORDER_BOOK_PROD_CONFIG: ApiBaseUrls;
|
|
10
|
-
/**
|
|
11
|
-
* An object containing *staging* environment base URLs for each supported `chainId`.
|
|
12
|
-
*/
|
|
13
|
-
export declare const ORDER_BOOK_STAGING_CONFIG: ApiBaseUrls;
|
|
14
|
-
/**
|
|
15
|
-
* The parameters for the `getOrders` request.
|
|
16
|
-
*/
|
|
17
|
-
export type GetOrdersRequest = {
|
|
18
|
-
owner: Address;
|
|
19
|
-
offset?: number;
|
|
20
|
-
limit?: number;
|
|
21
|
-
};
|
|
22
|
-
/**
|
|
23
|
-
* The CoW Protocol OrderBook API client.
|
|
24
|
-
*
|
|
25
|
-
* This is the main entry point for interacting with the CoW Protocol OrderBook API. The main advantage of using
|
|
26
|
-
* this client is the batteries-included approach to interacting with the API. It handles:
|
|
27
|
-
*
|
|
28
|
-
* - Environment configuration (mainnet, staging, etc.)
|
|
29
|
-
* - Rate limiting
|
|
30
|
-
* - Retries
|
|
31
|
-
* - Backoff
|
|
32
|
-
* - Error handling
|
|
33
|
-
* - Request signing
|
|
34
|
-
* - Request validation
|
|
35
|
-
*
|
|
36
|
-
* @example
|
|
37
|
-
*
|
|
38
|
-
* ```typescript
|
|
39
|
-
* import { OrderBookApi, OrderSigningUtils, SupportedChainId } from '@cowprotocol/cow-sdk'
|
|
40
|
-
* import { Web3Provider } from '@ethersproject/providers'
|
|
41
|
-
*
|
|
42
|
-
* const account = 'YOUR_WALLET_ADDRESS'
|
|
43
|
-
* const chainId = 100 // Gnosis chain
|
|
44
|
-
* const provider = new Web3Provider(window.ethereum)
|
|
45
|
-
* const signer = provider.getSigner()
|
|
46
|
-
*
|
|
47
|
-
* const quoteRequest = {
|
|
48
|
-
* sellToken: '0x6a023ccd1ff6f2045c3309768ead9e68f978f6e1', // WETH gnosis chain
|
|
49
|
-
* buyToken: '0x9c58bacc331c9aa871afd802db6379a98e80cedb', // GNO gnosis chain
|
|
50
|
-
* from: account,
|
|
51
|
-
* receiver: account,
|
|
52
|
-
* sellAmountBeforeFee: (0.4 * 10 ** 18).toString(), // 0.4 WETH
|
|
53
|
-
* kind: OrderQuoteSide.kind.SELL,
|
|
54
|
-
* }
|
|
55
|
-
*
|
|
56
|
-
* const orderBookApi = new OrderBookApi({ chainId: SupportedChainId.GNOSIS_CHAIN })
|
|
57
|
-
*
|
|
58
|
-
* async function main() {
|
|
59
|
-
* const { quote } = await orderBookApi.getQuote(quoteRequest)
|
|
60
|
-
*
|
|
61
|
-
* const orderSigningResult = await OrderSigningUtils.signOrder(quote, chainId, signer)
|
|
62
|
-
*
|
|
63
|
-
* const orderId = await orderBookApi.sendOrder({ ...quote, ...orderSigningResult })
|
|
64
|
-
*
|
|
65
|
-
* const order = await orderBookApi.getOrder(orderId)
|
|
66
|
-
*
|
|
67
|
-
* const trades = await orderBookApi.getTrades({ orderId })
|
|
68
|
-
*
|
|
69
|
-
* const orderCancellationSigningResult = await OrderSigningUtils.signOrderCancellations([orderId], chainId, signer)
|
|
70
|
-
*
|
|
71
|
-
* const cancellationResult = await orderBookApi.sendSignedOrderCancellations({...orderCancellationSigningResult, orderUids: [orderId] })
|
|
72
|
-
*
|
|
73
|
-
* console.log('Results: ', { orderId, order, trades, orderCancellationSigningResult, cancellationResult })
|
|
74
|
-
* }
|
|
75
|
-
* ```
|
|
76
|
-
*
|
|
77
|
-
* @see {@link Swagger documentation https://api.cow.fi/docs/#/}
|
|
78
|
-
* @see {@link OrderBook API https://github.com/cowprotocol/services}
|
|
79
|
-
*/
|
|
80
|
-
export declare class OrderBookApi {
|
|
81
|
-
context: ApiContext;
|
|
82
|
-
private rateLimiter;
|
|
83
|
-
/**
|
|
84
|
-
* Creates a new instance of the CoW Protocol OrderBook API client.
|
|
85
|
-
* @param context - The API context to use. If not provided, the default context will be used.
|
|
86
|
-
*/
|
|
87
|
-
constructor(context?: PartialApiContext);
|
|
88
|
-
/**
|
|
89
|
-
* Get the version of the API.
|
|
90
|
-
* @param contextOverride Optional context override for this request.
|
|
91
|
-
* @returns The version of the API.
|
|
92
|
-
* @see {@link https://api.cow.fi/docs/#/default/get_api_v1_version}
|
|
93
|
-
*/
|
|
94
|
-
getVersion(contextOverride?: PartialApiContext): Promise<string>;
|
|
95
|
-
/**
|
|
96
|
-
* Get all the trades for either an `owner` **OR** `orderUid`.
|
|
97
|
-
*
|
|
98
|
-
* Given that an order *may* be partially fillable, it is possible that a discrete order (`orderUid`)
|
|
99
|
-
* may have *multiple* trades. Therefore, this method returns a list of trades, either for *all* the orders
|
|
100
|
-
* of a given `owner`, or for a discrete order (`orderUid`).
|
|
101
|
-
* @param request Either an `owner` or an `orderUid` **MUST** be specified.
|
|
102
|
-
* @param contextOverride Optional context override for this request.
|
|
103
|
-
* @returns A list of trades matching the request.
|
|
104
|
-
*/
|
|
105
|
-
getTrades(request: {
|
|
106
|
-
owner?: Address;
|
|
107
|
-
orderUid?: UID;
|
|
108
|
-
}, contextOverride?: PartialApiContext): Promise<Array<Trade>>;
|
|
109
|
-
/**
|
|
110
|
-
* Get a list of orders for a given `owner`.
|
|
111
|
-
* @param request The request parameters with `request.offset = 0` and `request.limit = 1000` by default.
|
|
112
|
-
* @param contextOverride Optional context override for this request.
|
|
113
|
-
* @returns A list of orders matching the request.
|
|
114
|
-
* @see {@link GetOrdersRequest}
|
|
115
|
-
* @see {@link EnrichedOrder}
|
|
116
|
-
*/
|
|
117
|
-
getOrders({ owner, offset, limit }: GetOrdersRequest, contextOverride?: PartialApiContext): Promise<Array<EnrichedOrder>>;
|
|
118
|
-
/**
|
|
119
|
-
* Get a list of orders from a given settlement transaction hash.
|
|
120
|
-
* @param txHash The transaction hash.
|
|
121
|
-
* @param contextOverride Optional context override for this request.
|
|
122
|
-
* @returns A list of orders matching the request.
|
|
123
|
-
* @see {@link EnrichedOrder}
|
|
124
|
-
*/
|
|
125
|
-
getTxOrders(txHash: TransactionHash, contextOverride?: PartialApiContext): Promise<Array<EnrichedOrder>>;
|
|
126
|
-
/**
|
|
127
|
-
* Get an order by its unique identifier, `orderUid`.
|
|
128
|
-
* @param orderUid The unique identifier of the order.
|
|
129
|
-
* @param contextOverride Optional context override for this request.
|
|
130
|
-
* @returns The order matching the request.
|
|
131
|
-
*/
|
|
132
|
-
getOrder(orderUid: UID, contextOverride?: PartialApiContext): Promise<EnrichedOrder>;
|
|
133
|
-
/**
|
|
134
|
-
* Get the order status while open
|
|
135
|
-
*/
|
|
136
|
-
getOrderCompetitionStatus(orderUid: UID, contextOverride?: PartialApiContext): Promise<CompetitionOrderStatus>;
|
|
137
|
-
/**
|
|
138
|
-
* Attempt to get an order by its unique identifier, `orderUid`, from multiple environments.
|
|
139
|
-
*
|
|
140
|
-
* **NOTE**: The environment refers to either `prod` or `staging`. This allows a conveience method to
|
|
141
|
-
* attempt to get an order from both environments, in the event that the order is not found in the
|
|
142
|
-
* environment specified in the context.
|
|
143
|
-
* @param orderUid The unique identifier of the order.
|
|
144
|
-
* @param contextOverride Optional context override for this request.
|
|
145
|
-
* @returns The order matching the request.
|
|
146
|
-
* @throws {OrderBookApiError} If the order is not found in any of the environments.
|
|
147
|
-
*/
|
|
148
|
-
getOrderMultiEnv(orderUid: UID, contextOverride?: PartialApiContext): Promise<EnrichedOrder>;
|
|
149
|
-
/**
|
|
150
|
-
* Get a quote for an order.
|
|
151
|
-
* This allows for the calculation of the total cost of an order, including fees, before signing and submitting.
|
|
152
|
-
* @param requestBody The parameters for the order quote request.
|
|
153
|
-
* @param contextOverride Optional context override for this request.
|
|
154
|
-
* @returns A hydrated order matching the request ready to be signed.
|
|
155
|
-
*/
|
|
156
|
-
getQuote(requestBody: OrderQuoteRequest, contextOverride?: PartialApiContext): Promise<OrderQuoteResponse>;
|
|
157
|
-
/**
|
|
158
|
-
* Cancel one or more orders.
|
|
159
|
-
*
|
|
160
|
-
* **NOTE**: Cancellation is on a best-effort basis. Orders that are already in the process of being settled
|
|
161
|
-
* (ie. transaction has been submitted to chain by the solver) cannot not be cancelled.
|
|
162
|
-
* **CAUTION**: This method can only be used to cancel orders that were signed using `EIP-712` or `eth_sign (EIP-191)`.
|
|
163
|
-
* @param requestBody Orders to be cancelled and signed instructions to cancel them.
|
|
164
|
-
* @param contextOverride Optional context override for this request.
|
|
165
|
-
* @returns A list of order unique identifiers that were successfully cancelled.
|
|
166
|
-
*/
|
|
167
|
-
sendSignedOrderCancellations(requestBody: OrderCancellations, contextOverride?: PartialApiContext): Promise<void>;
|
|
168
|
-
/**
|
|
169
|
-
* Submit an order to the order book.
|
|
170
|
-
* @param requestBody The signed order to be submitted.
|
|
171
|
-
* @param contextOverride Optional context override for this request.
|
|
172
|
-
* @returns The unique identifier of the order.
|
|
173
|
-
*/
|
|
174
|
-
sendOrder(requestBody: OrderCreation, contextOverride?: PartialApiContext): Promise<UID>;
|
|
175
|
-
/**
|
|
176
|
-
* Get the native price of a token.
|
|
177
|
-
*
|
|
178
|
-
* **NOTE**: The native price is the price of the token in the native currency of the chain. For example, on Ethereum
|
|
179
|
-
* this would be the price of the token in ETH.
|
|
180
|
-
* @param tokenAddress The address of the ERC-20 token.
|
|
181
|
-
* @param contextOverride Optional context override for this request.
|
|
182
|
-
* @returns The native price of the token.
|
|
183
|
-
*/
|
|
184
|
-
getNativePrice(tokenAddress: Address, contextOverride?: PartialApiContext): Promise<NativePriceResponse>;
|
|
185
|
-
/**
|
|
186
|
-
* Given a user's address, get the total surplus that they have earned.
|
|
187
|
-
* @param address The user's address
|
|
188
|
-
* @param contextOverride Optional context override for this request.
|
|
189
|
-
* @returns Calculated user's surplus
|
|
190
|
-
*/
|
|
191
|
-
getTotalSurplus(address: Address, contextOverride?: PartialApiContext): Promise<TotalSurplus>;
|
|
192
|
-
/**
|
|
193
|
-
* Retrieve the full app data for a given app data hash.
|
|
194
|
-
* @param appDataHash `bytes32` hash of the app data
|
|
195
|
-
* @param contextOverride Optional context override for this request.
|
|
196
|
-
* @returns Full app data that was uploaded
|
|
197
|
-
*/
|
|
198
|
-
getAppData(appDataHash: AppDataHash, contextOverride?: PartialApiContext): Promise<AppDataObject>;
|
|
199
|
-
/**
|
|
200
|
-
* Upload the full app data that corresponds to a given app data hash.
|
|
201
|
-
* @param appDataHash `bytes32` hash of the app data
|
|
202
|
-
* @param fullAppData Full app data to be uploaded
|
|
203
|
-
* @param contextOverride Optional context override for this request.
|
|
204
|
-
* @returns The string encoding of the full app data that was uploaded.
|
|
205
|
-
*/
|
|
206
|
-
uploadAppData(appDataHash: AppDataHash, fullAppData: string, contextOverride?: PartialApiContext): Promise<AppDataObject>;
|
|
207
|
-
getSolverCompetition(auctionId: number, contextOverride?: PartialApiContext): Promise<SolverCompetitionResponse>;
|
|
208
|
-
getSolverCompetition(txHash: string, contextOverride?: PartialApiContext): Promise<SolverCompetitionResponse>;
|
|
209
|
-
/**
|
|
210
|
-
* Generate an API endpoint for an order by its unique identifier, `orderUid`.
|
|
211
|
-
* @param orderUid The unique identifier of the order.
|
|
212
|
-
* @param contextOverride Optional context override for this request.
|
|
213
|
-
* @returns The API endpoint to get the order.
|
|
214
|
-
*/
|
|
215
|
-
getOrderLink(orderUid: UID, contextOverride?: PartialApiContext): string;
|
|
216
|
-
/**
|
|
217
|
-
* Apply an override to the context for a request.
|
|
218
|
-
* @param contextOverride Optional context override for this request.
|
|
219
|
-
* @returns New context with the override applied.
|
|
220
|
-
*/
|
|
221
|
-
private getContextWithOverride;
|
|
222
|
-
/**
|
|
223
|
-
* Get the base URLs for the API endpoints given the environment.
|
|
224
|
-
* @param env The environment to get the base URLs for.
|
|
225
|
-
* @returns The base URLs for the API endpoints.
|
|
226
|
-
*/
|
|
227
|
-
private getApiBaseUrls;
|
|
228
|
-
/**
|
|
229
|
-
* Make a request to the API.
|
|
230
|
-
* @param params The parameters for the request.
|
|
231
|
-
* @param contextOverride Optional context override for this request.
|
|
232
|
-
* @returns The response from the API.
|
|
233
|
-
*/
|
|
234
|
-
private fetch;
|
|
235
|
-
}
|
|
1
|
+
import 'cross-fetch/polyfill';
|
|
2
|
+
import { ApiBaseUrls, ApiContext, PartialApiContext } from '../common/types/config';
|
|
3
|
+
import { Address, AppDataHash, AppDataObject, CompetitionOrderStatus, NativePriceResponse, OrderCancellations, OrderCreation, OrderQuoteRequest, OrderQuoteResponse, SolverCompetitionResponse, TotalSurplus, Trade, TransactionHash, UID } from './generated';
|
|
4
|
+
import { EnrichedOrder } from './types';
|
|
5
|
+
/**
|
|
6
|
+
* An object containing *production* environment base URLs for each supported `chainId`.
|
|
7
|
+
* @see {@link https://api.cow.fi/docs/#/}
|
|
8
|
+
*/
|
|
9
|
+
export declare const ORDER_BOOK_PROD_CONFIG: ApiBaseUrls;
|
|
10
|
+
/**
|
|
11
|
+
* An object containing *staging* environment base URLs for each supported `chainId`.
|
|
12
|
+
*/
|
|
13
|
+
export declare const ORDER_BOOK_STAGING_CONFIG: ApiBaseUrls;
|
|
14
|
+
/**
|
|
15
|
+
* The parameters for the `getOrders` request.
|
|
16
|
+
*/
|
|
17
|
+
export type GetOrdersRequest = {
|
|
18
|
+
owner: Address;
|
|
19
|
+
offset?: number;
|
|
20
|
+
limit?: number;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* The CoW Protocol OrderBook API client.
|
|
24
|
+
*
|
|
25
|
+
* This is the main entry point for interacting with the CoW Protocol OrderBook API. The main advantage of using
|
|
26
|
+
* this client is the batteries-included approach to interacting with the API. It handles:
|
|
27
|
+
*
|
|
28
|
+
* - Environment configuration (mainnet, staging, etc.)
|
|
29
|
+
* - Rate limiting
|
|
30
|
+
* - Retries
|
|
31
|
+
* - Backoff
|
|
32
|
+
* - Error handling
|
|
33
|
+
* - Request signing
|
|
34
|
+
* - Request validation
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
*
|
|
38
|
+
* ```typescript
|
|
39
|
+
* import { OrderBookApi, OrderSigningUtils, SupportedChainId } from '@cowprotocol/cow-sdk'
|
|
40
|
+
* import { Web3Provider } from '@ethersproject/providers'
|
|
41
|
+
*
|
|
42
|
+
* const account = 'YOUR_WALLET_ADDRESS'
|
|
43
|
+
* const chainId = 100 // Gnosis chain
|
|
44
|
+
* const provider = new Web3Provider(window.ethereum)
|
|
45
|
+
* const signer = provider.getSigner()
|
|
46
|
+
*
|
|
47
|
+
* const quoteRequest = {
|
|
48
|
+
* sellToken: '0x6a023ccd1ff6f2045c3309768ead9e68f978f6e1', // WETH gnosis chain
|
|
49
|
+
* buyToken: '0x9c58bacc331c9aa871afd802db6379a98e80cedb', // GNO gnosis chain
|
|
50
|
+
* from: account,
|
|
51
|
+
* receiver: account,
|
|
52
|
+
* sellAmountBeforeFee: (0.4 * 10 ** 18).toString(), // 0.4 WETH
|
|
53
|
+
* kind: OrderQuoteSide.kind.SELL,
|
|
54
|
+
* }
|
|
55
|
+
*
|
|
56
|
+
* const orderBookApi = new OrderBookApi({ chainId: SupportedChainId.GNOSIS_CHAIN })
|
|
57
|
+
*
|
|
58
|
+
* async function main() {
|
|
59
|
+
* const { quote } = await orderBookApi.getQuote(quoteRequest)
|
|
60
|
+
*
|
|
61
|
+
* const orderSigningResult = await OrderSigningUtils.signOrder(quote, chainId, signer)
|
|
62
|
+
*
|
|
63
|
+
* const orderId = await orderBookApi.sendOrder({ ...quote, ...orderSigningResult })
|
|
64
|
+
*
|
|
65
|
+
* const order = await orderBookApi.getOrder(orderId)
|
|
66
|
+
*
|
|
67
|
+
* const trades = await orderBookApi.getTrades({ orderId })
|
|
68
|
+
*
|
|
69
|
+
* const orderCancellationSigningResult = await OrderSigningUtils.signOrderCancellations([orderId], chainId, signer)
|
|
70
|
+
*
|
|
71
|
+
* const cancellationResult = await orderBookApi.sendSignedOrderCancellations({...orderCancellationSigningResult, orderUids: [orderId] })
|
|
72
|
+
*
|
|
73
|
+
* console.log('Results: ', { orderId, order, trades, orderCancellationSigningResult, cancellationResult })
|
|
74
|
+
* }
|
|
75
|
+
* ```
|
|
76
|
+
*
|
|
77
|
+
* @see {@link Swagger documentation https://api.cow.fi/docs/#/}
|
|
78
|
+
* @see {@link OrderBook API https://github.com/cowprotocol/services}
|
|
79
|
+
*/
|
|
80
|
+
export declare class OrderBookApi {
|
|
81
|
+
context: ApiContext;
|
|
82
|
+
private rateLimiter;
|
|
83
|
+
/**
|
|
84
|
+
* Creates a new instance of the CoW Protocol OrderBook API client.
|
|
85
|
+
* @param context - The API context to use. If not provided, the default context will be used.
|
|
86
|
+
*/
|
|
87
|
+
constructor(context?: PartialApiContext);
|
|
88
|
+
/**
|
|
89
|
+
* Get the version of the API.
|
|
90
|
+
* @param contextOverride Optional context override for this request.
|
|
91
|
+
* @returns The version of the API.
|
|
92
|
+
* @see {@link https://api.cow.fi/docs/#/default/get_api_v1_version}
|
|
93
|
+
*/
|
|
94
|
+
getVersion(contextOverride?: PartialApiContext): Promise<string>;
|
|
95
|
+
/**
|
|
96
|
+
* Get all the trades for either an `owner` **OR** `orderUid`.
|
|
97
|
+
*
|
|
98
|
+
* Given that an order *may* be partially fillable, it is possible that a discrete order (`orderUid`)
|
|
99
|
+
* may have *multiple* trades. Therefore, this method returns a list of trades, either for *all* the orders
|
|
100
|
+
* of a given `owner`, or for a discrete order (`orderUid`).
|
|
101
|
+
* @param request Either an `owner` or an `orderUid` **MUST** be specified.
|
|
102
|
+
* @param contextOverride Optional context override for this request.
|
|
103
|
+
* @returns A list of trades matching the request.
|
|
104
|
+
*/
|
|
105
|
+
getTrades(request: {
|
|
106
|
+
owner?: Address;
|
|
107
|
+
orderUid?: UID;
|
|
108
|
+
}, contextOverride?: PartialApiContext): Promise<Array<Trade>>;
|
|
109
|
+
/**
|
|
110
|
+
* Get a list of orders for a given `owner`.
|
|
111
|
+
* @param request The request parameters with `request.offset = 0` and `request.limit = 1000` by default.
|
|
112
|
+
* @param contextOverride Optional context override for this request.
|
|
113
|
+
* @returns A list of orders matching the request.
|
|
114
|
+
* @see {@link GetOrdersRequest}
|
|
115
|
+
* @see {@link EnrichedOrder}
|
|
116
|
+
*/
|
|
117
|
+
getOrders({ owner, offset, limit }: GetOrdersRequest, contextOverride?: PartialApiContext): Promise<Array<EnrichedOrder>>;
|
|
118
|
+
/**
|
|
119
|
+
* Get a list of orders from a given settlement transaction hash.
|
|
120
|
+
* @param txHash The transaction hash.
|
|
121
|
+
* @param contextOverride Optional context override for this request.
|
|
122
|
+
* @returns A list of orders matching the request.
|
|
123
|
+
* @see {@link EnrichedOrder}
|
|
124
|
+
*/
|
|
125
|
+
getTxOrders(txHash: TransactionHash, contextOverride?: PartialApiContext): Promise<Array<EnrichedOrder>>;
|
|
126
|
+
/**
|
|
127
|
+
* Get an order by its unique identifier, `orderUid`.
|
|
128
|
+
* @param orderUid The unique identifier of the order.
|
|
129
|
+
* @param contextOverride Optional context override for this request.
|
|
130
|
+
* @returns The order matching the request.
|
|
131
|
+
*/
|
|
132
|
+
getOrder(orderUid: UID, contextOverride?: PartialApiContext): Promise<EnrichedOrder>;
|
|
133
|
+
/**
|
|
134
|
+
* Get the order status while open
|
|
135
|
+
*/
|
|
136
|
+
getOrderCompetitionStatus(orderUid: UID, contextOverride?: PartialApiContext): Promise<CompetitionOrderStatus>;
|
|
137
|
+
/**
|
|
138
|
+
* Attempt to get an order by its unique identifier, `orderUid`, from multiple environments.
|
|
139
|
+
*
|
|
140
|
+
* **NOTE**: The environment refers to either `prod` or `staging`. This allows a conveience method to
|
|
141
|
+
* attempt to get an order from both environments, in the event that the order is not found in the
|
|
142
|
+
* environment specified in the context.
|
|
143
|
+
* @param orderUid The unique identifier of the order.
|
|
144
|
+
* @param contextOverride Optional context override for this request.
|
|
145
|
+
* @returns The order matching the request.
|
|
146
|
+
* @throws {OrderBookApiError} If the order is not found in any of the environments.
|
|
147
|
+
*/
|
|
148
|
+
getOrderMultiEnv(orderUid: UID, contextOverride?: PartialApiContext): Promise<EnrichedOrder>;
|
|
149
|
+
/**
|
|
150
|
+
* Get a quote for an order.
|
|
151
|
+
* This allows for the calculation of the total cost of an order, including fees, before signing and submitting.
|
|
152
|
+
* @param requestBody The parameters for the order quote request.
|
|
153
|
+
* @param contextOverride Optional context override for this request.
|
|
154
|
+
* @returns A hydrated order matching the request ready to be signed.
|
|
155
|
+
*/
|
|
156
|
+
getQuote(requestBody: OrderQuoteRequest, contextOverride?: PartialApiContext): Promise<OrderQuoteResponse>;
|
|
157
|
+
/**
|
|
158
|
+
* Cancel one or more orders.
|
|
159
|
+
*
|
|
160
|
+
* **NOTE**: Cancellation is on a best-effort basis. Orders that are already in the process of being settled
|
|
161
|
+
* (ie. transaction has been submitted to chain by the solver) cannot not be cancelled.
|
|
162
|
+
* **CAUTION**: This method can only be used to cancel orders that were signed using `EIP-712` or `eth_sign (EIP-191)`.
|
|
163
|
+
* @param requestBody Orders to be cancelled and signed instructions to cancel them.
|
|
164
|
+
* @param contextOverride Optional context override for this request.
|
|
165
|
+
* @returns A list of order unique identifiers that were successfully cancelled.
|
|
166
|
+
*/
|
|
167
|
+
sendSignedOrderCancellations(requestBody: OrderCancellations, contextOverride?: PartialApiContext): Promise<void>;
|
|
168
|
+
/**
|
|
169
|
+
* Submit an order to the order book.
|
|
170
|
+
* @param requestBody The signed order to be submitted.
|
|
171
|
+
* @param contextOverride Optional context override for this request.
|
|
172
|
+
* @returns The unique identifier of the order.
|
|
173
|
+
*/
|
|
174
|
+
sendOrder(requestBody: OrderCreation, contextOverride?: PartialApiContext): Promise<UID>;
|
|
175
|
+
/**
|
|
176
|
+
* Get the native price of a token.
|
|
177
|
+
*
|
|
178
|
+
* **NOTE**: The native price is the price of the token in the native currency of the chain. For example, on Ethereum
|
|
179
|
+
* this would be the price of the token in ETH.
|
|
180
|
+
* @param tokenAddress The address of the ERC-20 token.
|
|
181
|
+
* @param contextOverride Optional context override for this request.
|
|
182
|
+
* @returns The native price of the token.
|
|
183
|
+
*/
|
|
184
|
+
getNativePrice(tokenAddress: Address, contextOverride?: PartialApiContext): Promise<NativePriceResponse>;
|
|
185
|
+
/**
|
|
186
|
+
* Given a user's address, get the total surplus that they have earned.
|
|
187
|
+
* @param address The user's address
|
|
188
|
+
* @param contextOverride Optional context override for this request.
|
|
189
|
+
* @returns Calculated user's surplus
|
|
190
|
+
*/
|
|
191
|
+
getTotalSurplus(address: Address, contextOverride?: PartialApiContext): Promise<TotalSurplus>;
|
|
192
|
+
/**
|
|
193
|
+
* Retrieve the full app data for a given app data hash.
|
|
194
|
+
* @param appDataHash `bytes32` hash of the app data
|
|
195
|
+
* @param contextOverride Optional context override for this request.
|
|
196
|
+
* @returns Full app data that was uploaded
|
|
197
|
+
*/
|
|
198
|
+
getAppData(appDataHash: AppDataHash, contextOverride?: PartialApiContext): Promise<AppDataObject>;
|
|
199
|
+
/**
|
|
200
|
+
* Upload the full app data that corresponds to a given app data hash.
|
|
201
|
+
* @param appDataHash `bytes32` hash of the app data
|
|
202
|
+
* @param fullAppData Full app data to be uploaded
|
|
203
|
+
* @param contextOverride Optional context override for this request.
|
|
204
|
+
* @returns The string encoding of the full app data that was uploaded.
|
|
205
|
+
*/
|
|
206
|
+
uploadAppData(appDataHash: AppDataHash, fullAppData: string, contextOverride?: PartialApiContext): Promise<AppDataObject>;
|
|
207
|
+
getSolverCompetition(auctionId: number, contextOverride?: PartialApiContext): Promise<SolverCompetitionResponse>;
|
|
208
|
+
getSolverCompetition(txHash: string, contextOverride?: PartialApiContext): Promise<SolverCompetitionResponse>;
|
|
209
|
+
/**
|
|
210
|
+
* Generate an API endpoint for an order by its unique identifier, `orderUid`.
|
|
211
|
+
* @param orderUid The unique identifier of the order.
|
|
212
|
+
* @param contextOverride Optional context override for this request.
|
|
213
|
+
* @returns The API endpoint to get the order.
|
|
214
|
+
*/
|
|
215
|
+
getOrderLink(orderUid: UID, contextOverride?: PartialApiContext): string;
|
|
216
|
+
/**
|
|
217
|
+
* Apply an override to the context for a request.
|
|
218
|
+
* @param contextOverride Optional context override for this request.
|
|
219
|
+
* @returns New context with the override applied.
|
|
220
|
+
*/
|
|
221
|
+
private getContextWithOverride;
|
|
222
|
+
/**
|
|
223
|
+
* Get the base URLs for the API endpoints given the environment.
|
|
224
|
+
* @param env The environment to get the base URLs for.
|
|
225
|
+
* @returns The base URLs for the API endpoints.
|
|
226
|
+
*/
|
|
227
|
+
private getApiBaseUrls;
|
|
228
|
+
/**
|
|
229
|
+
* Make a request to the API.
|
|
230
|
+
* @param params The parameters for the request.
|
|
231
|
+
* @param contextOverride Optional context override for this request.
|
|
232
|
+
* @returns The response from the API.
|
|
233
|
+
*/
|
|
234
|
+
private fetch;
|
|
235
|
+
}
|
|
@@ -1,55 +1,55 @@
|
|
|
1
|
-
export type { Address } from './models/Address';
|
|
2
|
-
export type { AppData } from './models/AppData';
|
|
3
|
-
export type { AppDataHash } from './models/AppDataHash';
|
|
4
|
-
export type { AppDataObject } from './models/AppDataObject';
|
|
5
|
-
export type { Auction } from './models/Auction';
|
|
6
|
-
export type { AuctionOrder } from './models/AuctionOrder';
|
|
7
|
-
export type { AuctionPrices } from './models/AuctionPrices';
|
|
8
|
-
export type { BigUint } from './models/BigUint';
|
|
9
|
-
export { BuyTokenDestination } from './models/BuyTokenDestination';
|
|
10
|
-
export type { CallData } from './models/CallData';
|
|
11
|
-
export type { CompetitionAuction } from './models/CompetitionAuction';
|
|
12
|
-
export { CompetitionOrderStatus } from './models/CompetitionOrderStatus';
|
|
13
|
-
export type { EcdsaSignature } from './models/EcdsaSignature';
|
|
14
|
-
export { EcdsaSigningScheme } from './models/EcdsaSigningScheme';
|
|
15
|
-
export type { EthflowData } from './models/EthflowData';
|
|
16
|
-
export type { ExecutedAmounts } from './models/ExecutedAmounts';
|
|
17
|
-
export type { ExecutedProtocolFee } from './models/ExecutedProtocolFee';
|
|
18
|
-
export type { FeePolicy } from './models/FeePolicy';
|
|
19
|
-
export type { InteractionData } from './models/InteractionData';
|
|
20
|
-
export type { NativePriceResponse } from './models/NativePriceResponse';
|
|
21
|
-
export { OnchainOrderData } from './models/OnchainOrderData';
|
|
22
|
-
export type { Order } from './models/Order';
|
|
23
|
-
export type { OrderCancellation } from './models/OrderCancellation';
|
|
24
|
-
export { OrderCancellationError } from './models/OrderCancellationError';
|
|
25
|
-
export type { OrderCancellations } from './models/OrderCancellations';
|
|
26
|
-
export { OrderClass } from './models/OrderClass';
|
|
27
|
-
export type { OrderCreation } from './models/OrderCreation';
|
|
28
|
-
export { OrderKind } from './models/OrderKind';
|
|
29
|
-
export type { OrderMetaData } from './models/OrderMetaData';
|
|
30
|
-
export type { OrderParameters } from './models/OrderParameters';
|
|
31
|
-
export { OrderPostError } from './models/OrderPostError';
|
|
32
|
-
export type { OrderQuoteRequest } from './models/OrderQuoteRequest';
|
|
33
|
-
export type { OrderQuoteResponse } from './models/OrderQuoteResponse';
|
|
34
|
-
export type { OrderQuoteSide } from './models/OrderQuoteSide';
|
|
35
|
-
export { OrderQuoteSideKindBuy } from './models/OrderQuoteSideKindBuy';
|
|
36
|
-
export { OrderQuoteSideKindSell } from './models/OrderQuoteSideKindSell';
|
|
37
|
-
export type { OrderQuoteValidity } from './models/OrderQuoteValidity';
|
|
38
|
-
export { OrderStatus } from './models/OrderStatus';
|
|
39
|
-
export type { PreSignature } from './models/PreSignature';
|
|
40
|
-
export { PriceEstimationError } from './models/PriceEstimationError';
|
|
41
|
-
export type { PriceImprovement } from './models/PriceImprovement';
|
|
42
|
-
export { PriceQuality } from './models/PriceQuality';
|
|
43
|
-
export type { Quote } from './models/Quote';
|
|
44
|
-
export { SellTokenSource } from './models/SellTokenSource';
|
|
45
|
-
export type { Signature } from './models/Signature';
|
|
46
|
-
export { SigningScheme } from './models/SigningScheme';
|
|
47
|
-
export type { SolverCompetitionResponse } from './models/SolverCompetitionResponse';
|
|
48
|
-
export type { SolverSettlement } from './models/SolverSettlement';
|
|
49
|
-
export type { Surplus } from './models/Surplus';
|
|
50
|
-
export type { TokenAmount } from './models/TokenAmount';
|
|
51
|
-
export type { TotalSurplus } from './models/TotalSurplus';
|
|
52
|
-
export type { Trade } from './models/Trade';
|
|
53
|
-
export type { TransactionHash } from './models/TransactionHash';
|
|
54
|
-
export type { UID } from './models/UID';
|
|
55
|
-
export type { Volume } from './models/Volume';
|
|
1
|
+
export type { Address } from './models/Address';
|
|
2
|
+
export type { AppData } from './models/AppData';
|
|
3
|
+
export type { AppDataHash } from './models/AppDataHash';
|
|
4
|
+
export type { AppDataObject } from './models/AppDataObject';
|
|
5
|
+
export type { Auction } from './models/Auction';
|
|
6
|
+
export type { AuctionOrder } from './models/AuctionOrder';
|
|
7
|
+
export type { AuctionPrices } from './models/AuctionPrices';
|
|
8
|
+
export type { BigUint } from './models/BigUint';
|
|
9
|
+
export { BuyTokenDestination } from './models/BuyTokenDestination';
|
|
10
|
+
export type { CallData } from './models/CallData';
|
|
11
|
+
export type { CompetitionAuction } from './models/CompetitionAuction';
|
|
12
|
+
export { CompetitionOrderStatus } from './models/CompetitionOrderStatus';
|
|
13
|
+
export type { EcdsaSignature } from './models/EcdsaSignature';
|
|
14
|
+
export { EcdsaSigningScheme } from './models/EcdsaSigningScheme';
|
|
15
|
+
export type { EthflowData } from './models/EthflowData';
|
|
16
|
+
export type { ExecutedAmounts } from './models/ExecutedAmounts';
|
|
17
|
+
export type { ExecutedProtocolFee } from './models/ExecutedProtocolFee';
|
|
18
|
+
export type { FeePolicy } from './models/FeePolicy';
|
|
19
|
+
export type { InteractionData } from './models/InteractionData';
|
|
20
|
+
export type { NativePriceResponse } from './models/NativePriceResponse';
|
|
21
|
+
export { OnchainOrderData } from './models/OnchainOrderData';
|
|
22
|
+
export type { Order } from './models/Order';
|
|
23
|
+
export type { OrderCancellation } from './models/OrderCancellation';
|
|
24
|
+
export { OrderCancellationError } from './models/OrderCancellationError';
|
|
25
|
+
export type { OrderCancellations } from './models/OrderCancellations';
|
|
26
|
+
export { OrderClass } from './models/OrderClass';
|
|
27
|
+
export type { OrderCreation } from './models/OrderCreation';
|
|
28
|
+
export { OrderKind } from './models/OrderKind';
|
|
29
|
+
export type { OrderMetaData } from './models/OrderMetaData';
|
|
30
|
+
export type { OrderParameters } from './models/OrderParameters';
|
|
31
|
+
export { OrderPostError } from './models/OrderPostError';
|
|
32
|
+
export type { OrderQuoteRequest } from './models/OrderQuoteRequest';
|
|
33
|
+
export type { OrderQuoteResponse } from './models/OrderQuoteResponse';
|
|
34
|
+
export type { OrderQuoteSide } from './models/OrderQuoteSide';
|
|
35
|
+
export { OrderQuoteSideKindBuy } from './models/OrderQuoteSideKindBuy';
|
|
36
|
+
export { OrderQuoteSideKindSell } from './models/OrderQuoteSideKindSell';
|
|
37
|
+
export type { OrderQuoteValidity } from './models/OrderQuoteValidity';
|
|
38
|
+
export { OrderStatus } from './models/OrderStatus';
|
|
39
|
+
export type { PreSignature } from './models/PreSignature';
|
|
40
|
+
export { PriceEstimationError } from './models/PriceEstimationError';
|
|
41
|
+
export type { PriceImprovement } from './models/PriceImprovement';
|
|
42
|
+
export { PriceQuality } from './models/PriceQuality';
|
|
43
|
+
export type { Quote } from './models/Quote';
|
|
44
|
+
export { SellTokenSource } from './models/SellTokenSource';
|
|
45
|
+
export type { Signature } from './models/Signature';
|
|
46
|
+
export { SigningScheme } from './models/SigningScheme';
|
|
47
|
+
export type { SolverCompetitionResponse } from './models/SolverCompetitionResponse';
|
|
48
|
+
export type { SolverSettlement } from './models/SolverSettlement';
|
|
49
|
+
export type { Surplus } from './models/Surplus';
|
|
50
|
+
export type { TokenAmount } from './models/TokenAmount';
|
|
51
|
+
export type { TotalSurplus } from './models/TotalSurplus';
|
|
52
|
+
export type { Trade } from './models/Trade';
|
|
53
|
+
export type { TransactionHash } from './models/TransactionHash';
|
|
54
|
+
export type { UID } from './models/UID';
|
|
55
|
+
export type { Volume } from './models/Volume';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 20 byte Ethereum address encoded as a hex with `0x` prefix.
|
|
3
|
-
*/
|
|
4
|
-
export type Address = string;
|
|
1
|
+
/**
|
|
2
|
+
* 20 byte Ethereum address encoded as a hex with `0x` prefix.
|
|
3
|
+
*/
|
|
4
|
+
export type Address = string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The string encoding of a JSON object representing some `appData`. The
|
|
3
|
-
* format of the JSON expected in the `appData` field is defined
|
|
4
|
-
* [here](https://github.com/cowprotocol/app-data).
|
|
5
|
-
*
|
|
6
|
-
*/
|
|
7
|
-
export type AppData = string;
|
|
1
|
+
/**
|
|
2
|
+
* The string encoding of a JSON object representing some `appData`. The
|
|
3
|
+
* format of the JSON expected in the `appData` field is defined
|
|
4
|
+
* [here](https://github.com/cowprotocol/app-data).
|
|
5
|
+
*
|
|
6
|
+
*/
|
|
7
|
+
export type AppData = string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 32 bytes encoded as hex with `0x` prefix.
|
|
3
|
-
* It's expected to be the hash of the stringified JSON object representing the `appData`.
|
|
4
|
-
*
|
|
5
|
-
*/
|
|
6
|
-
export type AppDataHash = string;
|
|
1
|
+
/**
|
|
2
|
+
* 32 bytes encoded as hex with `0x` prefix.
|
|
3
|
+
* It's expected to be the hash of the stringified JSON object representing the `appData`.
|
|
4
|
+
*
|
|
5
|
+
*/
|
|
6
|
+
export type AppDataHash = string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { AppData } from './AppData';
|
|
2
|
-
/**
|
|
3
|
-
* An `appData` document that is registered with the API.
|
|
4
|
-
*/
|
|
5
|
-
export type AppDataObject = {
|
|
6
|
-
fullAppData?: AppData;
|
|
7
|
-
};
|
|
1
|
+
import type { AppData } from './AppData';
|
|
2
|
+
/**
|
|
3
|
+
* An `appData` document that is registered with the API.
|
|
4
|
+
*/
|
|
5
|
+
export type AppDataObject = {
|
|
6
|
+
fullAppData?: AppData;
|
|
7
|
+
};
|