@@ -3534,6 +3534,49 @@ public function orderRateLimit(array $params = [])
35343534 return $ this ->apiRequest ("v3/rateLimit/order " , 'GET ' , $ params , true );
35353535 }
35363536
3537+ /**
3538+ * preventedMatches - Get the list of orders that were expired due to STP
3539+ *
3540+ * @link https://developers.binance.com/docs/binance-spot-api-docs/rest-api/account-endpoints#query-prevented-matches-user_data
3541+ *
3542+ * @property int $weight 2
3543+ * - 2 if preventedMatchId is provided
3544+ * - 20 if orderId is provided
3545+ *
3546+ * @param string $symbol (mandatory) The symbol, e.g. BTCUSDT
3547+ * @param string $preventedMatchId (optional) The ID of the prevented match (mandatory if orderId is not provided)
3548+ * @param string $orderId (optional) The ID of the order (mandatory if preventedMatchId is not provided)
3549+ * @param string $fromPreventedMatchId (optional) The ID of the prevented match to start from
3550+ * @param int $limit (optional) The number of results to return (default is 500, max is 1000)
3551+ * @param array $params (optional) An array of additional parameters that the API endpoint allows
3552+ *
3553+ * @return array with error message or the rate limit details
3554+ * @throws \Exception
3555+ */
3556+ public function preventedMatches (string $ symbol , ?string $ preventedMatchId = null , ?string $ orderId = null , ?string $ fromPreventedMatchId = null , ?int $ limit = null , array $ params = []) {
3557+ $ request = [
3558+ 'symbol ' => $ symbol ,
3559+ ];
3560+
3561+ if (is_null ($ preventedMatchId ) && is_null ($ orderId )) {
3562+ throw new \Exception ("Either preventedMatchId or orderId must be provided " );
3563+ } else if ($ preventedMatchId ) {
3564+ $ request ['preventedMatchId ' ] = $ preventedMatchId ;
3565+ } else {
3566+ $ request ['orderId ' ] = $ orderId ;
3567+ }
3568+
3569+ if ($ fromPreventedMatchId ) {
3570+ $ request ['fromPreventedMatchId ' ] = $ fromPreventedMatchId ;
3571+ }
3572+
3573+ if (!is_null ($ limit )) {
3574+ $ request ['limit ' ] = $ limit ;
3575+ }
3576+
3577+ return $ this ->apiRequest ("v3/myPreventedMatches " , 'GET ' , array_merge ($ request , $ params ), true );
3578+ }
3579+
35373580 /**
35383581 * ocoOrder - Create a new OCO order
35393582 *
0 commit comments