# API v1 Overview

[![Run In Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/25193308-9db7ddc1-c22f-44f1-bcc4-badae4796dfb?action=collection%2Ffork\&source=rip_markdown\&collection-url=entityId%3D25193308-9db7ddc1-c22f-44f1-bcc4-badae4796dfb%26entityType%3Dcollection%26workspaceId%3D996072e7-23dc-4dc5-abe3-a4351f3abba1)

{% hint style="danger" %}
This is an outdated version of our documentation.

Please visit the latest version at <https://docs.blockend.com/> for up-to-date and accurate information.
{% endhint %}

### Getting Started <a href="#getting-started" id="getting-started"></a>

Base URL `https://api2.blockend.com/v1/` \
All type definitions can be found [here](https://docs.blockend.com/compass/type-definations)

### Core Transaction Flow

#### 1. Fetching quotes <a href="#id-1.-fetching-quotes" id="id-1.-fetching-quotes"></a>

User flow begins with fetching quotes, which returns a list of quotes for the given input and output assets, along with the steps involved in the transaction. Quotes are by default sorted via best output and contains a scores object and tags to determine fastest/cheapest/best output routes.

[Get Quotes Documentation](https://docs.blockend.com/compass/fetching-quotes)

#### 2. Creating a transaction <a href="#id-2.-creating-a-transaction" id="id-2.-creating-a-transaction"></a>

After fetching quotes, you can create a transaction using the selected quote by passing in the `routeId` of the quote.

[Create Transaction Documentation](https://docs.blockend.com/compass/create-transaction)

#### 3. Getting transaction data to execute <a href="#id-3.-getting-transaction-data-to-execute" id="id-3.-getting-transaction-data-to-execute"></a>

Call this api with `routeId` and `stepId` of individual steps to get the transaction data to execute.

[Get Transaction Data Documentation](https://docs.blockend.com/compass/getting-transaction-data-to-execute)

#### 4. Check status of a transaction <a href="#id-4.-check-status-of-a-transaction" id="id-4.-check-status-of-a-transaction"></a>

After user signs and submits the transaction on chain, check the status of the transaction by passing in the signature hash of the transaction.

[Check Transaction Status Documentation](https://docs.blockend.com/compass/check-transaction-status)

#### 5. Using WebSockets for realtime updates (in active development) <a href="#id-5.-using-websockets-for-realtime-updates" id="id-5.-using-websockets-for-realtime-updates"></a>

You can also check the status of a transaction using WebSockets. This can provide faster and almost realtime updates on the status of a transaction.

> Note: this feature is in active development and will be generally available soon. Contact us to get access to this feature.

#### 6. Single  API for simple flow execution (in active development) <a href="#meta-endpoints" id="meta-endpoints"></a>

A simple 1 step endpoint is being worked on where a request directly gives you a single quote in response along with array of transaction data to execute to complete the transaction&#x20;

> Note: this feature is in active development and will be generally available soon. Contact us to get access to this feature.

### Meta Endpoints <a href="#meta-endpoints" id="meta-endpoints"></a>

#### [Tokens](https://docs.blockend.com/compass/supported-tokens) <a href="#tokens" id="tokens"></a>

Get a list of supported tokens and their details.

```
curl -X GET "https://api2.blockend.com/v1/tokens"
```

#### [Chains](https://docs.blockend.com/compass/supported-chains) <a href="#chains" id="chains"></a>

Get a list of supported chains and their details.

```
curl -X GET "https://api2.blockend.com/v1/chains"
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.blockend.com/compass/api-v1-overview.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
