def client():
    """Client that connects to sandbox API. Relies on authentication information
    provided in api_config.json"""
    with open('api_config.json.example') as file:
        api_config = json.load(file)
    c = AuthenticatedClient(
        api_url='https://api-public.sandbox.pro.coinbase.com', **api_config)

    # Set up account with deposits and orders. Do this by depositing from
    # the Coinbase USD wallet, which has a fixed value of > $10,000.
    #
    # Only deposit if the balance is below some nominal amount. The
    # exchange seems to freak out if you run up your account balance.
    coinbase_accounts = c.get_coinbase_accounts()
    account_info = [x for x in coinbase_accounts
                    if x['name'] == 'USD Wallet'][0]
    account_usd = account_info['id']
    if float(account_info['balance']) < 70000:
        c.coinbase_deposit(10000, 'USD', account_usd)
    # Place some orders to generate history
    c.place_limit_order('BTC-USD', 'buy', 1, 0.01)
    c.place_limit_order('BTC-USD', 'buy', 2, 0.01)
    c.place_limit_order('BTC-USD', 'buy', 3, 0.01)

    return c
Client that connects to sandbox API. Relies on authentication information
    provided in api_config.json
tests/test_authenticated_client.py