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

# Clients

We publish typed client packages that wrap the `barkd` REST API, so you can call it from typed code without writing raw HTTP. The packages are generated from the [OpenAPI spec](/barkd/api-reference/wallet/create-a-wallet) and live in the [barkd-clients repository](https://gitlab.com/ark-bitcoin/barkd-clients).

<Tabs>
  <Tab title="TypeScript">
    ### Prerequisites

    * Node.js

    ### Install

    ```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
    npm install @secondts/barkd
    ```

    ### Usage

    ```typescript theme={"theme":{"light":"github-light","dark":"github-dark"}}
    import { Configuration, WalletApi } from '@secondts/barkd'

    const config = new Configuration({
      basePath: 'http://localhost:3535'
    })

    const walletApi = new WalletApi(config)

    // Create wallet
    await walletApi.createWallet({
      createWalletRequest: {
        arkServer: 'https://ark.signet.2nd.dev',
        chainSource: { esplora: { url: 'https://esplora.signet.2nd.dev' } },
        network: 'signet',
        mnemonic: 'your seed phrase'
      }
    })

    // Get address
    const { address } = await walletApi.address()

    // Get balance
    const balance = await walletApi.balance()
    ```
  </Tab>

  <Tab title="C#">
    ### Prerequisites

    * .NET SDK

    ### Install

    ```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
    dotnet add package Second.Barkd
    ```

    ### Usage

    ```csharp theme={"theme":{"light":"github-light","dark":"github-dark"}}
    using Second.Barkd.Api;
    using Second.Barkd.Client;
    using Second.Barkd.Model;

    var config = new Configuration
    {
        BasePath = "http://localhost:3535"
    };

    var walletApi = new WalletApi(config);

    // Create wallet
    await walletApi.CreateWalletAsync(new CreateWalletRequest(
        arkServer: "https://ark.signet.2nd.dev",
        chainSource: new ChainSourceConfig(
            new ChainSourceConfigOneOf1(
                new ChainSourceConfigOneOf1Esplora("https://esplora.signet.2nd.dev")
            )
        ),
        network: BarkNetwork.Signet,
        mnemonic: "your seed phrase"
    ));

    // Get address
    var address = await walletApi.AddressAsync();

    // Get balance
    var balance = await walletApi.BalanceAsync();
    ```
  </Tab>

  <Tab title="Python">
    ### Prerequisites

    * Python 3.9+

    ### Install

    ```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
    pip install barkd-client
    ```

    ### Usage

    ```python theme={"theme":{"light":"github-light","dark":"github-dark"}}
    import barkd_client
    from barkd_client import (
        Configuration,
        WalletApi,
        CreateWalletRequest,
        ChainSourceConfig,
        ChainSourceConfigOneOf1,
        ChainSourceConfigOneOf1Esplora,
        BarkNetwork,
    )

    config = Configuration(host='http://localhost:3535')

    with barkd_client.ApiClient(config) as api_client:
        wallet_api = WalletApi(api_client)

        # Create wallet
        wallet_api.create_wallet(CreateWalletRequest(
            ark_server='https://ark.signet.2nd.dev',
            chain_source=ChainSourceConfig(actual_instance=ChainSourceConfigOneOf1(
                esplora=ChainSourceConfigOneOf1Esplora(url='https://esplora.signet.2nd.dev')
            )),
            network=BarkNetwork.SIGNET,
            mnemonic='your seed phrase',
        ))

        # Get address
        address = wallet_api.address().address

        # Get balance
        balance = wallet_api.balance()
    ```
  </Tab>
</Tabs>

<Note>
  Need a client for another language? Generate one yourself from the [OpenAPI spec](https://gitlab.com/ark-bitcoin/bark/-/raw/master/bark-rest/openapi.json) using [openapi-generator](https://openapi-generator.tech).
</Note>
