Replace the JavaScript mobile app with a native Swift iOS wallet
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
import SwiftUI
|
||||
|
||||
@main
|
||||
struct KoinsApp: App {
|
||||
@StateObject private var model: AppModel
|
||||
|
||||
init() {
|
||||
Secp256k1Backend.derivePrivateKey = { entropy in
|
||||
KoinsSecp256k1.privateKey(fromEntropy: entropy)
|
||||
}
|
||||
Secp256k1Backend.publicKey = { privateKey in
|
||||
KoinsSecp256k1.publicKey(fromPrivateKey: privateKey)
|
||||
}
|
||||
Secp256k1Backend.sign = { digest, privateKey in
|
||||
KoinsSecp256k1.signDigest(digest, withPrivateKey: privateKey)
|
||||
}
|
||||
Secp256k1Backend.addScalar = { left, right in
|
||||
KoinsSecp256k1.addScalar(left, toScalar: right)
|
||||
}
|
||||
_model = StateObject(wrappedValue: AppModel())
|
||||
SelfTest.runIfRequested()
|
||||
}
|
||||
|
||||
var body: some Scene {
|
||||
WindowGroup {
|
||||
RootView()
|
||||
.environmentObject(model)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user