1- ////
2- //// KyotoSyncService.swift
3- //// BDKSwiftExampleWallet
4- ////
5- //// Created by Rubens Machion on 16/05/25.
6- ////
71//
8- //import BitcoinDevKit
9- //import Foundation
10- //
11- //final class KyotoSyncService: BDKSyncService {
12- //
13- // var connection: Connection?
14- // var keyClient: KeyClient
15- // var network: Network
16- // var wallet: Wallet?
17- // var needsFullScan = false
18- //
19- // private var node: CbfNode?
20- // private var client: CbfClient?
21- //
22- // init(
23- // keyClient: KeyClient = .live,
24- // network: Network = .signet,
25- // connection: Connection? = nil
26- // ) {
27- // self.connection = connection
28- // self.keyClient = keyClient
29- // self.network = network
30- // }
31- //
32- // func createWallet(params: String?) throws {
33- // self.wallet = try buildWallet(params: params)
34- // }
35- //
36- // func loadWallet() throws {
37- //
38- // }
39- //
40- // func deleteWallet() throws {
41- //
42- // }
43- //
44- // func updateNetwork(network: Network) {
45- // self.network = network
46- // }
47- //}
48-
49- //
50- // Untitled.swift
2+ // KyotoSyncService.swift
513// BDKSwiftExampleWallet
524//
535// Created by Rubens Machion on 16/05/25.
@@ -64,7 +16,8 @@ final class KyotoSyncService: BDKSyncService {
6416 var wallet : Wallet ?
6517 var needsFullScan = false
6618
67- private var esploraClient : EsploraClient
19+ private var node : CbfNode ?
20+ private var client : CbfClient ?
6821
6922 init (
7023 keyClient: KeyClient = . live,
@@ -74,33 +27,29 @@ final class KyotoSyncService: BDKSyncService {
7427 self . connection = connection
7528 self . keyClient = keyClient
7629 self . network = network
77-
78- let url = ( try ? keyClient. getEsploraURL ( ) ) ?? network. url
79- self . esploraClient = . init(
80- url: url
81- )
8230 }
8331
8432 func createWallet( params: String ? ) throws {
8533 self . wallet = try buildWallet ( params: params)
8634 }
8735
8836 func loadWallet( ) throws {
89- let wallet = try loadWalleFromBackup ( )
90- self . wallet = wallet
37+
9138 }
9239
9340 func deleteWallet( ) throws {
94- try deleteData ( )
95- needsFullScan = true
41+
9642 }
9743
9844 func updateNetwork( network: Network ) {
9945 self . network = network
10046 }
10147
102- func updateEsploraURL( _ url: String ) {
103- try ? keyClient. saveEsploraURL ( url)
104- self . esploraClient = . init( url: url)
48+ func startSync( progress: SyncScriptInspector ) async throws {
49+
50+ }
51+
52+ func startFullScan( progress: FullScanScriptInspector ) async throws {
53+
10554 }
10655}
0 commit comments