-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4e6fedb
commit 9e733bc
Showing
4 changed files
with
120 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
|
||
/** | ||
* @author lin <[email protected]> | ||
* | ||
* Fill in your key and secret and pass can be directly run | ||
* | ||
* Most of them are unfinished and need your help | ||
* https://github.com/zhouaini528/Mxc-php.git | ||
* */ | ||
use Lin\Mxc\MxcSpotV3; | ||
|
||
require __DIR__ .'../../../vendor/autoload.php'; | ||
|
||
include 'key_secret.php'; | ||
|
||
$mexc=new MxcSpotV3($key,$secret); | ||
|
||
//You can set special needs | ||
$mexc->setOptions([ | ||
//Set the request timeout to 60 seconds by default | ||
'timeout'=>10, | ||
|
||
]); | ||
|
||
try { | ||
$result=$mexc->privates()->getAccount(); | ||
print_r($result); | ||
}catch (\Exception $e){ | ||
print_r(json_decode($e->getMessage(),true)); | ||
} | ||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
<?php | ||
|
||
|
||
/** | ||
* @author lin <[email protected]> | ||
* | ||
* Fill in your key and secret and pass can be directly run | ||
* | ||
* Most of them are unfinished and need your help | ||
* https://github.com/zhouaini528/Mxc-php.git | ||
* */ | ||
use Lin\Mxc\MxcSpotV3; | ||
|
||
require __DIR__ .'../../../vendor/autoload.php'; | ||
|
||
include 'key_secret.php'; | ||
|
||
$mexc=new MxcSpotV3(); | ||
|
||
//You can set special needs | ||
$mexc->setOptions([ | ||
//Set the request timeout to 60 seconds by default | ||
'timeout'=>10, | ||
|
||
]); | ||
/* | ||
try { | ||
$result=$mexc->publics()->getTime(); | ||
print_r($result); | ||
}catch (\Exception $e){ | ||
print_r($e->getMessage()); | ||
} | ||
//try { | ||
// $result=$mexc->publics()->getExchangeInfo(); | ||
// print_r($result); | ||
//}catch (\Exception $e){ | ||
// print_r($e->getMessage()); | ||
//} | ||
try { | ||
$result=$mexc->publics()->getDepth([ | ||
'symbol'=>'BTCUSDT', | ||
'limit'=>10 | ||
]); | ||
print_r($result); | ||
}catch (\Exception $e){ | ||
print_r($e->getMessage()); | ||
} | ||
try { | ||
$result=$mexc->publics()->getTrades([ | ||
'symbol'=>'BTCUSDT', | ||
'limit'=>10 | ||
]); | ||
print_r($result); | ||
}catch (\Exception $e){ | ||
print_r($e->getMessage()); | ||
} | ||
*/ | ||
try { | ||
$result=$mexc->publics()->getKline([ | ||
'symbol'=>'BTCUSDT', | ||
'interval'=>'60m' | ||
]); | ||
print_r($result); | ||
}catch (\Exception $e){ | ||
print_r($e->getMessage()); | ||
} | ||
|