|
| 1 | +# MEXC-API PHP |
| 2 | +lib mexc api simples, para ver detalhes da conta, saldo spot, withdraw |
| 3 | +info token, etc... |
| 4 | + |
| 5 | +# Instalação |
| 6 | + |
| 7 | +```shell |
| 8 | +composer require wilianmaique/php-mexc-api-v3 |
| 9 | +``` |
| 10 | + |
| 11 | +# Como usar |
| 12 | + |
| 13 | +add to your config |
| 14 | +```shell |
| 15 | +const MEXC_CONFIG = [ |
| 16 | + 'MEXC_URL_API' => 'https://api.mexc.com/api/v3', |
| 17 | + 'MEXC_API_ACCESS_KEY' => 'xxxxxx', |
| 18 | + 'MEXC_API_SECRET' => 'xxxxxxxxxxxxxxxxx' |
| 19 | +]; |
| 20 | +``` |
| 21 | + |
| 22 | +Account::get() |
| 23 | +```PHP |
| 24 | +<?php |
| 25 | +require __DIR__ . '/vendor/autoload.php'; |
| 26 | + |
| 27 | +use WilianMaique\Mexc\Mexc\Account; |
| 28 | + |
| 29 | +// detail account |
| 30 | +var_dump(Account::get()); |
| 31 | + |
| 32 | +//output |
| 33 | + |
| 34 | +/* |
| 35 | +array (size=11) |
| 36 | + 'makerCommission' => int 0 |
| 37 | + 'takerCommission' => int 0 |
| 38 | + 'buyerCommission' => int 0 |
| 39 | + 'sellerCommission' => int 0 |
| 40 | + 'canTrade' => boolean true |
| 41 | + 'canWithdraw' => boolean true |
| 42 | + 'canDeposit' => boolean true |
| 43 | + 'updateTime' => null |
| 44 | + 'accountType' => string 'SPOT' (length=4) |
| 45 | + 'balances' => |
| 46 | + array (size=2) |
| 47 | + 0 => |
| 48 | + array (size=3) |
| 49 | + 'asset' => string 'USDT' (length=4) |
| 50 | + 'free' => string '0.000000006' (length=11) |
| 51 | + 'locked' => string '0' (length=1) |
| 52 | + 1 => |
| 53 | + array (size=3) |
| 54 | + 'asset' => string 'BNB' (length=3) |
| 55 | + 'free' => string '0.000244271466267283' (length=20) |
| 56 | + 'locked' => string '0' (length=1) |
| 57 | + 'permissions' => |
| 58 | + array (size=1) |
| 59 | + 0 => string 'SPOT' (length=4) |
| 60 | +*/ |
| 61 | +``` |
| 62 | + |
| 63 | +InfoToken::get('WEMIX') |
| 64 | +```PHP |
| 65 | +<?php |
| 66 | +require __DIR__ . '/vendor/autoload.php'; |
| 67 | + |
| 68 | +use WilianMaique\Mexc\Mexc\InfoToken; |
| 69 | + |
| 70 | +// get info by token name or all tokens |
| 71 | +var_dump(InfoToken::get('WEMIX')); |
| 72 | + |
| 73 | +//output |
| 74 | + |
| 75 | +/* |
| 76 | +array (size=3) |
| 77 | + 'coin' => string 'WEMIX' (length=5) |
| 78 | + 'name' => string 'WEMIX TOKEN' (length=11) |
| 79 | + 'networkList' => |
| 80 | + array (size=1) |
| 81 | + 0 => |
| 82 | + array (size=15) |
| 83 | + 'coin' => string 'WEMIX' (length=5) |
| 84 | + 'depositDesc' => null |
| 85 | + 'depositEnable' => boolean true |
| 86 | + 'minConfirm' => int 60 |
| 87 | + 'name' => string 'WEMIX TOKEN' (length=11) |
| 88 | + 'network' => string 'WEMIX' (length=5) |
| 89 | + 'withdrawEnable' => boolean true |
| 90 | + 'withdrawFee' => string '0.100000000000000000' (length=20) |
| 91 | + 'withdrawIntegerMultiple' => null |
| 92 | + 'withdrawMax' => string '550000.000000000000000000' (length=25) |
| 93 | + 'withdrawMin' => string '1.000000000000000000' (length=20) |
| 94 | + 'sameAddress' => boolean false |
| 95 | + 'contract' => string '' (length=0) |
| 96 | + 'withdrawTips' => null |
| 97 | + 'depositTips' => null |
| 98 | +*/ |
| 99 | +``` |
| 100 | + |
| 101 | +# |
| 102 | +# All functions.... |
| 103 | + |
| 104 | +```PHP |
| 105 | +Account::get(); // get detail account |
| 106 | +Account::getSpotBalance(); // get balance by asset, null to list all |
| 107 | +InfoToken::get(); // get info token, null to list all |
| 108 | +PriceTicker::get(); // get price by token, null to list all |
| 109 | +Withdraw::withdraw('WEMIX', 'WEMIX', 'xxxxxxxx', '1.0'); // send crypto to any wallet, if ok [id] returns |
| 110 | +Withdraw::history('WEMIX', 'c3bbe527692742cc95e64f999dfda324'); // get all history, if 'withdrawId' is not defined list all |
| 111 | +``` |
0 commit comments