Attention ETHGlobal Hackathon Participants. We have a 2000 prize and 1 $1000 prize). Add the Blockscout SDK into your app to provide interactivity and instant explorer feedback to your users.Note: The Blockscout SDK is currently in beta release. Please report any issues on the Blockscout Discord.
Overview
The Blockscout App SDK is a React toolkit designed to integrate Blockscout transaction notifications and transaction history into your decentralized applications (dApps). It provides an easy-to-use interface for displaying transaction status updates and viewing transaction history with real-time updates and mobile-responsive design.Key Features
- Transaction Toast Notifications - Real-time transaction status updates with pending, success, and error states
- Transaction History Popup - View recent transactions for specific addresses or entire chains
- Transaction Interpretation - Detailed transaction summaries and interpretations
- Multi-chain Support - Compatible with any blockchain that has a Blockscout explorer instance
- Mobile-responsive Design - Optimized for both desktop and mobile experiences
Installation
Install the SDK using npm or yarn:Transaction Toast Notifications
The transaction toast feature provides real-time notifications for transaction status updates, showing pending, success, and error states with detailed transaction information.Setup
Wrap your application with theNotificationProvider
:
Usage
Use theuseNotification
hook to display transaction toasts:
Toast Features
- Real-time status updates (pending, success, error)
- Transaction interpretation and summaries
- Links to block explorer
- Automatic status polling
- Error handling with revert reasons
Transaction History Popup
The transaction history popup allows users to view recent transactions for a specific address or all transactions on a chain.Setup
Wrap your application with theTransactionPopupProvider
:
Usage
Use theuseTransactionPopup
hook to open transaction history:
Popup Features
- View recent transactions
- Filter by address
- Transaction status indicators
- Transaction interpretation
- Links to block explorer
- Mobile-responsive design
- Loading states and error handling
Supported Chains
The SDK is compatible with any blockchain that has a Blockscout explorer instance with API v2 support.- Chains are listed in Chainscout.
- Chain IDs can be retrieved from https://github.com/blockscout/chainscout/blob/main/data/chains.json
- To verify if your target chain ID is supported, visit the compatibility checker.
Common Supported Chain IDs
-
1
- Ethereum Mainnet -
137
- Polygon Mainnet -
42161
- Arbitrum One -
10
- Optimism