Forum Replies Created
-
AuthorPosts
-
alexg
KeymasterGlad to hear that withdrawals are working for you!
The currency that pays for gas (in this case BNB), must be on the address that holds the token to be withdrawn. This is a limitation of CoinPayments. The plugin tries to move BNB around to fund addresses that hold tokens, so that these tokens are withdrawable. Of course these transfers also cost BNB. When you view in the plugin an address that holds a CP token, you can see whether there is enough gas on the address to facilitate withdrawal.
Hope this helps.
If you encounter any more problems with the plugin, please open a new topic or email me.
with regards
alexg
KeymasterHello,
Thank you for providing details from the logs.
1. First of all, is the currency that you are trying to withdraw a token or a coin? ERC-20 tokens suffer from an issue regarding gas fees, which is actually a limitation of the CP platform. The plugin has a gas management system but it requires setting up. (There is some further reading in the troubleshooting section of the CP adapter documentation about gas management for tokens.)
To test if withdrawals are working, you can use Litecoin testnet or Dogecoin or some other non-token currency.
2. The errors from the
DSWallets\Migration_Task
are to be expected if you have not used versions of the plugin before 6.0.0.3. I’m not sure about the
could_not_set
error: Maybe the cron jobs are not running? Deposits can work without the cron tasks, because they rely on IPNs.You can see if the crons are running at: “Dashboard” – “Bitcoin and Altcoin Wallets” -> “Debug” -> “Cron jobs last ran on:”
4. You mentioned that there were no log entries from the
Withdrawals_Task
. My apologies, I forgot to mention that you should also enable verbose logging from the plugin’s settings:“Settings” -> “Bitcoin & Altcoin Wallets” -> “Cron tasks” -> “Verbose logging”.
Shortly after you enable verbose logging there should be log entries from
Withdrawals_Task
even if nothing is withdrawn.Please let me know if you have questions about any of this.
with regards,
Alex
alexg
KeymasterHello,
To investigate, you can enable logging. Here’s instructions on how to do so:
Note that the plugin rotates over currencies and adapters, always running the next currency with an enabled adapter and with pending withdrawals.
Once you get some log output, look for lines from the
Withdrawals_Task
. There should be information there, or you can email me the logs and I can advise further.There should also be some withdrawal requests visible in your CoinPayments account. These will be at: https://www.coinpayments.net/acct-ipn-history
Hope this helps, let me know if you need help with the logs.
with regards
June 22, 2024 at 5:43 am in reply to: Integrating Custom Wallet Adapter Methods into UI Shortcode #13709alexg
KeymasterHello,
It sounds like you are doing something wrong.
If you have implemented the wallet adapter correctly, then you shouldn’t have to do anything else. You should be able to perform deposits and withdrawals via the plugin’s built-in UIs (
[wallets_deposit]
and[wallets_withdraw]
). The WP-REST API is useful only if you want to add new UIs, such as functionality that doesn’t already exist in the plugin.Available materials
The documentation and sample code for implementing a wallet adapter is here:
You can also study the Monero Wallet adapter which is available for free download, or the build-in Bitcoin core adapter, which works for any forks of Bitcoin core with the same RPC API (Litecoin, Dogecoin, Bitcoin Cash, etc).
I wouldrecommend that you start by following the instructions to setup the adapter and its settings. You may want to start from this template code: https://github.com/dashed-slug/my-wallet-adapter
Withdrawals
Implementing withdrawals is easy: just fill in the implementation for
do_withdrawals()
. Process the withdrawals and change their state on the withdrawal transactions afterwards. You can also set any TXID or timestamp or other data if you like. They will be saved by the plugin to the DB after thedo_withdrawals()
call.Here’s how the withdrawals are implemented for Bitcoin core:
Deposits
Implementing deposits is a two step process:
1. Implement the
get_new_address()
method which should return a newDSWallets\Address
for the wallet. This is what the shortcode[wallets_deposit]
displays.2. Implement deposit detection via polling: You would typically do this in the adapter’s
cron()
method which is called periodically. Once your cron code detects a new deposit, create a depositDSWallets\Transaction
object, and pass it todo_deposit()
from the abstract superclass:https://github.com/dashed-slug/wallets/blob/6.3.1/adapters/abstract-wallet-adapter.php#L326
The adapter’s
cron()
method gets called on cron runs, but not on every one. The plugin rotates between all active wallet adapters, and calls thecron()
method of only one adapter each time. To see what cron tasks are run, you can enable verbose logging from the plugin’s settings.The withdrawals are executed by the
DSWallets\Withdrawals_Task
cron.The
cron()
method is executed by theDSWallets\Adapters_Task
cron.If you end up publishing your adapter, let me know if you want me to add a link from this website to the adapter.
Hope this helps. Please do contact me with any questions you may have about the plugin.
with regards
alexg
KeymasterHello,
I have published an updated version
3.1.0
to the extension with bbPress integration.You can read the release notes here:
with regards
alexg
KeymasterHello,
The extension was not designed with bbpress forums in mind.
It can attach to most custom post types as long as the post type is shown using a WordPress loop.
I am taking a note of your request. If I can find some time, I will work on it and let you know.
with regards
alexg
KeymasterYes, that is correct. There are several APIs that you can interface with. Please let me know if you have any questions.
alexg
KeymasterHi. This depends on your level of proficiency with PHP and JavaScript as well as the WordPress APIs.
If you are a developer, you can start by looking at the templates, and also the plugin’s developer documentation: https://github.com/dashed-slug/wallets/blob/master/docs/developer.md
I believe that the
[[wallets_exchange_market_order]]
shortcode is what you initially described.If you have a plan on what you want to do, let me know about any technical questions and I will try to put you in the right direction.
with regards
alexg
KeymasterOK, I’m not sure what you are hoping to do then?
The plugin works with these types of technologies: https://www.dashed-slug.net/howto-choose-between-available-wallet-adapters/
Please let me know if you have any questions about this.
alexg
KeymasterHello,
Please see the video series here:
You can also study the installation instructions to see how to connect to a full node wallet:
If you would rather connect to a CoinPayments adapter rather than a full node wallet, you can study the installation instructions for the CoinPayments adapter instead:
The plugin and all its extensions come with extensive documentation under the menu item “Wallets Admin Docs”.
Please let me know if you have any questions about anything.
with regards
alexg
KeymasterHello,
Thank you for your feedback.
Unfortunately I am unable to implement suggestions or create new extensions.
However, if you are using the Exchange extension, and if you can provide liquidity to a market by setting limit orders in that market, then you can use the shortcode:
[wallets_exchange_market_order]
with no arguments.The UI will determine which currency pairs are tradeable based on the availability of markets on your system, and will show a simple UI with two dropdowns.
For more details see the relevant release notes:
💱 Easy crypto swapping UI, plus theme-able templates for the Exchange extension
Please let me know if you have any questions about this.
with regards
alexg
KeymasterGreat to hear that you resolved the curl issue.
This is not an error, it’s just a notice, informing you that upon plugin activation your admin user was given the
manage_wallets
capability:https://github.com/dashed-slug/wallets/blob/6.2.5/admin/capabilities.php#L310
You should be good to go. Please let me know in a new thread if you have any more questions about the plugin.
with regards
alexg
KeymasterHello,
This error comes from the php_curl module. The module writes retrieved data from the web to a temporary file.
Here the plugin is simply querying Coingecko for some exchange rates. Since in this case the data is very small in size, this should not normally be a problem.
1. Check to see if the disk space on your web server is completely full. Only if the free space is 0 bytes this problem would arise. This could happen for example if you have left some logs running without logrotate.
2. Check to see that the wordpress directory and its subdirectories are writeable by the webserver (apache or nginx).
Depending on your system, you may need to do:
chown -R www-data:www-data /path/to/wordpress
But don’t just copy the command, check to see what the uid and gid should be, and check your system first. If you are not sure, take a full backup of your site first. This command can mess things up if you don’t know what you are doing.
In any one of these two cases, it is a misconfiguration of your web server. It is likely that this causes problems to more plugins than just this one. If someone else is administering your host for you, contact them about this.
Hope this helps.
Please let me know if you have any more questions.
with regards
April 12, 2024 at 6:42 am in reply to: Use of the plugin’s front end without the need for JavaScript #13612alexg
KeymasterHello,
The error you mentioned is unavoidable. It’s simply the plugin checking whether there needs to be a migration from the old custom SQL tables that existed in versions before
6.0.0
. Nothing to worry about.If you enable verbose logging in the settings, you will get more detail in the wordpress debug log on how the transactions are executed.
The available balance does not count pending transactions, while the normal user balance does.
Transactions, including deposits and withdrawals should be initiated in a
pending
state by your code, then they should either transition into adone
or to afail
state by the wallet adapter. Does your transaction remain in a pending state?I am not sure what the problem you describe is. Can you please provide screenshots of the currency page and of the transaction page screens? You can either post them here or email me, whichever you prefer.
Looking forward to your reply.
with regards
April 11, 2024 at 4:36 am in reply to: Use of the plugin’s front end without the need for JavaScript #13608alexg
KeymasterHello,
The code you provided does not work because you are creating a class
Wallets
that does not exist. There is aDSWallets\Wallet
class that contains an adapter object ofDSWallets\Wallet_Adapter
class. The wallet adapter is an object that holds the connection information to the wallet as well as the code to communicate with the wallet. You can call get_new_address on the wallet adapter to get a new address.Once you have a
$currency
object, here’s how to generate a new address:$new_address = $currency->wallet->adapter->get_new_address( $currency );
(It’s necessary to pass the currency into the method because there are wallets with multiple currencies e.g. CoinPayments wallet)
It’s best to wrap this in a try..catch, because if there is any problem with communication with the wallet, this can throw.
So, to put it all together:
try {
$new_address = $currency->wallet->adapter->get_new_address( $currency );
} catch ( \Exception $e ) {
error_log( “Could not generate a new address for $currency because: ” . $e.getMessage() );
}In general, the UIs that require JavaScript, communicate with the plugin via its RESTful API, which is here and documented here.
If you check out the code for the various API endpoints, you can see example code for the basic operations.
Hope this helps.
Please let me know if you have any more questions. I want to answer all of them and help you with your project.
with regards
-
AuthorPosts