# How to manage TON wallets with WalletKit on the iOS platform (https://docs-fpm2731fy-ton-core-docs.vercel.app/llms/ecosystem/walletkit/ios/wallets/content.md)



<Callout type="tip">
  Initialize the WalletKit before managing wallets. See the [initialization guide](/llms/ecosystem/walletkit/ios/init/content.md) for details.
</Callout>

The SDK provides a comprehensive API for creating, retrieving, and managing wallets. All wallet operations follow a three-step pattern.

## Creation pattern [#creation-pattern]

The SDK uses a three-step pattern for creating wallets, providing fine-grained control over key management and wallet configuration:

1. Create a signer: generate or import cryptographic keys
2. Create an adapter: configure wallet version and network settings
3. Add the wallet: register the wallet with the SDK

## Creating wallets from mnemonic [#creating-wallets-from-mnemonic]

Import an existing wallet from a mnemonic:

```swift
let mnemonic = TONMnemonic(value: ["word1", "word2", /* ... 24 words ... */])
let signer = try await walletKit.signer(mnemonic: mnemonic)
let adapter = try await walletKit.walletV5R1Adapter(
    signer: signer,
    parameters: .init(network: .mainnet)
)
let wallet = try await walletKit.add(walletAdapter: adapter)
```

<Callout type="danger">
  Always store mnemonic phrases securely using platform-specific encrypted storage. Never store them in plain text or as part of the code.
</Callout>

## Creating wallets from secret key [#creating-wallets-from-secret-key]

For externally managed keys:

```swift
let privateKey = /* 32-byte private key as Data */
let signer = try await walletKit.signer(privateKey: privateKey)
let adapter = try await walletKit.walletV5R1Adapter(
    signer: signer,
    parameters: .init(network: .mainnet)
)
let wallet = try await walletKit.add(walletAdapter: adapter)
```

## Wallet versions [#wallet-versions]

The SDK supports multiple wallet contract versions: V5R1 and V4R2.

### V5R1 (Recommended) [#v5r1-recommended]

The latest wallet version with improved features and gas optimization:

```swift
let adapter = try await walletKit.walletV5R1Adapter(
    signer: signer,
    parameters: .init(network: .mainnet)
)
```

### V4R2 (Compatible) [#v4r2-compatible]

Widely supported legacy version:

```swift
let adapter = try await walletKit.walletV4R2Adapter(
    signer: signer,
    parameters: .init(network: .mainnet)
)
```

## Retrieving wallets [#retrieving-wallets]

Get all wallets managed by the SDK:

```swift
let wallets = try await walletKit.wallets()
```

Get a specific wallet by an address:

```swift
let wallet = try walletKit.wallet(address: "<TON_WALLET_ADDRESS>")
```

## Removing wallets [#removing-wallets]

Remove a single wallet:

```swift
try await walletKit.remove(walletAddress: "<TON_WALLET_ADDRESS>")
```

## Next steps [#next-steps]

<Columns cols="2">
  <Card title="Handle events" href="./events">
    Learn how to handle dApp connections and other events
  </Card>

  <Card title="Retrieve wallet data" href="./data">
    Get balances, Jettons, and NFTs
  </Card>
</Columns>
