[C#] Update auto-generated C# bindings
[ldk-java] / c_sharp / src / org / ldk / structs / TaggedHash.cs
1 using org.ldk.impl;
2 using org.ldk.enums;
3 using org.ldk.util;
4 using System;
5
6 namespace org { namespace ldk { namespace structs {
7
8
9 /**
10  * A hash for use in a specific context by tweaking with a context-dependent tag as per [BIP 340]
11  * and computed over the merkle root of a TLV stream to sign as defined in [BOLT 12].
12  * 
13  * [BIP 340]: https://github.com/bitcoin/bips/blob/master/bip-0340.mediawiki
14  * [BOLT 12]: https://github.com/rustyrussell/lightning-rfc/blob/guilt/offers/12-offer-encoding.md#signature-calculation
15  */
16 public class TaggedHash : CommonBase {
17         internal TaggedHash(object _dummy, long ptr) : base(ptr) { }
18         ~TaggedHash() {
19                 if (ptr != 0) { bindings.TaggedHash_free(ptr); }
20         }
21
22         internal long clone_ptr() {
23                 long ret = bindings.TaggedHash_clone_ptr(this.ptr);
24                 GC.KeepAlive(this);
25                 return ret;
26         }
27
28         /**
29          * Creates a copy of the TaggedHash
30          */
31         public TaggedHash clone() {
32                 long ret = bindings.TaggedHash_clone(this.ptr);
33                 GC.KeepAlive(this);
34                 if (ret >= 0 && ret <= 4096) { return null; }
35                 org.ldk.structs.TaggedHash ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.TaggedHash(null, ret); }
36                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
37                 return ret_hu_conv;
38         }
39
40         /**
41          * Returns the digest to sign.
42          */
43         public byte[] as_digest() {
44                 long ret = bindings.TaggedHash_as_digest(this.ptr);
45                 GC.KeepAlive(this);
46                 if (ret >= 0 && ret <= 4096) { return null; }
47                 byte[] ret_conv = InternalUtils.decodeUint8Array(ret);
48                 return ret_conv;
49         }
50
51         /**
52          * Returns the tag used in the tagged hash.
53          */
54         public string tag() {
55                 long ret = bindings.TaggedHash_tag(this.ptr);
56                 GC.KeepAlive(this);
57                 if (ret >= 0 && ret <= 4096) { return null; }
58                 string ret_conv = InternalUtils.decodeString(ret);
59                 return ret_conv;
60         }
61
62         /**
63          * Returns the merkle root used in the tagged hash.
64          */
65         public byte[] merkle_root() {
66                 long ret = bindings.TaggedHash_merkle_root(this.ptr);
67                 GC.KeepAlive(this);
68                 if (ret >= 0 && ret <= 4096) { return null; }
69                 byte[] ret_conv = InternalUtils.decodeUint8Array(ret);
70                 return ret_conv;
71         }
72
73 }
74 } } }