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

# getAddresses / getAddress

> Get wallet addresses.

## getAddresses

### Function Signature

```dart theme={null}
Future<PortalGetAddressesResult> getAddresses()
```

### Description

Returns the addresses for the client's wallet. Addresses come from the client's wallet metadata (provided by the Portal API), **not** from the signing shares on the device — so this returns addresses whenever the client has a wallet, regardless of whether its signing shares are on the current device.

<Warning>
  A returned address does **not** mean the wallet can sign on this device — it only tells you the client has a wallet. To check whether the signing shares are on the current device, use [`isWalletOnDevice`](./iswalletondevice).
</Warning>

### Parameters

This method takes no parameters.

### Returns

**`PortalGetAddressesResult`** - An object containing:

| Property    | Type              | Description                                                                                                                                                                                                    |
| ----------- | ----------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `hasWallet` | `bool`            | Whether the client has a wallet (i.e. addresses are available). This reflects wallet existence, **not** whether the signing shares are on this device — use [`isWalletOnDevice`](./iswalletondevice) for that. |
| `addresses` | `PortalAddresses` | The wallet addresses                                                                                                                                                                                           |

### PortalAddresses

| Property   | Type      | Description               |
| ---------- | --------- | ------------------------- |
| `ethereum` | `String?` | The EVM wallet address    |
| `solana`   | `String?` | The Solana wallet address |

### Example

```dart theme={null}
import 'package:portal_flutter/portal_flutter.dart';

final portal = Portal();

final result = await portal.getAddresses();

if (result.hasWallet) {
  print('EVM address: ${result.addresses.ethereum}');
  print('Solana address: ${result.addresses.solana}');
} else {
  print('No wallet found');
}
```

***

## getAddress

### Function Signature

```dart theme={null}
Future<String?> getAddress(String chainId)
```

### Description

Get the wallet address for a specific chain. Like `getAddresses`, it comes from the client's Portal-provided wallet metadata, not from the on-device signing shares, so a non-null address only indicates the client has a wallet — it does **not** mean the signing shares are on this device. Use [`isWalletOnDevice`](./iswalletondevice) to determine on-device signing availability.

### Parameters

| Parameter | Type     | Required | Description                   |
| --------- | -------- | -------- | ----------------------------- |
| `chainId` | `String` | Yes      | The chain ID in CAIP-2 format |

### Returns

**`String?`** - The wallet address for the specified chain, or `null` if the client has no wallet.

### Example

```dart theme={null}
import 'package:portal_flutter/portal_flutter.dart';

final portal = Portal();

// Get Ethereum mainnet address
final ethAddress = await portal.getAddress('eip155:1');

// Get Solana mainnet address
final solAddress = await portal.getAddress('solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp');

print('ETH address: $ethAddress');
print('SOL address: $solAddress');
```

## Errors

| Code              | Description                |
| ----------------- | -------------------------- |
| `NOT_INITIALIZED` | Portal was not initialized |

## Related

* [Create a wallet guide](../guide/create-a-wallet)
* [createWallet](./createwallet)
* [doesWalletExist](./doeswalletexist)
* [isWalletOnDevice](./iswalletondevice) — check whether the signing shares are on the current device
