Cloak API

Signing the transaction

The transaction field is a base64-encoded Solana versioned (v0) transaction.

Your wallet layer must support v0

Confirm that your wallet or signing library can deserialize and sign versioned Solana transactions before integrating Cloak.
Examples in

In a browser, pass the transaction to the user's wallet adapter. The examples also cover server-side signing.

Deserialize, sign, submit

Deserialize, sign, submit
# Signing is not possible from a shell: a private key must never transit
# a command line or environment variable in production.
#
# Pass order.transaction to your wallet layer instead:
#
#   1. base64-decode it
#   2. deserialize as a VERSIONED (v0) transaction
#   3. sign with the sender's key
#   4. submit the raw serialized bytes to your RPC
#
# Every other tab shows that in a real language.

SDK-specific signing behavior

Some SDKs do not attach a signature when you modify a deserialized transaction directly. Follow the language example above: Python rebuilds from unsigned.message, and Rust uses try_new.

After submission

  • Confirm the transaction, then optionally call POST /deposit so Cloak can process it sooner.
  • If submission fails on an expired blockhash, call refresh and sign again. This cannot double-spend.
  • Then poll status until final.

Keep SOL available for the deposit

Keep roughly 0.002 SOL available beyond the transfer amount for the deposit transaction.