3 public class ChannelTransactionParameters {
5 public internal(set) var cOpaqueStruct: LDKChannelTransactionParameters?;
7 /* DEFAULT_CONSTRUCTOR_START */
8 public init(holder_pubkeys_arg: ChannelPublicKeys, holder_selected_contest_delay_arg: UInt16, is_outbound_from_holder_arg: Bool, counterparty_parameters_arg: CounterpartyChannelTransactionParameters, funding_outpoint_arg: OutPoint) {
10 self.cOpaqueStruct = ChannelTransactionParameters_new(holder_pubkeys_arg.cOpaqueStruct!, holder_selected_contest_delay_arg, is_outbound_from_holder_arg, counterparty_parameters_arg.cOpaqueStruct!, funding_outpoint_arg.cOpaqueStruct!)
12 /* DEFAULT_CONSTRUCTOR_END */
14 public init(pointer: LDKChannelTransactionParameters){
15 self.cOpaqueStruct = pointer
18 /* STRUCT_METHODS_START */
20 public func get_holder_pubkeys() -> ChannelPublicKeys {
22 return ChannelPublicKeys(pointer: withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKChannelTransactionParameters>) in
23 ChannelTransactionParameters_get_holder_pubkeys(this_ptrPointer)
27 public func set_holder_pubkeys(val: ChannelPublicKeys) -> Void {
29 let this_ptrPointer = UnsafeMutablePointer<LDKChannelTransactionParameters>.allocate(capacity: 1)
30 this_ptrPointer.initialize(to: self.cOpaqueStruct!)
32 return ChannelTransactionParameters_set_holder_pubkeys(this_ptrPointer, val.cOpaqueStruct!);
35 public func get_holder_selected_contest_delay() -> UInt16 {
37 return withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKChannelTransactionParameters>) in
38 ChannelTransactionParameters_get_holder_selected_contest_delay(this_ptrPointer)
42 public func set_holder_selected_contest_delay(val: UInt16) -> Void {
44 let this_ptrPointer = UnsafeMutablePointer<LDKChannelTransactionParameters>.allocate(capacity: 1)
45 this_ptrPointer.initialize(to: self.cOpaqueStruct!)
47 return ChannelTransactionParameters_set_holder_selected_contest_delay(this_ptrPointer, val);
50 public func get_is_outbound_from_holder() -> Bool {
52 return withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKChannelTransactionParameters>) in
53 ChannelTransactionParameters_get_is_outbound_from_holder(this_ptrPointer)
57 public func set_is_outbound_from_holder(val: Bool) -> Void {
59 let this_ptrPointer = UnsafeMutablePointer<LDKChannelTransactionParameters>.allocate(capacity: 1)
60 this_ptrPointer.initialize(to: self.cOpaqueStruct!)
62 return ChannelTransactionParameters_set_is_outbound_from_holder(this_ptrPointer, val);
65 public func get_counterparty_parameters() -> CounterpartyChannelTransactionParameters {
67 return CounterpartyChannelTransactionParameters(pointer: withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKChannelTransactionParameters>) in
68 ChannelTransactionParameters_get_counterparty_parameters(this_ptrPointer)
72 public func set_counterparty_parameters(val: CounterpartyChannelTransactionParameters) -> Void {
74 let this_ptrPointer = UnsafeMutablePointer<LDKChannelTransactionParameters>.allocate(capacity: 1)
75 this_ptrPointer.initialize(to: self.cOpaqueStruct!)
77 return ChannelTransactionParameters_set_counterparty_parameters(this_ptrPointer, val.cOpaqueStruct!);
80 public func get_funding_outpoint() -> OutPoint {
82 return OutPoint(pointer: withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKChannelTransactionParameters>) in
83 ChannelTransactionParameters_get_funding_outpoint(this_ptrPointer)
87 public func set_funding_outpoint(val: OutPoint) -> Void {
89 let this_ptrPointer = UnsafeMutablePointer<LDKChannelTransactionParameters>.allocate(capacity: 1)
90 this_ptrPointer.initialize(to: self.cOpaqueStruct!)
92 return ChannelTransactionParameters_set_funding_outpoint(this_ptrPointer, val.cOpaqueStruct!);
95 public func clone(orig: ChannelTransactionParameters) -> ChannelTransactionParameters {
97 return withUnsafePointer(to: orig.cOpaqueStruct!) { (origPointer: UnsafePointer<LDKChannelTransactionParameters>) in
98 ChannelTransactionParameters(pointer: ChannelTransactionParameters_clone(origPointer))
102 public func is_populated() -> Bool {
104 return withUnsafePointer(to: self.cOpaqueStruct!) { (this_argPointer: UnsafePointer<LDKChannelTransactionParameters>) in
105 ChannelTransactionParameters_is_populated(this_argPointer)
109 public func as_holder_broadcastable() -> DirectedChannelTransactionParameters {
111 return DirectedChannelTransactionParameters(pointer: withUnsafePointer(to: self.cOpaqueStruct!) { (this_argPointer: UnsafePointer<LDKChannelTransactionParameters>) in
112 ChannelTransactionParameters_as_holder_broadcastable(this_argPointer)
116 public func as_counterparty_broadcastable() -> DirectedChannelTransactionParameters {
118 return DirectedChannelTransactionParameters(pointer: withUnsafePointer(to: self.cOpaqueStruct!) { (this_argPointer: UnsafePointer<LDKChannelTransactionParameters>) in
119 ChannelTransactionParameters_as_counterparty_broadcastable(this_argPointer)
123 public func write(obj: ChannelTransactionParameters) -> [UInt8] {
125 return Bindings.LDKCVec_u8Z_to_array(nativeType: withUnsafePointer(to: obj.cOpaqueStruct!) { (objPointer: UnsafePointer<LDKChannelTransactionParameters>) in
126 ChannelTransactionParameters_write(objPointer)
130 public func read(ser: [UInt8]) -> Result_ChannelTransactionParametersDecodeErrorZ {
132 return Result_ChannelTransactionParametersDecodeErrorZ(pointer: ChannelTransactionParameters_read(Bindings.new_LDKu8slice(array: ser)));
137 if self.cOpaqueStruct?.is_owned == false {
141 ChannelTransactionParameters_free(self.cOpaqueStruct!)
147 /* STRUCT_METHODS_END */