-
-
Notifications
You must be signed in to change notification settings - Fork 8.9k
Expand file tree
/
Copy pathbinanceusdm.php
More file actions
66 lines (60 loc) · 2.83 KB
/
Copy pathbinanceusdm.php
File metadata and controls
66 lines (60 loc) · 2.83 KB
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
<?php
namespace ccxt;
// PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
// https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
use Exception; // a common import
use ccxt\abstract\binanceusdm as binance;
class binanceusdm extends binance {
public function describe(): mixed {
return $this->deep_extend(parent::describe(), array(
'id' => 'binanceusdm',
'name' => 'Binance USDⓈ-M',
'urls' => array(
'logo' => 'https://github.com/user-attachments/assets/871cbea7-eebb-4b28-b260-c1c91df0487a',
'doc' => array(
'https://binance-docs.github.io/apidocs/futures/en/',
'https://binance-docs.github.io/apidocs/spot/en',
'https://developers.binance.com/en',
),
),
'has' => array(
'CORS' => null,
'spot' => false,
'margin' => false,
'swap' => true,
'future' => true,
'option' => null,
'createStopMarketOrder' => true,
),
'options' => array(
'fetchMarkets' => array(
'types' => array( 'linear' ),
),
'defaultType' => 'swap',
'defaultSubType' => 'linear',
// https://www.binance.com/en/support/faq/360033162192
// tier amount, maintenance margin, initial margin,
'leverageBrackets' => null,
'marginTypes' => array(),
'marginModes' => array(),
),
// https://binance-docs.github.io/apidocs/futures/en/#error-codes
// https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code
'exceptions' => array(
'exact' => array(
'-5021' => '\\ccxt\\InvalidOrder', // {"code":-5021,"msg":"Due to the order could not be filled immediately, the FOK order has been rejected."}
'-5022' => '\\ccxt\\InvalidOrder', // {"code":-5022,"msg":"Due to the order could not be executed as maker, the Post Only order will be rejected."}
'-5028' => '\\ccxt\\InvalidOrder', // {"code":-5028,"msg":"Timestamp for this request is outside of the ME recvWindow."}
),
),
));
}
public function transfer_in(string $code, float $amount, $params = array()): array {
// transfer from spot wallet to usdm futures wallet
return $this->futuresTransfer($code, $amount, 1, $params);
}
public function transfer_out(string $code, float $amount, $params = array()): array {
// transfer from usdm futures wallet to spot wallet
return $this->futuresTransfer($code, $amount, 2, $params);
}
}