Code Monkey home page Code Monkey logo

etherscan-service's Introduction

slvler - Etherscan Service

tests 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
  • First of all we'll add the API key and API Url of the service we're using to our .env file of our project. If you don't have an account yet on api.etherscan.io, you should create one. Once you have an account you can copy your API key from the dashboard page and put it into you .env file.
    ETHERSCAN_BASE_URL=https://api.etherscan.io/
    ETHERSCAN_API_KEY=YOUR-API-KEY
  • 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.

etherscan-service's People

Contributors

slvler avatar stylecibot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.