Stellar PHP SDK API Documentation

DepositRequest

Request parameters for initiating a deposit operation via SEP-06.

Encapsulates all parameters needed to request deposit information from an anchor. A deposit is when a user sends an external asset to the anchor, and the anchor sends equivalent Stellar tokens to the user's account.

Required fields are assetCode and account. Optional fields enable features like memos, language preferences, KYC information, and callbacks for status updates.

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

SEP-06 Specification

see
TransferServerService::deposit()
see
DepositResponse

Table of Contents

Properties

$account  : string
$amount  : string|null
$assetCode  : string
$claimableBalanceSupported  : string|null
$countryCode  : string|null
$customerId  : string|null
$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
$type  : string|null
$walletName  : string|null
$walletUrl  : string|null

Methods

__construct()  : mixed
Constructor

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|null $amount = null

(optional) The amount of the asset the user would like to deposit with the anchor. This field may be necessary for the anchor to determine what KYC information is necessary to collect.

$assetCode

public string $assetCode

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 object.

$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.

$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) 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 memoType 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.

$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()

Constructor

public __construct(string $assetCode, string $account[, 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 $amount = 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
$assetCode : 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 object.

$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.

$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) 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 memoType 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.

$amount : string|null = null

(optional) The amount of the asset the user would like to deposit with the anchor. This field may be necessary for the anchor to determine what KYC information is necessary to collect.

$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