@sevenlinelabs/aa-wallet-client
v0.6.1
Published
[TEST] Account Abstraction wallet client for AAWallet API integration
Readme
@sevenlinelabs/aa-wallet-client
WARNING: This is a TEST package. Not intended for production use.
Account Abstraction wallet client for AAWallet API integration.
Installation
npm install @sevenlinelabs/aa-wallet-clientFeatures
- AA account creation and management
- UserOperation preparation and submission
- Paymaster integration for gas sponsorship
- Contract address caching
- Framework-agnostic core module
- NestJS integration (optional)
Usage
Core (Framework-agnostic)
import { AAWalletClient } from '@sevenlinelabs/aa-wallet-client';
const client = new AAWalletClient({
baseUrl: 'https://aa-wallet-api.example.com',
apiKey: 'your-api-key',
});
// Create AA account
const account = await client.createAccount({
chainId: 31337,
ownerAddress: '0x...',
salt: '0x...',
});
// Prepare UserOperation
const userOp = await client.prepareUserOp({
chainId: 31337,
sender: account.address,
callData: '0x...',
});
// Submit UserOperation
const result = await client.submitUserOp({
chainId: 31337,
userOp,
signature: '0x...',
});With Facade (Simplified API)
import { AAWalletFacade } from '@sevenlinelabs/aa-wallet-client';
const facade = new AAWalletFacade({
baseUrl: 'https://aa-wallet-api.example.com',
apiKey: 'your-api-key',
});
// Execute contract call via AA
const txHash = await facade.execute({
chainId: 31337,
sender: '0x...',
to: '0x...',
data: '0x...',
signature: '0x...',
});NestJS Integration
import { AAClientModule } from '@sevenlinelabs/aa-wallet-client/nestjs';
@Module({
imports: [
AAClientModule.forRoot({
baseUrl: 'https://aa-wallet-api.example.com',
apiKey: 'your-api-key',
}),
],
})
export class AppModule {}
// Inject services
@Injectable()
export class MyService {
constructor(
private readonly aaWalletClient: AAWalletClientService,
private readonly aaWalletFacade: AAWalletFacade,
) {}
}Exports
| Path | Description |
|------|-------------|
| @sevenlinelabs/aa-wallet-client | Core classes and utilities |
| @sevenlinelabs/aa-wallet-client/nestjs | NestJS module and services |
Requirements
- Node.js >= 18.0.0
Dependencies
ethers^6.0.0
License
MIT
