Stellar PHP SDK API Documentation

AnchorTransaction

Represents a single deposit or withdrawal transaction processed by an anchor.

Contains comprehensive transaction details including status, amounts, fees, timestamps, account information, and any additional data needed to track or complete the transaction.

Used in transaction endpoint responses to provide detailed information about specific operations. Includes support for refunds, quotes (SEP-38), and status updates.

Transaction kinds: deposit, deposit-exchange, withdrawal, withdrawal-exchange.

Tags
see
https://github.com/stellar/stellar-protocol/blob/v4.3.0/ecosystem/sep-0006.md

SEP-06 Specification

see
https://github.com/stellar/stellar-protocol/blob/v2.5.0/ecosystem/sep-0038.md

SEP-38 v2.5.0 Quotes

see
AnchorTransactionResponse
see
AnchorTransactionsResponse
see
FeeDetails
see
TransactionRefunds

Table of Contents

Properties

$amountFee  : string|null
$amountFeeAsset  : string|null
$amountIn  : string|null
$amountInAsset  : string|null
$amountOut  : string|null
$amountOutAsset  : string|null
$claimableBalanceId  : string|null
$completedAt  : string|null
$depositMemo  : string|null
$depositMemoType  : string|null
$externalExtra  : string|null
$externalExtraText  : string|null
$externalTransactionId  : string|null
$feeDetails  : FeeDetails|null
$from  : string|null
$id  : string
$instructions  : array<string|int, mixed>|null
$kind  : string
$message  : string|null
$moreInfoUrl  : string|null
$quoteId  : string|null
$refunded  : bool|null
$refunds  : TransactionRefunds|null
$requiredInfoMessage  : string|null
$requiredInfoUpdates  : array<string|int, mixed>|null
$startedAt  : string|null
$status  : string
$statusEta  : int|null
$stellarTransactionId  : string|null
$to  : string|null
$updatedAt  : string|null
$userActionRequiredBy  : string|null
$withdrawAnchorAccount  : string|null
$withdrawMemo  : string|null
$withdrawMemoType  : string|null

Methods

__construct()  : mixed
fromJson()  : AnchorTransaction
Constructs a new instance of AnchorTransaction by using the given data.

Properties

$requiredInfoUpdates

public array<string|int, mixed>|null $requiredInfoUpdates = null

Methods

__construct()

public __construct(string $id, string $kind, string $status[, int|null $statusEta = null ][, string|null $moreInfoUrl = null ][, string|null $amountIn = null ][, string|null $amountInAsset = null ][, string|null $amountOut = null ][, string|null $amountOutAsset = null ][, string|null $amountFee = null ][, string|null $amountFeeAsset = null ][, FeeDetails|null $feeDetails = null ][, string|null $quoteId = null ][, string|null $from = null ][, string|null $to = null ][, string|null $externalExtra = null ][, string|null $externalExtraText = null ][, string|null $depositMemo = null ][, string|null $depositMemoType = null ][, string|null $withdrawAnchorAccount = null ][, string|null $withdrawMemo = null ][, string|null $withdrawMemoType = null ][, string|null $startedAt = null ][, string|null $updatedAt = null ][, string|null $completedAt = null ][, string|null $userActionRequiredBy = null ][, string|null $stellarTransactionId = null ][, string|null $externalTransactionId = null ][, string|null $message = null ][, bool|null $refunded = null ][, TransactionRefunds|null $refunds = null ][, string|null $requiredInfoMessage = null ][, array<string, AnchorField>|null $requiredInfoUpdates = null ][, array<string, DepositInstruction>|null $instructions = null ][, string|null $claimableBalanceId = null ]) : mixed
Parameters
$id : string

Unique, anchor-generated id for the deposit/withdrawal.

$kind : string

deposit, deposit-exchange, withdrawal or withdrawal-exchange.

$status : string

Processing status of deposit/withdrawal.

  • incomplete: Missing required information (non-interactive)
  • pending_user_transfer_start: Awaiting user to send funds to anchor
  • pending_anchor: Anchor is processing the transaction
  • pending_stellar: Transaction submitted to Stellar network
  • pending_external: Waiting for external system (bank, crypto network)
  • pending_trust: User must add trustline for the asset
  • pending_user: Action required from user (deprecated, use specific status)
  • completed: Transaction successfully completed
  • refunded: Transaction refunded to user
  • expired: Transaction expired without completion
  • no_market: No market available for requested conversion (exchange operations)
  • too_small: Transaction amount is below minimum
  • too_large: Transaction amount exceeds maximum
  • error: Unrecoverable error occurred.
$statusEta : int|null = null

Estimated number of seconds until a status change is expected.

$moreInfoUrl : string|null = null

A URL the user can visit if they want more information about their account / status.

$amountIn : string|null = null

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.

$amountInAsset : string|null = null

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.

$amountOut : string|null = null

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.

$amountOutAsset : string|null = null

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.

$amountFee : string|null = null

(deprecated) Amount of fee charged by anchor. Should be equals to quote.fee.total if a quote_id was used.

$amountFeeAsset : string|null = null

(deprecated) 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.

$feeDetails : FeeDetails|null = null

Description of fee charged by the anchor. If quote_id is present, it should match the referenced quote's fee object.

$quoteId : string|null = null

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.

$from : string|null = null

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

$to : string|null = null

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

$externalExtra : string|null = null

Extra information for the external account involved. It could be a bank routing number, BIC, or store number for example.

$externalExtraText : string|null = null

Text version of external_extra. This is the name of the bank or store.

$depositMemo : string|null = null

If this is a deposit, this is the memo (if any) used to transfer the asset to the Stellar address.

$depositMemoType : string|null = null

Type for the depositMemo.

$withdrawAnchorAccount : string|null = null

If this is a withdrawal, this is the anchor's Stellar account that the user transferred (or will transfer) their issued asset to.

$withdrawMemo : string|null = null

Memo used when the user transferred to withdrawAnchorAccount.

$withdrawMemoType : string|null = null

Memo type for withdrawMemo.

$startedAt : string|null = null

Start date and time of transaction - UTC ISO 8601 string.

$updatedAt : string|null = null

The date and time of transaction reaching the current status.

$completedAt : string|null = null

Completion date and time of transaction - UTC ISO 8601 string.

$userActionRequiredBy : string|null = null

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. user_action_required_by should only be specified for statuses where user action is required, and omitted for all other.

$stellarTransactionId : string|null = null

transaction_id on Stellar network of the transfer that either completed the deposit or started the withdrawal.

$externalTransactionId : string|null = null

ID of transaction on external network that either started the deposit or completed the withdrawal.

$message : string|null = null

Human readable explanation of transaction status, if needed.

$refunded : bool|null = null

(deprecated) 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.

$refunds : TransactionRefunds|null = null

An object describing any on or off-chain refund associated with this transaction.

$requiredInfoMessage : string|null = null

A human-readable message indicating any errors that require updated information from the user.

$requiredInfoUpdates : array<string, AnchorField>|null = null

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.

$instructions : array<string, DepositInstruction>|null = null

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.

$claimableBalanceId : string|null = null

ID of the Claimable Balance used to send the asset initially requested. Only relevant for deposit transactions.

Tags
see
https://github.com/stellar/stellar-protocol/blob/v4.3.0/ecosystem/sep-0006.md#transaction-status

fromJson()

Constructs a new instance of AnchorTransaction by using the given data.

public static fromJson(array<string|int, mixed> $json) : AnchorTransaction
Parameters
$json : array<string|int, mixed>

the data to construct the object from.

Return values
AnchorTransaction

the object containing the parsed data.


        
On this page

Search results