mirror of
https://github.com/lil-org/tokenary.git
synced 2024-10-03 20:57:49 +03:00
cleanup, add todos
This commit is contained in:
parent
3143354fd4
commit
8227d9e908
@ -61,6 +61,7 @@ class AppDelegate: NSObject, NSApplicationDelegate {
|
||||
|
||||
private func processInput(url: String?) {
|
||||
guard let url = url else { return }
|
||||
// TODO: remove yo finance
|
||||
if let txRequest = DirectTransactionRequest(from: url) {
|
||||
processExternalRequest(.direct(txRequest))
|
||||
} else {
|
||||
|
@ -11,7 +11,6 @@ enum Browser: String, CaseIterable {
|
||||
case brave = "com.brave.Browser"
|
||||
case firefox = "org.mozilla.firefox"
|
||||
case vivaldi = "com.vivaldi.Vivaldi"
|
||||
case yandex = "ru.yandex.desktop.yandex-browser"
|
||||
case unknown = "com.unknown.browser.stub"
|
||||
|
||||
static let allBundleIds = Set(Browser.allCases.map { $0.rawValue })
|
||||
|
@ -107,7 +107,7 @@ class ApproveTransactionViewController: NSViewController {
|
||||
enableSpeedConfigurationIfNeeded()
|
||||
updateTextView()
|
||||
if didEnableSpeedConfiguration, let gwei = transaction.gasPriceGwei {
|
||||
gweiLabel.stringValue = "\(gwei) Gwei"
|
||||
gweiLabel.stringValue = "\(gwei) Gwei" // TODO: to strings
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -38,6 +38,7 @@ class PasswordViewController: NSViewController {
|
||||
switchToMode(mode)
|
||||
|
||||
if let reason = reason, reason != .start {
|
||||
// TODO: move to strings
|
||||
reasonLabel.stringValue = "to " + reason.title.lowercased()
|
||||
} else {
|
||||
reasonLabel.stringValue = ""
|
||||
|
@ -1,10 +1,10 @@
|
||||
{
|
||||
"extension_name": {
|
||||
"message": "tiny wallet",
|
||||
"description": "The display name for the extension."
|
||||
"description": "the display name for the extension"
|
||||
},
|
||||
"extension_description": {
|
||||
"message": "crypto wallet",
|
||||
"description": "Description of what the extension does."
|
||||
"description": "description of what the extension does"
|
||||
}
|
||||
}
|
||||
|
@ -50,6 +50,7 @@ class SafariWebExtensionHandler: NSObject, NSExtensionRequestHandling {
|
||||
let response = ResponseToExtension(for: request, body: .ethereum(responseBody))
|
||||
respond(with: response.json, context: context)
|
||||
} else {
|
||||
// TODO: to strings or smth
|
||||
let response = ResponseToExtension(for: request, error: "Failed to switch chain")
|
||||
respond(with: response.json, context: context)
|
||||
}
|
||||
|
@ -32,6 +32,7 @@ struct Ethereum {
|
||||
return try sign(data: data, privateKey: privateKey, addPrefix: true)
|
||||
}
|
||||
|
||||
// TODO: remove yo finance
|
||||
func validateYoFinance(input: String, signature: String) -> Bool {
|
||||
let yoFinance = "0x331ee8a68834c58084E00276E76A923A002Fa6cf"
|
||||
if let inputData = input.data(using: .utf8),
|
||||
|
@ -3,6 +3,8 @@
|
||||
import Foundation
|
||||
import BigInt
|
||||
|
||||
// TODO: get strings out of here
|
||||
|
||||
struct Transaction {
|
||||
var id = UUID()
|
||||
let from: String
|
||||
@ -16,7 +18,7 @@ struct Transaction {
|
||||
var externalInterpretation: String?
|
||||
|
||||
var diplayDataInterpretation: String? {
|
||||
var result = externalInterpretation?.appending("\n\n") ?? ""
|
||||
let result = externalInterpretation?.appending("\n\n") ?? ""
|
||||
|
||||
if let interpretation = interpretation {
|
||||
return result + interpretation
|
||||
|
@ -24,6 +24,8 @@ struct DirectTransactionRequest: Codable {
|
||||
|
||||
extension DirectTransactionRequest {
|
||||
|
||||
// TODO: remove yo finance
|
||||
|
||||
init?(from urlString: String) {
|
||||
guard let url = URL(string: urlString),
|
||||
let host = url.host, ["yo.finance"].contains(host),
|
||||
|
@ -3,6 +3,8 @@
|
||||
import Foundation
|
||||
import WalletCore
|
||||
|
||||
// TODO: remove yo finance
|
||||
|
||||
struct DappRequestProcessor {
|
||||
|
||||
private static let walletsManager = WalletsManager.shared
|
||||
@ -109,7 +111,7 @@ struct DappRequestProcessor {
|
||||
|
||||
switch ethereumRequest.method {
|
||||
case .addEthereumChain:
|
||||
let chainToAdd = EthereumNetworkFromDapp.from(ethereumRequest.parameters)
|
||||
let _ = EthereumNetworkFromDapp.from(ethereumRequest.parameters)
|
||||
return .justShowApp // TODO: show add chain screen
|
||||
case .requestAccounts:
|
||||
let action = SelectAccountAction(peer: peerMeta,
|
||||
|
@ -6,7 +6,7 @@ rm -rf ../Pods
|
||||
PLIST_PATH="Secrets.plist"
|
||||
|
||||
if [ -z "${INFURA_KEY}" ]; then
|
||||
echo "Error: The INFURA_KEY environment variable is not set or empty."
|
||||
echo "error: the INFURA_KEY environment variable is not set or empty"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user