PHP Classes

PHP Etherscan API Service: Access virtual coin transactions of Etherscan.io

Recommend this page to a friend!
  Info   View files Documentation   View files View files (11)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2022-10-12 (1 month ago) RSS 2.0 feedNot yet rated by the usersTotal: 5 All time: 10,827 This week: 26Up
Version License PHP version Categories
etherscan-service 1.0The PHP License5PHP 5, Web services, Finances
Description Author

This package can Access virtual coin transactions of Etherscan.io.

It can send HTTP requests to the Etherscan.io API Web server to perform several types of operations related to virtual currency transactions.

Currently, it can:

- Get the current Ether balance of one or multiple accounts

- Get the list of transactions

- Get the list of tokens transferred

- Get the list of blocks mined

- Get the balance of a mined block

Picture of Hicri
Name: Hicri <contact>
Classes: 7 packages by
Country: Turkey Turkey
Innovation award
Innovation award
Nominee: 1x

Details

slvler - Etherscan Service

Latest Stable Version Latest Unstable Version License

An api service for etherscan.io

Installation

To install this package tou can use composer:

    composer require slvler/ether

Usage

  • First, you should extract the config/etherscan.php file to the config folder.
    php artisan vendor:publish --tag=ether

  • API key to be obtained from etherscan.io address should be declared.
    'ether' => [
        'etherscan_url' => 'https://api.etherscan.io/',
        'etherscan_key' => 'XXXXXXXXXXXXXXXXXXXXXXXX'
    ]

  • This is how you can connect to the etherscan api service.
  • Returns the Ether balance of a given address.
    $ether = new EtherScanService();
    $ether->balance('0xde0b295669a9fd93d5f28d9ec85e40f4cb697bae');

  • Returns the balance of the accounts from a list of addresses.
    $data = [ 
        '0xddbd2b932c763ba5b1b7ae3b362eac3e8d40121a',
        '0x63a9975ba31b0b9626b34300f7f627147df1f526',
        '0x198ef1ec325a96cc354c7266a038be8b5c558f67'
        ];
    
    $ether = new EtherScanService();
    $ether->balance_multiple($data);

  • Returns the list of transactions performed by an address, with optional pagination.
    $ether = new EtherScanService();
    $ether->transactions_normal('0xde0b295669a9fd93d5f28d9ec85e40f4cb697bae');

  • Returns the list of internal transactions performed by an address, with optional pagination.
    $ether = new EtherScanService();
    $ether->transactions_internal('0xde0b295669a9fd93d5f28d9ec85e40f4cb697bae');

  • Returns the list of internal transactions performed within a transaction.
    $ether = new EtherScanService();
    $ether->transactions_internal_hash('0x40eb908387324f2b575b4879cd9d7188f69c8fc9d87c901b9e2daaea4b442170');

  • Returns the list of internal transactions performed within a block range, with optional pagination.
    $ether = new EtherScanService();
    $ether->transactions_internal_block_range();

  • Returns the list of ERC-20 tokens transferred by an address, with optional filtering by token contract.
    $ether = new EtherScanService();
    $ether->token_transfer_events_erc20();

  • Returns the list of ERC-721 ( NFT ) tokens transferred by an address, with optional filtering by token contract.
    $ether = new EtherScanService();
    $ether->token_transfer_events_erc721();

  • Returns the list of ERC-1155 ( Multi Token Standard ) tokens transferred by an address, with optional filtering by token contract.
    $ether = new EtherScanService();
    $ether->token_transfer_events_erc1155();

  • Returns the list of blocks mined by an address.
    $ether = new EtherScanService();
    $ether->address_blocks_mined();

  • Returns the balance of an address at a certain block height. - PRO
    $ether = new EtherScanService();
    $ether->balance_single_adress();

Testing

    composer test

Credits

License

The MIT License (MIT). Please see License File for more information.

  Files folder image Files  
File Role Description
Files folder imageconfig (1 file)
Files folder imagesrc (1 file, 2 directories)
Files folder imagetests (1 file, 1 directory)
Accessible without login Plain text file .styleci.yml Data Auxiliary data
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file phpunit.xml Data Auxiliary data
Accessible without login Plain text file README.md Doc. Documentation

  Files folder image Files  /  config  
File Role Description
  Accessible without login Plain text file etherscan.php Aux. Auxiliary script

  Files folder image Files  /  src  
File Role Description
Files folder imageResources (1 file)
Files folder imageServices (1 file)
  Plain text file EtherServiceProvider.php Class Class source

  Files folder image Files  /  src  /  Resources  
File Role Description
  Plain text file Balance.php Class Class source

  Files folder image Files  /  src  /  Services  
File Role Description
  Plain text file EtherScanService.php Class Class source

  Files folder image Files  /  tests  
File Role Description
Files folder imageFeature (1 file)
  Plain text file TestCase.php Class Class source

  Files folder image Files  /  tests  /  Feature  
File Role Description
  Plain text file EtherScanTest.php Class Class source

 Version Control Unique User Downloads Download Rankings  
 100%
Total:5
This week:0
All time:10,827
This week:26Up