(smart_account)
- smart_account_batched_user_operations - Get Smart Account Batched User Operations
Generate a list of user operations for smart account batching.
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)| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
chain |
models.BatchedUserOperationsRequestChain | ✔️ | N/A | |
sender |
str | ✔️ | The address of the transaction sender. | 0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B |
operations |
List[models.UserOperation] | ✔️ | List of possible user operations | { "body": { "action_type": "SET_ALLOWANCE", "amount": "1000", "contract": "UniswapV3Router", "token": "USDC" } } |
estimate_gas |
Optional[bool] | ➖ | Determines whether to estimate gas costs for transactions, also verifying that the transaction can be successfully executed. | |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
models.BatchedUserOperationsResponse
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.HTTPValidationError | 422 | application/json |
| errors.APIError | 4XX, 5XX | */* |