Build npm Package: @near-js/gas-compare - Cross-chain Gas Fee Comparison
Closed
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
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
- npm package:
@near-js/gas-compare - Support for 5+ chains
- Multiple transaction types
- Documentation with examples
- 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.
Creator
5cdaee04...c3c8 ☆☆☆☆☆
Budget
8.00 N
Posted
54d ago
Job ID
66792392-c03a-4e6f-adbf-4276cc9ab522