monero-integrations/monerophp

get_transfers refuses to work with or without parameters

Codivorous opened this issue · 10 comments

It's really weird. I've tried with all sorts of combinations of parameters, but it only returns an empty array. I decided to settle on incoming_transfers for the time being, and that worked but it didn't seem to filter by subaddress, when I had the subaddress index, for example '3', fed to it.

Am I doing something wrong? I'm calling the functions with $WalletRPC->get_transfers().

I appreciate any help! :)

OK, I debugged this and solved it in #61. Thank you for your submission and I apologize for the issue! get_transfers works when feeding in an array of parameters, but when feeding in a single string as a parameter would use the nonexistent $input_type variable, whereas only $input_types exists.

Thank you, @Codivorous!

PS, the docs do say the following:

   * Look up transfers
   *
   * @param  array   $input_types      Array of transfer type strings; possible values include 'all', in', 'out', 'pending', 'failed', and 'pool'  (optional)

Check the code if you have an issue, but this really should have worked with just a string as an input--I just fucked up that bit of code :) Thank you again and please let me know if you have any other issues

Thanks for the quick work @sneurlax!

Unfortunately, this did not fix the issue completely. While the function now doesn't crash, I still can't actually get it to work.

This is the wallet that I am serving. As you can see, it has plenty of transfers:
bilde

The RPC wallet is running, and (hopefully) working:
bilde

This is the entire code snippet I am trying to run:
bilde

And then I get this output:
bilde

Running it without any parameters doesn't do anything either:
bilde

Same output. I hope I provided enough information for you to understand my issue :p

@serhack could you reopen this issue? I'm on it.

@Codivorous, could you try passing get_transfers(['in']) and/or get_transfers('in')? all isn't a thing (I am making it so now.)

It does indeed work when you specify "in" - so the issue here is that "all" doesn't exist, even though it's the default and is also specified in the documentation. Thank you for your help again @sneurlax!

I am opening a pull request now to add this functionality. Perhaps it was in a previous version of monero-wallet-rpc -- if you need it, it should become functional soon

Merged, all should work now