API: assets & tidying

Cleaned up responses from /addresses/* endpoints
in that some return text/plain instead of application/json.

Removed need for class-local copy of ApiErrorFactory in
AddressesResource - using getInstance() instead.

Some work still needs to be done on annotating API errors.
API error examples in API UI rendered incorrectly - swagger-ui issue?

Removed repository-accessing code from api.models.*

Added /assets/order/{orderId} for fetching info on specific asset order.

NOTE: AssetRepository.getOrdersTrades() now returns trades where order is
initiating or target. (Previously was initiating order only).
qora.assets.Order.orphan() updated to reflect above change.

block-explorer.html fixed to use new API output.
This commit is contained in:
catbref
2018-12-13 12:22:46 +00:00
parent dcd19f8e42
commit 034cf5dee3
17 changed files with 344 additions and 335 deletions

View File

@@ -88,7 +88,7 @@
document.body.innerHTML = html;
XHR({
url: "/transactions/address/" + address,
url: "/transactions/search?address=" + address,
onload: renderAddressTransactions,
responseType: "json"
});
@@ -137,7 +137,7 @@
}
function renderBlockInfo(e) {
var blockData = e.target.response;
var blockData = e.target.response.block;
// These properties are currently emitted as base64 by API but likely to be base58 in the future, so convert them
var props = [ "signature", "reference", "transactionsSignature", "generatorPublicKey", "generatorSignature" ];
@@ -196,7 +196,7 @@
}
function listBlock(e) {
var blockData = e.target.response;
var blockData = e.target.response.block;
var ourHeight = blockData.height;
var blockTimestamp = new Date(blockData.timestamp).toUTCString();