This Node.js script checks your airdrop eligibility and on-chain claim status for the LayerEdge airdrop. It interacts directly with the LayerEdge API and an Ethereum RPC provider.
- 🔄 Multi-wallet support (check multiple addresses at once)
- 💰 Shows current and initial EDGE allocation amounts
- ⛓️ Verifies on-chain claim status
- 🔒 Secure private key handling via
.env
file - 🎨 Colored and formatted console output
- Node.js: Version 16.x or higher recommended. You can download it from nodejs.org.
- npm (Node Package Manager): Usually comes with Node.js.
- An Ethereum Private Key: For the wallet you want to check.
-
Clone or Download:
git clone https://github.com/mesamirh/LayerEdge-Eligibility-Checker.git
-
Navigate to Project Directory: Open your terminal or command prompt and navigate to the directory where you saved the script.
cd LayerEdge-Eligibility-Checker
-
Install Dependencies: Run the following command to install the necessary Node.js packages (
ethers.js
andaxios
for functionality,dotenv
for environment variable management):npm install ethers axios dotenv
-
Create
.env
File: In the same project directory, create a file named.env
. This file will securely store your private key. Add your private key to this file in the following format:For single wallet:
PRIVATE_KEY="your_wallet_private_key_here"
For multiple wallets:
PRIVATE_KEYS=["private_key1", "private_key2", "private_key3"]
🔒 IMPORTANT SECURITY NOTE:
- Never share your private key with anyone.
- Never commit your
.env
file to a public repository (like GitHub). If you're using Git, add.env
to your.gitignore
file.
Once you've completed the setup:
- Open your terminal or command prompt.
- Navigate to the project directory.
- Run the script using Node.js:
node main.js
The script will then:
- Load your private key.
- Initialize your wallet and display your public address.
- Connect to the RPC provider.
- Fetch airdrop eligibility from the LayerEdge API.
- Check the on-chain claim status from the LayerEdge smart contract.
- Display a summary of the findings.
- Configuration: At the top of the script, you can find constants for API URLs and the contract address. These are generally pre-set for the LayerEdge airdrop.
getAirdropEligibility(walletAddress)
: This asynchronous function sends a GET request to the LayerEdge API to retrieve allocation details. It includes headers to mimic a browser request.getOnChainStatus(wallet, provider)
: This asynchronous function performs aneth_call
to the specified LayerEdge smart contract to check a likely claim status for the given wallet address.main()
: The main asynchronous function that orchestrates the script's execution, including loading the private key, initializing the wallet and provider, calling the helper functions, and displaying the results.
PRIVATE_KEY not found
Error: Ensure your.env
file is correctly named (.env
, notenv.txt
or similar) and is in the same directory as the script. Also, check thatPRIVATE_KEY=
is correctly set within the file.Invalid PRIVATE_KEY
Error: Double-check that the private key in your.env
file is correct and complete.- API Errors (e.g., 403, 503, 504):
403 Forbidden
: The API might be blocking the script. The script includes common browser headers to try and mitigate this, but advanced blocking might still occur.503 Service Unavailable
/504 Gateway Timeout
: These usually indicate a temporary issue on the LayerEdge API server-side. Try running the script again later.
- RPC Errors: Ensure the
RPC_URL
in the script is correct and accessible. The defaulthttps://rpc.layeredge.io/
should work, but network issues or RPC provider downtime can occur. - "Cannot read properties of undefined" (related to
ethers
): This usually means there's an issue with yourethers.js
installation or version compatibility. Ensure you've runnpm install ethers
and that the script is using syntax compatible with your installed version (the provided script is designed forethers
v6).
- This script is provided as-is for educational and informational purposes.
- Always handle your private keys with extreme caution. Ensure your environment is secure. The script reads the private key locally and uses it to derive your address; it does not send your private key over the internet.
- The accuracy of the airdrop information depends entirely on the LayerEdge API and the data it provides.
- The interpretation of the on-chain status depends on the specific function of the smart contract being called.