Closed MrDevBC closed 6 years ago
This was working before he upgraded past PHP 7. Not sure what would change other than switching to cURL
Works fine on https://travis-ci.org/jaggedsoft/php-binance-api
One of 3 things
ca bundle fix
now
dave@dave-laptop:~/Desktop/crypto/php-binance-api$ date
Wed Apr 25 09:24:54 IST 2018
php version
dave@dave-laptop:~/Desktop/crypto/php-binance-api$ php -v
PHP 7.2.4 (cli) (built: Apr 17 2018 21:01:00) ( ZTS DEBUG )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
with Xdebug v2.6.0, Copyright (c) 2002-2018, by Derick Rethans
code
dave@dave-laptop:~/Desktop/crypto/php-binance-api$ cat examples/get_prices.php
<?php
require '../php-binance-api.php';
// @see home_directory_config.php
// use config from ~/.confg/jaggedsoft/php-binance-api.json
$api = new Binance\API();
// Get latest price of a symbol
$ticker = $api->prices();
print_r($ticker); // List prices of all symbols
echo "Price of BNB: {$ticker['BNBBTC']} BTC.\n";
// Get all of your positions, including estimated BTC value - This is where the api doesn't work..
$balances = $api->balances($ticker);
print_r($balances);
result
dave@dave-laptop:~/Desktop/crypto/php-binance-api$ php examples/get_prices.php
Array
(
[ETHBTC] => 0.07005100
[LTCBTC] => 0.01642800
[BNBBTC] => 0.00153920
[NEOBTC] => 0.00815000
[QTUMETH] => 0.03156400
[EOSETH] => 0.02242400
[SNTETH] => 0.00022208
[BNTETH] => 0.00682000
[BCCBTC] => 0.14314000
[GASBTC] => 0.00293500
[BNBETH] => 0.02196200
[BTCUSDT] => 9416.06000000
[ETHUSDT] => 658.46000000
[HSRBTC] => 0.00104600
[OAXETH] => 0.00113320
[DNTETH] => 0.00015328
[MCOETH] => 0.01848300
[ICNETH] => 0.00223750
[MCOBTC] => 0.00129500
[WTCBTC] => 0.00145810
[WTCETH] => 0.02082000
[LRCBTC] => 0.00008489
[LRCETH] => 0.00120047
[QTUMBTC] => 0.00222000
[YOYOBTC] => 0.00001382
[OMGBTC] => 0.00176600
[OMGETH] => 0.02527500
[ZRXBTC] => 0.00011391
[ZRXETH] => 0.00161910
[STRATBTC] => 0.00067760
[STRATETH] => 0.00968200
[SNGLSBTC] => 0.00001045
[SNGLSETH] => 0.00014842
[BQXBTC] => 0.00036522
[BQXETH] => 0.00522500
[KNCBTC] => 0.00021193
[KNCETH] => 0.00301870
[FUNBTC] => 0.00000510
[FUNETH] => 0.00007274
[SNMBTC] => 0.00002239
[SNMETH] => 0.00031939
[NEOETH] => 0.11620400
[IOTABTC] => 0.00021083
[IOTAETH] => 0.00301111
[LINKBTC] => 0.00005135
[LINKETH] => 0.00073251
[XVGBTC] => 0.00000687
[XVGETH] => 0.00009802
[SALTBTC] => 0.00040480
[SALTETH] => 0.00577900
[MDABTC] => 0.00012500
[MDAETH] => 0.00178800
[MTLBTC] => 0.00051930
[MTLETH] => 0.00742000
[SUBBTC] => 0.00007732
[SUBETH] => 0.00110002
[EOSBTC] => 0.00157250
[SNTBTC] => 0.00001563
[ETCETH] => 0.03080400
[ETCBTC] => 0.00215200
[MTHBTC] => 0.00001337
[MTHETH] => 0.00018923
[ENGBTC] => 0.00026118
[ENGETH] => 0.00371180
[DNTBTC] => 0.00001075
[ZECBTC] => 0.03116500
[ZECETH] => 0.44244000
[BNTBTC] => 0.00047849
[ASTBTC] => 0.00006108
[ASTETH] => 0.00087460
[DASHBTC] => 0.05274900
[DASHETH] => 0.75290000
[OAXBTC] => 0.00007971
[ICNBTC] => 0.00015758
[BTGBTC] => 0.00828200
[BTGETH] => 0.11866500
[EVXBTC] => 0.00017721
[EVXETH] => 0.00252140
[REQBTC] => 0.00002684
[REQETH] => 0.00038382
[VIBBTC] => 0.00002153
[VIBETH] => 0.00030200
[HSRETH] => 0.01494600
[TRXBTC] => 0.00000787
[TRXETH] => 0.00011228
[POWRBTC] => 0.00005921
[POWRETH] => 0.00084266
[ARKBTC] => 0.00036310
[ARKETH] => 0.00518000
[YOYOETH] => 0.00019750
[XRPBTC] => 0.00009214
[XRPETH] => 0.00131247
[MODBTC] => 0.00029830
[MODETH] => 0.00423000
[ENJBTC] => 0.00001549
[ENJETH] => 0.00022086
[STORJBTC] => 0.00011790
[STORJETH] => 0.00167970
[BNBUSDT] => 14.45620000
[VENBNB] => 0.28010000
[YOYOBNB] => 0.00901000
[POWRBNB] => 0.03853000
[VENBTC] => 0.00043241
[VENETH] => 0.00616421
[KMDBTC] => 0.00041810
[KMDETH] => 0.00592800
[NULSBNB] => 0.20815000
[RCNBTC] => 0.00001526
[RCNETH] => 0.00021884
[RCNBNB] => 0.00992000
[NULSBTC] => 0.00031944
[NULSETH] => 0.00455696
[RDNBTC] => 0.00022523
[RDNETH] => 0.00321410
[RDNBNB] => 0.14684000
[XMRBTC] => 0.02914700
[XMRETH] => 0.41455000
[DLTBNB] => 0.01919000
[WTCBNB] => 0.94650000
[DLTBTC] => 0.00002959
[DLTETH] => 0.00042353
[AMBBTC] => 0.00006794
[AMBETH] => 0.00097497
[AMBBNB] => 0.04458000
[BCCETH] => 2.04200000
[BCCUSDT] => 1349.39000000
[BCCBNB] => 93.00000000
[BATBTC] => 0.00004594
[BATETH] => 0.00065619
[BATBNB] => 0.02985000
[BCPTBTC] => 0.00006414
[BCPTETH] => 0.00091381
[BCPTBNB] => 0.04194000
[ARNBTC] => 0.00018086
[ARNETH] => 0.00260369
[GVTBTC] => 0.00239190
[GVTETH] => 0.03408400
[CDTBTC] => 0.00000633
[CDTETH] => 0.00009017
[GXSBTC] => 0.00038690
[GXSETH] => 0.00554000
[NEOUSDT] => 76.58400000
[NEOBNB] => 5.29100000
[POEBTC] => 0.00000606
[POEETH] => 0.00008629
[QSPBTC] => 0.00002046
[QSPETH] => 0.00029196
[QSPBNB] => 0.01325000
[BTSBTC] => 0.00002955
[BTSETH] => 0.00042110
[BTSBNB] => 0.01924000
[XZCBTC] => 0.00482600
[XZCETH] => 0.06888600
[XZCBNB] => 3.15300000
[LSKBTC] => 0.00126620
[LSKETH] => 0.01809800
[LSKBNB] => 0.82620000
[TNTBTC] => 0.00001250
[TNTETH] => 0.00017715
[FUELBTC] => 0.00001031
[FUELETH] => 0.00014800
[MANABTC] => 0.00001443
[MANAETH] => 0.00020548
[BCDBTC] => 0.00323800
[BCDETH] => 0.04621000
[DGDBTC] => 0.03029300
[DGDETH] => 0.43139000
[IOTABNB] => 0.13700000
[ADXBTC] => 0.00011171
[ADXETH] => 0.00159340
[ADXBNB] => 0.07260000
[ADABTC] => 0.00003074
[ADAETH] => 0.00043850
[PPTBTC] => 0.00258000
[PPTETH] => 0.03686600
[CMTBTC] => 0.00001736
[CMTETH] => 0.00024806
[CMTBNB] => 0.01125000
[XLMBTC] => 0.00003885
[XLMETH] => 0.00055460
[XLMBNB] => 0.02525000
[CNDBTC] => 0.00001080
[CNDETH] => 0.00015394
[CNDBNB] => 0.00701000
[LENDBTC] => 0.00000841
[LENDETH] => 0.00011958
[WABIBTC] => 0.00014322
[WABIETH] => 0.00203657
[WABIBNB] => 0.09249000
[LTCETH] => 0.23529000
[LTCUSDT] => 154.69000000
[LTCBNB] => 10.64000000
[TNBBTC] => 0.00000543
[TNBETH] => 0.00007750
[WAVESBTC] => 0.00059500
[WAVESETH] => 0.00850900
[WAVESBNB] => 0.38690000
[GTOBTC] => 0.00003844
[GTOETH] => 0.00054884
[GTOBNB] => 0.02507000
[ICXBTC] => 0.00041930
[ICXETH] => 0.00597200
[ICXBNB] => 0.27291000
[OSTBTC] => 0.00002613
[OSTETH] => 0.00037035
[OSTBNB] => 0.01700000
[ELFBTC] => 0.00012100
[ELFETH] => 0.00172716
[AIONBTC] => 0.00042000
[AIONETH] => 0.00602200
[AIONBNB] => 0.27382000
[NEBLBTC] => 0.00135400
[NEBLETH] => 0.01934900
[NEBLBNB] => 0.88284000
[BRDBTC] => 0.00007567
[BRDETH] => 0.00108740
[BRDBNB] => 0.04908000
[MCOBNB] => 0.84339000
[EDOBTC] => 0.00024920
[EDOETH] => 0.00355300
[WINGSBTC] => 0.00006374
[WINGSETH] => 0.00090200
[NAVBTC] => 0.00014570
[NAVETH] => 0.00208700
[NAVBNB] => 0.09503000
[LUNBTC] => 0.00141610
[LUNETH] => 0.02045700
[TRIGBTC] => 0.00016470
[TRIGETH] => 0.00234900
[TRIGBNB] => 0.10765000
[APPCBTC] => 0.00006063
[APPCETH] => 0.00086330
[APPCBNB] => 0.03936000
[VIBEBTC] => 0.00003170
[VIBEETH] => 0.00045090
[RLCBTC] => 0.00015720
[RLCETH] => 0.00224600
[RLCBNB] => 0.10402000
[INSBTC] => 0.00019820
[INSETH] => 0.00281100
[PIVXBTC] => 0.00058340
[PIVXETH] => 0.00829300
[PIVXBNB] => 0.38374000
[IOSTBTC] => 0.00000514
[IOSTETH] => 0.00007331
[CHATBTC] => 0.00001383
[CHATETH] => 0.00019718
[STEEMBTC] => 0.00039480
[STEEMETH] => 0.00562300
[STEEMBNB] => 0.25819000
[NANOBTC] => 0.00082350
[NANOETH] => 0.01174000
[NANOBNB] => 0.53460000
[VIABTC] => 0.00027210
[VIAETH] => 0.00387700
[VIABNB] => 0.17564000
[BLZBTC] => 0.00005665
[BLZETH] => 0.00081270
[BLZBNB] => 0.03671000
[AEBTC] => 0.00026090
[AEETH] => 0.00371600
[AEBNB] => 0.17001000
[RPXBTC] => 0.00001243
[RPXETH] => 0.00017594
[RPXBNB] => 0.00807000
[NCASHBTC] => 0.00000453
[NCASHETH] => 0.00006449
[NCASHBNB] => 0.00294000
[POABTC] => 0.00006407
[POAETH] => 0.00091626
[POABNB] => 0.04210000
[ZILBTC] => 0.00000976
[ZILETH] => 0.00013878
[ZILBNB] => 0.00633000
[ONTBTC] => 0.00055170
[ONTETH] => 0.00784700
[ONTBNB] => 0.35830000
[STORMBTC] => 0.00000719
[STORMETH] => 0.00010265
[STORMBNB] => 0.00466000
[QTUMBNB] => 1.44171000
[QTUMUSDT] => 20.88700000
[XEMBTC] => 0.00004333
[XEMETH] => 0.00061687
[XEMBNB] => 0.02809000
[WANBTC] => 0.00078960
[WANETH] => 0.01126000
[WANBNB] => 0.51178000
[WPRBTC] => 0.00001638
[WPRETH] => 0.00023350
[QLCBTC] => 0.00002336
[QLCETH] => 0.00033090
[SYSBTC] => 0.00005830
[SYSETH] => 0.00083339
[SYSBNB] => 0.03777000
[QLCBNB] => 0.01520000
[GRSBTC] => 0.00015326
[GRSETH] => 0.00217926
[ADAUSDT] => 0.28938000
[ADABNB] => 0.02000000
[CLOAKBTC] => 0.00147990
[CLOAKETH] => 0.02106300
)
Price of BNB: 0.00153920 BTC.
Array
(
[XRP] => Array
(
[available] => 2100.00000000
[onOrder] => 0.00000000
[btcValue] => 0.19349400
[btcTotal] => 0.19349400
)
[BNB] => Array
(
[available] => 28.18310832
[onOrder] => 0.00000000
[btcValue] => 0.04337944
[btcTotal] => 0.04337944
)
[XLM] => Array
(
[available] => 500.78400000
[onOrder] => 0.00000000
[btcValue] => 0.01945546
[btcTotal] => 0.01945546
)
[BTC] => Array
(
[available] => 0.01193513
[onOrder] => 0.00000000
[btcValue] => 0.01193513
[btcTotal] => 0.01193513
)
[ETC] => Array
(
[available] => 3.99600000
[onOrder] => 0.00000000
[btcValue] => 0.00859939
[btcTotal] => 0.00859939
)
[NEO] => Array
(
[available] => 0.99900000
[onOrder] => 0.00000000
[btcValue] => 0.00814185
[btcTotal] => 0.00814185
)
[XVG] => Array
(
[available] => 1000.64200000
[onOrder] => 0.00000000
[btcValue] => 0.00687441
[btcTotal] => 0.00687441
)
[IOST] => Array
(
[available] => 601.03600000
[onOrder] => 399.00000000
[btcValue] => 0.00308933
[btcTotal] => 0.00514019
)
[STORJ] => Array
(
[available] => 0.96700000
[onOrder] => 32.00000000
[btcValue] => 0.00011401
[btcTotal] => 0.00388681
)
[AMB] => Array
(
[available] => 0.94700000
[onOrder] => 52.00000000
[btcValue] => 0.00006434
[btcTotal] => 0.00359722
)
[POWR] => Array
(
[available] => 0.98380000
[onOrder] => 53.00000000
[btcValue] => 0.00005825
[btcTotal] => 0.00319638
)
[AST] => Array
(
[available] => 0.86600000
[onOrder] => 47.00000000
[btcValue] => 0.00005290
[btcTotal] => 0.00292366
)
[BAT] => Array
(
[available] => 0.91500000
[onOrder] => 84.00000000
[btcValue] => 0.00004204
[btcTotal] => 0.00390100
)
[GTO] => Array
(
[available] => 0.88450000
[onOrder] => 85.00000000
[btcValue] => 0.00003400
[btcTotal] => 0.00330140
)
[ADA] => Array
(
[available] => 0.91500000
[onOrder] => 84.00000000
[btcValue] => 0.00002813
[btcTotal] => 0.00261029
)
[BTS] => Array
(
[available] => 0.89200000
[onOrder] => 107.00000000
[btcValue] => 0.00002636
[btcTotal] => 0.00318821
)
[REQ] => Array
(
[available] => 0.92600000
[onOrder] => 73.00000000
[btcValue] => 0.00002485
[btcTotal] => 0.00198417
)
[OST] => Array
(
[available] => 0.92300000
[onOrder] => 76.00000000
[btcValue] => 0.00002412
[btcTotal] => 0.00201000
)
[SNM] => Array
(
[available] => 0.85900000
[onOrder] => 140.00000000
[btcValue] => 0.00001923
[btcTotal] => 0.00315383
)
[QSP] => Array
(
[available] => 0.91200000
[onOrder] => 87.00000000
[btcValue] => 0.00001866
[btcTotal] => 0.00179868
)
[VIB] => Array
(
[available] => 0.68500000
[onOrder] => 106.00000000
[btcValue] => 0.00001475
[btcTotal] => 0.00229693
)
[SNT] => Array
(
[available] => 0.90000000
[onOrder] => 99.00000000
[btcValue] => 0.00001407
[btcTotal] => 0.00156144
)
[USDT] => Array
(
[available] => 0.13056080
[onOrder] => 1248.66000000
[btcValue] => 0.00001387
[btcTotal] => 0.13262347
)
[CMT] => Array
(
[available] => 0.75800000
[onOrder] => 164.00000000
[btcValue] => 0.00001316
[btcTotal] => 0.00286020
)
[RCN] => Array
(
[available] => 0.83400000
[onOrder] => 165.00000000
[btcValue] => 0.00001273
[btcTotal] => 0.00253063
)
[ENJ] => Array
(
[available] => 0.61800000
[onOrder] => 205.00000000
[btcValue] => 0.00000957
[btcTotal] => 0.00318502
)
[CND] => Array
(
[available] => 0.69100000
[onOrder] => 133.00000000
[btcValue] => 0.00000746
[btcTotal] => 0.00144386
)
[LEND] => Array
(
[available] => 0.76500000
[onOrder] => 0.00000000
[btcValue] => 0.00000643
[btcTotal] => 0.00000643
)
[FUN] => Array
(
[available] => 0.61900000
[onOrder] => 380.00000000
[btcValue] => 0.00000316
[btcTotal] => 0.00194116
)
[POE] => Array
(
[available] => 0.45100000
[onOrder] => 548.00000000
[btcValue] => 0.00000273
[btcTotal] => 0.00332361
)
[STAR] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[QTUM] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[IFT] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[UKG] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[VOISE] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[BNC] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[KICK] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[LSK] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[GRX] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[TNB] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[BCD] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[WABI] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[XZC] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[FUEL] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[ALIS] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[GVT] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[BCPT] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[ARN] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[GXS] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[RDN] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[CFD] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[WAVES] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[ETF] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[SBTC] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[POA] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[AE] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[VIA] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[BLZ] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[SYS] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[RPX] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[NCASH] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[ONT] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[STEEM] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[ZIL] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[STORM] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[XEM] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[WAN] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[WPR] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[QLC] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[GRS] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[NANO] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[ETH] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[BCX] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[NEBL] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[PPT] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[ICX] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[ELF] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[AION] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[WINGS] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[BRD] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[NAV] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[PIVX] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[VIBE] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[LUN] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[TRIG] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[APPC] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[CHAT] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[RLC] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[INS] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[OTN] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[QASH] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[MANA] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[KNC] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[LLT] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[TRX] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[FID] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[SNGLS] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[STRAT] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[BQX] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[CDT] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[YOYO] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[456] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[IOTA] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[LINK] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[CVC] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[TNT] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[REP] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[LRC] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[LRX] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[MDA] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[OAX] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[BNT] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[GAS] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[BCC] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[BTM] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[HCC] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[HSR] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[DNT] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[WTC] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[MCO] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[ICN] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[ELC] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[PAY] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[ZRX] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[OMG] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[CTR] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[MTL] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[MCAP] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[LTC] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[CAG] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[EDG] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[ARK] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[ICO] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[MOD] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[AVT] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[KMD] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[EVX] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[EDO] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[EOS] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[SAN] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[DATA] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[DLT] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[GUP] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[VEN] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[XMR] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[SALT] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[PIX] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[NULS] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[SUB] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[STX] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[MTH] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[CAT] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[ADX] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[123] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[BTG] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[ENG] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[ZEC] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[1ST] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[GNT] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[DGD] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[DASH] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
[CLOAK] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
)
One of 3 things double check your api key I have double check the api key and its working.
double check xamp. The ca bundle on the thing is out of date
- I have updated the ca bundle fix and still no go.
clock is wildly off on your machine and useservertime is not doing the job
- It's weird that the old version work fine.
yes, half the time people report issues its related to composer
try this method to get started
git clone https://github.com/jaggedsoft/php-binance-api.git
cd php-binance-api
composer install
php examples/get_prices.php
I ran composer and it installed: C:\Downloads\binance>composer require jaggedsoft/php-binance-api Using version ^0.3.0 for jaggedsoft/php-binance-api ./composer.json has been created Loading composer repositories with package information Updating dependencies (including require-dev) Package operations: 13 installs, 0 updates, 0 removals
what happens when you use my suggested method?
$ git clone https://github.com/jaggedsoft/php-binance-api.git Cloning into 'php-binance-api'... remote: Counting objects: 4397, done. remote: Compressing objects: 100% (262/262), done. remote: Total 4397 (delta 286), reused 167 (delta 100), pack-reused 4018 Receiving objects: 100% (4397/4397), 6.28 MiB | 3.32 MiB/s, done. Resolving deltas: 100% (3357/3357), done.
$ composer install Loading composer repositories with package information Reading composer.json of jaggedsoft/php-binance-api (v0.0.13) Could not fetch https://api.github.com/repos/jaggedsoft/php-binance-api/commits/ 80ca7bdd8a5f46b34ffe78e32dcde75c6e3006b7, please create a GitHub OAuth token to go over the API rate limit Head to https://github.com/settings/tokens/new?scopes=repo&description=Composer+ on+DESKTOP-T9AKC19+2018-04-25+1422 to retrieve a token. It will be stored in "C:/Users/xxxxx/AppData/Roaming/Comp oser/auth.json" for future use by Composer. Token (hidden):
Updating dependencies (including require-dev) Package operations: 45 installs, 0 updates, 0 removals
@jaggedsoft @MrDevBC
These Xampps / Wamps have issues which is unfortunate, because so many of our users use windows and use these install methods.
I'll need to look into some type of travis build for windows.
However if you look below, on linux there is zero issues, even using hte composer method. There is no problem with the code.
Getting started
dave@dave-pc:~/Desktop$ php composer-setup.php
All settings correct for using Composer
Downloading...
Composer (version 1.6.4) successfully installed to: /home/dave/Desktop/composer.phar
Use it: php composer.phar
dave@dave-pc:~/Desktop$ php -r "unlink('composer-setup.php');"
dave@dave-pc:~/Desktop$ chmod +x composer.phar
dave@dave-pc:~/Desktop$ ./composer.phar require jaggedsoft/php-binance-api
Using version ^0.3.0 for jaggedsoft/php-binance-api
./composer.json has been created
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 13 installs, 0 updates, 0 removals
- Installing psr/http-message (1.0.1): Downloading (100%)
- Installing guzzlehttp/psr7 (1.4.2): Downloading (100%)
- Installing ratchet/rfc6455 (v0.2.3): Downloading (100%)
- Installing evenement/evenement (v3.0.1): Downloading (100%)
- Installing react/event-loop (v0.5.2): Downloading (100%)
- Installing react/stream (v0.7.7): Downloading (100%)
- Installing react/promise (v2.5.1): Downloading (100%)
- Installing react/promise-timer (v1.3.0): Downloading (100%)
- Installing react/cache (v0.4.2): Downloading (100%)
- Installing react/dns (v0.4.13): Downloading (100%)
- Installing react/socket (v0.8.11): Downloading (100%)
- Installing ratchet/pawl (v0.3.1): Downloading (100%)
- Installing jaggedsoft/php-binance-api (v0.3.0): Downloading (100%)
react/event-loop suggests installing ext-event (~1.0 for ExtEventLoop)
ratchet/pawl suggests installing reactivex/rxphp (~2.0)
Writing lock file
Generating autoload files
dave@dave-pc:~/Desktop$ ls
code
dave@dave-pc:~/Desktop$ cat test.php
<?php
require 'vendor/autoload.php';
$apikey = "z5RQZ9n8JcS3HLDQmPpfLQIGGQN6TTs5pCP5CTnn4nYk2ImFcew49v4ZrmP3MGl5";
$apisecret = "ZqePF1DcLb6Oa0CfcLWH0Tva59y8qBBIqu789JEY27jq0RkOKXpNl9992By1PN9Z";
$config_file = getenv("HOME") . "/.config/jaggedsoft/php-binance-api.json";
file_put_contents($config_file, "{ \"api-key\": \"" . $apikey . "\", \"api-secret\": \"" . $apisecret . "\" }");
$api = new Binance\API();
$ticker = $api->prices();
print_r($ticker); // List prices of all symbols
echo "Price of BNB: {$ticker['BNBBTC']} BTC.\n";
$balances = $api->balances($ticker);
print_r($balances);
result
dave@dave-pc:~/Desktop$ php test.php
Array
(
[ETHBTC] => 0.06791000
[XEMBTC] => 0.00004023
..........
[XEMETH] => 0.00059661
[XEMBNB] => 0.02719000
)
Price of BNB: 0.00148310 BTC.
Array
(
[BTC] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
.........................
[STORM] => Array
(
[available] => 0.00000000
[onOrder] => 0.00000000
[btcValue] => 0
[btcTotal] => 0
)
)
Array ( [ETHBTC] => 0.06809700 [LTCBTC] => 0.01627700 [BNBBTC] => 0.00148990 [NEOBTC] => 0.00787700 [QTUMETH] => 0.03065400 [EOSETH] => 0.02219300 [SNTETH] => 0.00021516 [BNTETH] => 0.00678400 [BCCBTC] => 0.14080600 [GASBTC] => 0.00276500 [BNBETH] => 0.02183200 [BTCUSDT] => 8860.49000000 [ETHUSDT] => 602.74000000 [HSRBTC] => 0.00097500 [OAXETH] => 0.00113450 [DNTETH] => 0.00014635 [MCOETH] => 0.01805000 [ICNETH] => 0.00217510 [MCOBTC] => 0.00122500 [WTCBTC] => 0.00141000 [WTCETH] => 0.02066000 [LRCBTC] => 0.00007668 [LRCETH] => 0.00112305 [QTUMBTC] => 0.00208500 [YOYOBTC] => 0.00001262 [OMGBTC] => 0.00168600 [OMGETH] => 0.02485900 [ZRXBTC] => 0.00010511 [ZRXETH] => 0.00154759 [STRATBTC] => 0.00063070 [STRATETH] => 0.00930200 [SNGLSBTC] => 0.00000978 [SNGLSETH] => 0.00014365 [BQXBTC] => 0.00034107 [BQXETH] => 0.00501070 [KNCBTC] => 0.00020178 [KNCETH] => 0.00295060 [FUNBTC] => 0.00000466 [FUNETH] => 0.00006850 [SNMBTC] => 0.00002185 [SNMETH] => 0.00032056 [NEOETH] => 0.11569300 [IOTABTC] => 0.00019690 [IOTAETH] => 0.00290583 [LINKBTC] => 0.00004903 [LINKETH] => 0.00072361 [XVGBTC] => 0.00000678 [XVGETH] => 0.00009942 [SALTBTC] => 0.00037990 [SALTETH] => 0.00558300 [MDABTC] => 0.00011816 [MDAETH] => 0.00174070 [MTLBTC] => 0.00048780 [MTLETH] => 0.00718100 [SUBBTC] => 0.00007170 [SUBETH] => 0.00105500 [EOSBTC] => 0.00150870 [SNTBTC] => 0.00001460 [ETCETH] => 0.03021100 [ETCBTC] => 0.00205900 [MTHBTC] => 0.00001226 [MTHETH] => 0.00018002 [ENGBTC] => 0.00024869 [ENGETH] => 0.00365440 [DNTBTC] => 0.00001000 [ZECBTC] => 0.03028400 [ZECETH] => 0.44600000 [BNTBTC] => 0.00046338 [ASTBTC] => 0.00005680 [ASTETH] => 0.00083730 [DASHBTC] => 0.05153300 [DASHETH] => 0.75770000 [OAXBTC] => 0.00007700 [ICNBTC] => 0.00014741 [BTGBTC] => 0.00764600 [BTGETH] => 0.11200100 [EVXBTC] => 0.00016394 [EVXETH] => 0.00240340 [REQBTC] => 0.00002480 [REQETH] => 0.00036549 [VIBBTC] => 0.00002042 [VIBETH] => 0.00029810 [HSRETH] => 0.01440300 [TRXBTC] => 0.00000748 [TRXETH] => 0.00011004 [POWRBTC] => 0.00005616 [POWRETH] => 0.00082565 [ARKBTC] => 0.00034010 [ARKETH] => 0.00502400 [YOYOETH] => 0.00018508 [XRPBTC] => 0.00008690 [XRPETH] => 0.00127699 [MODBTC] => 0.00027520 [MODETH] => 0.00403400 [ENJBTC] => 0.00001480 [ENJETH] => 0.00021843 [STORJBTC] => 0.00011051 [STORJETH] => 0.00162730 [BNBUSDT] => 13.21060000 [VENBNB] => 0.27450000 [YOYOBNB] => 0.00857000 [POWRBNB] => 0.03780000 [VENBTC] => 0.00040766 [VENETH] => 0.00599741 [KMDBTC] => 0.00039140 [KMDETH] => 0.00574900 [NULSBNB] => 0.20010000 [RCNBTC] => 0.00001422 [RCNETH] => 0.00020849 [RCNBNB] => 0.00953000 [NULSBTC] => 0.00029828 [NULSETH] => 0.00439188 [RDNBTC] => 0.00020948 [RDNETH] => 0.00306930 [RDNBNB] => 0.14062000 [XMRBTC] => 0.02837100 [XMRETH] => 0.41527000 [DLTBNB] => 0.01919000 [WTCBNB] => 0.95200000 [DLTBTC] => 0.00002851 [DLTETH] => 0.00042029 [AMBBTC] => 0.00006202 [AMBETH] => 0.00091421 [AMBBNB] => 0.04235000 [BCCETH] => 2.06517000 [BCCUSDT] => 1245.55000000 [BCCBNB] => 94.92000000 [BATBTC] => 0.00004354 [BATETH] => 0.00063765 [BATBNB] => 0.02924000 [BCPTBTC] => 0.00005899 [BCPTETH] => 0.00086500 [BCPTBNB] => 0.03975000 [ARNBTC] => 0.00016505 [ARNETH] => 0.00242803 [GVTBTC] => 0.00221800 [GVTETH] => 0.03249800 [CDTBTC] => 0.00000617 [CDTETH] => 0.00009094 [GXSBTC] => 0.00036790 [GXSETH] => 0.00542000 [NEOUSDT] => 69.62900000 [NEOBNB] => 5.29800000 [POEBTC] => 0.00000563 [POEETH] => 0.00008268 [QSPBTC] => 0.00001926 [QSPETH] => 0.00028149 [QSPBNB] => 0.01300000 [BTSBTC] => 0.00002819 [BTSETH] => 0.00041288 [BTSBNB] => 0.01893000 [XZCBTC] => 0.00447500 [XZCETH] => 0.06569000 [XZCBNB] => 3.03700000 [LSKBTC] => 0.00119860 [LSKETH] => 0.01761100 [LSKBNB] => 0.80410000 [TNTBTC] => 0.00001180 [TNTETH] => 0.00017308 [FUELBTC] => 0.00000962 [FUELETH] => 0.00014134 [MANABTC] => 0.00001396 [MANAETH] => 0.00020534 [BCDBTC] => 0.00318300 [BCDETH] => 0.04669000 [DGDBTC] => 0.02886900 [DGDETH] => 0.42314000 [IOTABNB] => 0.13233000 [ADXBTC] => 0.00010198 [ADXETH] => 0.00149560 [ADXBNB] => 0.06876000 [ADABTC] => 0.00002969 [ADAETH] => 0.00043516 [PPTBTC] => 0.00238790 [PPTETH] => 0.03528300 [CMTBTC] => 0.00001614 [CMTETH] => 0.00023715 [CMTBNB] => 0.01085000 [XLMBTC] => 0.00003690 [XLMETH] => 0.00054201 [XLMBNB] => 0.02480000 [CNDBTC] => 0.00001017 [CNDETH] => 0.00014951 [CNDBNB] => 0.00686000 [LENDBTC] => 0.00000784 [LENDETH] => 0.00011570 [WABIBTC] => 0.00012948 [WABIETH] => 0.00190000 [WABIBNB] => 0.08690000 [LTCETH] => 0.23885000 [LTCUSDT] => 143.29000000 [LTCBNB] => 10.88000000 [TNBBTC] => 0.00000519 [TNBETH] => 0.00007643 [WAVESBTC] => 0.00057230 [WAVESETH] => 0.00838400 [WAVESBNB] => 0.38590000 [GTOBTC] => 0.00003429 [GTOETH] => 0.00050190 [GTOBNB] => 0.02300000 [ICXBTC] => 0.00040260 [ICXETH] => 0.00592600 [ICXBNB] => 0.27000000 [OSTBTC] => 0.00002479 [OSTETH] => 0.00036356 [OSTBNB] => 0.01665000 [ELFBTC] => 0.00011393 [ELFETH] => 0.00167530 [AIONBTC] => 0.00037550 [AIONETH] => 0.00551600 [AIONBNB] => 0.25314000 [NEBLBTC] => 0.00128010 [NEBLETH] => 0.01879700 [NEBLBNB] => 0.86272000 [BRDBTC] => 0.00007316 [BRDETH] => 0.00107680 [BRDBNB] => 0.04938000 [MCOBNB] => 0.82954000 [EDOBTC] => 0.00023120 [EDOETH] => 0.00339200 [WINGSBTC] => 0.00005972 [WINGSETH] => 0.00087340 [NAVBTC] => 0.00013560 [NAVETH] => 0.00199100 [NAVBNB] => 0.09135000 [LUNBTC] => 0.00135850 [LUNETH] => 0.01975900 [TRIGBTC] => 0.00015610 [TRIGETH] => 0.00230900 [TRIGBNB] => 0.10486000 [APPCBTC] => 0.00005684 [APPCETH] => 0.00083590 [APPCBNB] => 0.03858000 [VIBEBTC] => 0.00002948 [VIBEETH] => 0.00043490 [RLCBTC] => 0.00014450 [RLCETH] => 0.00215400 [RLCBNB] => 0.09754000 [INSBTC] => 0.00018830 [INSETH] => 0.00276900 [PIVXBTC] => 0.00055520 [PIVXETH] => 0.00817100 [PIVXBNB] => 0.37511000 [IOSTBTC] => 0.00000490 [IOSTETH] => 0.00007200 [CHATBTC] => 0.00001326 [CHATETH] => 0.00019521 [STEEMBTC] => 0.00038170 [STEEMETH] => 0.00560100 [STEEMBNB] => 0.25604000 [NANOBTC] => 0.00075930 [NANOETH] => 0.01117200 [NANOBNB] => 0.50990000 [VIABTC] => 0.00024940 [VIAETH] => 0.00369800 [VIABNB] => 0.16790000 [BLZBTC] => 0.00005347 [BLZETH] => 0.00078462 [BLZBNB] => 0.03583000 [AEBTC] => 0.00024780 [AEETH] => 0.00364200 [AEBNB] => 0.16898000 [RPXBTC] => 0.00001159 [RPXETH] => 0.00017003 [RPXBNB] => 0.00777000 [NCASHBTC] => 0.00000435 [NCASHETH] => 0.00006374 [NCASHBNB] => 0.00292000 [POABTC] => 0.00006002 [POAETH] => 0.00088337 [POABNB] => 0.04041000 [ZILBTC] => 0.00000905 [ZILETH] => 0.00013290 [ZILBNB] => 0.00604000 [ONTBTC] => 0.00051790 [ONTETH] => 0.00762000 [ONTBNB] => 0.34800000 [STORMBTC] => 0.00000716 [STORMETH] => 0.00010525 [STORMBNB] => 0.00482000 [QTUMBNB] => 1.39587000 [QTUMUSDT] => 18.50900000 [XEMBTC] => 0.00003991 [XEMETH] => 0.00059002 [XEMBNB] => 0.02716000 [WANBTC] => 0.00077630 [WANETH] => 0.01139900 [WANBNB] => 0.52104000 [WPRBTC] => 0.00001600 [WPRETH] => 0.00023485 [QLCBTC] => 0.00002110 [QLCETH] => 0.00031147 [SYSBTC] => 0.00005450 [SYSETH] => 0.00079868 [SYSBNB] => 0.03680000 [QLCBNB] => 0.01416000 [GRSBTC] => 0.00014153 [GRSETH] => 0.00208805 [ADAUSDT] => 0.26135000 [ADABNB] => 0.01990000 [CLOAKBTC] => 0.00137160 [CLOAKETH] => 0.02023500 )
Price of BNB: 0.00148990 BTC. balanceData error: Please make sure your system time is synchronized, or pass the useServerTime option. balanceData error: Please make sure your system time is synchronized, or pass the useServerTime option. 143.29000000
I have even try using Linux web hosting and still getting: signedRequest error: {"code":-1022,"msg":"Signature for this request is not valid."} balanceData error: Please make sure your system time is synchronized, or pass the useServerTime option. 145.04000000
this error is output when the array you pass into balances( $arr ) is empty or null.
Check your array
if (empty($array) || empty($array['balances'])) {
// WPCS: XSS OK.
echo "balanceData error: Please make sure your system time is synchronized, or pass the useServerTime option." . PHP_EOL;
return [];
}
i'm using the following code:
// Get all of your positions, including estimated BTC value $balances = $api->balances($ticker); //print_r($balances);
$ticker = $api->prices(); $balances = $api->balances($ticker); $BTCUSDT = $ticker['BTCUSDT']; $ETHUSDT = $ticker['ETHUSDT']; $LTCUSDT = $ticker['LTCUSDT'];
Can you pull the latest version please?
added an additional check for your balance information
https://github.com/jaggedsoft/php-binance-api/commit/0be3376ba9a71f26fdcd39a74d405594811efa9a
git clone https://github.com/jaggedsoft/php-binance-api.git
it's working now!!!... It was my api all this time -_-..
I'm so sorry guys..
Do you guys have api checking to make it correct?
I think it would be a good thing to have....
https://travis-ci.org/jaggedsoft/php-binance-api
Yes travis automatically checks php v7.0 v7.1 v7.2 and php nightly.
See the link
@jaggedsoft
Thank you for your help @dmzoneill I really appreciate everything you are doing to help people and help this project. You are outstanding
@MrDevBC it was the api key? Maybe we can make the error message more friendly
I have installed this on windows with no problems, not using XAMPP though. Just php
@jaggedsoft Yes it was the api keys. Maybe you can make a more friendly error message saying: Invalid API/Secret keys. Please check your keys and try again.
Getting signedRequest error: {"code":-1022,"msg":"Signature for this request is not valid."} balanceData error: Please make sure your system time is synchronized, or pass the useServerTime option.
I have try using the useServerTime too but no luck
Platform:
php version:
code
thank you