Skip to main content
POST
/
v1
/
transaction_bundler
/
authorization
Python (SDK)
from compass_api_sdk import CompassAPI, models


with CompassAPI(
    api_key_auth="<YOUR_API_KEY_HERE>",
) as compass_api:

    res = compass_api.transaction_bundler.transaction_bundler_authorization(chain=models.MulticallAuthorizationRequestChain.ARBITRUM, sender="0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B")

    # Handle response
    print(res)
import { CompassApiSDK } from "@compass-labs/api-sdk";

const compassApiSDK = new CompassApiSDK({
apiKeyAuth: "<YOUR_API_KEY_HERE>",
});

async function run() {
const result = await compassApiSDK.transactionBundler.transactionBundlerAuthorization({
chain: "arbitrum",
sender: "0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B",
});

console.log(result);
}

run();
curl --request POST \
--url https://api.compasslabs.ai/v1/transaction_bundler/authorization \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"chain": "arbitrum",
"sender": "0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B"
}
'
const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({chain: 'arbitrum', sender: '0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B'})
};

fetch('https://api.compasslabs.ai/v1/transaction_bundler/authorization', 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.compasslabs.ai/v1/transaction_bundler/authorization",
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([
'chain' => 'arbitrum',
'sender' => '0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);

$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.compasslabs.ai/v1/transaction_bundler/authorization"

payload := strings.NewReader("{\n \"chain\": \"arbitrum\",\n \"sender\": \"0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B\"\n}")

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

req.Header.Add("x-api-key", "<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.compasslabs.ai/v1/transaction_bundler/authorization")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"chain\": \"arbitrum\",\n \"sender\": \"0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.compasslabs.ai/v1/transaction_bundler/authorization")

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

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

response = http.request(request)
puts response.read_body
{
  "nonce": 123,
  "address": "<string>",
  "chainId": 123
}
{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}

Authorizations

x-api-key
string
header
required

Your Compass API Key. Get your key here.

Body

application/json

Request model for getting a multicall authorization.

This model is used to authorize a sender address to perform multicall operations, allowing it to call multiple functions on multiple contracts in a single transaction.

chain
enum<string>
default:arbitrum
required
Available options:
arbitrum,
base,
ethereum
Example:

"arbitrum"

sender
string
default:0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B
required

The Ethereum address to use for authorization

Example:

"0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B"

Response

Successful Response

Response model for multicall authorization.

nonce
integer
required

A unique nonce value for this authorization

Example:

12345

address
string
required

The Ethereum address authorized for multicall

chainId
integer
required

The chain ID for the blockchain network

Example:

1