Skip to main content
POST
/
v1
/
transaction_bundler
/
execute
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_execute(chain=models.MulticallExecuteRequestChain.ETHEREUM, sender="0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B", actions=[
        models.UserOperation(
            body=models.SetAllowanceParams(
                token="WETH",
                contract=models.SetAllowanceParamsContractEnum.UNISWAP_V3_ROUTER,
                amount="1000",
            ),
        ),
    ], estimate_gas=True, signed_authorization={
        "nonce": 1000,
        "address": "0xcA11bde05977b3631167028862bE2a173976CA11",
        "chain_id": 42161,
        "r": "0x5f9f3f3226ac91bc01a72dd117141f6c6de1ed30d3af9f95c3423316dc21d615",
        "s": "0x78f7982ede9dabc53d7153974c5692fda8a21fc73bdafc42aaf135505e22817c",
        "y_parity": 0,
    })

    # Handle response
    print(res)
{
  "transaction": {
    "chainId": "<string>",
    "data": "<string>",
    "from": "<string>",
    "gas": "<string>",
    "to": "<string>",
    "value": "<string>",
    "nonce": "<string>",
    "maxFeePerGas": "<string>",
    "maxPriorityFeePerGas": "<string>",
    "authorizationList": []
  }
}

Authorizations

x-api-key
string
header
required

Your Compass API Key. Get your key here.

Body

application/json

Request model for executing a multicall.

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

The address of the transaction sender.

Examples:

"0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B"

actions
UserOperation · object[]
required

List of possible actions for multicall

Examples:
{
"body": {
"action_type": "SET_ALLOWANCE",
"amount": "1000",
"contract": "UniswapV3Router",
"token": "WETH"
}
}
{
"body": {
"action_type": "UNISWAP_BUY_EXACTLY",
"amount_out": "1000",
"fee": "0.01",
"max_slippage_percent": 0.5,
"token_in": "WETH",
"token_out": "USDC"
}
}
{
"body": {
"action_type": "SET_ALLOWANCE",
"amount": "1000",
"contract": "AaveV3Pool",
"token": "USDC"
}
}
{
"body": {
"action_type": "SET_ALLOWANCE",
"amount": "0.1",
"contract": "AaveV3Pool",
"token": "WETH"
}
}
{
"body": {
"action_type": "AAVE_SUPPLY",
"amount": "1000",
"token": "USDC"
}
}
{
"body": {
"action_type": "AAVE_BORROW",
"amount": "0.1",
"interest_rate_mode": "variable",
"token": "USDC"
}
}
estimate_gas
boolean
default:true

Determines whether to estimate gas costs for transactions, also verifying that the transaction can be successfully executed.

signed_authorization
object | null

EIP-7702 authorization

Examples:
{
"address": "0xcA11bde05977b3631167028862bE2a173976CA11",
"chainId": 42161,
"nonce": 1000,
"r": "0x5f9f3f3226ac91bc01a72dd117141f6c6de1ed30d3af9f95c3423316dc21d615",
"s": "0x78f7982ede9dabc53d7153974c5692fda8a21fc73bdafc42aaf135505e22817c",
"yParity": 0
}

Response

Successful Response

transaction
object
required

The unsigned multicall transaction data. User must sign and broadcast to network.