AnchorTransaction

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

  • id

    Unique, anchor-generated id for the deposit/withdrawal

    Declaration

    Swift

    public let id: String
  • deposit, deposit-exchange, withdrawal or withdrawal-exchange.

    Declaration

    Swift

    public let kind: AnchorTransactionKind
  • Processing status of deposit/withdrawal

    Declaration

    Swift

    public let status: AnchorTransactionStatus
  • (optional) Estimated number of seconds until a status change is expected.

    Declaration

    Swift

    public let statusEta: Int?
  • (optional) A URL the user can visit if they want more information about their account / status.

    Declaration

    Swift

    public let moreInfoUrl: String?
  • (optional) Amount received by anchor at start of transaction as a string with up to 7 decimals. Excludes any fees charged before the anchor received the funds. Should be equals to quote.sell_asset if a quote_id was used.

    Declaration

    Swift

    public let amountIn: String?
  • (optional) The asset received or to be received by the Anchor. Must be present if the deposit/withdraw was made using quotes. The value must be in SEP-38 Asset Identification Format.

    Declaration

    Swift

    public let amountInAsset: String?
  • (optional) Amount sent by anchor to user at end of transaction as a string with up to 7 decimals. Excludes amount converted to XLM to fund account and any external fees. Should be equals to quote.buy_asset if a quote_id was used.

    Declaration

    Swift

    public let amountOut: String?
  • (optional) The asset delivered or to be delivered to the user. Must be present if the deposit/withdraw was made using quotes. The value must be in SEP-38 Asset Identification Format.

    Declaration

    Swift

    public let amountOutAsset: String?
  • (deprecated, optional) Amount of fee charged by anchor. Should be equals to quote.fee.total if a quote_id was used.

    Declaration

    Swift

    public let amountFee: String?
  • (deprecated, optional) The asset in which fees are calculated in. Must be present if the deposit/withdraw was made using quotes. The value must be in SEP-38 Asset Identification Format. Should be equals to quote.fee.asset if a quote_id was used.

    Declaration

    Swift

    public let amountFeeAsset: String?
  • Description of fee charged by the anchor. If quote_id is present, it should match the referenced quote’s fee object.

    Declaration

    Swift

    public let feeDetails: FeeDetails?
  • (optional) The ID of the quote used to create this transaction. Should be present if a quote_id was included in the POST /transactions request. Clients should be aware though that the quote_id may not be present in older implementations.

    Declaration

    Swift

    public let quoteId: String?
  • (optional) Sent from address (perhaps BTC, IBAN, or bank account in the case of a deposit, Stellar address in the case of a withdrawal).

    Declaration

    Swift

    public let from: String?
  • to

    (optional) Sent to address (perhaps BTC, IBAN, or bank account in the case of a withdrawal, Stellar address in the case of a deposit).

    Declaration

    Swift

    public let to: String?
  • (optional) Extra information for the external account involved. It could be a bank routing number, BIC, or store number for example.

    Declaration

    Swift

    public let externalExtra: String?
  • (optional) Text version of external_extra. This is the name of the bank or store.

    Declaration

    Swift

    public let externalExtraText: String?
  • (optional) If this is a deposit, this is the memo (if any) used to transfer the asset to the to Stellar address

    Declaration

    Swift

    public let depositMemo: String?
  • (optional) Type for the deposit_memo.

    Declaration

    Swift

    public let depositMemoType: String?
  • (optional) If this is a withdrawal, this is the anchor’s Stellar account that the user transferred (or will transfer) their issued asset to.

    Declaration

    Swift

    public let withdrawAnchorAccount: String?
  • (optional) Memo used when the user transferred to withdraw_anchor_account.

    Declaration

    Swift

    public let withdrawMemo: String?
  • (optional) Memo type for withdraw_memo.

    Declaration

    Swift

    public let withdrawMemoType: String?
  • (optional) start date and time of transaction

    Declaration

    Swift

    public let startedAt: Date?
  • (optional) The date and time of transaction reaching the current status.

    Declaration

    Swift

    public let updatedAt: Date?
  • (optional) completion date and time of transaction

    Declaration

    Swift

    public let completedAt: Date?
  • (optional) The date and time by when the user action is required. In certain statuses, such as pending_user_transfer_start or incomplete, anchor waits for the user action and user_action_required_by field should be used to show the time anchors gives for the user to make an action before transaction will automatically be moved into a different status (such as expired or to be refunded). user_action_required_by should only be specified for statuses where user action is required, and omitted for all other. Anchor should specify the action waited on using message or more_info_url.

    Declaration

    Swift

    public let userActionRequiredBy: Date?
  • (optional) transaction_id on Stellar network of the transfer that either completed the deposit or started the withdrawal

    Declaration

    Swift

    public let stellarTransactionId: String?
  • (optional) ID of transaction on external network that either started the deposit or completed the withdrawal

    Declaration

    Swift

    public let externalTransactionId: String?
  • (optional) Human readable explanation of transaction status, if needed.

    Declaration

    Swift

    public let message: String?
  • (deprecated, optional) This field is deprecated in favor of the refunds object. True if the transaction was refunded in full. False if the transaction was partially refunded or not refunded. For more details about any refunds, see the refunds object.

    Declaration

    Swift

    public let refunded: Bool?
  • (optional) An object describing any on or off-chain refund associated with this transaction.

    Declaration

    Swift

    public let refunds: Refunds?
  • (optional) A human-readable message indicating any errors that require updated information from the user.

    Declaration

    Swift

    public let requiredInfoMessage: String?
  • (optional) A set of fields that require update from the user described in the same format as /info. This field is only relevant when status is pending_transaction_info_update

    Declaration

    Swift

    public let requiredInfoUpdates: RequiredInfoUpdates?
  • (optional) JSON object containing the SEP-9 financial account fields that describe how to complete the off-chain deposit in the same format as the /deposit response. This field should be present if the instructions were provided in the /deposit response or if it could not have been previously provided synchronously. This field should only be present once the status becomes pending_user_transfer_start, not while the transaction has any statuses that precede it such as incomplete, pending_anchor, or pending_customer_info_update.

    Declaration

    Swift

    public let instructions: [String : DepositInstruction]?
  • (optional) ID of the Claimable Balance used to send the asset initially requested. Only relevant for deposit transactions.

    Declaration

    Swift

    public let claimableBalanceId: String?
  • 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