several order types
This commit is contained in:
parent
38bf829af1
commit
09f717b1a3
1 changed files with 12 additions and 0 deletions
|
|
@ -11,6 +11,7 @@ const {
|
||||||
Constants: { ErrorCode },
|
Constants: { ErrorCode },
|
||||||
Schema
|
Schema
|
||||||
} = Common
|
} = Common
|
||||||
|
const { assertNever } = require('assert-never')
|
||||||
|
|
||||||
const LightningServices = require('../../../../utils/lightningServices')
|
const LightningServices = require('../../../../utils/lightningServices')
|
||||||
const {
|
const {
|
||||||
|
|
@ -222,12 +223,23 @@ const listenerForAddr = (addr, SEA) => async (order, orderID) => {
|
||||||
const onData = invoice => {
|
const onData = invoice => {
|
||||||
if (invoice.settled) {
|
if (invoice.settled) {
|
||||||
writeCoordinate(invoice.r_hash.toString(), coord)
|
writeCoordinate(invoice.r_hash.toString(), coord)
|
||||||
|
|
||||||
if (order.targetType === 'tip') {
|
if (order.targetType === 'tip') {
|
||||||
getUser()
|
getUser()
|
||||||
.get('postToTipCount')
|
.get('postToTipCount')
|
||||||
// CAST: Checked above.
|
// CAST: Checked above.
|
||||||
.get(/** @type {string} */ (order.ackInfo))
|
.get(/** @type {string} */ (order.ackInfo))
|
||||||
.set(null) // each item in the set is a tip
|
.set(null) // each item in the set is a tip
|
||||||
|
} else if (order.targetType === 'contentReveal') {
|
||||||
|
// TODO
|
||||||
|
} else if (order.targetType === 'spontaneousPayment') {
|
||||||
|
// no action required
|
||||||
|
} else if (order.targetType === 'torrentSeed') {
|
||||||
|
// TODO
|
||||||
|
} else if (order.targetType === 'other') {
|
||||||
|
// TODO
|
||||||
|
} else {
|
||||||
|
assertNever(order.targetType)
|
||||||
}
|
}
|
||||||
|
|
||||||
stream.off()
|
stream.off()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue