Author

Topic: Bitcoin Core (Qt) JSON - RPC listtransactions method problem (Read 3399 times)

member
Activity: 70
Merit: 10
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.





newbie
Activity: 43
Merit: 0
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
member
Activity: 70
Merit: 10
Code:
{ "method": "listtransactions", "params" : [ "*", 10, 0 ] }
newbie
Activity: 43
Merit: 0
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
Jump to: