3 public class ChannelConfig {
5 public internal(set) var cOpaqueStruct: LDKChannelConfig?;
7 /* DEFAULT_CONSTRUCTOR_START */
10 self.cOpaqueStruct = ChannelConfig_default()
12 /* DEFAULT_CONSTRUCTOR_END */
14 public init(pointer: LDKChannelConfig){
15 self.cOpaqueStruct = pointer
18 /* STRUCT_METHODS_START */
20 public func get_forwarding_fee_proportional_millionths() -> UInt32 {
22 return withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKChannelConfig>) in
23 ChannelConfig_get_forwarding_fee_proportional_millionths(this_ptrPointer)
27 public func set_forwarding_fee_proportional_millionths(val: UInt32) -> Void {
29 let this_ptrPointer = UnsafeMutablePointer<LDKChannelConfig>.allocate(capacity: 1)
30 this_ptrPointer.initialize(to: self.cOpaqueStruct!)
32 return ChannelConfig_set_forwarding_fee_proportional_millionths(this_ptrPointer, val);
35 public func get_forwarding_fee_base_msat() -> UInt32 {
37 return withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKChannelConfig>) in
38 ChannelConfig_get_forwarding_fee_base_msat(this_ptrPointer)
42 public func set_forwarding_fee_base_msat(val: UInt32) -> Void {
44 let this_ptrPointer = UnsafeMutablePointer<LDKChannelConfig>.allocate(capacity: 1)
45 this_ptrPointer.initialize(to: self.cOpaqueStruct!)
47 return ChannelConfig_set_forwarding_fee_base_msat(this_ptrPointer, val);
50 public func get_cltv_expiry_delta() -> UInt16 {
52 return withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKChannelConfig>) in
53 ChannelConfig_get_cltv_expiry_delta(this_ptrPointer)
57 public func set_cltv_expiry_delta(val: UInt16) -> Void {
59 let this_ptrPointer = UnsafeMutablePointer<LDKChannelConfig>.allocate(capacity: 1)
60 this_ptrPointer.initialize(to: self.cOpaqueStruct!)
62 return ChannelConfig_set_cltv_expiry_delta(this_ptrPointer, val);
65 public func get_announced_channel() -> Bool {
67 return withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKChannelConfig>) in
68 ChannelConfig_get_announced_channel(this_ptrPointer)
72 public func set_announced_channel(val: Bool) -> Void {
74 let this_ptrPointer = UnsafeMutablePointer<LDKChannelConfig>.allocate(capacity: 1)
75 this_ptrPointer.initialize(to: self.cOpaqueStruct!)
77 return ChannelConfig_set_announced_channel(this_ptrPointer, val);
80 public func get_commit_upfront_shutdown_pubkey() -> Bool {
82 return withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKChannelConfig>) in
83 ChannelConfig_get_commit_upfront_shutdown_pubkey(this_ptrPointer)
87 public func set_commit_upfront_shutdown_pubkey(val: Bool) -> Void {
89 let this_ptrPointer = UnsafeMutablePointer<LDKChannelConfig>.allocate(capacity: 1)
90 this_ptrPointer.initialize(to: self.cOpaqueStruct!)
92 return ChannelConfig_set_commit_upfront_shutdown_pubkey(this_ptrPointer, val);
95 public func clone(orig: ChannelConfig) -> ChannelConfig {
97 return withUnsafePointer(to: orig.cOpaqueStruct!) { (origPointer: UnsafePointer<LDKChannelConfig>) in
98 ChannelConfig(pointer: ChannelConfig_clone(origPointer))
102 public func write(obj: ChannelConfig) -> [UInt8] {
104 return Bindings.LDKCVec_u8Z_to_array(nativeType: withUnsafePointer(to: obj.cOpaqueStruct!) { (objPointer: UnsafePointer<LDKChannelConfig>) in
105 ChannelConfig_write(objPointer)
109 public func read(ser: [UInt8]) -> Result_ChannelConfigDecodeErrorZ {
111 return Result_ChannelConfigDecodeErrorZ(pointer: ChannelConfig_read(Bindings.new_LDKu8slice(array: ser)));
116 if self.cOpaqueStruct?.is_owned == false {
120 ChannelConfig_free(self.cOpaqueStruct!)
126 /* STRUCT_METHODS_END */