Skip to content

Commit 8441e5e

Browse files
committed
fapiRequest added
1 parent 222e9ec commit 8441e5e

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

php-binance-api.php

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6111,20 +6111,29 @@ public function convertSend(string $fromAsset, string $toAsset, $fromAmount = nu
61116111
*
61126112
* @param string $quoteId (mandatory) the quote ID to accept
61136113
* @param int $recvWindow (optional) the time in milliseconds to wait for a response
6114+
* @param array $params (optional) additional parameters
61146115
*
61156116
* @return array containing the response
61166117
* @throws \Exception
61176118
*/
6118-
public function convertAccept(string $quoteId, int $recvWindow = null)
6119+
public function convertAccept(string $quoteId, int $recvWindow = null, array $params = [])
61196120
{
6120-
$params = [
6121-
'fapi' => true,
6121+
$request = [
61226122
'quoteId' => $quoteId,
61236123
];
6124+
return $this->fapiRequest("v1/cconvert/acceptQuote", 'POST', array_merge($request, $params), true, $recvWindow);
6125+
}
6126+
6127+
/**
6128+
* fapiRequest helper for creating a fapi httpRequest
6129+
*/
6130+
protected function fapiRequest(string $url, string $method, array $params = [], $signed = false, int $recvWindow = null)
6131+
{
6132+
$params['fapi'] = true;
61246133
if ($recvWindow) {
61256134
$params['recvWindow'] = $recvWindow;
61266135
}
6127-
return $this->httpRequest("v1/cconvert/acceptQuote", 'POST', $params, true);
6136+
return $this->httpRequest($url, $method, $params, $signed);
61286137
}
61296138

61306139
/**

0 commit comments

Comments
 (0)