X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;ds=sidebyside;f=src%2Fmain%2Fjava%2Forg%2Fldk%2Fstructs%2FRefund.java;h=69be10f0c1c016bd459bfc86213672ded107b343;hb=5d91c4ade4b5f736d100428ccf84709ad29f971d;hp=57c3a0763da500d83c561a3ac24d18359c830c35;hpb=3e33cfde4213dafe90eb976eb67224e2451da855;p=ldk-java diff --git a/src/main/java/org/ldk/structs/Refund.java b/src/main/java/org/ldk/structs/Refund.java index 57c3a076..69be10f0 100644 --- a/src/main/java/org/ldk/structs/Refund.java +++ b/src/main/java/org/ldk/structs/Refund.java @@ -63,11 +63,11 @@ public class Refund extends CommonBase { * * If `None`, the refund does not expire. */ - public Option_DurationZ absolute_expiry() { + public Option_u64Z absolute_expiry() { long ret = bindings.Refund_absolute_expiry(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.Option_DurationZ ret_hu_conv = org.ldk.structs.Option_DurationZ.constr_from_ptr(ret); + org.ldk.structs.Option_u64Z ret_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; return ret_hu_conv; } @@ -81,6 +81,16 @@ public class Refund extends CommonBase { return ret; } + /** + * Whether the refund has expired given the duration since the Unix epoch. + */ + public boolean is_expired_no_std(long duration_since_epoch) { + boolean ret = bindings.Refund_is_expired_no_std(this.ptr, duration_since_epoch); + Reference.reachabilityFence(this); + Reference.reachabilityFence(duration_since_epoch); + return ret; + } + /** * The issuer of the refund, possibly beginning with `user@domain` or `domain`. Intended to be * displayed to the user but with the caveat that it has not been verified in any way. @@ -121,8 +131,8 @@ public class Refund extends CommonBase { * * [`payer_id`]: Self::payer_id */ - public byte[] metadata() { - byte[] ret = bindings.Refund_metadata(this.ptr); + public byte[] payer_metadata() { + byte[] ret = bindings.Refund_payer_metadata(this.ptr); Reference.reachabilityFence(this); return ret; } @@ -198,6 +208,18 @@ public class Refund extends CommonBase { return ret_hu_conv; } + /** + * Generates a non-cryptographic 64-bit hash of the Refund. + */ + public long hash() { + long ret = bindings.Refund_hash(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + @Override public int hashCode() { + return (int)this.hash(); + } /** * Serialize the Refund object into a byte array which can be read by Refund_read */ @@ -218,4 +240,13 @@ public class Refund extends CommonBase { return ret_hu_conv; } + /** + * Get the string representation of a Refund object + */ + public String to_str() { + String ret = bindings.Refund_to_str(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + }