1inch-agent-kit
Version:
AI Agent Kit for 1inch - Connect any LLM to 1inch DeFi protocols
20 lines • 847 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.gasAPI = gasAPI;
const fetcher_1 = require("../../utils/fetcher");
/**
* Get gas price data from 1inch Gas Price API
* Provides real-time, accurate gas price data across various blockchains
*/
async function gasAPI(params) {
const apiKey = process.env.ONEINCH_API_KEY;
if (!apiKey) {
throw new Error("1inch API key is required. Set ONEINCH_API_KEY environment variable.");
}
const fetcher = new fetcher_1.OneInchFetcher(apiKey);
// Supported chains: 1 (Ethereum), 42161 (Arbitrum), 43114 (Avalanche),
// 56 (BNB Chain), 100 (Gnosis), 7565164 (Solana), 10 (Optimism),
// 137 (Polygon), 324 (zkSync Era), 8453 (Base), etc.
return await fetcher.get(`/gas-price/v1.6/${params.chain}`);
}
//# sourceMappingURL=index.js.map