Broadcast private transaction

Takes the raw transaction data as input and broadcasts it privately, only available for Ethereum network

POSThttps://api.1inch.com/tx-gateway/v1.1/{chain}/flashbots
Supported on:
EthereumBaseSolanaBNB ChainAvalancheZKsyncGnosisOptimismPolygonSonicUnichainArbitrum

Parameters

chain
* number path

Request Body

BroadcastRequest object
rawTransaction
* string
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
const axios = require('axios');

async function httpCall() {
  const url = 'https://api.1inch.com/tx-gateway/v1.1/{chain}/flashbots';

  const config = {
    headers: {
      Authorization: `Bearer ${API_KEY}`,
    },
    params: {},
    paramsSerializer: {
      indexes: null,
    },
  };
  const body = {
    rawTransaction: '0x123...',
  };

  try {
    const response = await axios.post(url, body, config);
    console.log(response.data);
  } catch (error) {
    console.error(error);
  }
}

Returns

200
400
BroadcastResponse object
transactionHash
* string
JSON
1
2
3
4
{
  "transactionHash": "0x123..."
}

Did you find what you need?