Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 16 additions & 18 deletions BDKSwiftExampleWallet.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 56;
objectVersion = 60;
objects = {

/* Begin PBXBuildFile section */
Expand Down Expand Up @@ -49,6 +49,7 @@
AE3646262BEDB01200B04E25 /* FileManager+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = AE3646252BEDB01200B04E25 /* FileManager+Extensions.swift */; };
AE3902A42A3B4CD900BEC318 /* HomeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = AE3902A32A3B4CD900BEC318 /* HomeView.swift */; };
AE4135652D0CC1AD00605103 /* BitcoinDevKit in Frameworks */ = {isa = PBXBuildFile; productRef = AE4135642D0CC1AD00605103 /* BitcoinDevKit */; };
AE4635122E81E7E700F40BA7 /* BitcoinDevKit in Frameworks */ = {isa = PBXBuildFile; productRef = AE4635112E81E7E700F40BA7 /* BitcoinDevKit */; };
AE49847C2A1BBBD6009951E2 /* BDKSwiftExampleWalletApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = AE49847B2A1BBBD6009951E2 /* BDKSwiftExampleWalletApp.swift */; };
AE4984802A1BBBD7009951E2 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = AE49847F2A1BBBD7009951E2 /* Assets.xcassets */; };
AE4984832A1BBBD7009951E2 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = AE4984822A1BBBD7009951E2 /* Preview Assets.xcassets */; };
Expand Down Expand Up @@ -83,7 +84,6 @@
AE91CEEF2C0FDBC7000AAD20 /* CanonicalTx+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = AE91CEEE2C0FDBC7000AAD20 /* CanonicalTx+Extensions.swift */; };
AE96F6622A424C400055623C /* BDKSwiftExampleWalletReceiveViewModelTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = AE96F6612A424C400055623C /* BDKSwiftExampleWalletReceiveViewModelTests.swift */; };
AE97E74D2E315A8F000A407D /* AddressType+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = AE97E74C2E315A8F000A407D /* AddressType+Extensions.swift */; };
AEA0A6272E297203008A525B /* BitcoinDevKit in Frameworks */ = {isa = PBXBuildFile; productRef = AEA0A6262E297203008A525B /* BitcoinDevKit */; };
AEAA61BF2E380D62006ED2D0 /* Notification+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = AEAA61BE2E380D62006ED2D0 /* Notification+Extensions.swift */; };
AEAB03112ABDDB86000C9528 /* FeeViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AEAB03102ABDDB86000C9528 /* FeeViewModel.swift */; };
AEAB03132ABDDBF4000C9528 /* AmountViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AEAB03122ABDDBF4000C9528 /* AmountViewModel.swift */; };
Expand Down Expand Up @@ -222,7 +222,7 @@
files = (
AE7053262DE79AA30091DD78 /* BitcoinDevKit in Frameworks */,
AE2DD83F2D6FEF3600E5F212 /* BitcoinDevKit in Frameworks */,
AEA0A6272E297203008A525B /* BitcoinDevKit in Frameworks */,
AE4635122E81E7E700F40BA7 /* BitcoinDevKit in Frameworks */,
AE187D782C9BB3B50081D0C3 /* BitcoinDevKit in Frameworks */,
AE29ED0F2BBE2E7100EB9C4F /* BitcoinDevKit in Frameworks */,
AEAF83B62B7BD4D10019B23B /* CodeScanner in Frameworks */,
Expand Down Expand Up @@ -621,7 +621,7 @@
AE2DD83B2D6FEC3100E5F212 /* BitcoinDevKit */,
AE2DD83E2D6FEF3600E5F212 /* BitcoinDevKit */,
AE7053252DE79AA30091DD78 /* BitcoinDevKit */,
AEA0A6262E297203008A525B /* BitcoinDevKit */,
AE4635112E81E7E700F40BA7 /* BitcoinDevKit */,
);
productName = BDKSwiftExampleWallet;
productReference = AE4984782A1BBBD6009951E2 /* BDKSwiftExampleWallet.app */;
Expand Down Expand Up @@ -679,7 +679,7 @@
AE7D5A0C2A7EE62200EAC8CE /* XCRemoteSwiftPackageReference "KeychainAccess" */,
AEB735D12B2CC4B900F99DBB /* XCRemoteSwiftPackageReference "BitcoinUI" */,
AEAF83B42B7BD4D10019B23B /* XCRemoteSwiftPackageReference "CodeScanner" */,
AEA0A6252E297203008A525B /* XCRemoteSwiftPackageReference "bdk-swift" */,
AE4635102E81E7E700F40BA7 /* XCLocalSwiftPackageReference "../bdk-ffi/bdk-swift" */,
);
productRefGroup = AE4984792A1BBBD6009951E2 /* Products */;
projectDirPath = "";
Expand Down Expand Up @@ -1088,6 +1088,13 @@
};
/* End XCConfigurationList section */

/* Begin XCLocalSwiftPackageReference section */
AE4635102E81E7E700F40BA7 /* XCLocalSwiftPackageReference "../bdk-ffi/bdk-swift" */ = {
isa = XCLocalSwiftPackageReference;
relativePath = "../bdk-ffi/bdk-swift";
};
/* End XCLocalSwiftPackageReference section */

/* Begin XCRemoteSwiftPackageReference section */
AE7D5A0C2A7EE62200EAC8CE /* XCRemoteSwiftPackageReference "KeychainAccess" */ = {
isa = XCRemoteSwiftPackageReference;
Expand All @@ -1097,14 +1104,6 @@
version = 4.2.2;
};
};
AEA0A6252E297203008A525B /* XCRemoteSwiftPackageReference "bdk-swift" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/bitcoindevkit/bdk-swift";
requirement = {
kind = exactVersion;
version = 2.0.0;
};
};
AEAF83B42B7BD4D10019B23B /* XCRemoteSwiftPackageReference "CodeScanner" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/twostraws/CodeScanner.git";
Expand Down Expand Up @@ -1152,6 +1151,10 @@
isa = XCSwiftPackageProductDependency;
productName = BitcoinDevKit;
};
AE4635112E81E7E700F40BA7 /* BitcoinDevKit */ = {
isa = XCSwiftPackageProductDependency;
productName = BitcoinDevKit;
};
AE7053252DE79AA30091DD78 /* BitcoinDevKit */ = {
isa = XCSwiftPackageProductDependency;
productName = BitcoinDevKit;
Expand All @@ -1161,11 +1164,6 @@
package = AE7D5A0C2A7EE62200EAC8CE /* XCRemoteSwiftPackageReference "KeychainAccess" */;
productName = KeychainAccess;
};
AEA0A6262E297203008A525B /* BitcoinDevKit */ = {
isa = XCSwiftPackageProductDependency;
package = AEA0A6252E297203008A525B /* XCRemoteSwiftPackageReference "bdk-swift" */;
productName = BitcoinDevKit;
};
AEAF83B52B7BD4D10019B23B /* CodeScanner */ = {
isa = XCSwiftPackageProductDependency;
package = AEAF83B42B7BD4D10019B23B /* XCRemoteSwiftPackageReference "CodeScanner" */;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ extension CbfClient {
do {

let components = try CbfBuilder()
.logLevel(logLevel: .debug)
// .logLevel(logLevel: .debug)
.scanType(scanType: .sync)
.dataDir(dataDir: Constants.Config.Kyoto.dbPath)
.peers(peers: Constants.Networks.Signet.Regular.kyotoPeers)
Expand Down Expand Up @@ -148,7 +148,7 @@ extension CbfClient {
while true {
if Task.isCancelled { break }
do {
let log = try await self.nextLog()
// let log = try await self.nextLog()
} catch is CancellationError {
break
} catch {
Expand Down
6 changes: 5 additions & 1 deletion BDKSwiftExampleWallet/Resources/Localizable.xcstrings
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,10 @@
},
"%" : {

},
"%@" : {
"comment" : "A label displaying a transaction ID. The text inside the parentheses is the transaction ID itself.",
"isCommentAutoGenerated" : true
},
"%@ • %@" : {
"localizations" : {
Expand Down Expand Up @@ -1482,5 +1486,5 @@
}
}
},
"version" : "1.0"
"version" : "1.1"
}
8 changes: 8 additions & 0 deletions BDKSwiftExampleWallet/View Model/WalletViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import BitcoinDevKit
import Foundation
import Observation
import os
import SwiftUI

@MainActor
Expand All @@ -16,6 +17,7 @@ class WalletViewModel {
let bdkClient: BDKClient
let keyClient: KeyClient
let priceClient: PriceClient
private let logger = Logger(subsystem: "com.bitcoindevkit.bdkswiftexamplewallet", category: "WalletViewModel")

var balanceTotal: UInt64 = 0
var canSend: Bool {
Expand Down Expand Up @@ -172,6 +174,9 @@ class WalletViewModel {
self.walletViewError = .generic(message: error.localizedDescription)
self.showingWalletViewErrorAlert = true
} catch let error as EsploraError {
logger.error(
"full scan esplora error: url=\(self.bdkClient.getEsploraURL(), privacy: .public) message=\(error.localizedDescription, privacy: .public)"
)
self.walletViewError = .generic(message: error.localizedDescription)
self.showingWalletViewErrorAlert = true
} catch let error as PersistenceError {
Expand Down Expand Up @@ -230,6 +235,9 @@ class WalletViewModel {
self.walletViewError = .generic(message: error.localizedDescription)
self.showingWalletViewErrorAlert = true
} catch let error as EsploraError {
logger.error(
"sync esplora error: url=\(self.bdkClient.getEsploraURL(), privacy: .public) message=\(error.localizedDescription, privacy: .public)"
)
self.walletViewError = .generic(message: error.localizedDescription)
self.showingWalletViewErrorAlert = true
} catch let error as RequestBuilderError {
Expand Down
Loading