Skip to main content

Step Transaction

Use this endpoint to convert a selected advanced route (returned by /v1/advanced/routes) into the final transaction payload a wallet needs to execute. It validates the route, enriches it with current gas data, and returns the transactionRequest object ready for signing.

If you want to learn more about how to use this endpoint, please have a look at our guide.

API

Endpoint Details

POST /v1/advanced/stepTransaction

Submit a selected route step and get the final wallet transaction.

Request

Headers

X-API-Keystring

API key issued by Router Protocol

Content-Typestringrequired

Set to `application/json`

Query Parameters

senderAddressstringrequired

Wallet that signs and submits the transaction

recipientAddressstringrequired

Wallet that should receive the bridged funds

Request Body

idstringrequired

Step identifier from advanced routes

typestringrequired

Step type (`bridge`, `swap`, etc.)

toolstringrequired

Bridge/DEX/tool that will execute this step

toolDetailsobject

Detailed metadata about the tool

actionobjectrequired

Instruction describing the transfer

fromChainIdstringrequired
toChainIdstringrequired
fromTokenobjectrequired
toTokenobjectrequired
fromAmountstringrequired
slippagenumber
fromAddressstringrequired
toAddressstringrequired
estimateobjectrequired

Quote that was selected for execution

toolstringrequired
toAmountMinstringrequired
toAmountstringrequired
fromAmountstringrequired
feeCostsobject[]
gasCostsobject[]
includedStepsobject[]
transactionRequestobject
executionobject

Response

Status Code: 200 OK
Content Type: application/json

Response

idstringrequired

Step identifier

typestringrequired

Step type

toolstringrequired

Bridge/DEX/tool used

toolDetailsobject
actionobjectrequired

Same action object returned for reference

estimateobjectrequired

Updated estimate with gas costs

includedStepsobject[]
transactionRequestobjectrequired

Payload that the wallet should sign and broadcast

fromstringrequired
tostringrequired
chainIdstringrequired
datastringrequired

Calldata for the bridge/swap contract

valuestringrequired

Amount of native token to send (wei)

gasPricestring
gasLimitstringrequired
executionobject

Example Request

curl -X POST \
'https://xplore.api.v2.routerprotocol.com/v1/advanced/stepTransaction?senderAddress=0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045&recipientAddress=0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"id": "bf35012e-bac0-421b-9d85-23b058610f8f",
"type": "bridge",
"tool": "across",
"toolDetails": null,
"action": {
"fromChainId": "1",
"toChainId": "42161",
"fromToken": { "address": "0x0000000000000000000000000000000000000000", "chainId": "1", "symbol": "ETH", "decimals": 18, "name": "ETH" },
"toToken": { "address": "0x0000000000000000000000000000000000000000", "chainId": "42161", "symbol": "ETH", "decimals": 18, "name": "ETH" },
"fromAmount": "999900000000000000",
"slippage": 0.03,
"fromAddress": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"toAddress": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"
},
"estimate": {
"tool": "across",
"toAmountMin": "999819035819119513",
"toAmount": "999819035819119513",
"fromAmount": "999900000000000000",
"feeCosts": [],
"gasCosts": []
}
}'

Example Response

{
"id": "bf35012e-bac0-421b-9d85-23b058610f8f",
"type": "bridge",
"tool": "across",
"toolDetails": null,
"action": {
"fromChainId": "1",
"toChainId": "42161",
"fromToken": {
"address": "0x0000000000000000000000000000000000000000",
"chainId": "1",
"symbol": "ETH",
"decimals": 18,
"name": "ETH"
},
"toToken": {
"address": "0x0000000000000000000000000000000000000000",
"chainId": "42161",
"symbol": "ETH",
"decimals": 18,
"name": "ETH"
},
"fromAmount": "999900000000000000",
"slippage": 0.03,
"fromAddress": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"toAddress": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"
},
"estimate": {
"tool": "across",
"toAmountMin": "999819035819119513",
"toAmount": "999819035819119513",
"fromAmount": "999900000000000000",
"feeCosts": [],
"gasCosts": [
{
"type": "SEND",
"price": "20000000000",
"estimate": "73356",
"limit": "110034",
"amount": "1467120000000000",
"token": {
"address": "0x0000000000000000000000000000000000000000",
"chainId": "1",
"symbol": "ETH",
"decimals": 18,
"name": "Ethereum"
}
}
]
},
"includedSteps": null,
"transactionRequest": {
"from": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"to": "0x5c7BCd6E7De5423a257D81B442095A1a6ced35C5",
"chainId": "1",
"data": "0x7b939232000000000000000000000000...",
"value": "999900000000000000",
"gasPrice": null,
"gasLimit": "73356"
},
"execution": null
}

Code Examples

JavaScript (fetch)

interface StepTransactionPayload {
id: string;
type: string;
tool: string;
action: Record<string, unknown>;
estimate: Record<string, unknown>;
}

async function createStepTransaction(payload: StepTransactionPayload) {
const url =
'https://xplore.api.v2.routerprotocol.com/v1/advanced/stepTransaction' +
'?senderAddress=0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045' +
'&recipientAddress=0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045';

const res = await fetch(url, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-API-Key': 'your-api-key-here',
},
body: JSON.stringify(payload),
});

if (!res.ok) {
throw new Error(`Request failed: ${res.status}`);
}

return res.json();
}

Python (requests)

import requests

def create_step_transaction(payload, sender, recipient, api_key=None):
params = {
'senderAddress': sender,
'recipientAddress': recipient,
}

headers = {'Content-Type': 'application/json'}
if api_key:
headers['X-API-Key'] = api_key

response = requests.post(
'https://xplore.api.v2.routerprotocol.com/v1/advanced/stepTransaction',
params=params,
json=payload,
headers=headers,
timeout=30,
)
response.raise_for_status()
return response.json()