Structures

The following structures are available globally.

  • Cryptographic constants used throughout the SDK. These values define parameters for checksum algorithms, bit operations, and other low-level cryptographic functions.

    See more

    Declaration

    Swift

    public struct CryptographicConstants : Sendable
  • Network and HTTP-related constants used throughout the SDK. These values define thresholds for HTTP response handling and network operations.

    See more

    Declaration

    Swift

    public struct NetworkConstants : Sendable
  • Constants defined by Stellar Ecosystem Proposals (SEPs). These values represent configuration defaults, timeouts, and validation constraints specified in various SEP standards.

    Reference: https://github.com/stellar/stellar-protocol/tree/master/ecosystem

    See more

    Declaration

    Swift

    public struct SEPConstants : Sendable
  • Constants defined by the Stellar protocol specification. These values represent core protocol limits, sizes, and validation constraints used throughout the Stellar network.

    Reference: Stellar developer docs

    See more

    Declaration

    Swift

    public struct StellarProtocolConstants : Sendable
  • Implements BIP-32 hierarchical deterministic key derivation for Ed25519 keys.

    This struct provides Ed25519 key derivation following the BIP-32 standard, specifically for deriving Stellar keys using the path m/44’/148’/account’. The derivation uses HMAC-SHA512 to generate child keys from parent keys in a deterministic way.

    The Stellar derivation path follows BIP-44:

    • Purpose: 44’ (hardened, meaning BIP-44)
    • Coin type: 148’ (hardened, Stellar’s registered coin type)
    • Account: n’ (hardened, user-defined account index)

    All derivation levels use hardened keys (indicated by ‘), which means the parent private key is required to derive child keys, providing better security isolation.

    See also:

    See more

    Declaration

    Swift

    public struct Ed25519Derivation : Sendable
  • Represents a federation server response according to SEP-0002.

    This structure contains the resolved information for a Stellar address, mapping human-readable addresses like “alice*example.com” to account IDs and optional memo fields required for payments.

    Federation servers return this response when successfully resolving addresses through name lookup, account ID reverse lookup, transaction ID lookup, or forward lookup requests.

    Example Response

    {
        "stellar_address": "alice*testanchor.stellar.org",
        "account_id": "GACCOUNT...",
        "memo_type": "id",
        "memo": "12345"
    }
    

    Usage

    let result = await Federation.resolve(stellarAddress: "alice*example.com")
    if case .success(let response) = result {
        // Use account ID for payment
        let destination = response.accountId
    
        // Attach memo if present
        if let memoType = response.memoType, let memoValue = response.memo {
            // Create appropriate memo based on type
        }
    }
    

    See SEP-0002 Specification

    See more

    Declaration

    Swift

    public struct ResolveAddressResponse : Decodable, Sendable
  • Abstraction for TOML key paths

    See more

    Declaration

    Swift

    public struct Path : Hashable, Equatable, Sendable
  • Request parameters for initiating a deposit transaction via SEP-0024.

    This struct encapsulates all the parameters needed to start an interactive deposit flow, where a user deposits off-chain assets (e.g., fiat currency) with an anchor and receives the equivalent Stellar asset.

    See also:

    • [InteractiveService.deposit] for the method that uses this request
    • SEP-0024
    See more

    Declaration

    Swift

    public struct Sep24DepositRequest : Sendable
  • Request parameters for querying transaction fees via SEP-0024.

    This struct encapsulates the parameters needed to request fee information from an anchor before initiating a deposit or withdrawal transaction.

    See also:

    • [InteractiveService.getFee] for the method that uses this request
    • SEP-0024
    See more

    Declaration

    Swift

    public struct Sep24FeeRequest : Sendable
  • Request parameters for querying a single transaction via SEP-0024.

    This struct encapsulates the parameters needed to retrieve the status and details of a specific deposit or withdrawal transaction. At least one of the transaction identifiers (id, stellarTransactionId, or externalTransactionId) must be provided.

    See also:

    • [InteractiveService.getTransaction] for the method that uses this request
    • SEP-0024
    See more

    Declaration

    Swift

    public struct Sep24TransactionRequest : Sendable
  • Request parameters for querying multiple transactions via SEP-0024.

    This struct encapsulates the parameters needed to retrieve a list of deposit or withdrawal transactions for a specific asset, with optional filtering and pagination.

    See also:

    • [InteractiveService.getTransactions] for the method that uses this request
    • SEP-0024
    See more

    Declaration

    Swift

    public struct Sep24TransactionsRequest : Sendable
  • Request parameters for initiating a withdrawal transaction via SEP-0024.

    This struct encapsulates all the parameters needed to start an interactive withdrawal flow, where a user withdraws Stellar assets with an anchor and receives the equivalent off-chain assets (e.g., fiat currency).

    See also:

    • [InteractiveService.withdraw] for the method that uses this request
    • SEP-0024
    See more

    Declaration

    Swift

    public struct Sep24WithdrawRequest : Sendable
  • Response containing fee information for a deposit or withdrawal transaction.

    This response is returned when querying the fee endpoint to determine the cost of a deposit or withdrawal operation before initiating the transaction.

    See also:

    • [Sep24FeeRequest] for the corresponding request
    • SEP-0024
    See more

    Declaration

    Swift

    public struct Sep24FeeResponse : Decodable, Sendable
  • Response containing information about an anchor’s supported assets and features.

    This response is returned from the /info endpoint and provides clients with details about which assets are supported for deposits and withdrawals, along with fee information and supported features.

    See also:

    • [InteractiveService.getInfo] for the method that returns this response
    • SEP-0024
    See more

    Declaration

    Swift

    public struct Sep24InfoResponse : Decodable, Sendable
  • Information about a deposit asset supported by an anchor.

    Contains details about deposit capabilities, limits, and fees for a specific asset.

    See more

    Declaration

    Swift

    public struct Sep24DepositAsset : Decodable, Sendable
  • Information about a withdrawal asset supported by an anchor.

    Contains details about withdrawal capabilities, limits, and fees for a specific asset.

    See more

    Declaration

    Swift

    public struct Sep24WithdrawAsset : Decodable, Sendable
  • Information about the availability and requirements of the fee endpoint.

    Indicates whether the fee endpoint is available and if authentication is required.

    See more

    Declaration

    Swift

    public struct Sep24FeeEndpointInfo : Decodable, Sendable
  • Feature flags indicating which optional SEP-0024 features are supported by the anchor.

    These flags inform clients about advanced capabilities like account creation and claimable balances.

    See more

    Declaration

    Swift

    public struct Sep24FeatureFlags : Decodable, Sendable
  • Response returned when initiating an interactive deposit or withdrawal transaction.

    This response contains the URL that the client should present to the user for completing the interactive flow, along with a transaction ID for tracking the request.

    See also:

    • [Sep24DepositRequest] for initiating deposits
    • [Sep24WithdrawRequest] for initiating withdrawals
    • SEP-0024
    See more

    Declaration

    Swift

    public struct Sep24InteractiveResponse : Decodable, Sendable
  • Response containing multiple transactions.

    This response is returned when querying for a list of transactions via the /transactions endpoint.

    See also:

    • [Sep24TransactionsRequest] for the corresponding request
    • SEP-0024
    See more

    Declaration

    Swift

    public struct Sep24TransactionsResponse : Decodable, Sendable
  • Response containing a single transaction.

    This response is returned when querying for a specific transaction via the /transaction endpoint.

    See also:

    • [Sep24TransactionRequest] for the corresponding request
    • SEP-0024
    See more

    Declaration

    Swift

    public struct Sep24TransactionResponse : Decodable, Sendable
  • Details of a single deposit or withdrawal transaction.

    Contains comprehensive information about the transaction status, amounts, fees, and identifiers for both on-chain and off-chain components of the transaction.

    See also:

    See more

    Declaration

    Swift

    public struct Sep24Transaction : Decodable, Sendable
  • Information about refunds associated with a transaction.

    Contains details about the total refund amount, fees, and individual refund payments for transactions that have been partially or fully refunded.

    See also:

    • [Sep24Transaction] for the parent transaction
    • SEP-0024
    See more

    Declaration

    Swift

    public struct Sep24Refund : Decodable, Sendable
  • Details of an individual refund payment.

    Represents a single refund payment made back to the user, either on-chain or off-chain.

    See also:

    • [Sep24Refund] for the parent refund object
    • SEP-0024
    See more

    Declaration

    Swift

    public struct Sep24RefundPayment : Decodable, Sendable
  • Request parameters for retrieving customer information via SEP-0012.

    This struct encapsulates all the parameters needed to check the status of a customer’s KYC information or to fetch the fields required by the anchor for customer registration. The endpoint allows clients to either fetch requirements for a new customer or check the status of an existing customer’s KYC process.

    See also:

    See more

    Declaration

    Swift

    public struct GetCustomerInfoRequest : Sendable
  • Request parameters for registering a callback URL via SEP-0012.

    This struct encapsulates all the parameters needed to register a callback URL with the anchor. The anchor will issue POST requests to the provided callback URL whenever the customer’s KYC status changes. This allows wallets to receive real-time updates about the customer’s KYC process without polling.

    The anchor will send POST requests with the same payload format as the GET /customer endpoint until the customer’s status changes to ACCEPTED or REJECTED. The callback must be properly signed by the anchor according to the callback signature specification.

    See also:

    See more

    Declaration

    Swift

    public struct PutCustomerCallbackRequest : Sendable
  • Request parameters for uploading customer information via SEP-0012.

    This struct encapsulates all the parameters needed to upload KYC information to an anchor in an authenticated and idempotent fashion. The endpoint is used to register new customers or update existing customer information. It supports submitting SEP-9 fields for natural persons, organizations, financial accounts, and cards, as well as custom fields and files.

    When uploading binary fields such as photo_id_front, the request uses multipart/form-data content type. Binary fields should be submitted after all other fields as some web servers require this for proper stream processing.

    See also:

    See more

    Declaration

    Swift

    public struct PutCustomerInfoRequest : Sendable
  • Request parameters for submitting customer verification data via SEP-0012.

    This struct encapsulates the parameters needed to verify previously provided customer fields that require verification, such as mobile_number or email_address. Fields that are in the VERIFICATION_REQUIRED status require a request to this endpoint with verification codes or confirmation values.

    Note: This endpoint has been deprecated in favor of using the PUT /customer endpoint for verification. However, it is still supported for backwards compatibility.

    Example usage:

    let request = PutCustomerVerificationRequest(
        id: "391fb415-c223-4608-b2f5-dd1e91e3a986",
        fields: ["mobile_number_verification": "123456"],
        jwt: authToken
    )
    

    See also:

    See more

    Declaration

    Swift

    public struct PutCustomerVerificationRequest : Sendable
  • Response returned when uploading or retrieving customer files.

    This response is returned by POST /customer/files and GET /customer/files requests in SEP-12. It contains metadata about uploaded files including the file ID that can be used to reference the file in subsequent PUT /customer requests.

    Files can be referenced in PUT /customer requests using the pattern {field_name}_file_id. For example, if uploading a photo ID front, use “photo_id_front_file_id” in the request.

    See SEP-12 Customer Files

    See more

    Declaration

    Swift

    public struct CustomerFileResponse : Decodable, Sendable
  • Response returned when retrieving customer files.

    This response is returned by GET /customer/files requests in SEP-12 and contains a list of files associated with a customer. The request can filter by file_id or customer_id.

    If no files are found for the specified identifier, an empty list is returned.

    See SEP-12 Customer Files GET

    See more

    Declaration

    Swift

    public struct GetCustomerFilesResponse : Decodable, Sendable
  • Response returned when checking the status of a customer’s KYC information.

    This response is returned by GET /customer requests in SEP-12 and provides the current status of the customer’s KYC process along with any fields that need to be provided or have already been submitted.

    The response varies based on the customer’s current status:

    • ACCEPTED: Customer is fully KYC’d and approved
    • PROCESSING: KYC information is being processed
    • NEEDS_INFO: Additional information is required
    • REJECTED: Customer has been rejected

    See SEP-12

    See more

    Declaration

    Swift

    public struct GetCustomerInfoResponse : Decodable, Sendable
  • Describes a field that the anchor requires from the customer.

    This structure defines fields that need to be provided by the customer to complete their KYC process. It appears in the NEEDS_INFO status response.

    See SEP-12 Fields

    See more

    Declaration

    Swift

    public struct GetCustomerInfoField : Decodable, Sendable
  • Describes a field that has been provided by the customer along with its validation status.

    This structure defines fields that the customer has already submitted and their current validation status. It is required for customers whose information needs verification.

    See SEP-12 Provided Fields

    See more

    Declaration

    Swift

    public struct GetCustomerInfoProvidedField : Decodable, Sendable
  • Response returned after successfully uploading customer information.

    This response is returned by PUT /customer requests in SEP-12 when the anchor has successfully received and stored the customer information. The response contains an ID that can be used in future requests to retrieve or update the customer’s information.

    The anchor responds with HTTP 202 Accepted or 200 Success along with this response body.

    See SEP-12 Customer PUT

    See more

    Declaration

    Swift

    public struct PutCustomerInfoResponse : Decodable, Sendable

BInt

  • BInt is an arbitrary precision integer value type. It stores a number in base 2^64 notation as an array. Each element of the array is called a limb, which is of type UInt64, the whole array is called limbs and has the type [UInt64]. A boolean sign variable determines if the number is positive or negative. If sign == true, then the number is smaller than 0, otherwise it is greater or equal to 0. It stores the 64 bit digits in little endian, that is, the least significant digit is stored in the array index 0:

    limbs == [] := undefined, should throw an error
    limbs == [0], sign == false := 0, defined as positive
    limbs == [0], sign == true := undefined, should throw an error
    limbs == [n] := n if sign == false, otherwise -n, given 0 <= n < 2^64
    
    limbs == [l0, l1, l2, ..., ln] :=
    (l0 * 2^(0*64)) +
    (11 * 2^(1*64)) +
    (12 * 2^(2*64)) +
    ... +
    (ln * 2^(n*64))
    
    See more

    Declaration

    Swift

    public struct BInt:
    	SignedNumeric, // Implies Numeric, Equatable, ExpressibleByIntegerLiteral
    	BinaryInteger, // Implies Hashable, CustomStringConvertible, Strideable, Comparable
    	ExpressibleByFloatLiteral,
    	Sendable

BDouble

  • Undocumented

    See more

    Declaration

    Swift

    public struct BDouble:
    	ExpressibleByIntegerLiteral,
    	ExpressibleByFloatLiteral,
    	CustomStringConvertible,
    	SignedNumeric,
    	Comparable,
    	Hashable,
    	Sendable
  • Request model for creating a firm quote via SEP-38.

    This structure represents a POST request to the /quote endpoint, which creates a firm quote that can be executed by the client. Either sellAmount or buyAmount must be specified, but not both.

    See SEP-38: Quote Service

    See more

    Declaration

    Swift

    public struct Sep38PostQuoteRequest : Sendable
  • Response from the GET /info endpoint of SEP-38 Quote Service.

    This response provides information about the assets supported by the anchor for quotes, including available delivery methods and country codes for each asset.

    See SEP-38: GET /info

    See more

    Declaration

    Swift

    public struct Sep38InfoResponse : Decodable, Sendable
  • Response from the GET /prices endpoint of SEP-38 Quote Service.

    This response provides indicative prices for buying various assets using a specified sell asset. Prices are not guaranteed and are for informational purposes only.

    See SEP-38: GET /prices

    See more

    Declaration

    Swift

    public struct Sep38PricesResponse : Decodable, Sendable
  • Response from the POST /quote and GET /quote/:id endpoints of SEP-38 Quote Service.

    This response represents a firm quote that can be executed by the client. The quote is guaranteed until the expiration time and includes all exchange details such as amounts, prices, and fees.

    See SEP-38: POST /quote and GET /quote/:id

    See more

    Declaration

    Swift

    public struct Sep38QuoteResponse : Decodable, Sendable
  • Response from the GET /price endpoint of SEP-38 Quote Service.

    This response provides an indicative price for an asset exchange without creating a firm quote. The price is not guaranteed and is for informational purposes only. To get a guaranteed quote, use POST /quote instead.

    See SEP-38: GET /price

    See more

    Declaration

    Swift

    public struct Sep38PriceResponse : Decodable, Sendable
  • Fee information for a SEP-38 quote or price.

    This structure contains the total fee amount and optionally a detailed breakdown of individual fee components. The fee is always denominated in a specific asset.

    See more

    Declaration

    Swift

    public struct Sep38Fee : Decodable, Sendable
  • Detailed information about a specific fee component.

    This structure describes an individual fee charge that contributes to the total fee amount in a quote or price.

    See more

    Declaration

    Swift

    public struct Sep38FeeDetails : Decodable, Sendable
  • Delivery method for selling an asset to the anchor.

    This structure describes a method by which the client can deliver the sell asset to the anchor. Available methods depend on the asset and are returned by the GET /info endpoint.

    See more

    Declaration

    Swift

    public struct Sep38SellDeliveryMethod : Decodable, Sendable
  • Delivery method for receiving an asset from the anchor.

    This structure describes a method by which the anchor can deliver the buy asset to the client. Available methods depend on the asset and are returned by the GET /info endpoint.

    See more

    Declaration

    Swift

    public struct Sep38BuyDeliveryMethod : Decodable, Sendable
  • Asset information from the SEP-38 GET /info endpoint.

    This structure describes an asset supported by the anchor for quotes, including the available delivery methods and supported country codes for the asset.

    See more

    Declaration

    Swift

    public struct Sep38Asset : Decodable, Sendable
  • Asset information with price from the SEP-38 GET /prices endpoint.

    This structure represents an asset that can be purchased along with its indicative price and decimal precision. The price is not guaranteed and is for informational purposes only.

    See more

    Declaration

    Swift

    public struct Sep38BuyAsset : Decodable, Sendable
  • Request structure for registering or updating account recovery identities.

    Used when registering a new account or updating identities for an existing account with a SEP-30 recovery service. Contains the list of identities that can recover the account.

    See more

    Declaration

    Swift

    public struct Sep30Request : Sendable
  • Identity configuration for account recovery.

    Represents a person or entity that can recover the account by authenticating through one of the configured authentication methods.

    See more

    Declaration

    Swift

    public struct Sep30RequestIdentity : Sendable
  • Authentication method for identity verification.

    Specifies how an identity can be authenticated to recover account access. Multiple methods can be configured per identity for flexibility.

    See more

    Declaration

    Swift

    public struct Sep30AuthMethod : Sendable
  • Identity information in recovery service responses.

    Contains the role of an identity and optionally indicates if the current client is authenticated as this identity.

    See more

    Declaration

    Swift

    public struct SEP30ResponseIdentity : Decodable, Sendable
  • Signer key information provided by the recovery service.

    Contains the public key that the recovery service can use to sign transactions for the associated account.

    See more

    Declaration

    Swift

    public struct SEP30ResponseSigner : Decodable, Sendable
  • Response for account registration, update, retrieval, and deletion operations.

    Contains the account address, configured identities, and signer keys available for account recovery transactions.

    See more

    Declaration

    Swift

    public struct Sep30AccountResponse : Decodable, Sendable
  • Response for listing accounts accessible by the authenticated client.

    Returns all accounts that the JWT token grants access to, including accounts where the authenticated identity is registered as an authorized identity.

    See more

    Declaration

    Swift

    public struct Sep30AccountsResponse : Decodable, Sendable
  • Response for transaction signing operations.

    Contains the signature generated by the recovery service and the network passphrase used during signing.

    See more

    Declaration

    Swift

    public struct Sep30SignatureResponse : Decodable, Sendable
  • Response when a transaction is approved without modifications.

    The approval server has validated and signed the transaction. The client should submit it to the Stellar network.

    See more

    Declaration

    Swift

    public struct Sep08PostTransactionSuccess : Decodable, Sendable
  • Response when a transaction is approved but with modifications.

    The approval server has revised the transaction (e.g., added fees or compliance signatures) and signed it. The client should submit the revised transaction to the network.

    See more

    Declaration

    Swift

    public struct Sep08PostTransactionRevised : Decodable, Sendable
  • Response when transaction approval is pending.

    The approval server is processing the transaction but has not yet made a decision. The client should wait and retry after the specified timeout.

    See more

    Declaration

    Swift

    public struct Sep08PostTransactionPending : Decodable, Sendable
  • Response when user action is required before approval can proceed.

    The approval server requires additional information from the user (e.g., KYC data). The client should collect the required information and POST it to the action URL.

    See more

    Declaration

    Swift

    public struct Sep08PostTransactionActionRequired : Decodable, Sendable
  • Response when a transaction is rejected by the approval server.

    The transaction does not meet the issuer’s compliance requirements and cannot be approved.

    See more

    Declaration

    Swift

    public struct Sep08PostTransactionRejected : Decodable, Sendable
  • Internal response struct used to determine the status of a transaction post.

    Used for parsing the initial status field before decoding into the specific response type.

    See more

    Declaration

    Swift

    public struct Sep08PostTransactionStatusResponse : Decodable, Sendable
  • Internal response struct used to determine the result of an action post.

    Used for parsing the result field to determine if action is complete or if another URL should be followed.

    See more

    Declaration

    Swift

    public struct Sep08PostActionResultResponse : Decodable, Sendable
  • Response when an action post requires following another URL.

    The action was processed, but the client should follow the next URL for additional steps.

    See more

    Declaration

    Swift

    public struct Sep08PostActionNextUrl : Decodable, Sendable
  • Represents a single asset balance in an account.

    Each AccountResponse contains an array of AccountBalanceResponse objects representing all assets (including native XLM) held by the account. Also includes authorization status and liabilities from open offers.

    See also:

    See more

    Declaration

    Swift

    public struct AccountBalanceResponse : Decodable, Sendable
  • Represents account authorization flags set on asset issuer accounts.

    These flags control how the issuer can manage who holds their asset. Issuers can require authorization, enable revocation, make flags immutable, or enable clawback functionality.

    See also:

    See more

    Declaration

    Swift

    public struct AccountFlagsResponse : Decodable, Sendable
  • Represents an account signer with its key, type, and signing weight.

    Stellar accounts can have multiple signers for implementing multi-signature authorization. Each signer has a weight that contributes to meeting operation threshold requirements.

    Common signer types:

    • ed25519_public_key: Standard Stellar account public key
    • sha256_hash: Hash of a preimage (for hash-locked transactions)
    • preauth_tx: Hash of a pre-authorized transaction

    See also:

    See more

    Declaration

    Swift

    public struct AccountSignerResponse : Decodable, Sendable
  • Represents signature weight thresholds for multi-signature accounts.

    Thresholds determine how many signature weights are required to authorize operations. Each operation type (low, medium, high) requires a total signature weight that meets or exceeds its threshold. Used for implementing multi-sig security.

    Threshold categories:

    • Low: Allow Trust, Bump Sequence
    • Medium: All other operations
    • High: Set Options (changing signers or thresholds)

    See also:

    See more

    Declaration

    Swift

    public struct AccountThresholdsResponse : Decodable, Sendable
  • Represents a single data entry value from an account’s key-value data store.

    Accounts can store arbitrary key-value pairs (up to 64 bytes per value). This response contains the value for a specific key requested via the Horizon API. Values are base64 encoded.

    Data entries are used for storing metadata like:

    • Domain verification proofs
    • Off-chain data references
    • Application-specific configuration

    See also:

    See more

    Declaration

    Swift

    public struct DataForAccountResponse : Decodable, Sendable
  • Represents an asset response. See Stellar developer docs

    See more

    Declaration

    Swift

    public struct AssetResponse : Decodable, Sendable
  • Statistics about the number of accounts holding an asset, categorized by authorization status. See Stellar developer docs

    See more

    Declaration

    Swift

    public struct AssetAccounts : Decodable, Sendable
  • Statistics about the total amounts of an asset held by accounts, categorized by authorization status. See Stellar developer docs

    See more

    Declaration

    Swift

    public struct AssetBalances : Decodable, Sendable
  • Represents a claimable balance response from the Horizon API. Claimable balances are held on the ledger until they are claimed by authorized claimants or until the conditions for claiming them expire. See Stellar developer docs

    See more

    Declaration

    Swift

    public struct ClaimableBalanceResponse : Decodable, Sendable
  • Represents a claimant entry for a claimable balance. Each claimant specifies an account that can claim the balance and the conditions under which they can claim it. See Stellar developer docs

    See more

    Declaration

    Swift

    public struct ClaimantResponse : Decodable, Sendable
  • Represents liquidity pool details within an effect response. Contains information about the pool’s state, including reserves, shares, and fee structure. Used as a nested object in liquidity pool effect responses. See Stellar developer docs

    See more

    Declaration

    Swift

    public struct LiquidityPoolEffectResponse : Decodable, Sendable
  • Represents the distribution of fees actually charged for transactions in recent ledgers. All values are in stroops (1 stroop = 0.0000001 XLM). See Stellar developer docs

    See more

    Declaration

    Swift

    public struct FeeChargedResponse : Decodable, Sendable
  • Represents fee statistics from the Horizon API. This endpoint provides information about transaction fees and network capacity usage from the last ledger, helping clients determine appropriate fee levels for transactions. See Stellar developer docs

    See more

    Declaration

    Swift

    public struct FeeStatsResponse : Decodable, Sendable
  • Represents the distribution of maximum fees that users were willing to pay for transactions in recent ledgers. All values are in stroops (1 stroop = 0.0000001 XLM). See Stellar developer docs

    See more

    Declaration

    Swift

    public struct MaxFeeResponse : Decodable, Sendable
  • Represents the response from the Horizon health check endpoint. This endpoint provides information about the health status of the Horizon server, including database connectivity and Stellar Core status. See Stellar developer docs

    See more

    Declaration

    Swift

    public struct HealthCheckResponse : Decodable, Sendable
  • Represents a ledger response. See Stellar developer docs

    See more

    Declaration

    Swift

    public struct LedgerResponse : Decodable, Sendable
  • Navigation links for account-related resources.

    Provides hypermedia links to all resources associated with an account, enabling easy navigation to transactions, operations, payments, effects, offers, trades, and data entries for the account.

    All links are templated and support filtering, pagination, and ordering parameters.

    See also:

    • Stellar developer docs
    • AccountResponse for complete account details
    • LinkResponse for individual link structure
    See more

    Declaration

    Swift

    public struct AccountLinksResponse : Decodable, Sendable
  • Navigation links for asset-related resources.

    Provides hypermedia links to resources associated with an asset, primarily the issuer’s stellar.toml file which contains asset metadata and verification.

    See also:

    See more

    Declaration

    Swift

    public struct AssetLinksResponse : Decodable, Sendable
  • Navigation links for claimable balance-related resources.

    Provides hypermedia links to resources associated with a claimable balance. Currently only includes a self reference to the claimable balance resource.

    See also:

    See more

    Declaration

    Swift

    public struct ClaimableBalanceLinksResponse : Decodable, Sendable
  • Navigation links for effect-related resources.

    Provides hypermedia links to resources associated with an effect, including the operation that produced it and chronologically adjacent effects.

    See also:

    • Stellar developer docs
    • EffectResponse for complete effect details
    • LinkResponse for individual link structure
    See more

    Declaration

    Swift

    public struct EffectLinksResponse : Decodable, Sendable
  • Navigation links for ledger-related resources.

    Provides hypermedia links to resources contained within a ledger, including transactions, operations, payments, and effects that occurred in this ledger.

    See also:

    • Stellar developer docs
    • LedgerResponse for complete ledger details
    • LinkResponse for individual link structure
    See more

    Declaration

    Swift

    public struct LedgerLinksResponse : Decodable, Sendable
  • Represents a hypermedia link in Horizon API responses.

    Horizon uses HAL (Hypertext Application Language) for responses, which includes links to related resources. Links provide navigation between related resources without requiring clients to construct URLs manually.

    Links may be templated (contain placeholders like {cursor}, {limit}) that clients can fill in with values, or they may be direct URLs ready to use.

    Example usage:

    let account: AccountResponse = // ... get account
    
    // Direct link (not templated)
    if let transactionsURL = account.links.transactions?.href {
        // Use URL directly to fetch transactions
    }
    
    // Templated link - requires parameter substitution
    if let templated = account.links.transactions?.templated, templated {
        // Link contains placeholders like {cursor}, {limit}, {order}
        // Need to substitute values before using
    }
    

    See also:

    See more

    Declaration

    Swift

    public struct LinkResponse : Decodable, Sendable
  • Navigation links for liquidity pool-related resources.

    Provides hypermedia links to resources associated with a liquidity pool, including transactions and operations that interact with the pool.

    See also:

    See more

    Declaration

    Swift

    public struct LiquidityPoolLinksResponse : Decodable, Sendable
  • Navigation links for liquidity pool trade-related resources.

    Provides hypermedia links to resources associated with liquidity pool trades. Currently only includes a self reference to the trades resource.

    See also:

    See more

    Declaration

    Swift

    public struct LiquidityPoolTradesLinksResponse : Decodable, Sendable
  • Navigation links for offer-related resources.

    Provides hypermedia links to resources associated with an offer, including the offer itself and the account that created the offer.

    See also:

    See more

    Declaration

    Swift

    public struct OfferLinksResponse : Decodable, Sendable
  • Navigation links for operation-related resources.

    Provides hypermedia links to resources associated with an operation, including effects, the containing transaction, and chronologically adjacent operations.

    See also:

    • Stellar developer docs
    • OperationResponse for complete operation details
    • LinkResponse for individual link structure
    See more

    Declaration

    Swift

    public struct OperationLinksResponse : 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:

    See more

    Declaration

    Swift

    public struct PagingLinksResponse : Decodable, Sendable
  • Navigation links for trade-related resources.

    Provides hypermedia links to resources associated with a trade, including the base and counter accounts involved and the operation that executed the trade.

    See also:

    See more

    Declaration

    Swift

    public struct TradeLinksResponse : Decodable, Sendable
  • Navigation links for transaction-related resources.

    Provides hypermedia links to resources associated with a transaction, including the source account, containing ledger, operations, effects, and chronologically adjacent transactions.

    See also:

    • Stellar developer docs
    • TransactionResponse for complete transaction details
    • LinkResponse for individual link structure
    See more

    Declaration

    Swift

    public struct TransactionLinksResponse : Decodable, Sendable
  • Represents a price ratio in a liquidity pool. The price is represented as a fraction with a numerator and denominator. See Stellar developer docs

    See more

    Declaration

    Swift

    public struct LiquidityPoolPriceResponse : Decodable, Sendable
  • Represents a liquidity pool response from the Horizon API. Liquidity pools are automated market makers that enable decentralized trading by maintaining reserves of two assets and allowing users to swap between them. See Stellar developer docs

    See more

    Declaration

    Swift

    public struct LiquidityPoolResponse : Decodable, Sendable
  • Represents a paginated collection of trades for a liquidity pool. This response contains trade records and navigation links for pagination. See Stellar developer docs

    See more

    Declaration

    Swift

    public struct LiquidityPoolTradesResponse : Decodable, Sendable
  • Represents a reserve asset in a liquidity pool. Each liquidity pool maintains reserves of two assets that are used for trading. See Stellar developer docs

    See more

    Declaration

    Swift

    public struct ReserveResponse : Decodable, Sendable
  • Represents an asset in an offer (either the selling or buying asset). See Stellar developer docs

    See more

    Declaration

    Swift

    public struct OfferAssetResponse : Decodable, Sendable
  • Represents an offer price_r attribute as a fraction. The price represents how many units of the buying asset are needed to purchase one unit of the selling asset. See Stellar developer docs

    See more

    Declaration

    Swift

    public struct OfferPriceResponse : Decodable, Sendable
  • Represents a offer response. See Stellar developer docs

    See more

    Declaration

    Swift

    public struct OfferResponse : Decodable, Sendable
  • Represents a orderbook offer(bids/asks). See Stellar developer docs

    See more

    Declaration

    Swift

    public struct OrderbookOfferResponse : Decodable, Sendable
  • Represents a orderbook response. See Stellar developer docs

    See more

    Declaration

    Swift

    public struct OrderbookResponse : Decodable, Sendable
  • Generic paginated response wrapper for Horizon API list endpoints.

    The Stellar Horizon API returns large result sets as pages to avoid overwhelming clients and servers. PageResponse provides the current page of results along with navigation links to access previous and next pages.

    Pagination uses cursor-based navigation, where each record has a unique paging token. Results are ordered by the specified sort order (ascending or descending).

    Example usage:

    let sdk = StellarSDK()
    
    // Get first page of transactions
    let response = await sdk.transactions.getTransactions(
        limit: 20,
        order: .descending
    )
    
    switch response {
    case .success(let page):
        // Process current page
        print("Fetched \(page.records.count) transactions")
    
        for transaction in page.records {
            print("Hash: \(transaction.hash)")
        }
    
        // Navigate to next page if available
        if page.hasNextPage() {
            let nextPage = await page.getNextPage()
            // Process next page...
        }
    
        // Or get cursor for later pagination
        if let nextLink = page.links.next?.href {
            // Save cursor from URL for later use
        }
    
    case .failure(let error):
        print("Error: \(error)")
    }
    

    See also:

    See more

    Declaration

    Swift

    public struct PageResponse<Element> : Decodable, Sendable where Element : Decodable, Element : Sendable
  • Declaration

    Swift

    public struct FindPaymentPathsResponse : Decodable, Sendable
  • Represents a Payment Path response. See Stellar developer docs

    See more

    Declaration

    Swift

    public struct PaymentPathResponse : Decodable, Sendable
  • Represents a trade price as a fraction with numerator and denominator.

    See more

    Declaration

    Swift

    public struct TradePrice : Decodable, Sendable
  • Represents a trade response. See Stellar developer docs

    See more

    Declaration

    Swift

    public struct TradeResponse : Decodable, Sendable
  • Represents a trade aggregation response. See Stellar developer docs

    See more

    Declaration

    Swift

    public struct TradeAggregationResponse : Decodable, Sendable
  • Represents the outer fee bump transaction that wraps an inner transaction with a higher fee.

    Fee bump transactions allow one account to pay a higher fee for another account’s transaction to prioritize it for inclusion when the network is congested. The fee bump transaction replaces the original transaction’s fee but preserves all operations and signatures.

    This response is included in TransactionResponse when the transaction is a fee bump.

    See also:

    • Stellar developer docs
    • InnerTransactionResponse for the wrapped transaction details
    • TransactionResponse for complete transaction information
    See more

    Declaration

    Swift

    public struct FeeBumpTransactionResponse : Decodable, Sendable
  • Represents the inner (original) transaction that has been wrapped by a fee bump transaction.

    When a transaction is wrapped in a fee bump, this response contains details about the original transaction including its hash, signatures, and max fee. The fee bump transaction replaces the fee but preserves the operations and original signatures.

    This response is included in TransactionResponse for fee bump transactions.

    See also:

    • Stellar developer docs
    • FeeBumpTransactionResponse for the wrapper transaction details
    • TransactionResponse for complete transaction information
    See more

    Declaration

    Swift

    public struct InnerTransactionResponse : Decodable, Sendable
  • Represents ledger sequence constraints for when a transaction can be included.

    Ledger bounds restrict transaction validity to a specific range of ledger sequence numbers. Validators will reject transactions with ledger bounds that don’t include the current ledger.

    Use cases:

    • Transactions that should execute within specific ledger windows
    • Coordinating transactions across multiple parties with ledger-based timing
    • Ensuring transactions execute before significant network state changes

    Unlike time bounds, ledger bounds use deterministic ledger sequence numbers rather than wall-clock time, providing more predictable execution windows.

    See also:

    • Stellar developer docs
    • TransactionPreconditionsResponse for all precondition types
    • PreconditionsTimeBoundsResponse for time-based constraints
    See more

    Declaration

    Swift

    public struct PreconditionsLedgerBoundsResponse : Decodable, Sendable
  • Represents time constraints for when a transaction can be included in a ledger.

    Time bounds restrict transaction validity to a specific time window using Unix timestamps. Validators will reject transactions with time bounds that don’t include the current time.

    Use cases:

    • Time-limited offers or escrow releases
    • Scheduled operations that should only execute after a specific time
    • Expiring transactions that become invalid after a deadline

    Both bounds are optional:

    • If only minTime is set, transaction valid from that time onward
    • If only maxTime is set, transaction valid until that time
    • If both set, transaction valid only within the time window
    • If neither set (both nil or 0), transaction has no time restrictions

    See also:

    See more

    Declaration

    Swift

    public struct PreconditionsTimeBoundsResponse : Decodable, Sendable
  • Response returned from asynchronously submitting a transaction to Horizon.

    When using async transaction submission, Horizon immediately returns this response indicating the submission status without waiting for the transaction to be included in a ledger. The transaction may still be pending or require later polling to confirm final status.

    Status values:

    • ERROR: Transaction validation failed
    • PENDING: Transaction accepted and pending inclusion in a ledger
    • DUPLICATE: Transaction was already submitted
    • TRY_AGAIN_LATER: System temporarily unable to accept transaction

    See also:

    See more

    Declaration

    Swift

    public struct SubmitTransactionAsyncResponse : Decodable, Sendable
  • Represents transaction preconditions that must be met for a transaction to be valid.

    Preconditions allow fine-grained control over when and how a transaction can be submitted and executed. They provide advanced features like time windows, ledger bounds, sequence constraints, and additional signing requirements.

    All preconditions are optional. If not specified, the transaction has no constraints beyond the standard requirements (valid signatures, sufficient fee, correct sequence number).

    Common use cases:

    • Time-locked transactions that can only execute within specific time windows
    • Ledger-locked transactions valid only for specific ledger ranges
    • Sequence-gated transactions requiring specific account age or sequence progression
    • Multi-party transactions requiring additional signers beyond the account’s configured signers

    See also:

    • Stellar developer docs
    • PreconditionsTimeBoundsResponse for time constraints
    • PreconditionsLedgerBoundsResponse for ledger constraints
    See more

    Declaration

    Swift

    public struct TransactionPreconditionsResponse : Decodable, Sendable
  • Represents a transaction on the Stellar network with all its details and metadata.

    Contains complete transaction information including operations, fees, signatures, source account, and XDR-encoded transaction data. Returned when querying transaction details or lists from Horizon.

    A transaction is a collection of operations that are atomically applied to the ledger. If any operation fails, the entire transaction fails and no changes are made.

    Example usage:

    let sdk = StellarSDK()
    
    let response = await sdk.transactions.getTransactionDetails(transactionHash: "abc123...")
    switch response {
    case .success(let tx):
        print("Transaction Hash: \(tx.transactionHash)")
        print("Source Account: \(tx.sourceAccount)")
        print("Fee Charged: \(tx.feeCharged ?? "N/A") stroops")
        print("Operations: \(tx.operationCount)")
        print("Ledger: \(tx.ledger)")
    
        if let memo = tx.memo {
            print("Memo: \(memo)")
        }
    
        // Check if fee bump transaction
        if let feeBump = tx.feeBumpTransactionResponse {
            print("Fee Bump Hash: \(feeBump.transactionHash)")
        }
    case .failure(let error):
        print("Error: \(error)")
    }
    

    See also:

    See more

    Declaration

    Swift

    public struct TransactionResponse : Decodable, Sendable
  • Information about a single contract event.

    Represents an event emitted by a smart contract during execution. Events are used to communicate contract state changes and actions to off-chain systems.

    Event types:

    • contract: Events emitted by user contracts
    • system: Events from system-level operations
    • diagnostic: Debug events (only in simulation)

    Contains:

    • Event type and emission context (ledger, timestamp)
    • Contract ID that emitted the event
    • Topics (indexed event parameters)
    • Event value (event payload)
    • Transaction and operation context

    Example:

    for event in eventsResponse.events {
        print("Event from contract: \(event.contractId)")
        print("Emitted in ledger: \(event.ledger)")
        print("Topics: \(event.topic.count)")
        print("Value: \(event.valueXdr)")
    }
    

    See also:

    See more

    Declaration

    Swift

    public struct EventInfo : Decodable, Sendable
  • Response from querying contract events.

    Contains a list of events emitted by smart contracts within the specified ledger range. Events are ordered by their emission time and include all relevant metadata.

    Use this response to:

    • Monitor contract state changes
    • Track token transfers and other contract activities
    • Build event-driven applications
    • Populate databases with on-chain event data

    Important: When making multiple requests, deduplicate events by their unique ID to prevent double-processing in case of overlapping queries.

    Example:

    let response = await server.getEvents(
        startLedger: 1000000,
        eventFilters: [filter],
        paginationOptions: PaginationOptions(limit: 100)
    )
    
    switch response {
    case .success(let eventsResponse):
        for event in eventsResponse.events {
            print("Event ID: \(event.id)")
            print("Contract: \(event.contractId ?? "system")")
            print("Ledger: \(event.ledger)")
            print("Topics: \(event.topic)")
            print("Value: \(event.value)")
        }
    
        // Fetch next page if available
        if let cursor = eventsResponse.cursor {
            let nextPageOptions = PaginationOptions(cursor: cursor, limit: 100)
            // Query next page...
        }
    case .failure(let error):
        print("Error: \(error)")
    }
    

    See also:

    • [SorobanServer.getEvents] for querying events
    • [EventInfo] for individual event details
    • [EventFilter] for filtering events
    See more

    Declaration

    Swift

    public struct GetEventsResponse : Decodable, Sendable
  • Response containing Soroban transaction fee statistics including inclusion fees.

    See more

    Declaration

    Swift

    public struct GetFeeStatsResponse : Decodable, Sendable
  • Fee statistics showing distribution of inclusion fees across network transactions.

    See more

    Declaration

    Swift

    public struct InclusionFee : Decodable, Sendable
  • General node health check response.

    See more

    Declaration

    Swift

    public struct GetHealthResponse : Decodable, Sendable
  • Constants representing possible health status values for Soroban RPC nodes.

    See more

    Declaration

    Swift

    public struct HealthStatus : Sendable
  • Response for the getLatestLedger request See: Stellar developer docs

    See more

    Declaration

    Swift

    public struct GetLatestLedgerResponse : Decodable, Sendable
  • Response for the getLedgerEntry request See: Stellar developer docs

    See more

    Declaration

    Swift

    public struct GetLedgerEntriesResponse : Decodable, Sendable
  • Response for the getLedgers request See: Stellar developer docs

    See more

    Declaration

    Swift

    public struct GetLedgersResponse : Decodable, Sendable
  • General info about the currently configured network. See: Stellar developer docs

    See more

    Declaration

    Swift

    public struct GetNetworkResponse : Decodable, Sendable
  • Response when polling for transaction completion status.

    After submitting a transaction with sendTransaction, use this response to check if the transaction has been included in a ledger and whether it succeeded or failed.

    Transaction status values:

    • SUCCESS: Transaction was included in a ledger and executed successfully
    • FAILED: Transaction was included but execution failed
    • NOT_FOUND: Transaction not found (may still be pending or has expired)

    For successful transactions, this response contains:

    • The return value from contract invocations
    • Events emitted during execution
    • The ledger number and timestamp when included
    • Complete transaction metadata

    For failed transactions, check the error field for details about why it failed.

    Example:

    let response = await server.getTransaction(transactionHash: txHash)
    switch response {
    case .success(let txInfo):
        switch txInfo.status {
        case GetTransactionResponse.STATUS_SUCCESS:
            print("Transaction succeeded in ledger \(txInfo.ledger ?? 0)")
            if let result = txInfo.resultValue {
                print("Contract returned: \(result)")
            }
            // Process events
            if let events = txInfo.events {
                for event in events.events {
                    print("Event: \(event)")
                }
            }
        case GetTransactionResponse.STATUS_FAILED:
            if let error = txInfo.error {
                print("Transaction failed: \(error.message)")
            }
        case GetTransactionResponse.STATUS_NOT_FOUND:
            print("Transaction not yet included")
        default:
            print("Unknown status: \(txInfo.status)")
        }
    case .failure(let error):
        print("RPC error: \(error)")
    }
    

    See also:

    See more

    Declaration

    Swift

    public struct GetTransactionResponse : Decodable, Sendable
  • Response containing an array of Soroban transaction records from RPC queries.

    See more

    Declaration

    Swift

    public struct GetTransactionsResponse : Decodable, Sendable
  • Detailed information about a Soroban transaction including status, ledger, and result XDR.

    See more

    Declaration

    Swift

    public struct TransactionInfo : Decodable, Sendable
  • Response containing Soroban RPC server version and commit information.

    See more

    Declaration

    Swift

    public struct GetVersionInfoResponse : Decodable, Sendable
  • Represents a Stellar ledger entry with its key, XDR value, and validity metadata.

    See more

    Declaration

    Swift

    public struct LedgerEntry : Decodable, Sendable
  • Represents a single ledger in the getLedgers response. See: Stellar developer docs

    See more

    Declaration

    Swift

    public struct LedgerInfo : Decodable, Sendable
  • Response from submitting a transaction to the Stellar network.

    After calling sendTransaction, this response indicates whether the transaction was accepted for processing. Note that acceptance does not mean the transaction has executed - you must poll with getTransaction to check final status.

    Status values:

    • PENDING: Transaction accepted and waiting to be included in a ledger
    • DUPLICATE: Transaction already submitted (same hash exists)
    • TRY_AGAIN_LATER: Server is busy, retry the submission
    • ERROR: Transaction rejected (check error field for details)

    After receiving a PENDING status, use getTransaction with the returned transactionId (hash) to poll for completion.

    Example:

    let sendResponse = await server.sendTransaction(transaction: signedTx)
    switch sendResponse {
    case .success(let result):
        switch result.status {
        case SendTransactionResponse.STATUS_PENDING:
            print("Transaction submitted: \(result.transactionId)")
            // Poll for status with getTransaction
        case SendTransactionResponse.STATUS_ERROR:
            print("Transaction rejected: \(result.error?.message ?? "unknown")")
        default:
            print("Status: \(result.status)")
        }
    case .failure(let error):
        print("RPC error: \(error)")
    }
    

    See also:

    • [SorobanServer.sendTransaction] for submitting transactions
    • [GetTransactionResponse] for polling transaction status
    • Stellar developer docs
    See more

    Declaration

    Swift

    public struct SendTransactionResponse : Decodable, Sendable
  • Response from simulating a Soroban contract invocation.

    Contains all information needed to understand what will happen when a transaction executes:

    • Return values from contract function calls
    • Resource requirements (CPU instructions, memory, I/O)
    • Ledger footprint (which ledger entries will be read/written)
    • Authorization requirements for multi-party transactions
    • Events emitted during simulation
    • Required fees and resource costs

    Use this response to:

    • Get results from read-only contract calls without submitting a transaction
    • Determine resource limits before submitting a write transaction
    • Check if ledger entries need restoration before invocation
    • Validate that a transaction will succeed before submission

    Before submitting a write transaction, you must:

    1. Simulate the transaction
    2. Use transactionData and minResourceFee from the simulation
    3. Add these to your transaction
    4. Sign and submit

    Example:

    let simResponse = await server.simulateTransaction(simulateTxRequest: request)
    switch simResponse {
    case .success(let simulation):
        // Check for errors
        if let error = simulation.error {
            print("Simulation failed: \(error)")
            return
        }
    
        // Check if restoration is needed
        if let restore = simulation.restorePreamble {
            print("Must restore footprint first")
            // Submit RestoreFootprint operation
        }
    
        // Get return value for read calls
        if let result = simulation.results?.first?.returnValue {
            print("Contract returned: \(result)")
        }
    
        // For write calls, use simulation data
        transaction.setSorobanTransactionData(simulation.transactionData!)
        transaction.addResourceFee(simulation.minResourceFee!)
    case .failure(let error):
        print("RPC error: \(error)")
    }
    

    See also:

    See more

    Declaration

    Swift

    public struct SimulateTransactionResponse : Decodable, Sendable
  • It can only present on successful simulation (i.e. no error) of InvokeHostFunction operations. If present, it indicates the simulation detected expired ledger entries which requires restoring with the submission of a RestoreFootprint operation before submitting the InvokeHostFunction operation. The restorePreamble.minResourceFee and restorePreamble.transactionData fields should be used to construct the transaction containing the RestoreFootprint

    See more

    Declaration

    Swift

    public struct RestorePreamble : Decodable, Sendable
  • Represents a change to a ledger entry as a result of transaction simulation.

    See more

    Declaration

    Swift

    public struct LedgerEntryChange : Decodable, Sendable
  • Individual result from a simulated transaction operation.

    Part of SimulateTransactionResponse, contains the return value and authorization requirements for a single host function invocation.

    Contains:

    • Return value from the contract function
    • Authorization entries required for execution

    For most contract calls, SimulateTransactionResponse.results will contain a single element with the contract’s return value.

    See also:

    • [SimulateTransactionResponse] for the complete simulation response
    See more

    Declaration

    Swift

    public struct SimulateTransactionResult : Decodable, Sendable
  • Represents an error response from the Soroban RPC server following JSON-RPC 2.0 specification.

    See more

    Declaration

    Swift

    public struct SorobanRpcError : Error, Sendable
  • Container for Soroban transaction diagnostic and execution events in XDR format.

    See more

    Declaration

    Swift

    public struct TransactionEvents : Decodable, Sendable
  • Internal error used within some of the responses.

    See more

    Declaration

    Swift

    public struct TransactionStatusError : Decodable, Sendable
  • Request parameters for retrieving transaction history via SEP-0006.

    This struct encapsulates all the parameters needed to fetch a list of historical transactions for a specific asset and account. The response includes details about deposits, withdrawals, and their current statuses. This endpoint is useful for displaying transaction history to users within a wallet application.

    See also:

    See more

    Declaration

    Swift

    public struct AnchorTransactionsRequest : Sendable
  • Request parameters for retrieving a single transaction via SEP-0006.

    This struct encapsulates the parameters needed to fetch details about a specific transaction. The transaction can be identified by its internal ID, Stellar transaction ID, or external transaction ID. At least one of these identifiers must be provided.

    See also:

    See more

    Declaration

    Swift

    public struct AnchorTransactionRequest : Sendable
  • Request parameters for initiating a deposit with asset exchange via SEP-0006.

    This struct encapsulates all the parameters needed to start a deposit flow where asset conversion occurs between non-equivalent assets. For example, a user can deposit fiat BRL via bank transfer and receive USDC on the Stellar network. This endpoint requires the anchor to implement SEP-38 for quotes.

    The flow supports both market rate conversions (using indicative quotes) and firm quote conversions (where the exchange rate is guaranteed if payment is made before expiration).

    See also:

    See more

    Declaration

    Swift

    public struct DepositExchangeRequest : Sendable
  • Request parameters for initiating a deposit transaction via SEP-0006.

    This struct encapsulates all the parameters needed to start a deposit flow where a user sends an external token (such as fiat via bank transfer) to an address held by an anchor. In return, the anchor sends an equal amount of the equivalent token on the Stellar network (minus fees) to the user’s Stellar account.

    The endpoint allows the anchor to specify additional information that the user must submit via SEP-12 to complete the deposit. If the anchor’s /deposit endpoint immediately returns success, the wallet should display the deposit information to the user including the fee.

    See also:

    See more

    Declaration

    Swift

    public struct DepositRequest : Sendable
  • Request parameters for retrieving fee information via SEP-0006.

    This struct encapsulates all the parameters needed to query the anchor’s fee structure for a specific deposit or withdrawal operation. The /fee endpoint is deprecated and optional, as fee information can typically be provided through the /info endpoint using fee_fixed and fee_percent fields.

    Note: This endpoint is deprecated. Anchors are recommended to express fees through the /info endpoint to provide a better user experience, allowing users to see fee structures early in the process. This endpoint should only be used for complex fee structures that cannot be adequately represented in the /info endpoint.

    See also:

    See more

    Declaration

    Swift

    public struct FeeRequest : Sendable
  • Request parameters for initiating a withdrawal with asset exchange via SEP-0006.

    This struct encapsulates all the parameters needed to start a withdrawal flow where asset conversion occurs between non-equivalent assets. For example, a user can send USDC on the Stellar network and withdraw fiat BRL to their bank account. This endpoint requires the anchor to implement SEP-38 for quotes.

    The flow supports both market rate conversions (using indicative quotes) and firm quote conversions (where the exchange rate is guaranteed if payment is made before quote expiration).

    See also:

    See more

    Declaration

    Swift

    public struct WithdrawExchangeRequest : Sendable
  • Request parameters for initiating a withdrawal transaction via SEP-0006.

    This struct encapsulates all the parameters needed to start a withdrawal flow where a user sends an on-chain asset (Stellar token) to an anchor. In return, the anchor sends an equal amount of an external token (minus fees) to the user’s external account such as a bank account, mobile money account, or crypto wallet.

    The endpoint allows the anchor to specify additional information that the user must submit via SEP-12 to complete the withdrawal. Anchors are instructed to accept a variation of ±10% between the informed amount and the actual value sent to the anchor’s Stellar account, with the withdrawn amount adjusted accordingly.

    See also:

    See more

    Declaration

    Swift

    public struct WithdrawRequest : Sendable
  • Response returned when requesting fee information for a transaction.

    This response is returned by GET /fee requests in SEP-6 (deprecated endpoint). It provides the fee that would be charged for a specific deposit or withdrawal amount.

    Note: This endpoint is deprecated. Anchors should use the fee information in the GET /info response or the fee_details field in transaction responses instead.

    See SEP-6 Fee

    See more

    Declaration

    Swift

    public struct AnchorFeeResponse : Decodable, Sendable
  • Response returned by the GET /info endpoint describing anchor capabilities.

    This response provides information about which assets the anchor supports for deposits and withdrawals, along with fee structures, transaction limits, and required fields. It is the first endpoint wallets should call to understand what operations are supported.

    See SEP-6 Info

    See more

    Declaration

    Swift

    public struct AnchorInfoResponse : Decodable, Sendable
  • Information about an asset available for deposit operations via SEP-6.

    Provides details about deposit capabilities including fee structure, transaction limits, authentication requirements, and any required fields for deposit transactions.

    See SEP-6 Info

    See more

    Declaration

    Swift

    public struct DepositAsset : Decodable, Sendable
  • Information about an asset available for deposit operations with exchange via SEP-6.

    Similar to DepositAsset but used when deposits support on-chain asset exchange. Allows users to deposit one off-chain asset and receive a different on-chain Stellar asset.

    See SEP-6 Info

    See more

    Declaration

    Swift

    public struct DepositExchangeAsset : Decodable, Sendable
  • Information about an asset available for withdrawal operations via SEP-6.

    Provides details about withdrawal capabilities including fee structure, transaction limits, authentication requirements, and supported withdrawal types with their required fields.

    See SEP-6 Info

    See more

    Declaration

    Swift

    public struct WithdrawAsset : Decodable, Sendable
  • Information about an asset available for withdrawal operations with exchange via SEP-6.

    Similar to WithdrawAsset but used when withdrawals support on-chain asset exchange. Allows users to exchange one on-chain Stellar asset and withdraw a different off-chain asset.

    See SEP-6 Info

    See more

    Declaration

    Swift

    public struct WithdrawExchangeAsset : Decodable, Sendable
  • Describes a field that must be provided by the user for deposit or withdrawal operations.

    Used to specify required or optional fields for deposit and withdrawal requests. Anchors should use SEP-9 financial account fields where possible but can define custom fields.

    See SEP-6 Info

    See more

    Declaration

    Swift

    public struct AnchorField : Decodable, Sendable
  • Describes a specific withdrawal type supported by the anchor.

    Each withdrawal method (e.g., bank account, crypto address, mobile money) can have different field requirements. This structure specifies which fields are needed for a particular withdrawal type.

    See SEP-6 Info

    See more

    Declaration

    Swift

    public struct WithdrawType : Decodable, Sendable
  • Information about the anchor’s GET /transactions endpoint availability and requirements.

    Indicates whether the endpoint for retrieving multiple transaction records is supported and if authentication is required to access it.

    See SEP-6 Transaction History

    See more

    Declaration

    Swift

    public struct AnchorTransactionsInfo : Decodable, Sendable
  • Information about the anchor’s GET /transaction endpoint availability and requirements.

    Indicates whether the endpoint for retrieving a single transaction record by ID is supported and if authentication is required to access it.

    See SEP-6 Single Transaction

    See more

    Declaration

    Swift

    public struct AnchorTransactionInfo : Decodable, Sendable
  • Information about the anchor’s GET /fee endpoint availability and requirements.

    Indicates whether the endpoint for querying detailed fee information is supported and if authentication is required to access it.

    See SEP-6 Fee

    See more

    Declaration

    Swift

    public struct AnchorFeeInfo : Decodable, Sendable
  • Feature flags indicating additional capabilities supported by the anchor.

    These flags communicate optional features that the anchor has implemented beyond the basic SEP-6 requirements, such as account creation and claimable balance support.

    See SEP-6 Info

    See more

    Declaration

    Swift

    public struct AnchorFeatureFlags : Decodable, Sendable
  • Response returned when requesting transaction history.

    This response is returned by GET /transactions requests in SEP-6 and contains a list of transactions for the authenticated user.

    See SEP-6 Transaction History

    See more

    Declaration

    Swift

    public struct AnchorTransactionsResponse : Decodable, Sendable
  • Response returned when requesting a single transaction.

    This response is returned by GET /transaction requests in SEP-6 and contains details about a specific transaction.

    See SEP-6 Single Historical Transaction

    See more

    Declaration

    Swift

    public struct AnchorTransactionResponse : Decodable, Sendable
  • Details about a specific deposit or withdrawal transaction.

    Contains comprehensive information about a transaction including its status, amounts, fees, and timestamps. This structure is used in both transaction history and single transaction responses.

    See SEP-6 Transaction Object

    See more

    Declaration

    Swift

    public struct AnchorTransaction : Decodable, Sendable
  • Information about fields that need to be updated for a transaction.

    Returned when transaction status is pending_transaction_info_update, indicating additional information is required to proceed.

    See SEP-6 Transaction Object

    See more

    Declaration

    Swift

    public struct RequiredInfoUpdates : Decodable, Sendable
  • Detailed breakdown of fees charged for a transaction.

    Provides a comprehensive view of all fees applied, including the total fee amount, the asset in which fees are charged, and optional itemized details.

    See SEP-6 Transaction Object

    See more

    Declaration

    Swift

    public struct FeeDetails : Decodable, Sendable
  • Individual fee component in the fee breakdown.

    Provides details about a specific fee component, allowing anchors to show itemized pricing to users.

    See SEP-6 Transaction Object

    See more

    Declaration

    Swift

    public struct FeeDetailsDetails : Decodable, Sendable
  • Information about refunds associated with a transaction.

    Describes any on or off-chain refunds that have been issued for the transaction, including the total refunded amount and individual refund payments.

    See SEP-6 Transaction Object

    See more

    Declaration

    Swift

    public struct Refunds : Decodable, Sendable
  • Details about an individual refund payment.

    Represents a single refund payment that was made back to the user, either on-chain via Stellar or off-chain through an external payment system.

    See SEP-6 Transaction Object

    See more

    Declaration

    Swift

    public struct RefundPayment : Decodable, Sendable
  • Response indicating that customer information is needed through a non-interactive flow.

    This response is returned by GET /deposit or GET /withdraw requests in SEP-6 when the anchor needs specific KYC fields from the user. The wallet should collect these fields and submit them via SEP-12.

    This approach allows wallets to collect information directly without redirecting users to an external web interface.

    See SEP-6 Customer Information Needed

    See more

    Declaration

    Swift

    public struct CustomerInformationNeededNonInteractive : Decodable, Sendable
  • Response indicating the status of customer information processing.

    This response is returned by GET /deposit or GET /withdraw requests in SEP-6 when customer information has been submitted and is being processed or has been denied. The wallet should inform the user of the current status and may periodically check for updates.

    Status values:

    • pending: Information is being reviewed
    • denied: Customer has been denied

    See SEP-6 Customer Information Status

    See more

    Declaration

    Swift

    public struct CustomerInformationStatus : Decodable, Sendable
  • Response returned when initiating a deposit transaction.

    This response is returned by GET /deposit and GET /deposit-exchange requests in SEP-6. It provides instructions for how to complete the deposit, including where to send the off-chain funds and any additional information needed.

    The wallet should use the transaction ID to query the GET /transaction endpoint to check the status of the deposit.

    See SEP-6 Deposit

    See more

    Declaration

    Swift

    public struct DepositResponse : Decodable, Sendable
  • Instruction for completing the off-chain deposit.

    Contains SEP-9 financial account fields that describe how to complete the deposit. Each instruction provides a value and description for a specific field.

    See SEP-6 Deposit Response

    See more

    Declaration

    Swift

    public struct DepositInstruction : Decodable, Sendable
  • Additional information about the deposit process.

    Contains optional messages or details that provide context about the deposit.

    See SEP-6 Deposit Response

    See more

    Declaration

    Swift

    public struct ExtraInfo : Decodable, Sendable
  • Response returned when initiating a withdrawal transaction.

    This response is returned by GET /withdraw and GET /withdraw-exchange requests in SEP-6. It provides the Stellar account and memo that the user should send their tokens to in order to initiate the withdrawal.

    The wallet should use the transaction ID to query the GET /transaction endpoint to check the status of the withdrawal.

    See SEP-6 Withdraw

    See more

    Declaration

    Swift

    public struct WithdrawResponse : Decodable, Sendable
  • String constants for asset types used in Horizon API responses and requests.

    These constants represent the different asset types supported by the Stellar network and are used when parsing or constructing API requests and responses.

    See: Stellar developer docs for more information.

    See more

    Declaration

    Swift

    public struct AssetTypeAsString : Sendable
  • String constants for effect types used in Horizon API responses.

    Effects represent specific changes that occur on the Stellar network as a result of operations. These constants are used when parsing effect responses from the Horizon server.

    See: Stellar developer docs for more information.

    See more

    Declaration

    Swift

    public struct EffectTypeAsString : Sendable
  • String constants for memo types used in transactions.

    Memos are optional attachments to transactions that can be used to include additional information or identification.

    See: Stellar developer docs for more information.

    See more

    Declaration

    Swift

    public struct MemoTypeAsString : Sendable
  • Fixed-size 32-byte data wrapper.

    Used for 256-bit hashes, public keys, and other 32-byte values in Stellar protocol. Examples: SHA-256 hashes, Ed25519 public keys, transaction hashes.

    See more

    Declaration

    Swift

    public struct WrappedData32 : WrappedData, Equatable, Sendable
  • Fixed-size 4-byte data wrapper.

    Used for short binary identifiers and fixed-size fields in Stellar protocol.

    See more

    Declaration

    Swift

    public struct WrappedData4 : WrappedData, Sendable
  • Fixed-size 12-byte data wrapper.

    Used for 12-character asset codes and other 12-byte values in Stellar protocol.

    See more

    Declaration

    Swift

    public struct WrappedData12 : WrappedData, Sendable

Decodable Response Structs

  • Response from the SEP-45 challenge endpoint containing authorization entries to be signed.

    This response is returned when requesting a challenge from the authentication server. The authorization entries must be validated, signed by the client, and submitted back to obtain a JWT token.

    See also:

    See more

    Declaration

    Swift

    public struct ContractChallengeResponse : Decodable, Sendable