bitaps-com / wallet-api-examples

Wallet API examples
6 stars 5 forks source link

Problems making transfers in ETH #4

Open lacchain-stamping opened 5 years ago

lacchain-stamping commented 5 years ago

When I create an ETH payment address in my wallet, the addresses are incorrect. When I transfer to another address it shows me this error: invalid amount, receiver list index 0 Code: $params = array("password" => "Password123"); $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => "https://api.bitaps.com/eth/v1/create/wallet", CURLOPT_RETURNTRANSFER => true, CURLOPT_CUSTOMREQUEST => "POST", CURLOPT_POSTFIELDS => json_encode($params) )); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); print_r(json_decode($response)); echo ("

");

$wallet_id=json_decode($response)->wallet_id;

$params = array("wallet_id"=> $wallet_id); $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => "https://api.bitaps.com/".$currency."/v1/create/wallet/payment/address", CURLOPT_RETURNTRANSFER => true, CURLOPT_CUSTOMREQUEST => "POST", CURLOPT_POSTFIELDS => json_encode($params))); $response = curl_exec($curl); print_r(json_decode($response)); echo ("

");

madnadyka commented 5 years ago

What do you mean that addresses in response are incorrect? These new addresses have zero balances and may not be shown in some explorers.

When you make a request to transfer to another address, the amount params should be in wei, for example for 1 ETH amount it should be 1000000000000000000 (1ETH=10^18wei)

lacchain-stamping commented 5 years ago

Thank you for your help, but I tried to charge you balance using Ethereum testnet (Ropsten) faucet to the address: 0xbB97627f2a14869034C422ee3F1d03d24d26ACbb. I have not had luck, it shows me an internal error.

madnadyka commented 5 years ago

Please use for faucet form in https://teth.bitaps.com the limit is 1 ETH per 1 request.