package
0.0.0-20250213232608-c453f8b35c75
Repository: https://github.com/stellar/go.git
Documentation: pkg.go.dev
# README
Horizon Protocol Changelog
Any changes to the Horizon Public API should be included in this doc.
SDK support
We started tracking SDK support at version 0.12.3. Support for 0.12.3 means that SDK can correctly:
- Send requests using all available query params / POST params / headers,
- Parse all fields in responses structs and headers.
For each new version we will only track changes from the previous version.
Changes
Unreleased
Changes
- In "Transaction",
result_meta_xdr
field is now nullable, and will benull
when Horizon hasSKIP_TXMETA=true
set, otherwise if Horizon is configured withSKIP_TXMETA=false
which is default, thenresult_meta_xdr
will be the same value of base64 encoded xdr. - Operations responses may include a
transaction
field which represents the transaction that created the operation.
0.15.0
SDKs with full support
Changes
- Assets stats are disabled by default. This can be changed using an environment variable (
ENABLE_ASSET_STATS=true
) or CLI parameter (--enable-asset-stats=true
). Please note that it has a negative impact on a DB and ingestion time. - In "Offers for Account",
last_modified_time
field endpoint can benull
when ledger data is not available (has not been ingested yet). - "Trades for Offer" endpoint will query for trades that match the given offer on either side of trades, rather than just the "sell" offer. Offer IDs are now synthetic.
- New
/operation_fee_stats
endpoint includes fee stats for the last 5 ledgers. - "Trades" endpoint can now be streamed.
- In "Trade Aggregations" endpoint,
offset
parameter has been added. - Account flags now display
auth_immutable
value. - Rate limiting in streams has been changed to be more fair. Now 1 credit has to be paid every time there's a new ledger instead of per request.
Resource | Changes | Go SDK 1 | JS SDK | Java SDK |
---|---|---|---|---|
GET /assets | Disabled by default. | + | 0.10.2 | 0.4.0 |
GET /accounts/{account_id}/offers | last_modified_time field can be null | - | 0.10.2 | 0.4.0 |
GET /offers/{offer_id}/trades | Query fields and syntetic IDs | - | 0.10.2 | 0.4.0 |
GET /trades SSE | Can be streamed | - | - | 0.4.0 |
GET /operation_fee_stats | New endpoint | - | - | 0.4.0 |
GET /trade_aggregations | New offset parameter | - | - | 0.4.0 |
GET /accounts/{account_id} | Displaying auth_immutable flag | - | 0.10.2 | 0.4.0 |
0.14.0
SDKs with full support
Changes
- New
bump_sequence
operation. - New
sequence_bumped
effect. - New fields in Account > Balances collection:
buying_liabilities
andselling_liabilities
. - Offer resource
last_modified
field removed, replaced bylast_modified_ledger
andlast_modified_time
. - Trade aggregations endpoint accepts only specific time ranges now (1/5/15 minutes, 1 hour, 1 day, 1 week).
- Horizon now sends
Cache-Control: no-cache, no-store, max-age=0
HTTP header for all responses.
Resource | Changes | Go SDK 1 | JS SDK | Java SDK |
---|---|---|---|---|
GET /accounts/{account_id} | Liabilities fields in Balances collection. | + | 0.10.2 | 0.3.1 |
GET /accounts/{account_id}/effects | sequence_bumped effect | - | 0.10.2 | 0.3.1 |
GET /accounts/{account_id}/effects SSE | sequence_bumped effect | - | 0.10.2 | 0.3.1 |
GET /accounts/{account_id}/offers | last_modified field removed | - | 0.10.2 | 0.3.1 |
GET /accounts/{account_id}/operations | bump_sequence operation | - | 0.10.2 | 0.3.1 |
GET /accounts/{account_id}/operations SSE | bump_sequence operation | - | 0.10.2 | 0.3.1 |
GET /effects | sequence_bumped effect | - | 0.10.2 | 0.3.1 |
GET /effects SSE | sequence_bumped effect | - | 0.10.2 | 0.3.1 |
GET /ledgers/{ledger_id}/operations | bump_sequence operation | - | 0.10.2 | 0.3.1 |
GET /ledgers/{ledger_id}/operations SSE | bump_sequence operation | - | 0.10.2 | 0.3.1 |
GET /ledgers/{ledger_id}/effects | sequence_bumped effect | - | 0.10.2 | 0.3.1 |
GET /ledgers/{ledger_id}/effects SSE | sequence_bumped effect | - | 0.10.2 | 0.3.1 |
GET /operations | bump_sequence operation | - | 0.10.2 | 0.3.1 |
GET /operations SSE | bump_sequence operation | - | 0.10.2 | 0.3.1 |
GET /operations/{op_id} | bump_sequence operation | + | 0.10.2 | 0.3.1 |
GET /trades_aggregations | Only specific time ranges allowed | + | 0.10.2 | 0.3.1 |
GET /transactions/{tx_id}/operations | bump_sequence operation | - | 0.10.2 | 0.3.1 |
GET /transactions/{tx_id}/operations SSE | bump_sequence operation | - | 0.10.2 | 0.3.1 |
GET /transactions/{tx_id}/effects | sequence_bumped effect | - | 0.10.2 | 0.3.1 |
GET /transactions/{tx_id}/effects SSE | sequence_bumped effect | - | 0.10.2 | 0.3.1 |
0.13.0
SDKs with full support
Changes
amount
field in/assets
is now a String (to support Stellar amounts larger thanint64
).- Effect resource contains a new
created_at
field.
Resource | Changes | Go SDK 1 | JS SDK | Java SDK |
---|---|---|---|---|
GET /assets | amount can be larger than MAX_INT64 /10^7 | + | 0.8.2 2 | 0.2.0 |
GET /ledgers/{ledger_id}/effects | created_at field added | + | 0.8.2 2 | 0.2.1 |
GET /ledgers/{ledger_id}/effects SSE | created_at field added | + | 0.8.2 2 | 0.2.1 |
GET /accounts/{account_id}/effects | created_at field added | + | 0.8.2 2 | 0.2.1 |
GET /accounts/{account_id}/effects SSE | created_at field added | + | 0.8.2 2 | 0.2.1 |
GET /transactions/{tx_id}/effects | created_at field added | + | 0.8.2 2 | 0.2.1 |
GET /transactions/{tx_id}/effects SSE | created_at field added | + | 0.8.2 2 | 0.2.1 |
GET /operations/{op_id}/effects | created_at field added | + | 0.8.2 2 | 0.2.1 |
GET /operations/{op_id}/effects SSE | created_at field added | + | 0.8.2 2 | 0.2.1 |
GET /effects | created_at field added | + | 0.8.2 2 | 0.2.1 |
GET /effects SSE | created_at field added | + | 0.8.2 2 | 0.2.1 |
0.12.3
SDKs with full support
Changes
Resource | Go SDK 1 | JS SDK | Java SDK |
---|---|---|---|
GET / | + (some _links missing) | - | 0.2.1 |
GET /metrics | - | - | - |
GET /ledgers | - | 0.8.2 | 0.2.0 |
GET /ledgers SSE | + | 0.8.2 | 0.2.0 |
GET /ledgers/{ledger_id} | - | 0.8.2 | 0.2.0 |
GET /ledgers/{ledger_id}/transactions | - | 0.8.2 | 0.2.0 |
GET /ledgers/{ledger_id}/transactions SSE | - | 0.8.2 | 0.2.0 |
GET /ledgers/{ledger_id}/operations | - | 0.8.2 | 0.2.0 |
GET /ledgers/{ledger_id}/operations SSE | - | 0.8.2 | 0.2.1 |
GET /ledgers/{ledger_id}/payments | - | 0.8.2 | 0.2.0 |
GET /ledgers/{ledger_id}/payments SSE | - | 0.8.2 | 0.2.0 |
GET /ledgers/{ledger_id}/effects | - | 0.8.2 | 0.2.0 (no support for data, inflation types) |
GET /ledgers/{ledger_id}/effects SSE | - | 0.8.2 | 0.2.0 (no support for data, inflation types) |
GET /accounts/{account_id} | + | 0.8.2 | 0.2.0 |
GET /accounts/{account_id}/transactions | - | 0.8.2 | 0.2.0 |
GET /accounts/{account_id}/transactions SSE | - | 0.8.2 | 0.2.0 |
GET /accounts/{account_id}/operations | - | 0.8.2 | 0.2.0 |
GET /accounts/{account_id}/operations SSE | - | 0.8.2 | 0.2.1 |
GET /accounts/{account_id}/payments | - | 0.8.2 | 0.2.0 |
GET /accounts/{account_id}/payments SSE | - | 0.8.2 | 0.2.0 |
GET /accounts/{account_id}/effects | - | 0.8.2 | 0.2.0 (no support for data, inflation types) |
GET /accounts/{account_id}/effects SSE | - | 0.8.2 | 0.2.0 (no support for data, inflation types) |
GET /accounts/{account_id}/offers | + | 0.8.2 | 0.2.0 |
GET /accounts/{account_id}/trades | - | 0.8.2 | 0.2.1 |
GET /accounts/{account_id}/data/{key} | - | - | - |
POST /transactions | - | 0.8.2 | 0.2.0 |
GET /transactions | + | 0.8.2 | 0.2.0 |
GET /transactions SSE | + | 0.8.2 | 0.2.0 |
GET /transactions/{tx_id} | + | 0.8.2 | 0.2.0 |
GET /transactions/{tx_id}/operations | - | 0.8.2 | 0.2.0 |
GET /transactions/{tx_id}/operations SSE | - | 0.8.2 | 0.2.1 |
GET /transactions/{tx_id}/payments | - | 0.8.2 | 0.2.0 |
GET /transactions/{tx_id}/payments SSE | - | 0.8.2 | 0.2.0 |
GET /transactions/{tx_id}/effects | - | 0.8.2 | 0.2.0 (no support for data, inflation types) |
GET /transactions/{tx_id}/effects SSE | - | 0.8.2 | 0.2.0 (no support for data, inflation types) |
GET /operations | - | 0.8.2 | 0.2.0 |
GET /operations SSE | - | 0.8.2 | 0.2.1 |
GET /operations/{op_id} | - | 0.8.2 | 0.2.0 |
GET /operations/{op_id}/effects | - | 0.8.2 | 0.2.0 (no support for data, inflation types) |
GET /operations/{op_id}/effects SSE | - | 0.8.2 | 0.2.0 (no support for data, inflation types) |
GET /payments | - | 0.8.2 | 0.2.0 |
GET /payments SSE | + | 0.8.2 | 0.2.0 |
GET /effects | - | 0.8.2 | 0.2.0 (no support for data, inflation types) |
GET /effects SSE | - | 0.8.2 | 0.2.0 (no support for data, inflation types) |
GET /trades | + | 0.8.2 | 0.2.0 (no price field) |
GET /trades_aggregations | + | 0.8.2 | 0.2.0 |
GET /offers/{offer_id}/trades | - | 0.8.2 | 0.2.1 |
GET /order_book | + | 0.8.2 | 0.2.0 |
GET /order_book SSE | - | 0.8.2 | 0.2.1 |
GET /paths | - | 0.8.2 | 0.2.0 |
GET /assets | - | 0.8.2 | 0.2.0 |
1 We don't do proper versioning for GO SDK yet. +
means implemented in master
branch.
2 Native JSON support in JS, no changes needed.
# Functions
KeyTypeFromAddress converts the version byte of the provided strkey encoded value (for example an account id or a signer key) and returns the appropriate horizon-specific type name.
MustKeyTypeFromAddress is the panicking variant of KeyTypeFromAddress.
# Variables
KeyTypeNames maps from strkey version bytes into json string values to use in horizon responses.
# Structs
Account is the summary of an account.
AccountData represents a single data object stored on by an account.
AccountFlags represents the state of an account's flags.
AccountsPage returns a list of account records.
AccountThresholds represents an accounts "thresholds", the numerical values needed to satisfy the authorization of a given operation.
AssetsPage contains page of assets returned by Horizon.
AssetStat represents the statistics for a single Asset.
AssetStatAccounts represents the summarized acount numbers for a single Asset.
AssetStatBalances represents the summarized balances for a single Asset.
AsyncTransactionSubmissionResponse represents the response returned by Horizon when using the transaction-async endpoint.
Balance represents an account's holdings for either a single currency type or shares in a liquidity pool.
ClaimableBalance represents a claimable balance.
ClaimableBalanceFlags represents the state of a claimable balance's flags.
Claimant represents a claimable balance claimant.
FeeBumpTransaction contains information about a fee bump transaction.
FeeStats represents a response of fees from horizon To do: implement fee suggestions if agreement is reached in https://github.com/stellar/go/issues/926.
InnerTransaction contains information about the inner transaction contained within a fee bump transaction.
Ledger represents a single closed ledger.
LedgersPage contains page of ledger information returned by Horizon.
LiquidityPool represents a liquidity pool.
LiquidityPoolReserve represents a liquidity pool asset reserve.
LiquidityPoolsPage returns a list of liquidity pool records.
Offer is the display form of an offer to trade currency.
OffersPage returns a list of offers.
OrderBookSummary represents a snapshot summary of a given order book.
Path represents a single payment path.
PathsPage contains records of payment paths found by horizon.
PriceLevel represents an aggregation of offers that share a given price.
Root is the initial map of links into the api.
Signer represents one of an account's signers.
Trade represents a horizon digested trade.
TradeAggregation represents trade data aggregation over a period of time.
TradeAggregationsPage returns a list of aggregated trade records, aggregated by resolution.
TradeEffect represents a trade effect resource.
TradePrice represents a price for a trade.
TradesPage returns a list of trade records.
Transaction represents a single, successful transaction.
TransactionResultCodes represent a summary of result codes returned from a single xdr TransactionResult.
TransactionsPage contains records of transaction information returned by Horizon.