3 public class UpdateFulfillHTLC {
5 public internal(set) var cOpaqueStruct: LDKUpdateFulfillHTLC?;
7 /* DEFAULT_CONSTRUCTOR_START */
8 public init(channel_id_arg: [UInt8], htlc_id_arg: UInt64, payment_preimage_arg: [UInt8]) {
10 self.cOpaqueStruct = UpdateFulfillHTLC_new(Bindings.new_LDKThirtyTwoBytes(array: channel_id_arg), htlc_id_arg, Bindings.new_LDKThirtyTwoBytes(array: payment_preimage_arg))
12 /* DEFAULT_CONSTRUCTOR_END */
14 public init(pointer: LDKUpdateFulfillHTLC){
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<LDKUpdateFulfillHTLC>) in
23 UpdateFulfillHTLC_get_channel_id(this_ptrPointer)
27 public func set_channel_id(val: [UInt8]) -> Void {
29 let this_ptrPointer = UnsafeMutablePointer<LDKUpdateFulfillHTLC>.allocate(capacity: 1)
30 this_ptrPointer.initialize(to: self.cOpaqueStruct!)
32 return UpdateFulfillHTLC_set_channel_id(this_ptrPointer, Bindings.new_LDKThirtyTwoBytes(array: val));
35 public func get_htlc_id() -> UInt64 {
37 return withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKUpdateFulfillHTLC>) in
38 UpdateFulfillHTLC_get_htlc_id(this_ptrPointer)
42 public func set_htlc_id(val: UInt64) -> Void {
44 let this_ptrPointer = UnsafeMutablePointer<LDKUpdateFulfillHTLC>.allocate(capacity: 1)
45 this_ptrPointer.initialize(to: self.cOpaqueStruct!)
47 return UpdateFulfillHTLC_set_htlc_id(this_ptrPointer, val);
50 public func get_payment_preimage() -> [UInt8] {
52 return Bindings.tuple32_to_array(nativeType: withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKUpdateFulfillHTLC>) in
53 UpdateFulfillHTLC_get_payment_preimage(this_ptrPointer)
57 public func set_payment_preimage(val: [UInt8]) -> Void {
59 let this_ptrPointer = UnsafeMutablePointer<LDKUpdateFulfillHTLC>.allocate(capacity: 1)
60 this_ptrPointer.initialize(to: self.cOpaqueStruct!)
62 return UpdateFulfillHTLC_set_payment_preimage(this_ptrPointer, Bindings.new_LDKThirtyTwoBytes(array: val));
65 public func clone(orig: UpdateFulfillHTLC) -> UpdateFulfillHTLC {
67 return withUnsafePointer(to: orig.cOpaqueStruct!) { (origPointer: UnsafePointer<LDKUpdateFulfillHTLC>) in
68 UpdateFulfillHTLC(pointer: UpdateFulfillHTLC_clone(origPointer))
72 public func write(obj: UpdateFulfillHTLC) -> [UInt8] {
74 return Bindings.LDKCVec_u8Z_to_array(nativeType: withUnsafePointer(to: obj.cOpaqueStruct!) { (objPointer: UnsafePointer<LDKUpdateFulfillHTLC>) in
75 UpdateFulfillHTLC_write(objPointer)
79 public func read(ser: [UInt8]) -> Result_UpdateFulfillHTLCDecodeErrorZ {
81 return Result_UpdateFulfillHTLCDecodeErrorZ(pointer: UpdateFulfillHTLC_read(Bindings.new_LDKu8slice(array: ser)));
86 if self.cOpaqueStruct?.is_owned == false {
90 UpdateFulfillHTLC_free(self.cOpaqueStruct!)
96 /* STRUCT_METHODS_END */