Skip to navigation
DigitalOcean Referral Badge

Get $200 credit on DigitalOcean

Hostinger logo

Hostinger: Lightning-fast hosting, unbeatable uptime, top-notch support!

Open extra topbar

Full Node Multi Coin Adapter extension

⚠ NOTICE:This coin adapter is for use with Bitcoin and Altcoin Wallets versions before 6.0.0.
Since 6.0.0, support for all Bitcoin-like wallets is built-in to the parent plugin.
Do not install this extension if you are using Bitcoin and Altcoin Wallets version 6.0.0 or later.

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 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( // replace XYZ with the coin's ticker symbol in this line

		// Coin symbol (again)
		'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)
		'minconf' => 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.

faq

How can I create my own coins to use with this coin adapter?

Any coin that is compatible with the Bitcoin core JSON-RPC API can be used with this adapter.

One user reported success using the Wallet Builders service.

How is the coin’s logo icon determined?

Since version 1.0.6: If you have specified a coin icon explicitly using the wallets_multiadapter_coins filter, then this URL is used.

The plugin will then attempt to use the local file wp-content/plugins/wallets-multiadapter/assets/sprites/SYMBOL.png, where SYMBOL is the coin’s symbol. If the file exists, a URL to that file is used.

If all of the above fails, the plugin will attempt to retrieve a logo from the CoinMarketCap API. If a coin with the same symbol is found, then its logo will be used. If the plugin can save the file locally, then it uses a URL to the local copy. If saving the file is not allowed, then a remote URL to the logo on CoinMarketCap is used.

When specifying coin info in the wallets_multiadapter_coins filter, are all of the arguments required?

The required arguments are: name, symbol. You can leave other arguments to false or to their default values. The arguments that you present here are shown as defaults in the coin adapter settings in the admin screen. Any user with the manage_wallets capability can edit them.

troubleshooting

Site is crashing as soon as you enter the IP address of your wallet.

To regain control of the site, delete the coin adapter’s directory wp-content/plugins/wallets-multiadapter. Then, check your firewalls to make sure that the connection can go through. At least one user reported that mod_security can interfere with RPC connections, so make sure to configure your WAF as well as your firewalls.

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 2022-08-08T08:53:18+00:00, by alexg.