3 public class CommitmentUpdate {
5 public internal(set) var cOpaqueStruct: LDKCommitmentUpdate?;
7 /* DEFAULT_CONSTRUCTOR_START */
8 public init(update_add_htlcs_arg: [LDKUpdateAddHTLC], update_fulfill_htlcs_arg: [LDKUpdateFulfillHTLC], update_fail_htlcs_arg: [LDKUpdateFailHTLC], update_fail_malformed_htlcs_arg: [LDKUpdateFailMalformedHTLC], update_fee_arg: UpdateFee, commitment_signed_arg: CommitmentSigned) {
10 self.cOpaqueStruct = CommitmentUpdate_new(Bindings.new_LDKCVec_UpdateAddHTLCZ(array: update_add_htlcs_arg), Bindings.new_LDKCVec_UpdateFulfillHTLCZ(array: update_fulfill_htlcs_arg), Bindings.new_LDKCVec_UpdateFailHTLCZ(array: update_fail_htlcs_arg), Bindings.new_LDKCVec_UpdateFailMalformedHTLCZ(array: update_fail_malformed_htlcs_arg), update_fee_arg.cOpaqueStruct!, commitment_signed_arg.cOpaqueStruct!)
12 /* DEFAULT_CONSTRUCTOR_END */
14 public init(pointer: LDKCommitmentUpdate){
15 self.cOpaqueStruct = pointer
18 /* STRUCT_METHODS_START */
20 public func set_update_add_htlcs(val: [LDKUpdateAddHTLC]) -> Void {
22 let this_ptrPointer = UnsafeMutablePointer<LDKCommitmentUpdate>.allocate(capacity: 1)
23 this_ptrPointer.initialize(to: self.cOpaqueStruct!)
25 return CommitmentUpdate_set_update_add_htlcs(this_ptrPointer, Bindings.new_LDKCVec_UpdateAddHTLCZ(array: val));
28 public func set_update_fulfill_htlcs(val: [LDKUpdateFulfillHTLC]) -> Void {
30 let this_ptrPointer = UnsafeMutablePointer<LDKCommitmentUpdate>.allocate(capacity: 1)
31 this_ptrPointer.initialize(to: self.cOpaqueStruct!)
33 return CommitmentUpdate_set_update_fulfill_htlcs(this_ptrPointer, Bindings.new_LDKCVec_UpdateFulfillHTLCZ(array: val));
36 public func set_update_fail_htlcs(val: [LDKUpdateFailHTLC]) -> Void {
38 let this_ptrPointer = UnsafeMutablePointer<LDKCommitmentUpdate>.allocate(capacity: 1)
39 this_ptrPointer.initialize(to: self.cOpaqueStruct!)
41 return CommitmentUpdate_set_update_fail_htlcs(this_ptrPointer, Bindings.new_LDKCVec_UpdateFailHTLCZ(array: val));
44 public func set_update_fail_malformed_htlcs(val: [LDKUpdateFailMalformedHTLC]) -> Void {
46 let this_ptrPointer = UnsafeMutablePointer<LDKCommitmentUpdate>.allocate(capacity: 1)
47 this_ptrPointer.initialize(to: self.cOpaqueStruct!)
49 return CommitmentUpdate_set_update_fail_malformed_htlcs(this_ptrPointer, Bindings.new_LDKCVec_UpdateFailMalformedHTLCZ(array: val));
52 public func get_update_fee() -> UpdateFee {
54 return UpdateFee(pointer: withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKCommitmentUpdate>) in
55 CommitmentUpdate_get_update_fee(this_ptrPointer)
59 public func set_update_fee(val: UpdateFee) -> Void {
61 let this_ptrPointer = UnsafeMutablePointer<LDKCommitmentUpdate>.allocate(capacity: 1)
62 this_ptrPointer.initialize(to: self.cOpaqueStruct!)
64 return CommitmentUpdate_set_update_fee(this_ptrPointer, val.cOpaqueStruct!);
67 public func get_commitment_signed() -> CommitmentSigned {
69 return CommitmentSigned(pointer: withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKCommitmentUpdate>) in
70 CommitmentUpdate_get_commitment_signed(this_ptrPointer)
74 public func set_commitment_signed(val: CommitmentSigned) -> Void {
76 let this_ptrPointer = UnsafeMutablePointer<LDKCommitmentUpdate>.allocate(capacity: 1)
77 this_ptrPointer.initialize(to: self.cOpaqueStruct!)
79 return CommitmentUpdate_set_commitment_signed(this_ptrPointer, val.cOpaqueStruct!);
82 public func clone(orig: CommitmentUpdate) -> CommitmentUpdate {
84 return withUnsafePointer(to: orig.cOpaqueStruct!) { (origPointer: UnsafePointer<LDKCommitmentUpdate>) in
85 CommitmentUpdate(pointer: CommitmentUpdate_clone(origPointer))
91 if self.cOpaqueStruct?.is_owned == false {
95 CommitmentUpdate_free(self.cOpaqueStruct!)
101 /* STRUCT_METHODS_END */