Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

api posttransfer problem #9

Open
tellocan opened this issue Dec 18, 2021 · 12 comments
Open

api posttransfer problem #9

tellocan opened this issue Dec 18, 2021 · 12 comments

Comments

@tellocan
Copy link

with a code like this, the request returns empty

$key = 'xx';
$secret = 'xx;
$account_id = '00';

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

try {
$result=$huobi->account()->get();
print_r($result);
}catch (\Exception $e){
print_r(json_decode($e->getMessage(),true));
}

try {
$result=$huobi->account()->postTransfer([
'from-user'=>'xx',
'from-account-type'=>'spot',
'from-account'=>'xx',
'to-user'=>'xx',
'to-account-type'=>'spot',
'to-account'=>'xx',
'currency'=>'USDT',
'amount'=>'20',
]);
echo($result);
}catch (\Exception $e){
print_r($e->getMessage());
}

@zhouaini528
Copy link
Owner

with a code like this, the request returns empty

I can return the results after the test, but I didn't succeed.

{"status":"error","err-code":"gateway-internal-error","err-msg":"Failed to load data. Try again later.","data":null,"_method":"POST","_url":"https://api.huobi.pro/v1/account

@tellocan
Copy link
Author

with a code like this, the request returns empty

I can return the results after the test, but I didn't succeed.

{"status":"error","err-code":"gateway-internal-error","err-msg":"Failed to load data. Try again later.","data":null,"_method":"POST","_url":"https://api.huobi.pro/v1/account

I am not returning any error codes. Can you share the php code where you got this error code?

@zhouaini528
Copy link
Owner

I am not returning any error codes. Can you share the php code where you got this error code?

$key='******';
$secret='******';
$parent_account_id='37***47';
$child_account_id='203***31';

try {
    $result=$huobi->account()->postTransfer([
        'from-user'=>'419***55',//this is parent account number UID
        'from-account-type'=>'spot',
        'from-account'=>$parent_account_id,//parent account get via API
        'to-user'=>'193***246',//this is child account number UID
        'to-account-type'=>'spot',
        'to-account'=>$child_account_id,//child account get via API
        'currency'=>'usdt',
        'amount'=>'1',
    ]);
    echo($result);
}catch (\Exception $e){
    print_r($e->getMessage());
}

Uid can only be viewed by logging in to the exchange.

@tellocan
Copy link
Author

tellocan commented Dec 20, 2021

I am not returning any error codes. Can you share the php code where you got this error code?

$key='******';
$secret='******';
$parent_account_id='37***47';
$child_account_id='203***31';

try {
    $result=$huobi->account()->postTransfer([
        'from-user'=>'419***55',//this is parent account number UID
        'from-account-type'=>'spot',
        'from-account'=>$parent_account_id,//parent account get via API
        'to-user'=>'193***246',//this is child account number UID
        'to-account-type'=>'spot',
        'to-account'=>$child_account_id,//child account get via API
        'currency'=>'usdt',
        'amount'=>'1',
    ]);
    echo($result);
}catch (\Exception $e){
    print_r($e->getMessage());
}

Uid can only be viewed by logging in to the exchange.

use Lin\Huobi\HuobiSpot;

require './vendor/autoload.php';
$key = '5f833cfc-xxx-d83a59fd-eab13';
$secret = '45cc2fb3-xx-e84c4b21-a25b1';
$account_id = '379xxx64';

$huobi=new HuobiSpot($key,$secret);
try {
$result=$huobi->account()->get();
// print_r($result);
}catch (\Exception $e){
print_r(json_decode($e->getMessage(),true));
}

try {
$result=$huobi->account()->postTransfer([
'from-user'=>'37xxx264',
'from-account-type'=>'spot',
'from-account'=>'38xxx309',
'to-user'=>'37xx264',
'to-account-type'=>'spot',
'to-account'=>'38xxx971',
'currency'=>'USDT',
'amount'=>'20.00',
]);
print_r($result);
}catch (\Exception $e){
print_r($e->getMessage());
}

@zhouaini528
Copy link
Owner

Why 'from-user'=>'37xxx264' and 'to-user'=>'37xx264' are the same number?

@tellocan
Copy link
Author

Neden 'from-user'=>'37xxx264' ve 'to-user'=>'37xx264' aynı sayıdır?

The user transfers from his/her own bank account to other sub-accounts

@zhouaini528
Copy link
Owner

Neden 'from-user'=>'37xxx264' ve 'to-user'=>'37xx264' aynı sayıdır?

The user transfers from his/her own bank account to other sub-accounts
20211221092051
There are two UIDs here, should they be different?

@tellocan
Copy link
Author

Neden 'from-user'=>'37xxx264' ve 'to-user'=>'37xx264' aynı sayıdır?

The user transfers from his/her own bank account to other sub-accounts
20211221092051
There are two UIDs here, should they be different?

yes they are suitable for me. but the problem is actually no error json is returning

@tellocan
Copy link
Author

hello, did you find any solution? can the problem return with post because error code is not returning

@zhouaini528
Copy link
Owner

hello, did you find any solution? can the problem return with post because error code is not returning

You try again. composer update 2.2.0

@tellocan
Copy link
Author

tellocan commented Jan 5, 2022

hi, now it's error code but in all timing operations there was error like transfer. api also has transfer permission

Array

  | (
  | [code] => 200
  | [data] => 297219680
  | [ok] => 1
  | )
  | Array
  | (
  | [status] => error
  | [err-code] => api-signature-not-valid
  | [err-msg] => Signature not valid: Verification failure [校验失败]
  | [data] =>
  | [_method] => POST
  | [_url] => https://api.huobi.pro/v1/account/transfer
  | [_httpcode] => 200
  | )

@zhouaini528
Copy link
Owner

hi, now it's error code but in all timing operations there was error like transfer. api also has transfer permission

Array

  | (   | [code] => 200   | [data] => 297219680   | [ok] => 1   | )   | Array   | (   | [status] => error   | [err-code] => api-signature-not-valid   | [err-msg] => Signature not valid: Verification failure [校验失败]   | [data] =>   | [_method] => POST   | [_url] => https://api.huobi.pro/v1/account/transfer   | [_httpcode] => 200   | )

In fact, I also encountered the same problem. Now I am restricted by the exchange and cannot complete the test. You can try to ask customer service.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants