> ## Documentation Index
> Fetch the complete documentation index at: https://align.tolbel.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Validate Address

> Check if a string is a valid Ethereum address

## Method Signature

```typescript theme={null}
align.blockchain.utils.isValidAddress(address: string): boolean
```

## Parameters

<ParamField body="address" type="string" required>
  String to validate
</ParamField>

## Returns

Returns `true` if valid address, `false` otherwise.

## Examples

<Tabs>
  <Tab title="TypeScript">
    ```typescript theme={null}
    import Align from "@tolbel/align";

    const align = new Align({
      apiKey: process.env.ALIGN_API_KEY!,
      environment: "sandbox",
    });

    // Valid addresses
    console.log(align.blockchain.utils.isValidAddress(
      "0x742d35Cc6634C0532925a3b844Bc9e7595f0aB42"
    )); // true

    // Invalid addresses
    console.log(align.blockchain.utils.isValidAddress("0x123")); // false
    console.log(align.blockchain.utils.isValidAddress("not-an-address")); // false
    console.log(align.blockchain.utils.isValidAddress("")); // false
    ```
  </Tab>

  <Tab title="JavaScript">
    ```javascript theme={null}
    const isValid = align.blockchain.utils.isValidAddress(userInput);
    if (!isValid) {
      throw new Error("Invalid wallet address");
    }
    ```
  </Tab>
</Tabs>

### Input Validation

```typescript theme={null}
function validateRecipient(address: string): void {
  if (!align.blockchain.utils.isValidAddress(address)) {
    throw new Error("Invalid recipient address");
  }

  // Also check it's not the zero address
  if (address === "0x0000000000000000000000000000000000000000") {
    throw new Error("Cannot send to zero address");
  }
}
```

<Info>
  This validates the format only. It doesn't check if the address exists
  on-chain or has any balance.
</Info>

## Related Methods

<CardGroup cols={2}>
  <Card title="Resolve ENS Name" icon="globe" href="/docs/api/blockchain/utils/resolve-name">
    Convert ENS to address
  </Card>

  <Card title="Lookup Address" icon="magnifying-glass" href="/docs/api/blockchain/utils/lookup-address">
    Get ENS for address
  </Card>
</CardGroup>
