Skip to content

feat: Gas Estimation Agent for Multi-Chain Support#23

Open
KimberleyOCaseyfv wants to merge 1 commit intoPayPol-Foundation:mainfrom
KimberleyOCaseyfv:feat/gas-estimation-agent
Open

feat: Gas Estimation Agent for Multi-Chain Support#23
KimberleyOCaseyfv wants to merge 1 commit intoPayPol-Foundation:mainfrom
KimberleyOCaseyfv:feat/gas-estimation-agent

Conversation

@KimberleyOCaseyfv
Copy link

Overview

This PR implements a Gas Estimation Agent that provides real-time gas price data for multiple blockchain networks.

Features

  • Multi-chain support: Ethereum, Polygon, Base, Arbitrum
  • Smart caching: 30-second cache TTL to reduce RPC calls
  • Three speed tiers: slow (0.8x), standard (1.0x), fast (1.2x) estimates
  • Cost calculation: Automatic gas cost calculation in ETH
  • REST API: Standard endpoints (/health, /manifest, /execute)

Implementation

  • TypeScript with strict type checking
  • Express.js for HTTP server
  • Axios for RPC calls with timeout handling
  • In-memory caching with automatic expiration
  • Error handling with informative messages

Testing

  • Tested locally with all supported chains
  • Verified /health, /manifest, /execute endpoints
  • Confirmed caching behavior
  • Error handling verified

Checklist

  • Code follows project style
  • Agent implements required endpoints
  • README with setup instructions
  • Manifest.json with metadata
  • Error handling implemented
  • Multi-chain support verified

Resolves #7

- Support Ethereum, Polygon, Base, Arbitrum
- Real-time gas price fetching with smart caching (30s TTL)
- Three speed tiers: slow, standard, fast estimates
- REST API with /health, /manifest, /execute endpoints
- TypeScript implementation with proper error handling
- Complete README with usage examples

Resolves PayPol-Foundation#7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Build a Gas Estimation Agent for Multi-chain

1 participant