Introduction
A sponsored transfer packages the wallet action as a signed UserOperation for a bundler and paymaster.- Use when: users should spend wallet assets without holding native currency in their signing EOA for gas.
- For: apps with an already deployed Swig account and a compatible sponsorship provider.
How it works
- Connect the role signer to
toSwigSmartAccountwith an explicit validity window. - Connect the bundler and ERC-7677 paymaster clients.
- Send one call through the smart-account adapter; the selected role’s permissions still apply.
- Check the UserOperation’s success result and containing transaction hash.
Requirements
The current adapter requires sponsorship and does not deploy accounts inside the operation. Confirm bundler compatibility before using a hosted endpoint.
Flow
SDK example
After Environment setup, supply the chain, endpoints, role signer, and deployed account. The selected role must allow this native transfer to an EOA recipient with no code.- Size gas limits for your deployment and operation; this example uses the SDK example’s verification limit.
- Inclusion does not guarantee execution success. A failed included operation can still consume a nonce and charge the sponsor.
- Obtain fresh sponsorship and authorization when rebuilding an expired operation.
- The Viem and permissionless.js example use the same Swig adapter.
- The Rust and Python examples use a local fixture sponsor. Hosted use requires the provider’s fee and sponsorship data before signing.

