Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ struct EnterWalletAddressView: View {
UrTextField(
text: $viewModel.walletAddress,
label: "USDC wallet address",
placeholder: "Enter a Solana or Matic USDC wallet address",
supportingText: "USDC addresses on Solana and Polygon are currently supported",
placeholder: "Enter a Solana USDC wallet address",
supportingText: "USDC addresses on Solana are currently supported",
isEnabled: !accountWalletsViewModel.isCreatingWallet,
submitLabel: .continue,
onSubmit: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,20 +46,15 @@ extension EnterWalletAddressView {

private func validateAddress(_ address: String) {
Task {
async let solanaValidation = validateAddress(address, chain: "SOL")
async let maticValidation = validateAddress(address, chain: "MATIC")

let (solanaResult, polygonResult) = await (solanaValidation, maticValidation)
let solanaResult = await validateAddress(address, chain: "SOL")

switch (solanaResult, polygonResult) {
case (.success(let isSolanaValid), .success(let isPolygonValid)):
switch (solanaResult) {
case (.success(let isSolanaValid)):

if isSolanaValid {
self.chain = WalletChain.sol
self.isValidWalletAddress = true
} else if isPolygonValid {
self.chain = WalletChain.matic
self.isValidWalletAddress = true
} else {
self.chain = WalletChain.invalid
self.isValidWalletAddress = false
Expand Down
1 change: 0 additions & 1 deletion app/network/Shared/Models/WalletChain.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,5 @@ import Foundation

enum WalletChain: String {
case sol = "SOL"
case matic = "MATIC"
case invalid = "INVALID"
}
Loading