-
Notifications
You must be signed in to change notification settings - Fork 3
/
LimitOrderAPIs_v1.2.yaml
2095 lines (2087 loc) · 98.5 KB
/
LimitOrderAPIs_v1.2.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
openapi: 3.0.3
info:
title: KyberSwap Limit Order APIs
version: '1.2.0'
description: API specification for managing KyberSwap on-chain and off-chain limit orders.
servers:
- url: 'https://limit-order.kyberswap.com'
paths:
# General LO APIS
/read-partner/api/v1/orders/pairs:
get:
summary: Get Chain Supported Pairs
tags:
- General
operationId: get-read-partner-api-v1-orders-pairs
description: Please refer to [Supported Exchanges And Networks](https://docs.kyberswap.com/getting-started/supported-exchanges-and-networks) for full list of supported networks.
parameters:
- schema:
type: string
in: query
name: chainId
description: The chainId of the network to query.
required: true
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
required:
- code
- message
- data
properties:
code:
type: integer
description: The response code.
message:
type: string
description: Server response message.
data:
type: object
required:
- pairs
properties:
pairs:
type: array
description: The supported token pairs.
items:
type: object
required:
- makerAsset
- takerAsset
properties:
makerAsset:
type: string
description: The token address of the asset which the Maker is selling.
takerAsset:
type: string
description: The token address of the asset which the Maker expects in return.
example:
value:
code: 0
message: Successfully
data:
pairs:
- makerAsset: '0x1c954e8fe737f99f68fa1ccda3e51ebdb291948c'
takerAsset: '0x2791bca1f2de4661ed88a30c99a7a9449aa84174'
'400':
description: |-
Bad Request
- Missing required field
- chainId is not supported
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
example:
value:
code: 4000
message: 'Missing required field: chainId'
errorEntities:
- chainId
'500':
description: Internal Server Error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
example:
value:
code: 5000
message: Internal Server Error
errorEntities: []
/read-ks/api/v1/configs/contract-address:
get:
summary: Get Limit Order Contract Addresses
tags:
- General
operationId: get-read-ks-api-v1-configs-contract-address
description: Please refer to [Supported Exchanges And Networks](https://docs.kyberswap.com/getting-started/supported-exchanges-and-networks) for full list of supported networks.
parameters:
- schema:
type: string
in: query
name: chainId
description: The chainId of the network to query.
required: true
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
required:
- code
- message
- data
properties:
code:
type: integer
description: The response code.
message:
type: string
description: Server response message.
data:
type: object
required:
- latest
- features
properties:
latest:
type: string
description: The latest limit order contract address.
features:
type: object
description: The limit order contract address.
additionalProperties:
type: object
required:
- supportDoubleSignature
properties:
supportDoubleSignature:
type: boolean
description: Whether the contract supports gasless cancellations (i.e. double signature = maker signature + operator signature).
example:
value:
code: 0
message: Successfully
data:
latest: '0xcab2FA2eeab7065B45CBcF6E3936dDE2506b4f6C'
features:
'0xBff3AF706AedfAa19724BAb00947b7cD7bF3Af5F':
supportDoubleSignature: false
'0xcab2FA2eeab7065B45CBcF6E3936dDE2506b4f6C':
supportDoubleSignature: true
'400':
description: |-
Bad Request
- Missing required field
- chainId is not supported
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
example:
value:
code: 4000
message: 'Missing required field: chainId'
errorEntities:
- chainId
'500':
description: Internal Server Error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
example:
value:
code: 5000
message: Internal Server Error
errorEntities: []
# Maker: Create order(s)
/write/api/v1/orders/sign-message:
post:
summary: Get Unsigned Create Order Message
tags:
- Maker
operationId: post-write-api-v1-orders-sign-message
description: Get EIP712 create order message to be signed. The response of this API will need to be signed with [Sign Typed Data v4](https://docs.metamask.io/guide/signing-data.html#sign-typed-data-v4) before submitting create order request to KyberSwap via `/write/api/v1/orders`.
requestBody:
content:
application/json:
schema:
type: object
required:
- chainId
- makerAsset
- takerAsset
- maker
- makingAmount
- takingAmount
- expiredAt
properties:
chainId:
type: string
description: The chainId on which the order is being created. Only supports EVM chains.
makerAsset:
type: string
description: The token address of the asset which the Maker is selling.
takerAsset:
type: string
description: The token address of the asset which the Maker expects in return.
maker:
type: string
description: The address of the Maker.
receiver:
type: string
description: |-
Defines who will receive the takerAsset when the order is filled.
Default: `maker`.
allowedSenders:
type: array
maxItems: 1
description: Defines the addresses who are allowed to fill the order.
items:
type: string
makingAmount:
type: string
description: The amount of `makerAsset` in wei. String representation of uint256 value.
takingAmount:
type: string
description: The amount of `takerAsset` in wei. String representation of uint256 value.
feeRecipient:
type: string
description: The address to receive the fees, if any. Fees are configured in `makerTokenFeePercent`.
makerTokenFeePercent:
type: string
description: |-
Amount of makerToken paid by the taker to the `feeRecipient`. For example, 20% = 0.2 -> makerTokenFeePercent = 0.2 * 10000 = 2000
Format: uint32
expiredAt:
type: integer
description: The unix timestamp upon which the order will automatically lapse (i.e. expire).
example:
chainId: '137'
makerAsset: '0x2791bca1f2de4661ed88a30c99a7a9449aa84174'
takerAsset: '0x1c954e8fe737f99f68fa1ccda3e51ebdb291948c'
maker: '0x2bfc3A4Ef52Fe6cD2c5236dA08005C59EaFB43a7'
allowedSenders:
- '0x2bfc3A4Ef52Fe6cD2c5236dA08005C59EaFB43a7'
makingAmount: '10000'
takingAmount: '20000000000000000'
expiredAt: 1697690051
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
required:
- code
- message
- data
properties:
code:
type: integer
description: The response code.
message:
type: string
description: Server response message.
data:
type: object
required:
- types
- domain
- primaryType
- message
properties:
types:
type: object
required:
- EIP712Domain
- Order
properties:
EIP712Domain:
type: array
items:
$ref: '#/components/schemas/OrderSignMessageDefinition'
Order:
type: array
items:
$ref: '#/components/schemas/OrderSignMessageDefinition'
domain:
type: object
required:
- name
- version
- chainId
- verifyingContract
properties:
name:
type: string
description: The user readable name of signing domain, i.e. the name of the DApp or the protocol.
version:
type: string
description: The current major version of the signing domain. Signatures from different versions are not compatible.
chainId:
type: string
description: The EIP-155 chain id. The user-agent should refuse signing if it does not match the currently active chain.
verifyingContract:
type: string
description: the address of the contract that will verify the signature. The user-agent may do contract specific phishing prevention.
primaryType:
type: string
description: The top-level type of the object in the EIP712 message but does not have to correspond to any of the types in the message.
message:
type: object
required:
- salt
- makerAsset
- takerAsset
- maker
- receiver
- allowedSender
- makingAmount
- takingAmount
- feeConfig
- makerAssetData
- takerAssetData
- getMakerAmount
- getTakerAmount
- predicate
- interaction
properties:
salt:
type: string
description: The randomized data fed as an additional input to the hashing function.
makerAsset:
type: string
description: The token address of the asset which the Maker is selling.
takerAsset:
type: string
description: The token address of the asset which the Maker expects in return.
maker:
type: string
description: The address of the Maker.
receiver:
type: string
description: The receiver of the takerAsset when order is filled.
allowedSender:
type: string
description: Defines the addresses who are allowed to fill the order. Deafults to `0x000...` if none specified.
makingAmount:
type: string
description: The amount of `makerAsset` in wei.
takingAmount:
type: string
description: The amount of `takerAsset` in wei.
feeConfig:
type: string
description: The hashstring representing the fee configuration for the order.
takerTokenFeeAmount:
type: string
description: The amount of token taken from the Taker as the limit order fee.
makerAssetData:
type: string
description: ABIv2 encoded data that can be decoded by a specified proxy contract when transferring makerAsset.
takerAssetData:
type: string
description: ABIv2 encoded data that can be decoded by a specified proxy contract when transferring takerAsset.
getMakerAmount:
type: string
description: The hexstring representing the `makerAsset` amount.
getTakerAmount:
type: string
description: The hexstring representing the `takerAsset` amount.
predicate:
type: string
description: Call data that indicates the validity of the orders logic.
permit:
type: string
description: Included data if token is able to leverage Permit function (EIP2612) for gasless approvals.
interaction:
type: string
description: Call data that is sent to an intermediate contract when the order is filled.
example:
value:
code: 0
message: Successfully
data:
types:
DSOrder:
- name: 'orderHash'
type: 'bytes32'
- name: 'opExpireTime'
type: 'uint32'
EIP712Domain:
- name: 'name'
type: 'string'
- name: 'version'
type: 'string'
- name: 'chainId'
type: 'uint256'
- name: 'verifyingContract'
type: 'address'
Order:
- name: 'salt'
type: 'uint256'
- name: 'makerAsset'
type: 'address'
- name: 'takerAsset'
type: 'address'
- name: 'maker'
type: 'address'
- name: 'receiver'
type: 'address'
- name: 'allowedSender'
type: 'address'
- name: 'makingAmount'
type: 'uint256'
- name: 'takingAmount'
type: 'uint256'
- name: 'feeConfig'
type: 'uint256'
- name: 'makerAssetData'
type: 'bytes'
- name: 'takerAssetData'
type: 'bytes'
- name: 'getMakerAmount'
type: 'bytes'
- name: 'getTakerAmount'
type: 'bytes'
- name: 'predicate'
type: 'bytes'
- name: 'interaction'
type: 'bytes'
domain:
name: Kyber Limit Order Protocol
version: '2'
chainId: '5'
verifyingContract: '0x973B1847407C579a58E610e5f12003996C5a4f16'
primaryType: 'Order'
message:
allowedSender: '0x2bfc3a4ef52fe6cd2c5236da08005c59eafb43a7'
feeConfig: '73529011378642731556159749336395186902652258478889'
getMakerAmount: '0xf4a215c3000000000000000000000000000000000000000000000000000000000000271000000000000000000000000000000000000000000000000000470de4df820000'
getTakerAmount: '0x296637bf000000000000000000000000000000000000000000000000000000000000271000000000000000000000000000000000000000000000000000470de4df820000'
interaction: '0x'
maker: '0x2bfc3a4ef52fe6cd2c5236da08005c59eafb43a7'
makerAsset: '0x2791bca1f2de4661ed88a30c99a7a9449aa84174'
makerAssetData: '0x'
makingAmount: '10000'
predicate: '0x961d5b1e000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000002000000000000000000000000cab2fa2eeab7065b45cbcf6e3936dde2506b4f6c000000000000000000000000cab2fa2eeab7065b45cbcf6e3936dde2506b4f6c0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000044cf6fc6e30000000000000000000000002bfc3a4ef52fe6cd2c5236da08005c59eafb43a7000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002463592c2b0000000000000000000000000000000000000000000000000000000065308b6d00000000000000000000000000000000000000000000000000000000'
receiver: '0x2bfc3a4ef52fe6cd2c5236da08005c59eafb43a7'
salt: '108360087403015833110619993432889154326'
takerAsset: '0x1c954e8fe737f99f68fa1ccda3e51ebdb291948c'
takerAssetData: '0x'
takingAmount: '20000000000000000'
'400':
description: |-
Bad Request
- Missing required fields
- chainId is not supported
- makerAsset, takerAsset, maker, receiver, allowedSenders, feeRecipient are not ETH address
- makerAsset or takerAsset are native tokens
- makingAmount, takingAmount are less than or equal to 0
- makerTokenFeePercent is less than 0
- makingAmount, takingAmount, takerTokenFeeAmount are not uint128
- expiredAt is in the past
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
example:
value:
code: 4000
message: 'Missing required fields: chainId'
errorEntities:
- chainId
'500':
description: Internal Server Error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
example:
value:
code: 5000
message: Internal Server Error
errorEntities: []
/write/api/v1/orders:
post:
summary: Create New Order
tags:
- Maker
operationId: post-write-api-v1-orders
description: API for Makers to create new orders by sending in order params which includes the signed EIP712 message returned in `/write/api/v1/orders/sign-message`.
requestBody:
content:
application/json:
schema:
type: object
required:
- chainId
- makerAsset
- takerAsset
- maker
- makingAmount
- takingAmount
- expiredAt
- salt
- signature
properties:
chainId:
type: string
description: The chainId on which the order is being created. Only supports EVM chains.
makerAsset:
type: string
description: The token address of the asset which the Maker is selling.
takerAsset:
type: string
description: The token address of the asset which the Maker expects in return.
maker:
type: string
description: The address of the Maker.
receiver:
type: string
description: |-
Defines who will receive the takerAsset when the order is filled.
Default: `maker`.
allowedSenders:
type: array
description: Defines the addresses who are allowed to fill the order.
items:
type: string
makingAmount:
type: string
description: The amount of `makerAsset` in wei. String representation of uint256 value.
takingAmount:
type: string
description: The amount of `takerAsset` in wei. String representation of uint256 value.
feeRecipient:
type: string
description: The address to receive the fees, if any. Fees are configured in `makerTokenFeePercent`.
makerTokenFeePercent:
type: string
description: |-
Amount of makerToken paid by the taker to the `feeRecipient`. For example, 20% = 0.2 -> makerTokenFeePercent = 0.2 * 10000 = 2000
Format: uint32
expiredAt:
type: integer
description: The unix timestamp upon which the order will automatically lapse (i.e. expire).
salt:
type: string
description: The randomized data fed as an additional input to the hashing function. Returned in `/write/api/v1/orders/sign-message`.
signature:
type: string
description: The signed(signDataTyped) EIP712 creation order returned in `/write/api/v1/orders/sign-message`.
example:
chainId: '137'
makerAsset: '0x2791bca1f2de4661ed88a30c99a7a9449aa84174'
takerAsset: '0x1c954e8fe737f99f68fa1ccda3e51ebdb291948c'
maker: '0x2bfc3A4Ef52Fe6cD2c5236dA08005C59EaFB43a7'
allowedSenders:
- '0x2bfc3A4Ef52Fe6cD2c5236dA08005C59EaFB43a7'
makingAmount: '10000'
takingAmount: '20000000000000000'
expiredAt: 1697683411
salt: '235124343165545613944116882191476069603'
signature: '0xff25fe292d922e7a28b4b84919d2709b8b01a4d2cd4d5ee2335b227dbaa13e1f789d861e1cbb1153e251d839651490276bae2324266f3107c1ade2137c6b4c301b'
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
required:
- code
- message
- data
properties:
code:
type: integer
description: The response code.
message:
type: string
description: Server response message.
data:
type: object
required:
- id
properties:
id:
type: integer
description: ID of the successfully created order.
example:
value:
code: 0
message: Successfully
data:
id: 1
'400':
description: |-
Bad Request
- Missing required fields
- chainId is not supported
- makerAsset, takerAsset, maker, receiver, allowedSenders, feeRecipient are not ETH address
- makerAsset, takerAsset are native token
- makingAmount, takingAmount are less than or equal 0
- makerTokenFeePercent is less than 0
- makingAmount, takingAmount, salt are not uint256
- makerTokenFeePercent is not uint32
- makerAsset is equal to takerAsset
- expiredAt is in the past
- signature is incorrect
- maker's balance is not enough
- maker's allowance amount is not enough
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
example:
value:
code: 4000
message: 'Missing required fields: chainId'
errorEntities:
- chainId
'500':
description: Internal Server Error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
example:
value:
code: 5000
message: Internal Server Error
errorEntities: []
# Maker: Query maker order(s)
/read-ks/api/v1/orders:
get:
summary: Get List Of Orders By Maker
tags:
- Maker
operationId: get-read-ks-api-v1-orders
description: Get all orders created by a Maker address filtered by the order status.
parameters:
- schema:
type: string
in: query
name: chainId
required: true
description: The chainId on which the order is being created. Only supports EVM chains.
- schema:
type: string
in: query
name: maker
required: true
description: The address of the Maker.
- schema:
type: string
enum:
- active
- open
- partially_filled
- closed
- filled
- cancelled
- expired
in: query
name: status
required: true
description: |-
The status of the order to filter for:
- `active`: Order is active and has yet to be filled.
- `open`: Order is active and has been partially filled.
- `partially_filled`: Order has been partially filled.
- `closed`: Order has been closed and can no longer be filled.
- `filled`: Order has been filled with no remaining assets to be filled.
- `cancelled`: Order was cancelled by the Maker and can no longer be filled.
- `expired`: Order can no longer be filled as the expiry set by the Maker is in the past.
- schema:
type: string
in: query
name: query
description: Token symbol or token address. Search prefix for symbol, search exact for address.
- schema:
type: integer
minimum: 1
default: 1
in: query
name: page
description: Number of pages to return. Minimum and default is set at `1`.
- schema:
type: integer
minimum: 1
maximum: 50
default: 10
in: query
name: pageSize
description: Number of results to display per page. Minimum is `1` and maximum is `50`. Default is `10`.
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
required:
- code
- message
- data
properties:
code:
type: integer
description: The response code.
message:
type: string
description: Server response message.
data:
type: object
required:
- orders
- pagination
properties:
orders:
type: array
items:
type: object
required:
- id
- chainId
- nonce
- makerAsset
- takerAsset
- makerAssetDecimals
- takerAssetDeicmals
- makingAmount
- takingAmount
- status
- createdAt
- expiredAt
properties:
id:
type: integer
description: The limit order ID.
chainId:
type: string
description: The chainId on which the order was created.
nonce:
type: integer
description: The nonce generated by KyberSwap to enable hard cancellation of all orders. See `/read-ks/api/v1/encode/increase-nonce`.
makerAsset:
type: string
description: The token address of the asset which the Maker is selling.
takerAsset:
type: string
description: The token address of the asset which the Maker expects in return.
makerAssetSymbol:
type: string
description: The ERC20 token symbol for the `makerAsset`.
takerAssetSymbol:
type: string
description: The ECR20 token symbol for the `takerAsset`.
makerAssetDecimals:
type: integer
description: The number of decimals supported by the ERC20 `makerAsset` token.
takerAssetDecimals:
type: integer
description: The number of decimals supported by the ERC20 `takerAsset` token.
makerAssetLogoURL:
type: string
description: A URL which hosts the logo of the `makerAsset`.
takerAssetLogoURL:
type: string
description: A URL which hosts the logo of the `takerAsset`.
makingAmount:
type: string
description: The amount of `makerAsset` in wei.
takingAmount:
type: string
description: The amount of `takerAsset` in wei.
filledMakingAmount:
type: string
description: The amount of `makerAsset` which has been filled for this order.
filledTakingAmount:
type: string
description: The amount of `takerAsset` which has been filled for this order.
status:
type: string
description: |-
The status of the order to filter for:
- `active`: Order is active and has yet to be filled.
- `open`: Order is active and has been partially filled.
- `partially_filled`: Order has been partially filled.
- `closed`: Order has been closed and can no longer be filled.
- `filled`: Order has been filled with no remaining assets to be filled.
- `cancelled`: Order was cancelled by the Maker and can no longer be filled.
- `expired`: Order can no longer be filled as the expiry set by the Maker is in the past.
createdAt:
type: integer
description: Timestamp at which the Maker order was created.
expiredAt:
type: integer
description: The unix timestamp upon which the order will automatically lapse (i.e. expire).
transactions:
type: array
description: The fill transactions related to this order.
items:
type: object
required:
- id
- txHash
- txTime
- makingAmount
- takingAmount
properties:
id:
type: integer
description: The order ID.
txHash:
type: string
description: The on-chain tx hash which filled the order.
txTime:
type: integer
description: The fill order tx timestamp.
makingAmount:
type: string
description: The amount of `makerAsset` filled by this order.
takingAmount:
type: string
description: The amount of `takerAsset` filled by this order.
pagination:
type: object
required:
- totalItems
properties:
totalItems:
type: integer
description: The total number or Maker orders.
example:
code: 0
message: Successfully
data:
orders:
- id: 22385,
chainId: '137'
nonce: 3,
makerAsset: '0x2791bca1f2de4661ed88a30c99a7a9449aa84174'
takerAsset: '0x1c954e8fe737f99f68fa1ccda3e51ebdb291948c'
contractAddress: '0xcab2fa2eeab7065b45cbcf6e3936dde2506b4f6c'
orderHash: '57e2bec735db51269aff31b60f4a02f8bd2ef2e554c1433bbd0aea914c378f3a'
makerAssetSymbol: 'USDC.e'
takerAssetSymbol: 'KNC'
makerAssetLogoURL: 'https://assets.coingecko.com/coins/images/6319/large/USD_Coin_icon.png'
takerAssetLogoURL: 'https://storage.googleapis.com/ks-setting-1d682dca/9e796f57-482a-426d-904d-007a6adf22fb.png'
makerAssetDecimals: 6
takerAssetDecimals: 18
makingAmount: '10000'
takingAmount: '20000000000000000'
filledMakingAmount: '0'
filledTakingAmount: '0'
status: 'open'
createdAt: 1697679812
expiredAt: 1697683411
operatorSignatureExpiredAt: 0
transactions: []
pagination:
totalItems: 1
'400':
description: |-
Bad Request
- Missing required fields
- status is not part of accepted values
- page, pageSize are in invalid formats
- page, pageSize are greater than/less than max/min value
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
example:
value:
code: 4000
message: 'Missing required fields: chainId'
errorEntities:
- chainId
'500':
description: Internal Server Error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
example:
value:
code: 5000
message: Internal Server Error
errorEntities: []
/read-ks/api/v1/orders/active-making-amount:
get:
summary: Get Maker Active Making Amount
tags:
- Maker
operationId: get-read-ks-api-v1-orders-active-making-amount
description: Get the Maker's total making amount for a specified token.
parameters:
- schema:
type: string
in: query
name: chainId
required: true
description: The chainId on which the order is being created. Only supports EVM chains.
- schema:
type: string
in: query
name: makerAsset
required: true
description: The token address of the asset which the Maker is selling.
- schema:
type: string
in: query
name: maker
description: The address of the Maker.
required: true
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
required:
- code
- message
- data
properties:
code:
type: integer
description: The response code.
message:
type: string
description: Server response message.
data:
type: object
required:
- activeMakingAmount
properties:
activeMakingAmount:
type: string
description: The total making amount for the specified token (in wei). String representation of uint256 amount.
example:
value:
code: 0
message: Successfully
data:
activeMakingAmount: '1000000000000000000'
'400':
description: |-
Bad Request
- Missing required fields
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
example:
value:
code: 4000
message: 'Missing required fields: chainId'
errorEntities:
- chainId
'500':
description: Internal Server Error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
example:
value:
code: 5000
message: Internal Server Error
errorEntities: []
# Maker: Gasless cancel order(s)
/write/api/v1/orders/cancel-sign:
post:
summary: Get Unsigned Cancel Order(s) Message
tags:
- Maker
operationId: post-write-api-v1-orders-cancel-sign
description: Get EIP712 cancel order message to be signed (i.e. 'Gasless Cancel'). The response of this API will need to be signed with [Sign Typed Data v4](https://docs.metamask.io/guide/signing-data.html#sign-typed-data-v4) before submitting create order request to KyberSwap via `/write/api/v1/orders/cancel`.
requestBody:
content:
application/json:
schema: