Skip to content

Commit

Permalink
get user uid
Browse files Browse the repository at this point in the history
  • Loading branch information
zhouaini528 committed Mar 17, 2021
1 parent 9ce9f37 commit 4204551
Show file tree
Hide file tree
Showing 2 changed files with 100 additions and 16 deletions.
62 changes: 46 additions & 16 deletions src/Api/Spot/Subuser.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,26 @@

class Subuser extends Request
{
/**
*POST /v2/sub-user/deduct-mode
* */
public function postDeductMode(array $data=[]){
$this->type='POST';
$this->path='/v2/sub-user/deduct-mode';
$this->data=$data;
return $this->exec();
}

/**
*
* */
public function post(array $data=[]){
$this->type='POST';
$this->path='';
$this->data=$data;
return $this->exec();
}

/**
*POST /v2/sub-user/creation
* */
Expand All @@ -20,7 +40,7 @@ public function postCreation(array $data=[]){
$this->data=$data;
return $this->exec();
}

/**
*GET /v2/sub-user/user-list
* */
Expand All @@ -30,7 +50,7 @@ public function getUserList(array $data=[]){
$this->data=$data;
return $this->exec();
}

/**
*POST /v2/sub-user/management
* */
Expand All @@ -40,7 +60,7 @@ public function getManagement(array $data=[]){
$this->data=$data;
return $this->exec();
}

/**
*GET /v2/sub-user/user-state
* */
Expand All @@ -50,7 +70,7 @@ public function getUserState(array $data=[]){
$this->data=$data;
return $this->exec();
}

/**
*POST /v2/sub-user/tradable-market
* */
Expand All @@ -60,7 +80,7 @@ public function postTradableMarket(array $data=[]){
$this->data=$data;
return $this->exec();
}

/**
*POST /v2/sub-user/transferability
* */
Expand All @@ -70,7 +90,7 @@ public function postTransferability(array $data=[]){
$this->data=$data;
return $this->exec();
}

/**
*GET /v2/sub-user/account-list
* */
Expand All @@ -80,7 +100,7 @@ public function getAccountList(array $data=[]){
$this->data=$data;
return $this->exec();
}

/**
*POST /v2/sub-user/api-key-generation
* */
Expand All @@ -90,7 +110,17 @@ public function postApiKeyGeneration(array $data=[]){
$this->data=$data;
return $this->exec();
}


/**
*GET /v2/user/uid
* */
public function getUid(array $data=[]){
$this->type='GET';
$this->path='/v2/user/uid';
$this->data=$data;
return $this->exec();
}

/**
*GET /v2/user/api-key
* */
Expand All @@ -100,7 +130,7 @@ public function getApiKey(array $data=[]){
$this->data=$data;
return $this->exec();
}

/**
*POST /v2/sub-user/api-key-modification
* */
Expand All @@ -110,7 +140,7 @@ public function postApiKeyModification(array $data=[]){
$this->data=$data;
return $this->exec();
}

/**
*POST /v2/sub-user/api-key-deletion
* */
Expand All @@ -120,7 +150,7 @@ public function getApiKeyDeletion(array $data=[]){
$this->data=$data;
return $this->exec();
}

/**
*POST /v1/subuser/transfer
* */
Expand All @@ -130,7 +160,7 @@ public function postTransfer(array $data=[]){
$this->data=$data;
return $this->exec();
}

/**
*GET /v2/sub-user/deposit-address
* */
Expand All @@ -140,7 +170,7 @@ public function getDepositAddress(array $data=[]){
$this->data=$data;
return $this->exec();
}

/**
*GET /v2/sub-user/query-deposit
* */
Expand All @@ -150,7 +180,7 @@ public function getQueryDeposit(array $data=[]){
$this->data=$data;
return $this->exec();
}

/**
*GET /v1/subuser/aggregate-balance
* */
Expand All @@ -160,7 +190,7 @@ public function getAggregateBalance(array $data=[]){
$this->data=$data;
return $this->exec();
}

/**
*GET /v1/account/accounts/{sub-uid}
* */
Expand All @@ -170,4 +200,4 @@ public function getAccounts(array $data=[]){
$this->data=$data;
return $this->exec();
}
}
}
54 changes: 54 additions & 0 deletions tests/spot/subuser.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<?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/huobi-php.git
* */
use Lin\Huobi\HuobiSpot;

require __DIR__ .'../../../vendor/autoload.php';

include 'key_secret.php';

$huobi=new HuobiSpot($key,$secret);

//You can set special needs
$huobi->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=$huobi->subuser()->getUid();
print_r($result);
}catch (\Exception $e){
print_r(json_decode($e->getMessage(),true));
}

try {
$result=$huobi->subuser()->getApiKey([
'uid'=>'11111111',
]);
print_r($result);
}catch (\Exception $e){
print_r(json_decode($e->getMessage(),true));
}


0 comments on commit 4204551

Please sign in to comment.