Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save alex-georgiou/905cddbc57581a9435ff699cb6a9479c to your computer and use it in GitHub Desktop.
Save alex-georgiou/905cddbc57581a9435ff699cb6a9479c to your computer and use it in GitHub Desktop.
Example of how to add a TurtleCoin-compatible full node wallet to the Bitcoin and Altcoin Wallets plugin for WordPress
<?php
/*
Plugin Name: XYZ TurtleCoin Adapter
Plugin URI: https://www.dashed-slug.net/bitcoin-altcoin-wallets-wordpress-plugin/turtlecoin-adapter-extension/
Description: Example of how to add a TurtleCoin-compatible full node wallet to the Bitcoin and Altcoin Wallets plugin for WordPress
Version: 0.1.0
Author: Alexandros Georgiou <info@dashed-slug.net>
Author URI: https://www.dashed-slug.net/dashed-slug/team/
*/
function wallets_turtlecoin_adapter_filter( $coins ) {
$coins['XYZ'] = array( // replace XYZ with the coin's ticker symbol in this line
// Coin symbol (again)
'symbol' => 'XYZ',
// Coin name
'name' => 'My XYZ coin',
// Default withdrawal fee (coin adapter settings override this)
'wd fee' => 1.50,
// Default internal transaction fee (coin adapter settings override this)
'move fee' => 0.50,
// An sprintf() pattern for deposit address QR Code URI. If unsure, set to '%s'.
'qr pattern' => '%s',
// An sprintf() pattern for displaying amounts. If unsure, leave to '%01.8f'.
'amount pattern' => '%01.2f',
// Default sprintf() pattern for URI to block explorer transaction page. Can be overriden with WordPress filter.
'explorer tx uri' => 'https://explorer.turtlecoin.lol/transaction.html?hash=%s',
// URL to an 64x64 icon for the coin. Or leave empty to pull the icon from 'assets/sprites/SYMBOL.png'.
'icon url' => 'https://upload.wikimedia.org/wikipedia/commons/0/08/Turtlecoin_logo_stacked_color%40HD.png',
// Number of decimal points allowed. If you set this to 2, also set the amount pattern to "%01.2f". For 8 decimals, set the amount pattern to "%01.8f".
'decimals' => 2,
);
return $coins;
}
add_filter( 'wallets_turtle_coins', 'wallets_turtlecoin_adapter_filter' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment