dashed-slug.net › Forums › CoinPayments.net Wallet Adapter extension support › Getting withdrawal settings for a CoinPayments coin in PHP
Tagged: fee, minimum withdrawal amount, option, php, withdrawal, withdrawal fee
- This topic has 3 replies, 2 voices, and was last updated 2 years, 10 months ago by alexg.
-
AuthorPosts
-
February 5, 2022 at 8:40 pm #11420AnonymousInactive
im curious as to where this page is saved in the DB?
one reason is we are doing a different UI and we want to check these on the fly
Minimum withdrawal amount
Withdrawal fee (fixed)figured there was just a way to do a DB call to find that info
Thanks
February 7, 2022 at 9:41 am #11426alexgKeymasterHello,
I can help you find the data in the DB (but this will change in the upcoming wallets6 release).
In the current CoinPayments adapter, every coin has its slug prefix. In
wallets-cp.php
, notice the code:foreach ( $this->coins as $symbol => &$coin ): $coin_option_slug = preg_replace( '/\W/', '-', 'wallets-cp-' . strtolower( $symbol ) . '-settings' ); $enabled = Dashed_Slug_Wallets::get_option( "{$coin_option_slug}-general-enabled" );
So, a coin with ticker symbol XYZ will typically have a prefix of:
wallets-cp-xyz-settings
. If the ticker symbol contains characters that are not letters, then these characters are replaced with a dash (-
).The withdraw fee is in the option:
wallets-cp-xyz-settings-fees-withdraw
And the minimum withdrawal amount is in the option:
wallets-cp-xyz-settings-general-minwithdraw
You can get these values with get_option.
It was necessary to change this in wallets6 for a few reasons:
– Currencies and wallets will now be stored as posts.
– The currency settings are decoupled from the wallet settings for clarity.
– All amounts are now stored as integers to avoid floating point errors.So, in the upcoming release, these will be stored as meta values on the currency post. It will be very easy to retrieve a currency and check its fields. When the time comes, ask me again, if you want to adapt your UI code to wallets6. I promise it will not be hard to make the change.
with regards
February 7, 2022 at 7:10 pm #11432AnonymousInactivesweet thanks…
so will wallet 5 still work for a while , i know you mentioned it would a while back but wasn’t sure if that would remain the case.
February 8, 2022 at 9:13 am #11435alexgKeymasterHello,
Yes, wallets 5.x will work forever exactly as it works now, but it will not be updated any more and will gradually become obsolete.
And it will be up to you to update to wallets6 when you choose to do so.
Since you will have to make some small changes in your code: You can install wallets6 on a dev/integration machine and modify your code there, then deploy to live when you decide to upgrade to wallets6.
with regards
-
AuthorPosts
- You must be logged in to reply to this topic.