-
Notifications
You must be signed in to change notification settings - Fork 21
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
236cb35
commit 989d3a1
Showing
3 changed files
with
85 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
/** | ||
* @author lin <[email protected]> | ||
* */ | ||
|
||
namespace Lin\Okex\Api\AccountV3; | ||
|
||
use Lin\Okex\Request; | ||
|
||
class Account extends Request | ||
{ | ||
/** | ||
* GET /api/account/v3/uid | ||
* */ | ||
public function getUid(array $data=[]){ | ||
$this->type='GET'; | ||
$this->path='/api/account/v3/uid'; | ||
$this->data=$data; | ||
return $this->exec(); | ||
} | ||
|
||
/** | ||
* POST/api/account/v3/purchase_redempt | ||
* */ | ||
public function postPurchaseRedempt(array $data=[]){ | ||
$this->type='POST'; | ||
$this->path='/api/account/v3/purchase_redempt'; | ||
$this->data=$data; | ||
return $this->exec(); | ||
} | ||
} |
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,47 @@ | ||
<?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/okex-php.git | ||
* */ | ||
use Lin\Okex\OkexAccount; | ||
|
||
require __DIR__ .'../../../vendor/autoload.php'; | ||
|
||
include 'key_secret.php'; | ||
|
||
$okex=new OkexAccount($key,$secret,$passphrase); | ||
|
||
//You can set special needs | ||
$okex->setOptions([ | ||
//Set the request timeout to 60 seconds by default | ||
'timeout'=>10, | ||
|
||
//If you are developing locally and need an agent, you can set this | ||
//'proxy'=>true, | ||
//More flexible Settings | ||
/* 'proxy'=>[ | ||
'http' => 'http://127.0.0.1:12333', | ||
'https' => 'http://127.0.0.1:12333', | ||
'no' => ['.cn'] | ||
], */ | ||
//Close the certificate | ||
//'verify'=>false, | ||
]); | ||
|
||
// | ||
try { | ||
$result=$okex->account()->getUid(); | ||
print_r($result); | ||
}catch (\Exception $e){ | ||
print_r(json_decode($e->getMessage(),true)); | ||
} | ||
|
||
|
||
|
||
|