X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fldk%2Fstructs%2FRawInvoice.java;fp=src%2Fmain%2Fjava%2Forg%2Fldk%2Fstructs%2FRawInvoice.java;h=002ba01bec2ddd6589f7923f8e2bad713987c527;hb=4a36fa97d4eee96099c4a176ea845c52db27e64c;hp=10548908309d4efde612d01ad29db5d7d3a54b09;hpb=46763b974f120d1795fca6c1e757578784f3305a;p=ldk-java diff --git a/src/main/java/org/ldk/structs/RawInvoice.java b/src/main/java/org/ldk/structs/RawInvoice.java index 10548908..002ba01b 100644 --- a/src/main/java/org/ldk/structs/RawInvoice.java +++ b/src/main/java/org/ldk/structs/RawInvoice.java @@ -9,11 +9,11 @@ import javax.annotation.Nullable; /** - * Represents an syntactically correct Invoice for a payment on the lightning network, + * Represents an syntactically correct [`Invoice`] for a payment on the lightning network, * but without the signature information. - * De- and encoding should not lead to information loss but may lead to different hashes. + * Decoding and encoding should not lead to information loss but may lead to different hashes. * - * For methods without docs see the corresponding methods in `Invoice`. + * For methods without docs see the corresponding methods in [`Invoice`]. */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class RawInvoice extends CommonBase { @@ -82,7 +82,7 @@ public class RawInvoice extends CommonBase { } /** - * Checks if two RawInvoices contain equal inner contents. + * Generates a non-cryptographic 64-bit hash of the RawInvoice. */ public long hash() { long ret = bindings.RawInvoice_hash(this.ptr); @@ -190,6 +190,15 @@ public class RawInvoice extends CommonBase { return ret; } + public Option_CVec_u8ZZ payment_metadata() { + long ret = bindings.RawInvoice_payment_metadata(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_CVec_u8ZZ ret_hu_conv = org.ldk.structs.Option_CVec_u8ZZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; + } + /** * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None */