Instantiating Scala classes from Java #2629
kiwiidb
started this conversation in
Developers
Replies: 1 comment 1 reply
-
Unfortunately Scala is very difficult to use from Java, though I don't see why using Router.SearchBoundaries boundaries = new Router.SearchBoundaries(new MilliSatoshi(1000L), 5.0, 1, new CltvExpiryDelta(10));
Either<Graph.WeightRatios, Graph.HeuristicsConstants> heuristics = new Left<>(new Graph.WeightRatios(1.0, 0.0, 0.0, 0.0, new Relayer.RelayFees(new MilliSatoshi(100), 100)));
Router.MultiPartParams mpp = new Router.MultiPartParams(new MilliSatoshi(1000L), 2);
Router.RouteParams params = new Router.RouteParams(false,
boundaries,
heuristics,
mpp, "", false);
PaymentInitiator.SendSpontaneousPayment ssp = new PaymentInitiator.SendSpontaneousPayment(
new MilliSatoshi(1000),
new Crypto.PublicKey(PublicKey.fromHex("031b84c5567b126440995d3ed5aaba0565d71e1834604819ff9c17f5e9d5dd078f")),
ByteVector32.One(),
1,
Option.apply(""),
params,
null,
false); It may be a type error (i.e the argument list does not match what is expected), is it possible to share some code or even better add a basic unit test to your project ? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
We succeeded in writing a Java plugin for Eclair that pushes incoming payments to RabbitMQ: https://github.com/getAlby/eclair-plugins . We're also working on a plugin to send boostagrams, but we seem to have some issues when instantiating Scala classes from Java. Both the approaches below result in a NoSuchMethodError


using
new
:using
apply
:Errors:
I was told by @t-bast that @sstone might be able to help.
Beta Was this translation helpful? Give feedback.
All reactions