@@ -1014,4 +1014,343 @@ public function testPositionV3Futures()
1014
1014
$ res = $ this ->futuresBinance ->futuresPositionV3 ($ this ->symbol );
1015
1015
$ this ->assertIsArray ($ res );
1016
1016
}
1017
+
1018
+ public function testAdlQuantileFutures ()
1019
+ {
1020
+ $ res = $ this ->futuresBinance ->futuresAdlQuantile ($ this ->symbol , $ this ->recvWindow );
1021
+ $ this ->assertIsArray ($ res );
1022
+ $ this ->assertEquals ($ this ->symbol , $ res ['symbol ' ]);
1023
+ $ this ->assertArrayHasKey ('adlQuantile ' , $ res );
1024
+ $ this ->assertIsArray ($ res ['adlQuantile ' ]);
1025
+ }
1026
+
1027
+ public function testPositionMarginChangeHistoryFutures ()
1028
+ {
1029
+ $ res = $ this ->futuresBinance ->futuresPositionMarginChangeHistory ($ this ->symbol );
1030
+ $ this ->assertIsArray ($ res );
1031
+ }
1032
+
1033
+ public function testBalancesFutures ()
1034
+ {
1035
+ $ res = $ this ->futuresBinance ->futuresBalances ();
1036
+ $ this ->assertIsArray ($ res );
1037
+ $ firstKey = array_key_first ($ res );
1038
+ $ this ->assertIsString ($ firstKey );
1039
+ $ firstValue = $ res [$ firstKey ];
1040
+ $ this ->assertIsArray ($ firstValue );
1041
+ $ this ->assertArrayHasKey ('available ' , $ firstValue );
1042
+ $ this ->assertIsNumeric ($ firstValue ['available ' ]);
1043
+ $ this ->assertArrayHasKey ('onOrder ' , $ firstValue );
1044
+ $ this ->assertIsNumeric ($ firstValue ['onOrder ' ]);
1045
+ $ this ->assertArrayHasKey ('total ' , $ firstValue );
1046
+ $ this ->assertIsNumeric ($ firstValue ['total ' ]);
1047
+ $ this ->assertArrayHasKey ('info ' , $ firstValue );
1048
+ $ info = $ firstValue ['info ' ];
1049
+ $ this ->assertIsArray ($ info );
1050
+ $ this ->assertArrayHasKey ('accountAlias ' , $ info );
1051
+ $ this ->assertIsString ($ info ['accountAlias ' ]);
1052
+ $ this ->assertArrayHasKey ('asset ' , $ info );
1053
+ $ this ->assertIsString ($ info ['asset ' ]);
1054
+ $ this ->assertArrayHasKey ('balance ' , $ info );
1055
+ $ this ->assertIsNumeric ($ info ['balance ' ]);
1056
+ $ this ->assertArrayHasKey ('crossWalletBalance ' , $ info );
1057
+ $ this ->assertIsNumeric ($ info ['crossWalletBalance ' ]);
1058
+ $ this ->assertArrayHasKey ('crossUnPnl ' , $ info );
1059
+ $ this ->assertIsNumeric ($ info ['crossUnPnl ' ]);
1060
+ $ this ->assertArrayHasKey ('availableBalance ' , $ info );
1061
+ $ this ->assertIsNumeric ($ info ['availableBalance ' ]);
1062
+ $ this ->assertArrayHasKey ('maxWithdrawAmount ' , $ info );
1063
+ $ this ->assertIsNumeric ($ info ['maxWithdrawAmount ' ]);
1064
+ $ this ->assertArrayHasKey ('marginAvailable ' , $ info );
1065
+ $ this ->assertIsBool ($ info ['marginAvailable ' ]);
1066
+ $ this ->assertArrayHasKey ('updateTime ' , $ info );
1067
+ $ this ->assertIsInt ($ info ['updateTime ' ]);
1068
+ }
1069
+
1070
+ public function testBalancesV2Futures ()
1071
+ {
1072
+ $ res = $ this ->futuresBinance ->futuresBalancesV2 ();
1073
+ $ this ->assertIsArray ($ res );
1074
+ $ firstKey = array_key_first ($ res );
1075
+ $ this ->assertIsString ($ firstKey );
1076
+ $ firstValue = $ res [$ firstKey ];
1077
+ $ this ->assertIsArray ($ firstValue );
1078
+ $ this ->assertArrayHasKey ('available ' , $ firstValue );
1079
+ $ this ->assertIsNumeric ($ firstValue ['available ' ]);
1080
+ $ this ->assertArrayHasKey ('onOrder ' , $ firstValue );
1081
+ $ this ->assertIsNumeric ($ firstValue ['onOrder ' ]);
1082
+ $ this ->assertArrayHasKey ('total ' , $ firstValue );
1083
+ $ this ->assertIsNumeric ($ firstValue ['total ' ]);
1084
+ $ this ->assertArrayHasKey ('info ' , $ firstValue );
1085
+ $ info = $ firstValue ['info ' ];
1086
+ $ this ->assertIsArray ($ info );
1087
+ $ this ->assertArrayHasKey ('accountAlias ' , $ info );
1088
+ $ this ->assertIsString ($ info ['accountAlias ' ]);
1089
+ $ this ->assertArrayHasKey ('asset ' , $ info );
1090
+ $ this ->assertIsString ($ info ['asset ' ]);
1091
+ $ this ->assertArrayHasKey ('balance ' , $ info );
1092
+ $ this ->assertIsNumeric ($ info ['balance ' ]);
1093
+ $ this ->assertArrayHasKey ('crossWalletBalance ' , $ info );
1094
+ $ this ->assertIsNumeric ($ info ['crossWalletBalance ' ]);
1095
+ $ this ->assertArrayHasKey ('crossUnPnl ' , $ info );
1096
+ $ this ->assertIsNumeric ($ info ['crossUnPnl ' ]);
1097
+ $ this ->assertArrayHasKey ('availableBalance ' , $ info );
1098
+ $ this ->assertIsNumeric ($ info ['availableBalance ' ]);
1099
+ $ this ->assertArrayHasKey ('maxWithdrawAmount ' , $ info );
1100
+ $ this ->assertIsNumeric ($ info ['maxWithdrawAmount ' ]);
1101
+ $ this ->assertArrayHasKey ('marginAvailable ' , $ info );
1102
+ $ this ->assertIsBool ($ info ['marginAvailable ' ]);
1103
+ $ this ->assertArrayHasKey ('updateTime ' , $ info );
1104
+ $ this ->assertIsInt ($ info ['updateTime ' ]);
1105
+ }
1106
+
1107
+ public function testBalancesV3Futures ()
1108
+ {
1109
+ $ res = $ this ->futuresBinance ->futuresBalancesV3 ();
1110
+ $ this ->assertIsArray ($ res );
1111
+ $ firstKey = array_key_first ($ res );
1112
+ $ this ->assertIsString ($ firstKey );
1113
+ $ firstValue = $ res [$ firstKey ];
1114
+ $ this ->assertIsArray ($ firstValue );
1115
+ $ this ->assertArrayHasKey ('available ' , $ firstValue );
1116
+ $ this ->assertIsNumeric ($ firstValue ['available ' ]);
1117
+ $ this ->assertArrayHasKey ('onOrder ' , $ firstValue );
1118
+ $ this ->assertIsNumeric ($ firstValue ['onOrder ' ]);
1119
+ $ this ->assertArrayHasKey ('total ' , $ firstValue );
1120
+ $ this ->assertIsNumeric ($ firstValue ['total ' ]);
1121
+ $ this ->assertArrayHasKey ('info ' , $ firstValue );
1122
+ $ info = $ firstValue ['info ' ];
1123
+ $ this ->assertIsArray ($ info );
1124
+ $ this ->assertArrayHasKey ('accountAlias ' , $ info );
1125
+ $ this ->assertIsString ($ info ['accountAlias ' ]);
1126
+ $ this ->assertArrayHasKey ('asset ' , $ info );
1127
+ $ this ->assertIsString ($ info ['asset ' ]);
1128
+ $ this ->assertArrayHasKey ('balance ' , $ info );
1129
+ $ this ->assertIsNumeric ($ info ['balance ' ]);
1130
+ $ this ->assertArrayHasKey ('crossWalletBalance ' , $ info );
1131
+ $ this ->assertIsNumeric ($ info ['crossWalletBalance ' ]);
1132
+ $ this ->assertArrayHasKey ('crossUnPnl ' , $ info );
1133
+ $ this ->assertIsNumeric ($ info ['crossUnPnl ' ]);
1134
+ $ this ->assertArrayHasKey ('availableBalance ' , $ info );
1135
+ $ this ->assertIsNumeric ($ info ['availableBalance ' ]);
1136
+ $ this ->assertArrayHasKey ('maxWithdrawAmount ' , $ info );
1137
+ $ this ->assertIsNumeric ($ info ['maxWithdrawAmount ' ]);
1138
+ $ this ->assertArrayHasKey ('marginAvailable ' , $ info );
1139
+ $ this ->assertIsBool ($ info ['marginAvailable ' ]);
1140
+ $ this ->assertArrayHasKey ('updateTime ' , $ info );
1141
+ $ this ->assertIsInt ($ info ['updateTime ' ]);
1142
+ }
1143
+
1144
+ public function testAccountFutures ()
1145
+ {
1146
+ $ res = $ this ->futuresBinance ->futuresAccount ();
1147
+ $ this ->assertIsArray ($ res );
1148
+ $ this ->assertArrayHasKey ('totalInitialMargin ' , $ res );
1149
+ $ this ->assertIsNumeric ($ res ['totalInitialMargin ' ]);
1150
+ $ this ->assertArrayHasKey ('totalMaintMargin ' , $ res );
1151
+ $ this ->assertIsNumeric ($ res ['totalMaintMargin ' ]);
1152
+ $ this ->assertArrayHasKey ('totalWalletBalance ' , $ res );
1153
+ $ this ->assertIsNumeric ($ res ['totalWalletBalance ' ]);
1154
+ $ this ->assertArrayHasKey ('totalUnrealizedProfit ' , $ res );
1155
+ $ this ->assertIsNumeric ($ res ['totalUnrealizedProfit ' ]);
1156
+ $ this ->assertArrayHasKey ('totalMarginBalance ' , $ res );
1157
+ $ this ->assertIsNumeric ($ res ['totalMarginBalance ' ]);
1158
+ $ this ->assertArrayHasKey ('totalPositionInitialMargin ' , $ res );
1159
+ $ this ->assertIsNumeric ($ res ['totalPositionInitialMargin ' ]);
1160
+ $ this ->assertArrayHasKey ('totalOpenOrderInitialMargin ' , $ res );
1161
+ $ this ->assertIsNumeric ($ res ['totalOpenOrderInitialMargin ' ]);
1162
+ $ this ->assertArrayHasKey ('totalCrossWalletBalance ' , $ res );
1163
+ $ this ->assertIsNumeric ($ res ['totalCrossWalletBalance ' ]);
1164
+ $ this ->assertArrayHasKey ('totalCrossUnPnl ' , $ res );
1165
+ $ this ->assertIsNumeric ($ res ['totalCrossUnPnl ' ]);
1166
+ $ this ->assertArrayHasKey ('availableBalance ' , $ res );
1167
+ $ this ->assertIsNumeric ($ res ['availableBalance ' ]);
1168
+ $ this ->assertArrayHasKey ('maxWithdrawAmount ' , $ res );
1169
+ $ this ->assertIsNumeric ($ res ['maxWithdrawAmount ' ]);
1170
+ $ this ->assertArrayHasKey ('assets ' , $ res );
1171
+ $ this ->assertIsArray ($ res ['assets ' ]);
1172
+ $ this ->assertArrayHasKey ('positions ' , $ res );
1173
+ $ this ->assertIsArray ($ res ['positions ' ]);
1174
+ }
1175
+
1176
+ public function testAccountV2Futures ()
1177
+ {
1178
+ $ res = $ this ->futuresBinance ->futuresAccountV2 ($ this ->recvWindow );
1179
+ $ this ->assertIsArray ($ res );
1180
+ $ this ->assertArrayHasKey ('totalInitialMargin ' , $ res );
1181
+ $ this ->assertIsNumeric ($ res ['totalInitialMargin ' ]);
1182
+ $ this ->assertArrayHasKey ('totalMaintMargin ' , $ res );
1183
+ $ this ->assertIsNumeric ($ res ['totalMaintMargin ' ]);
1184
+ $ this ->assertArrayHasKey ('totalWalletBalance ' , $ res );
1185
+ $ this ->assertIsNumeric ($ res ['totalWalletBalance ' ]);
1186
+ $ this ->assertArrayHasKey ('totalUnrealizedProfit ' , $ res );
1187
+ $ this ->assertIsNumeric ($ res ['totalUnrealizedProfit ' ]);
1188
+ $ this ->assertArrayHasKey ('totalMarginBalance ' , $ res );
1189
+ $ this ->assertIsNumeric ($ res ['totalMarginBalance ' ]);
1190
+ $ this ->assertArrayHasKey ('totalPositionInitialMargin ' , $ res );
1191
+ $ this ->assertIsNumeric ($ res ['totalPositionInitialMargin ' ]);
1192
+ $ this ->assertArrayHasKey ('totalOpenOrderInitialMargin ' , $ res );
1193
+ $ this ->assertIsNumeric ($ res ['totalOpenOrderInitialMargin ' ]);
1194
+ $ this ->assertArrayHasKey ('totalCrossWalletBalance ' , $ res );
1195
+ $ this ->assertIsNumeric ($ res ['totalCrossWalletBalance ' ]);
1196
+ $ this ->assertArrayHasKey ('totalCrossUnPnl ' , $ res );
1197
+ $ this ->assertIsNumeric ($ res ['totalCrossUnPnl ' ]);
1198
+ $ this ->assertArrayHasKey ('availableBalance ' , $ res );
1199
+ $ this ->assertIsNumeric ($ res ['availableBalance ' ]);
1200
+ $ this ->assertArrayHasKey ('maxWithdrawAmount ' , $ res );
1201
+ $ this ->assertIsNumeric ($ res ['maxWithdrawAmount ' ]);
1202
+ $ this ->assertArrayHasKey ('assets ' , $ res );
1203
+ $ this ->assertIsArray ($ res ['assets ' ]);
1204
+ $ this ->assertArrayHasKey ('positions ' , $ res );
1205
+ $ this ->assertIsArray ($ res ['positions ' ]);
1206
+ }
1207
+
1208
+ public function testAccountV3Futures ()
1209
+ {
1210
+ $ res = $ this ->futuresBinance ->futuresAccountV3 ($ this ->recvWindow );
1211
+ $ this ->assertIsArray ($ res );
1212
+ $ this ->assertArrayHasKey ('totalInitialMargin ' , $ res );
1213
+ $ this ->assertIsNumeric ($ res ['totalInitialMargin ' ]);
1214
+ $ this ->assertArrayHasKey ('totalMaintMargin ' , $ res );
1215
+ $ this ->assertIsNumeric ($ res ['totalMaintMargin ' ]);
1216
+ $ this ->assertArrayHasKey ('totalWalletBalance ' , $ res );
1217
+ $ this ->assertIsNumeric ($ res ['totalWalletBalance ' ]);
1218
+ $ this ->assertArrayHasKey ('totalUnrealizedProfit ' , $ res );
1219
+ $ this ->assertIsNumeric ($ res ['totalUnrealizedProfit ' ]);
1220
+ $ this ->assertArrayHasKey ('totalMarginBalance ' , $ res );
1221
+ $ this ->assertIsNumeric ($ res ['totalMarginBalance ' ]);
1222
+ $ this ->assertArrayHasKey ('totalPositionInitialMargin ' , $ res );
1223
+ $ this ->assertIsNumeric ($ res ['totalPositionInitialMargin ' ]);
1224
+ $ this ->assertArrayHasKey ('totalOpenOrderInitialMargin ' , $ res );
1225
+ $ this ->assertIsNumeric ($ res ['totalOpenOrderInitialMargin ' ]);
1226
+ $ this ->assertArrayHasKey ('totalCrossWalletBalance ' , $ res );
1227
+ $ this ->assertIsNumeric ($ res ['totalCrossWalletBalance ' ]);
1228
+ $ this ->assertArrayHasKey ('totalCrossUnPnl ' , $ res );
1229
+ $ this ->assertIsNumeric ($ res ['totalCrossUnPnl ' ]);
1230
+ $ this ->assertArrayHasKey ('availableBalance ' , $ res );
1231
+ $ this ->assertIsNumeric ($ res ['availableBalance ' ]);
1232
+ $ this ->assertArrayHasKey ('maxWithdrawAmount ' , $ res );
1233
+ $ this ->assertIsNumeric ($ res ['maxWithdrawAmount ' ]);
1234
+ $ this ->assertArrayHasKey ('assets ' , $ res );
1235
+ $ this ->assertIsArray ($ res ['assets ' ]);
1236
+ $ this ->assertArrayHasKey ('positions ' , $ res );
1237
+ $ this ->assertIsArray ($ res ['positions ' ]);
1238
+ }
1239
+
1240
+ public function testTradeFeeFutures ()
1241
+ {
1242
+ $ res = $ this ->futuresBinance ->futuresTradeFee ($ this ->symbol );
1243
+ $ this ->assertIsArray ($ res );
1244
+ $ this ->assertArrayHasKey ('symbol ' , $ res );
1245
+ $ this ->assertEquals ($ this ->symbol , $ res ['symbol ' ]);
1246
+ $ this ->assertArrayHasKey ('makerCommissionRate ' , $ res );
1247
+ $ this ->assertIsNumeric ($ res ['makerCommissionRate ' ]);
1248
+ $ this ->assertArrayHasKey ('takerCommissionRate ' , $ res );
1249
+ $ this ->assertIsNumeric ($ res ['takerCommissionRate ' ]);
1250
+ }
1251
+
1252
+ public function testAccountConfigFutures ()
1253
+ {
1254
+ $ res = $ this ->futuresBinance ->futuresAccountConfig ();
1255
+ $ this ->assertIsArray ($ res );
1256
+ $ this ->assertArrayHasKey ('feeTier ' , $ res );
1257
+ $ this ->assertIsInt ($ res ['feeTier ' ]);
1258
+ $ this ->assertArrayHasKey ('canTrade ' , $ res );
1259
+ $ this ->assertIsBool ($ res ['canTrade ' ]);
1260
+ $ this ->assertArrayHasKey ('canDeposit ' , $ res );
1261
+ $ this ->assertIsBool ($ res ['canDeposit ' ]);
1262
+ $ this ->assertArrayHasKey ('canWithdraw ' , $ res );
1263
+ $ this ->assertIsBool ($ res ['canWithdraw ' ]);
1264
+ $ this ->assertArrayHasKey ('dualSidePosition ' , $ res );
1265
+ $ this ->assertIsBool ($ res ['dualSidePosition ' ]);
1266
+ $ this ->assertArrayHasKey ('updateTime ' , $ res );
1267
+ $ this ->assertIsInt ($ res ['updateTime ' ]);
1268
+ $ this ->assertArrayHasKey ('multiAssetsMargin ' , $ res );
1269
+ $ this ->assertIsBool ($ res ['multiAssetsMargin ' ]);
1270
+ $ this ->assertArrayHasKey ('tradeGroupId ' , $ res );
1271
+ }
1272
+
1273
+ public function testMarginModesFutures ()
1274
+ {
1275
+ $ res = $ this ->futuresBinance ->futuresMarginModes ($ this ->symbol );
1276
+ $ this ->assertIsArray ($ res );
1277
+ $ firstEntry = $ res [0 ];
1278
+ $ this ->assertIsArray ($ firstEntry );
1279
+ $ this ->assertArrayHasKey ('symbol ' , $ firstEntry );
1280
+ $ this ->assertEquals ($ this ->symbol , $ firstEntry ['symbol ' ]);
1281
+ $ this ->assertArrayHasKey ('marginType ' , $ firstEntry );
1282
+ $ this ->assertIsString ($ firstEntry ['marginType ' ]);
1283
+ $ this ->assertArrayHasKey ('isAutoAddMargin ' , $ firstEntry );
1284
+ $ this ->assertIsBool ($ firstEntry ['isAutoAddMargin ' ]);
1285
+ $ this ->assertArrayHasKey ('leverage ' , $ firstEntry );
1286
+ $ this ->assertIsNumeric ($ firstEntry ['leverage ' ]);
1287
+ $ this ->assertArrayHasKey ('maxNotionalValue ' , $ firstEntry );
1288
+ $ this ->assertIsNumeric ($ firstEntry ['maxNotionalValue ' ]);
1289
+ }
1290
+
1291
+ public function testOrderRateLimitFutures ()
1292
+ {
1293
+ $ res = $ this ->futuresBinance ->futuresOrderRateLimit ();
1294
+ $ this ->assertIsArray ($ res );
1295
+ $ firstEntry = $ res [0 ];
1296
+ $ this ->assertIsArray ($ firstEntry );
1297
+ $ this ->assertArrayHasKey ('rateLimitType ' , $ firstEntry );
1298
+ $ this ->assertEquals ('ORDERS ' , $ firstEntry ['rateLimitType ' ]);
1299
+ $ this ->assertArrayHasKey ('interval ' , $ firstEntry );
1300
+ $ this ->assertIsString ($ firstEntry ['interval ' ]);
1301
+ $ this ->assertArrayHasKey ('intervalNum ' , $ firstEntry );
1302
+ $ this ->assertIsNumeric ($ firstEntry ['intervalNum ' ]);
1303
+ $ this ->assertArrayHasKey ('limit ' , $ firstEntry );
1304
+ $ this ->assertIsInt ($ firstEntry ['limit ' ]);
1305
+ }
1306
+
1307
+ public function testLeveragesFutures ()
1308
+ {
1309
+ $ res = $ this ->futuresBinance ->futuresLeverages ($ this ->symbol );
1310
+ $ this ->assertIsArray ($ res );
1311
+ $ firstEntry = $ res [0 ];
1312
+ $ this ->assertIsArray ($ firstEntry );
1313
+ $ this ->assertArrayHasKey ('symbol ' , $ firstEntry );
1314
+ $ this ->assertEquals ($ this ->symbol , $ firstEntry ['symbol ' ]);
1315
+ $ this ->assertArrayHasKey ('brackets ' , $ firstEntry );
1316
+ $ this ->assertIsArray ($ firstEntry ['brackets ' ]);
1317
+ $ firstBracket = $ firstEntry ['brackets ' ][0 ];
1318
+ $ this ->assertIsArray ($ firstBracket );
1319
+ $ this ->assertArrayHasKey ('bracket ' , $ firstBracket );
1320
+ $ this ->assertIsInt ($ firstBracket ['bracket ' ]);
1321
+ $ this ->assertArrayHasKey ('initialLeverage ' , $ firstBracket );
1322
+ $ this ->assertIsNumeric ($ firstBracket ['initialLeverage ' ]);
1323
+ $ this ->assertArrayHasKey ('notionalCap ' , $ firstBracket );
1324
+ $ this ->assertIsNumeric ($ firstBracket ['notionalCap ' ]);
1325
+ $ this ->assertArrayHasKey ('notionalFloor ' , $ firstBracket );
1326
+ $ this ->assertIsNumeric ($ firstBracket ['notionalFloor ' ]);
1327
+ $ this ->assertArrayHasKey ('maintMarginRatio ' , $ firstBracket );
1328
+ $ this ->assertIsNumeric ($ firstBracket ['maintMarginRatio ' ]);
1329
+ $ this ->assertArrayHasKey ('cum ' , $ firstBracket );
1330
+ $ this ->assertIsNumeric ($ firstBracket ['cum ' ]);
1331
+ }
1332
+
1333
+ public function testLedgerFutures ()
1334
+ {
1335
+ $ res = $ this ->futuresBinance ->futuresLedger ();
1336
+ $ this ->assertIsArray ($ res );
1337
+ }
1338
+
1339
+ public function testTradingStatusFutures ()
1340
+ {
1341
+ $ res = $ this ->futuresBinance ->futuresTradingStatus ();
1342
+ $ this ->assertIsArray ($ res );
1343
+ $ this ->assertArrayHasKey ('indicators ' , $ res );
1344
+ $ this ->assertIsArray ($ res ['indicators ' ]);
1345
+ $ this ->assertArrayHasKey ('updateTime ' , $ res );
1346
+ $ this ->assertIsInt ($ res ['updateTime ' ]);
1347
+ }
1348
+
1349
+ public function testFeeBurnStatusFutures ()
1350
+ {
1351
+ $ res = $ this ->futuresBinance ->futuresFeeBurnStatus ();
1352
+ $ this ->assertIsArray ($ res );
1353
+ $ this ->assertArrayHasKey ('feeBurn ' , $ res );
1354
+ $ this ->assertIsBool ($ res ['feeBurn ' ]);
1355
+ }
1017
1356
}
0 commit comments