@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
|
@@ -1,58 +1,58 @@
|
|
|
1
|
-
import type { Address } from './Address';
|
|
2
|
-
import type { AppData } from './AppData';
|
|
3
|
-
import type { AppDataHash } from './AppDataHash';
|
|
4
|
-
import type { BuyTokenDestination } from './BuyTokenDestination';
|
|
5
|
-
import type { OrderQuoteSide } from './OrderQuoteSide';
|
|
6
|
-
import type { OrderQuoteValidity } from './OrderQuoteValidity';
|
|
7
|
-
import type { PriceQuality } from './PriceQuality';
|
|
8
|
-
import type { SellTokenSource } from './SellTokenSource';
|
|
9
|
-
import type { SigningScheme } from './SigningScheme';
|
|
10
|
-
/**
|
|
11
|
-
* Request fee and price quote.
|
|
12
|
-
*/
|
|
13
|
-
export type OrderQuoteRequest = (OrderQuoteSide & OrderQuoteValidity & {
|
|
14
|
-
/**
|
|
15
|
-
* ERC-20 token to be sold
|
|
16
|
-
*/
|
|
17
|
-
sellToken: Address;
|
|
18
|
-
/**
|
|
19
|
-
* ERC-20 token to be bought
|
|
20
|
-
*/
|
|
21
|
-
buyToken: Address;
|
|
22
|
-
/**
|
|
23
|
-
* An optional address to receive the proceeds of the trade instead of the
|
|
24
|
-
* `owner` (i.e. the order signer).
|
|
25
|
-
*
|
|
26
|
-
*/
|
|
27
|
-
receiver?: Address | null;
|
|
28
|
-
/**
|
|
29
|
-
* AppData which will be assigned to the order.
|
|
30
|
-
*
|
|
31
|
-
* Expects either a string JSON doc as defined on
|
|
32
|
-
* [AppData](https://github.com/cowprotocol/app-data) or a hex
|
|
33
|
-
* encoded string for backwards compatibility.
|
|
34
|
-
*
|
|
35
|
-
* When the first format is used, it's possible to provide the
|
|
36
|
-
* derived appDataHash field.
|
|
37
|
-
*/
|
|
38
|
-
appData?: (AppData | AppDataHash);
|
|
39
|
-
/**
|
|
40
|
-
* The hash of the stringified JSON appData doc.
|
|
41
|
-
*
|
|
42
|
-
* If present, `appData` field must be set with the aforementioned
|
|
43
|
-
* data where this hash is derived from.
|
|
44
|
-
*
|
|
45
|
-
* In case they differ, the call will fail.
|
|
46
|
-
*/
|
|
47
|
-
appDataHash?: AppDataHash;
|
|
48
|
-
sellTokenBalance?: SellTokenSource;
|
|
49
|
-
buyTokenBalance?: BuyTokenDestination;
|
|
50
|
-
from: Address;
|
|
51
|
-
priceQuality?: PriceQuality;
|
|
52
|
-
signingScheme?: SigningScheme;
|
|
53
|
-
/**
|
|
54
|
-
* Flag to signal whether the order is intended for on-chain order placement. Only valid for non ECDSA-signed orders."
|
|
55
|
-
*
|
|
56
|
-
*/
|
|
57
|
-
onchainOrder?: any;
|
|
58
|
-
});
|
|
1
|
+
import type { Address } from './Address';
|
|
2
|
+
import type { AppData } from './AppData';
|
|
3
|
+
import type { AppDataHash } from './AppDataHash';
|
|
4
|
+
import type { BuyTokenDestination } from './BuyTokenDestination';
|
|
5
|
+
import type { OrderQuoteSide } from './OrderQuoteSide';
|
|
6
|
+
import type { OrderQuoteValidity } from './OrderQuoteValidity';
|
|
7
|
+
import type { PriceQuality } from './PriceQuality';
|
|
8
|
+
import type { SellTokenSource } from './SellTokenSource';
|
|
9
|
+
import type { SigningScheme } from './SigningScheme';
|
|
10
|
+
/**
|
|
11
|
+
* Request fee and price quote.
|
|
12
|
+
*/
|
|
13
|
+
export type OrderQuoteRequest = (OrderQuoteSide & OrderQuoteValidity & {
|
|
14
|
+
/**
|
|
15
|
+
* ERC-20 token to be sold
|
|
16
|
+
*/
|
|
17
|
+
sellToken: Address;
|
|
18
|
+
/**
|
|
19
|
+
* ERC-20 token to be bought
|
|
20
|
+
*/
|
|
21
|
+
buyToken: Address;
|
|
22
|
+
/**
|
|
23
|
+
* An optional address to receive the proceeds of the trade instead of the
|
|
24
|
+
* `owner` (i.e. the order signer).
|
|
25
|
+
*
|
|
26
|
+
*/
|
|
27
|
+
receiver?: Address | null;
|
|
28
|
+
/**
|
|
29
|
+
* AppData which will be assigned to the order.
|
|
30
|
+
*
|
|
31
|
+
* Expects either a string JSON doc as defined on
|
|
32
|
+
* [AppData](https://github.com/cowprotocol/app-data) or a hex
|
|
33
|
+
* encoded string for backwards compatibility.
|
|
34
|
+
*
|
|
35
|
+
* When the first format is used, it's possible to provide the
|
|
36
|
+
* derived appDataHash field.
|
|
37
|
+
*/
|
|
38
|
+
appData?: (AppData | AppDataHash);
|
|
39
|
+
/**
|
|
40
|
+
* The hash of the stringified JSON appData doc.
|
|
41
|
+
*
|
|
42
|
+
* If present, `appData` field must be set with the aforementioned
|
|
43
|
+
* data where this hash is derived from.
|
|
44
|
+
*
|
|
45
|
+
* In case they differ, the call will fail.
|
|
46
|
+
*/
|
|
47
|
+
appDataHash?: AppDataHash;
|
|
48
|
+
sellTokenBalance?: SellTokenSource;
|
|
49
|
+
buyTokenBalance?: BuyTokenDestination;
|
|
50
|
+
from: Address;
|
|
51
|
+
priceQuality?: PriceQuality;
|
|
52
|
+
signingScheme?: SigningScheme;
|
|
53
|
+
/**
|
|
54
|
+
* Flag to signal whether the order is intended for on-chain order placement. Only valid for non ECDSA-signed orders."
|
|
55
|
+
*
|
|
56
|
+
*/
|
|
57
|
+
onchainOrder?: any;
|
|
58
|
+
});
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import type { Address } from './Address';
|
|
2
|
-
import type { OrderParameters } from './OrderParameters';
|
|
3
|
-
/**
|
|
4
|
-
* An order quoted by the backend that can be directly signed and
|
|
5
|
-
* submitted to the order creation backend.
|
|
6
|
-
*
|
|
7
|
-
*/
|
|
8
|
-
export type OrderQuoteResponse = {
|
|
9
|
-
quote: OrderParameters;
|
|
10
|
-
from?: Address;
|
|
11
|
-
/**
|
|
12
|
-
* Expiration date of the offered fee. Order service might not accept
|
|
13
|
-
* the fee after this expiration date. Encoded as ISO 8601 UTC.
|
|
14
|
-
*
|
|
15
|
-
*/
|
|
16
|
-
expiration: string;
|
|
17
|
-
/**
|
|
18
|
-
* Quote ID linked to a quote to enable providing more metadata when analysing order slippage.
|
|
19
|
-
*
|
|
20
|
-
*/
|
|
21
|
-
id?: number;
|
|
22
|
-
/**
|
|
23
|
-
* Whether it was possible to verify that the quoted amounts are accurate using a simulation.
|
|
24
|
-
*
|
|
25
|
-
*/
|
|
26
|
-
verified: boolean;
|
|
27
|
-
};
|
|
1
|
+
import type { Address } from './Address';
|
|
2
|
+
import type { OrderParameters } from './OrderParameters';
|
|
3
|
+
/**
|
|
4
|
+
* An order quoted by the backend that can be directly signed and
|
|
5
|
+
* submitted to the order creation backend.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
export type OrderQuoteResponse = {
|
|
9
|
+
quote: OrderParameters;
|
|
10
|
+
from?: Address;
|
|
11
|
+
/**
|
|
12
|
+
* Expiration date of the offered fee. Order service might not accept
|
|
13
|
+
* the fee after this expiration date. Encoded as ISO 8601 UTC.
|
|
14
|
+
*
|
|
15
|
+
*/
|
|
16
|
+
expiration: string;
|
|
17
|
+
/**
|
|
18
|
+
* Quote ID linked to a quote to enable providing more metadata when analysing order slippage.
|
|
19
|
+
*
|
|
20
|
+
*/
|
|
21
|
+
id?: number;
|
|
22
|
+
/**
|
|
23
|
+
* Whether it was possible to verify that the quoted amounts are accurate using a simulation.
|
|
24
|
+
*
|
|
25
|
+
*/
|
|
26
|
+
verified: boolean;
|
|
27
|
+
};
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import type { OrderQuoteSideKindBuy } from './OrderQuoteSideKindBuy';
|
|
2
|
-
import type { OrderQuoteSideKindSell } from './OrderQuoteSideKindSell';
|
|
3
|
-
import type { TokenAmount } from './TokenAmount';
|
|
4
|
-
/**
|
|
5
|
-
* The buy or sell side when quoting an order.
|
|
6
|
-
*/
|
|
7
|
-
export type OrderQuoteSide = ({
|
|
8
|
-
kind: OrderQuoteSideKindSell;
|
|
9
|
-
/**
|
|
10
|
-
* The total amount that is available for the order. From this value, the fee is deducted and the buy amount is calculated.
|
|
11
|
-
*
|
|
12
|
-
*/
|
|
13
|
-
sellAmountBeforeFee: TokenAmount;
|
|
14
|
-
} | {
|
|
15
|
-
kind: OrderQuoteSideKindSell;
|
|
16
|
-
/**
|
|
17
|
-
* The `sellAmount` for the order.
|
|
18
|
-
*/
|
|
19
|
-
sellAmountAfterFee: TokenAmount;
|
|
20
|
-
} | {
|
|
21
|
-
kind: OrderQuoteSideKindBuy;
|
|
22
|
-
/**
|
|
23
|
-
* The `buyAmount` for the order.
|
|
24
|
-
*/
|
|
25
|
-
buyAmountAfterFee: TokenAmount;
|
|
26
|
-
});
|
|
1
|
+
import type { OrderQuoteSideKindBuy } from './OrderQuoteSideKindBuy';
|
|
2
|
+
import type { OrderQuoteSideKindSell } from './OrderQuoteSideKindSell';
|
|
3
|
+
import type { TokenAmount } from './TokenAmount';
|
|
4
|
+
/**
|
|
5
|
+
* The buy or sell side when quoting an order.
|
|
6
|
+
*/
|
|
7
|
+
export type OrderQuoteSide = ({
|
|
8
|
+
kind: OrderQuoteSideKindSell;
|
|
9
|
+
/**
|
|
10
|
+
* The total amount that is available for the order. From this value, the fee is deducted and the buy amount is calculated.
|
|
11
|
+
*
|
|
12
|
+
*/
|
|
13
|
+
sellAmountBeforeFee: TokenAmount;
|
|
14
|
+
} | {
|
|
15
|
+
kind: OrderQuoteSideKindSell;
|
|
16
|
+
/**
|
|
17
|
+
* The `sellAmount` for the order.
|
|
18
|
+
*/
|
|
19
|
+
sellAmountAfterFee: TokenAmount;
|
|
20
|
+
} | {
|
|
21
|
+
kind: OrderQuoteSideKindBuy;
|
|
22
|
+
/**
|
|
23
|
+
* The `buyAmount` for the order.
|
|
24
|
+
*/
|
|
25
|
+
buyAmountAfterFee: TokenAmount;
|
|
26
|
+
});
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare enum OrderQuoteSideKindBuy {
|
|
2
|
-
BUY = "buy"
|
|
3
|
-
}
|
|
1
|
+
export declare enum OrderQuoteSideKindBuy {
|
|
2
|
+
BUY = "buy"
|
|
3
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare enum OrderQuoteSideKindSell {
|
|
2
|
-
SELL = "sell"
|
|
3
|
-
}
|
|
1
|
+
export declare enum OrderQuoteSideKindSell {
|
|
2
|
+
SELL = "sell"
|
|
3
|
+
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The validity for the order.
|
|
3
|
-
*/
|
|
4
|
-
export type OrderQuoteValidity = ({
|
|
5
|
-
/**
|
|
6
|
-
* Unix timestamp (`uint32`) until which the order is valid.
|
|
7
|
-
*/
|
|
8
|
-
validTo?: number;
|
|
9
|
-
} | {
|
|
10
|
-
/**
|
|
11
|
-
* Number (`uint32`) of seconds that the order should be valid for.
|
|
12
|
-
*/
|
|
13
|
-
validFor?: number;
|
|
14
|
-
});
|
|
1
|
+
/**
|
|
2
|
+
* The validity for the order.
|
|
3
|
+
*/
|
|
4
|
+
export type OrderQuoteValidity = ({
|
|
5
|
+
/**
|
|
6
|
+
* Unix timestamp (`uint32`) until which the order is valid.
|
|
7
|
+
*/
|
|
8
|
+
validTo?: number;
|
|
9
|
+
} | {
|
|
10
|
+
/**
|
|
11
|
+
* Number (`uint32`) of seconds that the order should be valid for.
|
|
12
|
+
*/
|
|
13
|
+
validFor?: number;
|
|
14
|
+
});
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The current order status.
|
|
3
|
-
*/
|
|
4
|
-
export declare enum OrderStatus {
|
|
5
|
-
PRESIGNATURE_PENDING = "presignaturePending",
|
|
6
|
-
OPEN = "open",
|
|
7
|
-
FULFILLED = "fulfilled",
|
|
8
|
-
CANCELLED = "cancelled",
|
|
9
|
-
EXPIRED = "expired"
|
|
10
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* The current order status.
|
|
3
|
+
*/
|
|
4
|
+
export declare enum OrderStatus {
|
|
5
|
+
PRESIGNATURE_PENDING = "presignaturePending",
|
|
6
|
+
OPEN = "open",
|
|
7
|
+
FULFILLED = "fulfilled",
|
|
8
|
+
CANCELLED = "cancelled",
|
|
9
|
+
EXPIRED = "expired"
|
|
10
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Empty signature bytes. Used for "presign" signatures.
|
|
3
|
-
*/
|
|
4
|
-
export type PreSignature = string;
|
|
1
|
+
/**
|
|
2
|
+
* Empty signature bytes. Used for "presign" signatures.
|
|
3
|
+
*/
|
|
4
|
+
export type PreSignature = string;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
export type PriceEstimationError = {
|
|
2
|
-
errorType: PriceEstimationError.errorType;
|
|
3
|
-
description: string;
|
|
4
|
-
};
|
|
5
|
-
export declare namespace PriceEstimationError {
|
|
6
|
-
enum errorType {
|
|
7
|
-
QUOTE_NOT_VERIFIED = "QuoteNotVerified",
|
|
8
|
-
UNSUPPORTED_TOKEN = "UnsupportedToken",
|
|
9
|
-
ZERO_AMOUNT = "ZeroAmount",
|
|
10
|
-
UNSUPPORTED_ORDER_TYPE = "UnsupportedOrderType"
|
|
11
|
-
}
|
|
12
|
-
}
|
|
1
|
+
export type PriceEstimationError = {
|
|
2
|
+
errorType: PriceEstimationError.errorType;
|
|
3
|
+
description: string;
|
|
4
|
+
};
|
|
5
|
+
export declare namespace PriceEstimationError {
|
|
6
|
+
enum errorType {
|
|
7
|
+
QUOTE_NOT_VERIFIED = "QuoteNotVerified",
|
|
8
|
+
UNSUPPORTED_TOKEN = "UnsupportedToken",
|
|
9
|
+
ZERO_AMOUNT = "ZeroAmount",
|
|
10
|
+
UNSUPPORTED_ORDER_TYPE = "UnsupportedOrderType"
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import type { Quote } from './Quote';
|
|
2
|
-
/**
|
|
3
|
-
* The protocol fee is taken as a percent of the order price improvement which is a difference between the executed price and the best quote.
|
|
4
|
-
*/
|
|
5
|
-
export type PriceImprovement = {
|
|
6
|
-
factor: number;
|
|
7
|
-
maxVolumeFactor: number;
|
|
8
|
-
/**
|
|
9
|
-
* The best quote received.
|
|
10
|
-
*/
|
|
11
|
-
quote: Quote;
|
|
12
|
-
};
|
|
1
|
+
import type { Quote } from './Quote';
|
|
2
|
+
/**
|
|
3
|
+
* The protocol fee is taken as a percent of the order price improvement which is a difference between the executed price and the best quote.
|
|
4
|
+
*/
|
|
5
|
+
export type PriceImprovement = {
|
|
6
|
+
factor: number;
|
|
7
|
+
maxVolumeFactor: number;
|
|
8
|
+
/**
|
|
9
|
+
* The best quote received.
|
|
10
|
+
*/
|
|
11
|
+
quote: Quote;
|
|
12
|
+
};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* How good should the price estimate be?
|
|
3
|
-
*
|
|
4
|
-
* Fast: The price estimate is chosen among the fastest N price estimates.
|
|
5
|
-
* Optimal: The price estimate is chosen among all price estimates.
|
|
6
|
-
* Verified: The price estimate is chosen among all verified/simulated
|
|
7
|
-
* price estimates.
|
|
8
|
-
*
|
|
9
|
-
* **NOTE**: Orders are supposed to be created from `verified` or `optimal`
|
|
10
|
-
* price estimates.
|
|
11
|
-
*/
|
|
12
|
-
export declare enum PriceQuality {
|
|
13
|
-
FAST = "fast",
|
|
14
|
-
OPTIMAL = "optimal",
|
|
15
|
-
VERIFIED = "verified"
|
|
16
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* How good should the price estimate be?
|
|
3
|
+
*
|
|
4
|
+
* Fast: The price estimate is chosen among the fastest N price estimates.
|
|
5
|
+
* Optimal: The price estimate is chosen among all price estimates.
|
|
6
|
+
* Verified: The price estimate is chosen among all verified/simulated
|
|
7
|
+
* price estimates.
|
|
8
|
+
*
|
|
9
|
+
* **NOTE**: Orders are supposed to be created from `verified` or `optimal`
|
|
10
|
+
* price estimates.
|
|
11
|
+
*/
|
|
12
|
+
export declare enum PriceQuality {
|
|
13
|
+
FAST = "fast",
|
|
14
|
+
OPTIMAL = "optimal",
|
|
15
|
+
VERIFIED = "verified"
|
|
16
|
+
}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import type { TokenAmount } from './TokenAmount';
|
|
2
|
-
/**
|
|
3
|
-
* A calculated order quote.
|
|
4
|
-
*
|
|
5
|
-
*/
|
|
6
|
-
export type Quote = {
|
|
7
|
-
/**
|
|
8
|
-
* The amount of the sell token.
|
|
9
|
-
*/
|
|
10
|
-
sellAmount?: TokenAmount;
|
|
11
|
-
/**
|
|
12
|
-
* The amount of the buy token.
|
|
13
|
-
*/
|
|
14
|
-
buyAmount?: TokenAmount;
|
|
15
|
-
/**
|
|
16
|
-
* The amount that needs to be paid, denominated in the sell token.
|
|
17
|
-
*/
|
|
18
|
-
fee?: TokenAmount;
|
|
19
|
-
};
|
|
1
|
+
import type { TokenAmount } from './TokenAmount';
|
|
2
|
+
/**
|
|
3
|
+
* A calculated order quote.
|
|
4
|
+
*
|
|
5
|
+
*/
|
|
6
|
+
export type Quote = {
|
|
7
|
+
/**
|
|
8
|
+
* The amount of the sell token.
|
|
9
|
+
*/
|
|
10
|
+
sellAmount?: TokenAmount;
|
|
11
|
+
/**
|
|
12
|
+
* The amount of the buy token.
|
|
13
|
+
*/
|
|
14
|
+
buyAmount?: TokenAmount;
|
|
15
|
+
/**
|
|
16
|
+
* The amount that needs to be paid, denominated in the sell token.
|
|
17
|
+
*/
|
|
18
|
+
fee?: TokenAmount;
|
|
19
|
+
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Where should the `sellToken` be drawn from?
|
|
3
|
-
*/
|
|
4
|
-
export declare enum SellTokenSource {
|
|
5
|
-
ERC20 = "erc20",
|
|
6
|
-
INTERNAL = "internal",
|
|
7
|
-
EXTERNAL = "external"
|
|
8
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* Where should the `sellToken` be drawn from?
|
|
3
|
+
*/
|
|
4
|
+
export declare enum SellTokenSource {
|
|
5
|
+
ERC20 = "erc20",
|
|
6
|
+
INTERNAL = "internal",
|
|
7
|
+
EXTERNAL = "external"
|
|
8
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { EcdsaSignature } from './EcdsaSignature';
|
|
2
|
-
import type { PreSignature } from './PreSignature';
|
|
3
|
-
/**
|
|
4
|
-
* A signature.
|
|
5
|
-
*/
|
|
6
|
-
export type Signature = (EcdsaSignature | PreSignature);
|
|
1
|
+
import type { EcdsaSignature } from './EcdsaSignature';
|
|
2
|
+
import type { PreSignature } from './PreSignature';
|
|
3
|
+
/**
|
|
4
|
+
* A signature.
|
|
5
|
+
*/
|
|
6
|
+
export type Signature = (EcdsaSignature | PreSignature);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* How was the order signed?
|
|
3
|
-
*/
|
|
4
|
-
export declare enum SigningScheme {
|
|
5
|
-
EIP712 = "eip712",
|
|
6
|
-
ETHSIGN = "ethsign",
|
|
7
|
-
PRESIGN = "presign",
|
|
8
|
-
EIP1271 = "eip1271"
|
|
9
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* How was the order signed?
|
|
3
|
+
*/
|
|
4
|
+
export declare enum SigningScheme {
|
|
5
|
+
EIP712 = "eip712",
|
|
6
|
+
ETHSIGN = "ethsign",
|
|
7
|
+
PRESIGN = "presign",
|
|
8
|
+
EIP1271 = "eip1271"
|
|
9
|
+
}
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import type { CompetitionAuction } from './CompetitionAuction';
|
|
2
|
-
import type { SolverSettlement } from './SolverSettlement';
|
|
3
|
-
import type { TransactionHash } from './TransactionHash';
|
|
4
|
-
/**
|
|
5
|
-
* The settlements submitted by every solver for a specific auction.
|
|
6
|
-
* The `auctionId` corresponds to the id external solvers are provided
|
|
7
|
-
* with.
|
|
8
|
-
*
|
|
9
|
-
*/
|
|
10
|
-
export type SolverCompetitionResponse = {
|
|
11
|
-
/**
|
|
12
|
-
* The ID of the auction the competition info is for.
|
|
13
|
-
*/
|
|
14
|
-
auctionId?: number;
|
|
15
|
-
/**
|
|
16
|
-
* The hash of the transaction that the winning solution of this info was submitted in.
|
|
17
|
-
*/
|
|
18
|
-
transactionHash?: TransactionHash | null;
|
|
19
|
-
/**
|
|
20
|
-
* Gas price used for ranking solutions.
|
|
21
|
-
*/
|
|
22
|
-
gasPrice?: number;
|
|
23
|
-
liquidityCollectedBlock?: number;
|
|
24
|
-
competitionSimulationBlock?: number;
|
|
25
|
-
auction?: CompetitionAuction;
|
|
26
|
-
/**
|
|
27
|
-
* Maps from solver name to object describing that solver's settlement.
|
|
28
|
-
*/
|
|
29
|
-
solutions?: Array<SolverSettlement>;
|
|
30
|
-
};
|
|
1
|
+
import type { CompetitionAuction } from './CompetitionAuction';
|
|
2
|
+
import type { SolverSettlement } from './SolverSettlement';
|
|
3
|
+
import type { TransactionHash } from './TransactionHash';
|
|
4
|
+
/**
|
|
5
|
+
* The settlements submitted by every solver for a specific auction.
|
|
6
|
+
* The `auctionId` corresponds to the id external solvers are provided
|
|
7
|
+
* with.
|
|
8
|
+
*
|
|
9
|
+
*/
|
|
10
|
+
export type SolverCompetitionResponse = {
|
|
11
|
+
/**
|
|
12
|
+
* The ID of the auction the competition info is for.
|
|
13
|
+
*/
|
|
14
|
+
auctionId?: number;
|
|
15
|
+
/**
|
|
16
|
+
* The hash of the transaction that the winning solution of this info was submitted in.
|
|
17
|
+
*/
|
|
18
|
+
transactionHash?: TransactionHash | null;
|
|
19
|
+
/**
|
|
20
|
+
* Gas price used for ranking solutions.
|
|
21
|
+
*/
|
|
22
|
+
gasPrice?: number;
|
|
23
|
+
liquidityCollectedBlock?: number;
|
|
24
|
+
competitionSimulationBlock?: number;
|
|
25
|
+
auction?: CompetitionAuction;
|
|
26
|
+
/**
|
|
27
|
+
* Maps from solver name to object describing that solver's settlement.
|
|
28
|
+
*/
|
|
29
|
+
solutions?: Array<SolverSettlement>;
|
|
30
|
+
};
|
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
import type { BigUint } from './BigUint';
|
|
2
|
-
import type { UID } from './UID';
|
|
3
|
-
export type SolverSettlement = {
|
|
4
|
-
/**
|
|
5
|
-
* Name of the solver.
|
|
6
|
-
*/
|
|
7
|
-
solver?: string;
|
|
8
|
-
/**
|
|
9
|
-
* The address used by the solver to execute the settlement on-chain.
|
|
10
|
-
*
|
|
11
|
-
* This field is missing for old settlements, the zero address has been
|
|
12
|
-
* used instead.
|
|
13
|
-
*/
|
|
14
|
-
solverAddress?: string;
|
|
15
|
-
objective?: {
|
|
16
|
-
/**
|
|
17
|
-
* The total objective value used for ranking solutions.
|
|
18
|
-
*/
|
|
19
|
-
total?: number;
|
|
20
|
-
surplus?: number;
|
|
21
|
-
fees?: number;
|
|
22
|
-
cost?: number;
|
|
23
|
-
gas?: number;
|
|
24
|
-
};
|
|
25
|
-
/**
|
|
26
|
-
* The score of the current auction as defined in [CIP-20](https://snapshot.org/#/cow.eth/proposal/0x2d3f9bd1ea72dca84b03e97dda3efc1f4a42a772c54bd2037e8b62e7d09a491f).
|
|
27
|
-
* It is `null` for old auctions.
|
|
28
|
-
*
|
|
29
|
-
*/
|
|
30
|
-
score?: BigUint | null;
|
|
31
|
-
/**
|
|
32
|
-
* The prices of tokens for settled user orders as passed to the settlement contract.
|
|
33
|
-
*
|
|
34
|
-
*/
|
|
35
|
-
clearingPrices?: Record<string, BigUint>;
|
|
36
|
-
/**
|
|
37
|
-
* Touched orders.
|
|
38
|
-
*/
|
|
39
|
-
orders?: Array<{
|
|
40
|
-
id?: UID;
|
|
41
|
-
executedAmount?: BigUint;
|
|
42
|
-
}>;
|
|
43
|
-
/**
|
|
44
|
-
* whether the solution is a winner (received the right to get executed) or not
|
|
45
|
-
*/
|
|
46
|
-
isWinner?: boolean;
|
|
47
|
-
};
|
|
1
|
+
import type { BigUint } from './BigUint';
|
|
2
|
+
import type { UID } from './UID';
|
|
3
|
+
export type SolverSettlement = {
|
|
4
|
+
/**
|
|
5
|
+
* Name of the solver.
|
|
6
|
+
*/
|
|
7
|
+
solver?: string;
|
|
8
|
+
/**
|
|
9
|
+
* The address used by the solver to execute the settlement on-chain.
|
|
10
|
+
*
|
|
11
|
+
* This field is missing for old settlements, the zero address has been
|
|
12
|
+
* used instead.
|
|
13
|
+
*/
|
|
14
|
+
solverAddress?: string;
|
|
15
|
+
objective?: {
|
|
16
|
+
/**
|
|
17
|
+
* The total objective value used for ranking solutions.
|
|
18
|
+
*/
|
|
19
|
+
total?: number;
|
|
20
|
+
surplus?: number;
|
|
21
|
+
fees?: number;
|
|
22
|
+
cost?: number;
|
|
23
|
+
gas?: number;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* The score of the current auction as defined in [CIP-20](https://snapshot.org/#/cow.eth/proposal/0x2d3f9bd1ea72dca84b03e97dda3efc1f4a42a772c54bd2037e8b62e7d09a491f).
|
|
27
|
+
* It is `null` for old auctions.
|
|
28
|
+
*
|
|
29
|
+
*/
|
|
30
|
+
score?: BigUint | null;
|
|
31
|
+
/**
|
|
32
|
+
* The prices of tokens for settled user orders as passed to the settlement contract.
|
|
33
|
+
*
|
|
34
|
+
*/
|
|
35
|
+
clearingPrices?: Record<string, BigUint>;
|
|
36
|
+
/**
|
|
37
|
+
* Touched orders.
|
|
38
|
+
*/
|
|
39
|
+
orders?: Array<{
|
|
40
|
+
id?: UID;
|
|
41
|
+
executedAmount?: BigUint;
|
|
42
|
+
}>;
|
|
43
|
+
/**
|
|
44
|
+
* whether the solution is a winner (received the right to get executed) or not
|
|
45
|
+
*/
|
|
46
|
+
isWinner?: boolean;
|
|
47
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The protocol fee is taken as a percent of the surplus.
|
|
3
|
-
*/
|
|
4
|
-
export type Surplus = {
|
|
5
|
-
factor: number;
|
|
6
|
-
maxVolumeFactor: number;
|
|
7
|
-
};
|
|
1
|
+
/**
|
|
2
|
+
* The protocol fee is taken as a percent of the surplus.
|
|
3
|
+
*/
|
|
4
|
+
export type Surplus = {
|
|
5
|
+
factor: number;
|
|
6
|
+
maxVolumeFactor: number;
|
|
7
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Amount of a token. `uint256` encoded in decimal.
|
|
3
|
-
*/
|
|
4
|
-
export type TokenAmount = string;
|
|
1
|
+
/**
|
|
2
|
+
* Amount of a token. `uint256` encoded in decimal.
|
|
3
|
+
*/
|
|
4
|
+
export type TokenAmount = string;
|