Skip to content
Merged
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
86 changes: 86 additions & 0 deletions Bitkit.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,30 @@
961058EB2C35793000E1F1D8 /* WalletNetwork.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9637E6DC2C32EAA8004A92FC /* WalletNetwork.swift */; };
961058EE2C35798C00E1F1D8 /* LDKNode in Frameworks */ = {isa = PBXBuildFile; productRef = 961058ED2C35798C00E1F1D8 /* LDKNode */; };
961058F02C35799400E1F1D8 /* BitcoinDevKit in Frameworks */ = {isa = PBXBuildFile; productRef = 961058EF2C35799400E1F1D8 /* BitcoinDevKit */; };
961301882C50202A00878183 /* MigrationsService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 961301872C50202A00878183 /* MigrationsService.swift */; };
9613018C2C5022D700878183 /* SQLite in Frameworks */ = {isa = PBXBuildFile; productRef = 9613018B2C5022D700878183 /* SQLite */; };
9613018E2C50288900878183 /* LdkMigration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9613018D2C50288900878183 /* LdkMigration.swift */; };
9613018F2C5028CC00878183 /* MigrationsService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 961301872C50202A00878183 /* MigrationsService.swift */; };
9637E6D32C32CE79004A92FC /* Env.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9637E6D22C32CE79004A92FC /* Env.swift */; };
9637E6D52C32D811004A92FC /* OnChainService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9637E6D42C32D811004A92FC /* OnChainService.swift */; };
9637E6D82C32D8A7004A92FC /* BitcoinDevKit in Frameworks */ = {isa = PBXBuildFile; productRef = 9637E6D72C32D8A7004A92FC /* BitcoinDevKit */; };
9637E6DA2C32E573004A92FC /* OnChainViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9637E6D92C32E573004A92FC /* OnChainViewModel.swift */; };
9637E6DD2C32EAA8004A92FC /* WalletNetwork.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9637E6DC2C32EAA8004A92FC /* WalletNetwork.swift */; };
9637E6DF2C32ED7B004A92FC /* LnPeer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9637E6DE2C32ED7B004A92FC /* LnPeer.swift */; };
966DE6612C502C7E00A7B0EF /* Env.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9637E6D22C32CE79004A92FC /* Env.swift */; };
966DE6622C502C8600A7B0EF /* Errors.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96F261352C369D2400167439 /* Errors.swift */; };
966DE6632C502C8600A7B0EF /* Logger.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96FE5A1A2C46A4DD00860ADC /* Logger.swift */; };
966DE6642C502CA300A7B0EF /* ServiceQueue.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96F261312C369C2100167439 /* ServiceQueue.swift */; };
966DE6652C502CAD00A7B0EF /* WalletNetwork.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9637E6DC2C32EAA8004A92FC /* WalletNetwork.swift */; };
966DE6662C502CBD00A7B0EF /* LnPeer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9637E6DE2C32ED7B004A92FC /* LnPeer.swift */; };
966DE6672C50372600A7B0EF /* LightningService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96B12A022C2EC65000DD07B0 /* LightningService.swift */; };
966DE6682C50372900A7B0EF /* OnChainService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9637E6D42C32D811004A92FC /* OnChainService.swift */; };
966DE66B2C50FA6A00A7B0EF /* channel_manager.bin in Resources */ = {isa = PBXBuildFile; fileRef = 966DE66A2C50FA6A00A7B0EF /* channel_manager.bin */; };
966DE66D2C50FA7600A7B0EF /* adb1de43b448b04b3fdde638155929cd2163d2c53d36bb40b517d7acc44d1630.bin in Resources */ = {isa = PBXBuildFile; fileRef = 966DE66C2C50FA7600A7B0EF /* adb1de43b448b04b3fdde638155929cd2163d2c53d36bb40b517d7acc44d1630.bin */; };
966DE6702C51210000A7B0EF /* LightningDevKit in Frameworks */ = {isa = PBXBuildFile; productRef = 966DE66F2C51210000A7B0EF /* LightningDevKit */; };
966DE6722C512C1E00A7B0EF /* seed.bin in Resources */ = {isa = PBXBuildFile; fileRef = 966DE6712C512C1E00A7B0EF /* seed.bin */; };
966DE6742C512C9300A7B0EF /* HexBytes.swift in Sources */ = {isa = PBXBuildFile; fileRef = 966DE6732C512C9300A7B0EF /* HexBytes.swift */; };
966DE6752C512FD100A7B0EF /* HexBytes.swift in Sources */ = {isa = PBXBuildFile; fileRef = 966DE6732C512C9300A7B0EF /* HexBytes.swift */; };
96B129FD2C2EC05D00DD07B0 /* LDKNode in Frameworks */ = {isa = PBXBuildFile; productRef = 96B129FC2C2EC05D00DD07B0 /* LDKNode */; };
96B12A002C2EC37B00DD07B0 /* LightningViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96B129FF2C2EC37B00DD07B0 /* LightningViewModel.swift */; };
96B12A032C2EC65000DD07B0 /* LightningService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96B12A022C2EC65000DD07B0 /* LightningService.swift */; };
Expand Down Expand Up @@ -82,11 +100,17 @@
961058DC2C355B5500E1F1D8 /* BitkitNotification.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = BitkitNotification.appex; sourceTree = BUILT_PRODUCTS_DIR; };
961058DE2C355B5500E1F1D8 /* NotificationService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationService.swift; sourceTree = "<group>"; };
961058E02C355B5500E1F1D8 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
961301872C50202A00878183 /* MigrationsService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MigrationsService.swift; sourceTree = "<group>"; };
9613018D2C50288900878183 /* LdkMigration.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LdkMigration.swift; sourceTree = "<group>"; };
9637E6D22C32CE79004A92FC /* Env.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Env.swift; sourceTree = "<group>"; };
9637E6D42C32D811004A92FC /* OnChainService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OnChainService.swift; sourceTree = "<group>"; };
9637E6D92C32E573004A92FC /* OnChainViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OnChainViewModel.swift; sourceTree = "<group>"; };
9637E6DC2C32EAA8004A92FC /* WalletNetwork.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WalletNetwork.swift; sourceTree = "<group>"; };
9637E6DE2C32ED7B004A92FC /* LnPeer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LnPeer.swift; sourceTree = "<group>"; };
966DE66A2C50FA6A00A7B0EF /* channel_manager.bin */ = {isa = PBXFileReference; lastKnownFileType = archive.macbinary; path = channel_manager.bin; sourceTree = "<group>"; };
966DE66C2C50FA7600A7B0EF /* adb1de43b448b04b3fdde638155929cd2163d2c53d36bb40b517d7acc44d1630.bin */ = {isa = PBXFileReference; lastKnownFileType = archive.macbinary; path = adb1de43b448b04b3fdde638155929cd2163d2c53d36bb40b517d7acc44d1630.bin; sourceTree = "<group>"; };
966DE6712C512C1E00A7B0EF /* seed.bin */ = {isa = PBXFileReference; lastKnownFileType = archive.macbinary; path = seed.bin; sourceTree = "<group>"; };
966DE6732C512C9300A7B0EF /* HexBytes.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HexBytes.swift; sourceTree = "<group>"; };
96B129FF2C2EC37B00DD07B0 /* LightningViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LightningViewModel.swift; sourceTree = "<group>"; };
96B12A022C2EC65000DD07B0 /* LightningService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LightningService.swift; sourceTree = "<group>"; };
96C246C32C455AF60058222C /* BitkitNotification.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = BitkitNotification.entitlements; sourceTree = "<group>"; };
Expand Down Expand Up @@ -121,7 +145,9 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
9613018C2C5022D700878183 /* SQLite in Frameworks */,
9637E6D82C32D8A7004A92FC /* BitcoinDevKit in Frameworks */,
966DE6702C51210000A7B0EF /* LightningDevKit in Frameworks */,
96B129FD2C2EC05D00DD07B0 /* LDKNode in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -163,6 +189,7 @@
961058F12C35904F00E1F1D8 /* Extensions */ = {
isa = PBXGroup;
children = (
966DE6732C512C9300A7B0EF /* HexBytes.swift */,
);
path = Extensions;
sourceTree = "<group>";
Expand All @@ -184,6 +211,16 @@
path = Models;
sourceTree = "<group>";
};
966DE6692C50FA5800A7B0EF /* ldk-backup */ = {
isa = PBXGroup;
children = (
966DE6712C512C1E00A7B0EF /* seed.bin */,
966DE66A2C50FA6A00A7B0EF /* channel_manager.bin */,
966DE66C2C50FA7600A7B0EF /* adb1de43b448b04b3fdde638155929cd2163d2c53d36bb40b517d7acc44d1630.bin */,
);
path = "ldk-backup";
sourceTree = "<group>";
};
96B129FE2C2EC0ED00DD07B0 /* ViewModels */ = {
isa = PBXGroup;
children = (
Expand All @@ -198,6 +235,7 @@
children = (
96B12A022C2EC65000DD07B0 /* LightningService.swift */,
9637E6D42C32D811004A92FC /* OnChainService.swift */,
961301872C50202A00878183 /* MigrationsService.swift */,
96F261312C369C2100167439 /* ServiceQueue.swift */,
);
path = Services;
Expand Down Expand Up @@ -265,7 +303,9 @@
96FE1F752C2DE6AC006D0C8B /* BitkitTests */ = {
isa = PBXGroup;
children = (
966DE6692C50FA5800A7B0EF /* ldk-backup */,
96FE1F762C2DE6AC006D0C8B /* BitkitTests.swift */,
9613018D2C50288900878183 /* LdkMigration.swift */,
);
path = BitkitTests;
sourceTree = "<group>";
Expand Down Expand Up @@ -329,6 +369,8 @@
packageProductDependencies = (
96B129FC2C2EC05D00DD07B0 /* LDKNode */,
9637E6D72C32D8A7004A92FC /* BitcoinDevKit */,
9613018B2C5022D700878183 /* SQLite */,
966DE66F2C51210000A7B0EF /* LightningDevKit */,
);
productName = Bitkit;
productReference = 96FE1F612C2DE6AA006D0C8B /* Bitkit.app */;
Expand Down Expand Up @@ -408,6 +450,8 @@
packageReferences = (
96B129FB2C2EC05D00DD07B0 /* XCRemoteSwiftPackageReference "ldk-node" */,
9637E6D62C32D8A7004A92FC /* XCRemoteSwiftPackageReference "bdk-swift" */,
961301892C50215500878183 /* XCRemoteSwiftPackageReference "SQLite.swift" */,
966DE66E2C51210000A7B0EF /* XCRemoteSwiftPackageReference "ldk-swift" */,
);
productRefGroup = 96FE1F622C2DE6AA006D0C8B /* Products */;
projectDirPath = "";
Expand Down Expand Up @@ -442,6 +486,9 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
966DE66B2C50FA6A00A7B0EF /* channel_manager.bin in Resources */,
966DE6722C512C1E00A7B0EF /* seed.bin in Resources */,
966DE66D2C50FA7600A7B0EF /* adb1de43b448b04b3fdde638155929cd2163d2c53d36bb40b517d7acc44d1630.bin in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -476,6 +523,7 @@
files = (
9637E6D32C32CE79004A92FC /* Env.swift in Sources */,
96FE5A192C46594500860ADC /* LogView.swift in Sources */,
961301882C50202A00878183 /* MigrationsService.swift in Sources */,
96B12A002C2EC37B00DD07B0 /* LightningViewModel.swift in Sources */,
9637E6DD2C32EAA8004A92FC /* WalletNetwork.swift in Sources */,
96F261362C369D2400167439 /* Errors.swift in Sources */,
Expand All @@ -485,6 +533,7 @@
96FE1F672C2DE6AA006D0C8B /* ContentView.swift in Sources */,
96FE5A1B2C46A4DD00860ADC /* Logger.swift in Sources */,
96B12A032C2EC65000DD07B0 /* LightningService.swift in Sources */,
966DE6742C512C9300A7B0EF /* HexBytes.swift in Sources */,
9637E6D52C32D811004A92FC /* OnChainService.swift in Sources */,
96FE1F652C2DE6AA006D0C8B /* BitkitApp.swift in Sources */,
);
Expand All @@ -494,7 +543,18 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
966DE6622C502C8600A7B0EF /* Errors.swift in Sources */,
966DE6652C502CAD00A7B0EF /* WalletNetwork.swift in Sources */,
966DE6672C50372600A7B0EF /* LightningService.swift in Sources */,
966DE6632C502C8600A7B0EF /* Logger.swift in Sources */,
9613018E2C50288900878183 /* LdkMigration.swift in Sources */,
966DE6662C502CBD00A7B0EF /* LnPeer.swift in Sources */,
966DE6612C502C7E00A7B0EF /* Env.swift in Sources */,
9613018F2C5028CC00878183 /* MigrationsService.swift in Sources */,
966DE6642C502CA300A7B0EF /* ServiceQueue.swift in Sources */,
966DE6752C512FD100A7B0EF /* HexBytes.swift in Sources */,
96FE1F772C2DE6AC006D0C8B /* BitkitTests.swift in Sources */,
966DE6682C50372900A7B0EF /* OnChainService.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -922,6 +982,14 @@
/* End XCConfigurationList section */

/* Begin XCRemoteSwiftPackageReference section */
961301892C50215500878183 /* XCRemoteSwiftPackageReference "SQLite.swift" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/stephencelis/SQLite.swift.git";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 0.15.3;
};
};
9637E6D62C32D8A7004A92FC /* XCRemoteSwiftPackageReference "bdk-swift" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/bitcoindevkit/bdk-swift";
Expand All @@ -930,6 +998,14 @@
minimumVersion = 0.31.1;
};
};
966DE66E2C51210000A7B0EF /* XCRemoteSwiftPackageReference "ldk-swift" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/lightningdevkit/ldk-swift/";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 0.0.123;
};
};
96B129FB2C2EC05D00DD07B0 /* XCRemoteSwiftPackageReference "ldk-node" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/lightningdevkit/ldk-node";
Expand All @@ -951,11 +1027,21 @@
package = 9637E6D62C32D8A7004A92FC /* XCRemoteSwiftPackageReference "bdk-swift" */;
productName = BitcoinDevKit;
};
9613018B2C5022D700878183 /* SQLite */ = {
isa = XCSwiftPackageProductDependency;
package = 961301892C50215500878183 /* XCRemoteSwiftPackageReference "SQLite.swift" */;
productName = SQLite;
};
9637E6D72C32D8A7004A92FC /* BitcoinDevKit */ = {
isa = XCSwiftPackageProductDependency;
package = 9637E6D62C32D8A7004A92FC /* XCRemoteSwiftPackageReference "bdk-swift" */;
productName = BitcoinDevKit;
};
966DE66F2C51210000A7B0EF /* LightningDevKit */ = {
isa = XCSwiftPackageProductDependency;
package = 966DE66E2C51210000A7B0EF /* XCRemoteSwiftPackageReference "ldk-swift" */;
productName = LightningDevKit;
};
96B129FC2C2EC05D00DD07B0 /* LDKNode */ = {
isa = XCSwiftPackageProductDependency;
package = 96B129FB2C2EC05D00DD07B0 /* XCRemoteSwiftPackageReference "ldk-node" */;
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,27 @@
<key>orderHint</key>
<integer>1</integer>
</dict>
<key>SQLite (Playground) 1.xcscheme</key>
<dict>
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>3</integer>
</dict>
<key>SQLite (Playground) 2.xcscheme</key>
<dict>
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>4</integer>
</dict>
<key>SQLite (Playground).xcscheme</key>
<dict>
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>2</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
<dict>
Expand Down
23 changes: 14 additions & 9 deletions Bitkit/BitkitApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -70,17 +70,22 @@ struct BitkitApp: App {

var body: some Scene {
WindowGroup {
ContentView()
.onAppear {
//TODO move this elsewhere
requestPushNotificationPermision { (granted, error) in
if granted {
Logger.info("Push notification permission granted")
} else {
Logger.warn("Push notification permission denied")
if Env.isUnitTest {
Text("Running unit tests...")
} else {
ContentView()
.onAppear {
//TODO move this elsewhere
requestPushNotificationPermision { (granted, error) in
if granted {
Logger.info("Push notification permission granted")
} else {
Logger.warn("Push notification permission denied")
}
}
}
}
}

}
}
}
33 changes: 23 additions & 10 deletions Bitkit/Constants/Env.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,9 @@ struct Env {
static var esploraServerUrl: String {
switch network {
case .regtest:
return "https://electrs-regtest.synonym.to"
//cargo run --release --bin electrs -- -vvv --jsonrpc-import --daemon-rpc-addr 127.0.0.1:18443 --cookie polaruser:polarpass
// return "https://jaybird-logical-sadly.ngrok-free.app"
// return "http://127.0.0.1:3000"

return "http://192.168.0.106:3000"
//return "http://127.0.0.1:3000"
case .bitcoin:
fatalError("Bitcoin network not implemented")
case .testnet:
Expand All @@ -49,15 +47,30 @@ struct Env {
fatalError("Could not find documents directory")
}

if isUnitTest {
return documentsDirectory.appendingPathComponent("unit-tests")
}

return documentsDirectory
}

static var ldkStorage: URL {
let storageDirPath = appStorageUrl.appendingPathComponent("ldk")

switch network {
case .regtest:
return storageDirPath.appendingPathComponent("regtest")
return appStorageUrl.appendingPathComponent("regtest").appendingPathComponent("ldk")
case .bitcoin:
fatalError("Bitcoin network not implemented")
case .testnet:
fatalError("Testnet network not implemented")
case .signet:
fatalError("Signet network not implemented")
}
}

static var bdkStorage: URL {
switch network {
case .regtest:
return appStorageUrl.appendingPathComponent("regtest").appendingPathComponent("bdk")
case .bitcoin:
fatalError("Bitcoin network not implemented")
case .testnet:
Expand All @@ -84,9 +97,7 @@ struct Env {
switch network {
case .regtest:
return [
.init(nodeId: "03e26fdad23b9e17f6a6b1dd0a019c6fcd9e778a1c2af6ae62a0951c8352efbbc3", address: "192.168.0.106:9735")
// .init(nodeId: "0218ab1da83a4768e154fada54deb5d835199aad116c4212e6844d0dce0f82cab1", address: "192.168.0.106:9737"),
// .init(nodeId: "021de6ad59a78caf8f376cbd022e8c6ede2a1ef0a4fa035174e8b9c25ad5866584", address: "192.168.0.106:9738")
.init(nodeId: "02b61365f14c5070465e014485fa91cee5a131cf2a4b7cb37309fcd1cc53975238", address: "192.168.0.106:9735")
]
case .bitcoin:
return []
Expand All @@ -96,4 +107,6 @@ struct Env {
return []
}
}

static let testMnemonic = "pool curve feature leader elite dilemma exile toast smile couch crane public"
}
Loading