Bitcoin Forum
June 14, 2024, 05:46:12 PM *
News: Voting for pizza day contest
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: API call 'sendfrom' not working  (Read 1637 times)
bananas (OP)
Sr. Member
****
Offline Offline

Activity: 364
Merit: 257


View Profile
March 04, 2014, 05:27:35 AM
 #1

I make a 'getbalance' call to  be sure that there are enough funds, it works. Then i use 'sendfrom' to send from an account to an address and it just does not work:

$btc = "0.01000000";

$call = $api->call('sendfrom', $sender_account, $receiving_address, $btc,6);

it just returns null, so i have no idea what the error is.

I'm using the testnet.
bananas (OP)
Sr. Member
****
Offline Offline

Activity: 364
Merit: 257


View Profile
March 04, 2014, 07:34:23 AM
 #2

Well, i tested not using variables for the params. Instead i hardcoded the parameters and it worked. Why it would not work with variables? I've checked and the var values are all correct.
Automatic
Full Member
***
Offline Offline

Activity: 238
Merit: 105


View Profile
March 04, 2014, 05:25:03 PM
 #3

Well, i tested not using variables for the params. Instead i hardcoded the parameters and it worked. Why it would not work with variables? I've checked and the var values are all correct.


Open up wireshark, compare the difference?

Please ask for a signed message from my on-site Bitcoin address (Check my profile) before doing any offsite trades with me.
Vortuarackne
Newbie
*
Offline Offline

Activity: 28
Merit: 0


View Profile
March 04, 2014, 09:58:51 PM
 #4

I make a 'getbalance' call to  be sure that there are enough funds, it works. Then i use 'sendfrom' to send from an account to an address and it just does not work:

$btc = "0.01000000";

$call = $api->call('sendfrom', $sender_account, $receiving_address, $btc,6);

it just returns null, so i have no idea what the error is.

I'm using the testnet.

Make sure $btc is a numeric value rather than a string, in php;

Code:
$btc = floatval("0.01000000");

$call = $api->call('sendfrom', $sender_account, $receiving_address, $btc,6);

Your confirmation number may also need to be an int (e.g. intval("6") )
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!