spark-wallet icon indicating copy to clipboard operation
spark-wallet copied to clipboard

WebWallet: 'route' should be an array, not '["571512x1642x0"'

Open ghost opened this issue 5 years ago • 1 comments

Trying to send along a specific route, and maybe I'm not doing it right, but the error code suggests that it's not processing array's correctly when it gets to the rpc.

What I'm sending:

sendpay ["571512x1642x0", "570234x1091x0", "553206x1828x1"] f2e05f77f25523843465a851e5e0199c98e3f52d4d89ec03fd6baf5448d1e7fd testing1432 1000 lnbc1pwtyeyypp57ts97alj253cgdr94pg7tcqenjvw8afdfky7cqladwh4gjx3ul7sdpc235hqurfdcsxx7trwfuhqarjyq58g6tswp5kutndv55jsaf3x56nyvffcqzpgxqyz5vqermynd32c4wp2p0u54v8nvxpy5rhchlv20eadf7vps29tep6ahkjg37hj4ge0vvkaf9ufpk7lakcjz0nwr8e307vwwxe49rszxvd9rqqp8khgg

What the RPC command looks like when copied as a curl command:

...
--data-binary '{"method":"sendpay","params":["[\"571512x1642x0\"",",","570234x1091x0",",","553206x1828x1","]","f2e05f77f25523843465a851e5e0199c98e3f52d4d89ec03fd6baf5448d1e7fd","testing1432","1000","lnbc1pwtyeyypp57ts97alj253cgdr94pg7tcqenjvw8afdfky7cqladwh4gjx3ul7sdpc235hqurfdcsxx7trwfuhqarjyq58g6tswp5kutndv55jsaf3x56nyvffcqzpgxqyz5vqermynd32c4wp2p0u54v8nvxpy5rhchlv20eadf7vps29tep6ahkjg37hj4ge0vvkaf9ufpk7lakcjz0nwr8e307vwwxe49rszxvd9rqqp8khgg"]}'
...

The error code I get in spark:

'route' should be an array, not '["571512x1642x0"'

I've tried with single quotes, breaking with \ with single and double quotes, and having it as one single string, with/without breaks/single/double quotes, but no luck. Is there a right way to do this?

ghost avatar Apr 13 '19 23:04 ghost

The RPC command parser is a bit limited and does not currently allow passing complex arguments like arrays/objects. I'll look into improving it.

shesek avatar Apr 15 '19 10:04 shesek