Fixed payment methods for amp update
@@ -193,23 +193,15 @@ class AppKitModel : ViewModel() {
// push preimage to node supervisor actor
it.kit.system().eventStream().publish(preimage)
-// amountMsat_opt: Option[MilliSatoshi],
-// description: String,
-// expirySeconds_opt: Option[Long] = None,
-// extraHops: List[List[ExtraHop]] = Nil,
-// fallbackAddress: Option[String] = None,
-// paymentPreimage: Option[ByteVector32] = None,
-// allowMultiPart: Boolean = false
-
val f = Patterns.ask(it.kit.paymentHandler(),
PaymentLifecycle.ReceivePayment(
- amount_opt,
- description,
- Option.apply(null),
- routes,
- Option.empty(),
- Option.apply(preimage),
- true), timeout)
+ /* amount */ amount_opt,
+ /* description */ description,
+ /* expiry seconds */ Option.apply(null),
+ /* extra routing info */ routes,
+ /* fallback onchain address */ Option.empty(),
+ /* payment preimage */ Option.apply(preimage),
+ /* allow multi part payment */ true), timeout)
Await.result(f, awaitDuration) as PaymentRequest
} ?: throw RuntimeException("kit not initialized")
}
@@ -242,11 +234,11 @@ class AppKitModel : ViewModel() {
/* max attempts */ 10,
/* predefined route */ predefRoutes,
/* payment request */ Option.apply(paymentRequest),
- /* assisted routes */ assistedRoutes,
+ /* assisted routes */ paymentRequest.routingInfo(), // assistedRoutes,
/* cltv expiry */ Channel.MIN_CLTV_EXPIRY(),
- /* route params */ routeParams,
- /* allow amp */ true,
- /* amp total amount */ Option.apply(null))
+ /* route params */ Option.apply(null),
+ /* allow amp */ paymentRequest.features().allowMultiPart(),
+ /* amp total amount */ Option.apply(amount.amount()))
it.kit.paymentInitiator().tell(sendRequest, ActorRef.noSender())
} ?: log.warn("tried to send a payment but app kit is not initialized!!")
