# BitcoinApi

All URIs are relative to *http://localhost*

| Method | HTTP request | Description |
|------------- | ------------- | -------------|
| [**tip**](BitcoinApi.md#tip) | **GET** /api/v1/bitcoin/tip | Get bitcoin tip height |



## tip

> TipResponse tip()

Get bitcoin tip height

Queries the wallet\&#39;s chain source for the block height of the latest block on the best chain.

### Example

```ts
import {
  Configuration,
  BitcoinApi,
} from '@secondts/barkd';
import type { TipRequest } from '@secondts/barkd';

async function example() {
  console.log("🚀 Testing @secondts/barkd SDK...");
  const config = new Configuration({ 
    // Configure HTTP bearer authorization: bearer
    accessToken: "YOUR BEARER TOKEN",
  });
  const api = new BitcoinApi(config);

  try {
    const data = await api.tip();
    console.log(data);
  } catch (error) {
    console.error(error);
  }
}

// Run the test
example().catch(console.error);
```

### Parameters

This endpoint does not need any parameter.

### Return type

[**TipResponse**](TipResponse.md)

### Authorization

[bearer](../README.md#bearer)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: `application/json`


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | Returns the current bitcoin tip height |  -  |
| **500** | Internal server error |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)

