Files
2022-10-06 16:17:16 +03:00

27 lines
508 B
Swift

//
// String.swift
// Wallet
//
// Created by Igor on 23.03.2021.
// Copyright © 2021 AM. All rights reserved.
//
import Foundation
import eosswift
// MARK: - REFACTOR
extension String {
func publicKey() -> String? {
guard Data(base58Decoding: self) != nil else { return nil }
do {
let result = try EOSPrivateKey(base58: self)
let publicKey = result.publicKey
return publicKey.base58
} catch {
return nil
}
}
}