-
Notifications
You must be signed in to change notification settings - Fork 23
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
Showing
8 changed files
with
161 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
|
||
require_once __DIR__ . '/../../../vendor/autoload.php'; | ||
|
||
$key = ''; | ||
$secret = ''; | ||
|
||
$client = new \Binance\Spot([ | ||
'key' => $key, | ||
'secret' => $secret | ||
]); | ||
|
||
$response = $client->marginDustLog( | ||
[ | ||
'startTime' => 1640995200000, | ||
'endTime' => 1640995200000, | ||
'recvWindow' => 5000 | ||
] | ||
); | ||
|
||
echo json_encode($response); |
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,15 @@ | ||
<?php | ||
|
||
require_once __DIR__ . '/../../../vendor/autoload.php'; | ||
|
||
$key = ''; | ||
$secret = ''; | ||
|
||
$client = new \Binance\Spot([ | ||
'key' => $key, | ||
'secret' => $secret | ||
]); | ||
|
||
$response = $client->userAsset(); | ||
|
||
echo json_encode($response); |
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
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,40 @@ | ||
<?php | ||
|
||
use Binance\Tests\BaseTestCase; | ||
use Aeris\GuzzleHttpMock\Expect; | ||
use Binance\Exception\MissingArgumentException; | ||
|
||
class MarginDustLogTest extends BaseTestCase | ||
{ | ||
public function setUp(): void | ||
{ | ||
parent::setUp(); | ||
} | ||
|
||
public function testMarginDustLog() | ||
{ | ||
$this->httpMock | ||
->shouldReceiveRequest() | ||
->withUrl(new Expect\Equals('/sapi/v1/margin/dribblet')) | ||
->withMethod('GET') | ||
->withQueryParams(new Expect\ArrayEquals([ | ||
'startTime' => 1640995200000, | ||
'endTime' => 1640995200000, | ||
'recvWindow' => 5000 | ||
])) | ||
->andRespondWithJson($this->data, $statusCode = 200); | ||
|
||
$response = $this->spotClient->marginDustLog([ | ||
'startTime' => 1640995200000, | ||
'endTime' => 1640995200000, | ||
'recvWindow' => 5000 | ||
]); | ||
|
||
$this->assertEquals($response, $this->data); | ||
} | ||
|
||
public function tearDown(): void | ||
{ | ||
parent::tearDown(); | ||
} | ||
} |
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,40 @@ | ||
<?php | ||
|
||
use Binance\Tests\BaseTestCase; | ||
use Aeris\GuzzleHttpMock\Expect; | ||
use Binance\Exception\MissingArgumentException; | ||
|
||
class UserAssetTest extends BaseTestCase | ||
{ | ||
public function setUp(): void | ||
{ | ||
parent::setUp(); | ||
} | ||
|
||
public function testUserAsset() | ||
{ | ||
$this->httpMock | ||
->shouldReceiveRequest() | ||
->withUrl(new Expect\Equals('/sapi/v3/asset/getUserAsset')) | ||
->withMethod('POST') | ||
->withQueryParams(new Expect\ArrayEquals([ | ||
'asset' => 'BTC', | ||
'needBtcValuation' => 'true', | ||
'recvWindow' => '5000' | ||
]), ['timestamp', 'signature']) | ||
->andRespondWithJson($this->data, $statusCode = 200); | ||
|
||
$response = $this->spotClient->userAsset([ | ||
'asset' => 'BTC', | ||
'needBtcValuation' => true, | ||
'recvWindow' => 5000 | ||
]); | ||
|
||
$this->assertEquals($response, $this->data); | ||
} | ||
|
||
public function tearDown(): void | ||
{ | ||
parent::tearDown(); | ||
} | ||
} |