Forum Replies Created
-
AuthorPosts
-
alexgKeymaster
Thank you.
This is a common issue with TGMPA, I have seen it before.
Some themes do not load TGMPA correctly because they assume that no other plugin is using that same library.
Simply delete the file
wp-content/plugins/wallets-airdrop/includes/third-party/TGM-Plugin-Activation/class-tgm-plugin-activation.php
This should resolve the problem.
Ideally you should notify the theme developer about this. All themes and plugins must check if TGMPA is defined before attempting to redefine it. Unfortunately some themes do not include the latest version of TGMPA that does this extra check.
with regards
alexgKeymasterHello,
I have moved the block.io adapter to the wastedump, where old extensions go to die.
There were complaints about block.io from some users and in fact some people were saying that block.io is a scam site. I don’t know if these are true or not. But my implementation was somewhat slow and buggy, and the CoinPayments adapter is superior in every way (is faster and offers more coins). This is why I stopped working on the block.io adapter and am not advertising it any more.
If you are using it without issues, you can continue using it.
with regards
alexgKeymasterHello,
Can you please show me the entire error so I can help?
You should have received an email from your site, with a PHP error message and a stack trace.
Alternatively, the error should also be in your PHP error log.
with regards
alexgKeymasterHello,
You should not manipulate the
wp_wallets_txs
table directly for a number of reasons. Mainly, the table is going to be removed in the next major version 6.0.0 of the plugin. You are quite right that the table is kinda weird; in fact, in the past I have ranted about how bad this is, and I’m looking forward to get rid of it!Instead, to create a transfer, you can use the
wallets_api_move
action from the PHP API:https://wallets-phpdoc.dashed-slug.net/classes/Dashed_Slug_Wallets_PHP_API.html#method_api_move_action. This PHP API will be preserved in future versions of the plugin.
A gaming service is a very interesting application. If I may ask, are you developing this for use on your site only, or is it something that you plan to publish/sell somewhere?
with regards
https://mail.zoho.com/zm/#mail/folder/inbox/p/1645276382613100001
Hello,
Yes this is a typical problem. Hopefully there will not be any such issues once the WP-REST API becomes available. In the meantime, look into your cashing plugin and see if you can disable
alexgKeymasterHello @LeinAd,
I have replied to your email.
For the benefit of others reading this thread:
The
__wallets_exchange_action=get_market_orderbook
endpoint does not retrieve orders. Instead it retrieves the orderbook’s depth summary, where the market’s liquidity is shown in aggregate form. Limit orders with the same price are added into one row. Hence you wouldn’t expect Order IDs in the output.To retrieve individual orders, use the endpoint:
__wallets_exchange_action=get_user_orders
. The API is explained in the documentation.with regards
alexgKeymasterHello,
Normally the hot wallet balance should be updated after 30 seconds at most. The same hot wallet balance should be shown in the Cold Storage screens and in the Adapters list screen.
For coin with ticker symbol
XYZ
, the hot wallet balance is cached for 30 seconds in the transientwallets_get_balance_XYZ
. So, for bitcoin, the hot wallet balance will be cached inwallets_get_balance_BTC
.After 30 seconds the transient will expire, and the new value will be read from the wallet and shown again.
Unfortunately some server cache plugins, when not correctly configured, fail to expire transients as specified by the WordPress API. To verify that this is the problem with your setup, go enable the checkbox at Wallets → Frontend Settings → Disable transients (debug) and hit “Save Changes”. This issue will cause problems with other plugins as well.
Do this only to verify that this is the problem. Your site will become slow if you leave this setting on.
After you verify that the problem is related to your caching plugin, check its settings again. For example, if you’ve enabled memcached support but you don’t have a memcached server, this could happen. I’m sorry but I don’t know under which specific conditions caching plugins do this. I only know that, when you delegate transients to caching plugins, then WordPress is no longer responsible for expiring transients, but delegates this to whatever mechanism you’re using.
I’ve tried to address this issue better in the upcoming wallets6 plugin.
with regards
alexgKeymasterHello Sage,
Yes, you should check any relevant firewalls, including software firewalls on your server.
If you have shell access on your WordPress machine, you can also use nc to check if the RPC port on the wallet server is reachable.
If the wallet server is down, then attempts to communicate with its RPC port will likely fail immediately, rather than timeout. The plugin can handle this without crashing. Only the coin on that wallet should become unavailable in the frontend UIs. If you plan to keep the server down for a while, you can deactivate the coin adapter just to be sure.
If you have any more questions please open a new thread.
with regards
P.S. In the upcoming wallets6 release, this behavior will change. Wallets will be decoupled from currencies, and therefore a currency will still be usable if the wallet is offline. Only deposits/withdrawals will obviously stop for as long as the wallet is offline.
alexgKeymasterHello,
When you visit your wordpress site, does the request complete or does it keep loading in the browser?
If it completes quickly, you should enable and check the WordPress debug log.
If it hangs and keeps loading, or times out after a round multiple of 10 or 15 seconds (e.g. 10,15,20,30,40,45,60 seconds), then this is typically an indication that the plugin tries to communicate to your wallet server, but encounters a firewall. This is typically your hosting provider’s firewall disallowing outgoing communication.
Talk to your WordPress host and explain to them that you need outgoing TCP connections to the port you’re using and to your wallet server’s IP. They will be able to add an exception rule to their firewall.
Let me know if after this you are not able to resolve the issue.
with regards
February 11, 2022 at 7:40 am in reply to: Adding a knockout.js data binding on the balance template #11457alexgKeymasterIf you want to hook into an event, you could subscribe to the observable for the selected currency:
wp.wallets.viewModels.wallets.selectedCoin.subscribe( function() { let coin = wp.wallets.viewModels.wallets.coins()[ wp.wallets.viewModels.wallets.selectedCoin() ]; let html = '<span class="button" href="?symbol=' + coin.symbol + '&balance=' + coin.balance + '">' + coin.name + '</span>'; console.log( html); } );
Not sure if this is what you are looking for. Again sorry, I know all of this is confusing, which is why I am currently improving it.
February 10, 2022 at 8:00 am in reply to: Adding a knockout.js data binding on the balance template #11453alexgKeymasterHello,
This would be so much easier if you were working on wallets6, but unfortunately it’s not ready for release just yet.
Oh well, I guess you could do this:
<a class="button" data-bind="attr: { href: '?symbol=' + selectedCoin() + '&balance=' + currentCoinBalance() }">Button!</a>
The mistake I did in the past is that in wallets 5.x the UI JavaScript is a big bunch of spaghetti code (wallets-ko.js). I have since changed the templates to make everything clear and self-contained and extendable. You’ll see 🙂
In any case, make sure you make your changes in a theme or child theme. The documentation explains how in: Frontend -> Template Modifications -> Modifying markup. TL;DR, you should copy balances.php to
wp-content/themes/YOURTHEMEORCHILDTHEME/templates/wallets/balances.php
and do your changes there…And if you do need to run any javascript on the UIs, you should run it after the data loads, on the
wallets_ready
bubbling event. So, to hook to that event, you would do:jQuery( 'body' ).on( 'wallets_coins_ready', function( event, coins ) { // TODO do your thing here! } );
Hope this helps.
alexgKeymasterThank you so much @megeanwasson! Your donation will go towards buying the coffee that is so necessary for development.
By LN I mean Lightning of course!
February 9, 2022 at 8:38 am in reply to: Problem connecting to full node wallet: Connection refused #11448alexgKeymasterHello,
What have you tried?
P.S. I have moved your issue to a new thread because it was not related to the other thread.
alexgKeymasterHello,
It looks like you are trying to create a whole plugin from scratch to process invoices. This is not something that the plugin does. I can’t guide your entire development effort for a new plugin. For that you probably need to create a different plugin. That includes doing the analysis and design, and choosing the appropriate technologies and architecture.
I can try to give you some pointers:
The code you posted is kinda wrong because it tries to read data from the wallets plugin via the browser’s DOM. You will likely encounter race conditions, where the data is not there at the time you are reading it. IF you wanted to read the user data, you should be using the
get_coins_info
call from JSON-API. BUT you probably don’t want to do this. You are trying to read addresses that YOUR code has generated, not the addresses that the wallets plugin has assigned to the users. So you must pass the data to the frontend in some other way.To do deposits to CoinPayments independently from the plugin, you must do a call to GetDepositAddress. This will give you back an address that belongs to your CP wallet and that will notify you whenever there is a deposit via IPN.
You must keep track of these addresses that you generate. This will probably be in the DB. It’s up to you how to store it, but don’t use the plugin’s tables. You can create your own custom SQL tables or use Custom Post Types, or even store the addresses in options, user meta, etc depending on your design.
Once you know which addresses you have generated, you can hook into an action such as
init
orparse_request
to listen for incoming IPNs. Since you will only be processing addresses that you know are generated with your plugin, these will not interfere with the existing IPN handler of the wallets plugin. You can then detect invoice payments and notify your users via email or any other way you see fit.The wallets plugin uses the JSON-API (and the upcoming WP-REST API) for communication between frontend and backend. It then uses frontend javascript to create the qr code. Whether your plugin renders your address as a qrcode in the frontend or backend is up to you.
In summary: If you are trying to create invoices, this is a different plugin. The wallets plugin as it is now, cannot be extended to accept invoices. You must create a different plugin from scratch. Think about your requirements, do an analysis, and you will see that it is not appropriate to extend this plugin for your use case.
I’m really sorry for being so negative, but it doesn’t look like I can help you more with this. It really sounds like someone who studied business, not engineering, gave you the task of adapting the plugin for a totally different technical requirement. You should get back to them and tell them that the decision of which software to use to achieve a business requirement, is a technical decision, and must be done by an engineer.
Best of luck with your project.
with regards
alexgKeymasterHello @dynamitemedia,
Any address that is not a registered deposit address can be used to increase the hot wallet balance.
The plugin checks all incoming transactions to the wallet. If a deposit address is associated with a user, the transaction debits the user balance. If not, the plugin ignores the transaction, and therefore it only increases the hot wallet balance.
To get the plugin’s cold storage deposit address, you can read it from an option. For example, to get the plugin’s Bitcoin cold storage deposit address:
get_option('wallets_cs_address_BTC');
To create a new wallet address communicate with the coin adapter directly. Example:
// get a hold of the coin adapters try { $adapters = apply_filters( 'wallets_api_adapters', array(), array( 'check_capabilities' => true, 'online_only' => true, ) ); } catch ( Exception $e ) { error_log( 'you do not have access to wallets' ); } // iterate over all the adapters and get a new address from each wallet foreach ( $adapters as $symbol => $adapter ) { try { $address = $adapter->get_new_address(); } catch ( Exception $e ) { error_log( "Could not get a new address for $symbol, because: " . $e->getMessage() ); continue; } error_log( "The new deposit address for $symbol is $address" ); // TODO you must somehow save the addresses somewhere if you want to use them }
Hope this helps.
with regards
February 8, 2022 at 9:13 am in reply to: Getting withdrawal settings for a CoinPayments coin in PHP #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