[C#] Update auto-generated files
[ldk-java] / c_sharp / src / org / ldk / structs / BroadcasterInterface.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  * An interface to send a transaction to the Bitcoin network.
10  */
11 public class BroadcasterInterface : CommonBase {
12         internal readonly bindings.LDKBroadcasterInterface bindings_instance;
13         internal BroadcasterInterface(object _dummy, long ptr) : base(ptr) { bindings_instance = null; }
14         private BroadcasterInterface(bindings.LDKBroadcasterInterface arg) : base(bindings.LDKBroadcasterInterface_new(arg)) {
15                 this.ptrs_to.AddLast(arg);
16                 this.bindings_instance = arg;
17         }
18         ~BroadcasterInterface() {
19                 if (ptr != 0) { bindings.BroadcasterInterface_free(ptr); }
20         }
21
22         public interface BroadcasterInterfaceInterface {
23                 /**
24                  * Sends a list of transactions out to (hopefully) be mined.
25                  * This only needs to handle the actual broadcasting of transactions, LDK will automatically
26                  * rebroadcast transactions that haven't made it into a block.
27                  * 
28                  * In some cases LDK may attempt to broadcast a transaction which double-spends another
29                  * and this isn't a bug and can be safely ignored.
30                  * 
31                  * If more than one transaction is given, these transactions should be considered to be a
32                  * package and broadcast together. Some of the transactions may or may not depend on each other,
33                  * be sure to manage both cases correctly.
34                  * 
35                  * Bitcoin transaction packages are defined in BIP 331 and here:
36                  * https://github.com/bitcoin/bitcoin/blob/master/doc/policy/packages.md
37                  */
38                 void broadcast_transactions(byte[][] _txs);
39         }
40         private class LDKBroadcasterInterfaceHolder { internal BroadcasterInterface held; }
41         private class LDKBroadcasterInterfaceImpl : bindings.LDKBroadcasterInterface {
42                 internal LDKBroadcasterInterfaceImpl(BroadcasterInterfaceInterface arg, LDKBroadcasterInterfaceHolder impl_holder) { this.arg = arg; this.impl_holder = impl_holder; }
43                 private BroadcasterInterfaceInterface arg;
44                 private LDKBroadcasterInterfaceHolder impl_holder;
45                 public void broadcast_transactions(byte[][] _txs) {
46                         arg.broadcast_transactions(_txs);
47                                 GC.KeepAlive(arg);
48                 }
49         }
50         public static BroadcasterInterface new_impl(BroadcasterInterfaceInterface arg) {
51                 LDKBroadcasterInterfaceHolder impl_holder = new LDKBroadcasterInterfaceHolder();
52                 impl_holder.held = new BroadcasterInterface(new LDKBroadcasterInterfaceImpl(arg, impl_holder));
53                 return impl_holder.held;
54         }
55         /**
56          * Sends a list of transactions out to (hopefully) be mined.
57          * This only needs to handle the actual broadcasting of transactions, LDK will automatically
58          * rebroadcast transactions that haven't made it into a block.
59          * 
60          * In some cases LDK may attempt to broadcast a transaction which double-spends another
61          * and this isn't a bug and can be safely ignored.
62          * 
63          * If more than one transaction is given, these transactions should be considered to be a
64          * package and broadcast together. Some of the transactions may or may not depend on each other,
65          * be sure to manage both cases correctly.
66          * 
67          * Bitcoin transaction packages are defined in BIP 331 and here:
68          * https://github.com/bitcoin/bitcoin/blob/master/doc/policy/packages.md
69          */
70         public void broadcast_transactions(byte[][] txs) {
71                 bindings.BroadcasterInterface_broadcast_transactions(this.ptr, txs);
72                 GC.KeepAlive(this);
73                 GC.KeepAlive(txs);
74         }
75
76 }
77 } } }