Last active
November 20, 2021 03:50
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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