Direct Integration of SBC Paymaster and Bundler
Overview
For developers who prefer direct integration without using the SBC AppKit, you can interact directly with our Account Abstraction API endpoints. This approach gives you complete control over UserOperation creation and submission while leveraging SBC's custom paymaster and bundler infrastructure.
Prerequisites
- API Key: Get your API key from the SBC Dashboard
- Network: Currently supports Base and Base Sepolia testnet
- Smart Account: You'll need a smart account implementation (we recommend Kernel from ZeroDev)
Paymaster URLs
Replace YOUR_SBC_API_KEY with your actual API Key
- Base Sepolia (Testnet):
https://api.aa.stablecoin.xyz/rpc/v1/baseSepolia/YOUR_SBC_API_KEY
- Base (Mainnet):
https://api.aa.stablecoin.xyz/rpc/v1/base/YOUR_SBC_API_KEY
Basic Usage
Use your chain-specific Account Abstraction (AA) URL as both your Bundler and Paymaster URL.
Configuration
Here's the basic integration using the SBC AA URL, with SimpleAccount, using viem and permissionless:
index.ts
import { Address, Hex } from 'viem';
import { smartAccountClient } from './client'
// Example: Send a transaction
const userOpHash = await smartAccountClient.sendUserOperation({
calls: [
{
to: "0x742d35Cc6641C4532B4d4c7B4C0D1C3d4e5f6789" as Address,
data: "0x" as Hex, // For ETH transfer
value: 1000000000000000000n, // 1 ETH
}
]
});
// Wait for the transaction to be included
const receipt = await smartAccountClient.waitForUserOperationReceipt({
hash: userOpHash,
});
console.log(`Transaction hash: ${receipt.receipt.transactionHash}`);
console.log(`User operation hash: ${receipt.userOpHash}`);
For more examples, see Smart Account Implementations.
Support
- Documentation: SBC AppKit Documentation
- Dashboard: SBC Dashboard
- Telegram: @stablecoin_xyz
Next Steps
- Learn about the SBC AppKit for easier integration
- Explore supported Smart Account Implementations
- Understand the Architecture behind our solutions