承接 numairawan/eth-gas-tracker-php 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

numairawan/eth-gas-tracker-php

最新稳定版本:v2.0.0

Composer 安装命令:

composer require numairawan/eth-gas-tracker-php

包简介

Powerful PHP library to retrieve live Ethereum gas prices.

README 文档

README

Eth Gas Tracker PHP

Total Downloads Latest Version License

eth-gas-tracker-php is a powerful PHP library that provides developers with an effortless way to retrieve live Ethereum gas prices, empowering them to optimize transactions and smart contracts on the Ethereum network.

Features

  • 🚀 Retrieve live Ethereum gas prices with ease.
  • ⛽️ Obtain up-to-date and accurate gas price data.
  • 💪 Fine-tune transaction optimization based on real-time gas prices.
  • 🤝 Seamless integration into existing PHP projects.
  • 📚 Comprehensive documentation and code examples for easy implementation.

Installation

To install the library, you can use Composer and run the following command:

composer require numairawan/eth-gas-tracker-php

Usage

To retrieve live Ethereum gas prices, follow these simple steps:

use NumairAwan\EthGasTracker\EthereumGasPrice;

// Instantiate the EthereumGasPrice
$ethereumGasPrice = new EthereumGasPrice();

// Get gas prices
$gasPrice = $ethereumGasPrice->getGasPrices();

// safe gas price 
echo "Gas Prices:\n";
echo "Slow Gas Price: " . $gasPrice->proposeGas . " Gwei\n";
echo "Safe Gas Price: " . $gasPrice->safeGas . " Gwei\n";
echo "Fast Gas Price: " . $gasPrice->fastGas . " Gwei\n";

Utilities

// Convert gas prices to Wei
$fastGasPriceWei = $ethereumGasPrice->toWei($gasPrice->fastGas);
echo "Fast Gas Price (Wei): " . $fastGasPriceWei . PHP_EOL;

// Convert gas prices (WEI) to Hexadecimal with '0x' prefix (don't pass second parameter to just get hex)
$fastGasPriceHex = $ethereumGasPrice->toHex($fastGasPriceWei, true);
echo "Fast Gas Price (Hex): " . $fastGasPriceHex . PHP_EOL;

Contributing

Contributions are welcome! Feel free to fork the repository and submit pull requests as well.

License

This project is licensed under the MIT license.

Connect with Me

Feel free to reach out to me for any project-related queries or collaborations. I'm always happy to connect and discuss ideas!

Telegram WhatsApp

统计信息

  • 总下载量: 484
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 4
  • 点击次数: 4
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 4
  • Watchers: 3
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-07-16