npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

n8n-nodes-smart-contract

v1.0.0

Published

n8n node for interacting with Ethereum Smart Contracts

Readme

n8n-nodes-smart-contract

Este es un nodo personalizado de n8n para interactuar con Smart Contracts de Ethereum y redes compatibles con EVM.

🚀 Características

  • Call Function: Ejecuta funciones de solo lectura (view/pure)
  • Send Transaction: Ejecuta transacciones que modifican el estado del blockchain
  • Get Balance: Obtiene el balance de una dirección

📋 Requisitos previos

  • Node.js v16 o superior
  • n8n instalado
  • Una cuenta de Infura, Alchemy u otro proveedor RPC
  • Una wallet con su clave privada

📦 Instalación

Opción 1: Instalación en n8n Cloud o n8n local

  1. Clona este repositorio:
git clone https://github.com/jesusrosab/n8n-nodes-smart-contract.git
cd n8n-nodes-smart-contract
  1. Instala las dependencias:
npm install
  1. Compila el nodo:
npm run build
  1. Enlaza el nodo a n8n:
npm link
  1. En tu instalación de n8n, ejecuta:
cd ~/.n8n
npm link n8n-nodes-smart-contract
  1. Reinicia n8n

Opción 2: Instalación desde npm (cuando esté publicado)

npm install n8n-nodes-smart-contract

🔧 Estructura del proyecto

n8n-nodes-smart-contract/
├── credentials/
│   └── SmartContractApi.credentials.ts
├── nodes/
│   └── SmartContract/
│       └── SmartContract.node.ts
├── package.json
├── tsconfig.json
└── README.md

🎯 Uso

1. Configurar las credenciales

  1. En n8n, ve a CredentialsNew
  2. Busca Smart Contract API
  3. Completa:
    • Network RPC URL: Tu URL de Infura/Alchemy (ej: https://sepolia.infura.io/v3/TU_PROJECT_ID)
    • Private Key: Tu clave privada (comienza con 0x)
    • Network Name: Selecciona la red

2. Usar el nodo

Ejemplo 1: Leer un valor (Call Function)

  1. Añade el nodo Smart Contract a tu workflow
  2. Selecciona la operación Call Function
  3. Configura:
    • Contract Address: 0x87e10fC2902f36145e7725b270cB96e57aab8040
    • Contract ABI: Pega el ABI JSON de tu contrato
    • Function Name: retrieve
    • Parameters: (vacío si la función no tiene parámetros)

Ejemplo 2: Enviar una transacción (Send Transaction)

  1. Añade el nodo Smart Contract
  2. Selecciona Send Transaction
  3. Configura:
    • Contract Address: Dirección del contrato
    • Contract ABI: ABI del contrato
    • Function Name: store
    • Parameters:
      • Type: number
      • Value: 100
    • Gas Options (opcional):
      • Gas Limit: 0 (auto-estimación)
      • Gas Price Multiplier: 110 (10% extra)

Ejemplo 3: Obtener balance

  1. Selecciona Get Balance
  2. Introduce la dirección de la wallet

🔐 Seguridad

⚠️ IMPORTANTE:

  • NUNCA compartas tu clave privada
  • NUNCA subas tu clave privada a repositorios públicos
  • Usa variables de entorno o el gestor de credenciales de n8n
  • Para testing, usa redes de prueba (Sepolia, Goerli)

📝 Ejemplo de ABI

[
  {
    "inputs": [
      {
        "internalType": "uint256",
        "name": "num",
        "type": "uint256"
      }
    ],
    "name": "store",
    "outputs": [],
    "stateMutability": "nonpayable",
    "type": "function"
  },
  {
    "inputs": [],
    "name": "retrieve",
    "outputs": [
      {
        "internalType": "uint256",
        "name": "",
        "type": "uint256"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  }
]

🌐 Redes soportadas

  • Ethereum Mainnet
  • Sepolia Testnet
  • Goerli Testnet
  • Polygon
  • Mumbai Testnet
  • Binance Smart Chain (BSC)
  • BSC Testnet
  • Cualquier red compatible con EVM

🛠️ Desarrollo

# Instalar dependencias
npm install

# Compilar en modo desarrollo (watch)
npm run dev

# Compilar para producción
npm run build

# Formatear código
npm run format

# Lint
npm run lint

📚 Recursos

🤝 Contribuir

Las contribuciones son bienvenidas. Por favor:

  1. Haz fork del proyecto
  2. Crea una rama para tu feature (git checkout -b feature/AmazingFeature)
  3. Commit tus cambios (git commit -m 'Add some AmazingFeature')
  4. Push a la rama (git push origin feature/AmazingFeature)
  5. Abre un Pull Request

📄 Licencia

MIT

👤 Autor

Jesús Rosa Bilbao

📞 Soporte

Si encuentras algún problema o tienes sugerencias: