PagingLinksResponse

public struct PagingLinksResponse : Decodable, Sendable

Navigation links for paginated result sets from Horizon.

Horizon uses cursor-based pagination for large result sets. This response provides links to navigate between pages: the current page (self), next page, and previous page.

Pagination links preserve all query parameters from the original request (filters, ordering, etc.) and include cursor parameters to fetch the adjacent pages.

Example usage:

let page: PageResponse<TransactionResponse> = // ... get page

// Check if there are more pages
if let nextURL = page.links.next?.href {
    // Fetch next page using the URL
}

if let prevURL = page.links.prev?.href {
    // Fetch previous page using the URL
}

// Self link to current page
let currentPageURL = page.links.selflink.href

See also:

  • Link to the current page with all original query parameters.

    Declaration

    Swift

    public let selflink: LinkResponse
  • Link to the next page of results. Nil if this is the last page.

    Declaration

    Swift

    public let next: LinkResponse?
  • Link to the previous page of results. Nil if this is the first page.

    Declaration

    Swift

    public let prev: LinkResponse?
  • Initializer - creates a new instance by decoding from the given decoder.

    Declaration

    Swift

    public init(from decoder: Decoder) throws

    Parameters

    decoder

    The decoder containing the data