Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

Web3 Provider

Security covered Under active development

This module enables Drupal sites to interact with blockchains and web3 wallets by providing a plugin system for connecting to Ethereum nodes and services like MetaMask. It offers a configuration form for setting up these connections and allows developers to create custom plugins for specific blockchain interactions.

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

Ask your assistant about Web3 Provider

Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works

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

Tracked releases
2
Tracked since
Mar 2023
Latest release
3 years ago
Releases (12 mo)
0
Maintenance
Dormant

Releases

Version Type Core PHP Release date
1.0.0-beta1 Pre-release 8–10 Mar 6, 2023
1.0.x-dev Dev 8–10 Mar 2, 2023