import { Client } from 'ilp-core'
const client = new Client({
auth: {
account: 'https://far-far-away-ledger.example/accounts/bob',
password: 'super-secret-password',
}
})
const payment = client.createPayment({
destinationAmount: '1',
// or sourceAmount
destinationAccount: 'https://red.ilpdemo.org/ledger/accounts/alice',
destinationLedger: 'https://red.ilpdemo.org/ledger',
destinationMemo: {
foo: 'bar'
},
sourceMemo: {
thisWasFor: 'that thing'
}
})
payment.quote()
.then((quote) => {
// quote.sourceAmount (BigNumber)
// quote.destinationAmount (BigNumber)
//...
payment.sendQuoted(quote)
})
// can be used instead of payment.sendQuoted
payment.send({
maxSourceAmount: '11',
maxHoldTime: 10000
})
.then((transfer) => {
})
.catch((err) => {
})
import { Client } from 'ilp-core'
const client = new Client({
auth: {
account: 'https://far-far-away-ledger.example/accounts/bob',
password: 'super-secret-password',
}
})
client.on('incoming', (transfer) => {
})