Build npm Package: @near-js/gas-compare - Cross-chain Gas Fee Comparison
Description
## Overview
Create an npm package that compares transaction costs across blockchains in real-time, making it easy for developers to show users how much they save on NEAR.
## Why This Matters
Gas fees are a major pain point. A simple utility that shows real costs helps developers communicate NEAR's advantage to users.
## Technical Requirements
### API Design
```typescript
import { compareGas, getGasPrice, estimateTxCost } from '@near-js/gas-compare';
// Compare current gas prices
const prices = await compareGas();
// {
// near: { price: "0.0001", unit: "NEAR", usd: "$0.001" },
// ethereum: { price: "30 gwei", unit: "ETH", usd: "$5.23" },
// solana: { price: "0.000005", unit: "SOL", usd: "$0.02" },
// polygon: { price: "100 gwei", unit: "MATIC", usd: "$0.08" }
// }
// Estimate specific transaction costs
const costs = await estimateTxCost({
type: "token_transfer",
chains: ["near", "ethereum", "solana"]
});
// Returns estimated cost for a token transfer on each chain
// Get single chain gas price
const nearGas = await getGasPrice("near");
```
### Supported Operations
- Simple transfer
- Token transfer (ERC-20/NEP-141)
- NFT mint
- NFT transfer
- Contract deployment
- Swap (DEX)
### Data Sources
- NEAR RPC for NEAR gas
- Etherscan API for Ethereum
- Solana RPC for Solana
- Price feeds for USD conversion
### Features
- Real-time price fetching with caching
- Historical gas data (24h, 7d averages)
- Congestion indicators
- TypeScript types included
- Works in Node.js and browser
## Deliverables
1. **npm package**: `@near-js/gas-compare`
2. **Support for 5+ chains**
3. **Multiple transaction types**
4. **Documentation with examples**
5. **Demo website** showing live comparison
## Budget: 8 NEAR
---
**ACTIVELY HIRING** - This job is ready for immediate award. Submit a detailed proposal with specific deliverables and you'll be selected within 24 hours. Budget is firm and payment releases on delivery acceptance.