LogoLogo
DashboardBlogNode API DocsContact
  • Staking
    • Overview
    • FAQ
  • Ethereum
    • Staking Tutorial
      • API
        • Prerequisites
        • Authenticating with Auth0
        • Setting up a Wallet
        • Get Staking Transaction
        • Signing a Transaction
        • Broadcast Transaction
        • Full Code
    • Staking API Reference
      • Authentication
      • Get Validators
      • Stake Transaction
      • Broadcast Transaction
      • Exit Validators
      • Presigned Exit Request
Powered by GitBook
On this page
  1. Ethereum
  2. Staking Tutorial
  3. API

Broadcast Transaction

The code snippet below makes a request to broadcast the signed transaction. The signed transaction is sent to the Validation Cloud backend that will validate it and forward it to the Ethereum network.

const STAKING_BROADCAST_TX_URL = `${STAKING_BASE_API_URL}/ethereum/mainnet/broadcast_transaction`;


async function broadcastStakingTransaction(token, signedTx) {
  const jsonBody = JSON.stringify({
    signed_transaction: signedTx,
  });

  const response = await fetch(STAKING_BROADCAST_TX_URL, {
    method: 'POST',
    headers: {
      Authorization: `Bearer ${token}`,
      'Content-Type': 'application/json',
    },
    body: jsonBody,
  });

  return await response.json();
}

PreviousSigning a TransactionNextFull Code

Last updated 1 year ago