lotteam/php-etherscan-api

PHP 客户端用于 Etherscan API

1.3.9 2022-04-15 07:49 UTC

This package is not auto-updated.

Last update: 2024-10-03 03:58:56 UTC


README

Etherscan API 的 PHP 包装器

License: MIT

官方 API 文档

创建 API 密钥(可选)

要求

Etherscan API 的最低要求是您的 Web 服务器支持 PHP 5.6。

安装

要安装 Etherscan PHP API 包,您可以运行以下命令

composer require maslakoff/php-etherscan-api:dev-master

用法

主网

$client = new \Etherscan\Client('Y3U3GMFC8P545CFWRU4TET8MY1K79YDZ3V');
$client->api('account')->balance('0x43406D1baAE11a950DE734DAE4079A3C9Eb48DAf');

对于测试网使用

支持

  • goerli
  • ropsten
  • kovan
  • rinkeby
$client = new \Etherscan\Client('Y3U3GMFC8P545CFWRU4TET8MY1K79YDZ3V', EtherscanAPIConf::TESTNET_RINKEBY);
$client->api('account')->balance('0x43406D1baAE11a950DE734DAE4079A3C9Eb48DAf');