bitcoind

bitcoind: listtransactions return error `Unknown named parameter from`


I want to return a list of wallet transactions via rpc command and set count and offset, but this query

{"method":"listtransactions","params":{"from":"0","count":"1"},"id":1}

returns error message Unknown named parameter from. I read manual https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_calls_list and took those fields from there. But seems something not working or I set it wrong? If I skip params, rpc works just fine


Solution

  • If you're sending commands via RPC you need to refer to the Bitcoin RPC API Reference.

    Upon looking specifically at listtransactions you will see that there is no from parameter:

    Argument #1 - label
    Argument #2 - count
    Argument #3 - skip
    Argument #4 - include_watchonly
    

    You may be confusing the client API with RPC commands (most of which have similar or related command names but have different parameters and syntax).

    In this case, from probably correlates to skip which indicates the number of transactions to skip over before returning the transactions indicated in count.