Forum Replies Created
-
AuthorPosts
-
July 27, 2020 at 9:56 am in reply to: How to deposit, withdraw, trade fiat currencies and checkout a cart #8964
alexg
KeymasterHello,
How does admin manually add up or subtract a user fiat balance from the admin panel?
There is by design no direct way for an admin to alter fiat balances or other balances. However there are some exceptions:
1. You can always perform an airdrop of fiat or other coins to a user role.
2. As an admin you can also perform a fiat deposit to a user. Simply get the user’s deposit “address” for that fiat coin, from Wallets → Deposit addresses. Then go to Tools → Fiat Deposits, enter the deposit “address” in the “reference code” field, and on the next screen enter an amount to deposit.
3. In the Wallets → Transactions screen, you can see all transactions, including fiat deposits. As an admin, you can cancel any such deposit. Cancelling a deposit means that the amount is no longer added to the user’s balance.how do users transfer fiat balances to each other?
Using the
[wallets_move]
UI, just like with any other crypto coin.how do users purchase a coin, product with their fiat balance?
Normally users would perform bank transfers to deposit fiat currencies, as described in the adapter’s homepage. Users would then use the special UIs
[wallets_fiat_deposit]
and[wallets_fiat_withdraw]
. Please see the adapter’s homepage for details.You ask how users can purchase a fiat coin. Users can purchase a coin from the exchange extension, as long as you have set up the appropriate markets. There must also be limit orders on the orderbook, so that users can then trade their other coins with that fiat coin. If all of the above is set up, then users can use any one of the order placement UIs:
[wallets_exchange_market_buy]
– Allows user to place an instant market order to buy the quote against the base.[wallets_exchange_market_sell]
– Allows user to place an instant market order to sell the quote against the base.[wallets_exchange_limit_buy]
– Allows user to place a limit order to buy the quote against the base.[wallets_exchange_limit_sell]
– Allows user to place a limit order to sell the quote against the base.[wallets_exchange_market_order]
– Allows user to easily exchange a cryptocurrency for another by placing a market buy or sell order on an appropriate market.
how do users purchase a coin, product with their fiat balance?
Finally you asked how users can purchase a product using a fiat coin. The process is no differnt than with other cryptocurrencies.
IF the exchange rate between that coin and the WooCommerce default currency is known (see Wallets → Exchange Rates), AND if the user holds sufficient balance to pay for a cart, then the user will be presented with an option to pay with that fiat currency on the cart checkout. For more information on how checkout works, read the Payment Gateway homepage under “Troubleshooting” and “FAQ”.with regards
P.S. In the future if possible please post one question per thread if you can. This makes it easier for me and for others reading this forum later.
alexg
KeymasterHello,
Indeed it would be a really big change.
I would first have to analyze a few of the competing protocols and then see how they can be made to fit the plugin.
I will make a note of it in my backlog to investigate. But it is unlikely that I could implement such a change, so do not anticipate it.
with regards
alexg
KeymasterHello,
I have moved this into a new thread as it is unrelated to the previous issue that got resolved.
Every fork of TurtleCoin has a number of decimals associated with it. ARMS has 4 decimals (I double checked). This means that any integer value reported by the
wallet-api
must be divided by 10^4.Please do all of the following:
1. What is the content of
wp-content/plugins/wallets-turtlecoin/assets/coins.csv
?2. You mentioned earlier that you were expecting to see 8 decimals, rather than 4. I had given you some sample code of how to use the
wallets_turtle_coins
filter to modify the number of decimals.2.1 Remove this code altogether if you still have it.
2.2 Also, delete all DB data with the following SQL query:
DELETE FROM wp_wallets_txs WHERE symbol='ARMS'; DELETE FROM wp_wallets_adds WHERE symbol='ARMS';
2.3 Also delete the following transient with the following wp-cli shell command, so that the scan restarts:
wp transient delete trtl-ARMS-settings-max-height
2.4 Let the adapter start to resync.
What do you see now? Are the decimals correct?
with regards
July 24, 2020 at 1:49 am in reply to: I’m getting ready to replace my hacked up monero adapter with yours #8948alexg
KeymasterNot sure but I believe that when the scan finishes, your user balances may not be correct.
1. If a balance is negative, is it possible that you have deleted or cancelled a deposit?2. The hot wallet balance will remain as is after the plugin syncs with the wallet.
If your blockchain daemon is synced to the network, and the wallet api is synced to the blockchain, then the plugin will also sync. If you want to make the plugin go faster, you can go to Wallets -> Cron job and trigger the cron job url several times.
It would be best if you could start with a new wallet and empty wp_wallets_txs DB table, if you are building a new site.
Please let me know what you find.
with regards
July 23, 2020 at 6:59 am in reply to: I’m getting ready to replace my hacked up monero adapter with yours #8943alexg
KeymasterThe number of decimals is set in the filter that defines the coins.
The filter is initialized with values in assets/coins.csv
ARMS,2ACoin,100,0.00001,arms:%s,%01.4f,https://explorer.2acoin.org/?hash=%s#blockchain_transaction,,4
%01.4f is the pattern for displaying amounts, and the last value of 4 is the number of decimals. These values should match.
To modify the values, use the
wallets_turtle_coins
filter described in the adapter’s homepage, to modify the values. Something like:function wallets_turtlecoin_adapter_filter( $coins ) { $coins['ARMS']['amount pattern'] = '%01.8f'; $coins['ARMS']['decimals'] = 8; return $coins; } add_filter( 'wallets_turtle_coins', 'wallets_turtlecoin_adapter_filter' );
However, I don’t think it’s necessary, as 2ACoin has 4 decimals I believe.
with regards
EDIT: Changed
$coins['2ACOIN']
to the correct indexing,$coins['ARMS']
.July 23, 2020 at 6:51 am in reply to: I’m getting ready to replace my hacked up monero adapter with yours #8942alexg
KeymasterHello,
That’s great news!
To understand the differences between the “Hot Wallet Balance”, “User Balances”, and “Unavailable Balance”, see the Glossary chapter in the documentation.
In short, the “Hot Wallet Balance” is the result of the
/balance
call to thewallet-api
. The “User Balance” is the sum of transactions for any one user.To find out why your balance is negative, inspect your user’s transactions.
The adapter is supposed to scan the wallet on each cron job, with increasing block heights to conserve bandwidth. The first time it retrieves most of the transactions, and on subsequent runs it scans the remaining blocks that have not yet been scanned. This is expected behavior. If you want to see the logic behind this, it’s at the function
cron_discover_deposits()
.with regards
alexg
KeymasterNormally the plugin assigns the correct capabilities, but for whatever reason this didn’t work for you.
You can use any capability-editing plugin to assign the following to the admin user (or to the Administrator role):
publish_airdrops
edit_airdrops
edit_others_airdrops
delete_airdrops
delete_others_airdrops
read_private_airdrops
edit_airdrop
delete_airdrop
read_airdropalexg
KeymasterOK, but see the FAQ under “I want to do changes to the plugin’s code.”
Also, this doesn’t solve the issue of why you even saw the error in the first place. If you want to investigate this further, disable the other plugins and test the checkout again. Normally the plugin doesn’t allow a user to checkout with a coin that has insufficient balance.
with regards
alexg
KeymasterHello,
This looks like a serious DB error.
In the plugin there are checks to verify the consistency of its DB tables. The tables that hold deposit addresses and transactions seem to not have any indices.
I’m guessing that either you or someone else must have backed up and restored the database in an improper way. This can happen when someone is transferring a site to a different server. Alternatively, your site may have been hacked.
First, check to see if these two tables exist and have data in them. You can see this from the MySQL console or PHPMyAdmin. Type the following queries to see if the tables exist and have the proper columns:
describe wp_wallets_txs;
describe wp_wallets_adds;
And to check if the tables have data:
select count(*) from wp_wallets_txs;
select count(*) from wp_wallets_adds;
If unsure about the output, email me the results and we’ll see what’s going on.
In any case, check to see if you can restore your site from a backup and check your access logs for any signs of intrusion.
If the site was hacked you will need to investigate how the breach happened, otherwise it will happen again. You should also contact your hosting provider about it. Also, keep a safe copy of the web server’s access logs because they may contain evidence.
Hope this helps. Let me know what you found over email.
with regards
alexg
KeymasterHello,
You can use one of the following two shortcodes, depending on which type of CAPTCHA you want to use:
[wallets_faucet symbol="BYTN" captcha="recaptcha"]
[wallets_faucet symbol="BYTN" captcha="solvemedia"]
with regards
alexg
KeymasterHello,
You can control this behavior at “Wallets” -> “Confirms” -> “Withdraw transaction confirmations” -> “Admin confirmation required”.
with regards
July 21, 2020 at 5:21 pm in reply to: I’m getting ready to replace my hacked up monero adapter with yours #8917alexg
KeymasterAlternatively you could go to Performance -> General Settings -> Database Cache and change Database Cache Method: from memcached to disk. This will use your
wp-content/cache
dir for caching. It will be somewhat slower but it should work. If it does, then you can go ahead and debug your memcached server.July 21, 2020 at 4:55 pm in reply to: I’m getting ready to replace my hacked up monero adapter with yours #8916alexg
KeymasterOK, so there’s your culprit. Can you disable W3 Total Cache and try again?
Normally it should work as it is, but it looks like W3TC or memcached may be misconfigured, so transients are not stored.
July 21, 2020 at 4:16 pm in reply to: I’m getting ready to replace my hacked up monero adapter with yours #8914alexg
KeymasterAlso check to see if the
wp-content/cache
directory is writable by your HTTP server’s user:group (usuallywww-data:www-data
).For more information about the default object cache, see this article: https://perishablepress.com/how-to-enable-the-default-wordpress-object-cache/
July 21, 2020 at 4:11 pm in reply to: I’m getting ready to replace my hacked up monero adapter with yours #8913alexg
KeymasterWhile most options are saved as options, the secrets are stored as transients. If your object cache were misbehaving, you would get this issue.
What is the output of the command
wp cache type
? This is a wp-cli command that will determine the type of object cache installed. -
AuthorPosts