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


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

    res = compass_api.smart_account.smart_account_batched_user_operations(chain=models.BatchedUserOperationsRequestChain.ARBITRUM, sender="0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B", operations=[
        models.UserOperation(
            body=models.SetAllowanceParams(
                token="USDC",
                contract=models.SetAllowanceParamsContractEnum.UNISWAP_V3_ROUTER,
                amount="1000",
            ),
        ),
    ], estimate_gas=True)

    # Handle response
    print(res)
{
  "operations": [
    {
      "to": "<string>",
      "data": "<string>",
      "value": "<string>"
    }
  ]
}

Authorizations

x-api-key
string
header
required

Your Compass API Key. Get your key here.

Body

application/json

Request model for batching user operations.

Used for smart account batching and 5792 batching.

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

The address of the transaction sender.

Examples:

"0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B"

operations
UserOperation · object[]
required

List of possible user operations

Examples:
{
"body": {
"action_type": "SET_ALLOWANCE",
"amount": "1000",
"contract": "UniswapV3Router",
"token": "USDC"
}
}
estimate_gas
boolean
default:true

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

Response

Successful Response

operations
UserOperationResponse · object[]
required

List of user operations to be batched and executed by the smart account.