3 public class UpdateFee {
5 public internal(set) var cOpaqueStruct: LDKUpdateFee?;
7 /* DEFAULT_CONSTRUCTOR_START */
8 public init(channel_id_arg: [UInt8], feerate_per_kw_arg: UInt32) {
10 self.cOpaqueStruct = UpdateFee_new(Bindings.new_LDKThirtyTwoBytes(array: channel_id_arg), feerate_per_kw_arg)
12 /* DEFAULT_CONSTRUCTOR_END */
14 public init(pointer: LDKUpdateFee){
15 self.cOpaqueStruct = pointer
18 /* STRUCT_METHODS_START */
20 public func get_channel_id() -> [UInt8] {
22 return Bindings.tuple32_to_array(nativeType: withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKUpdateFee>) in
23 UpdateFee_get_channel_id(this_ptrPointer)
27 public func set_channel_id(val: [UInt8]) -> Void {
29 let this_ptrPointer = UnsafeMutablePointer<LDKUpdateFee>.allocate(capacity: 1)
30 this_ptrPointer.initialize(to: self.cOpaqueStruct!)
32 return UpdateFee_set_channel_id(this_ptrPointer, Bindings.new_LDKThirtyTwoBytes(array: val));
35 public func get_feerate_per_kw() -> UInt32 {
37 return withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKUpdateFee>) in
38 UpdateFee_get_feerate_per_kw(this_ptrPointer)
42 public func set_feerate_per_kw(val: UInt32) -> Void {
44 let this_ptrPointer = UnsafeMutablePointer<LDKUpdateFee>.allocate(capacity: 1)
45 this_ptrPointer.initialize(to: self.cOpaqueStruct!)
47 return UpdateFee_set_feerate_per_kw(this_ptrPointer, val);
50 public func clone(orig: UpdateFee) -> UpdateFee {
52 return withUnsafePointer(to: orig.cOpaqueStruct!) { (origPointer: UnsafePointer<LDKUpdateFee>) in
53 UpdateFee(pointer: UpdateFee_clone(origPointer))
57 public func write(obj: UpdateFee) -> [UInt8] {
59 return Bindings.LDKCVec_u8Z_to_array(nativeType: withUnsafePointer(to: obj.cOpaqueStruct!) { (objPointer: UnsafePointer<LDKUpdateFee>) in
60 UpdateFee_write(objPointer)
64 public func read(ser: [UInt8]) -> Result_UpdateFeeDecodeErrorZ {
66 return Result_UpdateFeeDecodeErrorZ(pointer: UpdateFee_read(Bindings.new_LDKu8slice(array: ser)));
71 if self.cOpaqueStruct?.is_owned == false {
75 UpdateFee_free(self.cOpaqueStruct!)
81 /* STRUCT_METHODS_END */