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!

Fee Caculation

dashed-slug.net Forums General discussion Fee Caculation

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #9529

    My developer is using standard math to calculate fees for the mobile app implementation of your plugin. Which way would you suggest we retrieve the correct fees.

    Is there a section of your code we can emulate?


    The admin sets the fees in the coin adapter settings via the admin interface.

    Every coin adapter has its own way of doing this, but ultimately they all report back to the plugin 4 values: https://github.com/dashed-slug/wallets/blob/5.0.12/includes/coin-adapter.php#L555-L613

    When you do a call to the get_coins_info JSON-API endpoint, you get back a number of fields for each coin.

    The relevant fields for fees are: “move_fee”,”move_fee_proportional”,”withdraw_fee”,”withdraw_fee_proportional”:0

    So, for an internal transfer, the fee paid will be move_fee + amount * move_fee proportional.

    For withdrawals, the fee to be paid will be withdraw_fee + amount * withdraw_fee_proportional.

    This allows for both fixed fees and fees that are proportional to the transacted amount.

    with regards

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.