@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,30 +1,30 @@
|
|
|
1
|
-
import type { Address } from './Address';
|
|
2
|
-
import type { AuctionOrder } from './AuctionOrder';
|
|
3
|
-
import type { AuctionPrices } from './AuctionPrices';
|
|
4
|
-
/**
|
|
5
|
-
* A batch auction for solving.
|
|
6
|
-
*
|
|
7
|
-
*/
|
|
8
|
-
export type Auction = {
|
|
9
|
-
/**
|
|
10
|
-
* The unique identifier of the auction. Increment whenever the backend creates a new auction.
|
|
11
|
-
*
|
|
12
|
-
*/
|
|
13
|
-
id?: number;
|
|
14
|
-
/**
|
|
15
|
-
* The block number for the auction. Orders and prices are guaranteed to be valid on this block. Proposed settlements should be valid for this block as well.
|
|
16
|
-
*
|
|
17
|
-
*/
|
|
18
|
-
block?: number;
|
|
19
|
-
/**
|
|
20
|
-
* The solvable orders included in the auction.
|
|
21
|
-
*
|
|
22
|
-
*/
|
|
23
|
-
orders?: Array<AuctionOrder>;
|
|
24
|
-
prices?: AuctionPrices;
|
|
25
|
-
/**
|
|
26
|
-
* List of addresses on whose surplus will count towards the objective value of their solution (unlike other orders that were created by the solver).
|
|
27
|
-
*
|
|
28
|
-
*/
|
|
29
|
-
surplusCapturingJitOrderOwners?: Array<Address>;
|
|
30
|
-
};
|
|
1
|
+
import type { Address } from './Address';
|
|
2
|
+
import type { AuctionOrder } from './AuctionOrder';
|
|
3
|
+
import type { AuctionPrices } from './AuctionPrices';
|
|
4
|
+
/**
|
|
5
|
+
* A batch auction for solving.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
export type Auction = {
|
|
9
|
+
/**
|
|
10
|
+
* The unique identifier of the auction. Increment whenever the backend creates a new auction.
|
|
11
|
+
*
|
|
12
|
+
*/
|
|
13
|
+
id?: number;
|
|
14
|
+
/**
|
|
15
|
+
* The block number for the auction. Orders and prices are guaranteed to be valid on this block. Proposed settlements should be valid for this block as well.
|
|
16
|
+
*
|
|
17
|
+
*/
|
|
18
|
+
block?: number;
|
|
19
|
+
/**
|
|
20
|
+
* The solvable orders included in the auction.
|
|
21
|
+
*
|
|
22
|
+
*/
|
|
23
|
+
orders?: Array<AuctionOrder>;
|
|
24
|
+
prices?: AuctionPrices;
|
|
25
|
+
/**
|
|
26
|
+
* List of addresses on whose surplus will count towards the objective value of their solution (unlike other orders that were created by the solver).
|
|
27
|
+
*
|
|
28
|
+
*/
|
|
29
|
+
surplusCapturingJitOrderOwners?: Array<Address>;
|
|
30
|
+
};
|
|
@@ -1,92 +1,92 @@
|
|
|
1
|
-
import type { Address } from './Address';
|
|
2
|
-
import type { AppDataHash } from './AppDataHash';
|
|
3
|
-
import type { BuyTokenDestination } from './BuyTokenDestination';
|
|
4
|
-
import type { FeePolicy } from './FeePolicy';
|
|
5
|
-
import type { InteractionData } from './InteractionData';
|
|
6
|
-
import type { OrderClass } from './OrderClass';
|
|
7
|
-
import type { OrderKind } from './OrderKind';
|
|
8
|
-
import type { Quote } from './Quote';
|
|
9
|
-
import type { SellTokenSource } from './SellTokenSource';
|
|
10
|
-
import type { Signature } from './Signature';
|
|
11
|
-
import type { TokenAmount } from './TokenAmount';
|
|
12
|
-
import type { UID } from './UID';
|
|
13
|
-
/**
|
|
14
|
-
* A solvable order included in the current batch auction. Contains the data forwarded to solvers for solving.
|
|
15
|
-
*
|
|
16
|
-
*/
|
|
17
|
-
export type AuctionOrder = {
|
|
18
|
-
uid: UID;
|
|
19
|
-
/**
|
|
20
|
-
* see `OrderParameters::sellToken`
|
|
21
|
-
*/
|
|
22
|
-
sellToken: Address;
|
|
23
|
-
/**
|
|
24
|
-
* see `OrderParameters::buyToken`
|
|
25
|
-
*/
|
|
26
|
-
buyToken: Address;
|
|
27
|
-
/**
|
|
28
|
-
* see `OrderParameters::sellAmount`
|
|
29
|
-
*/
|
|
30
|
-
sellAmount: TokenAmount;
|
|
31
|
-
/**
|
|
32
|
-
* see `OrderParameters::buyAmount`
|
|
33
|
-
*/
|
|
34
|
-
buyAmount: TokenAmount;
|
|
35
|
-
/**
|
|
36
|
-
* Creation time of the order. Denominated in epoch seconds.
|
|
37
|
-
*/
|
|
38
|
-
created: string;
|
|
39
|
-
/**
|
|
40
|
-
* see `OrderParameters::validTo`
|
|
41
|
-
*/
|
|
42
|
-
validTo: number;
|
|
43
|
-
/**
|
|
44
|
-
* see `OrderParameters::kind`
|
|
45
|
-
*/
|
|
46
|
-
kind: OrderKind;
|
|
47
|
-
/**
|
|
48
|
-
* see `OrderParameters::receiver`
|
|
49
|
-
*/
|
|
50
|
-
receiver: Address | null;
|
|
51
|
-
owner: Address;
|
|
52
|
-
/**
|
|
53
|
-
* see `OrderParameters::partiallyFillable`
|
|
54
|
-
*/
|
|
55
|
-
partiallyFillable: boolean;
|
|
56
|
-
/**
|
|
57
|
-
* Currently executed amount of sell/buy token, depending on the order kind.
|
|
58
|
-
*
|
|
59
|
-
*/
|
|
60
|
-
executed: TokenAmount;
|
|
61
|
-
/**
|
|
62
|
-
* The pre-interactions that need to be executed before the first execution of the order.
|
|
63
|
-
*
|
|
64
|
-
*/
|
|
65
|
-
preInteractions: Array<InteractionData>;
|
|
66
|
-
/**
|
|
67
|
-
* The post-interactions that need to be executed after the execution of the order.
|
|
68
|
-
*
|
|
69
|
-
*/
|
|
70
|
-
postInteractions: Array<InteractionData>;
|
|
71
|
-
/**
|
|
72
|
-
* see `OrderParameters::sellTokenBalance`
|
|
73
|
-
*/
|
|
74
|
-
sellTokenBalance: SellTokenSource;
|
|
75
|
-
/**
|
|
76
|
-
* see `OrderParameters::buyTokenBalance`
|
|
77
|
-
*/
|
|
78
|
-
buyTokenBalance: BuyTokenDestination;
|
|
79
|
-
class: OrderClass;
|
|
80
|
-
appData: AppDataHash;
|
|
81
|
-
signature: Signature;
|
|
82
|
-
/**
|
|
83
|
-
* The fee policies that are used to compute the protocol fees for this order.
|
|
84
|
-
*
|
|
85
|
-
*/
|
|
86
|
-
protocolFees: Array<FeePolicy>;
|
|
87
|
-
/**
|
|
88
|
-
* A winning quote.
|
|
89
|
-
*
|
|
90
|
-
*/
|
|
91
|
-
quote?: Quote;
|
|
92
|
-
};
|
|
1
|
+
import type { Address } from './Address';
|
|
2
|
+
import type { AppDataHash } from './AppDataHash';
|
|
3
|
+
import type { BuyTokenDestination } from './BuyTokenDestination';
|
|
4
|
+
import type { FeePolicy } from './FeePolicy';
|
|
5
|
+
import type { InteractionData } from './InteractionData';
|
|
6
|
+
import type { OrderClass } from './OrderClass';
|
|
7
|
+
import type { OrderKind } from './OrderKind';
|
|
8
|
+
import type { Quote } from './Quote';
|
|
9
|
+
import type { SellTokenSource } from './SellTokenSource';
|
|
10
|
+
import type { Signature } from './Signature';
|
|
11
|
+
import type { TokenAmount } from './TokenAmount';
|
|
12
|
+
import type { UID } from './UID';
|
|
13
|
+
/**
|
|
14
|
+
* A solvable order included in the current batch auction. Contains the data forwarded to solvers for solving.
|
|
15
|
+
*
|
|
16
|
+
*/
|
|
17
|
+
export type AuctionOrder = {
|
|
18
|
+
uid: UID;
|
|
19
|
+
/**
|
|
20
|
+
* see `OrderParameters::sellToken`
|
|
21
|
+
*/
|
|
22
|
+
sellToken: Address;
|
|
23
|
+
/**
|
|
24
|
+
* see `OrderParameters::buyToken`
|
|
25
|
+
*/
|
|
26
|
+
buyToken: Address;
|
|
27
|
+
/**
|
|
28
|
+
* see `OrderParameters::sellAmount`
|
|
29
|
+
*/
|
|
30
|
+
sellAmount: TokenAmount;
|
|
31
|
+
/**
|
|
32
|
+
* see `OrderParameters::buyAmount`
|
|
33
|
+
*/
|
|
34
|
+
buyAmount: TokenAmount;
|
|
35
|
+
/**
|
|
36
|
+
* Creation time of the order. Denominated in epoch seconds.
|
|
37
|
+
*/
|
|
38
|
+
created: string;
|
|
39
|
+
/**
|
|
40
|
+
* see `OrderParameters::validTo`
|
|
41
|
+
*/
|
|
42
|
+
validTo: number;
|
|
43
|
+
/**
|
|
44
|
+
* see `OrderParameters::kind`
|
|
45
|
+
*/
|
|
46
|
+
kind: OrderKind;
|
|
47
|
+
/**
|
|
48
|
+
* see `OrderParameters::receiver`
|
|
49
|
+
*/
|
|
50
|
+
receiver: Address | null;
|
|
51
|
+
owner: Address;
|
|
52
|
+
/**
|
|
53
|
+
* see `OrderParameters::partiallyFillable`
|
|
54
|
+
*/
|
|
55
|
+
partiallyFillable: boolean;
|
|
56
|
+
/**
|
|
57
|
+
* Currently executed amount of sell/buy token, depending on the order kind.
|
|
58
|
+
*
|
|
59
|
+
*/
|
|
60
|
+
executed: TokenAmount;
|
|
61
|
+
/**
|
|
62
|
+
* The pre-interactions that need to be executed before the first execution of the order.
|
|
63
|
+
*
|
|
64
|
+
*/
|
|
65
|
+
preInteractions: Array<InteractionData>;
|
|
66
|
+
/**
|
|
67
|
+
* The post-interactions that need to be executed after the execution of the order.
|
|
68
|
+
*
|
|
69
|
+
*/
|
|
70
|
+
postInteractions: Array<InteractionData>;
|
|
71
|
+
/**
|
|
72
|
+
* see `OrderParameters::sellTokenBalance`
|
|
73
|
+
*/
|
|
74
|
+
sellTokenBalance: SellTokenSource;
|
|
75
|
+
/**
|
|
76
|
+
* see `OrderParameters::buyTokenBalance`
|
|
77
|
+
*/
|
|
78
|
+
buyTokenBalance: BuyTokenDestination;
|
|
79
|
+
class: OrderClass;
|
|
80
|
+
appData: AppDataHash;
|
|
81
|
+
signature: Signature;
|
|
82
|
+
/**
|
|
83
|
+
* The fee policies that are used to compute the protocol fees for this order.
|
|
84
|
+
*
|
|
85
|
+
*/
|
|
86
|
+
protocolFees: Array<FeePolicy>;
|
|
87
|
+
/**
|
|
88
|
+
* A winning quote.
|
|
89
|
+
*
|
|
90
|
+
*/
|
|
91
|
+
quote?: Quote;
|
|
92
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { BigUint } from './BigUint';
|
|
2
|
-
/**
|
|
3
|
-
* The reference prices for all traded tokens in the auction as a mapping from token addresses to a price denominated in native token (i.e. 1e18 represents a token that trades one to one with the native token). These prices are used for solution competition for computing surplus and converting fees to native token.
|
|
4
|
-
*
|
|
5
|
-
*/
|
|
6
|
-
export type AuctionPrices = Record<string, BigUint>;
|
|
1
|
+
import type { BigUint } from './BigUint';
|
|
2
|
+
/**
|
|
3
|
+
* The reference prices for all traded tokens in the auction as a mapping from token addresses to a price denominated in native token (i.e. 1e18 represents a token that trades one to one with the native token). These prices are used for solution competition for computing surplus and converting fees to native token.
|
|
4
|
+
*
|
|
5
|
+
*/
|
|
6
|
+
export type AuctionPrices = Record<string, BigUint>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A big unsigned integer encoded in decimal.
|
|
3
|
-
*/
|
|
4
|
-
export type BigUint = string;
|
|
1
|
+
/**
|
|
2
|
+
* A big unsigned integer encoded in decimal.
|
|
3
|
+
*/
|
|
4
|
+
export type BigUint = string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Where should the `buyToken` be transferred to?
|
|
3
|
-
*/
|
|
4
|
-
export declare enum BuyTokenDestination {
|
|
5
|
-
ERC20 = "erc20",
|
|
6
|
-
INTERNAL = "internal"
|
|
7
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* Where should the `buyToken` be transferred to?
|
|
3
|
+
*/
|
|
4
|
+
export declare enum BuyTokenDestination {
|
|
5
|
+
ERC20 = "erc20",
|
|
6
|
+
INTERNAL = "internal"
|
|
7
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Some `calldata` sent to a contract in a transaction encoded as a hex with `0x` prefix.
|
|
3
|
-
*/
|
|
4
|
-
export type CallData = string;
|
|
1
|
+
/**
|
|
2
|
+
* Some `calldata` sent to a contract in a transaction encoded as a hex with `0x` prefix.
|
|
3
|
+
*/
|
|
4
|
+
export type CallData = string;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import type { AuctionPrices } from './AuctionPrices';
|
|
2
|
-
import type { UID } from './UID';
|
|
3
|
-
/**
|
|
4
|
-
* The components that describe a batch auction for the solver competition.
|
|
5
|
-
*
|
|
6
|
-
*/
|
|
7
|
-
export type CompetitionAuction = {
|
|
8
|
-
/**
|
|
9
|
-
* The UIDs of the orders included in the auction.
|
|
10
|
-
*
|
|
11
|
-
*/
|
|
12
|
-
orders?: Array<UID>;
|
|
13
|
-
prices?: AuctionPrices;
|
|
14
|
-
};
|
|
1
|
+
import type { AuctionPrices } from './AuctionPrices';
|
|
2
|
+
import type { UID } from './UID';
|
|
3
|
+
/**
|
|
4
|
+
* The components that describe a batch auction for the solver competition.
|
|
5
|
+
*
|
|
6
|
+
*/
|
|
7
|
+
export type CompetitionAuction = {
|
|
8
|
+
/**
|
|
9
|
+
* The UIDs of the orders included in the auction.
|
|
10
|
+
*
|
|
11
|
+
*/
|
|
12
|
+
orders?: Array<UID>;
|
|
13
|
+
prices?: AuctionPrices;
|
|
14
|
+
};
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import type { ExecutedAmounts } from './ExecutedAmounts';
|
|
2
|
-
export type CompetitionOrderStatus = {
|
|
3
|
-
type: CompetitionOrderStatus.type;
|
|
4
|
-
/**
|
|
5
|
-
* A list of solvers who participated in the latest competition, sorted
|
|
6
|
-
* by score in ascending order, where the last element is the winner.
|
|
7
|
-
*
|
|
8
|
-
* The presence of executed amounts defines whether the solver provided
|
|
9
|
-
* a solution for the desired order.
|
|
10
|
-
*/
|
|
11
|
-
value?: Array<{
|
|
12
|
-
/**
|
|
13
|
-
* Name of the solver.
|
|
14
|
-
*/
|
|
15
|
-
solver: string;
|
|
16
|
-
executedAmounts?: ExecutedAmounts;
|
|
17
|
-
}>;
|
|
18
|
-
};
|
|
19
|
-
export declare namespace CompetitionOrderStatus {
|
|
20
|
-
enum type {
|
|
21
|
-
OPEN = "open",
|
|
22
|
-
SCHEDULED = "scheduled",
|
|
23
|
-
ACTIVE = "active",
|
|
24
|
-
SOLVED = "solved",
|
|
25
|
-
EXECUTING = "executing",
|
|
26
|
-
TRADED = "traded",
|
|
27
|
-
CANCELLED = "cancelled"
|
|
28
|
-
}
|
|
29
|
-
}
|
|
1
|
+
import type { ExecutedAmounts } from './ExecutedAmounts';
|
|
2
|
+
export type CompetitionOrderStatus = {
|
|
3
|
+
type: CompetitionOrderStatus.type;
|
|
4
|
+
/**
|
|
5
|
+
* A list of solvers who participated in the latest competition, sorted
|
|
6
|
+
* by score in ascending order, where the last element is the winner.
|
|
7
|
+
*
|
|
8
|
+
* The presence of executed amounts defines whether the solver provided
|
|
9
|
+
* a solution for the desired order.
|
|
10
|
+
*/
|
|
11
|
+
value?: Array<{
|
|
12
|
+
/**
|
|
13
|
+
* Name of the solver.
|
|
14
|
+
*/
|
|
15
|
+
solver: string;
|
|
16
|
+
executedAmounts?: ExecutedAmounts;
|
|
17
|
+
}>;
|
|
18
|
+
};
|
|
19
|
+
export declare namespace CompetitionOrderStatus {
|
|
20
|
+
enum type {
|
|
21
|
+
OPEN = "open",
|
|
22
|
+
SCHEDULED = "scheduled",
|
|
23
|
+
ACTIVE = "active",
|
|
24
|
+
SOLVED = "solved",
|
|
25
|
+
EXECUTING = "executing",
|
|
26
|
+
TRADED = "traded",
|
|
27
|
+
CANCELLED = "cancelled"
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 65 bytes encoded as hex with `0x` prefix. `r || s || v` from the spec.
|
|
3
|
-
*/
|
|
4
|
-
export type EcdsaSignature = string;
|
|
1
|
+
/**
|
|
2
|
+
* 65 bytes encoded as hex with `0x` prefix. `r || s || v` from the spec.
|
|
3
|
+
*/
|
|
4
|
+
export type EcdsaSignature = string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* How was the order signed?
|
|
3
|
-
*/
|
|
4
|
-
export declare enum EcdsaSigningScheme {
|
|
5
|
-
EIP712 = "eip712",
|
|
6
|
-
ETHSIGN = "ethsign"
|
|
7
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* How was the order signed?
|
|
3
|
+
*/
|
|
4
|
+
export declare enum EcdsaSigningScheme {
|
|
5
|
+
EIP712 = "eip712",
|
|
6
|
+
ETHSIGN = "ethsign"
|
|
7
|
+
}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import type { TransactionHash } from './TransactionHash';
|
|
2
|
-
/**
|
|
3
|
-
* Provides the additional data for ethflow orders.
|
|
4
|
-
*/
|
|
5
|
-
export type EthflowData = {
|
|
6
|
-
/**
|
|
7
|
-
* Specifies in which transaction the order was refunded. If
|
|
8
|
-
* this field is null the order was not yet refunded.
|
|
9
|
-
*
|
|
10
|
-
*/
|
|
11
|
-
refundTxHash: TransactionHash | null;
|
|
12
|
-
/**
|
|
13
|
-
* Describes the `validTo` of an order ethflow order.
|
|
14
|
-
*
|
|
15
|
-
* **NOTE**: For ethflow orders, the `validTo` encoded in the smart
|
|
16
|
-
* contract is `type(uint256).max`.
|
|
17
|
-
*
|
|
18
|
-
*/
|
|
19
|
-
userValidTo: number;
|
|
20
|
-
};
|
|
1
|
+
import type { TransactionHash } from './TransactionHash';
|
|
2
|
+
/**
|
|
3
|
+
* Provides the additional data for ethflow orders.
|
|
4
|
+
*/
|
|
5
|
+
export type EthflowData = {
|
|
6
|
+
/**
|
|
7
|
+
* Specifies in which transaction the order was refunded. If
|
|
8
|
+
* this field is null the order was not yet refunded.
|
|
9
|
+
*
|
|
10
|
+
*/
|
|
11
|
+
refundTxHash: TransactionHash | null;
|
|
12
|
+
/**
|
|
13
|
+
* Describes the `validTo` of an order ethflow order.
|
|
14
|
+
*
|
|
15
|
+
* **NOTE**: For ethflow orders, the `validTo` encoded in the smart
|
|
16
|
+
* contract is `type(uint256).max`.
|
|
17
|
+
*
|
|
18
|
+
*/
|
|
19
|
+
userValidTo: number;
|
|
20
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { BigUint } from './BigUint';
|
|
2
|
-
export type ExecutedAmounts = {
|
|
3
|
-
sell: BigUint;
|
|
4
|
-
buy: BigUint;
|
|
5
|
-
};
|
|
1
|
+
import type { BigUint } from './BigUint';
|
|
2
|
+
export type ExecutedAmounts = {
|
|
3
|
+
sell: BigUint;
|
|
4
|
+
buy: BigUint;
|
|
5
|
+
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { Address } from './Address';
|
|
2
|
-
import type { FeePolicy } from './FeePolicy';
|
|
3
|
-
import type { TokenAmount } from './TokenAmount';
|
|
4
|
-
export type ExecutedProtocolFee = {
|
|
5
|
-
policy?: FeePolicy;
|
|
6
|
-
amount?: TokenAmount;
|
|
7
|
-
token?: Address;
|
|
8
|
-
};
|
|
1
|
+
import type { Address } from './Address';
|
|
2
|
+
import type { FeePolicy } from './FeePolicy';
|
|
3
|
+
import type { TokenAmount } from './TokenAmount';
|
|
4
|
+
export type ExecutedProtocolFee = {
|
|
5
|
+
policy?: FeePolicy;
|
|
6
|
+
amount?: TokenAmount;
|
|
7
|
+
token?: Address;
|
|
8
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { PriceImprovement } from './PriceImprovement';
|
|
2
|
-
import type { Surplus } from './Surplus';
|
|
3
|
-
import type { Volume } from './Volume';
|
|
4
|
-
/**
|
|
5
|
-
* Defines the ways to calculate the protocol fee.
|
|
6
|
-
*/
|
|
7
|
-
export type FeePolicy = (Surplus | Volume | PriceImprovement);
|
|
1
|
+
import type { PriceImprovement } from './PriceImprovement';
|
|
2
|
+
import type { Surplus } from './Surplus';
|
|
3
|
+
import type { Volume } from './Volume';
|
|
4
|
+
/**
|
|
5
|
+
* Defines the ways to calculate the protocol fee.
|
|
6
|
+
*/
|
|
7
|
+
export type FeePolicy = (Surplus | Volume | PriceImprovement);
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type { Address } from './Address';
|
|
2
|
-
import type { CallData } from './CallData';
|
|
3
|
-
import type { TokenAmount } from './TokenAmount';
|
|
4
|
-
export type InteractionData = {
|
|
5
|
-
target?: Address;
|
|
6
|
-
value?: TokenAmount;
|
|
7
|
-
/**
|
|
8
|
-
* The call data to be used for the interaction.
|
|
9
|
-
*/
|
|
10
|
-
call_data?: Array<CallData>;
|
|
11
|
-
};
|
|
1
|
+
import type { Address } from './Address';
|
|
2
|
+
import type { CallData } from './CallData';
|
|
3
|
+
import type { TokenAmount } from './TokenAmount';
|
|
4
|
+
export type InteractionData = {
|
|
5
|
+
target?: Address;
|
|
6
|
+
value?: TokenAmount;
|
|
7
|
+
/**
|
|
8
|
+
* The call data to be used for the interaction.
|
|
9
|
+
*/
|
|
10
|
+
call_data?: Array<CallData>;
|
|
11
|
+
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The estimated native price for the token
|
|
3
|
-
*
|
|
4
|
-
*/
|
|
5
|
-
export type NativePriceResponse = {
|
|
6
|
-
/**
|
|
7
|
-
* Estimated price of the token.
|
|
8
|
-
*/
|
|
9
|
-
price?: number;
|
|
10
|
-
};
|
|
1
|
+
/**
|
|
2
|
+
* The estimated native price for the token
|
|
3
|
+
*
|
|
4
|
+
*/
|
|
5
|
+
export type NativePriceResponse = {
|
|
6
|
+
/**
|
|
7
|
+
* Estimated price of the token.
|
|
8
|
+
*/
|
|
9
|
+
price?: number;
|
|
10
|
+
};
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import type { Address } from './Address';
|
|
2
|
-
export type OnchainOrderData = {
|
|
3
|
-
/**
|
|
4
|
-
* If orders are placed as on-chain orders, the owner of the order might be a smart contract, but not the user placing the order. The actual user will be provided in this field.
|
|
5
|
-
*
|
|
6
|
-
*/
|
|
7
|
-
sender: Address;
|
|
8
|
-
/**
|
|
9
|
-
* Describes the error, if the order placement was not successful. This could happen, for example, if the `validTo` is too high, or no valid quote was found or generated.
|
|
10
|
-
*
|
|
11
|
-
*/
|
|
12
|
-
placementError?: OnchainOrderData.placementError;
|
|
13
|
-
};
|
|
14
|
-
export declare namespace OnchainOrderData {
|
|
15
|
-
/**
|
|
16
|
-
* Describes the error, if the order placement was not successful. This could happen, for example, if the `validTo` is too high, or no valid quote was found or generated.
|
|
17
|
-
*
|
|
18
|
-
*/
|
|
19
|
-
enum placementError {
|
|
20
|
-
QUOTE_NOT_FOUND = "QuoteNotFound",
|
|
21
|
-
VALID_TO_TOO_FAR_IN_FUTURE = "ValidToTooFarInFuture",
|
|
22
|
-
PRE_VALIDATION_ERROR = "PreValidationError"
|
|
23
|
-
}
|
|
24
|
-
}
|
|
1
|
+
import type { Address } from './Address';
|
|
2
|
+
export type OnchainOrderData = {
|
|
3
|
+
/**
|
|
4
|
+
* If orders are placed as on-chain orders, the owner of the order might be a smart contract, but not the user placing the order. The actual user will be provided in this field.
|
|
5
|
+
*
|
|
6
|
+
*/
|
|
7
|
+
sender: Address;
|
|
8
|
+
/**
|
|
9
|
+
* Describes the error, if the order placement was not successful. This could happen, for example, if the `validTo` is too high, or no valid quote was found or generated.
|
|
10
|
+
*
|
|
11
|
+
*/
|
|
12
|
+
placementError?: OnchainOrderData.placementError;
|
|
13
|
+
};
|
|
14
|
+
export declare namespace OnchainOrderData {
|
|
15
|
+
/**
|
|
16
|
+
* Describes the error, if the order placement was not successful. This could happen, for example, if the `validTo` is too high, or no valid quote was found or generated.
|
|
17
|
+
*
|
|
18
|
+
*/
|
|
19
|
+
enum placementError {
|
|
20
|
+
QUOTE_NOT_FOUND = "QuoteNotFound",
|
|
21
|
+
VALID_TO_TOO_FAR_IN_FUTURE = "ValidToTooFarInFuture",
|
|
22
|
+
PRE_VALIDATION_ERROR = "PreValidationError"
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { OrderCreation } from './OrderCreation';
|
|
2
|
-
import type { OrderMetaData } from './OrderMetaData';
|
|
3
|
-
export type Order = (OrderCreation & OrderMetaData);
|
|
1
|
+
import type { OrderCreation } from './OrderCreation';
|
|
2
|
+
import type { OrderMetaData } from './OrderMetaData';
|
|
3
|
+
export type Order = (OrderCreation & OrderMetaData);
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import type { EcdsaSignature } from './EcdsaSignature';
|
|
2
|
-
import type { EcdsaSigningScheme } from './EcdsaSigningScheme';
|
|
3
|
-
/**
|
|
4
|
-
* [EIP-712](https://eips.ethereum.org/EIPS/eip-712) signature of struct
|
|
5
|
-
* `OrderCancellation(bytes orderUid)` from the order's owner.
|
|
6
|
-
*
|
|
7
|
-
*/
|
|
8
|
-
export type OrderCancellation = {
|
|
9
|
-
/**
|
|
10
|
-
* OrderCancellation signed by owner
|
|
11
|
-
*/
|
|
12
|
-
signature: EcdsaSignature;
|
|
13
|
-
signingScheme: EcdsaSigningScheme;
|
|
14
|
-
};
|
|
1
|
+
import type { EcdsaSignature } from './EcdsaSignature';
|
|
2
|
+
import type { EcdsaSigningScheme } from './EcdsaSigningScheme';
|
|
3
|
+
/**
|
|
4
|
+
* [EIP-712](https://eips.ethereum.org/EIPS/eip-712) signature of struct
|
|
5
|
+
* `OrderCancellation(bytes orderUid)` from the order's owner.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
export type OrderCancellation = {
|
|
9
|
+
/**
|
|
10
|
+
* OrderCancellation signed by owner
|
|
11
|
+
*/
|
|
12
|
+
signature: EcdsaSignature;
|
|
13
|
+
signingScheme: EcdsaSigningScheme;
|
|
14
|
+
};
|