withdraw
Initiates a programmatic withdrawal.
A withdrawal occurs when a user sends a Stellar asset to an anchor's account, and the anchor delivers the equivalent amount in an off-chain asset (fiat to bank account, crypto to external blockchain, cash pickup, etc.).
Return
Sep06WithdrawResponse with withdrawal instructions (anchor account, memo)
Parameters
request
Withdrawal request parameters
Throws
If JWT is invalid or expired
If additional KYC fields are required
If KYC status prevents the transaction
On validation error
On anchor server error
Example:
val response = sep06.withdraw(Sep06WithdrawRequest(
assetCode = "USDC",
type = "bank_account",
jwt = jwtToken,
dest = "1234567890",
destExtra = "021000021",
amount = "100"
))
println("Send to: ${response.accountId}")
println("Memo: ${response.memo} (${response.memoType})")Content copied to clipboard