3 public class RouteHintHop {
5 public internal(set) var cOpaqueStruct: LDKRouteHintHop?;
7 /* DEFAULT_CONSTRUCTOR_START */
8 public init(src_node_id_arg: [UInt8], short_channel_id_arg: UInt64, fees_arg: RoutingFees, cltv_expiry_delta_arg: UInt16, htlc_minimum_msat_arg: Option_u64Z, htlc_maximum_msat_arg: Option_u64Z) {
10 self.cOpaqueStruct = RouteHintHop_new(Bindings.new_LDKPublicKey(array: src_node_id_arg), short_channel_id_arg, fees_arg.cOpaqueStruct!, cltv_expiry_delta_arg, htlc_minimum_msat_arg.cOpaqueStruct!, htlc_maximum_msat_arg.cOpaqueStruct!)
12 /* DEFAULT_CONSTRUCTOR_END */
14 public init(pointer: LDKRouteHintHop){
15 self.cOpaqueStruct = pointer
18 /* STRUCT_METHODS_START */
20 public func get_src_node_id() -> [UInt8] {
22 return Bindings.LDKPublicKey_to_array(nativeType: withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKRouteHintHop>) in
23 RouteHintHop_get_src_node_id(this_ptrPointer)
27 public func set_src_node_id(val: [UInt8]) -> Void {
29 let this_ptrPointer = UnsafeMutablePointer<LDKRouteHintHop>.allocate(capacity: 1)
30 this_ptrPointer.initialize(to: self.cOpaqueStruct!)
32 return RouteHintHop_set_src_node_id(this_ptrPointer, Bindings.new_LDKPublicKey(array: val));
35 public func get_short_channel_id() -> UInt64 {
37 return withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKRouteHintHop>) in
38 RouteHintHop_get_short_channel_id(this_ptrPointer)
42 public func set_short_channel_id(val: UInt64) -> Void {
44 let this_ptrPointer = UnsafeMutablePointer<LDKRouteHintHop>.allocate(capacity: 1)
45 this_ptrPointer.initialize(to: self.cOpaqueStruct!)
47 return RouteHintHop_set_short_channel_id(this_ptrPointer, val);
50 public func get_fees() -> RoutingFees {
52 return RoutingFees(pointer: withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKRouteHintHop>) in
53 RouteHintHop_get_fees(this_ptrPointer)
57 public func set_fees(val: RoutingFees) -> Void {
59 let this_ptrPointer = UnsafeMutablePointer<LDKRouteHintHop>.allocate(capacity: 1)
60 this_ptrPointer.initialize(to: self.cOpaqueStruct!)
62 return RouteHintHop_set_fees(this_ptrPointer, val.cOpaqueStruct!);
65 public func get_cltv_expiry_delta() -> UInt16 {
67 return withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKRouteHintHop>) in
68 RouteHintHop_get_cltv_expiry_delta(this_ptrPointer)
72 public func set_cltv_expiry_delta(val: UInt16) -> Void {
74 let this_ptrPointer = UnsafeMutablePointer<LDKRouteHintHop>.allocate(capacity: 1)
75 this_ptrPointer.initialize(to: self.cOpaqueStruct!)
77 return RouteHintHop_set_cltv_expiry_delta(this_ptrPointer, val);
80 public func get_htlc_minimum_msat() -> Option_u64Z {
82 return Option_u64Z(pointer: withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKRouteHintHop>) in
83 RouteHintHop_get_htlc_minimum_msat(this_ptrPointer)
87 public func set_htlc_minimum_msat(val: Option_u64Z) -> Void {
89 let this_ptrPointer = UnsafeMutablePointer<LDKRouteHintHop>.allocate(capacity: 1)
90 this_ptrPointer.initialize(to: self.cOpaqueStruct!)
92 return RouteHintHop_set_htlc_minimum_msat(this_ptrPointer, val.cOpaqueStruct!);
95 public func get_htlc_maximum_msat() -> Option_u64Z {
97 return Option_u64Z(pointer: withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKRouteHintHop>) in
98 RouteHintHop_get_htlc_maximum_msat(this_ptrPointer)
102 public func set_htlc_maximum_msat(val: Option_u64Z) -> Void {
104 let this_ptrPointer = UnsafeMutablePointer<LDKRouteHintHop>.allocate(capacity: 1)
105 this_ptrPointer.initialize(to: self.cOpaqueStruct!)
107 return RouteHintHop_set_htlc_maximum_msat(this_ptrPointer, val.cOpaqueStruct!);
110 public func eq(a: RouteHintHop, b: RouteHintHop) -> Bool {
112 return withUnsafePointer(to: a.cOpaqueStruct!) { (aPointer: UnsafePointer<LDKRouteHintHop>) in
113 withUnsafePointer(to: b.cOpaqueStruct!) { (bPointer: UnsafePointer<LDKRouteHintHop>) in
114 RouteHintHop_eq(aPointer, bPointer)
119 public func clone(orig: RouteHintHop) -> RouteHintHop {
121 return withUnsafePointer(to: orig.cOpaqueStruct!) { (origPointer: UnsafePointer<LDKRouteHintHop>) in
122 RouteHintHop(pointer: RouteHintHop_clone(origPointer))
128 if self.cOpaqueStruct?.is_owned == false {
132 RouteHintHop_free(self.cOpaqueStruct!)
138 /* STRUCT_METHODS_END */