Skip to content

Commit 0bcd7c1

Browse files
committed
update to latest upstream version
1 parent ceac980 commit 0bcd7c1

Some content is hidden

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

44 files changed

+12659
-11009
lines changed

bindings/LDK/Bindings.swift

Lines changed: 546 additions & 373 deletions
Large diffs are not rendered by default.

bindings/LDK/structs/ChainParameters.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,13 @@ ChainParameters_get_best_block(this_ptrPointer)
4545
return ChainParameters_set_best_block(this_ptrPointer, val.cOpaqueStruct!);
4646
}
4747

48+
public func clone(orig: ChainParameters) -> ChainParameters {
49+
50+
return withUnsafePointer(to: orig.cOpaqueStruct!) { (origPointer: UnsafePointer<LDKChainParameters>) in
51+
ChainParameters(pointer: ChainParameters_clone(origPointer))
52+
};
53+
}
54+
4855

4956
deinit {
5057
if self.cOpaqueStruct?.is_owned == false {

bindings/LDK/structs/ChannelDetails.swift

Lines changed: 64 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,21 @@ ChannelDetails_get_channel_id(this_ptrPointer)
2525
return ChannelDetails_set_channel_id(this_ptrPointer, Bindings.new_LDKThirtyTwoBytes(array: val));
2626
}
2727

28+
public func get_funding_txo() -> OutPoint {
29+
30+
return OutPoint(pointer: withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKChannelDetails>) in
31+
ChannelDetails_get_funding_txo(this_ptrPointer)
32+
});
33+
}
34+
35+
public func set_funding_txo(val: OutPoint) -> Void {
36+
37+
let this_ptrPointer = UnsafeMutablePointer<LDKChannelDetails>.allocate(capacity: 1)
38+
this_ptrPointer.initialize(to: self.cOpaqueStruct!)
39+
40+
return ChannelDetails_set_funding_txo(this_ptrPointer, val.cOpaqueStruct!);
41+
}
42+
2843
public func get_short_channel_id() -> Option_u64Z {
2944

3045
return Option_u64Z(pointer: withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKChannelDetails>) in
@@ -130,19 +145,64 @@ ChannelDetails_get_inbound_capacity_msat(this_ptrPointer)
130145
return ChannelDetails_set_inbound_capacity_msat(this_ptrPointer, val);
131146
}
132147

133-
public func get_is_live() -> Bool {
148+
public func get_is_outbound() -> Bool {
149+
150+
return withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKChannelDetails>) in
151+
ChannelDetails_get_is_outbound(this_ptrPointer)
152+
};
153+
}
154+
155+
public func set_is_outbound(val: Bool) -> Void {
156+
157+
let this_ptrPointer = UnsafeMutablePointer<LDKChannelDetails>.allocate(capacity: 1)
158+
this_ptrPointer.initialize(to: self.cOpaqueStruct!)
159+
160+
return ChannelDetails_set_is_outbound(this_ptrPointer, val);
161+
}
162+
163+
public func get_is_funding_locked() -> Bool {
164+
165+
return withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKChannelDetails>) in
166+
ChannelDetails_get_is_funding_locked(this_ptrPointer)
167+
};
168+
}
169+
170+
public func set_is_funding_locked(val: Bool) -> Void {
171+
172+
let this_ptrPointer = UnsafeMutablePointer<LDKChannelDetails>.allocate(capacity: 1)
173+
this_ptrPointer.initialize(to: self.cOpaqueStruct!)
174+
175+
return ChannelDetails_set_is_funding_locked(this_ptrPointer, val);
176+
}
177+
178+
public func get_is_usable() -> Bool {
179+
180+
return withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKChannelDetails>) in
181+
ChannelDetails_get_is_usable(this_ptrPointer)
182+
};
183+
}
184+
185+
public func set_is_usable(val: Bool) -> Void {
186+
187+
let this_ptrPointer = UnsafeMutablePointer<LDKChannelDetails>.allocate(capacity: 1)
188+
this_ptrPointer.initialize(to: self.cOpaqueStruct!)
189+
190+
return ChannelDetails_set_is_usable(this_ptrPointer, val);
191+
}
192+
193+
public func get_is_public() -> Bool {
134194

135195
return withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKChannelDetails>) in
136-
ChannelDetails_get_is_live(this_ptrPointer)
196+
ChannelDetails_get_is_public(this_ptrPointer)
137197
};
138198
}
139199

140-
public func set_is_live(val: Bool) -> Void {
200+
public func set_is_public(val: Bool) -> Void {
141201

142202
let this_ptrPointer = UnsafeMutablePointer<LDKChannelDetails>.allocate(capacity: 1)
143203
this_ptrPointer.initialize(to: self.cOpaqueStruct!)
144204

145-
return ChannelDetails_set_is_live(this_ptrPointer, val);
205+
return ChannelDetails_set_is_public(this_ptrPointer, val);
146206
}
147207

148208
public func clone(orig: ChannelDetails) -> ChannelDetails {

bindings/LDK/structs/ChannelFeatures.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,15 @@ public class ChannelFeatures {
1515

1616
/* STRUCT_METHODS_START */
1717

18+
public func eq(a: ChannelFeatures, b: ChannelFeatures) -> Bool {
19+
20+
return withUnsafePointer(to: a.cOpaqueStruct!) { (aPointer: UnsafePointer<LDKChannelFeatures>) in
21+
withUnsafePointer(to: b.cOpaqueStruct!) { (bPointer: UnsafePointer<LDKChannelFeatures>) in
22+
ChannelFeatures_eq(aPointer, bPointer)
23+
}
24+
};
25+
}
26+
1827
public func clone(orig: ChannelFeatures) -> ChannelFeatures {
1928

2029
return withUnsafePointer(to: orig.cOpaqueStruct!) { (origPointer: UnsafePointer<LDKChannelFeatures>) in

bindings/LDK/structs/ChannelHandshakeLimits.swift

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -90,36 +90,6 @@ ChannelHandshakeLimits_get_min_max_accepted_htlcs(this_ptrPointer)
9090
return ChannelHandshakeLimits_set_min_max_accepted_htlcs(this_ptrPointer, val);
9191
}
9292

93-
public func get_min_dust_limit_satoshis() -> UInt64 {
94-
95-
return withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKChannelHandshakeLimits>) in
96-
ChannelHandshakeLimits_get_min_dust_limit_satoshis(this_ptrPointer)
97-
};
98-
}
99-
100-
public func set_min_dust_limit_satoshis(val: UInt64) -> Void {
101-
102-
let this_ptrPointer = UnsafeMutablePointer<LDKChannelHandshakeLimits>.allocate(capacity: 1)
103-
this_ptrPointer.initialize(to: self.cOpaqueStruct!)
104-
105-
return ChannelHandshakeLimits_set_min_dust_limit_satoshis(this_ptrPointer, val);
106-
}
107-
108-
public func get_max_dust_limit_satoshis() -> UInt64 {
109-
110-
return withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKChannelHandshakeLimits>) in
111-
ChannelHandshakeLimits_get_max_dust_limit_satoshis(this_ptrPointer)
112-
};
113-
}
114-
115-
public func set_max_dust_limit_satoshis(val: UInt64) -> Void {
116-
117-
let this_ptrPointer = UnsafeMutablePointer<LDKChannelHandshakeLimits>.allocate(capacity: 1)
118-
this_ptrPointer.initialize(to: self.cOpaqueStruct!)
119-
120-
return ChannelHandshakeLimits_set_max_dust_limit_satoshis(this_ptrPointer, val);
121-
}
122-
12393
public func get_max_minimum_depth() -> UInt32 {
12494

12595
return withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKChannelHandshakeLimits>) in

bindings/LDK/structs/DelayedPaymentOutputDescriptor.swift

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,18 @@ DelayedPaymentOutputDescriptor(pointer: DelayedPaymentOutputDescriptor_clone(ori
120120
};
121121
}
122122

123+
public func write(obj: DelayedPaymentOutputDescriptor) -> [UInt8] {
124+
125+
return Bindings.LDKCVec_u8Z_to_array(nativeType: withUnsafePointer(to: obj.cOpaqueStruct!) { (objPointer: UnsafePointer<LDKDelayedPaymentOutputDescriptor>) in
126+
DelayedPaymentOutputDescriptor_write(objPointer)
127+
});
128+
}
129+
130+
public func read(ser: [UInt8]) -> Result_DelayedPaymentOutputDescriptorDecodeErrorZ {
131+
132+
return Result_DelayedPaymentOutputDescriptorDecodeErrorZ(pointer: DelayedPaymentOutputDescriptor_read(Bindings.new_LDKu8slice(array: ser)));
133+
}
134+
123135

124136
deinit {
125137
if self.cOpaqueStruct?.is_owned == false {

bindings/LDK/structs/Description.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,15 @@ public class Description {
1010

1111
/* STRUCT_METHODS_START */
1212

13+
public func eq(a: Description, b: Description) -> Bool {
14+
15+
return withUnsafePointer(to: a.cOpaqueStruct!) { (aPointer: UnsafePointer<LDKDescription>) in
16+
withUnsafePointer(to: b.cOpaqueStruct!) { (bPointer: UnsafePointer<LDKDescription>) in
17+
Description_eq(aPointer, bPointer)
18+
}
19+
};
20+
}
21+
1322
public func clone(orig: Description) -> Description {
1423

1524
return withUnsafePointer(to: orig.cOpaqueStruct!) { (origPointer: UnsafePointer<LDKDescription>) in

bindings/LDK/structs/ExpiryTime.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,15 @@ public class ExpiryTime {
1010

1111
/* STRUCT_METHODS_START */
1212

13+
public func eq(a: ExpiryTime, b: ExpiryTime) -> Bool {
14+
15+
return withUnsafePointer(to: a.cOpaqueStruct!) { (aPointer: UnsafePointer<LDKExpiryTime>) in
16+
withUnsafePointer(to: b.cOpaqueStruct!) { (bPointer: UnsafePointer<LDKExpiryTime>) in
17+
ExpiryTime_eq(aPointer, bPointer)
18+
}
19+
};
20+
}
21+
1322
public func clone(orig: ExpiryTime) -> ExpiryTime {
1423

1524
return withUnsafePointer(to: orig.cOpaqueStruct!) { (origPointer: UnsafePointer<LDKExpiryTime>) in

bindings/LDK/structs/InitFeatures.swift

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,29 @@ public class InitFeatures {
1515

1616
/* STRUCT_METHODS_START */
1717

18+
public func eq(a: InitFeatures, b: InitFeatures) -> Bool {
19+
20+
return withUnsafePointer(to: a.cOpaqueStruct!) { (aPointer: UnsafePointer<LDKInitFeatures>) in
21+
withUnsafePointer(to: b.cOpaqueStruct!) { (bPointer: UnsafePointer<LDKInitFeatures>) in
22+
InitFeatures_eq(aPointer, bPointer)
23+
}
24+
};
25+
}
26+
1827
public func clone(orig: InitFeatures) -> InitFeatures {
1928

2029
return withUnsafePointer(to: orig.cOpaqueStruct!) { (origPointer: UnsafePointer<LDKInitFeatures>) in
2130
InitFeatures(pointer: InitFeatures_clone(origPointer))
2231
};
2332
}
2433

34+
public func supports_payment_secret() -> Bool {
35+
36+
return withUnsafePointer(to: self.cOpaqueStruct!) { (this_argPointer: UnsafePointer<LDKInitFeatures>) in
37+
InitFeatures_supports_payment_secret(this_argPointer)
38+
};
39+
}
40+
2541
public func write(obj: InitFeatures) -> [UInt8] {
2642

2743
return Bindings.LDKCVec_u8Z_to_array(nativeType: withUnsafePointer(to: obj.cOpaqueStruct!) { (objPointer: UnsafePointer<LDKInitFeatures>) in

bindings/LDK/structs/Invoice.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,15 @@ public class Invoice {
1010

1111
/* STRUCT_METHODS_START */
1212

13+
public func eq(a: Invoice, b: Invoice) -> Bool {
14+
15+
return withUnsafePointer(to: a.cOpaqueStruct!) { (aPointer: UnsafePointer<LDKInvoice>) in
16+
withUnsafePointer(to: b.cOpaqueStruct!) { (bPointer: UnsafePointer<LDKInvoice>) in
17+
Invoice_eq(aPointer, bPointer)
18+
}
19+
};
20+
}
21+
1322
public func clone(orig: Invoice) -> Invoice {
1423

1524
return withUnsafePointer(to: orig.cOpaqueStruct!) { (origPointer: UnsafePointer<LDKInvoice>) in

bindings/LDK/structs/InvoiceFeatures.swift

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,29 @@ public class InvoiceFeatures {
1515

1616
/* STRUCT_METHODS_START */
1717

18+
public func eq(a: InvoiceFeatures, b: InvoiceFeatures) -> Bool {
19+
20+
return withUnsafePointer(to: a.cOpaqueStruct!) { (aPointer: UnsafePointer<LDKInvoiceFeatures>) in
21+
withUnsafePointer(to: b.cOpaqueStruct!) { (bPointer: UnsafePointer<LDKInvoiceFeatures>) in
22+
InvoiceFeatures_eq(aPointer, bPointer)
23+
}
24+
};
25+
}
26+
1827
public func clone(orig: InvoiceFeatures) -> InvoiceFeatures {
1928

2029
return withUnsafePointer(to: orig.cOpaqueStruct!) { (origPointer: UnsafePointer<LDKInvoiceFeatures>) in
2130
InvoiceFeatures(pointer: InvoiceFeatures_clone(origPointer))
2231
};
2332
}
2433

34+
public func supports_payment_secret() -> Bool {
35+
36+
return withUnsafePointer(to: self.cOpaqueStruct!) { (this_argPointer: UnsafePointer<LDKInvoiceFeatures>) in
37+
InvoiceFeatures_supports_payment_secret(this_argPointer)
38+
};
39+
}
40+
2541
public func write(obj: InvoiceFeatures) -> [UInt8] {
2642

2743
return Bindings.LDKCVec_u8Z_to_array(nativeType: withUnsafePointer(to: obj.cOpaqueStruct!) { (objPointer: UnsafePointer<LDKInvoiceFeatures>) in

bindings/LDK/structs/InvoiceSignature.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,15 @@ public class InvoiceSignature {
1010

1111
/* STRUCT_METHODS_START */
1212

13+
public func eq(a: InvoiceSignature, b: InvoiceSignature) -> Bool {
14+
15+
return withUnsafePointer(to: a.cOpaqueStruct!) { (aPointer: UnsafePointer<LDKInvoiceSignature>) in
16+
withUnsafePointer(to: b.cOpaqueStruct!) { (bPointer: UnsafePointer<LDKInvoiceSignature>) in
17+
InvoiceSignature_eq(aPointer, bPointer)
18+
}
19+
};
20+
}
21+
1322
public func clone(orig: InvoiceSignature) -> InvoiceSignature {
1423

1524
return withUnsafePointer(to: orig.cOpaqueStruct!) { (origPointer: UnsafePointer<LDKInvoiceSignature>) in

bindings/LDK/structs/MinFinalCltvExpiry.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,15 @@ public class MinFinalCltvExpiry {
1010

1111
/* STRUCT_METHODS_START */
1212

13+
public func eq(a: MinFinalCltvExpiry, b: MinFinalCltvExpiry) -> Bool {
14+
15+
return withUnsafePointer(to: a.cOpaqueStruct!) { (aPointer: UnsafePointer<LDKMinFinalCltvExpiry>) in
16+
withUnsafePointer(to: b.cOpaqueStruct!) { (bPointer: UnsafePointer<LDKMinFinalCltvExpiry>) in
17+
MinFinalCltvExpiry_eq(aPointer, bPointer)
18+
}
19+
};
20+
}
21+
1322
public func clone(orig: MinFinalCltvExpiry) -> MinFinalCltvExpiry {
1423

1524
return withUnsafePointer(to: orig.cOpaqueStruct!) { (origPointer: UnsafePointer<LDKMinFinalCltvExpiry>) in

bindings/LDK/structs/NodeFeatures.swift

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,29 @@ public class NodeFeatures {
1515

1616
/* STRUCT_METHODS_START */
1717

18+
public func eq(a: NodeFeatures, b: NodeFeatures) -> Bool {
19+
20+
return withUnsafePointer(to: a.cOpaqueStruct!) { (aPointer: UnsafePointer<LDKNodeFeatures>) in
21+
withUnsafePointer(to: b.cOpaqueStruct!) { (bPointer: UnsafePointer<LDKNodeFeatures>) in
22+
NodeFeatures_eq(aPointer, bPointer)
23+
}
24+
};
25+
}
26+
1827
public func clone(orig: NodeFeatures) -> NodeFeatures {
1928

2029
return withUnsafePointer(to: orig.cOpaqueStruct!) { (origPointer: UnsafePointer<LDKNodeFeatures>) in
2130
NodeFeatures(pointer: NodeFeatures_clone(origPointer))
2231
};
2332
}
2433

34+
public func supports_payment_secret() -> Bool {
35+
36+
return withUnsafePointer(to: self.cOpaqueStruct!) { (this_argPointer: UnsafePointer<LDKNodeFeatures>) in
37+
NodeFeatures_supports_payment_secret(this_argPointer)
38+
};
39+
}
40+
2541
public func write(obj: NodeFeatures) -> [UInt8] {
2642

2743
return Bindings.LDKCVec_u8Z_to_array(nativeType: withUnsafePointer(to: obj.cOpaqueStruct!) { (objPointer: UnsafePointer<LDKNodeFeatures>) in

bindings/LDK/structs/OutPoint.swift

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,22 @@ OutPoint(pointer: OutPoint_clone(origPointer))
5252
};
5353
}
5454

55+
public func eq(a: OutPoint, b: OutPoint) -> Bool {
56+
57+
return withUnsafePointer(to: a.cOpaqueStruct!) { (aPointer: UnsafePointer<LDKOutPoint>) in
58+
withUnsafePointer(to: b.cOpaqueStruct!) { (bPointer: UnsafePointer<LDKOutPoint>) in
59+
OutPoint_eq(aPointer, bPointer)
60+
}
61+
};
62+
}
63+
64+
public func hash(o: OutPoint) -> UInt64 {
65+
66+
return withUnsafePointer(to: o.cOpaqueStruct!) { (oPointer: UnsafePointer<LDKOutPoint>) in
67+
OutPoint_hash(oPointer)
68+
};
69+
}
70+
5571
public func to_channel_id() -> [UInt8] {
5672

5773
return Bindings.LDKThirtyTwoBytes_to_array(nativeType: withUnsafePointer(to: self.cOpaqueStruct!) { (this_argPointer: UnsafePointer<LDKOutPoint>) in

bindings/LDK/structs/PayeePubKey.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,15 @@ public class PayeePubKey {
1010

1111
/* STRUCT_METHODS_START */
1212

13+
public func eq(a: PayeePubKey, b: PayeePubKey) -> Bool {
14+
15+
return withUnsafePointer(to: a.cOpaqueStruct!) { (aPointer: UnsafePointer<LDKPayeePubKey>) in
16+
withUnsafePointer(to: b.cOpaqueStruct!) { (bPointer: UnsafePointer<LDKPayeePubKey>) in
17+
PayeePubKey_eq(aPointer, bPointer)
18+
}
19+
};
20+
}
21+
1322
public func clone(orig: PayeePubKey) -> PayeePubKey {
1423

1524
return withUnsafePointer(to: orig.cOpaqueStruct!) { (origPointer: UnsafePointer<LDKPayeePubKey>) in

0 commit comments

Comments
 (0)