承接 mollsoft/laravel-ethereum-module 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

mollsoft/laravel-ethereum-module

最新稳定版本:v1.0.12

Composer 安装命令:

composer require mollsoft/laravel-ethereum-module

包简介

Laravel Ethereum Module

README 文档

README

Pest Laravel Expectations

Latest Version on Packagist Php Version Php Version Total Downloads

Website Telegram

Laravel Ethereum Module is a Laravel package for work with cryptocurrency Ethereum, with the support ERC-20 tokens. It allows you to generate HD wallets using mnemonic phrase, validate addresses, get addresses balances and resources, preview and send ETH/ERC-20 tokens. You can automate the acceptance and withdrawal of cryptocurrency in your application.

You can contact me for help in integrating payment acceptance into your project.

Requirements

The following versions of PHP are supported by this version.

  • PHP 8.2 and older
  • Laravel 10 or older
  • PHP Extensions: GMP, BCMath, CType.

Installation

You can install the package via composer:

composer require mollsoft/laravel-ethereum-module

After you can run installer using command:

php artisan ethereum:install

And run migrations:

php artisan migrate

Register Service Provider and Facade in app, edit config/app.php:

'providers' => ServiceProvider::defaultProviders()->merge([
    ...,
    \Mollsoft\LaravelEthereumModule\EthereumServiceProvider::class,
])->toArray(),

'aliases' => Facade::defaultAliases()->merge([
    ...,
    'Ethereum' => \Mollsoft\LaravelEthereumModule\Facades\Ethereum::class,
])->toArray(),

For Laravel 10 you edit file app/Console/Kernel in method schedule(Schedule $schedule) add:

$schedule->command('ethereum:sync')
    ->everyMinute()
    ->runInBackground();

or for Laravel 11+ add this content to routes/console.php:

use Illuminate\Support\Facades\Schedule;

...

Schedule::command('ethereum:sync')
    ->everyMinute()
    ->runInBackground();

Examples

First you need to add Ethereum Nodes, you can register account in ANKR.COM get take HTTPS Endpoint with API key for Ethereum blockchain:

use \Mollsoft\LaravelEthereumModule\Facades\Ethereum;

Ethereum::createNode('My node', 'https://rpc.ankr.com/eth/{API_KEY}');

Second you need add Ethereum Explorer, you can register account in Etherscan.io API and take Endpoint with API key:

use \Mollsoft\LaravelEthereumModule\Facades\Ethereum;

Ethereum::createExplorer('My explorer', 'https://api.etherscan.io/api', '{API_KEY}');

You can create ERC-20 Token:

use \Mollsoft\LaravelEthereumModule\Facades\Ethereum;

$contractAddress = '0xdac17f958d2ee523a2206206994597c13d831ec7';
Ethereum::createToken($contractAddress);

Now you can create new Wallet:

use \Mollsoft\LaravelEthereumModule\Facades\Ethereum;

$wallet = Ethereum::createWallet('My wallet');

统计信息

  • 总下载量: 339
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-04-05