LaravelPackages.net
Acme Inc.
Toggle sidebar
vance-page/laravel-web3

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

5
0
1.0.1
About vance-page/laravel-web3

vance-page/laravel-web3 is a Laravel package for laravel sdk wrapper for the web3 php api client that interacts with the ethereum blockchain.. It currently has 0 GitHub stars and 5 downloads on Packagist (latest version 1.0.1). Install it with composer require vance-page/laravel-web3. Discover more Laravel packages by vance-page or browse all Laravel packages to compare alternatives.

Last updated

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, spread some kind words about our work or sponsor our work via Patreon. πŸ“¦

You will sometimes get exclusive content on tips about Laravel, AWS or Kubernetes on Patreon and some early-access to projects or packages.

πŸš€ Installation

You can install the package via composer:

composer require vance-page/laravel-web3 --ignore-platform-reqs

Publish the config:

$ php artisan vendor:publish --provider="Vance\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 Vance\LaravelWeb3\Web3Facade;

Web3Facade::eth()->provider->execute(function ($err, $data) {
    //
});

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 Vance\LaravelWeb3\Web3Facade;

Web3Facade::connection('http2')->eth()->provider->execute(function ($err, $data) {
    //
});

Additional methods

The following methods are also available to start with:

use Vance\LaravelWeb3\Web3Facade;

Web3Facade::eth(); // equivalent of $web3->eth
Web3Facade::net();  // equivalent of $web3->net
Web3Facade::personal();  // equivalent of $web3->personal
Web3Facade::shh();  // equivalent of $web3->shh
Web3Facade::utils();  // equivalent of $web3->utils

Working with Contracts

You can also initialize contracts with the same configuration:

use Vance\LaravelWeb3\Web3Facade;

Web3Facade::contract($abi, 'latest')
    ->bytecode($bytecode)
    ->new($params, $callback);

πŸ› 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

Comments