|
...
|
...
|
@@ -53,4 +53,27 @@ class SymbolInfo |
|
|
|
$info = new SymbolInfo($data["instId"], $symbolSt, $ctVal, $pricePrec, $qtyPrec, $lotPrec, $minLot, $minQty);
|
|
|
|
return $info;
|
|
|
|
}
|
|
|
|
public static function transferBinance($data, callable $getSymbolSt): SymbolInfo
|
|
|
|
{
|
|
|
|
$symbolOri = $data['symbol'];
|
|
|
|
$symbolSt = $getSymbolSt($symbolOri); //转换为标准交易对
|
|
|
|
$ctVal = 1;
|
|
|
|
$pricePrec = 0;
|
|
|
|
$qtyPrec = 0;
|
|
|
|
$lotPrec = 0;
|
|
|
|
$minLot = 0;
|
|
|
|
foreach ($data['filters'] as $v) {
|
|
|
|
if ($v['filterType'] == 'PRICE_FILTER') {
|
|
|
|
$pricePrec = getPrecision($v['tickSize']);
|
|
|
|
}
|
|
|
|
if ($v['filterType'] == 'LOT_SIZE') {
|
|
|
|
$minLot = $v['minQty'];
|
|
|
|
$minQty = $minLot * $ctVal;
|
|
|
|
$qtyPrec = getPrecision($minLot);
|
|
|
|
$lotPrec = getPrecision($minLot);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$info = new SymbolInfo($symbolOri, $symbolSt, $ctVal, $pricePrec, $qtyPrec, $lotPrec, $minLot, $minQty);
|
|
|
|
return $info;
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|