@cowprotocol/cow-sdk 6.3.2-RC.2 → 7.0.0-beta.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 (246) hide show
  1. package/README.md +276 -192
  2. package/dist/CHANGELOG.md +24 -0
  3. package/dist/README.md +276 -192
  4. package/dist/index.d.mts +73 -0
  5. package/dist/index.d.ts +73 -11
  6. package/dist/index.js +86 -27
  7. package/dist/index.mjs +49 -0
  8. package/dist/package.json +71 -91
  9. package/package.json +71 -91
  10. package/LICENSE-APACHE +0 -201
  11. package/LICENSE-MIT +0 -21
  12. package/dist/COPYRIGHT.md +0 -13
  13. package/dist/bridging/BridgingSdk/BridgingSdk.d.ts +0 -87
  14. package/dist/bridging/BridgingSdk/findBridgeProviderFromHook.d.ts +0 -2
  15. package/dist/bridging/BridgingSdk/getBridgeSignedHook.d.ts +0 -8
  16. package/dist/bridging/BridgingSdk/getCrossChainOrder.d.ts +0 -16
  17. package/dist/bridging/BridgingSdk/getQuoteWithBridge.d.ts +0 -3
  18. package/dist/bridging/BridgingSdk/getQuoteWithoutBridge.d.ts +0 -7
  19. package/dist/bridging/BridgingSdk/mock/bridgeRequestMocks.d.ts +0 -21
  20. package/dist/bridging/BridgingSdk/types.d.ts +0 -43
  21. package/dist/bridging/const.d.ts +0 -6
  22. package/dist/bridging/errors.d.ts +0 -22
  23. package/dist/bridging/index.d.ts +0 -8
  24. package/dist/bridging/providers/across/AcrossApi.d.ts +0 -30
  25. package/dist/bridging/providers/across/AcrossBridgeProvider.d.ts +0 -44
  26. package/dist/bridging/providers/across/abi.d.ts +0 -154
  27. package/dist/bridging/providers/across/const/contracts.d.ts +0 -3
  28. package/dist/bridging/providers/across/const/interfaces.d.ts +0 -3
  29. package/dist/bridging/providers/across/const/misc.d.ts +0 -2
  30. package/dist/bridging/providers/across/const/tokens.d.ts +0 -11
  31. package/dist/bridging/providers/across/createAcrossDepositCall.d.ts +0 -9
  32. package/dist/bridging/providers/across/getDepositParams.d.ts +0 -4
  33. package/dist/bridging/providers/across/types.d.ts +0 -242
  34. package/dist/bridging/providers/across/util.d.ts +0 -43
  35. package/dist/bridging/providers/bungee/BungeeApi.d.ts +0 -67
  36. package/dist/bridging/providers/bungee/BungeeBridgeProvider.d.ts +0 -45
  37. package/dist/bridging/providers/bungee/abi.d.ts +0 -203
  38. package/dist/bridging/providers/bungee/const/contracts.d.ts +0 -4
  39. package/dist/bridging/providers/bungee/const/misc.d.ts +0 -8
  40. package/dist/bridging/providers/bungee/createBungeeDepositCall.d.ts +0 -7
  41. package/dist/bridging/providers/bungee/getBridgingStatusFromEvents.d.ts +0 -3
  42. package/dist/bridging/providers/bungee/types.d.ts +0 -268
  43. package/dist/bridging/providers/bungee/util.d.ts +0 -62
  44. package/dist/bridging/providers/mock/MockBridgeProvider.d.ts +0 -26
  45. package/dist/bridging/providers/utils/getGasLimitEstimationForHook.d.ts +0 -10
  46. package/dist/bridging/types.d.ts +0 -333
  47. package/dist/bridging/utils.d.ts +0 -9
  48. package/dist/chains/const/index.d.ts +0 -25
  49. package/dist/chains/const/path.d.ts +0 -1
  50. package/dist/chains/details/arbitrum.d.ts +0 -7
  51. package/dist/chains/details/avalanche.d.ts +0 -2
  52. package/dist/chains/details/base.d.ts +0 -7
  53. package/dist/chains/details/bnb.d.ts +0 -2
  54. package/dist/chains/details/gnosis.d.ts +0 -7
  55. package/dist/chains/details/index.d.ts +0 -10
  56. package/dist/chains/details/lens.d.ts +0 -2
  57. package/dist/chains/details/mainnet.d.ts +0 -7
  58. package/dist/chains/details/optimism.d.ts +0 -2
  59. package/dist/chains/details/polygon.d.ts +0 -2
  60. package/dist/chains/details/sepolia.d.ts +0 -7
  61. package/dist/chains/index.d.ts +0 -4
  62. package/dist/chains/types.d.ts +0 -133
  63. package/dist/chains/utils.d.ts +0 -19
  64. package/dist/common/consts/config.d.ts +0 -9
  65. package/dist/common/consts/contracts.d.ts +0 -45
  66. package/dist/common/consts/ipfs.d.ts +0 -2
  67. package/dist/common/consts/order.d.ts +0 -1
  68. package/dist/common/consts/path.d.ts +0 -1
  69. package/dist/common/consts/tokens.d.ts +0 -9
  70. package/dist/common/generated/CoWShed.d.ts +0 -219
  71. package/dist/common/generated/CoWShedFactory.d.ts +0 -191
  72. package/dist/common/generated/ComposableCoW.d.ts +0 -340
  73. package/dist/common/generated/EthFlow.d.ts +0 -117
  74. package/dist/common/generated/ExtensibleFallbackHandler.d.ts +0 -282
  75. package/dist/common/generated/GPv2Settlement.d.ts +0 -107
  76. package/dist/common/generated/TWAP.d.ts +0 -141
  77. package/dist/common/generated/common.d.ts +0 -21
  78. package/dist/common/generated/factories/CoWShedFactory__factory.d.ts +0 -250
  79. package/dist/common/generated/factories/CoWShed__factory.d.ts +0 -254
  80. package/dist/common/generated/factories/ComposableCoW__factory.d.ts +0 -475
  81. package/dist/common/generated/factories/EthFlow__factory.d.ts +0 -124
  82. package/dist/common/generated/factories/ExtensibleFallbackHandler__factory.d.ts +0 -389
  83. package/dist/common/generated/factories/GPv2Settlement__factory.d.ts +0 -81
  84. package/dist/common/generated/factories/TWAP__factory.d.ts +0 -260
  85. package/dist/common/generated/factories/index.d.ts +0 -7
  86. package/dist/common/generated/index.d.ts +0 -15
  87. package/dist/common/index.d.ts +0 -12
  88. package/dist/common/types/config.d.ts +0 -70
  89. package/dist/common/types/cow-error.d.ts +0 -4
  90. package/dist/common/types/ethereum.d.ts +0 -5
  91. package/dist/common/types/tokens.d.ts +0 -12
  92. package/dist/common/types/wallets.d.ts +0 -5
  93. package/dist/common/utils/common.d.ts +0 -1
  94. package/dist/common/utils/config.d.ts +0 -4
  95. package/dist/common/utils/log.d.ts +0 -2
  96. package/dist/common/utils/math.d.ts +0 -19
  97. package/dist/common/utils/order.d.ts +0 -4
  98. package/dist/common/utils/serialize.d.ts +0 -1
  99. package/dist/common/utils/wallet.d.ts +0 -3
  100. package/dist/composable/ConditionalOrder.d.ts +0 -206
  101. package/dist/composable/ConditionalOrderFactory.d.ts +0 -19
  102. package/dist/composable/Multiplexer.d.ts +0 -174
  103. package/dist/composable/contracts.d.ts +0 -6
  104. package/dist/composable/generated/ComposableCoW.d.ts +0 -340
  105. package/dist/composable/generated/ExtensibleFallbackHandler.d.ts +0 -282
  106. package/dist/composable/generated/TWAP.d.ts +0 -141
  107. package/dist/composable/generated/common.d.ts +0 -21
  108. package/dist/composable/generated/factories/ComposableCoW__factory.d.ts +0 -475
  109. package/dist/composable/generated/factories/ExtensibleFallbackHandler__factory.d.ts +0 -389
  110. package/dist/composable/generated/factories/TWAP__factory.d.ts +0 -260
  111. package/dist/composable/generated/factories/index.d.ts +0 -3
  112. package/dist/composable/generated/index.d.ts +0 -7
  113. package/dist/composable/index.d.ts +0 -6
  114. package/dist/composable/orderTypes/Twap.d.ts +0 -242
  115. package/dist/composable/orderTypes/index.d.ts +0 -3
  116. package/dist/composable/orderTypes/test/TestConditionalOrder.d.ts +0 -25
  117. package/dist/composable/types.d.ts +0 -133
  118. package/dist/composable/utils.d.ts +0 -37
  119. package/dist/cow-shed/CowShedSdk.d.ts +0 -74
  120. package/dist/cow-shed/contracts/CoWShedHooks.d.ts +0 -46
  121. package/dist/cow-shed/contracts/utils.d.ts +0 -4
  122. package/dist/cow-shed/index.d.ts +0 -3
  123. package/dist/cow-shed/types.d.ts +0 -17
  124. package/dist/docs/architecture.md +0 -353
  125. package/dist/examples/cra/README.md +0 -21
  126. package/dist/hooks/utils.d.ts +0 -3
  127. package/dist/index-30eefcb8.js +0 -29
  128. package/dist/index-30eefcb8.js.map +0 -1
  129. package/dist/index.js.map +0 -1
  130. package/dist/index.modern.mjs +0 -2
  131. package/dist/index.modern.mjs.map +0 -1
  132. package/dist/index.module.js +0 -29
  133. package/dist/index.module.js.map +0 -1
  134. package/dist/order-book/api.d.ts +0 -235
  135. package/dist/order-book/generated/index.d.ts +0 -55
  136. package/dist/order-book/generated/models/Address.d.ts +0 -4
  137. package/dist/order-book/generated/models/AppData.d.ts +0 -7
  138. package/dist/order-book/generated/models/AppDataHash.d.ts +0 -6
  139. package/dist/order-book/generated/models/AppDataObject.d.ts +0 -7
  140. package/dist/order-book/generated/models/Auction.d.ts +0 -30
  141. package/dist/order-book/generated/models/AuctionOrder.d.ts +0 -92
  142. package/dist/order-book/generated/models/AuctionPrices.d.ts +0 -6
  143. package/dist/order-book/generated/models/BigUint.d.ts +0 -4
  144. package/dist/order-book/generated/models/BuyTokenDestination.d.ts +0 -7
  145. package/dist/order-book/generated/models/CallData.d.ts +0 -4
  146. package/dist/order-book/generated/models/CompetitionAuction.d.ts +0 -14
  147. package/dist/order-book/generated/models/CompetitionOrderStatus.d.ts +0 -29
  148. package/dist/order-book/generated/models/EcdsaSignature.d.ts +0 -4
  149. package/dist/order-book/generated/models/EcdsaSigningScheme.d.ts +0 -7
  150. package/dist/order-book/generated/models/EthflowData.d.ts +0 -20
  151. package/dist/order-book/generated/models/ExecutedAmounts.d.ts +0 -5
  152. package/dist/order-book/generated/models/ExecutedProtocolFee.d.ts +0 -8
  153. package/dist/order-book/generated/models/FeePolicy.d.ts +0 -7
  154. package/dist/order-book/generated/models/InteractionData.d.ts +0 -11
  155. package/dist/order-book/generated/models/NativePriceResponse.d.ts +0 -10
  156. package/dist/order-book/generated/models/OnchainOrderData.d.ts +0 -24
  157. package/dist/order-book/generated/models/Order.d.ts +0 -3
  158. package/dist/order-book/generated/models/OrderCancellation.d.ts +0 -14
  159. package/dist/order-book/generated/models/OrderCancellationError.d.ts +0 -15
  160. package/dist/order-book/generated/models/OrderCancellations.d.ts +0 -18
  161. package/dist/order-book/generated/models/OrderClass.d.ts +0 -8
  162. package/dist/order-book/generated/models/OrderCreation.d.ts +0 -80
  163. package/dist/order-book/generated/models/OrderKind.d.ts +0 -7
  164. package/dist/order-book/generated/models/OrderMetaData.d.ts +0 -100
  165. package/dist/order-book/generated/models/OrderParameters.d.ts +0 -53
  166. package/dist/order-book/generated/models/OrderPostError.d.ts +0 -35
  167. package/dist/order-book/generated/models/OrderQuoteRequest.d.ts +0 -58
  168. package/dist/order-book/generated/models/OrderQuoteResponse.d.ts +0 -27
  169. package/dist/order-book/generated/models/OrderQuoteSide.d.ts +0 -26
  170. package/dist/order-book/generated/models/OrderQuoteSideKindBuy.d.ts +0 -3
  171. package/dist/order-book/generated/models/OrderQuoteSideKindSell.d.ts +0 -3
  172. package/dist/order-book/generated/models/OrderQuoteValidity.d.ts +0 -14
  173. package/dist/order-book/generated/models/OrderStatus.d.ts +0 -10
  174. package/dist/order-book/generated/models/PreSignature.d.ts +0 -4
  175. package/dist/order-book/generated/models/PriceEstimationError.d.ts +0 -12
  176. package/dist/order-book/generated/models/PriceImprovement.d.ts +0 -12
  177. package/dist/order-book/generated/models/PriceQuality.d.ts +0 -16
  178. package/dist/order-book/generated/models/Quote.d.ts +0 -19
  179. package/dist/order-book/generated/models/SellTokenSource.d.ts +0 -8
  180. package/dist/order-book/generated/models/Signature.d.ts +0 -6
  181. package/dist/order-book/generated/models/SigningScheme.d.ts +0 -9
  182. package/dist/order-book/generated/models/SolverCompetitionResponse.d.ts +0 -30
  183. package/dist/order-book/generated/models/SolverSettlement.d.ts +0 -47
  184. package/dist/order-book/generated/models/Surplus.d.ts +0 -7
  185. package/dist/order-book/generated/models/TokenAmount.d.ts +0 -4
  186. package/dist/order-book/generated/models/TotalSurplus.d.ts +0 -10
  187. package/dist/order-book/generated/models/Trade.d.ts +0 -57
  188. package/dist/order-book/generated/models/TransactionHash.d.ts +0 -4
  189. package/dist/order-book/generated/models/UID.d.ts +0 -8
  190. package/dist/order-book/generated/models/Volume.d.ts +0 -6
  191. package/dist/order-book/index.d.ts +0 -5
  192. package/dist/order-book/mock.d.ts +0 -63
  193. package/dist/order-book/quoteAmountsAndCostsUtils.d.ts +0 -35
  194. package/dist/order-book/request.d.ts +0 -49
  195. package/dist/order-book/transformOrder.d.ts +0 -10
  196. package/dist/order-book/types.d.ts +0 -74
  197. package/dist/order-signing/index.d.ts +0 -2
  198. package/dist/order-signing/orderSigningUtils.d.ts +0 -97
  199. package/dist/order-signing/types.d.ts +0 -55
  200. package/dist/order-signing/utils.d.ts +0 -49
  201. package/dist/schemas/trading/LimitOrderAdvancedSettings.ts +0 -422
  202. package/dist/schemas/trading/LimitTradeParameters.ts +0 -229
  203. package/dist/schemas/trading/QuoteResultsSerialized.ts +0 -1151
  204. package/dist/schemas/trading/QuoterParameters.ts +0 -43
  205. package/dist/schemas/trading/SwapAdvancedSettings.ts +0 -708
  206. package/dist/schemas/trading/TradeParameters.ts +0 -217
  207. package/dist/src/bridging/PROVIDER_README.md +0 -796
  208. package/dist/src/bridging/README.md +0 -718
  209. package/dist/src/cow-shed/README.md +0 -60
  210. package/dist/src/trading/README.md +0 -544
  211. package/dist/src/weiroll/README.md +0 -58
  212. package/dist/subgraph/api.d.ts +0 -77
  213. package/dist/subgraph/graphql.d.ts +0 -3203
  214. package/dist/subgraph/index.d.ts +0 -1
  215. package/dist/subgraph/queries.d.ts +0 -14
  216. package/dist/test/getWallet.d.ts +0 -5
  217. package/dist/test/utils.d.ts +0 -1
  218. package/dist/trading/appDataUtils.d.ts +0 -5
  219. package/dist/trading/calculateUniqueOrderId.d.ts +0 -5
  220. package/dist/trading/consts.d.ts +0 -6
  221. package/dist/trading/getEthFlowTransaction.d.ts +0 -12
  222. package/dist/trading/getOrderToSign.d.ts +0 -11
  223. package/dist/trading/getOrderTypedData.d.ts +0 -4
  224. package/dist/trading/getPreSignTransaction.d.ts +0 -4
  225. package/dist/trading/getQuote.d.ts +0 -26
  226. package/dist/trading/index.d.ts +0 -21
  227. package/dist/trading/postCoWProtocolTrade.d.ts +0 -4
  228. package/dist/trading/postLimitOrder.d.ts +0 -3
  229. package/dist/trading/postSellNativeCurrencyOrder.d.ts +0 -4
  230. package/dist/trading/postSwapOrder.d.ts +0 -5
  231. package/dist/trading/suggestSlippageBps.d.ts +0 -13
  232. package/dist/trading/suggestSlippageFromFee.d.ts +0 -19
  233. package/dist/trading/suggestSlippageFromVolume.d.ts +0 -10
  234. package/dist/trading/tradingSdk.d.ts +0 -26
  235. package/dist/trading/types.d.ts +0 -221
  236. package/dist/trading/utils/getPartnerFeeBps.d.ts +0 -2
  237. package/dist/trading/utils/misc.d.ts +0 -27
  238. package/dist/trading/utils/slippage.d.ts +0 -16
  239. package/dist/utils-9f8a0370.js +0 -2
  240. package/dist/utils-9f8a0370.js.map +0 -1
  241. package/dist/utils-a846dcac.js +0 -2
  242. package/dist/utils-a846dcac.js.map +0 -1
  243. package/dist/utils-ea990520.js +0 -2
  244. package/dist/utils-ea990520.js.map +0 -1
  245. package/dist/utils.d.ts +0 -3
  246. package/dist/weiroll/index.d.ts +0 -23
@@ -1,708 +0,0 @@
1
- export default {
2
- "$schema": "http://json-schema.org/draft-07/schema#",
3
- "type": "object",
4
- "properties": {
5
- "quoteRequest": {
6
- "type": "object",
7
- "properties": {
8
- "sellAmountBeforeFee": {
9
- "type": "string",
10
- "description": "The total amount that is available for the order. From this value, the fee is deducted and the buy amount is calculated."
11
- },
12
- "validTo": {
13
- "type": "number",
14
- "description": "Unix timestamp (`uint32`) until which the order is valid."
15
- },
16
- "sellToken": {
17
- "type": "string",
18
- "description": "ERC-20 token to be sold"
19
- },
20
- "buyToken": {
21
- "type": "string",
22
- "description": "ERC-20 token to be bought"
23
- },
24
- "receiver": {
25
- "anyOf": [
26
- {
27
- "type": "string",
28
- "description": "20 byte Ethereum address encoded as a hex with `0x` prefix."
29
- },
30
- {
31
- "type": "null"
32
- }
33
- ],
34
- "description": "An optional address to receive the proceeds of the trade instead of the `owner` (i.e. the order signer)."
35
- },
36
- "appData": {
37
- "anyOf": [
38
- {
39
- "type": "string",
40
- "description": "The string encoding of a JSON object representing some `appData`. The format of the JSON expected in the `appData` field is defined [here](https://github.com/cowprotocol/app-data)."
41
- },
42
- {
43
- "type": "string",
44
- "description": "32 bytes encoded as hex with `0x` prefix. It's expected to be the hash of the stringified JSON object representing the `appData`."
45
- }
46
- ],
47
- "description": "AppData which will be assigned to the order.\n\nExpects either a string JSON doc as defined on [AppData](https://github.com/cowprotocol/app-data) or a hex encoded string for backwards compatibility.\n\nWhen the first format is used, it's possible to provide the derived appDataHash field."
48
- },
49
- "appDataHash": {
50
- "type": "string",
51
- "description": "The hash of the stringified JSON appData doc.\n\nIf present, `appData` field must be set with the aforementioned data where this hash is derived from.\n\nIn case they differ, the call will fail."
52
- },
53
- "sellTokenBalance": {
54
- "type": "string",
55
- "enum": [
56
- "erc20",
57
- "internal",
58
- "external"
59
- ],
60
- "description": "Where should the `sellToken` be drawn from?"
61
- },
62
- "buyTokenBalance": {
63
- "type": "string",
64
- "enum": [
65
- "erc20",
66
- "internal"
67
- ],
68
- "description": "Where should the `buyToken` be transferred to?"
69
- },
70
- "from": {
71
- "type": "string",
72
- "description": "20 byte Ethereum address encoded as a hex with `0x` prefix."
73
- },
74
- "priceQuality": {
75
- "type": "string",
76
- "enum": [
77
- "fast",
78
- "optimal",
79
- "verified"
80
- ],
81
- "description": "How good should the price estimate be?\n\nFast: The price estimate is chosen among the fastest N price estimates. Optimal: The price estimate is chosen among all price estimates. Verified: The price estimate is chosen among all verified/simulated price estimates.\n\n**NOTE**: Orders are supposed to be created from `verified` or `optimal` price estimates."
82
- },
83
- "signingScheme": {
84
- "type": "string",
85
- "enum": [
86
- "eip712",
87
- "ethsign",
88
- "presign",
89
- "eip1271"
90
- ],
91
- "description": "How was the order signed?"
92
- },
93
- "onchainOrder": {
94
- "description": "Flag to signal whether the order is intended for on-chain order placement. Only valid for non ECDSA-signed orders.\""
95
- },
96
- "validFor": {
97
- "type": "number",
98
- "description": "Number (`uint32`) of seconds that the order should be valid for."
99
- },
100
- "sellAmountAfterFee": {
101
- "type": "string",
102
- "description": "The `sellAmount` for the order."
103
- },
104
- "buyAmountAfterFee": {
105
- "type": "string",
106
- "description": "The `buyAmount` for the order."
107
- }
108
- },
109
- "additionalProperties": false
110
- },
111
- "appData": {
112
- "type": "object",
113
- "properties": {
114
- "appCode": {
115
- "type": "string",
116
- "description": "The code identifying the CLI, UI, service generating the order."
117
- },
118
- "environment": {
119
- "type": "string",
120
- "description": "Environment from which the order came from."
121
- },
122
- "metadata": {
123
- "type": "object",
124
- "properties": {
125
- "signer": {
126
- "type": "string",
127
- "description": "The address of the trader who signs the CoW Swap order. This field should normally be omitted; it is recommended to use it if the signer is a smart-contract wallet using EIP-1271 signatures."
128
- },
129
- "referrer": {
130
- "type": "object",
131
- "properties": {
132
- "address": {
133
- "type": "string"
134
- }
135
- },
136
- "required": [
137
- "address"
138
- ],
139
- "additionalProperties": false
140
- },
141
- "utm": {
142
- "type": "object",
143
- "properties": {
144
- "utmSource": {
145
- "type": "string",
146
- "description": "Tracks in which medium the traffic originated from (twitter, facebook, etc.)"
147
- },
148
- "utmMedium": {
149
- "type": "string",
150
- "description": "Tracks in which medium the traffic originated from (mail, CPC, social, etc.)"
151
- },
152
- "utmCampaign": {
153
- "type": "string",
154
- "description": "Track the performance of a specific campaign"
155
- },
156
- "utmContent": {
157
- "type": "string",
158
- "description": "Track which link was clicked"
159
- },
160
- "utmTerm": {
161
- "type": "string",
162
- "description": "Track which keyword term a website visitor came from"
163
- }
164
- },
165
- "additionalProperties": false
166
- },
167
- "quote": {
168
- "type": "object",
169
- "properties": {
170
- "slippageBips": {
171
- "type": "number",
172
- "description": "Slippage tolerance that was applied to the order to get the limit price. Expressed in Basis Points (BPS). One basis point is equivalent to 0.01% (1/100th of a percent)"
173
- },
174
- "smartSlippage": {
175
- "type": "boolean",
176
- "description": "Whether the given slippageBips used is originated from a Smart slippage suggestion"
177
- }
178
- },
179
- "required": [
180
- "slippageBips"
181
- ],
182
- "additionalProperties": false
183
- },
184
- "orderClass": {
185
- "type": "object",
186
- "properties": {
187
- "orderClass": {
188
- "type": "string",
189
- "enum": [
190
- "market",
191
- "limit",
192
- "liquidity",
193
- "twap"
194
- ],
195
- "description": "Indicator of the order class."
196
- }
197
- },
198
- "required": [
199
- "orderClass"
200
- ],
201
- "additionalProperties": false
202
- },
203
- "hooks": {
204
- "type": "object",
205
- "properties": {
206
- "version": {
207
- "type": "string",
208
- "description": "Semantic versioning of document."
209
- },
210
- "pre": {
211
- "type": "array",
212
- "items": {
213
- "type": "object",
214
- "properties": {
215
- "target": {
216
- "type": "string",
217
- "description": "The contract to call for the hook"
218
- },
219
- "callData": {
220
- "type": "string",
221
- "description": "The calldata to use when calling the hook"
222
- },
223
- "gasLimit": {
224
- "type": "string",
225
- "description": "The gas limit (in gas units) for the hook"
226
- },
227
- "dappId": {
228
- "type": "string",
229
- "description": "CoW Swap has an interface that allows dApps to build hooks for orders. This field is used to identify the dApp that has built the hook."
230
- }
231
- },
232
- "required": [
233
- "target",
234
- "callData",
235
- "gasLimit"
236
- ],
237
- "additionalProperties": false
238
- },
239
- "description": "CoW Hooks to call before an order executes"
240
- },
241
- "post": {
242
- "type": "array",
243
- "items": {
244
- "type": "object",
245
- "properties": {
246
- "target": {
247
- "type": "string",
248
- "description": "The contract to call for the hook"
249
- },
250
- "callData": {
251
- "type": "string",
252
- "description": "The calldata to use when calling the hook"
253
- },
254
- "gasLimit": {
255
- "type": "string",
256
- "description": "The gas limit (in gas units) for the hook"
257
- },
258
- "dappId": {
259
- "type": "string",
260
- "description": "CoW Swap has an interface that allows dApps to build hooks for orders. This field is used to identify the dApp that has built the hook."
261
- }
262
- },
263
- "required": [
264
- "target",
265
- "callData",
266
- "gasLimit"
267
- ],
268
- "additionalProperties": false
269
- },
270
- "description": "CoW Hooks to call after an order executes"
271
- }
272
- },
273
- "additionalProperties": false,
274
- "description": "Optional Pre and Post order interaction hooks attached to a single order"
275
- },
276
- "widget": {
277
- "type": "object",
278
- "properties": {
279
- "appCode": {
280
- "type": "string",
281
- "description": "The code identifying the UI powering the widget"
282
- },
283
- "environment": {
284
- "type": "string",
285
- "description": "Environment from which the order came from."
286
- }
287
- },
288
- "required": [
289
- "appCode"
290
- ],
291
- "additionalProperties": false
292
- },
293
- "partnerFee": {
294
- "anyOf": [
295
- {
296
- "type": "array",
297
- "items": {
298
- "anyOf": [
299
- {
300
- "type": "object",
301
- "properties": {
302
- "volumeBps": {
303
- "type": "number",
304
- "description": "The fee in basis points (BPS) to be paid to the partner based on volume. Capped at protocol level to 100 BPS (1%)"
305
- },
306
- "recipient": {
307
- "type": "string",
308
- "description": "The Ethereum address of the partner to receive the fee."
309
- }
310
- },
311
- "required": [
312
- "volumeBps",
313
- "recipient"
314
- ],
315
- "additionalProperties": false
316
- },
317
- {
318
- "type": "object",
319
- "properties": {
320
- "surplusBps": {
321
- "type": "number",
322
- "description": "The fee in basis points (BPS) to be paid to the partner based on surplus"
323
- },
324
- "maxVolumeBps": {
325
- "type": "number",
326
- "description": "The maximum volume in basis points (BPS) to be paid to the partner. Capped at protocol level to 100 BPS (1%). You can chose to go lower but not higher"
327
- },
328
- "recipient": {
329
- "type": "string",
330
- "description": "The Ethereum address of the partner to receive the fee."
331
- }
332
- },
333
- "required": [
334
- "surplusBps",
335
- "maxVolumeBps",
336
- "recipient"
337
- ],
338
- "additionalProperties": false
339
- },
340
- {
341
- "type": "object",
342
- "properties": {
343
- "priceImprovementBps": {
344
- "type": "number",
345
- "description": "The fee in basis points (BPS) to be paid to the partner based on price improvement"
346
- },
347
- "maxVolumeBps": {
348
- "type": "number",
349
- "description": "The maximum volume in basis points (BPS) to be paid to the partner. Capped at protocol level to 100 BPS (1%). You can chose to go lower but not higher"
350
- },
351
- "recipient": {
352
- "type": "string",
353
- "description": "The Ethereum address of the partner to receive the fee."
354
- }
355
- },
356
- "required": [
357
- "priceImprovementBps",
358
- "maxVolumeBps",
359
- "recipient"
360
- ],
361
- "additionalProperties": false
362
- }
363
- ]
364
- }
365
- },
366
- {
367
- "type": "object",
368
- "properties": {
369
- "volumeBps": {
370
- "type": "number",
371
- "description": "The fee in basis points (BPS) to be paid to the partner based on volume. Capped at protocol level to 100 BPS (1%)"
372
- },
373
- "recipient": {
374
- "type": "string",
375
- "description": "The Ethereum address of the partner to receive the fee."
376
- }
377
- },
378
- "required": [
379
- "volumeBps",
380
- "recipient"
381
- ],
382
- "additionalProperties": false
383
- },
384
- {
385
- "type": "object",
386
- "properties": {
387
- "surplusBps": {
388
- "type": "number",
389
- "description": "The fee in basis points (BPS) to be paid to the partner based on surplus"
390
- },
391
- "maxVolumeBps": {
392
- "type": "number",
393
- "description": "The maximum volume in basis points (BPS) to be paid to the partner. Capped at protocol level to 100 BPS (1%). You can chose to go lower but not higher"
394
- },
395
- "recipient": {
396
- "type": "string",
397
- "description": "The Ethereum address of the partner to receive the fee."
398
- }
399
- },
400
- "required": [
401
- "surplusBps",
402
- "maxVolumeBps",
403
- "recipient"
404
- ],
405
- "additionalProperties": false
406
- },
407
- {
408
- "type": "object",
409
- "properties": {
410
- "priceImprovementBps": {
411
- "type": "number",
412
- "description": "The fee in basis points (BPS) to be paid to the partner based on price improvement"
413
- },
414
- "maxVolumeBps": {
415
- "type": "number",
416
- "description": "The maximum volume in basis points (BPS) to be paid to the partner. Capped at protocol level to 100 BPS (1%). You can chose to go lower but not higher"
417
- },
418
- "recipient": {
419
- "type": "string",
420
- "description": "The Ethereum address of the partner to receive the fee."
421
- }
422
- },
423
- "required": [
424
- "priceImprovementBps",
425
- "maxVolumeBps",
426
- "recipient"
427
- ],
428
- "additionalProperties": false
429
- }
430
- ]
431
- },
432
- "replacedOrder": {
433
- "type": "object",
434
- "properties": {
435
- "uid": {
436
- "type": "string",
437
- "description": "The replaced order UID."
438
- }
439
- },
440
- "required": [
441
- "uid"
442
- ],
443
- "additionalProperties": false
444
- },
445
- "bridging": {
446
- "type": "object",
447
- "properties": {
448
- "destinationChainId": {
449
- "type": "string",
450
- "description": "Id of a blockchain where funds will be received"
451
- },
452
- "destinationTokenAddress": {
453
- "type": "string",
454
- "description": "Address of a token that will be received at destination chain. The chain might be EVM or non-EVM. Some chains might even not have a token address. E.g.: Bitcoin"
455
- }
456
- },
457
- "required": [
458
- "destinationChainId",
459
- "destinationTokenAddress"
460
- ],
461
- "additionalProperties": false
462
- },
463
- "flashloan": {
464
- "type": "object",
465
- "properties": {
466
- "lender": {
467
- "type": "string",
468
- "description": "The Ethereum address of the flashloan lender"
469
- },
470
- "borrower": {
471
- "type": "string",
472
- "description": "The Ethereum address of the flashloan borrower"
473
- },
474
- "token": {
475
- "type": "string",
476
- "description": "The Ethereum address of the token being borrowed"
477
- },
478
- "amount": {
479
- "type": "string",
480
- "description": "The amount of tokens to be flash loaned (in token units, as uint256)"
481
- }
482
- },
483
- "required": [
484
- "lender",
485
- "borrower",
486
- "token",
487
- "amount"
488
- ],
489
- "additionalProperties": false,
490
- "description": "Information about flashloan parameters for the order"
491
- }
492
- },
493
- "additionalProperties": false,
494
- "description": "Each metadata will specify one aspect of the order."
495
- }
496
- },
497
- "additionalProperties": false
498
- },
499
- "additionalParams": {
500
- "type": "object",
501
- "properties": {
502
- "checkEthFlowOrderExists": {
503
- "type": "object",
504
- "additionalProperties": false,
505
- "description": "Selling native token orders are special, because they are created from smart-contract, and their validTo is always the same. Because of that, you might get the same orderId when trying to create an order with the same parameters The callback is needed to check if there is already an order with the same orderId"
506
- },
507
- "networkCostsAmount": {
508
- "type": "string",
509
- "description": "Cost of executing the order onchain. The value is used in getQuoteAmountsAndCosts in order to calculate proper amounts"
510
- },
511
- "signingScheme": {
512
- "type": "string",
513
- "enum": [
514
- "eip712",
515
- "ethsign",
516
- "presign",
517
- "eip1271"
518
- ],
519
- "description": "By default, is EIP712 for EOA wallets. You might need other types of signing, for example PRESIGN when sign order via Smart Contract wallets."
520
- }
521
- },
522
- "additionalProperties": false,
523
- "description": "Additional parameters for posting orders. In most of the cases you don't need to use them."
524
- },
525
- "quoteSigner": {
526
- "anyOf": [
527
- {
528
- "type": "object",
529
- "properties": {
530
- "provider": {
531
- "type": "object",
532
- "properties": {
533
- "_isProvider": {
534
- "type": "boolean"
535
- }
536
- },
537
- "required": [
538
- "_isProvider"
539
- ],
540
- "additionalProperties": false
541
- },
542
- "_isSigner": {
543
- "type": "boolean"
544
- }
545
- },
546
- "required": [
547
- "_isSigner"
548
- ],
549
- "additionalProperties": false
550
- },
551
- {
552
- "type": "object",
553
- "properties": {
554
- "isMetaMask": {
555
- "type": "boolean"
556
- },
557
- "isStatus": {
558
- "type": "boolean"
559
- },
560
- "host": {
561
- "type": "string"
562
- },
563
- "path": {
564
- "type": "string"
565
- },
566
- "sendAsync": {
567
- "$comment": "(request: {\n method: string;\n params?: Array<any>;\n }, callback: (error: any, response: any) => void) => void",
568
- "type": "object",
569
- "properties": {
570
- "namedArgs": {
571
- "type": "object",
572
- "properties": {
573
- "request": {
574
- "type": "object",
575
- "properties": {
576
- "method": {
577
- "type": "string"
578
- },
579
- "params": {
580
- "type": "array",
581
- "items": {}
582
- }
583
- },
584
- "required": [
585
- "method"
586
- ],
587
- "additionalProperties": false
588
- },
589
- "callback": {
590
- "$comment": "(error: any, response: any) => void",
591
- "type": "object",
592
- "properties": {
593
- "namedArgs": {
594
- "type": "object",
595
- "properties": {
596
- "error": {},
597
- "response": {}
598
- },
599
- "required": [
600
- "error",
601
- "response"
602
- ],
603
- "additionalProperties": false
604
- }
605
- }
606
- }
607
- },
608
- "required": [
609
- "request",
610
- "callback"
611
- ],
612
- "additionalProperties": false
613
- }
614
- }
615
- },
616
- "send": {
617
- "$comment": "(request: {\n method: string;\n params?: Array<any>;\n }, callback: (error: any, response: any) => void) => void",
618
- "type": "object",
619
- "properties": {
620
- "namedArgs": {
621
- "type": "object",
622
- "properties": {
623
- "request": {
624
- "type": "object",
625
- "properties": {
626
- "method": {
627
- "type": "string"
628
- },
629
- "params": {
630
- "type": "array",
631
- "items": {}
632
- }
633
- },
634
- "required": [
635
- "method"
636
- ],
637
- "additionalProperties": false
638
- },
639
- "callback": {
640
- "$comment": "(error: any, response: any) => void",
641
- "type": "object",
642
- "properties": {
643
- "namedArgs": {
644
- "type": "object",
645
- "properties": {
646
- "error": {},
647
- "response": {}
648
- },
649
- "required": [
650
- "error",
651
- "response"
652
- ],
653
- "additionalProperties": false
654
- }
655
- }
656
- }
657
- },
658
- "required": [
659
- "request",
660
- "callback"
661
- ],
662
- "additionalProperties": false
663
- }
664
- }
665
- },
666
- "request": {
667
- "$comment": "(request: {\n method: string;\n params?: Array<any>;\n }) => Promise<any>",
668
- "type": "object",
669
- "properties": {
670
- "namedArgs": {
671
- "type": "object",
672
- "properties": {
673
- "request": {
674
- "type": "object",
675
- "properties": {
676
- "method": {
677
- "type": "string"
678
- },
679
- "params": {
680
- "type": "array",
681
- "items": {}
682
- }
683
- },
684
- "required": [
685
- "method"
686
- ],
687
- "additionalProperties": false
688
- }
689
- },
690
- "required": [
691
- "request"
692
- ],
693
- "additionalProperties": false
694
- }
695
- }
696
- }
697
- },
698
- "additionalProperties": false
699
- },
700
- {
701
- "type": "string"
702
- }
703
- ]
704
- }
705
- },
706
- "additionalProperties": false,
707
- "definitions": {}
708
- } as const