OZRelayerResponse

public struct OZRelayerResponse : Decodable, Equatable, Hashable, Sendable

Response from the relayer service.

The relayer wraps user transactions with fee bumps and submits them to Stellar, enabling gasless onboarding for accounts with no XLM balance.

  • success: true when the relayer accepted the transaction.
  • transactionId: relayer-assigned identifier when submission succeeded.
  • hash: Stellar transaction hash returned by the relayer when available.
  • status: transaction status string (for example "PENDING", "SUCCESS", "ERROR").
  • error: human-readable error message when the request failed. Stored verbatim as returned by the relayer; not individually truncated. Bounded only by the overall response-size limit (OZConstants.maxRelayerResponseBytes), which caps the entire response body before decoding.
  • errorCode: machine-readable error code; one of the OZRelayerErrorCodes constants when populated.
  • details: additional details JSON forwarded from the relayer body’s data field. See the property documentation below for the exact mapping.
  • Undocumented

    Declaration

    Swift

    public let success: Bool
  • Undocumented

    Declaration

    Swift

    public let transactionId: String?
  • Undocumented

    Declaration

    Swift

    public let hash: String?
  • Undocumented

    Declaration

    Swift

    public let status: String?
  • Undocumented

    Declaration

    Swift

    public let error: String?
  • Undocumented

    Declaration

    Swift

    public let errorCode: String?
  • Additional details JSON forwarded from the relayer body’s data field. When the relayer emits a JSON object under data, its keys appear verbatim. When the relayer emits a non-object value (string, number, array, bool, or null) under data, the value is wrapped as ["value": <wrapped>] so callers always observe a [String: OZJSONValue] shape. nil when the relayer omits data entirely.

    Declaration

    Swift

    public let details: [String : OZJSONValue]?
  • Undocumented

    Declaration

    Swift

    public init(
        success: Bool,
        transactionId: String? = nil,
        hash: String? = nil,
        status: String? = nil,
        error: String? = nil,
        errorCode: String? = nil,
        details: [String: OZJSONValue]? = nil
    )
  • Decodes from either the wrapped envelope ({"success": ..., "data": {...}}) or the flat envelope ({"success": ..., "hash": ..., ...}).

    transactionId, hash, and status are read from the nested data object if present, falling back to top-level. error and errorCode use a fixed lookup order (codeerrorCode → nested data.code) and read text from error then message. details is sourced from the nested data object; non-object data payloads (string, number, array, bool, null) are wrapped under the key "value" so callers always observe a [String: OZJSONValue]. nil means the relayer omitted data entirely.

    Declaration

    Swift

    public init(from decoder: Decoder) throws