Skip to main content
POST
/
exchanges
/
multi
/
{multiId}
/
tx
/
build
Build multi exchange batch transaction data
curl --request POST \
  --url https://api-partner.houdiniswap.com/v2/exchanges/multi/{multiId}/tx/build \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "sender": "<string>",
  "houdiniIds": [
    "<string>"
  ]
}
'
import requests

url = "https://api-partner.houdiniswap.com/v2/exchanges/multi/{multiId}/tx/build"

payload = {
"sender": "<string>",
"houdiniIds": ["<string>"]
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({sender: '<string>', houdiniIds: ['<string>']})
};

fetch('https://api-partner.houdiniswap.com/v2/exchanges/multi/{multiId}/tx/build', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api-partner.houdiniswap.com/v2/exchanges/multi/{multiId}/tx/build",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'sender' => '<string>',
'houdiniIds' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://api-partner.houdiniswap.com/v2/exchanges/multi/{multiId}/tx/build"

payload := strings.NewReader("{\n \"sender\": \"<string>\",\n \"houdiniIds\": [\n \"<string>\"\n ]\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://api-partner.houdiniswap.com/v2/exchanges/multi/{multiId}/tx/build")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"sender\": \"<string>\",\n \"houdiniIds\": [\n \"<string>\"\n ]\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api-partner.houdiniswap.com/v2/exchanges/multi/{multiId}/tx/build")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"sender\": \"<string>\",\n \"houdiniIds\": [\n \"<string>\"\n ]\n}"

response = http.request(request)
puts response.read_body
{
  "multiId": "<string>",
  "chain": "<string>",
  "transactions": [
    {
      "houdiniIds": [
        "<string>"
      ],
      "txData": {
        "userOpHash": "<string>",
        "to": "<string>",
        "data": "<string>",
        "value": "<string>",
        "chainId": 123,
        "tokenAmount": "<string>"
      }
    }
  ],
  "depositNeeded": "<string>",
  "saCurrentBalance": "<string>"
}
{
"message": "<string>",
"code": "<string>",
"requestId": "<string>"
}
{
"message": "<string>",
"code": "<string>",
"requestId": "<string>"
}
{
"message": "<string>",
"code": "<string>",
"fields": {},
"requestId": "<string>"
}
{
"message": "<string>",
"code": "<string>",
"requestId": "<string>"
}

Authorizations

Authorization
string
header
required

Path Parameters

multiId
string
required

The multi exchange group ID

Maximum string length: 64

Body

application/json

Request body for POST /exchanges/multi/{multiId}/tx/build

sender
string
required

Wallet address that will sign and fund the transaction(s)

houdiniIds
string[]

Optional subset of orders to build for; defaults to all orders in the group

Maximum array length: 50

Response

Success

multiId
string
required
chain
string
required

Chain kind of the from token (e.g. "solana", "evm")

transactions
object[]
required
depositNeeded
string

How much more native ETH (wei) the SA needs before submission; "0" means already funded

saCurrentBalance
string

Current SA native balance in wei