TradeResponse

@Serializable
data class TradeResponse(val id: String, val pagingToken: String, val ledgerCloseTime: String, val tradeType: String, val offerId: Long? = null, val liquidityPoolFeeBP: Int? = null, val baseLiquidityPoolId: String? = null, val baseOfferId: Long? = null, val baseAccount: String? = null, val baseAmount: String, val baseAssetType: String, val baseAssetCode: String? = null, val baseAssetIssuer: String? = null, val counterLiquidityPoolId: String? = null, val counterOfferId: Long? = null, val counterAccount: String? = null, val counterAmount: String, val counterAssetType: String, val counterAssetCode: String? = null, val counterAssetIssuer: String? = null, val baseIsSeller: Boolean? = null, val price: Price? = null, val links: TradeResponse.Links) : Response, Pageable

Represents a trade response from the Horizon API.

A trade represents an exchange of assets between two parties on the Stellar network. Trades can occur between two offers (orderbook trades) or between an offer and a liquidity pool.

See also

Constructors

Link copied to clipboard
constructor(id: String, pagingToken: String, ledgerCloseTime: String, tradeType: String, offerId: Long? = null, liquidityPoolFeeBP: Int? = null, baseLiquidityPoolId: String? = null, baseOfferId: Long? = null, baseAccount: String? = null, baseAmount: String, baseAssetType: String, baseAssetCode: String? = null, baseAssetIssuer: String? = null, counterLiquidityPoolId: String? = null, counterOfferId: Long? = null, counterAccount: String? = null, counterAmount: String, counterAssetType: String, counterAssetCode: String? = null, counterAssetIssuer: String? = null, baseIsSeller: Boolean? = null, price: Price? = null, links: TradeResponse.Links)

Types

Link copied to clipboard
@Serializable
data class Links(val base: Link, val counter: Link, val operation: Link)

HAL links connected to this trade.

Properties

Link copied to clipboard
@SerialName(value = "base_account")
val baseAccount: String?

The account ID of the base party in this trade

Link copied to clipboard
@SerialName(value = "base_amount")
val baseAmount: String

The amount of the base asset that was moved from base to counter

Link copied to clipboard
@SerialName(value = "base_asset_code")
val baseAssetCode: String?

The code of the base asset (null for native)

Link copied to clipboard
@SerialName(value = "base_asset_issuer")
val baseAssetIssuer: String?

The issuer of the base asset (null for native)

Link copied to clipboard
@SerialName(value = "base_asset_type")
val baseAssetType: String

The type of asset on the base side (native, credit_alphanum4, credit_alphanum12)

Link copied to clipboard
@SerialName(value = "base_is_seller")
val baseIsSeller: Boolean?

Indicates which party is the seller (true if base is seller)

Link copied to clipboard
@SerialName(value = "base_liquidity_pool_id")
val baseLiquidityPoolId: String?

The liquidity pool ID for the base side (for liquidity pool trades)

Link copied to clipboard
@SerialName(value = "base_offer_id")
val baseOfferId: Long?

The offer ID of the base account

Link copied to clipboard
@SerialName(value = "counter_account")
val counterAccount: String?

The account ID of the counter party in this trade

Link copied to clipboard
@SerialName(value = "counter_amount")
val counterAmount: String

The amount of the counter asset that was moved from counter to base

Link copied to clipboard
@SerialName(value = "counter_asset_code")
val counterAssetCode: String?

The code of the counter asset (null for native)

Link copied to clipboard
@SerialName(value = "counter_asset_issuer")
val counterAssetIssuer: String?

The issuer of the counter asset (null for native)

Link copied to clipboard
@SerialName(value = "counter_asset_type")
val counterAssetType: String

The type of asset on the counter side (native, credit_alphanum4, credit_alphanum12)

Link copied to clipboard
@SerialName(value = "counter_liquidity_pool_id")
val counterLiquidityPoolId: String?

The liquidity pool ID for the counter side (for liquidity pool trades)

Link copied to clipboard
@SerialName(value = "counter_offer_id")
val counterOfferId: Long?

The offer ID of the counter account

Link copied to clipboard
@SerialName(value = "id")
val id: String

Unique identifier for this trade

Link copied to clipboard
@SerialName(value = "ledger_close_time")
val ledgerCloseTime: String

An ISO 8601 formatted string of when the ledger with this trade was closed

Link copied to clipboard
@SerialName(value = "_links")
val links: TradeResponse.Links

HAL links related to this trade

Link copied to clipboard
@SerialName(value = "liquidity_pool_fee_bp")
val liquidityPoolFeeBP: Int?

The liquidity pool fee in basis points (for liquidity pool trades)

Link copied to clipboard
@SerialName(value = "offer_id")
val offerId: Long?

The offer ID (for backwards compatibility, deprecated - use baseOfferId or counterOfferId)

Link copied to clipboard
@SerialName(value = "paging_token")
open override val pagingToken: String

A cursor value for use in pagination

Link copied to clipboard
@SerialName(value = "price")
val price: Price?

The original offer price (counter / base)

Link copied to clipboard
@SerialName(value = "trade_type")
val tradeType: String

The type of trade (orderbook, liquidity_pool)