# `X402.Wallet`
[🔗](https://github.com/cardotrejos/x402/blob/main/lib/x402/wallet.ex#L1)

Wallet address validation utilities for x402.

This module supports EVM and Solana address formats and can detect the wallet
type from a single string value.

# `type`
*since 0.1.0* 

```elixir
@spec type(term()) :: :evm | :solana | :unknown
```

Detects the wallet type.

## Examples

    iex> X402.Wallet.type("0x1111111111111111111111111111111111111111")
    :evm

    iex> X402.Wallet.type("9xQeWvG816bUx9EPfQmQTYnC16hHhV6bQf8kX6y4YB9")
    :solana

    iex> X402.Wallet.type("not-a-wallet")
    :unknown

# `valid?`
*since 0.1.0* 

```elixir
@spec valid?(term()) :: boolean()
```

Returns `true` when the value is a valid EVM or Solana wallet address.

## Examples

    iex> X402.Wallet.valid?("0x1111111111111111111111111111111111111111")
    true

    iex> X402.Wallet.valid?("not-a-wallet")
    false

# `valid_evm?`
*since 0.1.0* 

```elixir
@spec valid_evm?(term()) :: boolean()
```

Returns `true` for addresses in the format `0x` + 40 hexadecimal characters.

## Examples

    iex> X402.Wallet.valid_evm?("0x1111111111111111111111111111111111111111")
    true

    iex> X402.Wallet.valid_evm?("0x123")
    false

# `valid_solana?`
*since 0.1.0* 

```elixir
@spec valid_solana?(term()) :: boolean()
```

Returns `true` for Base58 strings with length 43 or 44 (the valid range for 32-byte Solana public keys).

## Examples

    iex> X402.Wallet.valid_solana?("9xQeWvG816bUx9EPfQmQTYnC16hHhV6bQf8kX6y4YB9")
    true

    iex> X402.Wallet.valid_solana?("invalid0base58")
    false

---

*Consult [api-reference.md](api-reference.md) for complete listing*
