Exchange extension to Bitcoin and Altcoin Wallets for WordPress

🗠 Public chart and orderbook in exchange extension

A discussion on the latest beta version of the Exchange extension to the Bitcoin and Altcoin Wallets free WordPress plugin.

The latest beta version of the Exchange extension to the Bitcoin and Altcoin Wallets plugin for WordPress introduces a much requested improvement, as well as a bug fix that causes some breaking changes to the trade histories views.

Public graph

A much requested feature was for a user to be able to view the market chart and the orderbook even if not logged in. To this end, the frontend JavaScript and JSON APIs were hacked to make this possible. This is the reason that this latest beta requires version 3.9.1 of its parent plugin, so make sure to install that first (TGMPA will still warn you if you don’t).

Market and user histories

It turns out that the DB schema of the Exchange extension was previously flawed in that it did not correctly capture the 1..n relation of orders to trades. Trades were therefore not easily accessible to display histories and market prices. This resulted in some history displays missing a few trades. This was only an issue with displaying the history, orders were still executed correctly.

This is now fixed with the introduction of a new table in the DB schema that captures individual trades. Market and user histories, as well as OHLC (candlestick) data are now derived from this table. A side-effect is that any existing trade histories will no longer be displayed. The [wallets_exchange_market_history] and [wallets_exchange_user_history] shortcodes will only display trades that occurred with version 0.5.0-beta or later.

A new JSON API endpoint is introduced for getting user trade histories. This is get_user_history. The corresponding PHP API is the filter wallets_api_trades.

DB error reporting

The error reporting feature of this plugin is now greatly improved. Any DB errors are now reported in a uniform way via the JSON API.

Comments:0

Leave a Reply

Your email address will not be published. Required fields are marked *