Skip to content

Instantly share code, notes, and snippets.

@alex-georgiou
Last active November 20, 2021 03:50
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alex-georgiou/7181cc71c320cbe078a5623479b0a852 to your computer and use it in GitHub Desktop.
Save alex-georgiou/7181cc71c320cbe078a5623479b0a852 to your computer and use it in GitHub Desktop.
Example of how to add a CryptoNote-based wallet to the Monero Coin Adapter extension for Bitcoin and Altcoin Wallets.
<?php
/*
Plugin Name: Cryptonote-based Coin Adapter for XYZ coin
Plugin URI: https://www.dashed-slug.net/bitcoin-altcoin-wallets-wordpress-plugin/monero-coin-adapter-extension
Description: Example of how to add a CryptoNote-based wallet to the Monero Coin Adapter extension for Bitcoin and Altcoin Wallets.
Version: 0.1.1
Author: Alex Georgiou <alexgeorgiou@gmail.com>
Author URI: http://alexgeorgiou.gr
*/
function wallets_cryptonote_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.001',
// Default internal transaction fee (coin adapter settings override this)
'move fee' => '0.0001',
// An sprintf() pattern for deposit address QR Code URI. '%s' will be replaced with the address string. If unsure, set to '%s'.
'qr pattern' => 'xyzcoin:%s',
// An sprintf() pattern for displaying amounts. If unsure, leave to '%01.12f'. This must match the "decimals" field below.
'amount pattern' => '%01.12f',
// Default sprintf() pattern for URI to block explorer transaction page. '%s' will be replaced with the TXID.
'explorer tx uri' => 'https://blockexplorer.example.com/tx/%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',
// Number of decimal points allowed. If you set this to 12, also set the amount pattern to "%01.12f". For 8 decimals, set the amount pattern to "%01.8f".
'decimals' => 12,
);
return $coins;
}
add_filter( 'wallets_cryptonote_coins', 'wallets_cryptonote_coins_filter' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment