Sep24WithdrawRequest
public struct Sep24WithdrawRequest : 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
-
JWT previously received from the anchor via the SEP-10 authentication flow.
Declaration
Swift
public var jwt: String -
Code of the asset the user wants to withdraw. The value passed must match one of the codes listed in the /info response’s withdraw object. ‘native’ is a special asset_code that represents the native XLM token.
Declaration
Swift
public var assetCode: String -
The issuer of the stellar asset the user wants to withdraw with the anchor. If asset_issuer is not provided, the anchor should use the asset issued by themselves as described in their TOML file. If ‘native’ is specified as the asset_code, asset_issuer must be not be set.
Declaration
Swift
public var assetIssuer: String? -
String in Asset Identification Format - The asset user wants to receive. It’s an off-chain or fiat asset. If this is not provided, it will be collected in the interactive flow. When quote_id is specified, this parameter must match the quote’s buy_asset asset code or be omitted.
Declaration
Swift
public var destinationAsset: String? -
Amount of asset requested to withdraw. If this is not provided it will be collected in the interactive flow.
Declaration
Swift
public var amount: String? -
The id returned from a SEP-38 POST /quote response.
Declaration
Swift
public var quoteId: String? -
The Stellar (G…) or muxed account (M…) the client wants to use as the destination of the payment sent by the anchor. Defaults to the account authenticated via SEP-10 if not specified.
Declaration
Swift
public var account: String? -
Deprecated. This field was originally intended to differentiate users of the same Stellar account. However, the anchor should use the sub value included in the decoded SEP-10 JWT instead. Anchors should still support this parameter to maintain support for outdated clients.
Declaration
Swift
public var memo: String? -
Deprecated. Type of memo. One of text, id or hash. Deprecated because memos used to identify users of the same Stellar account should always be of type of id.
Declaration
Swift
public var memoType: String? -
In communications / pages about the withdrawal, anchor should display the wallet name to the user to explain where funds are coming from.
Declaration
Swift
public var walletName: String? -
Anchor can show this to the user when referencing the wallet involved in the withdrawal (ex. in the anchor’s transaction history).
Declaration
Swift
public var walletUrl: String? -
Defaults to en if not specified or if the specified language is not supported. Language code specified using RFC 4646 which means it can also accept locale in the format en-US. Error fields in the response, as well as the interactive flow UI and any other user-facing strings returned for this transaction should be in this language.
Declaration
Swift
public var lang: String? -
The memo the anchor must use when sending refund payments back to the user. If not specified, the anchor should use the same memo used by the user to send the original payment. If specified, refund_memo_type must also be specified.
Declaration
Swift
public var refundMemo: String? -
The type of the refund_memo. Can be id, text, or hash. If specified, refund_memo must also be specified.
Declaration
Swift
public var refundMemoType: String? -
One or more of the KYC fields for natural persons as listed in SEP-9.
Declaration
Swift
public var kycFields: [KYCNaturalPersonFieldsEnum]? -
One or more of the KYC fields for organizations as listed in SEP-9.
Declaration
Swift
public var kycOrganizationFields: [KYCOrganizationFieldsEnum]? -
One or more of the KYC fields for financial accounts as listed in SEP-9.
Declaration
Swift
public var kycFinancialAccountFields: [KYCFinancialAccountFieldsEnum]? -
Additional custom fields to be added to the request.
Declaration
Swift
public var customFields: [String : String]? -
Additional custom files to be added to the request.
Declaration
Swift
public var customFiles: [String : Data]? -
Creates a new withdrawal request.
Declaration
Swift
public init(jwt: String, assetCode: String)Parameters
jwtJWT previously received from the anchor via SEP-10 authentication
assetCodeThe code of the stellar asset the user wants to withdraw
-
Converts the request parameters to a dictionary of data for multipart form submission.
Declaration
Swift
public func toParameters() -> [String : Data]Return Value
Dictionary mapping parameter names to their Data representations
View on GitHub
Install in Dash