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!

alexg

Forum Replies Created

Viewing 15 posts - 1 through 15 (of 2,205 total)
  • Author
    Posts
  • in reply to: CP Wallet adapter not performing withdraws #13718
    alexg
    Keymaster

    Glad 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

    in reply to: CP Wallet adapter not performing withdraws #13715
    alexg
    Keymaster

    Hello,

    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

    in reply to: CP Wallet adapter not performing withdraws #13713
    alexg
    Keymaster

    Hello,

    To investigate, you can enable logging. Here’s instructions on how to do so:

    https://github.com/dashed-slug/wallets/blob/master/docs/troubleshooting.md#something-else-is-wrong-i-would-like-to-check-the-logs-for-any-errors-that-might-give-me-clues-as-to-whats-going-on

    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

    alexg
    Keymaster

    Hello,

    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:

    https://github.com/dashed-slug/wallets/blob/6.3.1/docs/developer.md#developing-wallet-adapters-wallet-adapters

    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 the do_withdrawals() call.

    Here’s how the withdrawals are implemented for Bitcoin core:

    https://github.com/dashed-slug/wallets/blob/6.3.1/adapters/class-bitcoin-core-like-wallet-adapter.php#L429-L593

    Deposits

    Implementing deposits is a two step process:

    1. Implement the get_new_address() method which should return a new DSWallets\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 deposit DSWallets\Transaction object, and pass it to do_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 the cron() 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 the DSWallets\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

    in reply to: Tip The Author Extension Deformating pages #13704
    alexg
    Keymaster

    Hello,

    I have published an updated version 3.1.0 to the extension with bbPress integration.

    You can read the release notes here:

    How to enable cryptocurrency tipping in bbPress forums

    with regards

    in reply to: Tip The Author Extension Deformating pages #13686
    alexg
    Keymaster

    Hello,

    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

    in reply to: Suggestion: simple currency swapping UI #13644
    alexg
    Keymaster

    Yes, that is correct. There are several APIs that you can interface with. Please let me know if you have any questions.

    in reply to: Suggestion: simple currency swapping UI #13641
    alexg
    Keymaster

    Hi. 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

    in reply to: Help with setting up the wallet and the adapters #13640
    alexg
    Keymaster

    OK, 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.

    in reply to: Help with setting up the wallet and the adapters #13635
    alexg
    Keymaster

    Hello,

    Please see the video series here:

    You can also study the installation instructions to see how to connect to a full node wallet:

    Bitcoin and Altcoin Wallets WordPress plugin

    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:

    CoinPayments.net Wallet Adapter extension

    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

    in reply to: Suggestion: simple currency swapping UI #13634
    alexg
    Keymaster

    Hello,

    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

    in reply to: php_curl error code 23 on site logs #13630
    alexg
    Keymaster

    Great 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

    in reply to: php_curl error code 23 on site logs #13622
    alexg
    Keymaster

    Hello,

    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

    alexg
    Keymaster

    Hello,

    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 a done or to a fail 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

    alexg
    Keymaster

    Hello,

    The code you provided does not work because you are creating a class Wallets that does not exist. There is a DSWallets\Wallet class that contains an adapter object of DSWallets\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

Viewing 15 posts - 1 through 15 (of 2,205 total)