Onchain Integration
Reward users for on-chain actions — token transfers, NFT mints, swaps, staking, and any smart contract event on Soneium.
How It Works
The Onchain integration uses the same reward pipeline as Discord, Telegram, and Shopify. A dedicated Contract Reader Worker polls the Soneium blockchain every minute, detects matching contract events, resolves the acting wallet to a Resonance user, and fires a reward through the existing Event Handler.
Soneium RPC (eth_getLogs)
↓
Contract Reader Worker (1-min cron)
↓
Detect matching events → Resolve wallet → Resonance user
↓
Event Handler API ← same entry point as all other integrations
↓
Credits, streaks, leaderboards, perks — same pipeline
Key Features
| Feature | Details |
|---|---|
| Chain | Soneium Mainnet (Chain ID: 1868) |
| Detection | Any EVM event log from any contract |
| Polling | Every 1 minute via Cloudflare Cron |
| Deduplication | Block cursor + tx hash + log index |
| Reorg Safety | Configurable confirmation depth (default: 3 blocks) |
| User Resolution | Matches Privy wallets and linked external wallets |
Quick Start
- Open the Partner Portal and go to the Rewards tab
- Create a new event and select "Onchain / Contract"
- Enter the contract address you want to watch
- Specify the event signature (e.g.,
Transfer(address,address,uint256)) - Choose the wallet field — which parameter contains the wallet to reward (
from,to, etc.) - Set reward amount and cooldown — same as any other event
- Save — the Contract Reader will start watching on the next cron tick
User Identification
The Contract Reader resolves on-chain wallet addresses to Resonance users by checking:
- Privy-generated wallets — wallets created via OAuth pregeneration (Discord, Telegram, etc.)
- Linked external wallets — wallets users connected via account linking
- Email-based wallets — wallets associated with email accounts
If a wallet can't be matched to a known user, the event is skipped.
Supported Event Types
Any standard EVM event log is supported. Common examples:
- Token Transfers —
Transfer(address,address,uint256) - NFT Mints —
Transfer(address,address,uint256)wherefromis0x0 - Swaps —
Swap(address,uint256,uint256,uint256,uint256,address) - Staking —
Staked(address,uint256)orDeposit(address,uint256) - Custom events — any event emitted by your contract