mirror of
https://github.com/lil-org/tokenary.git
synced 2025-01-07 06:00:44 +03:00
Drop Web3Swift usage in AccountsService
This commit is contained in:
parent
7e9ca15b1f
commit
ca52a484b5
@ -1,14 +1,16 @@
|
||||
// Copyright © 2021 Encrypted Ink. All rights reserved.
|
||||
|
||||
import Foundation
|
||||
import Web3Swift
|
||||
import WalletCore
|
||||
|
||||
struct AccountsService {
|
||||
|
||||
static func validateAccountKey(_ key: String) -> Bool {
|
||||
let address = try? EthPrivateKey(hex: key).address().value()
|
||||
return address != nil
|
||||
if let data = Data(hexString: key) {
|
||||
return PrivateKey.isValid(data: data, curve: CoinType.ethereum.curve)
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
static func addAccount(privateKey: String) -> Account? {
|
||||
|
Loading…
Reference in New Issue
Block a user