Skip to content

getUserOperationGasPrice

Return the gas price that Pimlico's bundler will accept for the User Operation.

Usage

example.ts
import { pimlicoClient } from "./client"
 
const smartAccountClient = createSmartAccountClient({
	account,
	chain: sepolia,
	bundlerTransport: http(pimlicoUrl),
	paymaster: pimlicoClient,
	userOperation: {
		estimateFeesPerGas: async () => {
			return (await pimlicoClient.getUserOperationGasPrice()).fast
		},
	}
})
 
/* other gas alternatives */
const gasPriceResult = await pimlicoClient.getUserOperationGasPrice()
/**
 * {
    "slow": {
        "maxFeePerGas": 3267781404n,
        "maxPriorityFeePerGas": 3267781404n
    },
    "standard": {
        "maxFeePerGas": 3439769899n,
        "maxPriorityFeePerGas": 3439769899n
    },
    "fast": {
        "maxFeePerGas": 3620810421n,
        "maxPriorityFeePerGas": 3620810421n
    }
   }
 */

Returns

  • Type: GetUserOperationGasPriceReturnType

The maxFeePerGas and maxPriorityFeePerGas values for the different gas price tiers. Choosing a faster gas price will mean faster inclusion by the Pimlico Bundler.

JSON-RPC Method

pimlico_getUserOperationGasPrice