Skip to main content
POST
/
v1
/
execute
Get transaction data for execution
curl --request POST \
  --url https://api.hypermid.io/v1/execute \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "fromChain": 123,
  "fromToken": "<string>",
  "fromAmount": "<string>",
  "toChain": 123,
  "toToken": "<string>",
  "fromAddress": "<string>",
  "toAddress": "<string>",
  "refundAddress": "<string>",
  "slippage": 123
}
'
{
  "data": {
    "transactionRequest": {
      "to": "0xContractAddress",
      "data": "0x2646478b...",
      "value": "1000000000000000000",
      "gasLimit": "350000",
      "chainId": 1
    },
    "estimate": {
      "fromAmount": "1000000000000000000",
      "fromAmountUSD": "3250.00",
      "toAmount": "3237500000",
      "toAmountUSD": "3237.50",
      "executionDuration": 120
    }
  }
}
Returns the transaction data for a swap. Sign it with the user’s wallet and broadcast it.
fromChain
number
required
Source chain ID (e.g., 1 for Ethereum, 8453 for Base, 369 for PulseChain).
toChain
number
required
Destination chain ID.
fromToken
string
required
Source token contract address. Use 0x0000000000000000000000000000000000000000 for native tokens (ETH, PLS, etc.).
toToken
string
required
Destination token contract address.
fromAmount
string
required
Amount in the smallest unit (e.g., wei). Must be a string to handle large numbers.
fromAddress
string
required
Sender wallet address.
toAddress
string
required
Recipient wallet address on the destination chain.
slippage
number
Maximum slippage as a decimal (e.g., 0.03 for 3%). Default: 0.03.
tool
string
Specific routing tool. Omit to let Hypermid choose the best automatically.
depositMode
string
Set to "manual" to force manual deposit flow for non-EVM chains.

Response Types

The response has one of two shapes depending on the route:

Transaction Request (most swaps)

Sign it and broadcast.
const tx = await wallet.sendTransaction(exec.data.transactionRequest);

Deposit Address (XRP, Dogecoin, Stellar, etc.)

Show the address to the user. They send tokens from their native wallet.
console.log("Send to:", exec.data.depositAddress);
console.log("Memo:", exec.data.memo); // Required for XRP, Stellar
Track deposit-based swaps with GET /v1/execute/deposit/status.
Some PulseChain routes require a confirmation step after the transaction. If the quote response includes afterStep1, see Register — Inbound Receiver.
{
  "data": {
    "transactionRequest": {
      "to": "0xContractAddress",
      "data": "0x2646478b...",
      "value": "1000000000000000000",
      "gasLimit": "350000",
      "chainId": 1
    },
    "estimate": {
      "fromAmount": "1000000000000000000",
      "fromAmountUSD": "3250.00",
      "toAmount": "3237500000",
      "toAmountUSD": "3237.50",
      "executionDuration": 120
    }
  }
}
const exec = await client.execute({
  fromChain: 1,
  toChain: 42161,
  fromToken: "0x0000000000000000000000000000000000000000",
  toToken: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
  fromAmount: "1000000000000000000",
  fromAddress: "0xYourAddress",
  toAddress: "0xYourAddress",
  slippage: 0.03,
});

if (exec.data.transactionRequest) {
  const tx = await wallet.sendTransaction(exec.data.transactionRequest);
  console.log("Tx hash:", tx.hash);
} else if (exec.data.depositAddress) {
  console.log("Send to:", exec.data.depositAddress);
  if (exec.data.memo) console.log("Memo:", exec.data.memo);
}
Transaction data is time-sensitive. Sign and broadcast within a few minutes — prices and gas estimates change.

Authorizations

X-API-Key
string
header
required

Partner API key. Optional for public endpoints, required for /v1/partner/*.

Body

application/json
fromChain
integer
required

Source chain ID

fromToken
string
required

Source token address

fromAmount
string
required

Amount in base units

toChain
integer
required

Destination chain ID

toToken
string
required

Destination token address

fromAddress
string
required

Sender wallet address

toAddress
string
required

Recipient wallet address

refundAddress
string

Refund address (defaults to fromAddress)

slippage
number

Slippage tolerance (decimal or bps)

Response

Execution data with deposit address

data
object
required

Response payload (null on error)

error
object
required
meta
object
required