Skip to main content
POST
/
build-user-steps
Build transaction steps
curl --request POST \
  --url https://transfer.layerzero-api.com/v1/build-user-steps \
  --header 'Content-Type: application/json' \
  --data '
{
  "quoteId": "quote_abc123"
}
'
{
  "userSteps": [
    {
      "type": "TRANSACTION",
      "description": "bridge",
      "chainKey": "solana",
      "chainType": "SOLANA",
      "signerAddress": "Dz93pUVjXuaMnSsPSn7V99V4cUzhKoQdx9ECwZJZiafG"
    }
  ]
}
Generates fresh transaction data for a quote. Required for Solana transfers due to short blockhash validity.

Reference

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, STARKNET
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..."
    }
  }
}

Code examples

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

Response

{
  "userSteps": [
    {
      "type": "TRANSACTION",
      "description": "bridge",
      "chainKey": "solana",
      "chainType": "SOLANA",
      "signerAddress": "Dz93pUVjXuaMnSsPSn7V99V4cUzhKoQdx9ECwZJZiafG",
      "transaction": {
        "encoded": {
          "encoding": "base64",
          "data": "AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAkT..."
        }
      }
    }
  ]
}

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

Body

application/json
quoteId
string
required

The quote ID to build steps for

Example:

"quote_abc123"

Response

200 - application/json

Successfully built user steps

userSteps
object[]