@cryptodevops/n8n-nodes-infura
v0.1.3
Published
n8n node for Infura API
Maintainers
Readme
n8n-nodes-infura
Custom n8n node for Infura JSON-RPC API integration. This node allows you to interact with Ethereum and other EVM-compatible blockchains using the standard JSON-RPC protocol through Infura's infrastructure.
Features
- JSON-RPC Operations: Full support for Ethereum JSON-RPC methods
- Multi-Network Support: Ethereum, Arbitrum, Avalanche, Base, Blast, BSC, Celo, Linea, Mantle, opBNB, Optimism, Palm, Polygon, Scroll, Sei, Starknet (mainnet and testnet)
- Account Operations: Get balance, transaction count, and code
- Block Operations: Get block information by number or hash
- Transaction Operations: Get transaction details, receipts, and send raw transactions
- Smart Contract Operations: Call contract methods and estimate gas
- Gas Operations: Get current gas price and estimate gas usage
Installation
npm install @cryptodevops/n8n-nodes-infuraConfiguration
- Get your Infura Project ID from Infura Dashboard
- In n8n, create new credentials for "Infura API"
- Enter your Project ID in the API Key field
Supported Networks
Mainnet Networks
- Ethereum Mainnet
- Arbitrum One
- Avalanche C-Chain
- Base
- Blast
- BSC (Binance Smart Chain)
- Celo
- Linea
- Mantle
- opBNB
- Optimism
- Palm
- Polygon
- Scroll
- Sei
- Starknet
Testnet Networks
- Ethereum Sepolia, Hoodi
- Arbitrum Sepolia
- Avalanche Fuji
- Base Sepolia
- Blast Sepolia
- BSC Testnet
- Celo Alfajores
- Linea Sepolia
- Mantle Sepolia
- opBNB Testnet
- Optimism Sepolia
- Palm Testnet
- Polygon Amoy
- Scroll Sepolia
- Sei Testnet
- Starknet Sepolia
Available Operations
Account Operations
- Get Balance (
eth_getBalance): Get ETH balance of an address - Get Transaction Count (
eth_getTransactionCount): Get nonce/transaction count for an address - Get Code (
eth_getCode): Get contract code at an address - Get Accounts (
eth_accounts): Get list of accounts (typically empty for Infura)
Block Operations
- Get Block Number (
eth_blockNumber): Get the latest block number - Get Block by Number (
eth_getBlockByNumber): Get block details by block number - Get Block by Hash (
eth_getBlockByHash): Get block details by block hash - Get Block Transaction Count by Hash (
eth_getBlockTransactionCountByHash): Get transaction count in a block by hash - Get Block Transaction Count by Number (
eth_getBlockTransactionCountByNumber): Get transaction count in a block by number
Transaction Operations
- Get Transaction (
eth_getTransactionByHash): Get transaction details by hash - Get Transaction Receipt (
eth_getTransactionReceipt): Get transaction receipt by hash - Get Transaction by Block Hash and Index (
eth_getTransactionByBlockHashAndIndex): Get transaction by block hash and index - Get Transaction by Block Number and Index (
eth_getTransactionByBlockNumberAndIndex): Get transaction by block number and index - Send Raw Transaction (
eth_sendRawTransaction): Broadcast a signed transaction
Smart Contract Operations
- Call Contract (
eth_call): Execute a read-only contract call - Estimate Gas (
eth_estimateGas): Estimate gas required for a transaction - Get Storage At (
eth_getStorageAt): Get storage value at a specific position - Get Logs (
eth_getLogs): Get event logs matching filter criteria
Gas and Fee Operations
- Get Gas Price (
eth_gasPrice): Get current gas price - Get Max Priority Fee Per Gas (
eth_maxPriorityFeePerGas): Get maximum priority fee per gas - Get Fee History (
eth_feeHistory): Get historical fee data
Network Information
- Get Chain ID (
eth_chainId): Get the chain ID of the network - Get Sync Status (
eth_syncing): Get synchronization status - Get Client Version (
web3_clientVersion): Get client version information - Get Network Version (
net_version): Get network version/ID
Total: 25 JSON-RPC operations supported
Usage Examples
Get ETH Balance
{
"network": "ethereum-mainnet",
"operation": "eth_getBalance",
"address": "0x742d35Cc6634C0532925a3b8D4C9db96C4b4Db45",
"blockParameter": "latest"
}Get Latest Block
{
"network": "ethereum-mainnet",
"operation": "eth_getBlockByNumber",
"blockNumber": "latest",
"includeTransactions": false
}Get Transaction Details
{
"network": "ethereum-mainnet",
"operation": "eth_getTransactionByHash",
"transactionHash": "0x88df016429689c079f3b2f6ad39fa052532c56795b733da78a91ebe6a713944b"
}Call Smart Contract
{
"network": "ethereum-mainnet",
"operation": "eth_call",
"toAddress": "0xA0b86a33E6441b8C4505E2c52Bb5a8e5c5F8b7E8",
"data": "0x70a08231000000000000000000000000742d35cc6634c0532925a3b8d4c9db96c4b4db45",
"blockParameter": "latest"
}Get Chain ID
{
"network": "ethereum-mainnet",
"operation": "eth_chainId"
}Get Event Logs
{
"network": "ethereum-mainnet",
"operation": "eth_getLogs",
"fromBlock": "latest",
"toBlock": "latest",
"contractAddress": "0xA0b86a33E6441b8C4505E2c52Bb5a8e5c5F8b7E8"
}Get Fee History
{
"network": "ethereum-mainnet",
"operation": "eth_feeHistory",
"blockCount": 4,
"newestBlock": "latest",
"rewardPercentiles": "[25, 50, 75]"
}Get Storage Value
{
"network": "ethereum-mainnet",
"operation": "eth_getStorageAt",
"address": "0xA0b86a33E6441b8C4505E2c52Bb5a8e5c5F8b7E8",
"storagePosition": "0x0",
"blockParameter": "latest"
}API Documentation
For more information about the JSON-RPC API and Infura services, visit:
Tests
Des tests complets ont été réalisés pour valider l'authentification et les routes de l'API Infura. Pour plus d'informations sur les tests disponibles et comment les exécuter, consultez les fichiers suivants :
- README-TESTS.md - Vue d'ensemble des tests disponibles
- README-INFURA-AUTH-SOLUTION.md - Tests d'authentification
- README-INFURA-ROUTES-TESTS.md - Tests des routes API
License
MIT
Support
For issues and feature requests, please visit our GitHub repository.
