Api reference
Execute Operation
Execute operations with human-readable parameters.
Execute operations with human-readable parameters.
Endpoint
POST /executeDescription
Executes operations on Account Abstraction wallets using human-readable parameters. This endpoint handles the encoding and execution of UserOperations automatically.
Request Body
{
"operations": [
{
"wallet": "0x28097eF2268B553783D9c32A33ECb1bB78B209F3",
"walletCustody": 2,
"to": "0xB72F28d9c0f72d488813E57581C17C466855E1F7",
"funcSignature": "transfer(address,uint256)",
"funcParams": ["0x106eB473f541E9485bB428aeC502c2FEa1467779", "1000000000000000000"],
"value": "0",
"validAfter": 1718733600,
"validUnitl": 1718733700
}
],
"settings": {
"rpc": "https://polygon-amoy.infura.io/v3/{key}",
"entryPoint": "0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789",
"signer": {
"clientId": "your-fireblocks-client-id",
"versionId": "1"
},
"factory": "0xA61de0370Cd362FE335F5B9957d2a4edE0b8E98A",
"paymaster": "0x8D120E0A8a6aB93442B9839a7D6854De874A93fd"
}
}Request Parameters
operations (array, required)
Array of operations to execute.
wallet(string, optional): The wallet address. Required ifsaltis empty.salt(string, optional): The salt to identify the wallet. Required ifwalletis empty.walletCustody(integer, required): The wallet custody classification (0-5)to(string, required): The contract address for the execute operationfuncSignature(string, required): The function signature for the executionfuncParams(array, optional): The params for the function signaturevalue(string, optional): The value to be sent with the transactionvalidAfter(integer, optional): The amount of time that the transaction validation starts being availablevalidUnitl(integer, optional): The amount of time that the transaction is valid fordependsOn(integer, optional): The index of a transaction that has to succeed before executing this index
settings (object, required)
Configuration settings for execution.
rpc(string, required): The RPC endpoint for the chainentryPoint(string, required): The entry point address on the provided chainsigner(object, required): Signer configuration (HSM or MPC)factory(string, optional): The factory address on the provided chainpaymaster(string, optional): The paymaster address on the provided chainaggregator(string, optional): The aggregator address on the provided chainpercentTxGasOvershoot(integer, optional): The amount of gas overshoot (in percent). Default is 50.percentTxGasPriceOvershoot(string, optional): The amount of gas price overshoot (in percent)
Response
{
"status": 1,
"txHash": "0x066a0269a55aa42498da9993f01b9bfc82517330669c240807ed1b94b2acd938",
"cumulativeGasUsed": 17033026,
"gasUsed": 34111,
"effectiveGasPrice": "1136849215",
"returnData": [],
"logs": []
}Response Fields
status(integer): The status code (0 - failed, 1 - success, 4 - operations partially executed)txHash(string): The transaction hashcumulativeGasUsed(integer): The cumulative gas usedgasUsed(integer): The gas usedeffectiveGasPrice(string): The effective gas pricereturnData(array): The return data of the transactionlogs(array): The logs of the transaction
Example Request
curl -X POST https://api.msa.omnes.tech/execute \
-H "Content-Type: application/json" \
-d '{
"operations": [
{
"wallet": "0x28097eF2268B553783D9c32A33ECb1bB78B209F3",
"walletCustody": 2,
"to": "0xB72F28d9c0f72d488813E57581C17C466855E1F7",
"funcSignature": "transfer(address,uint256)",
"funcParams": ["0x106eB473f541E9485bB428aeC502c2FEa1467779", "1000000000000000000"]
}
],
"settings": {
"rpc": "https://polygon-amoy.infura.io/v3/{key}",
"entryPoint": "0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789",
"signer": {
"clientId": "your-fireblocks-client-id",
"versionId": "1"
}
}
}'const response = await fetch('https://api.msa.omnes.tech/execute', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
operations: [
{
wallet: '0x28097eF2268B553783D9c32A33ECb1bB78B209F3',
walletCustody: 2,
to: '0xB72F28d9c0f72d488813E57581C17C466855E1F7',
funcSignature: 'transfer(address,uint256)',
funcParams: ['0x106eB473f541E9485bB428aeC502c2FEa1467779', '1000000000000000000'],
},
],
settings: {
rpc: 'https://polygon-amoy.infura.io/v3/{key}',
entryPoint: '0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789',
signer: {
clientId: 'your-fireblocks-client-id',
versionId: '1',
},
},
}),
});
const result = await response.json();
console.log('Transaction hash:', result.txHash);import requests
url = "https://api.msa.omnes.tech/execute"
payload = {
"operations": [
{
"wallet": "0x28097eF2268B553783D9c32A33ECb1bB78B209F3",
"walletCustody": 2,
"to": "0xB72F28d9c0f72d488813E57581C17C466855E1F7",
"funcSignature": "transfer(address,uint256)",
"funcParams": ["0x106eB473f541E9485bB428aeC502c2FEa1467779", "1000000000000000000"]
}
],
"settings": {
"rpc": "https://polygon-amoy.infura.io/v3/{key}",
"entryPoint": "0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789",
"signer": {
"clientId": "your-fireblocks-client-id",
"versionId": "1"
}
}
}
response = requests.post(url, json=payload)
result = response.json()
print(f"Transaction hash: {result['txHash']}")Error Responses
400 Bad Request
Invalid request parameters.
{
"error": "invalid function signature"
}422 Unprocessable Entity
Request valid but execution failed.
{
"error": "insufficient funds"
}Use Cases
- Token transfers: Send ERC-20 tokens between wallets
- Smart contract interactions: Call any smart contract function
- Batch operations: Execute multiple operations in a single transaction
- Gas optimization: Leverage Account Abstraction for efficient gas usage
Best Practices
- Estimate gas first: Use the estimate gas endpoint before execution
- Validate parameters: Ensure function signatures and parameters are correct
- Handle partial execution: Check status codes for partial execution scenarios
- Monitor gas costs: Track gas usage for optimization
- Use paymasters: Consider using paymasters for gasless transactions
Related Endpoints
- Estimate Gas - Estimate gas costs before execution
- Execute Encoded - Execute pre-encoded UserOperations
- Get Receipt - Get transaction receipts
✅ Success: This endpoint automatically handles UserOperation encoding, gas estimation, and execution. Perfect for developers who want simplicity.
💡 Pro Tip: For advanced use cases requiring more control, use the estimate gas endpoint first, then execute encoded for fine-tuned gas management.