Hello and thanks for your kind words!
The instructions below are for the current versions of wallets (before wallets6):
1. It is currently possible to export user balances into .csv from the adapters list, but you have to do it one coin at a time. Go to Wallets → Adapters → Your coin → Export.
2. If you prefer, you can run your own SQL query. Assuming that your WordPress db prefix is db_:
SELECT
u.ID as user_id,
u.user_login AS account_name,
u.user_email,
t.symbol,
SUM( IF( t.amount > 0, t.amount - t.fee, t.amount ) ) AS balance
FROM
wp_wallets_txs
LEFT JOIN wp_users u ON u.ID = t.account
WHERE
t.status = 'done'
GROUP BY
t.account,
t.symbol
ORDER BY
t.symbol,
u.ID ASC;
But be careful: IF you are on a multisite installation, AND the plugin is NOT network activated, then you also need to filter by blog_id=N in your WHERE clause. N being the number of the site where the plugin is installed. Usually this will not be needed.
Hope this helps.
Note that in the upcoming wallets6 release, the SQL tables will be replaced with CPTs, so the SQL query won’t work. But there will be a simple PHP helper function that returns all the user balances.
Thanks for this! Do you know if it’s possible to automate the exports daily or when theres a change? Want to use the data to give a new balance total.
When are you looking to release wallet6?
Hello,
You can call the above code via a linux cron job on your server. There’s multiple ways to do this.
The release is only weeks away, possibly less. I am currently doing integration testing and have already tested 7 out of 9 components. For more details on the upcoming release, see here and here.