Web3 Provider
Security covered
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
Depends on
Dependencies of the latest stable release
No dependencies recorded for this project.
Required by
Tracked projects that depend on this one
No tracked projects depend on this one yet.
Activity
Releases
| Version | Type | Core | Release date | |
|---|---|---|---|---|
| 1.0.0-beta1 | Pre-release | Mar 6, 2023 | ||
| 1.0.x-dev | Dev | Mar 2, 2023 |