Skip to content

Instantly share code, notes, and snippets.

@alex-georgiou
Last active September 15, 2018 08:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alex-georgiou/5430a8b92a5c199f6134b277ce028e24 to your computer and use it in GitHub Desktop.
Save alex-georgiou/5430a8b92a5c199f6134b277ce028e24 to your computer and use it in GitHub Desktop.
<?php
/**
* Disallow selling TOKEN for BTC in the Dashed-Slug Exchange extension to Bitcoin and Altcoin Wallets
*
* https://www.dashed-slug.net/bitcoin-altcoin-wallets-wordpress-plugin/exchange-extension/
*
* @author alexg
*/
function disallow_limit_ask_orders( $order_id = null, $args = array() ) {
if ( 'BTC' == $args['base_symbol'] && 'TOKEN' == $args['quote_symbol'] && 'ask' == $args['direction'] ) {
throw new Exception( 'You can only buy our TOKEN token, but you can never sell it, sucker!!!! hahaha' );
}
}
add_filter( 'wallets_api_limit_order', 'disallow_limit_ask_orders', 0, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment