curl --request POST \
--url https://api.privy.io/v1/wallets/{wallet_id}/rpc \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--header 'privy-app-id: <privy-app-id>' \
--data '{
"method": "eth_signUserOperation",
"params": {
"contract": "0x69007702764179f14F51cdce752f4f775d74E139",
"user_operation": {
"sender": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"nonce": "0x0",
"call_data": "0x",
"call_gas_limit": "0x30d40",
"verification_gas_limit": "0x30d40",
"pre_verification_gas": "0x5208",
"max_fee_per_gas": "0xf4240",
"max_priority_fee_per_gas": "0xf4240",
"paymaster": "0x0000000000000000000000000000000000000000",
"paymaster_data": "0x",
"paymaster_verification_gas_limit": "0x0",
"paymaster_post_op_gas_limit": "0x0"
},
"chain_id": "11155111"
}
}'
{
"method": "eth_signUserOperation",
"data": {
"signature": "0x1754782aea15e96189c3a85a7b7ac2f6339f6f4f3b29b1d3200a4c9907ef53e4776a84387583896b0a074cbc6de1a1c2a1eb53aba199da6ada8c99b0266171c41b",
"encoding": "hex"
}
}
Ethereum
eth_signUserOperation
Sign a user operation using the eth_signUserOperation method.
POST
/
v1
/
wallets
/
{wallet_id}
/
rpc
curl --request POST \
--url https://api.privy.io/v1/wallets/{wallet_id}/rpc \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--header 'privy-app-id: <privy-app-id>' \
--data '{
"method": "eth_signUserOperation",
"params": {
"contract": "0x69007702764179f14F51cdce752f4f775d74E139",
"user_operation": {
"sender": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"nonce": "0x0",
"call_data": "0x",
"call_gas_limit": "0x30d40",
"verification_gas_limit": "0x30d40",
"pre_verification_gas": "0x5208",
"max_fee_per_gas": "0xf4240",
"max_priority_fee_per_gas": "0xf4240",
"paymaster": "0x0000000000000000000000000000000000000000",
"paymaster_data": "0x",
"paymaster_verification_gas_limit": "0x0",
"paymaster_post_op_gas_limit": "0x0"
},
"chain_id": "11155111"
}
}'
{
"method": "eth_signUserOperation",
"data": {
"signature": "0x1754782aea15e96189c3a85a7b7ac2f6339f6f4f3b29b1d3200a4c9907ef53e4776a84387583896b0a074cbc6de1a1c2a1eb53aba199da6ada8c99b0266171c41b",
"encoding": "hex"
}
}
This method is currently only supported for these smart contract addresses:
0x69007702764179f14F51cdce752f4f775d74E139, 0x00000000000002377B26b1EdA7b0BC371C60DD4f,
0xd6CEDDe84be40893d153Be9d467CD6aD37875b28, and 0x63c0c19a282a1B52b07dD5a65b58948A07DAE32B.Idempotency on errors: On 4xx or 5xx, Privy caches the response and replays it for the same
key. Generate a new key to retry after a server error. Policy violations are an exception and
allow same-key retries.
curl --request POST \
--url https://api.privy.io/v1/wallets/{wallet_id}/rpc \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--header 'privy-app-id: <privy-app-id>' \
--data '{
"method": "eth_signUserOperation",
"params": {
"contract": "0x69007702764179f14F51cdce752f4f775d74E139",
"user_operation": {
"sender": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"nonce": "0x0",
"call_data": "0x",
"call_gas_limit": "0x30d40",
"verification_gas_limit": "0x30d40",
"pre_verification_gas": "0x5208",
"max_fee_per_gas": "0xf4240",
"max_priority_fee_per_gas": "0xf4240",
"paymaster": "0x0000000000000000000000000000000000000000",
"paymaster_data": "0x",
"paymaster_verification_gas_limit": "0x0",
"paymaster_post_op_gas_limit": "0x0"
},
"chain_id": "11155111"
}
}'
{
"method": "eth_signUserOperation",
"data": {
"signature": "0x1754782aea15e96189c3a85a7b7ac2f6339f6f4f3b29b1d3200a4c9907ef53e4776a84387583896b0a074cbc6de1a1c2a1eb53aba199da6ada8c99b0266171c41b",
"encoding": "hex"
}
}
Headers
string
required
ID of your Privy app.
string
Request authorization signature. If multiple signatures are required, they should be comma
separated.
string
Request expiry. Value is a Unix timestamp in milliseconds representing the deadline by which the
request must be processed.
Path Parameters
string
required
ID of the wallet to get.
Body
string
required
Available options:
eth_signUserOperationobject
required
Hide child attributes
Hide child attributes
string
required
The smart contract address for the user operation. Currently supports
0x69007702764179f14F51cdce752f4f775d74E139, 0x00000000000002377B26b1EdA7b0BC371C60DD4f,
0xd6CEDDe84be40893d153Be9d467CD6aD37875b28, and
0x63c0c19a282a1B52b07dD5a65b58948A07DAE32B.object
required
Hide child attributes
Hide child attributes
string
required
The account making the operation.
string
required
Anti-replay parameter; also used as the salt for first-time account creation.
string
The account factory address, if deploying a new account.
string
Additional data for the account factory.
string
required
The data to pass to the sender during the main execution call.
string
required
The amount of gas to allocate the main execution call.
string
required
The amount of gas to allocate for the verification step.
string
required
Extra gas to pay the bundler.
string
required
Maximum fee per gas (similar to EIP-1559 max_fee_per_gas).
string
required
Maximum priority fee per gas (similar to EIP-1559 max_priority_fee_per_gas).
string
Address of paymaster sponsoring the transaction, zero for self-sponsored.
string
Extra data to send to the paymaster.
string
The amount of gas to allocate for the paymaster validation code.
string
The amount of gas to allocate for the paymaster post-operation code.
string
required
The chain ID for the user operation.
Response
enum<string>
required
Available options:
eth_signUserOperationWas this page helpful?

