zhouaini528 / huobi-php

Huobi API Like the official document interface, Support for arbitrary extension.
MIT License
42 stars 23 forks source link

api posttransfer problem #9

Open tellocan opened 2 years ago

tellocan commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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'=>'41955',//this is parent account number UID 'from-account-type'=>'spot', 'from-account'=>$parent_account_id,//parent account get via API 'to-user'=>'193246',//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 commented 2 years ago

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 commented 2 years ago

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

tellocan commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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

zhouaini528 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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.