Winks SDK (rootstock)
A React/Next.js SDK for building on Rootstock with wallet integration, token/NFT utilities, signature management, and RPC Management
Features
🚀 Easy Integration: drop-in
Winkswrapper for Next.js🔑 API-keyed metadata management (server included)
📱 Social meta: Open Graph, Twitter Cards
🎯 Full SEO meta coverage
💰 Token utilities: ERC-20 transfer/approve/balance/allowance
🎨 NFT utilities: ERC-721 owner, ERC-721/1155 transfers, ERC-1155 balance
🔗 Rootstock ready (Testnet 31) — SDK defaults to Testnet in the example app
🌐 Wallet integration via RainbowKit + WalletConnect (styles auto-injected)
✍️ Signature management (tx/message/personal/typed data)
🔄 Network switching helpers
🧭 RPC Management with health checks and latency-based selection
🧩 EIP-1193 Provider adapter
🧯 Signature queueing to avoid overlapping prompts
🛠️ Dual builds (Rollup + Vite) outputting CJS + ESM
✅ Testing setup (Jest unit, Playwright E2E)
Installation
Quick Start (Next.js)
Create an API key:
WalletConnect project ID (RainbowKit)
RainbowKit requires a WalletConnect project ID. Set it in your app (for the example app, create example/.env.local):
Winks Component
Props:
apikey: stringrequiredchildren: ReactNoderequiredfallback?: MetaData(used if server fetch fails)
MetaData shape:
Network Configuration
Rootstock Mainnet: Chain ID 30, RPC
https://public-node.rsk.co, Explorerhttps://explorer.rootstock.io, Currency RBTCRootstock Testnet: Chain ID 31, RPC
https://public-node.testnet.rsk.co, Explorerhttps://explorer.testnet.rootstock.io, Currency tRBTC
Server API
GET /healthPOST /api/keys→{ id, key, name, createdAt, isActive }GET /api/keys(auth)DELETE /api/keys/:key(auth)GET /api/meta/:apiKey→ returnsMetaDataPOST /api/meta/:apiKey(auth){ metadata: MetaData }PUT /api/meta/:apiKey(auth){ metadata: MetaData }DELETE /api/meta/:apiKey(auth)
Auth header: X-API-Key: {apiKey}
Development
Build
Testing
License
MIT
Contributing
Fork the repository
Create a feature branch:
git checkout -b feature/amazing-featureCommit your changes:
git commit -m 'Add some amazing feature'Push:
git push origin feature/amazing-featureOpen a Pull Request
Last updated