@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.
Files changed (240) hide show
  1. package/README.md +3 -1
  2. package/dist/README.md +3 -1
  3. package/dist/bridging/BridgingSdk/BridgingSdk.d.ts +87 -63
  4. package/dist/bridging/BridgingSdk/findBridgeProviderFromHook.d.ts +2 -0
  5. package/dist/bridging/BridgingSdk/getBridgeSignedHook.d.ts +8 -0
  6. package/dist/bridging/BridgingSdk/getCrossChainOrder.d.ts +16 -0
  7. package/dist/bridging/BridgingSdk/getQuoteWithBridge.d.ts +3 -0
  8. package/dist/bridging/BridgingSdk/getQuoteWithoutBridge.d.ts +7 -7
  9. package/dist/bridging/BridgingSdk/mock/bridgeRequestMocks.d.ts +20 -0
  10. package/dist/bridging/BridgingSdk/types.d.ts +43 -0
  11. package/dist/bridging/const.d.ts +4 -2
  12. package/dist/bridging/errors.d.ts +22 -0
  13. package/dist/bridging/index.d.ts +8 -5
  14. package/dist/bridging/providers/across/AcrossApi.d.ts +30 -195
  15. package/dist/bridging/providers/across/AcrossBridgeProvider.d.ts +44 -41
  16. package/dist/bridging/providers/across/abi.d.ts +154 -154
  17. package/dist/bridging/providers/across/const/contracts.d.ts +3 -3
  18. package/dist/bridging/providers/across/const/interfaces.d.ts +3 -0
  19. package/dist/bridging/providers/across/const/misc.d.ts +2 -0
  20. package/dist/bridging/providers/across/const/tokens.d.ts +11 -11
  21. package/dist/bridging/providers/across/createAcrossDepositCall.d.ts +9 -9
  22. package/dist/bridging/providers/across/getDepositParams.d.ts +4 -0
  23. package/dist/bridging/providers/across/types.d.ts +242 -0
  24. package/dist/bridging/providers/across/util.d.ts +43 -39
  25. package/dist/bridging/providers/bungee/BungeeApi.d.ts +67 -0
  26. package/dist/bridging/providers/bungee/BungeeBridgeProvider.d.ts +44 -0
  27. package/dist/bridging/providers/bungee/abi.d.ts +203 -0
  28. package/dist/bridging/providers/bungee/const/contracts.d.ts +4 -0
  29. package/dist/bridging/providers/bungee/const/misc.d.ts +8 -0
  30. package/dist/bridging/providers/bungee/createBungeeDepositCall.d.ts +7 -0
  31. package/dist/bridging/providers/bungee/getBridgingStatusFromEvents.d.ts +3 -0
  32. package/dist/bridging/providers/bungee/types.d.ts +267 -0
  33. package/dist/bridging/providers/bungee/util.d.ts +62 -0
  34. package/dist/bridging/providers/mock/MockBridgeProvider.d.ts +26 -20
  35. package/dist/bridging/providers/utils/getGasLimitEstimationForHook.d.ts +4 -0
  36. package/dist/bridging/types.d.ts +323 -251
  37. package/dist/bridging/utils.d.ts +9 -6
  38. package/dist/chains/const/index.d.ts +25 -25
  39. package/dist/chains/const/path.d.ts +1 -1
  40. package/dist/chains/details/arbitrum.d.ts +7 -7
  41. package/dist/chains/details/avalanche.d.ts +2 -0
  42. package/dist/chains/details/base.d.ts +7 -7
  43. package/dist/chains/details/gnosis.d.ts +7 -7
  44. package/dist/chains/details/index.d.ts +8 -0
  45. package/dist/chains/details/mainnet.d.ts +7 -7
  46. package/dist/chains/details/optimism.d.ts +2 -2
  47. package/dist/chains/details/polygon.d.ts +2 -2
  48. package/dist/chains/details/sepolia.d.ts +7 -7
  49. package/dist/chains/index.d.ts +4 -3
  50. package/dist/chains/types.d.ts +127 -122
  51. package/dist/chains/utils.d.ts +18 -18
  52. package/dist/common/consts/config.d.ts +9 -9
  53. package/dist/common/consts/contracts.d.ts +43 -34
  54. package/dist/common/consts/ipfs.d.ts +2 -2
  55. package/dist/common/consts/order.d.ts +1 -0
  56. package/dist/common/consts/path.d.ts +1 -1
  57. package/dist/common/consts/tokens.d.ts +9 -9
  58. package/dist/common/generated/CoWShed.d.ts +219 -219
  59. package/dist/common/generated/CoWShedFactory.d.ts +191 -191
  60. package/dist/common/generated/ComposableCoW.d.ts +340 -340
  61. package/dist/common/generated/EthFlow.d.ts +117 -117
  62. package/dist/common/generated/ExtensibleFallbackHandler.d.ts +282 -282
  63. package/dist/common/generated/GPv2Settlement.d.ts +107 -107
  64. package/dist/common/generated/TWAP.d.ts +141 -141
  65. package/dist/common/generated/common.d.ts +21 -21
  66. package/dist/common/generated/factories/CoWShedFactory__factory.d.ts +250 -250
  67. package/dist/common/generated/factories/CoWShed__factory.d.ts +254 -254
  68. package/dist/common/generated/factories/ComposableCoW__factory.d.ts +475 -475
  69. package/dist/common/generated/factories/EthFlow__factory.d.ts +124 -124
  70. package/dist/common/generated/factories/ExtensibleFallbackHandler__factory.d.ts +389 -389
  71. package/dist/common/generated/factories/GPv2Settlement__factory.d.ts +81 -81
  72. package/dist/common/generated/factories/TWAP__factory.d.ts +260 -260
  73. package/dist/common/generated/factories/index.d.ts +7 -7
  74. package/dist/common/generated/index.d.ts +15 -15
  75. package/dist/common/index.d.ts +12 -10
  76. package/dist/common/types/config.d.ts +70 -70
  77. package/dist/common/types/cow-error.d.ts +4 -4
  78. package/dist/common/types/ethereum.d.ts +5 -5
  79. package/dist/common/types/tokens.d.ts +12 -12
  80. package/dist/common/types/wallets.d.ts +5 -5
  81. package/dist/common/utils/common.d.ts +1 -0
  82. package/dist/common/utils/config.d.ts +4 -4
  83. package/dist/common/utils/log.d.ts +2 -0
  84. package/dist/common/utils/math.d.ts +19 -0
  85. package/dist/common/utils/order.d.ts +4 -0
  86. package/dist/common/utils/serialize.d.ts +1 -1
  87. package/dist/common/utils/wallet.d.ts +3 -3
  88. package/dist/composable/ConditionalOrder.d.ts +206 -206
  89. package/dist/composable/ConditionalOrderFactory.d.ts +19 -19
  90. package/dist/composable/Multiplexer.d.ts +174 -174
  91. package/dist/composable/contracts.d.ts +6 -6
  92. package/dist/composable/generated/ComposableCoW.d.ts +340 -340
  93. package/dist/composable/generated/ExtensibleFallbackHandler.d.ts +282 -282
  94. package/dist/composable/generated/TWAP.d.ts +141 -141
  95. package/dist/composable/generated/common.d.ts +21 -21
  96. package/dist/composable/generated/factories/ComposableCoW__factory.d.ts +475 -475
  97. package/dist/composable/generated/factories/ExtensibleFallbackHandler__factory.d.ts +389 -389
  98. package/dist/composable/generated/factories/TWAP__factory.d.ts +260 -260
  99. package/dist/composable/generated/factories/index.d.ts +3 -3
  100. package/dist/composable/generated/index.d.ts +7 -7
  101. package/dist/composable/index.d.ts +6 -6
  102. package/dist/composable/orderTypes/Twap.d.ts +242 -242
  103. package/dist/composable/orderTypes/index.d.ts +3 -3
  104. package/dist/composable/orderTypes/test/TestConditionalOrder.d.ts +25 -25
  105. package/dist/composable/types.d.ts +133 -133
  106. package/dist/composable/utils.d.ts +37 -37
  107. package/dist/cow-shed/CowShedSdk.d.ts +74 -69
  108. package/dist/cow-shed/contracts/CoWShedHooks.d.ts +47 -45
  109. package/dist/cow-shed/contracts/utils.d.ts +4 -4
  110. package/dist/cow-shed/index.d.ts +3 -2
  111. package/dist/cow-shed/types.d.ts +17 -17
  112. package/dist/hooks/utils.d.ts +3 -2
  113. package/dist/index-847d9333.js +29 -0
  114. package/dist/index-847d9333.js.map +1 -0
  115. package/dist/index.d.ts +11 -10
  116. package/dist/index.js +4 -4
  117. package/dist/index.js.map +1 -1
  118. package/dist/index.modern.mjs +1 -1
  119. package/dist/index.module.js +4 -4
  120. package/dist/index.module.js.map +1 -1
  121. package/dist/order-book/api.d.ts +235 -235
  122. package/dist/order-book/generated/index.d.ts +55 -55
  123. package/dist/order-book/generated/models/Address.d.ts +4 -4
  124. package/dist/order-book/generated/models/AppData.d.ts +7 -7
  125. package/dist/order-book/generated/models/AppDataHash.d.ts +6 -6
  126. package/dist/order-book/generated/models/AppDataObject.d.ts +7 -7
  127. package/dist/order-book/generated/models/Auction.d.ts +30 -30
  128. package/dist/order-book/generated/models/AuctionOrder.d.ts +92 -92
  129. package/dist/order-book/generated/models/AuctionPrices.d.ts +6 -6
  130. package/dist/order-book/generated/models/BigUint.d.ts +4 -4
  131. package/dist/order-book/generated/models/BuyTokenDestination.d.ts +7 -7
  132. package/dist/order-book/generated/models/CallData.d.ts +4 -4
  133. package/dist/order-book/generated/models/CompetitionAuction.d.ts +14 -14
  134. package/dist/order-book/generated/models/CompetitionOrderStatus.d.ts +29 -29
  135. package/dist/order-book/generated/models/EcdsaSignature.d.ts +4 -4
  136. package/dist/order-book/generated/models/EcdsaSigningScheme.d.ts +7 -7
  137. package/dist/order-book/generated/models/EthflowData.d.ts +20 -20
  138. package/dist/order-book/generated/models/ExecutedAmounts.d.ts +5 -5
  139. package/dist/order-book/generated/models/ExecutedProtocolFee.d.ts +8 -8
  140. package/dist/order-book/generated/models/FeePolicy.d.ts +7 -7
  141. package/dist/order-book/generated/models/InteractionData.d.ts +11 -11
  142. package/dist/order-book/generated/models/NativePriceResponse.d.ts +10 -10
  143. package/dist/order-book/generated/models/OnchainOrderData.d.ts +24 -24
  144. package/dist/order-book/generated/models/Order.d.ts +3 -3
  145. package/dist/order-book/generated/models/OrderCancellation.d.ts +14 -14
  146. package/dist/order-book/generated/models/OrderCancellationError.d.ts +15 -15
  147. package/dist/order-book/generated/models/OrderCancellations.d.ts +18 -18
  148. package/dist/order-book/generated/models/OrderClass.d.ts +8 -8
  149. package/dist/order-book/generated/models/OrderCreation.d.ts +80 -80
  150. package/dist/order-book/generated/models/OrderKind.d.ts +7 -7
  151. package/dist/order-book/generated/models/OrderMetaData.d.ts +100 -100
  152. package/dist/order-book/generated/models/OrderParameters.d.ts +53 -53
  153. package/dist/order-book/generated/models/OrderPostError.d.ts +35 -35
  154. package/dist/order-book/generated/models/OrderQuoteRequest.d.ts +58 -58
  155. package/dist/order-book/generated/models/OrderQuoteResponse.d.ts +27 -27
  156. package/dist/order-book/generated/models/OrderQuoteSide.d.ts +26 -26
  157. package/dist/order-book/generated/models/OrderQuoteSideKindBuy.d.ts +3 -3
  158. package/dist/order-book/generated/models/OrderQuoteSideKindSell.d.ts +3 -3
  159. package/dist/order-book/generated/models/OrderQuoteValidity.d.ts +14 -14
  160. package/dist/order-book/generated/models/OrderStatus.d.ts +10 -10
  161. package/dist/order-book/generated/models/PreSignature.d.ts +4 -4
  162. package/dist/order-book/generated/models/PriceEstimationError.d.ts +12 -12
  163. package/dist/order-book/generated/models/PriceImprovement.d.ts +12 -12
  164. package/dist/order-book/generated/models/PriceQuality.d.ts +16 -16
  165. package/dist/order-book/generated/models/Quote.d.ts +19 -19
  166. package/dist/order-book/generated/models/SellTokenSource.d.ts +8 -8
  167. package/dist/order-book/generated/models/Signature.d.ts +6 -6
  168. package/dist/order-book/generated/models/SigningScheme.d.ts +9 -9
  169. package/dist/order-book/generated/models/SolverCompetitionResponse.d.ts +30 -30
  170. package/dist/order-book/generated/models/SolverSettlement.d.ts +47 -47
  171. package/dist/order-book/generated/models/Surplus.d.ts +7 -7
  172. package/dist/order-book/generated/models/TokenAmount.d.ts +4 -4
  173. package/dist/order-book/generated/models/TotalSurplus.d.ts +10 -10
  174. package/dist/order-book/generated/models/Trade.d.ts +57 -57
  175. package/dist/order-book/generated/models/TransactionHash.d.ts +4 -4
  176. package/dist/order-book/generated/models/UID.d.ts +8 -8
  177. package/dist/order-book/generated/models/Volume.d.ts +6 -6
  178. package/dist/order-book/index.d.ts +5 -5
  179. package/dist/order-book/mock.d.ts +63 -63
  180. package/dist/order-book/quoteAmountsAndCostsUtils.d.ts +35 -22
  181. package/dist/order-book/request.d.ts +49 -49
  182. package/dist/order-book/transformOrder.d.ts +10 -10
  183. package/dist/order-book/types.d.ts +74 -74
  184. package/dist/order-signing/index.d.ts +2 -2
  185. package/dist/order-signing/orderSigningUtils.d.ts +97 -97
  186. package/dist/order-signing/types.d.ts +55 -55
  187. package/dist/order-signing/utils.d.ts +49 -49
  188. package/dist/package.json +31 -32
  189. package/dist/schemas/trading/LimitOrderAdvancedSettings.ts +151 -12
  190. package/dist/schemas/trading/LimitTradeParameters.ts +136 -15
  191. package/dist/schemas/trading/QuoteResultsSerialized.ts +292 -27
  192. package/dist/schemas/trading/QuoterParameters.ts +10 -0
  193. package/dist/schemas/trading/SwapAdvancedSettings.ts +331 -12
  194. package/dist/schemas/trading/TradeParameters.ts +136 -15
  195. package/dist/src/trading/README.md +99 -7
  196. package/dist/subgraph/api.d.ts +77 -77
  197. package/dist/subgraph/graphql.d.ts +3203 -3203
  198. package/dist/subgraph/index.d.ts +1 -1
  199. package/dist/subgraph/queries.d.ts +14 -14
  200. package/dist/test/utils.d.ts +1 -0
  201. package/dist/trading/appDataUtils.d.ts +5 -4
  202. package/dist/trading/calculateUniqueOrderId.d.ts +5 -5
  203. package/dist/trading/consts.d.ts +6 -14
  204. package/dist/trading/getEthFlowTransaction.d.ts +12 -7
  205. package/dist/trading/getOrderToSign.d.ts +11 -8
  206. package/dist/trading/getOrderTypedData.d.ts +4 -4
  207. package/dist/trading/getPreSignTransaction.d.ts +4 -4
  208. package/dist/trading/getQuote.d.ts +26 -14
  209. package/dist/trading/index.d.ts +21 -19
  210. package/dist/trading/postCoWProtocolTrade.d.ts +4 -4
  211. package/dist/trading/postLimitOrder.d.ts +3 -3
  212. package/dist/trading/postSellNativeCurrencyOrder.d.ts +4 -7
  213. package/dist/trading/postSwapOrder.d.ts +5 -5
  214. package/dist/trading/suggestSlippageBps.d.ts +13 -0
  215. package/dist/trading/suggestSlippageFromFee.d.ts +19 -0
  216. package/dist/trading/suggestSlippageFromVolume.d.ts +10 -0
  217. package/dist/trading/tradingSdk.d.ts +26 -26
  218. package/dist/trading/types.d.ts +221 -190
  219. package/dist/trading/utils/getPartnerFeeBps.d.ts +2 -0
  220. package/dist/trading/{utils.d.ts → utils/misc.d.ts} +27 -27
  221. package/dist/trading/utils/slippage.d.ts +16 -0
  222. package/dist/utils-09dadb80.js +2 -0
  223. package/dist/utils-09dadb80.js.map +1 -0
  224. package/dist/utils-0ff3f95e.js +2 -0
  225. package/dist/utils-0ff3f95e.js.map +1 -0
  226. package/dist/utils-ddcfac77.js +2 -0
  227. package/dist/utils-ddcfac77.js.map +1 -0
  228. package/dist/utils.d.ts +3 -3
  229. package/dist/weiroll/index.d.ts +23 -23
  230. package/package.json +31 -32
  231. package/dist/bridging/BridgingSdk/getErc20Decimals.d.ts +0 -4
  232. package/dist/bridging/BridgingSdk/getQuoteWithBridging.d.ts +0 -9
  233. package/dist/index-317c25f1.js +0 -29
  234. package/dist/index-317c25f1.js.map +0 -1
  235. package/dist/utils-204a9cbe.js +0 -2
  236. package/dist/utils-204a9cbe.js.map +0 -1
  237. package/dist/utils-762ee9c3.js +0 -2
  238. package/dist/utils-762ee9c3.js.map +0 -1
  239. package/dist/utils-de2eb543.js +0 -2
  240. package/dist/utils-de2eb543.js.map +0 -1
@@ -1,15 +1,15 @@
1
- export type OrderCancellationError = {
2
- errorType: OrderCancellationError.errorType;
3
- description: string;
4
- };
5
- export declare namespace OrderCancellationError {
6
- enum errorType {
7
- INVALID_SIGNATURE = "InvalidSignature",
8
- WRONG_OWNER = "WrongOwner",
9
- ORDER_NOT_FOUND = "OrderNotFound",
10
- ALREADY_CANCELLED = "AlreadyCancelled",
11
- ORDER_FULLY_EXECUTED = "OrderFullyExecuted",
12
- ORDER_EXPIRED = "OrderExpired",
13
- ON_CHAIN_ORDER = "OnChainOrder"
14
- }
15
- }
1
+ export type OrderCancellationError = {
2
+ errorType: OrderCancellationError.errorType;
3
+ description: string;
4
+ };
5
+ export declare namespace OrderCancellationError {
6
+ enum errorType {
7
+ INVALID_SIGNATURE = "InvalidSignature",
8
+ WRONG_OWNER = "WrongOwner",
9
+ ORDER_NOT_FOUND = "OrderNotFound",
10
+ ALREADY_CANCELLED = "AlreadyCancelled",
11
+ ORDER_FULLY_EXECUTED = "OrderFullyExecuted",
12
+ ORDER_EXPIRED = "OrderExpired",
13
+ ON_CHAIN_ORDER = "OnChainOrder"
14
+ }
15
+ }
@@ -1,18 +1,18 @@
1
- import type { EcdsaSignature } from './EcdsaSignature';
2
- import type { EcdsaSigningScheme } from './EcdsaSigningScheme';
3
- import type { UID } from './UID';
4
- /**
5
- * EIP-712 signature of struct OrderCancellations { orderUid: bytes[] } from the order's owner.
6
- *
7
- */
8
- export type OrderCancellations = {
9
- /**
10
- * UIDs of orders to cancel.
11
- */
12
- orderUids?: Array<UID>;
13
- /**
14
- * `OrderCancellation` signed by the owner.
15
- */
16
- signature: EcdsaSignature;
17
- signingScheme: EcdsaSigningScheme;
18
- };
1
+ import type { EcdsaSignature } from './EcdsaSignature';
2
+ import type { EcdsaSigningScheme } from './EcdsaSigningScheme';
3
+ import type { UID } from './UID';
4
+ /**
5
+ * EIP-712 signature of struct OrderCancellations { orderUid: bytes[] } from the order's owner.
6
+ *
7
+ */
8
+ export type OrderCancellations = {
9
+ /**
10
+ * UIDs of orders to cancel.
11
+ */
12
+ orderUids?: Array<UID>;
13
+ /**
14
+ * `OrderCancellation` signed by the owner.
15
+ */
16
+ signature: EcdsaSignature;
17
+ signingScheme: EcdsaSigningScheme;
18
+ };
@@ -1,8 +1,8 @@
1
- /**
2
- * Order class.
3
- */
4
- export declare enum OrderClass {
5
- MARKET = "market",
6
- LIMIT = "limit",
7
- LIQUIDITY = "liquidity"
8
- }
1
+ /**
2
+ * Order class.
3
+ */
4
+ export declare enum OrderClass {
5
+ MARKET = "market",
6
+ LIMIT = "limit",
7
+ LIQUIDITY = "liquidity"
8
+ }
@@ -1,80 +1,80 @@
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 { OrderKind } from './OrderKind';
6
- import type { SellTokenSource } from './SellTokenSource';
7
- import type { Signature } from './Signature';
8
- import type { SigningScheme } from './SigningScheme';
9
- import type { TokenAmount } from './TokenAmount';
10
- /**
11
- * Data a user provides when creating a new order.
12
- */
13
- export type OrderCreation = {
14
- /**
15
- * see `OrderParameters::sellToken`
16
- */
17
- sellToken: Address;
18
- /**
19
- * see `OrderParameters::buyToken`
20
- */
21
- buyToken: Address;
22
- /**
23
- * see `OrderParameters::receiver`
24
- */
25
- receiver?: Address | null;
26
- /**
27
- * see `OrderParameters::sellAmount`
28
- */
29
- sellAmount: TokenAmount;
30
- /**
31
- * see `OrderParameters::buyAmount`
32
- */
33
- buyAmount: TokenAmount;
34
- /**
35
- * see `OrderParameters::validTo`
36
- */
37
- validTo: number;
38
- /**
39
- * see `OrderParameters::feeAmount`
40
- */
41
- feeAmount: TokenAmount;
42
- /**
43
- * see `OrderParameters::kind`
44
- */
45
- kind: OrderKind;
46
- /**
47
- * see `OrderParameters::partiallyFillable`
48
- */
49
- partiallyFillable: boolean;
50
- /**
51
- * see `OrderParameters::sellTokenBalance`
52
- */
53
- sellTokenBalance?: SellTokenSource;
54
- /**
55
- * see `OrderParameters::buyTokenBalance`
56
- */
57
- buyTokenBalance?: BuyTokenDestination;
58
- signingScheme: SigningScheme;
59
- signature: Signature;
60
- /**
61
- * If set, the backend enforces that this address matches what is decoded as the *signer* of the signature. This helps catch errors with invalid signature encodings as the backend might otherwise silently work with an unexpected address that for example does not have any balance.
62
- *
63
- */
64
- from?: Address | null;
65
- /**
66
- * Orders can optionally include a quote ID. This way the order can be linked to a quote and enable providing more metadata when analysing order slippage.
67
- *
68
- */
69
- quoteId?: number | null;
70
- /**
71
- * This field comes in two forms for backward compatibility. The hash form will eventually stop being accepted.
72
- *
73
- */
74
- appData: (AppData | AppDataHash);
75
- /**
76
- * May be set for debugging purposes. If set, this field is compared to what the backend internally calculates as the app data hash based on the contents of `appData`. If the hash does not match, an error is returned. If this field is set, then `appData` **MUST** be a string encoding of a JSON object.
77
- *
78
- */
79
- appDataHash?: AppDataHash | null;
80
- };
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 { OrderKind } from './OrderKind';
6
+ import type { SellTokenSource } from './SellTokenSource';
7
+ import type { Signature } from './Signature';
8
+ import type { SigningScheme } from './SigningScheme';
9
+ import type { TokenAmount } from './TokenAmount';
10
+ /**
11
+ * Data a user provides when creating a new order.
12
+ */
13
+ export type OrderCreation = {
14
+ /**
15
+ * see `OrderParameters::sellToken`
16
+ */
17
+ sellToken: Address;
18
+ /**
19
+ * see `OrderParameters::buyToken`
20
+ */
21
+ buyToken: Address;
22
+ /**
23
+ * see `OrderParameters::receiver`
24
+ */
25
+ receiver?: Address | null;
26
+ /**
27
+ * see `OrderParameters::sellAmount`
28
+ */
29
+ sellAmount: TokenAmount;
30
+ /**
31
+ * see `OrderParameters::buyAmount`
32
+ */
33
+ buyAmount: TokenAmount;
34
+ /**
35
+ * see `OrderParameters::validTo`
36
+ */
37
+ validTo: number;
38
+ /**
39
+ * see `OrderParameters::feeAmount`
40
+ */
41
+ feeAmount: TokenAmount;
42
+ /**
43
+ * see `OrderParameters::kind`
44
+ */
45
+ kind: OrderKind;
46
+ /**
47
+ * see `OrderParameters::partiallyFillable`
48
+ */
49
+ partiallyFillable: boolean;
50
+ /**
51
+ * see `OrderParameters::sellTokenBalance`
52
+ */
53
+ sellTokenBalance?: SellTokenSource;
54
+ /**
55
+ * see `OrderParameters::buyTokenBalance`
56
+ */
57
+ buyTokenBalance?: BuyTokenDestination;
58
+ signingScheme: SigningScheme;
59
+ signature: Signature;
60
+ /**
61
+ * If set, the backend enforces that this address matches what is decoded as the *signer* of the signature. This helps catch errors with invalid signature encodings as the backend might otherwise silently work with an unexpected address that for example does not have any balance.
62
+ *
63
+ */
64
+ from?: Address | null;
65
+ /**
66
+ * Orders can optionally include a quote ID. This way the order can be linked to a quote and enable providing more metadata when analysing order slippage.
67
+ *
68
+ */
69
+ quoteId?: number | null;
70
+ /**
71
+ * This field comes in two forms for backward compatibility. The hash form will eventually stop being accepted.
72
+ *
73
+ */
74
+ appData: (AppData | AppDataHash);
75
+ /**
76
+ * May be set for debugging purposes. If set, this field is compared to what the backend internally calculates as the app data hash based on the contents of `appData`. If the hash does not match, an error is returned. If this field is set, then `appData` **MUST** be a string encoding of a JSON object.
77
+ *
78
+ */
79
+ appDataHash?: AppDataHash | null;
80
+ };
@@ -1,7 +1,7 @@
1
- /**
2
- * Is this order a buy or sell?
3
- */
4
- export declare enum OrderKind {
5
- BUY = "buy",
6
- SELL = "sell"
7
- }
1
+ /**
2
+ * Is this order a buy or sell?
3
+ */
4
+ export declare enum OrderKind {
5
+ BUY = "buy",
6
+ SELL = "sell"
7
+ }
@@ -1,100 +1,100 @@
1
- import type { Address } from './Address';
2
- import type { BigUint } from './BigUint';
3
- import type { EthflowData } from './EthflowData';
4
- import type { OnchainOrderData } from './OnchainOrderData';
5
- import type { OrderClass } from './OrderClass';
6
- import type { OrderStatus } from './OrderStatus';
7
- import type { TokenAmount } from './TokenAmount';
8
- import type { UID } from './UID';
9
- /**
10
- * Extra order data that is returned to users when querying orders but not provided by users when creating orders.
11
- *
12
- */
13
- export type OrderMetaData = {
14
- /**
15
- * Creation time of the order. Encoded as ISO 8601 UTC.
16
- */
17
- creationDate: string;
18
- class: OrderClass;
19
- owner: Address;
20
- uid: UID;
21
- /**
22
- * Unused field that is currently always set to `null` and will be removed in the future.
23
- *
24
- * @deprecated
25
- */
26
- availableBalance?: TokenAmount | null;
27
- /**
28
- * The total amount of `sellToken` that has been executed for this order including fees.
29
- *
30
- */
31
- executedSellAmount: BigUint;
32
- /**
33
- * The total amount of `sellToken` that has been executed for this order without fees.
34
- *
35
- */
36
- executedSellAmountBeforeFees: BigUint;
37
- /**
38
- * The total amount of `buyToken` that has been executed for this order.
39
- *
40
- */
41
- executedBuyAmount: BigUint;
42
- /**
43
- * The total amount of fees that have been executed for this order.
44
- */
45
- executedFeeAmount: BigUint;
46
- /**
47
- * Has this order been invalidated?
48
- */
49
- invalidated: boolean;
50
- /**
51
- * Order status.
52
- */
53
- status: OrderStatus;
54
- /**
55
- * Amount that the signed fee would be without subsidies.
56
- */
57
- fullFeeAmount?: TokenAmount;
58
- /**
59
- * Liquidity orders are functionally the same as normal smart contract
60
- * orders but are not placed with the intent of actively getting
61
- * traded. Instead they facilitate the trade of normal orders by
62
- * allowing them to be matched against liquidity orders which uses less
63
- * gas and can have better prices than external liquidity.
64
- *
65
- * As such liquidity orders will only be used in order to improve
66
- * settlement of normal orders. They should not be expected to be
67
- * traded otherwise and should not expect to get surplus.
68
- */
69
- isLiquidityOrder?: boolean;
70
- ethflowData?: EthflowData;
71
- /**
72
- * This represents the actual trader of an on-chain order.
73
- * ### ethflow orders
74
- * In this case, the `owner` would be the `EthFlow` contract and *not* the actual trader.
75
- *
76
- */
77
- onchainUser?: Address;
78
- /**
79
- * There is some data only available for orders that are placed on-chain. This data can be found in this object.
80
- *
81
- */
82
- onchainOrderData?: OnchainOrderData;
83
- /**
84
- * Surplus fee that the limit order was executed with.
85
- */
86
- executedSurplusFee?: BigUint;
87
- /**
88
- * Total fee charged for execution of the order. Contains network fee and protocol fees.
89
- */
90
- executedFee?: BigUint;
91
- /**
92
- * Token the executed fee was captured in.
93
- */
94
- executedFeeToken?: Address;
95
- /**
96
- * Full `appData`, which the contract-level `appData` is a hash of. See `OrderCreation` for more information.
97
- *
98
- */
99
- fullAppData?: string | null;
100
- };
1
+ import type { Address } from './Address';
2
+ import type { BigUint } from './BigUint';
3
+ import type { EthflowData } from './EthflowData';
4
+ import type { OnchainOrderData } from './OnchainOrderData';
5
+ import type { OrderClass } from './OrderClass';
6
+ import type { OrderStatus } from './OrderStatus';
7
+ import type { TokenAmount } from './TokenAmount';
8
+ import type { UID } from './UID';
9
+ /**
10
+ * Extra order data that is returned to users when querying orders but not provided by users when creating orders.
11
+ *
12
+ */
13
+ export type OrderMetaData = {
14
+ /**
15
+ * Creation time of the order. Encoded as ISO 8601 UTC.
16
+ */
17
+ creationDate: string;
18
+ class: OrderClass;
19
+ owner: Address;
20
+ uid: UID;
21
+ /**
22
+ * Unused field that is currently always set to `null` and will be removed in the future.
23
+ *
24
+ * @deprecated
25
+ */
26
+ availableBalance?: TokenAmount | null;
27
+ /**
28
+ * The total amount of `sellToken` that has been executed for this order including fees.
29
+ *
30
+ */
31
+ executedSellAmount: BigUint;
32
+ /**
33
+ * The total amount of `sellToken` that has been executed for this order without fees.
34
+ *
35
+ */
36
+ executedSellAmountBeforeFees: BigUint;
37
+ /**
38
+ * The total amount of `buyToken` that has been executed for this order.
39
+ *
40
+ */
41
+ executedBuyAmount: BigUint;
42
+ /**
43
+ * The total amount of fees that have been executed for this order.
44
+ */
45
+ executedFeeAmount: BigUint;
46
+ /**
47
+ * Has this order been invalidated?
48
+ */
49
+ invalidated: boolean;
50
+ /**
51
+ * Order status.
52
+ */
53
+ status: OrderStatus;
54
+ /**
55
+ * Amount that the signed fee would be without subsidies.
56
+ */
57
+ fullFeeAmount?: TokenAmount;
58
+ /**
59
+ * Liquidity orders are functionally the same as normal smart contract
60
+ * orders but are not placed with the intent of actively getting
61
+ * traded. Instead they facilitate the trade of normal orders by
62
+ * allowing them to be matched against liquidity orders which uses less
63
+ * gas and can have better prices than external liquidity.
64
+ *
65
+ * As such liquidity orders will only be used in order to improve
66
+ * settlement of normal orders. They should not be expected to be
67
+ * traded otherwise and should not expect to get surplus.
68
+ */
69
+ isLiquidityOrder?: boolean;
70
+ ethflowData?: EthflowData;
71
+ /**
72
+ * This represents the actual trader of an on-chain order.
73
+ * ### ethflow orders
74
+ * In this case, the `owner` would be the `EthFlow` contract and *not* the actual trader.
75
+ *
76
+ */
77
+ onchainUser?: Address;
78
+ /**
79
+ * There is some data only available for orders that are placed on-chain. This data can be found in this object.
80
+ *
81
+ */
82
+ onchainOrderData?: OnchainOrderData;
83
+ /**
84
+ * Surplus fee that the limit order was executed with.
85
+ */
86
+ executedSurplusFee?: BigUint;
87
+ /**
88
+ * Total fee charged for execution of the order. Contains network fee and protocol fees.
89
+ */
90
+ executedFee?: BigUint;
91
+ /**
92
+ * Token the executed fee was captured in.
93
+ */
94
+ executedFeeToken?: Address;
95
+ /**
96
+ * Full `appData`, which the contract-level `appData` is a hash of. See `OrderCreation` for more information.
97
+ *
98
+ */
99
+ fullAppData?: string | null;
100
+ };
@@ -1,53 +1,53 @@
1
- import type { Address } from './Address';
2
- import type { AppDataHash } from './AppDataHash';
3
- import type { BuyTokenDestination } from './BuyTokenDestination';
4
- import type { OrderKind } from './OrderKind';
5
- import type { SellTokenSource } from './SellTokenSource';
6
- import type { SigningScheme } from './SigningScheme';
7
- import type { TokenAmount } from './TokenAmount';
8
- /**
9
- * Order parameters.
10
- */
11
- export type OrderParameters = {
12
- /**
13
- * ERC-20 token to be sold.
14
- */
15
- sellToken: Address;
16
- /**
17
- * ERC-20 token to be bought.
18
- */
19
- buyToken: Address;
20
- /**
21
- * An optional Ethereum address to receive the proceeds of the trade instead of the owner (i.e. the order signer).
22
- *
23
- */
24
- receiver?: Address | null;
25
- /**
26
- * Amount of `sellToken` to be sold in atoms.
27
- */
28
- sellAmount: TokenAmount;
29
- /**
30
- * Amount of `buyToken` to be bought in atoms.
31
- */
32
- buyAmount: TokenAmount;
33
- /**
34
- * Unix timestamp (`uint32`) until which the order is valid.
35
- */
36
- validTo: number;
37
- appData: AppDataHash;
38
- /**
39
- * feeRatio * sellAmount + minimal_fee in atoms.
40
- */
41
- feeAmount: TokenAmount;
42
- /**
43
- * The kind is either a buy or sell order.
44
- */
45
- kind: OrderKind;
46
- /**
47
- * Is the order fill-or-kill or partially fillable?
48
- */
49
- partiallyFillable: boolean;
50
- sellTokenBalance?: SellTokenSource;
51
- buyTokenBalance?: BuyTokenDestination;
52
- signingScheme?: SigningScheme;
53
- };
1
+ import type { Address } from './Address';
2
+ import type { AppDataHash } from './AppDataHash';
3
+ import type { BuyTokenDestination } from './BuyTokenDestination';
4
+ import type { OrderKind } from './OrderKind';
5
+ import type { SellTokenSource } from './SellTokenSource';
6
+ import type { SigningScheme } from './SigningScheme';
7
+ import type { TokenAmount } from './TokenAmount';
8
+ /**
9
+ * Order parameters.
10
+ */
11
+ export type OrderParameters = {
12
+ /**
13
+ * ERC-20 token to be sold.
14
+ */
15
+ sellToken: Address;
16
+ /**
17
+ * ERC-20 token to be bought.
18
+ */
19
+ buyToken: Address;
20
+ /**
21
+ * An optional Ethereum address to receive the proceeds of the trade instead of the owner (i.e. the order signer).
22
+ *
23
+ */
24
+ receiver?: Address | null;
25
+ /**
26
+ * Amount of `sellToken` to be sold in atoms.
27
+ */
28
+ sellAmount: TokenAmount;
29
+ /**
30
+ * Amount of `buyToken` to be bought in atoms.
31
+ */
32
+ buyAmount: TokenAmount;
33
+ /**
34
+ * Unix timestamp (`uint32`) until which the order is valid.
35
+ */
36
+ validTo: number;
37
+ appData: AppDataHash;
38
+ /**
39
+ * feeRatio * sellAmount + minimal_fee in atoms.
40
+ */
41
+ feeAmount: TokenAmount;
42
+ /**
43
+ * The kind is either a buy or sell order.
44
+ */
45
+ kind: OrderKind;
46
+ /**
47
+ * Is the order fill-or-kill or partially fillable?
48
+ */
49
+ partiallyFillable: boolean;
50
+ sellTokenBalance?: SellTokenSource;
51
+ buyTokenBalance?: BuyTokenDestination;
52
+ signingScheme?: SigningScheme;
53
+ };
@@ -1,35 +1,35 @@
1
- export type OrderPostError = {
2
- errorType: OrderPostError.errorType;
3
- description: string;
4
- };
5
- export declare namespace OrderPostError {
6
- enum errorType {
7
- DUPLICATED_ORDER = "DuplicatedOrder",
8
- QUOTE_NOT_FOUND = "QuoteNotFound",
9
- QUOTE_NOT_VERIFIED = "QuoteNotVerified",
10
- INVALID_QUOTE = "InvalidQuote",
11
- MISSING_FROM = "MissingFrom",
12
- WRONG_OWNER = "WrongOwner",
13
- INVALID_EIP1271SIGNATURE = "InvalidEip1271Signature",
14
- INSUFFICIENT_BALANCE = "InsufficientBalance",
15
- INSUFFICIENT_ALLOWANCE = "InsufficientAllowance",
16
- INVALID_SIGNATURE = "InvalidSignature",
17
- SELL_AMOUNT_OVERFLOW = "SellAmountOverflow",
18
- TRANSFER_SIMULATION_FAILED = "TransferSimulationFailed",
19
- ZERO_AMOUNT = "ZeroAmount",
20
- INCOMPATIBLE_SIGNING_SCHEME = "IncompatibleSigningScheme",
21
- TOO_MANY_LIMIT_ORDERS = "TooManyLimitOrders",
22
- TOO_MUCH_GAS = "TooMuchGas",
23
- UNSUPPORTED_BUY_TOKEN_DESTINATION = "UnsupportedBuyTokenDestination",
24
- UNSUPPORTED_SELL_TOKEN_SOURCE = "UnsupportedSellTokenSource",
25
- UNSUPPORTED_ORDER_TYPE = "UnsupportedOrderType",
26
- INSUFFICIENT_VALID_TO = "InsufficientValidTo",
27
- EXCESSIVE_VALID_TO = "ExcessiveValidTo",
28
- INVALID_NATIVE_SELL_TOKEN = "InvalidNativeSellToken",
29
- SAME_BUY_AND_SELL_TOKEN = "SameBuyAndSellToken",
30
- UNSUPPORTED_TOKEN = "UnsupportedToken",
31
- INVALID_APP_DATA = "InvalidAppData",
32
- APP_DATA_HASH_MISMATCH = "AppDataHashMismatch",
33
- APPDATA_FROM_MISMATCH = "AppdataFromMismatch"
34
- }
35
- }
1
+ export type OrderPostError = {
2
+ errorType: OrderPostError.errorType;
3
+ description: string;
4
+ };
5
+ export declare namespace OrderPostError {
6
+ enum errorType {
7
+ DUPLICATED_ORDER = "DuplicatedOrder",
8
+ QUOTE_NOT_FOUND = "QuoteNotFound",
9
+ QUOTE_NOT_VERIFIED = "QuoteNotVerified",
10
+ INVALID_QUOTE = "InvalidQuote",
11
+ MISSING_FROM = "MissingFrom",
12
+ WRONG_OWNER = "WrongOwner",
13
+ INVALID_EIP1271SIGNATURE = "InvalidEip1271Signature",
14
+ INSUFFICIENT_BALANCE = "InsufficientBalance",
15
+ INSUFFICIENT_ALLOWANCE = "InsufficientAllowance",
16
+ INVALID_SIGNATURE = "InvalidSignature",
17
+ SELL_AMOUNT_OVERFLOW = "SellAmountOverflow",
18
+ TRANSFER_SIMULATION_FAILED = "TransferSimulationFailed",
19
+ ZERO_AMOUNT = "ZeroAmount",
20
+ INCOMPATIBLE_SIGNING_SCHEME = "IncompatibleSigningScheme",
21
+ TOO_MANY_LIMIT_ORDERS = "TooManyLimitOrders",
22
+ TOO_MUCH_GAS = "TooMuchGas",
23
+ UNSUPPORTED_BUY_TOKEN_DESTINATION = "UnsupportedBuyTokenDestination",
24
+ UNSUPPORTED_SELL_TOKEN_SOURCE = "UnsupportedSellTokenSource",
25
+ UNSUPPORTED_ORDER_TYPE = "UnsupportedOrderType",
26
+ INSUFFICIENT_VALID_TO = "InsufficientValidTo",
27
+ EXCESSIVE_VALID_TO = "ExcessiveValidTo",
28
+ INVALID_NATIVE_SELL_TOKEN = "InvalidNativeSellToken",
29
+ SAME_BUY_AND_SELL_TOKEN = "SameBuyAndSellToken",
30
+ UNSUPPORTED_TOKEN = "UnsupportedToken",
31
+ INVALID_APP_DATA = "InvalidAppData",
32
+ APP_DATA_HASH_MISMATCH = "AppDataHashMismatch",
33
+ APPDATA_FROM_MISMATCH = "AppdataFromMismatch"
34
+ }
35
+ }