Skip to main content
POST
Prepare Solana transaction

Authorizations

Authorization
string
header
required

Cognito JWT token for regular user authentication

Body

Request body for preparing a Solana transaction. The authenticated user id is derived from the bearer token; clients do not send userId to Wallet Kit. The server builds and stores an unsigned Solana v0 message, then returns the exact bytes the embedded wallet must sign.

Request body for preparing a Solana transaction. The authenticated user id is derived from the bearer token; clients do not send userId to Wallet Kit. The server builds and stores an unsigned Solana v0 message, then returns the exact bytes the embedded wallet must sign.

clientIntentId
string
required

Caller-supplied idempotency key for this prepare call. Repeating the same clientIntentId with an identical intent returns the existing prepared transaction while it is active. Reusing the same key with different intent details returns a conflict error.

Minimum string length: 1
intentVersion
enum<number>
required

Version of the intent schema. Production prepare currently expects exactly 1.

Available options:
1
Example:

1

intent
object
required

Discriminated Solana transaction intent. Use transfer for wallet transfers, payment for Spritz off-ramp quote payments, yield.deposit for Kamino USDC vault deposits, and yield.withdraw for Kamino USDC vault withdrawals.

feeMode
enum<string>
Available options:
auto,
sponsored_only,
user_paid_only

Response

Prepare response for the embedded-wallet signing flow. Decode messageBytes, sign those exact bytes with userSigner, then submit only the detached base64 signature. Do not submit a serialized transaction or rebuild the message client-side.

Prepare response for the embedded-wallet signing flow. Decode messageBytes, sign those exact bytes with userSigner, then submit only the detached base64 signature. Do not submit a serialized transaction or rebuild the message client-side.

txId
string
required

Server-issued transaction id. Pass this back to the submit endpoint along with the user signature.

messageBytes
string
required

Base64-encoded Solana v0 message bytes. The embedded wallet must sign exactly these bytes after base64 decoding — do not mutate, rebuild, or wrap.

messageFormat
enum<string>
required

Format of messageBytes. solana_message_v0 means the bytes are a Solana v0 message, not a serialized transaction.

Available options:
solana_message_v0
userSigner
string
required

Solana public key that must produce userSignature over the decoded messageBytes.

Example:

"8sLbNZoA1cfnvMJLPfp98ZLAnFSYCFApfJKMbiXNLwxj"

requiredSigners
string[]
required

All signer public keys required by the prepared message. The embedded wallet is responsible for the userSigner; Spritz may add the fee-payer signature during submit.

feePayer
string
required

Solana public key paying the network fee for the prepared transaction.

sponsored
boolean
required

Whether Spritz is expected to pay the Solana network fee for this prepared transaction.

estimatedFeeLamports
integer
required

Estimated Solana network fee in lamports for the prepared message.

Required range: x >= 0
Example:

5000

addressLookupTableAddresses
string[]
required

Address lookup table accounts used by the v0 message. Empty when the message does not use lookup tables.

blockhash
string
required

Recent blockhash embedded in the prepared message. This blockhash is what makes the prepared message expire.

lastValidBlockHeight
integer
required

Last Solana block height at which the prepared message can still be submitted.

Required range: x >= 0
expiresAt
string<date-time>
required

ISO 8601 timestamp at which this prepared transaction expires. Solana blockhashes expire quickly; if submit fails with TX_EXPIRED, call prepare again and sign the new messageBytes.

summary
object
required

Product summary of the prepared transaction. Shape varies by intent. Transfer summaries identify sender, recipient, mint, and amount. Payment summaries identify the off-ramp quote, destination, amount, mint, and required token input. Kamino yield summaries identify protocol, vault, mint, and the deposit amount or withdraw-all request.