-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
2,919 additions
and
2,012 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
public class Option_u16Z { | ||
|
||
public internal(set) var cOpaqueStruct: LDKCOption_u16Z?; | ||
|
||
/* DEFAULT_CONSTRUCTOR_START */ | ||
public init(value: UInt16?) { | ||
|
||
self.cOpaqueStruct = LDKCOption_u16Z() | ||
if let value = value { | ||
self.cOpaqueStruct!.tag = LDKCOption_u16Z_Some | ||
self.cOpaqueStruct!.some = value | ||
} else { | ||
self.cOpaqueStruct!.tag = LDKCOption_u16Z_None | ||
} | ||
|
||
|
||
} | ||
/* DEFAULT_CONSTRUCTOR_END */ | ||
|
||
public init(pointer: LDKCOption_u16Z){ | ||
self.cOpaqueStruct = pointer | ||
} | ||
|
||
/* OPTION_METHODS_START */ | ||
|
||
public func getValue() -> UInt16? { | ||
|
||
|
||
if self.cOpaqueStruct!.tag == LDKCOption_u16Z_None { | ||
return nil | ||
} | ||
if self.cOpaqueStruct!.tag == LDKCOption_u16Z_Some { | ||
return self.cOpaqueStruct!.some | ||
} | ||
assert(false, "invalid option enum value") | ||
return nil | ||
|
||
|
||
} | ||
|
||
/* OPTION_METHODS_END */ | ||
|
||
/* TYPE_CLASSES */ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
public class ChannelCounterparty { | ||
|
||
public internal(set) var cOpaqueStruct: LDKChannelCounterparty?; | ||
|
||
|
||
|
||
public init(pointer: LDKChannelCounterparty){ | ||
self.cOpaqueStruct = pointer | ||
} | ||
|
||
/* STRUCT_METHODS_START */ | ||
|
||
public func get_node_id() -> [UInt8] { | ||
|
||
return Bindings.LDKPublicKey_to_array(nativeType: withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKChannelCounterparty>) in | ||
ChannelCounterparty_get_node_id(this_ptrPointer) | ||
}); | ||
} | ||
|
||
public func set_node_id(val: [UInt8]) -> Void { | ||
|
||
let this_ptrPointer = UnsafeMutablePointer<LDKChannelCounterparty>.allocate(capacity: 1) | ||
this_ptrPointer.initialize(to: self.cOpaqueStruct!) | ||
|
||
return ChannelCounterparty_set_node_id(this_ptrPointer, Bindings.new_LDKPublicKey(array: val)); | ||
} | ||
|
||
public func get_features() -> InitFeatures { | ||
|
||
return InitFeatures(pointer: withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKChannelCounterparty>) in | ||
ChannelCounterparty_get_features(this_ptrPointer) | ||
}); | ||
} | ||
|
||
public func set_features(val: InitFeatures) -> Void { | ||
|
||
let this_ptrPointer = UnsafeMutablePointer<LDKChannelCounterparty>.allocate(capacity: 1) | ||
this_ptrPointer.initialize(to: self.cOpaqueStruct!) | ||
|
||
return ChannelCounterparty_set_features(this_ptrPointer, val.cOpaqueStruct!); | ||
} | ||
|
||
public func get_unspendable_punishment_reserve() -> UInt64 { | ||
|
||
return withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKChannelCounterparty>) in | ||
ChannelCounterparty_get_unspendable_punishment_reserve(this_ptrPointer) | ||
}; | ||
} | ||
|
||
public func set_unspendable_punishment_reserve(val: UInt64) -> Void { | ||
|
||
let this_ptrPointer = UnsafeMutablePointer<LDKChannelCounterparty>.allocate(capacity: 1) | ||
this_ptrPointer.initialize(to: self.cOpaqueStruct!) | ||
|
||
return ChannelCounterparty_set_unspendable_punishment_reserve(this_ptrPointer, val); | ||
} | ||
|
||
public func clone(orig: ChannelCounterparty) -> ChannelCounterparty { | ||
|
||
return withUnsafePointer(to: orig.cOpaqueStruct!) { (origPointer: UnsafePointer<LDKChannelCounterparty>) in | ||
ChannelCounterparty(pointer: ChannelCounterparty_clone(origPointer)) | ||
}; | ||
} | ||
|
||
|
||
deinit { | ||
if self.cOpaqueStruct?.is_owned == false { | ||
|
||
|
||
|
||
ChannelCounterparty_free(self.cOpaqueStruct!) | ||
|
||
} | ||
|
||
} | ||
|
||
/* STRUCT_METHODS_END */ | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.