Stellar PHP SDK API Documentation

DepositExchangeRequest

Request parameters for cross-asset deposit with SEP-38 quote support.

Encapsulates parameters for deposit operations involving currency conversion. Enables users to send one asset (e.g., BRL via bank transfer) and receive a different asset on Stellar (e.g., USDC tokens). Requires anchor support for SEP-38 quotes to determine exchange rates.

Required fields include destinationAsset (what user receives), sourceAsset (what user sends), amount, and account. Optional quote_id locks in exchange rates.

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
TransferServerService::depositExchange()
see
DepositResponse

Table of Contents

Properties

$account  : string
$amount  : string
$claimableBalanceSupported  : string|null
$countryCode  : string|null
$customerId  : string|null
$destinationAsset  : string
$emailAddress  : string|null
$extraFields  : array<string, string>|null
$jwt  : string|null
$lang  : string|null
$locationId  : string|null
$memo  : string|null
$memoType  : string|null
$onChangeCallback  : string|null
$quoteId  : string|null
$sourceAsset  : string
$type  : string|null
$walletName  : string|null
$walletUrl  : string|null

Methods

__construct()  : mixed

Properties

$account

public string $account

The stellar or muxed account ID of the user that wants to deposit. This is where the asset token will be sent. Note that the account specified in this request could differ from the account authenticated via SEP-10.

$amount

public string $amount

The amount of the source_asset the user would like to deposit to the anchor's off-chain account. This field may be necessary for the anchor to determine what KYC information is necessary to collect. Should be equals to quote.sell_amount if a quote_id was used.

$claimableBalanceSupported

public string|null $claimableBalanceSupported = null

(optional) true if the client supports receiving deposit transactions as a claimable balance, false otherwise.

$countryCode

public string|null $countryCode = null

(optional) The ISO 3166-1 alpha-3 code of the user's current address (e.g., 'USA' for United States, 'GBR' for United Kingdom, 'DEU' for Germany). This field may be necessary for the anchor to determine what KYC information is necessary to collect.

$customerId

public string|null $customerId = null

(optional) id of an off-chain account (managed by the anchor) associated with this user's Stellar account (identified by the JWT's sub field). If the anchor supports SEP-12, the customerId field should match the SEP-12 customer's id. customerId should be passed only when the off-chain id is know to the client, but the relationship between this id and the user's Stellar account is not known to the Anchor.

$destinationAsset

public string $destinationAsset

The code of the on-chain asset the user wants to get from the Anchor after doing an off-chain deposit. The value passed must match one of the codes listed in the /info response's deposit-exchange object.

$emailAddress

public string|null $emailAddress = null

(optional) Email address of depositor. If desired, an anchor can use this to send email updates to the user about the deposit.

$extraFields

public array<string, string>|null $extraFields = null

(optional) can be used to provide extra fields for the request. E.g. required fields from the /info endpoint that are not covered by the standard parameters.

$jwt

public string|null $jwt = null

jwt token previously received from the anchor via the SEP-10 authentication flow

$lang

public string|null $lang = null

(optional) Defaults to en. Language code specified using ISO 639-1 (e.g., 'en' for English, 'es' for Spanish, 'pt' for Portuguese). Error fields in the response should be in this language.

$locationId

public string|null $locationId = null

(optional) id of the chosen location to drop off cash.

$memo

public string|null $memo = null

(optional) (optional) Value of memo to attach to transaction, for hash this should be base64-encoded. Because a memo can be specified in the SEP-10 JWT for Shared Accounts, this field as well as memo_type can be different than the values included in the SEP-10 JWT. For example, a client application could use the value passed for this parameter as a reference number used to match payments made to account.

$memoType

public string|null $memoType = null

(optional) Type of memo that the anchor should attach to the Stellar payment transaction, one of text, id or hash.

$onChangeCallback

public string|null $onChangeCallback = null

(optional) A URL that the anchor should POST a JSON message to when the status property of the transaction created as a result of this request changes. The JSON message should be identical to the response format for the /transaction endpoint.

$quoteId

public string|null $quoteId = null

(optional) The id returned from a SEP-38 POST /quote response. If this parameter is provided and the user delivers the deposit funds to the Anchor before the quote expiration, the Anchor should respect the conversion rate agreed in that quote. If the values of destination_asset, source_asset and amount conflict with the ones used to create the SEP-38 quote, this request should be rejected with a 400.

$sourceAsset

public string $sourceAsset

The off-chain asset the Anchor will receive from the user. The value must match one of the asset values included in a SEP-38 GET /prices?buy_asset=stellar:<destination_asset>:<asset_issuer> response using SEP-38 Asset Identification Format.

$type

public string|null $type = null

(optional) Type of deposit. If the anchor supports multiple deposit methods (e.g. SEPA or SWIFT), the wallet should specify type. This field may be necessary for the anchor to determine which KYC fields to collect.

$walletName

public string|null $walletName = null

(deprecated, optional) In communications / pages about the deposit, anchor should display the wallet name to the user to explain where funds are going. However, anchors should use client_domain (for non-custodial) and sub value of JWT (for custodial) to determine wallet information.

$walletUrl

public string|null $walletUrl = null

(deprecated,optional) Anchor should link to this when notifying the user that the transaction has completed. However, anchors should use client_domain (for non-custodial) and sub value of JWT (for custodial) to determine wallet information.

Methods

__construct()

public __construct(string $destinationAsset, string $sourceAsset, string $amount, string $account[, string|null $quoteId = null ][, string|null $memoType = null ][, string|null $memo = null ][, string|null $emailAddress = null ][, string|null $type = null ][, string|null $walletName = null ][, string|null $walletUrl = null ][, string|null $lang = null ][, string|null $onChangeCallback = null ][, string|null $countryCode = null ][, string|null $claimableBalanceSupported = null ][, string|null $customerId = null ][, string|null $locationId = null ][, array<string, string>|null $extraFields = null ][, string|null $jwt = null ]) : mixed
Parameters
$destinationAsset : string

The code of the on-chain asset the user wants to get from the Anchor after doing an off-chain deposit. The value passed must match one of the codes listed in the /info response's deposit-exchange object.

$sourceAsset : string

The off-chain asset the Anchor will receive from the user. The value must match one of the asset values included in a SEP-38 GET /prices?buy_asset=stellar:<destination_asset>:<asset_issuer> response using SEP-38 Asset Identification Format.

$amount : string

The amount of the source_asset the user would like to deposit to the anchor's off-chain account. This field may be necessary for the anchor to determine what KYC information is necessary to collect. Should be equals to quote.sell_amount if a quote_id was used.

$account : string

The stellar or muxed account ID of the user that wants to deposit. This is where the asset token will be sent. Note that the account specified in this request could differ from the account authenticated via SEP-10.

$quoteId : string|null = null

(optional) The id returned from a SEP-38 POST /quote response. If this parameter is provided and the user delivers the deposit funds to the Anchor before the quote expiration, the Anchor should respect the conversion rate agreed in that quote. If the values of destination_asset, source_asset and amount conflict with the ones used to create the SEP-38 quote, this request should be rejected with a 400.

$memoType : string|null = null

(optional) Type of memo that the anchor should attach to the Stellar payment transaction, one of text, id or hash.

$memo : string|null = null

(optional) (optional) Value of memo to attach to transaction, for hash this should be base64-encoded. Because a memo can be specified in the SEP-10 JWT for Shared Accounts, this field as well as memo_type can be different than the values included in the SEP-10 JWT. For example, a client application could use the value passed for this parameter as a reference number used to match payments made to account.

$emailAddress : string|null = null

(optional) Email address of depositor. If desired, an anchor can use this to send email updates to the user about the deposit.

$type : string|null = null

(optional) Type of deposit. If the anchor supports multiple deposit methods (e.g. SEPA or SWIFT), the wallet should specify type. This field may be necessary for the anchor to determine which KYC fields to collect.

$walletName : string|null = null

(deprecated, optional) In communications / pages about the deposit, anchor should display the wallet name to the user to explain where funds are going. However, anchors should use client_domain (for non-custodial) and sub value of JWT (for custodial) to determine wallet information.

$walletUrl : string|null = null

(deprecated,optional) Anchor should link to this when notifying the user that the transaction has completed. However, anchors should use client_domain (for non-custodial) and sub value of JWT (for custodial) to determine wallet information.

$lang : string|null = null

(optional) Defaults to en. Language code specified using ISO 639-1 (e.g., 'en' for English, 'es' for Spanish, 'pt' for Portuguese). Error fields in the response should be in this language.

$onChangeCallback : string|null = null

(optional) A URL that the anchor should POST a JSON message to when the status property of the transaction created as a result of this request changes. The JSON message should be identical to the response format for the /transaction endpoint.

$countryCode : string|null = null

(optional) The ISO 3166-1 alpha-3 code of the user's current address (e.g., 'USA' for United States, 'GBR' for United Kingdom, 'DEU' for Germany). This field may be necessary for the anchor to determine what KYC information is necessary to collect.

$claimableBalanceSupported : string|null = null

(optional) true if the client supports receiving deposit transactions as a claimable balance, false otherwise.

$customerId : string|null = null

(optional) id of an off-chain account (managed by the anchor) associated with this user's Stellar account (identified by the JWT's sub field). If the anchor supports SEP-12, the customerId field should match the SEP-12 customer's id. customerId should be passed only when the off-chain id is know to the client, but the relationship between this id and the user's Stellar account is not known to the Anchor.

$locationId : string|null = null

(optional) id of the chosen location to drop off cash.

$extraFields : array<string, string>|null = null

(optional) can be used to provide extra fields for the request. E.g. required fields from the /info endpoint that are not covered by the standard parameters.

$jwt : string|null = null

jwt token previously received from the anchor via the SEP-10 authentication flow.


        
On this page

Search results