Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import { EndpointsTable } from "@site/src/components/EndpointsTable";

An order book is a collection of offers for a specific pair of assets.

The [latest ledger](../../structure/consistency.mdx) known to Horizon is included as an HTTP header in the response.

Learn more about [order books](../../../../../learn/glossary.mdx#decentralized-exchange).

<EndpointsTable title="Endpoints">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ When Horizon returns information about an order book, it uses the following form

</AttributeTable>

The [latest ledger](../../structure/consistency.mdx) known to Horizon is included as an HTTP header in the response.

<ExampleResponse>

```json
Expand Down
2 changes: 2 additions & 0 deletions docs/data/horizon/api-reference/aggregations/paths/README.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import { EndpointsTable } from "@site/src/components/EndpointsTable";

Paths provide information about potential path payments. A path can be used to populate the necessary fields for a path payment operation.

The [latest ledger](../../structure/consistency.mdx) known to Horizon is included as an HTTP header in the response.

Learn more about the two types of path payment: [`path payment strict send`](../../../../../learn/fundamentals/transactions/list-of-operations.mdx#path-payment-strict-send) and [`path payment strict receive`](../../../../../learn/fundamentals/transactions/list-of-operations.mdx#path-payment-strict-receive)

<EndpointsTable title="Endpoints">
Expand Down
2 changes: 2 additions & 0 deletions docs/data/horizon/api-reference/aggregations/paths/object.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ When Horizon returns information about a path, it uses the following format:

</AttributeTable>

The [latest ledger](../../structure/consistency.mdx) known to Horizon is included as an HTTP header in the response.

<ExampleResponse>

```json
Expand Down
2 changes: 2 additions & 0 deletions docs/data/horizon/api-reference/resources/accounts/README.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import { EndpointsTable } from "@site/src/components/EndpointsTable";

Users interact with the Stellar network through accounts. Everything else in the ledger—assets, offers, trustlines, etc.—are owned by accounts, and accounts must authorize all changes to the ledger through signed transactions.

The [latest ledger](../../structure/consistency.mdx) known to Horizon is included as an HTTP header in the response.

Learn more about [accounts](../../../../../learn/glossary.mdx#account).

<EndpointsTable title="Endpoints">
Expand Down
2 changes: 2 additions & 0 deletions docs/data/horizon/api-reference/resources/accounts/object.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,8 @@ When Horizon returns information about an account, it uses the following format:

</AttributeTable>

The [latest ledger](../../structure/consistency.mdx) known to Horizon is included as an HTTP header in the response.

<ExampleResponse>

```json
Expand Down
2 changes: 2 additions & 0 deletions docs/data/horizon/api-reference/resources/assets/README.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import { EndpointsTable } from "@site/src/components/EndpointsTable";

Assets are representations of value issued on the Stellar network. An asset consists of a type, code, and issuer.

The [latest ledger](../../structure/consistency.mdx) known to Horizon is included as an HTTP header in the response.

Learn more about [assets](../../../../../learn/glossary.mdx#asset).

<EndpointsTable title="Endpoints">
Expand Down
2 changes: 2 additions & 0 deletions docs/data/horizon/api-reference/resources/assets/object.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ When Horizon returns information about an asset, it uses the following format:

</AttributeTable>

The [latest ledger](../../structure/consistency.mdx) known to Horizon is included as an HTTP header in the response.

<ExampleResponse>

```json
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import { EndpointsTable } from "@site/src/components/EndpointsTable";

A Claimable Balance represents the transfer of ownership of some amount of an asset. Claimable balances provide a mechanism for setting up a payment which can be claimed in the future. This allows you to make payments to accounts which are currently not able to accept them.

The [latest ledger](../../structure/consistency.mdx) known to Horizon is included as an HTTP header in the response.

<EndpointsTable title="Endpoints">

| | |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ When Horizon returns information about a claimable balance, it uses the followin

</AttributeTable>

The [latest ledger](../../structure/consistency.mdx) known to Horizon is included as an HTTP header in the response.

<ExampleResponse>

```json
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import { EndpointsTable } from "@site/src/components/EndpointsTable";

Liquidity Pools provide a simple, non-interactive way to trade large amounts of capital and enable high volumes of trading.

The [latest ledger](../../structure/consistency.mdx) known to Horizon is included as an HTTP header in the response.

<EndpointsTable title="Endpoints">

| | |
Expand Down
2 changes: 2 additions & 0 deletions docs/data/horizon/api-reference/resources/offers/README.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import { EndpointsTable } from "@site/src/components/EndpointsTable";

Offers are statements about how much of an asset an account wants to buy or sell.

The [latest ledger](../../structure/consistency.mdx) known to Horizon is included as an HTTP header in the response.

Learn more about [offers](../../../../../learn/glossary.mdx#decentralized-exchange).

<EndpointsTable title="Endpoints">
Expand Down
2 changes: 2 additions & 0 deletions docs/data/horizon/api-reference/resources/offers/object.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ When Horizon returns information about an offer, it uses the following format:

</AttributeTable>

The [latest ledger](../../structure/consistency.mdx) known to Horizon is included as an HTTP header in the response.

<ExampleResponse>

```json
Expand Down
9 changes: 9 additions & 0 deletions docs/data/horizon/api-reference/structure/consistency.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
title: Consistency
sidebar_position: 70
---

For endpoints which serve data which can change from ledger to ledger (for example an account balance), Horizon includes a `Latest-Ledger` HTTP header in its response.
The value of the `Latest-Ledger` HTTP header is the sequence number of the latest ledger known to Horizon at the time the request was processed.
Horizon will guarantee that all the data included in the response is consistent with that ledger. This mechanism prevents race conditions where
a request is processed at the boundary of two ledgers and ensures that the response is consistent with the ledger included in the `Latest-Ledger` HTTP header.