Skip to main content

getETAIntoATAWithdrawerFunction

Import: @umbra-privacy/sdk/withdrawal
Withdraws tokens from the caller’s ETA to a destination ATA. This is the primary withdrawal path — no ZK proof required. The withdrawal queues an Arcium MPC computation; the network processes it and calls back on-chain to execute the transfer. Follows the dual-instruction pattern.

Deps

All fields are optional.
  • accountInfoProvider?: AccountInfoProviderFunction.
  • getLatestBlockhash?: GetLatestBlockhash.
  • transactionForwarder?: TransactionForwarder.

Returns

  • destinationAddress: Address — wallet whose ATA receives the tokens.
  • mint: Address — token mint address.
  • withdrawalAmount: U64 — amount in base token units to withdraw from the ETA.

Options (ETAIntoATAWithdrawerOptions)

  • optionalData — 32-byte caller metadata. Pre-hashed only. Default 32 zero bytes.
  • accountInfoCommitment — per-call commitment for RPC account reads.
  • computationOffset, mpcCallbackDataOffset — PDA offsets. Default to fresh CSPRNG values per call.
  • feeVaultOffset, destinationProgram — observer-forward CPI configuration. Leave at defaults unless you are intentionally routing post-callback into another program.
  • hooks — per-phase lifecycle hooks (onValidationStart, onAccountFetchComplete, queueComputation, onComplete, onError, etc.).
There are no priorityFees, awaitCallback, skipPreflight, maxRetries, or epochInfoCommitment options on the V18 withdrawer.

WithdrawResult

Errors

Throws EncryptedWithdrawalError. See Errors.

Example

Dropped-callback recovery

If the handler succeeds but the Arcium callback never lands, tokens stay staged in the pool ATA. Reclaim them with getStagedSplRecovererFunction / getStagedSolRecovererFunction from @umbra-privacy/sdk/account — synchronous, no MPC, no ZK proof.

EncryptedWithdrawalError

Thrown by the withdrawer factory. Stage values: "initialization" | "validation" | "mint-fetch" | "pda-derivation" | "instruction-build" | "transaction-build" | "transaction-compile" | "transaction-sign" | "transaction-send". See Errors.