Extending sponsorship duration | Pimlico Docs
Skip to content

Extending sponsorship duration

By default, verifying paymaster sponsorships are valid for 10 minutes. It’s now possible to set a custom validity period of up to 24 hours.

Use Cases

Extended sponsorship durations are helpful in several scenarios:

  1. Multi-sigs – when there may be delays in collecting signatures
  2. Scheduled transactions – For userOperations that are submitted at a later time

Important Considerations

Your offchain Pimlico balance is held as a prefund for the duration that the paymaster signature is valid for. It’s released either when your sponsored userOp is included on-chain or when the signature expires.

  • The maximum allowed duration is 24 hours (86,400 seconds).
  • ERC-20 sponsorships always have a validity period of 10 minutes.

Implementation

You can set the sponsorship duration through the validForSeconds parameter in the paymasterContext

main.ts
const userOpHash = await smartAccountClient.sendUserOperation({
 calls: [
  {
   to: "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
   value: 0n,
   data: "0x"
  },
 ],
 // sponsorship will be valid for 1 hour
 paymasterContext: { 
  validForSeconds: 3600, 
 }, 
})