Giter Site home page Giter Site logo

renoki-co / laravel-web3 Goto Github PK

View Code? Open in Web Editor NEW
113.0 9.0 35.0 67 KB

Laravel SDK wrapper for the Web3 PHP API client that interacts with the Ethereum blockchain.

License: Apache License 2.0

PHP 100.00%
web3 eth contract blockchain laravel php api sdk wrapper ethereum

laravel-web3's Introduction

Laravel Web3 API Client

CI codecov StyleCI Latest Stable Version Total Downloads Monthly Downloads License

Laravel Web3 is a Laravel SDK wrapper for the Web3 PHP API client that interacts with the Ethereum blockchain.

๐Ÿค Supporting

If you are using one or more Renoki Co. open-source packages in your production apps, in presentation demos, hobby projects, school projects or so, sponsor our work with Github Sponsors. ๐Ÿ“ฆ

๐Ÿš€ Installation

You can install the package via composer:

composer require renoki-co/laravel-web3 --ignore-platform-reqs

Publish the config:

$ php artisan vendor:publish --provider="RenokiCo\LaravelWeb3\LaravelWeb3ServiceProvider" --tag="config"

๐Ÿ™Œ Usage

The client configuration can be found in the config/web3.php file. Each call will be made from the \Web3\Web3 class:

use RenokiCo\LaravelWeb3\Web3Facade as Web3;

Web3::eth()->hashRate();

Multiple connections

The package supports multiple connections configurations. If you wish to select a specific one (not the default one), call connection before getting the cluster.

use RenokiCo\LaravelWeb3\Web3Facade as Web3;

Web3Facade::connection('http2')->eth()->hashRate();

Additional methods

The following methods are also available to start with:

use RenokiCo\LaravelWeb3\Web3Facade as Web3;

Web3::eth()->coinbase();
Web3::net()->version();

๐Ÿ› Testing

vendor/bin/phpunit

๐Ÿค Contributing

Please see CONTRIBUTING for details.

๐Ÿ”’ Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

๐ŸŽ‰ Credits

laravel-web3's People

Contributors

dependabot-preview[bot] avatar dependabot[bot] avatar laravel-shift avatar rennokki avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

laravel-web3's Issues

Please batch json rpc first.

How can I fix this error?

RuntimeException
Please batch json rpc first.

Web3\Providers\HttpProvider::execute
vendor/sc0vu/web3.php/src/Providers/HttpProvider.php:91

 */

public function execute($callback)

{

    if (!$this->isBatch) {

        throw new \RuntimeException('Please batch json rpc first.');

    }

    $methods = $this->methods;

    $proxy = function ($err, $res) use ($methods, $callback) {

        if ($err !== null) {

            return call_user_func($callback, $err, null);

        }

Create wallet

Do you know how to create a private and public key in php?

Guzzle version conflict

Hi i was trying to install this in my Laravel 8 project but it gives a guzzle version error, as this package depends on guzzle 6 but Laravel 8 and most of the latest packages require guzzle 7.

It wil be very helpful if you can provide some solution.

Thanks

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.