This module implement a new plugin type (e.g. web3_provider) to allow your site to interact with blockchains - such as making JSON-RPC calls to Ethereum network nodes - and with web3 wallets such (e.g. like Metamask)
This module does nothing on its own except providing a settings form to configure the existing Web3 Provider plugins. Developers can use the plugin.manager.web3_provider service to embed the configuration and/or transaction plugins' forms.
You can define your own plugin as follow:
<?php
namespace Drupal\mymodule\Plugin\Web3Provider;
use Drupal\web3_provider\Plugin\Web3Provider\Web3ProviderBase;
/**
* Defines my custom web3_provider plugin to communicate with the XXX blockchain.
*
* @Web3Provider(
* id = "mymodule_provider",
* title = @Translation("TheBest Blockchain"),
* description = @Translation("Interact with the most profitable blockchain in the universe.")
* )
*/
class MyModuleProvider extends Web3ProviderBase {
public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
// Add your custom editable settings here.
return $form;
}
public function buildTransactionForm(array $form, FormStateInterface $form_state) {
// Do your things here.
return $form;
}
}
Related modules
Project information
- Project categories: Developer tools
- Ecosystem: Ethereum
- Created by matthieuscarset on , updated
Stable releases for this project are covered by the security advisory policy.
There are currently no supported stable releases.
Releases
1.0.0-beta1
released 6 March 2023
Works with Drupal: ^8.9 || ^9 || ^10
Custom provider and signer with Web3php + Wallet plugin for Metamask.
Install:
Development version: 1.0.x-dev updated 15 May 2023 at 14:56 UTC


