• Resolved hartology

    (@hartology)


    Want to know if there’s a way I can set a minimum amount that can be moved among users. Thanks.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author dashed-slug.net

    (@dashedslug)

    Hello,

    There’s no such feature right now, but you can easily hook into the plugin’s PHP API. This way you can add any logic you want for rejecting transactions based on coin, amount, sender, receiver, etc.

    In this situation we’ll hook into wallets_api_move with a priority that is less than 10, because at 10 we actually perform the transaction. If you throw an exception on a hook that runs earlier, this will prevent the transaction, and will display your error message to the user.

    function disallow_small_moves( $args = array() ) {
    
    	if ( 'BTC' == $args['symbol'] && $args['amount'] < 0.0001 ) {
    		throw new Exception( 'You cannot move less than 0.0001 Bitcoin' );
    
    	} elseif ( 'LTC' == $args['symbol'] && $args['amount'] < 0.001 ) {
    		throw new Exception( 'You cannot move less than 0.001 Litecoin' );
    	}
    }
    
    add_action( 'wallets_api_move', 'disallow_small_moves', 0 );

    Here we’ve set lower limits to move transactions for Bitcoin and Litecoin.

    Don’t forget to add your code into your child theme’s functions.php file or as a separate plugin. Don’t edit your theme or plugins directly, because any changes will get overwritten when you update your components.

    Let me know if you have any further questions about this.

    with regards,
    Alex

    Thread Starter hartology

    (@hartology)

    This is wonderful, you just have solution to everything. I really appreciate your help. Thanks “plentifully” ??

    Plugin Author dashed-slug.net

    (@dashedslug)

    Glad to help!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘minimum move amount’ is closed to new replies.