Skip to content

Commit

Permalink
update to latest upstream version
Browse files Browse the repository at this point in the history
  • Loading branch information
arik-so committed Jun 7, 2021
1 parent ceac980 commit 0bcd7c1
Show file tree
Hide file tree
Showing 44 changed files with 12,659 additions and 11,009 deletions.
919 changes: 546 additions & 373 deletions bindings/LDK/Bindings.swift

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions bindings/LDK/structs/ChainParameters.swift
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,13 @@ ChainParameters_get_best_block(this_ptrPointer)
return ChainParameters_set_best_block(this_ptrPointer, val.cOpaqueStruct!);
}

public func clone(orig: ChainParameters) -> ChainParameters {

return withUnsafePointer(to: orig.cOpaqueStruct!) { (origPointer: UnsafePointer<LDKChainParameters>) in
ChainParameters(pointer: ChainParameters_clone(origPointer))
};
}


deinit {
if self.cOpaqueStruct?.is_owned == false {
Expand Down
68 changes: 64 additions & 4 deletions bindings/LDK/structs/ChannelDetails.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,21 @@ ChannelDetails_get_channel_id(this_ptrPointer)
return ChannelDetails_set_channel_id(this_ptrPointer, Bindings.new_LDKThirtyTwoBytes(array: val));
}

public func get_funding_txo() -> OutPoint {

return OutPoint(pointer: withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKChannelDetails>) in
ChannelDetails_get_funding_txo(this_ptrPointer)
});
}

public func set_funding_txo(val: OutPoint) -> Void {

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

return ChannelDetails_set_funding_txo(this_ptrPointer, val.cOpaqueStruct!);
}

public func get_short_channel_id() -> Option_u64Z {

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

public func get_is_live() -> Bool {
public func get_is_outbound() -> Bool {

return withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKChannelDetails>) in
ChannelDetails_get_is_outbound(this_ptrPointer)
};
}

public func set_is_outbound(val: Bool) -> Void {

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

return ChannelDetails_set_is_outbound(this_ptrPointer, val);
}

public func get_is_funding_locked() -> Bool {

return withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKChannelDetails>) in
ChannelDetails_get_is_funding_locked(this_ptrPointer)
};
}

public func set_is_funding_locked(val: Bool) -> Void {

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

return ChannelDetails_set_is_funding_locked(this_ptrPointer, val);
}

public func get_is_usable() -> Bool {

return withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKChannelDetails>) in
ChannelDetails_get_is_usable(this_ptrPointer)
};
}

public func set_is_usable(val: Bool) -> Void {

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

return ChannelDetails_set_is_usable(this_ptrPointer, val);
}

public func get_is_public() -> Bool {

return withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKChannelDetails>) in
ChannelDetails_get_is_live(this_ptrPointer)
ChannelDetails_get_is_public(this_ptrPointer)
};
}

public func set_is_live(val: Bool) -> Void {
public func set_is_public(val: Bool) -> Void {

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

return ChannelDetails_set_is_live(this_ptrPointer, val);
return ChannelDetails_set_is_public(this_ptrPointer, val);
}

public func clone(orig: ChannelDetails) -> ChannelDetails {
Expand Down
9 changes: 9 additions & 0 deletions bindings/LDK/structs/ChannelFeatures.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,15 @@ public class ChannelFeatures {

/* STRUCT_METHODS_START */

public func eq(a: ChannelFeatures, b: ChannelFeatures) -> Bool {

return withUnsafePointer(to: a.cOpaqueStruct!) { (aPointer: UnsafePointer<LDKChannelFeatures>) in
withUnsafePointer(to: b.cOpaqueStruct!) { (bPointer: UnsafePointer<LDKChannelFeatures>) in
ChannelFeatures_eq(aPointer, bPointer)
}
};
}

public func clone(orig: ChannelFeatures) -> ChannelFeatures {

return withUnsafePointer(to: orig.cOpaqueStruct!) { (origPointer: UnsafePointer<LDKChannelFeatures>) in
Expand Down
30 changes: 0 additions & 30 deletions bindings/LDK/structs/ChannelHandshakeLimits.swift
Original file line number Diff line number Diff line change
Expand Up @@ -90,36 +90,6 @@ ChannelHandshakeLimits_get_min_max_accepted_htlcs(this_ptrPointer)
return ChannelHandshakeLimits_set_min_max_accepted_htlcs(this_ptrPointer, val);
}

public func get_min_dust_limit_satoshis() -> UInt64 {

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

public func set_min_dust_limit_satoshis(val: UInt64) -> Void {

let this_ptrPointer = UnsafeMutablePointer<LDKChannelHandshakeLimits>.allocate(capacity: 1)
this_ptrPointer.initialize(to: self.cOpaqueStruct!)

return ChannelHandshakeLimits_set_min_dust_limit_satoshis(this_ptrPointer, val);
}

public func get_max_dust_limit_satoshis() -> UInt64 {

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

public func set_max_dust_limit_satoshis(val: UInt64) -> Void {

let this_ptrPointer = UnsafeMutablePointer<LDKChannelHandshakeLimits>.allocate(capacity: 1)
this_ptrPointer.initialize(to: self.cOpaqueStruct!)

return ChannelHandshakeLimits_set_max_dust_limit_satoshis(this_ptrPointer, val);
}

public func get_max_minimum_depth() -> UInt32 {

return withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKChannelHandshakeLimits>) in
Expand Down
12 changes: 12 additions & 0 deletions bindings/LDK/structs/DelayedPaymentOutputDescriptor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,18 @@ DelayedPaymentOutputDescriptor(pointer: DelayedPaymentOutputDescriptor_clone(ori
};
}

public func write(obj: DelayedPaymentOutputDescriptor) -> [UInt8] {

return Bindings.LDKCVec_u8Z_to_array(nativeType: withUnsafePointer(to: obj.cOpaqueStruct!) { (objPointer: UnsafePointer<LDKDelayedPaymentOutputDescriptor>) in
DelayedPaymentOutputDescriptor_write(objPointer)
});
}

public func read(ser: [UInt8]) -> Result_DelayedPaymentOutputDescriptorDecodeErrorZ {

return Result_DelayedPaymentOutputDescriptorDecodeErrorZ(pointer: DelayedPaymentOutputDescriptor_read(Bindings.new_LDKu8slice(array: ser)));
}


deinit {
if self.cOpaqueStruct?.is_owned == false {
Expand Down
9 changes: 9 additions & 0 deletions bindings/LDK/structs/Description.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,15 @@ public class Description {

/* STRUCT_METHODS_START */

public func eq(a: Description, b: Description) -> Bool {

return withUnsafePointer(to: a.cOpaqueStruct!) { (aPointer: UnsafePointer<LDKDescription>) in
withUnsafePointer(to: b.cOpaqueStruct!) { (bPointer: UnsafePointer<LDKDescription>) in
Description_eq(aPointer, bPointer)
}
};
}

public func clone(orig: Description) -> Description {

return withUnsafePointer(to: orig.cOpaqueStruct!) { (origPointer: UnsafePointer<LDKDescription>) in
Expand Down
9 changes: 9 additions & 0 deletions bindings/LDK/structs/ExpiryTime.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,15 @@ public class ExpiryTime {

/* STRUCT_METHODS_START */

public func eq(a: ExpiryTime, b: ExpiryTime) -> Bool {

return withUnsafePointer(to: a.cOpaqueStruct!) { (aPointer: UnsafePointer<LDKExpiryTime>) in
withUnsafePointer(to: b.cOpaqueStruct!) { (bPointer: UnsafePointer<LDKExpiryTime>) in
ExpiryTime_eq(aPointer, bPointer)
}
};
}

public func clone(orig: ExpiryTime) -> ExpiryTime {

return withUnsafePointer(to: orig.cOpaqueStruct!) { (origPointer: UnsafePointer<LDKExpiryTime>) in
Expand Down
16 changes: 16 additions & 0 deletions bindings/LDK/structs/InitFeatures.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,29 @@ public class InitFeatures {

/* STRUCT_METHODS_START */

public func eq(a: InitFeatures, b: InitFeatures) -> Bool {

return withUnsafePointer(to: a.cOpaqueStruct!) { (aPointer: UnsafePointer<LDKInitFeatures>) in
withUnsafePointer(to: b.cOpaqueStruct!) { (bPointer: UnsafePointer<LDKInitFeatures>) in
InitFeatures_eq(aPointer, bPointer)
}
};
}

public func clone(orig: InitFeatures) -> InitFeatures {

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

public func supports_payment_secret() -> Bool {

return withUnsafePointer(to: self.cOpaqueStruct!) { (this_argPointer: UnsafePointer<LDKInitFeatures>) in
InitFeatures_supports_payment_secret(this_argPointer)
};
}

public func write(obj: InitFeatures) -> [UInt8] {

return Bindings.LDKCVec_u8Z_to_array(nativeType: withUnsafePointer(to: obj.cOpaqueStruct!) { (objPointer: UnsafePointer<LDKInitFeatures>) in
Expand Down
9 changes: 9 additions & 0 deletions bindings/LDK/structs/Invoice.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,15 @@ public class Invoice {

/* STRUCT_METHODS_START */

public func eq(a: Invoice, b: Invoice) -> Bool {

return withUnsafePointer(to: a.cOpaqueStruct!) { (aPointer: UnsafePointer<LDKInvoice>) in
withUnsafePointer(to: b.cOpaqueStruct!) { (bPointer: UnsafePointer<LDKInvoice>) in
Invoice_eq(aPointer, bPointer)
}
};
}

public func clone(orig: Invoice) -> Invoice {

return withUnsafePointer(to: orig.cOpaqueStruct!) { (origPointer: UnsafePointer<LDKInvoice>) in
Expand Down
16 changes: 16 additions & 0 deletions bindings/LDK/structs/InvoiceFeatures.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,29 @@ public class InvoiceFeatures {

/* STRUCT_METHODS_START */

public func eq(a: InvoiceFeatures, b: InvoiceFeatures) -> Bool {

return withUnsafePointer(to: a.cOpaqueStruct!) { (aPointer: UnsafePointer<LDKInvoiceFeatures>) in
withUnsafePointer(to: b.cOpaqueStruct!) { (bPointer: UnsafePointer<LDKInvoiceFeatures>) in
InvoiceFeatures_eq(aPointer, bPointer)
}
};
}

public func clone(orig: InvoiceFeatures) -> InvoiceFeatures {

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

public func supports_payment_secret() -> Bool {

return withUnsafePointer(to: self.cOpaqueStruct!) { (this_argPointer: UnsafePointer<LDKInvoiceFeatures>) in
InvoiceFeatures_supports_payment_secret(this_argPointer)
};
}

public func write(obj: InvoiceFeatures) -> [UInt8] {

return Bindings.LDKCVec_u8Z_to_array(nativeType: withUnsafePointer(to: obj.cOpaqueStruct!) { (objPointer: UnsafePointer<LDKInvoiceFeatures>) in
Expand Down
9 changes: 9 additions & 0 deletions bindings/LDK/structs/InvoiceSignature.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,15 @@ public class InvoiceSignature {

/* STRUCT_METHODS_START */

public func eq(a: InvoiceSignature, b: InvoiceSignature) -> Bool {

return withUnsafePointer(to: a.cOpaqueStruct!) { (aPointer: UnsafePointer<LDKInvoiceSignature>) in
withUnsafePointer(to: b.cOpaqueStruct!) { (bPointer: UnsafePointer<LDKInvoiceSignature>) in
InvoiceSignature_eq(aPointer, bPointer)
}
};
}

public func clone(orig: InvoiceSignature) -> InvoiceSignature {

return withUnsafePointer(to: orig.cOpaqueStruct!) { (origPointer: UnsafePointer<LDKInvoiceSignature>) in
Expand Down
9 changes: 9 additions & 0 deletions bindings/LDK/structs/MinFinalCltvExpiry.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,15 @@ public class MinFinalCltvExpiry {

/* STRUCT_METHODS_START */

public func eq(a: MinFinalCltvExpiry, b: MinFinalCltvExpiry) -> Bool {

return withUnsafePointer(to: a.cOpaqueStruct!) { (aPointer: UnsafePointer<LDKMinFinalCltvExpiry>) in
withUnsafePointer(to: b.cOpaqueStruct!) { (bPointer: UnsafePointer<LDKMinFinalCltvExpiry>) in
MinFinalCltvExpiry_eq(aPointer, bPointer)
}
};
}

public func clone(orig: MinFinalCltvExpiry) -> MinFinalCltvExpiry {

return withUnsafePointer(to: orig.cOpaqueStruct!) { (origPointer: UnsafePointer<LDKMinFinalCltvExpiry>) in
Expand Down
16 changes: 16 additions & 0 deletions bindings/LDK/structs/NodeFeatures.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,29 @@ public class NodeFeatures {

/* STRUCT_METHODS_START */

public func eq(a: NodeFeatures, b: NodeFeatures) -> Bool {

return withUnsafePointer(to: a.cOpaqueStruct!) { (aPointer: UnsafePointer<LDKNodeFeatures>) in
withUnsafePointer(to: b.cOpaqueStruct!) { (bPointer: UnsafePointer<LDKNodeFeatures>) in
NodeFeatures_eq(aPointer, bPointer)
}
};
}

public func clone(orig: NodeFeatures) -> NodeFeatures {

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

public func supports_payment_secret() -> Bool {

return withUnsafePointer(to: self.cOpaqueStruct!) { (this_argPointer: UnsafePointer<LDKNodeFeatures>) in
NodeFeatures_supports_payment_secret(this_argPointer)
};
}

public func write(obj: NodeFeatures) -> [UInt8] {

return Bindings.LDKCVec_u8Z_to_array(nativeType: withUnsafePointer(to: obj.cOpaqueStruct!) { (objPointer: UnsafePointer<LDKNodeFeatures>) in
Expand Down
16 changes: 16 additions & 0 deletions bindings/LDK/structs/OutPoint.swift
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,22 @@ OutPoint(pointer: OutPoint_clone(origPointer))
};
}

public func eq(a: OutPoint, b: OutPoint) -> Bool {

return withUnsafePointer(to: a.cOpaqueStruct!) { (aPointer: UnsafePointer<LDKOutPoint>) in
withUnsafePointer(to: b.cOpaqueStruct!) { (bPointer: UnsafePointer<LDKOutPoint>) in
OutPoint_eq(aPointer, bPointer)
}
};
}

public func hash(o: OutPoint) -> UInt64 {

return withUnsafePointer(to: o.cOpaqueStruct!) { (oPointer: UnsafePointer<LDKOutPoint>) in
OutPoint_hash(oPointer)
};
}

public func to_channel_id() -> [UInt8] {

return Bindings.LDKThirtyTwoBytes_to_array(nativeType: withUnsafePointer(to: self.cOpaqueStruct!) { (this_argPointer: UnsafePointer<LDKOutPoint>) in
Expand Down
9 changes: 9 additions & 0 deletions bindings/LDK/structs/PayeePubKey.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,15 @@ public class PayeePubKey {

/* STRUCT_METHODS_START */

public func eq(a: PayeePubKey, b: PayeePubKey) -> Bool {

return withUnsafePointer(to: a.cOpaqueStruct!) { (aPointer: UnsafePointer<LDKPayeePubKey>) in
withUnsafePointer(to: b.cOpaqueStruct!) { (bPointer: UnsafePointer<LDKPayeePubKey>) in
PayeePubKey_eq(aPointer, bPointer)
}
};
}

public func clone(orig: PayeePubKey) -> PayeePubKey {

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

0 comments on commit 0bcd7c1

Please sign in to comment.