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 Parameters | Value |
|---|---|
x-api-key string required Your API key |
| Body Parameters | Value |
|---|---|
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 type | When to call |
|---|---|
| EVM | Not required. Use userSteps directly from quote response. |
| Solana | Always required. Solana transactions have short blockhash validity (~60 seconds). Call this endpoint immediately before execution. |
Request body
| Parameter | Type | Required | Description |
|---|---|---|---|
quoteId | string | Yes | Quote 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:
| Attribute | Type | Description |
|---|---|---|
type | string | TRANSACTION |
description | string | Human-readable action description |
chainKey | string | Chain to execute on |
chainType | enum | EVM, SOLANA, APTOS, TON, TRON |
signerAddress | string | Wallet that must sign |
transaction | object | Transaction details |
transaction.encoded | object | Encoded 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
- TypeScript
- Python
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"}'
const response = await fetch('https://transfer.layerzero-api.com/v1/build-user-steps', {
method: 'POST',
headers: {
'x-api-key': process.env.VT_API_KEY,
'Content-Type': 'application/json',
},
body: JSON.stringify({quoteId: 'quote_abc123'}),
});
const {userSteps} = await response.json();
console.log('User steps:', userSteps);
import requests
response = requests.post(
"https://transfer.layerzero-api.com/v1/build-user-steps",
headers={
"x-api-key": "YOUR_API_KEY",
"Content-Type": "application/json",
},
json={"quoteId": "quote_abc123"},
)
user_steps = response.json()["userSteps"]
print("User steps:", user_steps)
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:
- Request quote → Receive quote with
quoteId - Call
/build-user-stepswithquoteId→ Get fresh transaction - Sign and submit immediately (within 60 seconds)
Related endpoints
- Quotes — Request transfer quotes (includes
userStepsfor EVM) - Status — Track transfer progress after execution
Examples
- Solana Example — Complete Solana transfer with transaction building