Accept standard ILP Packet & Transfer for quote and send
Closed this issue · 2 comments
ilp-core
is a low-level module that's intended for use in other libraries. Right now its transforms the parameters to create the transfer and ILP packet in a way that's supposed to be helpful. However, this makes it more complicated to use in other libraries like js-ilp
where you want more fine-grained control over the payment details. I think we should make it accept more standard parameters for the quote
and send
methods.
Instead of the sendQuotedPayment
method (or in addition if we don't want it to be a breaking change) I think we should just have a send
method like the underlying Ledger Plugin Interface that takes a fully-formed OutgoingTransfer
object. This would allow users of ilp-core
to create the transfer and packet as desired and pass them straight through.
For quote
I'm less sure because we don't have a well defined standard for that. One idea would be to have a quote method that takes an ILP packet and gives you a transfer back, though that wouldn't support fixed source amounts (because packets include only the destination amount).
I'm also not sure about how to deal with expiries and expiry_duration
s. The main point here though is that ilp-core
right now has a different API than the plugins and it makes it more complicated, rather than less, to interact with.
Thoughts?
After discussing with @justmoon I think there's a better way to improve the API once ilp-core
is responsible for creating the binary packets. Closing this for now