CSharp: fix LDKStr array decoding
[ldk-java] / c_sharp / src / org / ldk / structs / Amount.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  * The minimum amount required for an item in an [`Offer`], denominated in either bitcoin or
11  * another currency.
12  */
13 public class Amount : CommonBase {
14         internal Amount(object _dummy, long ptr) : base(ptr) { }
15         ~Amount() {
16                 if (ptr != 0) { bindings.Amount_free(ptr); }
17         }
18
19         internal long clone_ptr() {
20                 long ret = bindings.Amount_clone_ptr(this.ptr);
21                 GC.KeepAlive(this);
22                 return ret;
23         }
24
25         /**
26          * Creates a copy of the Amount
27          */
28         public Amount clone() {
29                 long ret = bindings.Amount_clone(this.ptr);
30                 GC.KeepAlive(this);
31                 if (ret >= 0 && ret <= 4096) { return null; }
32                 org.ldk.structs.Amount ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Amount(null, ret); }
33                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
34                 return ret_hu_conv;
35         }
36
37 }
38 } } }