-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
460 Allow add EOA address in customised address book #558
Conversation
if !formatedAddress.hasPrefix("0x") { | ||
formatedAddress = "0x" + formatedAddress | ||
var formattedAddress = state.address.trim().lowercased() | ||
if !formattedAddress.hasPrefix("0x") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use addHexPrefix
instead
class AddAddressViewModel: ViewModel { | ||
final class AddAddressViewModel: ViewModel { | ||
enum AddressType { | ||
case flow, eoa |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The type should be flow
and evm
@@ -298,6 +313,20 @@ extension AddAddressView.AddAddressViewModel { | |||
DispatchQueue.main.asyncAfter(deadline: .now() + 0.5, execute: task) | |||
} | |||
|
|||
private func checkEoaAddressExists(_ address: String) { | |||
guard let eoa = EthereumAddress(address, type: .normal, ignoreChecksum: false) else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ignoreChecksum
should be true.
guard let eoa = EthereumAddress(address, ignoreChecksum: true) else {
#460