Smart Account Integration
The embedded wallet gives users a KMS-backed EOA. Combined with ERC-4337, that EOA becomes the owner of a smart contract account — one that can send transactions without gas.
OxGasClient handles all of this. It ties together authentication, signer wiring, and smart account creation so you don’t have to manage each piece separately.
The two-layer model
Section titled “The two-layer model”Every user who logs in gets two addresses:
- EOA (Externally Owned Account) — the address backed by AWS KMS. This is what
auth.getAddress()returns. It holds no funds in normal use. - Smart Account — a deployed (or counterfactually deployed) ERC-4337 contract, owned by the EOA above. This is the address that holds tokens and sends transactions.
The smart account address is deterministic. Given the same EOA, the same account index, and the same chain, the address will always be the same — even before the contract is deployed on-chain.
Why smart accounts?
Section titled “Why smart accounts?”Smart accounts can pay transaction fees in ERC-20 tokens, have transactions sponsored by a paymaster, and batch multiple calls into one. With the 0xGasless paymaster, all of this is set up for you — the user never touches ETH to pay gas.
Next steps
Section titled “Next steps”- Setup — how to call
setupSmartAccount() - Send a Transaction —
sendTransaction()and batch calls - Token Operations — balances and ERC-20 transfers