I reply to all queries on the forums and via email, once per day, Monday to Friday (not weekends).

If you are new here, please see some information on how to ask for support. Thank you!

Reply To: How to add multiple Coins

#8999
alexg
Keymaster

OK.

Suppose you want to add two coins, with symbols ABC and XYZ.

This is how you can use the wallets_multiadapter_coins filter to add more than one coin (I have omitted most of the settings for clarity):

function wallets_multiadapter_coins_filter( $coins ) {

	$coins['ABC'] = array( // replace ABC with the coin's ticker symbol in this line

		// Coin symbol (again)
		'symbol' => 'ABC',

		// Coin name
		'name' => 'ABC coin',

		// MORE SETTINGS GO HERE

		// 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/abc-coin-icon-64x64.png',
	);

	$coins['XYZ'] = array( // replace XYZ with the coin's ticker symbol in this line

		// Coin symbol (again)
		'symbol' => 'XYZ',

		// Coin name
		'name' => 'XYZ coin',

		// MORE SETTINGS GO HERE

		// 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' );

If you really wanted to define multiple functions you could, but there’s no need.