Skip to content

Instantly share code, notes, and snippets.

@alex-georgiou
Last active December 4, 2022 05:53
Show Gist options
  • Save alex-georgiou/11e19523697d4c1a84c83874690466c3 to your computer and use it in GitHub Desktop.
Save alex-georgiou/11e19523697d4c1a84c83874690466c3 to your computer and use it in GitHub Desktop.
Example of how to add an RPC-compatible wallet to the Full Node Multi Coin Adapter for Bitcoin and Altcoin Wallets
<?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' );
@alex-georgiou
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment