Skip to main content
Version: Endpoint V2

Build user steps

Generates fresh transaction data for a quote. Required for Solana transfers due to short blockhash validity.

POST/build-user-steps

Rebuild or refresh the user steps for a quote. Use this if the original quote's user steps have expired or if you need fresh transaction data (required for Solana).
Header ParametersValue
x-api-key
string
required
Your API key
Body ParametersValue
quoteId
string
required
The quote ID to build steps for
Response
{
"userSteps": [
{
"type": "TRANSACTION",
"description": "Bridge ETH from Base to Optimism",
"chainKey": "base",
"chainType": "EVM",
"signerAddress": "0x..."
}
]
}

Reference

Authentication

Required. Include your API key in the x-api-key header.

When to use

Chain typeWhen to call
EVMNot required. Use userSteps directly from quote response.
SolanaAlways required. Solana transactions have short blockhash validity (~60 seconds). Call this endpoint immediately before execution.

Request body

ParameterTypeRequiredDescription
quoteIdstringYesQuote ID from the /quotes response

Response

Returns a userSteps array with fresh transaction data.

User step attributes

User steps can be TRANSACTION or SIGNATURE (same structure as quote response):

TRANSACTION step:

AttributeTypeDescription
typestringTRANSACTION
descriptionstringHuman-readable action description
chainKeystringChain to execute on
chainTypeenumEVM, SOLANA, APTOS, TON, TRON
signerAddressstringWallet that must sign
transactionobjectTransaction details
transaction.encodedobjectEncoded transaction data

For Solana, the transaction data is base64-encoded:

{
type: "TRANSACTION",
chainType: "SOLANA",
transaction: {
encoded: {
encoding: "base64",
data: "AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA..."
}
}
}

For EVM, the transaction data includes standard fields:

{
type: "TRANSACTION",
chainType: "EVM",
transaction: {
encoded: {
to: "0x...",
data: "0x...",
value: "0",
chainId: 8453
}
}
}

Code examples

curl -X POST "https://transfer.layerzero-api.com/v1/build-user-steps" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"quoteId": "quote_abc123"}'

Response

{
"userSteps": [
{
"type": "TRANSACTION",
"description": "Bridge tokens",
"chainKey": "solana",
"chainType": "SOLANA",
"signerAddress": "YourSolanaPublicKey...",
"transaction": {
"encoded": {
"encoding": "base64",
"data": "AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA..."
}
}
}
]
}

Solana execution

After building user steps, deserialize and sign the transaction:

import {VersionedTransaction, Connection} from '@solana/web3.js';

// Get fresh user steps
const {userSteps} = await buildUserSteps(quoteId);
const step = userSteps[0];

// Decode base64 transaction
const txBuffer = Buffer.from(step.transaction.encoded.data, 'base64');
const tx = VersionedTransaction.deserialize(txBuffer);

// Sign and send
const signedTx = await wallet.signTransaction(tx);
const signature = await connection.sendRawTransaction(signedTx.serialize());

await connection.confirmTransaction(signature, 'confirmed');

Why Solana needs fresh transactions

Solana transactions include a recent blockhash that expires after ~60 seconds. The /build-user-steps endpoint generates transactions with the latest blockhash, ensuring they remain valid during execution.

Workflow:

  1. Request quote → Receive quote with quoteId
  2. Call /build-user-steps with quoteId → Get fresh transaction
  3. Sign and submit immediately (within 60 seconds)
  • Quotes — Request transfer quotes (includes userSteps for EVM)
  • Status — Track transfer progress after execution

Examples

  • Solana Example — Complete Solana transfer with transaction building