3 public class ChannelPublicKeys {
5 public internal(set) var cOpaqueStruct: LDKChannelPublicKeys?;
7 /* DEFAULT_CONSTRUCTOR_START */
8 public init(funding_pubkey_arg: [UInt8], revocation_basepoint_arg: [UInt8], payment_point_arg: [UInt8], delayed_payment_basepoint_arg: [UInt8], htlc_basepoint_arg: [UInt8]) {
10 self.cOpaqueStruct = ChannelPublicKeys_new(Bindings.new_LDKPublicKey(array: funding_pubkey_arg), Bindings.new_LDKPublicKey(array: revocation_basepoint_arg), Bindings.new_LDKPublicKey(array: payment_point_arg), Bindings.new_LDKPublicKey(array: delayed_payment_basepoint_arg), Bindings.new_LDKPublicKey(array: htlc_basepoint_arg))
12 /* DEFAULT_CONSTRUCTOR_END */
14 public init(pointer: LDKChannelPublicKeys){
15 self.cOpaqueStruct = pointer
18 /* STRUCT_METHODS_START */
20 public func get_funding_pubkey() -> [UInt8] {
22 return Bindings.LDKPublicKey_to_array(nativeType: withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKChannelPublicKeys>) in
23 ChannelPublicKeys_get_funding_pubkey(this_ptrPointer)
27 public func set_funding_pubkey(val: [UInt8]) -> Void {
29 let this_ptrPointer = UnsafeMutablePointer<LDKChannelPublicKeys>.allocate(capacity: 1)
30 this_ptrPointer.initialize(to: self.cOpaqueStruct!)
32 return ChannelPublicKeys_set_funding_pubkey(this_ptrPointer, Bindings.new_LDKPublicKey(array: val));
35 public func get_revocation_basepoint() -> [UInt8] {
37 return Bindings.LDKPublicKey_to_array(nativeType: withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKChannelPublicKeys>) in
38 ChannelPublicKeys_get_revocation_basepoint(this_ptrPointer)
42 public func set_revocation_basepoint(val: [UInt8]) -> Void {
44 let this_ptrPointer = UnsafeMutablePointer<LDKChannelPublicKeys>.allocate(capacity: 1)
45 this_ptrPointer.initialize(to: self.cOpaqueStruct!)
47 return ChannelPublicKeys_set_revocation_basepoint(this_ptrPointer, Bindings.new_LDKPublicKey(array: val));
50 public func get_payment_point() -> [UInt8] {
52 return Bindings.LDKPublicKey_to_array(nativeType: withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKChannelPublicKeys>) in
53 ChannelPublicKeys_get_payment_point(this_ptrPointer)
57 public func set_payment_point(val: [UInt8]) -> Void {
59 let this_ptrPointer = UnsafeMutablePointer<LDKChannelPublicKeys>.allocate(capacity: 1)
60 this_ptrPointer.initialize(to: self.cOpaqueStruct!)
62 return ChannelPublicKeys_set_payment_point(this_ptrPointer, Bindings.new_LDKPublicKey(array: val));
65 public func get_delayed_payment_basepoint() -> [UInt8] {
67 return Bindings.LDKPublicKey_to_array(nativeType: withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKChannelPublicKeys>) in
68 ChannelPublicKeys_get_delayed_payment_basepoint(this_ptrPointer)
72 public func set_delayed_payment_basepoint(val: [UInt8]) -> Void {
74 let this_ptrPointer = UnsafeMutablePointer<LDKChannelPublicKeys>.allocate(capacity: 1)
75 this_ptrPointer.initialize(to: self.cOpaqueStruct!)
77 return ChannelPublicKeys_set_delayed_payment_basepoint(this_ptrPointer, Bindings.new_LDKPublicKey(array: val));
80 public func get_htlc_basepoint() -> [UInt8] {
82 return Bindings.LDKPublicKey_to_array(nativeType: withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKChannelPublicKeys>) in
83 ChannelPublicKeys_get_htlc_basepoint(this_ptrPointer)
87 public func set_htlc_basepoint(val: [UInt8]) -> Void {
89 let this_ptrPointer = UnsafeMutablePointer<LDKChannelPublicKeys>.allocate(capacity: 1)
90 this_ptrPointer.initialize(to: self.cOpaqueStruct!)
92 return ChannelPublicKeys_set_htlc_basepoint(this_ptrPointer, Bindings.new_LDKPublicKey(array: val));
95 public func clone(orig: ChannelPublicKeys) -> ChannelPublicKeys {
97 return withUnsafePointer(to: orig.cOpaqueStruct!) { (origPointer: UnsafePointer<LDKChannelPublicKeys>) in
98 ChannelPublicKeys(pointer: ChannelPublicKeys_clone(origPointer))
102 public func write(obj: ChannelPublicKeys) -> [UInt8] {
104 return Bindings.LDKCVec_u8Z_to_array(nativeType: withUnsafePointer(to: obj.cOpaqueStruct!) { (objPointer: UnsafePointer<LDKChannelPublicKeys>) in
105 ChannelPublicKeys_write(objPointer)
109 public func read(ser: [UInt8]) -> Result_ChannelPublicKeysDecodeErrorZ {
111 return Result_ChannelPublicKeysDecodeErrorZ(pointer: ChannelPublicKeys_read(Bindings.new_LDKu8slice(array: ser)));
116 if self.cOpaqueStruct?.is_owned == false {
120 ChannelPublicKeys_free(self.cOpaqueStruct!)
126 /* STRUCT_METHODS_END */