Allows the Bitcoin and Altcoin Wallets WordPress plugin to connect to a large number of Bitcoin-like full node wallets via their JSON RPC API.

the Full Node Multi Coin Adapter extension

The Bitcoin and Altcoin Wallets WordPress plugin by default lets you connect a Bitcoin wallet daemon with your WordPress site. This normally requires that you run a full Bitcoin node on a machine that you own. Any coin with a wallet that is a fork of the Bitcoin core wallet, is eligible to be connected to the Bitcoin and Altcoin Wallets WordPress plugin using this multi-adapter. The key requirement is that a wallet must provide a similar JSON-RPC interface.

To support other Bitcoin-like coins, previously the recommended method was to implement a full node adapter by modifying the Litecoin full node adapter.

With this Full Node Multi Coin Adapter extension supporting these coin wallets becomes easier:

installation instructions

  1. Install the Bitcoin and Altcoin Wallets plugin.
  2. Install and activate this plugin extension if you have not already done so.
  3. Once installed, the plugin will populate your AdminWallets menu with new entries, one for each supported full node wallet. Visit these entries and enable each coin adapter that you would like to use.
  4. The plugin will inform you that it cannot communicate with your wallet’s JSON-RPC API. Follow the on-screen instructions. You will need to configure the coin adapter settings and the .conf file of your wallet. For the plugin to be able to communicate with your full node, these settings must match.
  5. Visit your AdminWalletsAdapters page, and make sure that the status of all the coin adapters you have enabled is Responding.

adding support for your coins

The multiadapter needs to know some pieces of information about your coin and its wallet before it can display a coin adapter for it. For some coins, this information is held in a built-in CSV file, at wp-content/plugins/wallets-multiadapter/assets/coins.csv. Editing this file is not recommended because the file contents will be replaced when updating to any new version of the multi-adapter. Instead, you should create a short plugin and attach it to the wallets_multiadapter_coins WordPress filter.

Here’s an example of how to add a hypothetical XYZ coin:

  1. Create a new PHP file.
  2. Add some plugin headers as shown here
  3. Paste your code beneath the headers.
  4. Copy the PHP file into your wp-content/plugins directory
  5. Go to Plugins and activate your plugin.
  6. You can now go to WalletsXYZ coin full node (multi) and configure your connection settings.
<?php

/*
Plugin Name: XYZ Coin Adapter
Plugin URI: https://www.dashed-slug.net/bitcoin-altcoin-wallets-wordpress-plugin/full-node-multi-coin-adapter-extension/
Description:  Example of how to add an RPC-compatible wallet to the Full Node Multi Coin Adapter for Bitcoin and Altcoin Wallets
Version: 0.1.0
Author: Alex Georgiou <alexgeorgiou@gmail.com>
Author URI: http://alexgeorgiou.gr
*/

function wallets_multiadapter_coins_filter( $coins ) {
	$coins['XYZ'] = array(

		// Coin symbol
		'symbol' => 'XYZ',

		// Coin name
		'name' => 'XYZ coin',

		// Default withdrawal fee (coin adapter settings override this)
		'wd fee' => '0.005',

		// Default internal transaction fee (coin adapter settings override this)
		'move fee' => '0.0005',

		// Default min confirmation count required for deposits (coin adapter settings override this)
		'confirms' => 12,

		// Default RPC port (coin adapter settings override this)
		'port number' => 12345,

		// Whether the wallet supports -walletnotify
		'tx notify' => 1,

		// Whether the wallet supports -blocknotify
		'block notify' => 1,

		// Whether the wallet supports -alertnotify (some wallets have deprecated this)
		'alert notify' => 0,

		// Comma separated list of hex bytes, needed for frontend validation of withdraw addresses. Leave blank for no validation.
		'versions' => '',

		// An sprintf() pattern for deposit address QR Code URI. If unsure, set to '%s'.
		'qr pattern' => 'xyzcoin:%s',

		// An sprintf() pattern for displaying amounts. If unsure, leave to '%01.8f'.
		'amount pattern' => '%01.8f',

		// Default sprintf() pattern for URI to block explorer transaction page. Can be overriden with WordPress filter.
		'explorer tx uri' => 'https://blockexplorer.example.com/tx/%s/',

		// Default sprintf() pattern for URI to block explorer address page. Can be overriden with WordPress filter.
		'explorer address uri' => 'https://blockexplorer.example.com/address/%s/',

		// URL to an 64x64 icon for the coin. Or leave empty to pull the icon from 'assets/sprites/SYMBOL.png'.
		'icon url' => 'http://www.example.com/xyz-coin-icon-64x64.png',
	);

	return $coins;
 }

add_filter( 'wallets_multiadapter_coins', 'wallets_multiadapter_coins_filter' );

This example code is also hosted on GitHub.

Use the above code as a template to add any suitable coin to your website. You will need to install and maintain a full node on a server, and configure your wallet’s .conf file. Refer to your wallet’s documentation or support forum for details on how to setup the wallet.

download

Available free of charge to all subscribers and premium members (you need to be logged in).

support

Please visit the support area for any issues, suggestions, feedback regarding this plugin extension.

For support regarding the parent plugin, Bitcoin and Altcoin Wallets, please use the support forums on WordPress.org.

Full Node Multi Coin Adapter extension

Updated on 2018-06-11T12:46:49+00:00, by alexg.