End User Flow Example
This example demonstrates how an end user sends a gasless transaction using community credit.
Steps
- Eligibility Check: Verify the user has sufficient reputation or SBTs to use community sponsorship.
- UserOperation Construction: Create a signed UserOperation targeting a dapp contract.
- Paymaster Sponsorship: Request the SuperPaymaster to sign the UserOperation for gasless execution.
Code Preview
typescript
import { createEndUserClient } from '@aastar/core';
const user = createEndUserClient({ ... });
// Send Gasless Transaction
const hash = await user.sendTransaction({
to: dappAddress,
data: callData,
communityAddress: '0x...', // Community to sponsor gas
});