ripple / ripple-client

A UI for the Ripple payment network built using web technologies
ISC License
1.34k stars 494 forks source link

Client provides unhelpful error if destination currency is not accepted by destination account #384

Closed JoelKatz closed 10 years ago

JoelKatz commented 11 years ago

When a user tries to send funds to an account that can't accept that currency, the client report "No path found!". This is an unhelpful generic error message that suggests that the network failed or liquidity is insufficient.

To address this, the ripple_path_find return value has been enhanced to include the list of currencies the destination accepts. See https://ripple.com/wiki/RPC_API#ripple_path_find

Here's an example of the new format:

{
   "result" : {
      "alternatives" : [],
      "destination_account" : "rLDDq8ZGhCaVBP8MyYTifhCJzgWPQBjwpt",
      "destination_currencies" : [ "SHR", "BTC", "USD", "DYM", "XRP" ],
      "ledger_current_index" : 481321,
      "status" : "success"
   }
}

Note that the list of supported currencies is provided whether paths are found or not.

I'd suggest that the client return a more useful error message if the currency sent isn't on the list of destination currencies. Something like "destination does not support that currency". The client can also use the list to limit the choice of destination currencies to those the destination supports (perhaps graying unsupported currencies or offering a dropdown list of those supported by the destination).

The new return format is currently supported only on the development branch of the Ripple server. Production servers do not return this information yet. If it will help get this feature in the field faster, I can accelerate deploying the feature to live servers.

ahbritto commented 11 years ago

The client should not fail if destination_currencies is not provided.