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

# Adding Custom Solana, Bitcoin, and TON Networks

> Configure custom Solana, Bitcoin, and TON networks for the Swift SDK at initialization.

You can add Solana, Bitcoin, and TON networks that Dynamic does not support out of the box by passing lists of `GenericNetwork` objects to the `solNetworks`, `bitcoinNetworks`, and `tonNetworks` properties in `ClientProps` when initializing the SDK.

<Warning>
  The `solNetworks`, `bitcoinNetworks`, and `tonNetworks` lists replace the Solana, Bitcoin, and TON networks enabled in your Dynamic dashboard for this session. Pass the full list of networks you want the SDK to use.
</Warning>

## Example

The following example sets Solana Mainnet and Devnet, Bitcoin Mainnet, and TON Mainnet as supported networks.

```swift theme={"system"}
import DynamicSDKSwift

let solNetworks = [
    GenericNetwork(
        blockExplorerUrls: ["https://explorer.solana.com"],
        chainId: "solana:101",
        iconUrls: ["https://app.dynamic.xyz/assets/networks/sol.svg"],
        name: "Solana Mainnet",
        nativeCurrency: NativeCurrency(
            decimals: 9,
            name: "Sol",
            symbol: "SOL"
        ),
        networkId: 101,
        rpcUrls: ["https://api.mainnet-beta.solana.com"],
        vanityName: "Solana Mainnet"
    ),
    GenericNetwork(
        blockExplorerUrls: ["https://explorer.solana.com/?cluster=devnet"],
        chainId: "solana:103",
        iconUrls: ["https://app.dynamic.xyz/assets/networks/sol.svg"],
        name: "Solana Devnet",
        nativeCurrency: NativeCurrency(
            decimals: 9,
            name: "Sol",
            symbol: "SOL"
        ),
        networkId: 103,
        rpcUrls: ["https://api.devnet.solana.com"],
        vanityName: "Solana Devnet"
    )
]

let bitcoinNetworks = [
    GenericNetwork(
        blockExplorerUrls: ["https://mempool.space"],
        chainId: "bip122:000000000019d6689c085ae165831e93",
        iconUrls: ["https://app.dynamic.xyz/assets/networks/btc.svg"],
        name: "Bitcoin Mainnet",
        nativeCurrency: NativeCurrency(
            decimals: 8,
            name: "Bitcoin",
            symbol: "BTC"
        ),
        networkId: 0,
        rpcUrls: ["https://YOUR_BTC_RPC_URL"],
        vanityName: "Bitcoin"
    )
]

let tonNetworks = [
    GenericNetwork(
        blockExplorerUrls: ["https://tonscan.org"],
        chainId: "ton:-239",
        iconUrls: ["https://app.dynamic.xyz/assets/networks/ton.svg"],
        name: "TON Mainnet",
        nativeCurrency: NativeCurrency(
            decimals: 9,
            name: "Toncoin",
            symbol: "TON"
        ),
        networkId: -239,
        rpcUrls: ["https://toncenter.com/api/v2/jsonRPC"],
        vanityName: "TON Mainnet"
    )
]

let _ = DynamicSDK.initialize(
    props: ClientProps(
        environmentId: "REPLACE_WITH_YOUR_ENV_ID",
        appOrigin: "https://your-app.com",
        solNetworks: solNetworks,
        bitcoinNetworks: bitcoinNetworks,
        tonNetworks: tonNetworks
    )
)
```

<Note>
  In the `GenericNetwork` initializer, `chainId` and `networkId` accept an `Int`, `Int64`, or `String`. `chainName`, `lcdUrl`, `nameService`, `privateCustomerRpcUrls`, and `vanityName` are optional.
</Note>

## Type Reference

### GenericNetwork

| Attribute              | Type              | Required/Optional |
| ---------------------- | ----------------- | ----------------- |
| blockExplorerUrls      | `[String]`        | Required          |
| chainId                | `Int` or `String` | Required          |
| iconUrls               | `[String]`        | Required          |
| name                   | `String`          | Required          |
| nativeCurrency         | `NativeCurrency`  | Required          |
| networkId              | `Int` or `String` | Required          |
| privateCustomerRpcUrls | `[String]?`       | Optional          |
| rpcUrls                | `[String]`        | Required          |
| vanityName             | `String?`         | Optional          |

### NativeCurrency

| Attribute | Type     | Required/Optional |
| --------- | -------- | ----------------- |
| decimals  | `Int`    | Required          |
| name      | `String` | Required          |
| symbol    | `String` | Required          |

## Next Steps

* [Network Management](/docs/swift/wallets/general/network-management) - Switch networks and read the current network
* [Solana Connection](/docs/swift/wallets/solana/connection) - Interact with the Solana blockchain
* [Bitcoin Overview](/docs/swift/wallets/bitcoin/overview) - Work with Bitcoin wallets
* [TON Overview](/docs/swift/wallets/ton/overview) - Work with TON wallets
