Bitcoin Forum
September 27, 2018, 10:51:53 PM *
News: ♦♦ New info! Bitcoin Core users absolutely must upgrade to previously-announced 0.16.3 [Torrent]. All Bitcoin users should temporarily trust confirmations slightly less. More info.
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: Bitcoin Core (Qt) JSON - RPC listtransactions method problem  (Read 3283 times)
TheVault
Newbie
*
Offline Offline

Activity: 43
Merit: 0


View Profile WWW
March 25, 2014, 01:57:04 PM
 #1

Hi,
I want to poll the Bitcoin Core wallet for new transactions. These transactions can belong to various accounts, ie the addresses have labels. How do I pass appropriate JSON in to select all transactions from all accounts. The spec says that the "listtransactions" call takes [account] as an optional parameter. However, when I pass "", I get the base wallet address and none of the transactions for the labeled addresses. I cannot seem to omit this parameter and just set the [count] or [skip] parameters as I am constantly getting an error.

I'm doing this in c++ although I'm not sure that language makes any difference. What is the required string format for the command omitting the account parameter.

{ "method": "listtransactions", "params" : [ "", 10, 0 ] }

gives transactions for the base account only. I want all accounts.


{ "method": "listtransactions", "params" : [ 10, 0 ] }

omitting the first parameter causes a server error with a HTTP status code of 500 and an error message of...

{"result":null,"error":{"code":-1,"message":"value is type int, expected str"},"id":null}


So if listtransactions expects a string as the first parameter, and "" specifies the unnamed wallet account, how do I specify all accounts including the named ones.

Rgds
The Vault
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1538088713
Hero Member
*
Offline Offline

Posts: 1538088713

View Profile Personal Message (Offline)

Ignore
1538088713
Reply with quote  #2

1538088713
Report to moderator
syslog
Member
**
Offline Offline

Activity: 70
Merit: 10


View Profile WWW
March 25, 2014, 01:59:46 PM
 #2

Code:
{ "method": "listtransactions", "params" : [ "*", 10, 0 ] }

TheVault
Newbie
*
Offline Offline

Activity: 43
Merit: 0


View Profile WWW
March 25, 2014, 03:53:01 PM
 #3

Thank you very much sir,

I wasted a lot of time mucking with the syntax as I'm a JSON newbie and thought the error with my syntax. Would help to document that tidbit Smiley

There are lots of 'optional' parameters in the API, how would I omit a numeric value? What about other string values or would they all be covered by the *?

Thx Smiley
The Vault
syslog
Member
**
Offline Offline

Activity: 70
Merit: 10


View Profile WWW
March 25, 2014, 05:02:11 PM
 #4

Thank you very much sir,

I wasted a lot of time mucking with the syntax as I'm a JSON newbie and thought the error with my syntax. Would help to document that tidbit Smiley

There are lots of 'optional' parameters in the API, how would I omit a numeric value? What about other string values or would they all be covered by the *?

Thx Smiley
The Vault

well it depends on rpc call.

you have to use brute force, here is the a good numbers for brute force.

..,-1000,-100,-10,-1, 0, 1, 10, 100, 1000, 10000, ...

for string values
"", "*"

Also if a parameter is optional and you don't want to use it. dont pass any variable(string, integer, float, ...). just let it blank. Let  rpc server handle that parameters.






Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!