interledger-deprecated / ilp-core

Core ILP module — handles ledger abstraction and quoting
Other
8 stars 5 forks source link

Proposal: Remove Payment class from API #12

Closed emschwartz closed 8 years ago

emschwartz commented 8 years ago

Right now you need to interact with the client by calling:

const payment = client.createPayment(params)
payment.quote().then((quote) => {
  payment.sendQuoted(quote)
})

It would be cleaner to get rid of the Payment class and add quote and send methods to the client:

client.quote(params).then((quote) => {
  client.send(Object.assign({}, params, quote))
})

This would also make it easier to wrap the quote/send functionality in js-ilp, for example to have the client check whether the source hold duration is too long.

emschwartz commented 8 years ago

@justmoon I'll take this ticket