3 public class UpdateAddHTLC {
5 public internal(set) var cOpaqueStruct: LDKUpdateAddHTLC?;
9 public init(pointer: LDKUpdateAddHTLC){
10 self.cOpaqueStruct = pointer
13 /* STRUCT_METHODS_START */
15 public func get_channel_id() -> [UInt8] {
17 return Bindings.tuple32_to_array(nativeType: withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKUpdateAddHTLC>) in
18 UpdateAddHTLC_get_channel_id(this_ptrPointer)
22 public func set_channel_id(val: [UInt8]) -> Void {
24 let this_ptrPointer = UnsafeMutablePointer<LDKUpdateAddHTLC>.allocate(capacity: 1)
25 this_ptrPointer.initialize(to: self.cOpaqueStruct!)
27 return UpdateAddHTLC_set_channel_id(this_ptrPointer, Bindings.new_LDKThirtyTwoBytes(array: val));
30 public func get_htlc_id() -> UInt64 {
32 return withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKUpdateAddHTLC>) in
33 UpdateAddHTLC_get_htlc_id(this_ptrPointer)
37 public func set_htlc_id(val: UInt64) -> Void {
39 let this_ptrPointer = UnsafeMutablePointer<LDKUpdateAddHTLC>.allocate(capacity: 1)
40 this_ptrPointer.initialize(to: self.cOpaqueStruct!)
42 return UpdateAddHTLC_set_htlc_id(this_ptrPointer, val);
45 public func get_amount_msat() -> UInt64 {
47 return withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKUpdateAddHTLC>) in
48 UpdateAddHTLC_get_amount_msat(this_ptrPointer)
52 public func set_amount_msat(val: UInt64) -> Void {
54 let this_ptrPointer = UnsafeMutablePointer<LDKUpdateAddHTLC>.allocate(capacity: 1)
55 this_ptrPointer.initialize(to: self.cOpaqueStruct!)
57 return UpdateAddHTLC_set_amount_msat(this_ptrPointer, val);
60 public func get_payment_hash() -> [UInt8] {
62 return Bindings.tuple32_to_array(nativeType: withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKUpdateAddHTLC>) in
63 UpdateAddHTLC_get_payment_hash(this_ptrPointer)
67 public func set_payment_hash(val: [UInt8]) -> Void {
69 let this_ptrPointer = UnsafeMutablePointer<LDKUpdateAddHTLC>.allocate(capacity: 1)
70 this_ptrPointer.initialize(to: self.cOpaqueStruct!)
72 return UpdateAddHTLC_set_payment_hash(this_ptrPointer, Bindings.new_LDKThirtyTwoBytes(array: val));
75 public func get_cltv_expiry() -> UInt32 {
77 return withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKUpdateAddHTLC>) in
78 UpdateAddHTLC_get_cltv_expiry(this_ptrPointer)
82 public func set_cltv_expiry(val: UInt32) -> Void {
84 let this_ptrPointer = UnsafeMutablePointer<LDKUpdateAddHTLC>.allocate(capacity: 1)
85 this_ptrPointer.initialize(to: self.cOpaqueStruct!)
87 return UpdateAddHTLC_set_cltv_expiry(this_ptrPointer, val);
90 public func clone(orig: UpdateAddHTLC) -> UpdateAddHTLC {
92 return withUnsafePointer(to: orig.cOpaqueStruct!) { (origPointer: UnsafePointer<LDKUpdateAddHTLC>) in
93 UpdateAddHTLC(pointer: UpdateAddHTLC_clone(origPointer))
97 public func write(obj: UpdateAddHTLC) -> [UInt8] {
99 return Bindings.LDKCVec_u8Z_to_array(nativeType: withUnsafePointer(to: obj.cOpaqueStruct!) { (objPointer: UnsafePointer<LDKUpdateAddHTLC>) in
100 UpdateAddHTLC_write(objPointer)
104 public func read(ser: [UInt8]) -> Result_UpdateAddHTLCDecodeErrorZ {
106 return Result_UpdateAddHTLCDecodeErrorZ(pointer: UpdateAddHTLC_read(Bindings.new_LDKu8slice(array: ser)));
111 if self.cOpaqueStruct?.is_owned == false {
115 UpdateAddHTLC_free(self.cOpaqueStruct!)
121 /* STRUCT_METHODS_END */