@cowprotocol/cow-sdk 5.8.0-RC.8 → 5.8.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 (56) hide show
  1. package/dist/common/consts.d.ts +1 -11
  2. package/dist/common/generated/factories/index.d.ts +0 -2
  3. package/dist/common/generated/index.d.ts +0 -4
  4. package/dist/composable/ConditionalOrderFactory.d.ts +10 -0
  5. package/dist/index-c004f2c4.js +29 -0
  6. package/dist/index-c004f2c4.js.map +1 -0
  7. package/dist/index.d.ts +0 -1
  8. package/dist/index.js +4 -4
  9. package/dist/index.js.map +1 -1
  10. package/dist/index.modern.mjs +1 -1
  11. package/dist/index.module.js +4 -4
  12. package/dist/index.module.js.map +1 -1
  13. package/dist/order-signing/orderSigningUtils.d.ts +4 -14
  14. package/dist/order-signing/utils.d.ts +1 -11
  15. package/dist/package.json +5 -8
  16. package/dist/utils-2718e59e.js +2 -0
  17. package/dist/utils-2718e59e.js.map +1 -0
  18. package/dist/utils-353bb58e.js +2 -0
  19. package/dist/utils-353bb58e.js.map +1 -0
  20. package/dist/utils-61509987.js +2 -0
  21. package/dist/utils-61509987.js.map +1 -0
  22. package/package.json +5 -8
  23. package/dist/common/generated/EthFlow.d.ts +0 -117
  24. package/dist/common/generated/GPv2Settlement.d.ts +0 -107
  25. package/dist/common/generated/factories/EthFlow__factory.d.ts +0 -124
  26. package/dist/common/generated/factories/GPv2Settlement__factory.d.ts +0 -81
  27. package/dist/index-cc6750e9.js +0 -29
  28. package/dist/index-cc6750e9.js.map +0 -1
  29. package/dist/schemas/trading/LimitOrderAdvancedSettings.ts +0 -228
  30. package/dist/schemas/trading/LimitTradeParameters.ts +0 -90
  31. package/dist/schemas/trading/QuoteResultsSerialized.ts +0 -836
  32. package/dist/schemas/trading/QuoterParameters.ts +0 -30
  33. package/dist/schemas/trading/SwapAdvancedSettings.ts +0 -334
  34. package/dist/schemas/trading/TradeParameters.ts +0 -79
  35. package/dist/trading/appDataUtils.d.ts +0 -4
  36. package/dist/trading/calculateUniqueOrderId.d.ts +0 -6
  37. package/dist/trading/consts.d.ts +0 -8
  38. package/dist/trading/getEthFlowTransaction.d.ts +0 -7
  39. package/dist/trading/getOrderToSign.d.ts +0 -8
  40. package/dist/trading/getOrderTypedData.d.ts +0 -4
  41. package/dist/trading/getPreSignTransaction.d.ts +0 -4
  42. package/dist/trading/getQuote.d.ts +0 -14
  43. package/dist/trading/index.d.ts +0 -19
  44. package/dist/trading/postCoWProtocolTrade.d.ts +0 -4
  45. package/dist/trading/postLimitOrder.d.ts +0 -3
  46. package/dist/trading/postOnChainTrade.d.ts +0 -8
  47. package/dist/trading/postSwapOrder.d.ts +0 -4
  48. package/dist/trading/tradingSdk.d.ts +0 -13
  49. package/dist/trading/types.d.ts +0 -103
  50. package/dist/trading/utils.d.ts +0 -16
  51. package/dist/utils-492ba939.js +0 -2
  52. package/dist/utils-492ba939.js.map +0 -1
  53. package/dist/utils-d066bc92.js +0 -2
  54. package/dist/utils-d066bc92.js.map +0 -1
  55. package/dist/utils-f09c5cb3.js +0 -2
  56. package/dist/utils-f09c5cb3.js.map +0 -1
@@ -1,836 +0,0 @@
1
- export default {
2
- "$schema": "http://json-schema.org/draft-07/schema#",
3
- "type": "object",
4
- "properties": {
5
- "tradeParameters": {
6
- "type": "object",
7
- "additionalProperties": false,
8
- "properties": {
9
- "env": {
10
- "type": "string",
11
- "enum": [
12
- "prod",
13
- "staging"
14
- ],
15
- "description": "The environment to use for the Cow API."
16
- },
17
- "partiallyFillable": {
18
- "type": "boolean"
19
- },
20
- "slippageBps": {
21
- "type": "number"
22
- },
23
- "receiver": {
24
- "type": "string"
25
- },
26
- "validFor": {
27
- "type": "number"
28
- },
29
- "partnerFee": {
30
- "type": "object",
31
- "properties": {
32
- "bps": {
33
- "type": "number",
34
- "description": "The fee in basis points (BPS) to be paid to the partner. One basis point is equivalent to 0.01% (1/100th of a percent)"
35
- },
36
- "recipient": {
37
- "type": "string",
38
- "description": "The Ethereum address of the partner to receive the fee."
39
- }
40
- },
41
- "required": [
42
- "bps",
43
- "recipient"
44
- ],
45
- "additionalProperties": false
46
- },
47
- "kind": {
48
- "type": "string",
49
- "enum": [
50
- "buy",
51
- "sell"
52
- ],
53
- "description": "Is this order a buy or sell?"
54
- },
55
- "sellToken": {
56
- "type": "string",
57
- "description": "20 byte Ethereum address encoded as a hex with `0x` prefix."
58
- },
59
- "sellTokenDecimals": {
60
- "type": "number"
61
- },
62
- "buyToken": {
63
- "type": "string",
64
- "description": "20 byte Ethereum address encoded as a hex with `0x` prefix."
65
- },
66
- "buyTokenDecimals": {
67
- "type": "number"
68
- },
69
- "amount": {
70
- "type": "string"
71
- }
72
- },
73
- "required": [
74
- "amount",
75
- "buyToken",
76
- "buyTokenDecimals",
77
- "kind",
78
- "sellToken",
79
- "sellTokenDecimals"
80
- ]
81
- },
82
- "orderToSign": {
83
- "type": "object",
84
- "additionalProperties": false,
85
- "properties": {
86
- "receiver": {
87
- "type": "string"
88
- },
89
- "sellToken": {
90
- "type": "string",
91
- "description": "ERC-20 token to be sold."
92
- },
93
- "buyToken": {
94
- "type": "string",
95
- "description": "ERC-20 token to be bought."
96
- },
97
- "sellAmount": {
98
- "type": "string",
99
- "description": "Amount of `sellToken` to be sold in atoms."
100
- },
101
- "buyAmount": {
102
- "type": "string",
103
- "description": "Amount of `buyToken` to be bought in atoms."
104
- },
105
- "validTo": {
106
- "type": "number",
107
- "description": "Unix timestamp (`uint32`) until which the order is valid."
108
- },
109
- "appData": {
110
- "type": "string",
111
- "description": "32 bytes encoded as hex with `0x` prefix. It's expected to be the hash of the stringified JSON object representing the `appData`."
112
- },
113
- "feeAmount": {
114
- "type": "string",
115
- "description": "feeRatio * sellAmount + minimal_fee in atoms."
116
- },
117
- "kind": {
118
- "type": "string",
119
- "enum": [
120
- "buy",
121
- "sell"
122
- ],
123
- "description": "The kind is either a buy or sell order."
124
- },
125
- "partiallyFillable": {
126
- "type": "boolean",
127
- "description": "Is the order fill-or-kill or partially fillable?"
128
- },
129
- "sellTokenBalance": {
130
- "type": "string",
131
- "enum": [
132
- "erc20",
133
- "internal",
134
- "external"
135
- ],
136
- "description": "Where should the `sellToken` be drawn from?"
137
- },
138
- "buyTokenBalance": {
139
- "type": "string",
140
- "enum": [
141
- "erc20",
142
- "internal"
143
- ],
144
- "description": "Where should the `buyToken` be transferred to?"
145
- },
146
- "signingScheme": {
147
- "type": "string",
148
- "enum": [
149
- "eip712",
150
- "ethsign",
151
- "presign",
152
- "eip1271"
153
- ],
154
- "description": "How was the order signed?"
155
- }
156
- },
157
- "required": [
158
- "appData",
159
- "buyAmount",
160
- "buyToken",
161
- "feeAmount",
162
- "kind",
163
- "partiallyFillable",
164
- "receiver",
165
- "sellAmount",
166
- "sellToken",
167
- "validTo"
168
- ],
169
- "description": "Unsigned order intent to be placed."
170
- },
171
- "quoteResponse": {
172
- "type": "object",
173
- "properties": {
174
- "quote": {
175
- "type": "object",
176
- "properties": {
177
- "sellToken": {
178
- "type": "string",
179
- "description": "ERC-20 token to be sold."
180
- },
181
- "buyToken": {
182
- "type": "string",
183
- "description": "ERC-20 token to be bought."
184
- },
185
- "receiver": {
186
- "anyOf": [
187
- {
188
- "type": "string",
189
- "description": "20 byte Ethereum address encoded as a hex with `0x` prefix."
190
- },
191
- {
192
- "type": "null"
193
- }
194
- ],
195
- "description": "An optional Ethereum address to receive the proceeds of the trade instead of the owner (i.e. the order signer)."
196
- },
197
- "sellAmount": {
198
- "type": "string",
199
- "description": "Amount of `sellToken` to be sold in atoms."
200
- },
201
- "buyAmount": {
202
- "type": "string",
203
- "description": "Amount of `buyToken` to be bought in atoms."
204
- },
205
- "validTo": {
206
- "type": "number",
207
- "description": "Unix timestamp (`uint32`) until which the order is valid."
208
- },
209
- "appData": {
210
- "type": "string",
211
- "description": "32 bytes encoded as hex with `0x` prefix. It's expected to be the hash of the stringified JSON object representing the `appData`."
212
- },
213
- "feeAmount": {
214
- "type": "string",
215
- "description": "feeRatio * sellAmount + minimal_fee in atoms."
216
- },
217
- "kind": {
218
- "type": "string",
219
- "enum": [
220
- "buy",
221
- "sell"
222
- ],
223
- "description": "The kind is either a buy or sell order."
224
- },
225
- "partiallyFillable": {
226
- "type": "boolean",
227
- "description": "Is the order fill-or-kill or partially fillable?"
228
- },
229
- "sellTokenBalance": {
230
- "type": "string",
231
- "enum": [
232
- "erc20",
233
- "internal",
234
- "external"
235
- ],
236
- "description": "Where should the `sellToken` be drawn from?"
237
- },
238
- "buyTokenBalance": {
239
- "type": "string",
240
- "enum": [
241
- "erc20",
242
- "internal"
243
- ],
244
- "description": "Where should the `buyToken` be transferred to?"
245
- },
246
- "signingScheme": {
247
- "type": "string",
248
- "enum": [
249
- "eip712",
250
- "ethsign",
251
- "presign",
252
- "eip1271"
253
- ],
254
- "description": "How was the order signed?"
255
- }
256
- },
257
- "required": [
258
- "sellToken",
259
- "buyToken",
260
- "sellAmount",
261
- "buyAmount",
262
- "validTo",
263
- "appData",
264
- "feeAmount",
265
- "kind",
266
- "partiallyFillable"
267
- ],
268
- "additionalProperties": false,
269
- "description": "Order parameters."
270
- },
271
- "from": {
272
- "type": "string",
273
- "description": "20 byte Ethereum address encoded as a hex with `0x` prefix."
274
- },
275
- "expiration": {
276
- "type": "string",
277
- "description": "Expiration date of the offered fee. Order service might not accept the fee after this expiration date. Encoded as ISO 8601 UTC."
278
- },
279
- "id": {
280
- "type": "number",
281
- "description": "Quote ID linked to a quote to enable providing more metadata when analysing order slippage."
282
- },
283
- "verified": {
284
- "type": "boolean",
285
- "description": "Whether it was possible to verify that the quoted amounts are accurate using a simulation."
286
- }
287
- },
288
- "required": [
289
- "quote",
290
- "expiration",
291
- "verified"
292
- ],
293
- "additionalProperties": false,
294
- "description": "An order quoted by the backend that can be directly signed and submitted to the order creation backend."
295
- },
296
- "appDataInfo": {
297
- "type": "object",
298
- "properties": {
299
- "doc": {
300
- "type": "object",
301
- "properties": {
302
- "version": {
303
- "type": "string",
304
- "description": "Semantic versioning of document."
305
- },
306
- "appCode": {
307
- "type": "string",
308
- "description": "The code identifying the CLI, UI, service generating the order."
309
- },
310
- "environment": {
311
- "type": "string",
312
- "description": "Environment from which the order came from."
313
- },
314
- "metadata": {
315
- "type": "object",
316
- "properties": {
317
- "signer": {
318
- "type": "string",
319
- "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."
320
- },
321
- "referrer": {
322
- "type": "object",
323
- "properties": {
324
- "address": {
325
- "type": "string"
326
- }
327
- },
328
- "required": [
329
- "address"
330
- ],
331
- "additionalProperties": false
332
- },
333
- "utm": {
334
- "type": "object",
335
- "properties": {
336
- "utmSource": {
337
- "type": "string",
338
- "description": "Tracks in which medium the traffic originated from (twitter, facebook, etc.)"
339
- },
340
- "utmMedium": {
341
- "type": "string",
342
- "description": "Tracks in which medium the traffic originated from (mail, CPC, social, etc.)"
343
- },
344
- "utmCampaign": {
345
- "type": "string",
346
- "description": "Track the performance of a specific campaign"
347
- },
348
- "utmContent": {
349
- "type": "string",
350
- "description": "Track which link was clicked"
351
- },
352
- "utmTerm": {
353
- "type": "string",
354
- "description": "Track which keyword term a website visitor came from"
355
- }
356
- },
357
- "additionalProperties": false
358
- },
359
- "quote": {
360
- "type": "object",
361
- "properties": {
362
- "slippageBips": {
363
- "type": "number",
364
- "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)"
365
- },
366
- "smartSlippage": {
367
- "type": "boolean",
368
- "description": "Whether the given slippageBips used is originated from a Smart slippage suggestion"
369
- }
370
- },
371
- "required": [
372
- "slippageBips"
373
- ],
374
- "additionalProperties": false
375
- },
376
- "orderClass": {
377
- "type": "object",
378
- "properties": {
379
- "orderClass": {
380
- "type": "string",
381
- "enum": [
382
- "market",
383
- "limit",
384
- "liquidity",
385
- "twap"
386
- ],
387
- "description": "Indicator of the order class."
388
- }
389
- },
390
- "required": [
391
- "orderClass"
392
- ],
393
- "additionalProperties": false
394
- },
395
- "hooks": {
396
- "type": "object",
397
- "properties": {
398
- "version": {
399
- "type": "string",
400
- "description": "Semantic versioning of document."
401
- },
402
- "pre": {
403
- "type": "array",
404
- "items": {
405
- "type": "object",
406
- "properties": {
407
- "target": {
408
- "type": "string",
409
- "description": "The contract to call for the hook"
410
- },
411
- "callData": {
412
- "type": "string",
413
- "description": "The calldata to use when calling the hook"
414
- },
415
- "gasLimit": {
416
- "type": "string",
417
- "description": "The gas limit (in gas units) for the hook"
418
- },
419
- "dappId": {
420
- "type": "string",
421
- "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."
422
- }
423
- },
424
- "required": [
425
- "target",
426
- "callData",
427
- "gasLimit"
428
- ],
429
- "additionalProperties": false
430
- },
431
- "description": "CoW Hooks to call before an order executes"
432
- },
433
- "post": {
434
- "type": "array",
435
- "items": {
436
- "type": "object",
437
- "properties": {
438
- "target": {
439
- "type": "string",
440
- "description": "The contract to call for the hook"
441
- },
442
- "callData": {
443
- "type": "string",
444
- "description": "The calldata to use when calling the hook"
445
- },
446
- "gasLimit": {
447
- "type": "string",
448
- "description": "The gas limit (in gas units) for the hook"
449
- },
450
- "dappId": {
451
- "type": "string",
452
- "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."
453
- }
454
- },
455
- "required": [
456
- "target",
457
- "callData",
458
- "gasLimit"
459
- ],
460
- "additionalProperties": false
461
- },
462
- "description": "CoW Hooks to call after an order executes"
463
- }
464
- },
465
- "additionalProperties": false,
466
- "description": "Optional Pre and Post order interaction hooks attached to a single order"
467
- },
468
- "widget": {
469
- "type": "object",
470
- "properties": {
471
- "appCode": {
472
- "type": "string",
473
- "description": "The code identifying the UI powering the widget"
474
- },
475
- "environment": {
476
- "type": "string",
477
- "description": "Environment from which the order came from."
478
- }
479
- },
480
- "required": [
481
- "appCode"
482
- ],
483
- "additionalProperties": false
484
- },
485
- "partnerFee": {
486
- "type": "object",
487
- "properties": {
488
- "bps": {
489
- "type": "number",
490
- "description": "The fee in basis points (BPS) to be paid to the partner. One basis point is equivalent to 0.01% (1/100th of a percent)"
491
- },
492
- "recipient": {
493
- "type": "string",
494
- "description": "The Ethereum address of the partner to receive the fee."
495
- }
496
- },
497
- "required": [
498
- "bps",
499
- "recipient"
500
- ],
501
- "additionalProperties": false
502
- },
503
- "replacedOrder": {
504
- "type": "object",
505
- "properties": {
506
- "uid": {
507
- "type": "string",
508
- "description": "The replaced order UID."
509
- }
510
- },
511
- "required": [
512
- "uid"
513
- ],
514
- "additionalProperties": false
515
- }
516
- },
517
- "additionalProperties": false,
518
- "description": "Each metadata will specify one aspect of the order."
519
- }
520
- },
521
- "required": [
522
- "version",
523
- "metadata"
524
- ],
525
- "additionalProperties": false,
526
- "description": "Metadata JSON document for adding information to orders."
527
- },
528
- "fullAppData": {
529
- "type": "string"
530
- },
531
- "appDataKeccak256": {
532
- "type": "string"
533
- },
534
- "env": {
535
- "type": "string",
536
- "enum": [
537
- "prod",
538
- "staging"
539
- ],
540
- "description": "The environment to use for the Cow API."
541
- }
542
- },
543
- "required": [
544
- "doc",
545
- "fullAppData",
546
- "appDataKeccak256"
547
- ],
548
- "additionalProperties": false
549
- },
550
- "orderTypedData": {
551
- "type": "object",
552
- "properties": {
553
- "domain": {
554
- "type": "object",
555
- "properties": {
556
- "name": {
557
- "type": "string"
558
- },
559
- "version": {
560
- "type": "string"
561
- },
562
- "chainId": {
563
- "type": "number"
564
- },
565
- "verifyingContract": {
566
- "type": "string"
567
- }
568
- },
569
- "required": [
570
- "name",
571
- "version",
572
- "chainId",
573
- "verifyingContract"
574
- ],
575
- "additionalProperties": false
576
- },
577
- "primaryType": {
578
- "type": "string",
579
- "const": "Order"
580
- },
581
- "types": {
582
- "type": "object",
583
- "additionalProperties": {
584
- "type": "array",
585
- "items": {
586
- "type": "object",
587
- "properties": {
588
- "name": {
589
- "type": "string"
590
- },
591
- "type": {
592
- "type": "string"
593
- }
594
- },
595
- "required": [
596
- "name",
597
- "type"
598
- ],
599
- "additionalProperties": false
600
- }
601
- }
602
- },
603
- "message": {
604
- "type": "object",
605
- "additionalProperties": false,
606
- "properties": {
607
- "receiver": {
608
- "type": "string"
609
- },
610
- "sellToken": {
611
- "type": "string",
612
- "description": "ERC-20 token to be sold."
613
- },
614
- "buyToken": {
615
- "type": "string",
616
- "description": "ERC-20 token to be bought."
617
- },
618
- "sellAmount": {
619
- "type": "string",
620
- "description": "Amount of `sellToken` to be sold in atoms."
621
- },
622
- "buyAmount": {
623
- "type": "string",
624
- "description": "Amount of `buyToken` to be bought in atoms."
625
- },
626
- "validTo": {
627
- "type": "number",
628
- "description": "Unix timestamp (`uint32`) until which the order is valid."
629
- },
630
- "appData": {
631
- "type": "string",
632
- "description": "32 bytes encoded as hex with `0x` prefix. It's expected to be the hash of the stringified JSON object representing the `appData`."
633
- },
634
- "feeAmount": {
635
- "type": "string",
636
- "description": "feeRatio * sellAmount + minimal_fee in atoms."
637
- },
638
- "kind": {
639
- "type": "string",
640
- "enum": [
641
- "buy",
642
- "sell"
643
- ],
644
- "description": "The kind is either a buy or sell order."
645
- },
646
- "partiallyFillable": {
647
- "type": "boolean",
648
- "description": "Is the order fill-or-kill or partially fillable?"
649
- },
650
- "sellTokenBalance": {
651
- "type": "string",
652
- "enum": [
653
- "erc20",
654
- "internal",
655
- "external"
656
- ],
657
- "description": "Where should the `sellToken` be drawn from?"
658
- },
659
- "buyTokenBalance": {
660
- "type": "string",
661
- "enum": [
662
- "erc20",
663
- "internal"
664
- ],
665
- "description": "Where should the `buyToken` be transferred to?"
666
- },
667
- "signingScheme": {
668
- "type": "string",
669
- "enum": [
670
- "eip712",
671
- "ethsign",
672
- "presign",
673
- "eip1271"
674
- ],
675
- "description": "How was the order signed?"
676
- }
677
- },
678
- "required": [
679
- "appData",
680
- "buyAmount",
681
- "buyToken",
682
- "feeAmount",
683
- "kind",
684
- "partiallyFillable",
685
- "receiver",
686
- "sellAmount",
687
- "sellToken",
688
- "validTo"
689
- ],
690
- "description": "Unsigned order intent to be placed."
691
- }
692
- },
693
- "required": [
694
- "domain",
695
- "primaryType",
696
- "types",
697
- "message"
698
- ],
699
- "additionalProperties": false
700
- },
701
- "amountsAndCosts": {
702
- "type": "object",
703
- "properties": {
704
- "isSell": {
705
- "type": "boolean"
706
- },
707
- "costs": {
708
- "type": "object",
709
- "properties": {
710
- "networkFee": {
711
- "type": "object",
712
- "properties": {
713
- "amountInSellCurrency": {
714
- "type": "string"
715
- },
716
- "amountInBuyCurrency": {
717
- "type": "string"
718
- }
719
- },
720
- "required": [
721
- "amountInSellCurrency",
722
- "amountInBuyCurrency"
723
- ],
724
- "additionalProperties": false
725
- },
726
- "partnerFee": {
727
- "type": "object",
728
- "properties": {
729
- "amount": {
730
- "type": "string"
731
- },
732
- "bps": {
733
- "type": "number"
734
- }
735
- },
736
- "required": [
737
- "amount",
738
- "bps"
739
- ],
740
- "additionalProperties": false
741
- }
742
- },
743
- "required": [
744
- "networkFee",
745
- "partnerFee"
746
- ],
747
- "additionalProperties": false
748
- },
749
- "beforeNetworkCosts": {
750
- "type": "object",
751
- "properties": {
752
- "sellAmount": {
753
- "type": "string"
754
- },
755
- "buyAmount": {
756
- "type": "string"
757
- }
758
- },
759
- "required": [
760
- "sellAmount",
761
- "buyAmount"
762
- ],
763
- "additionalProperties": false
764
- },
765
- "afterNetworkCosts": {
766
- "type": "object",
767
- "properties": {
768
- "sellAmount": {
769
- "type": "string"
770
- },
771
- "buyAmount": {
772
- "type": "string"
773
- }
774
- },
775
- "required": [
776
- "sellAmount",
777
- "buyAmount"
778
- ],
779
- "additionalProperties": false
780
- },
781
- "afterPartnerFees": {
782
- "type": "object",
783
- "properties": {
784
- "sellAmount": {
785
- "type": "string"
786
- },
787
- "buyAmount": {
788
- "type": "string"
789
- }
790
- },
791
- "required": [
792
- "sellAmount",
793
- "buyAmount"
794
- ],
795
- "additionalProperties": false
796
- },
797
- "afterSlippage": {
798
- "type": "object",
799
- "properties": {
800
- "sellAmount": {
801
- "type": "string"
802
- },
803
- "buyAmount": {
804
- "type": "string"
805
- }
806
- },
807
- "required": [
808
- "sellAmount",
809
- "buyAmount"
810
- ],
811
- "additionalProperties": false
812
- }
813
- },
814
- "required": [
815
- "isSell",
816
- "costs",
817
- "beforeNetworkCosts",
818
- "afterNetworkCosts",
819
- "afterPartnerFees",
820
- "afterSlippage"
821
- ],
822
- "additionalProperties": false,
823
- "description": "CoW Protocol quote has amounts (sell/buy) and costs (network fee), there is also partner fees. Besides that, CoW Protocol supports both sell and buy orders and the fees and costs are calculated differently.\n\nThe order of adding fees and costs is as follows: 1. Network fee is always added to the sell amount 2. Partner fee is added to the surplus amount (sell amount for sell-orders, buy amount for buy-orders)\n\nFor sell-orders the partner fee is subtracted from the buy amount after network costs. For buy-orders the partner fee is added on top of the sell amount after network costs."
824
- }
825
- },
826
- "required": [
827
- "amountsAndCosts",
828
- "appDataInfo",
829
- "orderToSign",
830
- "orderTypedData",
831
- "quoteResponse",
832
- "tradeParameters"
833
- ],
834
- "additionalProperties": false,
835
- "definitions": {}
836
- } as const