Screenshot of the admin page with the settings for each Web3 Provider plugin.
The result of a call made from the Web3 Provider "Wallet" plugin on the transaction form from the Ethereum module the Ethereum module using the

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

Releases