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: Getting withdrawal settings for a CoinPayments coin in PHP

dashed-slug.net Forums CoinPayments.net Wallet Adapter extension support Getting withdrawal settings for a CoinPayments coin in PHP Reply To: Getting withdrawal settings for a CoinPayments coin in PHP

#11426
alexg
Keymaster

Hello,

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