You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.
Dismiss alert
protected$charts = []; // /< Websockets chart data
protected$curlOpts = []; // /< User defined curl coptions
protected$info = [
"timeOffset" => 0,
]; // /< Additional connection options
protected$proxyConf = null; // /< Used for story the proxy configuration
protected$caOverride = false; // /< set this if you donnot wish to use CA bundle auto download feature
protected$transfered = 0; // /< This stores the amount of bytes transfered
protected$requestCount = 0; // /< This stores the amount of API requests
protected$httpDebug = false; // /< If you enable this, curl will output debugging information
protected$subscriptions = []; // /< View all websocket subscriptions
protected$recvWindow = null; // /< The amount of time in milliseconds to wait for a response from the server for endpoints that accept a recvWindow parameter
// /< value of available onOrder assets
protected$exchangeInfo = null;
protected$futuresExchangeInfo = null;
protected$lastRequest = [];
protected$xMbxUsedWeight = 0;
protected$xMbxUsedWeight1m = 0;
public$headers = [];
private$SPOT_ORDER_PREFIX = "x-B3AUXNYV";
private$CONTRACT_ORDER_PREFIX = "x-ftGmvgAN";
/**
* Constructor for the class,
* send as many argument as you want.
*
* No arguments - use file setup
* 1 argument - file to load config from
* 2 arguments - api key and api secret
* 3 arguments - api key, api secret and use testnet flag
*
* @return null
*/
publicfunction__construct()
{
$param = func_get_args();
switch (count($param)) {
case0:
$this->setupApiConfigFromFile();
$this->setupProxyConfigFromFile();
$this->setupCurlOptsFromFile();
break;
case1:
$this->setupApiConfigFromFile($param[0]);
$this->setupProxyConfigFromFile($param[0]);
$this->setupCurlOptsFromFile($param[0]);
break;
case2:
$this->api_key = $param[0];
$this->api_secret = $param[1];
break;
case3:
$this->api_key = $param[0];
$this->api_secret = $param[1];
$this->useTestnet = (bool)$param[2];
break;
default:
echo'Please see valid constructors here: https://github.com/jaggedsoft/php-binance-api/blob/master/examples/constructor.php';
}
}
/**
* magic get for protected and protected members
*
* @param $file string the name of the property to return
* @return null
*/
publicfunction__get(string$member)
{
if (property_exists($this, $member)) {
return$this->$member;
}
returnnull;
}
/**
* magic set for protected and protected members
*
* @param $member string the name of the member property
* @param $value the value of the member property
*/
publicfunction__set(string$member, $value)
{
$this->$member = $value;
}
/**
* If no paramaters are supplied in the constructor, this function will attempt
* to load the api_key and api_secret from the users home directory in the file
* @param string $symbol (mandatory) the currency symbol
* @param string $orderid (optional) the orderid to fetch (mandatory if $params['origClientOrderId'] is not provided)
* @param array $params an array of additional parameters that the API endpoint allows
* - @param string $params['origClientOrderId'] optional the original client order id (mandatory if $orderid is not provided)
* - @param string $params['cancelRestrictions'] optional ONLY_NEW (cancel will succeed if the order status is NEW) or ONLY_PARTIALLY_FILLED (cancel will succeed if the order status is PARTIALLY_FILLED)
* @return array with error message or the order details
* @example https://github.com/jaggedsoft/php-binance-api#withdraw Standard withdraw
* @example https://github.com/jaggedsoft/php-binance-api#withdraw-with-addresstag Withdraw with addressTag for e.g. XRP
*
* @property int $weight 1
*
* @param string $asset (mandatory) An asset, e.g. BTC
* @param string $address (mandatory) The address where to send, e.g. 1C5gqLRs96Xq4V2ZZAR1347yUCpHie7sa or 44tLjmXrQNrWJ5NBsEj2R77ZBEgDa3fEe9GLpSf2FRmhexPvfYDUAB7EXX1Hdb3aMQ9FLqdJ56yaAhiXoRsceGJCRS3Jxkn
* @param string $amount (mandatory) The amount, e.g. 0.2
* @param string $addressTag (optional) Mandatory secondary address for some assets (XRP,XMR,etc), e.g. 0e5e38a01058dbf64e53a4333a5acf98e0d5feb8e523d32e3186c664a9c762c1
* @param string $addressName (optional) Description of the address
* @param string $transactionFeeFlag (optional) When making internal transfer, true for returning the fee to the destination account; false for returning the fee back to the departure account.
* @param string $network (optional)
* @param string $orderId (optional) Client id for withdraw