5 public var cOpaqueStruct: LDKFilter?;
9 /* NATIVE_CALLBACKS_START */
11 func register_txCallback(pointer: UnsafeRawPointer?, txidPointer: UnsafePointer<(UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8)>?, script_pubkey: LDKu8slice) -> Void {
12 let instance: Filter = Bindings.pointerToInstance(pointer: pointer!, sourceMarker: "Filter.swift::register_tx")
14 var txid: [UInt8]? = nil
15 if let txidUnwrapped = txidPointer {
16 txid = Bindings.tuple32_to_array(nativeType: txidUnwrapped.pointee)
19 return instance.register_tx(txid: txid, script_pubkey: Bindings.LDKu8slice_to_array(nativeType: script_pubkey));
22 func register_outputCallback(pointer: UnsafeRawPointer?, output: LDKWatchedOutput) -> LDKCOption_C2Tuple_usizeTransactionZZ {
23 let instance: Filter = Bindings.pointerToInstance(pointer: pointer!, sourceMarker: "Filter.swift::register_output")
25 return instance.register_output(output: WatchedOutput(pointer: output)).cOpaqueStruct!;
28 func freeCallback(pointer: UnsafeMutableRawPointer?) -> Void {
29 let instance: Filter = Bindings.pointerToInstance(pointer: pointer!, sourceMarker: "Filter.swift::free")
31 return instance.free();
34 /* NATIVE_CALLBACKS_END */
36 self.cOpaqueStruct = LDKFilter(this_arg: Bindings.instanceToPointer(instance: self),
37 register_tx: register_txCallback,
38 register_output: register_outputCallback,
42 public init(pointer: LDKFilter){
43 self.cOpaqueStruct = pointer
46 /* SWIFT_CALLBACKS_START */
48 open func register_tx(txid: [UInt8]?, script_pubkey: [UInt8]) -> Void {
53 open func register_output(output: WatchedOutput) -> Option_C2Tuple_usizeTransactionZZ {
55 return Option_C2Tuple_usizeTransactionZZ(pointer: LDKCOption_C2Tuple_usizeTransactionZZ())
58 open func free() -> Void {
63 /* SWIFT_CALLBACKS_END */
68 public class NativelyImplementedFilter: Filter {
69 /* SWIFT_DEFAULT_CALLBACKS_START */
71 public override func register_tx(txid: [UInt8]?, script_pubkey: [UInt8]) -> Void {
73 withUnsafePointer(to: Bindings.array_to_tuple32(array: txid!)) { (txidPointer: UnsafePointer<(UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8)>) in
75 self.cOpaqueStruct!.register_tx(self.cOpaqueStruct!.this_arg, txidPointer, Bindings.new_LDKu8slice(array: script_pubkey))
81 public override func register_output(output: WatchedOutput) -> Option_C2Tuple_usizeTransactionZZ {
84 Option_C2Tuple_usizeTransactionZZ(pointer: self.cOpaqueStruct!.register_output(self.cOpaqueStruct!.this_arg, output.cOpaqueStruct!))
89 public override func free() -> Void {
92 self.cOpaqueStruct!.free(self.cOpaqueStruct!.this_arg)
97 /* SWIFT_DEFAULT_CALLBACKS_END */