|
23 | 23 | - [Place Order Test](#place-order-test) |
24 | 24 | - [Place Multiple Orders](#place-multiple-orders) |
25 | 25 | - [Place take profit and stop loss order](#place-take-profit-and-stop-loss-order) |
| 26 | + - [Batch cancel Orders](#batch-cancel-orders) |
26 | 27 | - [Fills](#fills) |
27 | 28 | - [Positions](#positions) |
| 29 | + - [Get Margin Mode](#get-margin-mode) |
| 30 | + - [Modify Margin Mode](#modify-margin-mode) |
| 31 | + - [Get Cross Margin Leverage](#get-cross-margin-leverage) |
| 32 | + - [Modify Cross Margin Leverage](#modify-cross-margin-leverage) |
28 | 33 | - [Risk Limit Level](#risk-limit-level) |
29 | 34 | - [Funding Fees](#funding-fees) |
30 | 35 | - [Trade Fees](#trade-fees) |
@@ -428,6 +433,58 @@ futuresSDK.futuresOrderMulti([...], console.log); |
428 | 433 | futuresSDK.futuresOrderStp(params, console.log); |
429 | 434 | ``` |
430 | 435 |
|
| 436 | +##### Batch cancel Orders |
| 437 | + |
| 438 | +| Param | Type | Mandatory | Description | |
| 439 | +|----------------|--------|-----------|--------------------------------------------------------------------------------| |
| 440 | +| symbol | String | No | symbol, this parameter is required when using clientOidsList to cancel orders. | |
| 441 | +| orderIdsList | String | No | Choose one of orderIdsList and clientOidsList | |
| 442 | +| clientOidsList | String | No | Choose one of orderIdsList and clientOidsList | |
| 443 | +```js |
| 444 | +//Request |
| 445 | +{ |
| 446 | + "orderIdsList": |
| 447 | + [ |
| 448 | + "80465574458560512", |
| 449 | + "80465575289094144" |
| 450 | + ], |
| 451 | + "clientOidsList": |
| 452 | + [ |
| 453 | + { |
| 454 | + "symbol": "XBTUSDTM", |
| 455 | + "clientOid": "clientOid123" |
| 456 | + }, |
| 457 | + { |
| 458 | + "symbol": "ETHUSDTM", |
| 459 | + "clientOid": "clientOid321" |
| 460 | + } |
| 461 | + ] |
| 462 | +} |
| 463 | + |
| 464 | +//Response |
| 465 | +{ |
| 466 | + "code": "200000", |
| 467 | + "data": |
| 468 | + [ |
| 469 | + { |
| 470 | + "orderId": "80465574458560512", |
| 471 | + "clientOid": null, |
| 472 | + "code": "200", |
| 473 | + "msg": "success" |
| 474 | + }, |
| 475 | + { |
| 476 | + "orderId": "80465575289094144", |
| 477 | + "clientOid": null, |
| 478 | + "code": "200", |
| 479 | + "msg": "success" |
| 480 | + } |
| 481 | + ] |
| 482 | +} |
| 483 | + |
| 484 | +futuresSDK.futuresMultiCancelOrder(params, console.log); |
| 485 | +``` |
| 486 | + |
| 487 | + |
431 | 488 |
|
432 | 489 | #### Fills |
433 | 490 |
|
@@ -499,6 +556,100 @@ futuresSDK.futuresWithdrawMargin( |
499 | 556 | ); |
500 | 557 | ``` |
501 | 558 |
|
| 559 | +##### Get Margin Mode |
| 560 | +PARAMETERS |
| 561 | +| Param | Type | Mandatory | Description | |
| 562 | +|--------|--------|-----------|------------------------| |
| 563 | +| symbol | String | Yes | Symbol of the contract | |
| 564 | + |
| 565 | +RESPONSES |
| 566 | +| Param | Description | |
| 567 | +|------------|---------------------------------------------------------| |
| 568 | +| symbol | Symbol of the contract | |
| 569 | +| marginMode | Margin mode: ISOLATED (isolated), CROSS (cross margin). | |
| 570 | + |
| 571 | + |
| 572 | +```js |
| 573 | +{ |
| 574 | + "symbol":"XBTUSDTM", // symbol |
| 575 | + "marginMode":"CROSS" // Margin mode: ISOLATED (isolated), CROSS (cross margin). |
| 576 | +} |
| 577 | + |
| 578 | +futuresSDK.futuresGetMarginMode({ symbol: 'ETHUSDTM' }, console.log); |
| 579 | +``` |
| 580 | + |
| 581 | +##### Modify Margin Mode |
| 582 | +PARAMETERS |
| 583 | +| Param | Type | Mandatory | Description | |
| 584 | +|------------|--------|-----------|-------------------------------------------------------------------| |
| 585 | +| symbol | String | Yes | Symbol of the contract | |
| 586 | +| marginMode | String | Yes | Modified margin model: ISOLATED (isolated), CROSS (cross margin). | |
| 587 | + |
| 588 | +RESPONSES |
| 589 | +| Param | Description | |
| 590 | +|------------|---------------------------------------------------------| |
| 591 | +| symbol | Symbol of the contract | |
| 592 | +| marginMode | Margin mode: ISOLATED (isolated), CROSS (cross margin). | |
| 593 | + |
| 594 | + |
| 595 | +```js |
| 596 | +// request body |
| 597 | +{ |
| 598 | + "symbol":"XBTUSDTM", // symbol |
| 599 | + "marginMode":"CROSS" // Margin mode: ISOLATED (isolated), CROSS (cross margin). |
| 600 | +} |
| 601 | + |
| 602 | +// response body |
| 603 | +{ |
| 604 | + "symbol":"XBTUSDTM", // symbol |
| 605 | + "marginMode":"CROSS" // Modified margin model:ISOLATED (isolated), CROSS (cross margin). |
| 606 | +} |
| 607 | + |
| 608 | +futuresSDK.futuresChangeMarginMode({ symbol: 'ETHUSDTM', marginMode: 'CROSS' }, console.log); |
| 609 | +``` |
| 610 | + |
| 611 | +##### Get Cross Margin Leverage |
| 612 | +PARAMETERS |
| 613 | +| Param | Type | Mandatory | Description | |
| 614 | +|--------|--------|-----------|------------------------| |
| 615 | +| symbol | String | Yes | Symbol of the contract | |
| 616 | + |
| 617 | +RESPONSES |
| 618 | +| Param | Description | |
| 619 | +|-----------------------------|--------------------------| |
| 620 | +| symbol | Symbol of the contract | |
| 621 | +| leverage | Leverage multiple | |
| 622 | + |
| 623 | +```js |
| 624 | +{ |
| 625 | + "symbol":"XBTUSDTM", // symbol |
| 626 | + "leverage":"3.00" // Leverage multiple |
| 627 | +} |
| 628 | + |
| 629 | +futuresSDK.futuresGetCrossUserLeverage({ symbol: 'XBTUSDTM' }, console.log) |
| 630 | +``` |
| 631 | + |
| 632 | +##### Modify Cross Margin Leverage |
| 633 | +PARAMETERS |
| 634 | +| Param | Type | Mandatory | Description | |
| 635 | +|----------|--------|-----------|------------------------| |
| 636 | +| symbol | String | Yes | Symbol of the contract | |
| 637 | +| leverage | String | Yes | Leverage multiple | |
| 638 | + |
| 639 | +RESPONSES |
| 640 | +| Param | Description | |
| 641 | +|-----------------------------|--------------------------| |
| 642 | +| data | Whether successful | |
| 643 | + |
| 644 | +```js |
| 645 | +{ |
| 646 | + "symbol":"XBTUSDTM", // symbol |
| 647 | + "leverage":"3.00" // Leverage multiple |
| 648 | +} |
| 649 | + |
| 650 | +futuresSDK.futuresChangeCrossUserLeverage({ symbol: 'XBTUSDTM', leverage: 3 }, console.log) |
| 651 | +``` |
| 652 | + |
502 | 653 | #### Risk Limit Level |
503 | 654 |
|
504 | 655 | ```js |
@@ -719,6 +870,33 @@ futuresSDK.websocket.position(['ETHUSDTM', 'XBTUSDTM']); |
719 | 870 | // All Position Change Events |
720 | 871 | // The subject is the same as the position change events above. |
721 | 872 | futuresSDK.websocket.positionAll(console.log); |
| 873 | + |
| 874 | +// { |
| 875 | +// "topic": "/contract/marginMode", |
| 876 | +// "type": "message", |
| 877 | +// "subject": "user.config", |
| 878 | +// "userId": "6687a53f5bda600012b84bf", |
| 879 | +// "channelType": "private", |
| 880 | +// "data": { |
| 881 | +// "ANTUSDTM": "CROSS" |
| 882 | +// } |
| 883 | +// } |
| 884 | +futuresSDK.websocket.marginMode(console.log); |
| 885 | + |
| 886 | +// { |
| 887 | +// "topic": "/contract/crossLeverage", |
| 888 | +// "type": "message", |
| 889 | +// "subject": "user.config", |
| 890 | +// "userId": "6687a53f5bda600001284bf", |
| 891 | +// "channelType": "private", |
| 892 | +// "data": { |
| 893 | +// "ANTUSDTM": { |
| 894 | +// "leverage": 5 |
| 895 | +// } |
| 896 | +// } |
| 897 | +// } |
| 898 | +futuresSDK.websocket.crossLeverage(console.log); |
| 899 | + |
722 | 900 | ``` |
723 | 901 |
|
724 | 902 | ## License |
|
0 commit comments