Skip to content

Commit 3d1f246

Browse files
committed
[C#] Update auto-generated C# bindings
1 parent a32b884 commit 3d1f246

File tree

186 files changed

+25926
-6345
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

186 files changed

+25926
-6345
lines changed

c_sharp/bindings.c

Lines changed: 8098 additions & 2044 deletions
Large diffs are not rendered by default.

c_sharp/bindings.c.body

Lines changed: 8098 additions & 2044 deletions
Large diffs are not rendered by default.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
namespace org { namespace ldk { namespace enums {/**
2+
* Whether this blinded HTLC is being failed backwards by the introduction node or a blinded node,
3+
* which determines the failure message that should be used.
4+
*/
5+
public enum BlindedFailure {
6+
/**
7+
* This HTLC is being failed backwards by the introduction node, and thus should be failed with
8+
* [`msgs::UpdateFailHTLC`] and error code `0x8000|0x4000|24`.
9+
*/
10+
LDKBlindedFailure_FromIntroductionNode,
11+
/**
12+
* This HTLC is being failed backwards by a blinded node within the path, and thus should be
13+
* failed with [`msgs::UpdateFailMalformedHTLC`] and error code `0x8000|0x4000|24`.
14+
*/
15+
LDKBlindedFailure_FromBlindedNode,
16+
}} } }

c_sharp/src/org/ldk/enums/ConfirmationTarget.cs

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -10,25 +10,6 @@ public enum ConfirmationTarget {
1010
* fee - this should be a relatively high priority feerate.
1111
*/
1212
LDKConfirmationTarget_OnChainSweep,
13-
/**
14-
* The highest feerate we will allow our channel counterparty to have in a non-anchor channel.
15-
*
16-
* This is the feerate on the transaction which we (or our counterparty) will broadcast in
17-
* order to close the channel unilaterally. Because our counterparty must ensure they can
18-
* always broadcast the latest state, this value being too low will cause immediate
19-
* force-closures.
20-
*
21-
* Allowing this value to be too high can allow our counterparty to burn our HTLC outputs to
22-
* dust, which can result in HTLCs failing or force-closures (when the dust HTLCs exceed
23-
* [`ChannelConfig::max_dust_htlc_exposure`]).
24-
*
25-
* Because most nodes use a feerate estimate which is based on a relatively high priority
26-
* transaction entering the current mempool, setting this to a small multiple of your current
27-
* high priority feerate estimate should suffice.
28-
*
29-
* [`ChannelConfig::max_dust_htlc_exposure`]: crate::util::config::ChannelConfig::max_dust_htlc_exposure
30-
*/
31-
LDKConfirmationTarget_MaxAllowedNonAnchorChannelRemoteFee,
3213
/**
3314
* This is the lowest feerate we will allow our channel counterparty to have in an anchor
3415
* channel in order to close the channel if a channel party goes away.

c_sharp/src/org/ldk/impl/bindings.cs

Lines changed: 1816 additions & 666 deletions
Large diffs are not rendered by default.

c_sharp/src/org/ldk/structs/AcceptChannel.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,18 @@ public AcceptChannel clone() {
390390
return ret_hu_conv;
391391
}
392392

393+
/**
394+
* Generates a non-cryptographic 64-bit hash of the AcceptChannel.
395+
*/
396+
public long hash() {
397+
long ret = bindings.AcceptChannel_hash(this.ptr);
398+
GC.KeepAlive(this);
399+
return ret;
400+
}
401+
402+
public override int GetHashCode() {
403+
return (int)this.hash();
404+
}
393405
/**
394406
* Checks if two AcceptChannels contain equal inner contents.
395407
* This ignores pointers and is_owned flags and looks at the values in fields.

c_sharp/src/org/ldk/structs/AcceptChannelV2.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -436,6 +436,18 @@ public AcceptChannelV2 clone() {
436436
return ret_hu_conv;
437437
}
438438

439+
/**
440+
* Generates a non-cryptographic 64-bit hash of the AcceptChannelV2.
441+
*/
442+
public long hash() {
443+
long ret = bindings.AcceptChannelV2_hash(this.ptr);
444+
GC.KeepAlive(this);
445+
return ret;
446+
}
447+
448+
public override int GetHashCode() {
449+
return (int)this.hash();
450+
}
439451
/**
440452
* Checks if two AcceptChannelV2s contain equal inner contents.
441453
* This ignores pointers and is_owned flags and looks at the values in fields.

c_sharp/src/org/ldk/structs/AnnouncementSignatures.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,18 @@ public AnnouncementSignatures clone() {
128128
return ret_hu_conv;
129129
}
130130

131+
/**
132+
* Generates a non-cryptographic 64-bit hash of the AnnouncementSignatures.
133+
*/
134+
public long hash() {
135+
long ret = bindings.AnnouncementSignatures_hash(this.ptr);
136+
GC.KeepAlive(this);
137+
return ret;
138+
}
139+
140+
public override int GetHashCode() {
141+
return (int)this.hash();
142+
}
131143
/**
132144
* Checks if two AnnouncementSignaturess contain equal inner contents.
133145
* This ignores pointers and is_owned flags and looks at the values in fields.
Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
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+
* Information used to forward or fail this HTLC that is being forwarded within a blinded path.
11+
*/
12+
public class BlindedForward : CommonBase {
13+
internal BlindedForward(object _dummy, long ptr) : base(ptr) { }
14+
~BlindedForward() {
15+
if (ptr != 0) { bindings.BlindedForward_free(ptr); }
16+
}
17+
18+
/**
19+
* The `blinding_point` that was set in the inbound [`msgs::UpdateAddHTLC`], or in the inbound
20+
* onion payload if we're the introduction node. Useful for calculating the next hop's
21+
* [`msgs::UpdateAddHTLC::blinding_point`].
22+
*/
23+
public byte[] get_inbound_blinding_point() {
24+
long ret = bindings.BlindedForward_get_inbound_blinding_point(this.ptr);
25+
GC.KeepAlive(this);
26+
if (ret >= 0 && ret <= 4096) { return null; }
27+
byte[] ret_conv = InternalUtils.decodeUint8Array(ret);
28+
return ret_conv;
29+
}
30+
31+
/**
32+
* The `blinding_point` that was set in the inbound [`msgs::UpdateAddHTLC`], or in the inbound
33+
* onion payload if we're the introduction node. Useful for calculating the next hop's
34+
* [`msgs::UpdateAddHTLC::blinding_point`].
35+
*/
36+
public void set_inbound_blinding_point(byte[] val) {
37+
bindings.BlindedForward_set_inbound_blinding_point(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 33)));
38+
GC.KeepAlive(this);
39+
GC.KeepAlive(val);
40+
}
41+
42+
/**
43+
* If needed, this determines how this HTLC should be failed backwards, based on whether we are
44+
* the introduction node.
45+
*/
46+
public BlindedFailure get_failure() {
47+
BlindedFailure ret = bindings.BlindedForward_get_failure(this.ptr);
48+
GC.KeepAlive(this);
49+
return ret;
50+
}
51+
52+
/**
53+
* If needed, this determines how this HTLC should be failed backwards, based on whether we are
54+
* the introduction node.
55+
*/
56+
public void set_failure(BlindedFailure val) {
57+
bindings.BlindedForward_set_failure(this.ptr, val);
58+
GC.KeepAlive(this);
59+
GC.KeepAlive(val);
60+
}
61+
62+
/**
63+
* Constructs a new BlindedForward given each field
64+
*/
65+
public static BlindedForward of(byte[] inbound_blinding_point_arg, BlindedFailure failure_arg) {
66+
long ret = bindings.BlindedForward_new(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(inbound_blinding_point_arg, 33)), failure_arg);
67+
GC.KeepAlive(inbound_blinding_point_arg);
68+
GC.KeepAlive(failure_arg);
69+
if (ret >= 0 && ret <= 4096) { return null; }
70+
org.ldk.structs.BlindedForward ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.BlindedForward(null, ret); }
71+
if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
72+
return ret_hu_conv;
73+
}
74+
75+
internal long clone_ptr() {
76+
long ret = bindings.BlindedForward_clone_ptr(this.ptr);
77+
GC.KeepAlive(this);
78+
return ret;
79+
}
80+
81+
/**
82+
* Creates a copy of the BlindedForward
83+
*/
84+
public BlindedForward clone() {
85+
long ret = bindings.BlindedForward_clone(this.ptr);
86+
GC.KeepAlive(this);
87+
if (ret >= 0 && ret <= 4096) { return null; }
88+
org.ldk.structs.BlindedForward ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.BlindedForward(null, ret); }
89+
if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
90+
return ret_hu_conv;
91+
}
92+
93+
/**
94+
* Generates a non-cryptographic 64-bit hash of the BlindedForward.
95+
*/
96+
public long hash() {
97+
long ret = bindings.BlindedForward_hash(this.ptr);
98+
GC.KeepAlive(this);
99+
return ret;
100+
}
101+
102+
public override int GetHashCode() {
103+
return (int)this.hash();
104+
}
105+
/**
106+
* Checks if two BlindedForwards contain equal inner contents.
107+
* This ignores pointers and is_owned flags and looks at the values in fields.
108+
* Two objects with NULL inner values will be considered "equal" here.
109+
*/
110+
public bool eq(org.ldk.structs.BlindedForward b) {
111+
bool ret = bindings.BlindedForward_eq(this.ptr, b == null ? 0 : b.ptr);
112+
GC.KeepAlive(this);
113+
GC.KeepAlive(b);
114+
if (this != null) { this.ptrs_to.AddLast(b); };
115+
return ret;
116+
}
117+
118+
public override bool Equals(object o) {
119+
if (!(o is BlindedForward)) return false;
120+
return this.eq((BlindedForward)o);
121+
}
122+
/**
123+
* Serialize the BlindedForward object into a byte array which can be read by BlindedForward_read
124+
*/
125+
public byte[] write() {
126+
long ret = bindings.BlindedForward_write(this.ptr);
127+
GC.KeepAlive(this);
128+
if (ret >= 0 && ret <= 4096) { return null; }
129+
byte[] ret_conv = InternalUtils.decodeUint8Array(ret);
130+
return ret_conv;
131+
}
132+
133+
/**
134+
* Read a BlindedForward from a byte array, created by BlindedForward_write
135+
*/
136+
public static Result_BlindedForwardDecodeErrorZ read(byte[] ser) {
137+
long ret = bindings.BlindedForward_read(InternalUtils.encodeUint8Array(ser));
138+
GC.KeepAlive(ser);
139+
if (ret >= 0 && ret <= 4096) { return null; }
140+
Result_BlindedForwardDecodeErrorZ ret_hu_conv = Result_BlindedForwardDecodeErrorZ.constr_from_ptr(ret);
141+
return ret_hu_conv;
142+
}
143+
144+
}
145+
} } }

c_sharp/src/org/ldk/structs/BlindedHopFeatures.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,18 @@ public BlindedHopFeatures clone() {
5050
return ret_hu_conv;
5151
}
5252

53+
/**
54+
* Generates a non-cryptographic 64-bit hash of the BlindedHopFeatures.
55+
*/
56+
public long hash() {
57+
long ret = bindings.BlindedHopFeatures_hash(this.ptr);
58+
GC.KeepAlive(this);
59+
return ret;
60+
}
61+
62+
public override int GetHashCode() {
63+
return (int)this.hash();
64+
}
5365
/**
5466
* Create a blank Features with no features set
5567
*/

0 commit comments

Comments
 (0)