2018-12-09 16:26:04 -07:00
|
|
|
<!doctype html>
|
|
|
|
<html lang="en">
|
|
|
|
<head>
|
|
|
|
<meta charset="utf-8">
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
|
|
|
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
|
|
|
|
<style>
|
|
|
|
.row {
|
|
|
|
margin-top: 1%;
|
|
|
|
}
|
|
|
|
</style>
|
2018-12-10 09:22:37 -07:00
|
|
|
<title>Blockbook Websocket Test Page</title>
|
2018-12-09 16:26:04 -07:00
|
|
|
<script>
|
|
|
|
var ws;
|
|
|
|
var messageID;
|
|
|
|
var pendingMessages;
|
|
|
|
var subscriptions;
|
|
|
|
function send(method, params, callback) {
|
2018-12-11 03:50:43 -07:00
|
|
|
var id = messageID.toString();
|
2018-12-09 16:26:04 -07:00
|
|
|
messageID++;
|
|
|
|
pendingMessages[id] = callback;
|
|
|
|
var req = {
|
|
|
|
id,
|
|
|
|
method,
|
|
|
|
params
|
|
|
|
}
|
|
|
|
ws.send(JSON.stringify(req));
|
|
|
|
return id;
|
|
|
|
}
|
|
|
|
function subscribe(method, params, callback) {
|
2018-12-11 03:50:43 -07:00
|
|
|
var id = messageID.toString();
|
2018-12-09 16:26:04 -07:00
|
|
|
messageID++;
|
|
|
|
subscriptions[id] = callback;
|
|
|
|
var req = {
|
|
|
|
id,
|
|
|
|
method,
|
|
|
|
params
|
|
|
|
}
|
|
|
|
ws.send(JSON.stringify(req));
|
|
|
|
return id;
|
|
|
|
}
|
2018-12-11 03:50:43 -07:00
|
|
|
function unsubscribe(method, id, params, callback) {
|
|
|
|
delete subscriptions[id];
|
|
|
|
pendingMessages[id] = callback;
|
|
|
|
var req = {
|
|
|
|
id,
|
|
|
|
method,
|
|
|
|
params
|
|
|
|
}
|
|
|
|
ws.send(JSON.stringify(req));
|
|
|
|
return id;
|
|
|
|
}
|
2018-12-09 16:26:04 -07:00
|
|
|
function connect(server) {
|
|
|
|
messageID = 0;
|
2018-12-11 03:50:43 -07:00
|
|
|
pendingMessages = {};
|
|
|
|
subscriptions = {};
|
|
|
|
subscribeNewBlockId = "";
|
|
|
|
subscribeAddressesId = "";
|
2018-12-09 16:26:04 -07:00
|
|
|
if (server.startsWith("http")) {
|
2018-12-11 03:50:43 -07:00
|
|
|
server = server.replace("http", "ws");
|
2018-12-09 16:26:04 -07:00
|
|
|
}
|
|
|
|
if (!server.endsWith("/websocket")) {
|
|
|
|
server += "/websocket";
|
|
|
|
}
|
|
|
|
ws = new WebSocket(server);
|
|
|
|
ws.onopen = function (e) {
|
|
|
|
console.log('socket connected', e);
|
|
|
|
document.getElementById('connectionStatus').innerText = "connected";
|
|
|
|
};
|
|
|
|
ws.onclose = function (e) {
|
|
|
|
console.log('socket closed', e);
|
|
|
|
document.getElementById('connectionStatus').innerText = "disconnected";
|
|
|
|
};
|
|
|
|
ws.onerror = function (e) {
|
|
|
|
console.log('socket error ', e);
|
|
|
|
document.getElementById('connectionStatus').innerText = "error";
|
|
|
|
};
|
|
|
|
ws.onmessage = function (e) {
|
|
|
|
console.log('resp ' + e.data);
|
|
|
|
var resp = JSON.parse(e.data);
|
|
|
|
var f = pendingMessages[resp.id];
|
|
|
|
if (f != undefined) {
|
|
|
|
delete pendingMessages[resp.id];
|
|
|
|
f(resp.data);
|
|
|
|
} else {
|
|
|
|
f = subscriptions[resp.id];
|
|
|
|
if (f != undefined) {
|
|
|
|
f(resp.data);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
console.log("unkown response " + resp.id);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2018-12-18 01:52:46 -07:00
|
|
|
function getInfo() {
|
|
|
|
const method = 'getInfo';
|
|
|
|
const params = {
|
|
|
|
};
|
|
|
|
send(method, params, function (result) {
|
|
|
|
document.getElementById('getInfoResult').innerText = JSON.stringify(result).replace(/,/g, ", ");
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2019-07-19 06:59:03 -06:00
|
|
|
function ping() {
|
|
|
|
const method = 'ping';
|
|
|
|
const params = {
|
|
|
|
};
|
|
|
|
send(method, params, function (result) {
|
|
|
|
document.getElementById('pingResult').innerText = JSON.stringify(result).replace(/,/g, ", ");
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2019-01-04 08:10:24 -07:00
|
|
|
function getBlockHash() {
|
|
|
|
const method = 'getBlockHash';
|
|
|
|
const height = parseInt(document.getElementById("getBlockHashHeight").value);
|
|
|
|
const params = {
|
|
|
|
height
|
|
|
|
};
|
|
|
|
send(method, params, function (result) {
|
|
|
|
document.getElementById('getBlockHashResult').innerText = JSON.stringify(result).replace(/,/g, ", ");
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2018-12-09 16:26:04 -07:00
|
|
|
function getAccountInfo() {
|
|
|
|
const descriptor = document.getElementById('getAccountInfoDescriptor').value.trim();
|
|
|
|
const selectDetails = document.getElementById('getAccountInfoDetails');
|
|
|
|
const details = selectDetails.options[selectDetails.selectedIndex].value;
|
|
|
|
const page = parseInt(document.getElementById("getAccountInfoPage").value);
|
2018-12-14 08:42:35 -07:00
|
|
|
const from = parseInt(document.getElementById("getAccountInfoFrom").value);
|
|
|
|
const to = parseInt(document.getElementById("getAccountInfoTo").value);
|
|
|
|
const contractFilter = document.getElementById("getAccountInfoContract").value.trim();
|
2018-12-09 16:26:04 -07:00
|
|
|
const pageSize = 10;
|
|
|
|
const method = 'getAccountInfo';
|
2019-03-01 07:25:16 -07:00
|
|
|
const tokens = "derived"; // could be "nonzero", "used", default is "derived" i.e. all
|
2018-12-09 16:26:04 -07:00
|
|
|
const params = {
|
|
|
|
descriptor,
|
|
|
|
details,
|
2019-03-01 07:25:16 -07:00
|
|
|
tokens,
|
2018-12-09 16:26:04 -07:00
|
|
|
page,
|
|
|
|
pageSize,
|
2018-12-14 08:42:35 -07:00
|
|
|
from,
|
|
|
|
to,
|
|
|
|
contractFilter
|
2019-06-18 04:21:22 -06:00
|
|
|
// default gap=20
|
2018-12-09 16:26:04 -07:00
|
|
|
};
|
|
|
|
send(method, params, function (result) {
|
|
|
|
document.getElementById('getAccountInfoResult').innerText = JSON.stringify(result).replace(/,/g, ", ");
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2019-01-14 09:12:33 -07:00
|
|
|
function getAccountUtxo() {
|
|
|
|
const descriptor = document.getElementById('getAccountUtxoDescriptor').value.trim();
|
|
|
|
const method = 'getAccountUtxo';
|
|
|
|
const params = {
|
|
|
|
descriptor,
|
|
|
|
};
|
|
|
|
send(method, params, function (result) {
|
|
|
|
document.getElementById('getAccountUtxoResult').innerText = JSON.stringify(result).replace(/,/g, ", ");
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2019-12-17 06:37:24 -07:00
|
|
|
function getBalanceHistory() {
|
|
|
|
const descriptor = document.getElementById('getBalanceHistoryDescriptor').value.trim();
|
2019-12-17 16:02:24 -07:00
|
|
|
const from = document.getElementById("getBalanceHistoryFrom").value.trim();
|
|
|
|
const to = document.getElementById("getBalanceHistoryTo").value.trim();
|
2019-12-17 06:37:24 -07:00
|
|
|
const fiat = document.getElementById("getBalanceHistoryFiat").value.trim();
|
|
|
|
const method = 'getBalanceHistory';
|
|
|
|
const params = {
|
|
|
|
descriptor,
|
|
|
|
from,
|
|
|
|
to,
|
|
|
|
fiat
|
|
|
|
// default gap=20
|
|
|
|
};
|
|
|
|
send(method, params, function (result) {
|
|
|
|
document.getElementById('getBalanceHistoryResult').innerText = JSON.stringify(result).replace(/,/g, ", ");
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2019-01-16 08:10:30 -07:00
|
|
|
function getTransaction() {
|
|
|
|
const txid = document.getElementById('getTransactionTxid').value.trim();
|
|
|
|
const method = 'getTransaction';
|
|
|
|
const params = {
|
|
|
|
txid,
|
|
|
|
};
|
|
|
|
send(method, params, function (result) {
|
|
|
|
document.getElementById('getTransactionResult').innerText = JSON.stringify(result).replace(/,/g, ", ");
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2019-03-01 07:37:38 -07:00
|
|
|
function getTransactionSpecific() {
|
|
|
|
const txid = document.getElementById('getTransactionSpecificTxid').value.trim();
|
|
|
|
const method = 'getTransactionSpecific';
|
|
|
|
const params = {
|
|
|
|
txid,
|
|
|
|
};
|
|
|
|
send(method, params, function (result) {
|
|
|
|
document.getElementById('getTransactionSpecificResult').innerText = JSON.stringify(result).replace(/,/g, ", ");
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2018-12-18 01:52:46 -07:00
|
|
|
function estimateFee() {
|
|
|
|
try {
|
|
|
|
var blocks = document.getElementById('estimateFeeBlocks').value.split(",");
|
|
|
|
var specific = document.getElementById('estimateFeeSpecific').value.trim();
|
|
|
|
if (specific) {
|
|
|
|
// example for bitcoin type: {"conservative": false,"txsize":1234}
|
|
|
|
// example for ethereum type: {"from":"0x65513ecd11fd3a5b1fefdcc6a500b025008405a2","to":"0x65513ecd11fd3a5b1fefdcc6a500b025008405a2","data":"0xabcd"}
|
|
|
|
specific = JSON.parse(specific)
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
specific = undefined;
|
|
|
|
}
|
|
|
|
blocks = blocks.map(s => parseInt(s.trim()));
|
|
|
|
const method = 'estimateFee';
|
|
|
|
const params = {
|
|
|
|
blocks,
|
|
|
|
specific
|
|
|
|
};
|
|
|
|
send(method, params, function (result) {
|
|
|
|
document.getElementById('estimateFeeResult').innerText = JSON.stringify(result).replace(/,/g, ", ");
|
|
|
|
});
|
|
|
|
}
|
|
|
|
catch (e) {
|
|
|
|
document.getElementById('estimateFeeResult').innerText = e;
|
|
|
|
}
|
2018-12-15 16:26:41 -07:00
|
|
|
}
|
|
|
|
|
2018-12-09 16:26:04 -07:00
|
|
|
function sendTransaction() {
|
|
|
|
var hex = document.getElementById('sendTransactionHex').value.trim();
|
|
|
|
const method = 'sendTransaction';
|
|
|
|
const params = {
|
|
|
|
hex,
|
|
|
|
};
|
|
|
|
send(method, params, function (result) {
|
|
|
|
document.getElementById('sendTransactionResult').innerText = JSON.stringify(result).replace(/,/g, ", ");
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
function subscribeNewBlock() {
|
|
|
|
const method = 'subscribeNewBlock';
|
|
|
|
const params = {
|
|
|
|
};
|
2018-12-11 03:50:43 -07:00
|
|
|
if (subscribeNewBlockId) {
|
|
|
|
delete subscriptions[subscribeNewBlockId];
|
|
|
|
subscribeNewBlockId = "";
|
|
|
|
}
|
|
|
|
subscribeNewBlockId = subscribe(method, params, function (result) {
|
|
|
|
document.getElementById('subscribeNewBlockResult').innerText += JSON.stringify(result).replace(/,/g, ", ") + "\n";
|
|
|
|
});
|
2018-12-11 04:14:05 -07:00
|
|
|
document.getElementById('subscribeNewBlockId').innerText = subscribeNewBlockId;
|
|
|
|
document.getElementById('unsubscribeNewBlockButton').setAttribute("style", "display: inherit;");
|
2018-12-11 03:50:43 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
function unsubscribeNewBlock() {
|
|
|
|
const method = 'unsubscribeNewBlock';
|
|
|
|
const params = {
|
|
|
|
};
|
|
|
|
unsubscribe(method, subscribeNewBlockId, params, function (result) {
|
|
|
|
subscribeNewBlockId = "";
|
2018-12-09 16:26:04 -07:00
|
|
|
document.getElementById('subscribeNewBlockResult').innerText += JSON.stringify(result).replace(/,/g, ", ") + "\n";
|
2018-12-11 03:50:43 -07:00
|
|
|
document.getElementById('subscribeNewBlockId').innerText = "";
|
|
|
|
document.getElementById('unsubscribeNewBlockButton').setAttribute("style", "display: none;");
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
function subscribeAddresses() {
|
|
|
|
const method = 'subscribeAddresses';
|
|
|
|
var addresses = document.getElementById('subscribeAddressesName').value.split(",");
|
|
|
|
addresses = addresses.map(s => s.trim());
|
|
|
|
const params = {
|
|
|
|
addresses
|
|
|
|
};
|
|
|
|
if (subscribeAddressesId) {
|
|
|
|
delete subscriptions[subscribeAddressesId];
|
|
|
|
subscribeAddressesId = "";
|
|
|
|
}
|
|
|
|
subscribeAddressesId = subscribe(method, params, function (result) {
|
|
|
|
document.getElementById('subscribeAddressesResult').innerText += JSON.stringify(result).replace(/,/g, ", ") + "\n";
|
2018-12-09 16:26:04 -07:00
|
|
|
});
|
2018-12-11 04:14:05 -07:00
|
|
|
document.getElementById('subscribeAddressesIds').innerText = subscribeAddressesId;
|
|
|
|
document.getElementById('unsubscribeAddressesButton').setAttribute("style", "display: inherit;");
|
2018-12-09 16:26:04 -07:00
|
|
|
}
|
|
|
|
|
2018-12-11 03:50:43 -07:00
|
|
|
function unsubscribeAddresses() {
|
|
|
|
const method = 'unsubscribeAddresses';
|
2018-12-09 16:26:04 -07:00
|
|
|
const params = {
|
|
|
|
};
|
2018-12-11 03:50:43 -07:00
|
|
|
unsubscribe(method, subscribeAddressesId, params, function (result) {
|
|
|
|
subscribeAddressesId = "";
|
|
|
|
document.getElementById('subscribeAddressesResult').innerText += JSON.stringify(result).replace(/,/g, ", ") + "\n";
|
|
|
|
document.getElementById('subscribeAddressesIds').innerText = "";
|
|
|
|
document.getElementById('unsubscribeAddressesButton').setAttribute("style", "display: none;");
|
2018-12-09 16:26:04 -07:00
|
|
|
});
|
2018-12-10 09:22:37 -07:00
|
|
|
}
|
2018-12-09 16:26:04 -07:00
|
|
|
|
Add fiat rates functionality (#316)
* Add initial commit for fiat rates functionality
* templates.go: use bash from current user's environment
* bitcoinrpc.go: add FiatRates and FiatRatesParams to config
* blockbook.go: add initFiatRatesDownloader kickoff
* bitcoin.json: add coingecko API URL
* rockdb.go: add FindTicker and StoreTicker functions
* rocksdb_test.go: add a simple test for storing and getting FiatRate tickers
* rocksdb: add FindLastTicker and convertDate, make FindTicker return strings
* rocksdb: add ConvertDate function and CoinGeckoTicker struct, update tests
* blockbook.go, fiat: finalize the CoinGecko downloader
* coingecko.go: do not stop syncing when encountered an error
* rocksdb_test: fix the exported function name
* worker.go: make getBlockInfoFromBlockID a public function
* public.go: apiTickers kickoff
* rocksdb_test: fix the unittest comment
* coingecko.go: update comments
* blockbook.go, fiat: reword CoinGecko -> FiatRates, fix binary search upper bound, remove assignment of goroutine call result
* rename coingecko -> fiat_rates
* fiat_rates: export only the necessary methods
* blockbook.go: update log message
* bitcoinrpc.go: remove fiatRates settings
* use CurrencyRatesTicker structure everywhere, fix time format string, update tests, use UTC time
* add /api/v2/tickers tests, store rates as strings (json.Number)
* fiat_rates: add more tests, metrics and tickers-list endpoint, make the "currency" parameter mandatory
* public, worker: move FiatRates API logic to worker.go
* fiat_rates: add a future date test, fix comments, add more checks, store time as a pointer
* rocksdb_test: remove unneeded code
* fiat_rates: add a "ping" call to check server availability
* fiat_rates: do not return empty ticker, return nil instead if not found
add a test for non-existent ticker
* rocksdb_test: remove Sleep from tests
* worker.go: do not propagate all API errors to the client
* move InitTestFiatRates from rocksdb.go to public_test.go
* public.go: fix FiatRatesFindLastTicker result check
* fiat_rates: mock API server responses
* remove commented-out code
* fiat_rates: add comment explaining what periodSeconds attribute is used for
* websocket.go: implement fiatRates websocket endpoints & add tests
* fiatRates: add getFiatRatesTickersList websocket endpoint & test
* fiatRates: make websocket getFiatRatesByDate accept an array of dates, add more tests
* fiatRates: remove getFiatRatesForBlockID from websocket endpoints
* fiatRates: remove "if test", use custom startTime instead
Update tests and mock data
* fiatRates: finalize websocket functionality
add "date" parameter to TickerList
return data timestamps where needed
fix sync bugs (nil timestamp, duplicate save)
* fiatRates: add FiatRates configs for different coins
* worker.go: make GetBlockInfoFromBlockID private again
* fiatRates: wait & retry on errors, remove Ping function
* websocket.go: remove incorrect comment
* fiatRates: move coingecko-related code to a separate file, use interface
* fiatRates: if the new rates are the same as previous, try five more times, and only then store them
* coingecko: fix getting actual rates, add a timestamp parameter to get uncached responses
* vertcoin_testnet.json: remove fiat rates parameters
* fiat_rates: add timestamp to log message about skipping the repeating rates
2019-12-17 02:40:02 -07:00
|
|
|
function getFiatRatesForDates() {
|
|
|
|
const method = 'getFiatRatesForDates';
|
|
|
|
var dates = document.getElementById('getFiatRatesForDatesList').value.split(",");
|
|
|
|
var currency = document.getElementById('getFiatRatesForDatesCurrency').value;
|
|
|
|
dates = dates.map(s => s.trim());
|
|
|
|
const params = {
|
|
|
|
dates,
|
|
|
|
"currency": currency
|
|
|
|
};
|
|
|
|
send(method, params, function (result) {
|
|
|
|
document.getElementById('getFiatRatesForDatesResult').innerText = JSON.stringify(result).replace(/,/g, ", ");
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
function getCurrentFiatRates() {
|
|
|
|
const method = 'getCurrentFiatRates';
|
|
|
|
var currency = document.getElementById('getCurrentFiatRatesCurrency').value;
|
|
|
|
const params = {
|
|
|
|
"currency": currency
|
|
|
|
};
|
|
|
|
send(method, params, function (result) {
|
|
|
|
document.getElementById('getCurrentFiatRatesResult').innerText = JSON.stringify(result).replace(/,/g, ", ");
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
function getFiatRatesTickersList() {
|
|
|
|
const method = 'getFiatRatesTickersList';
|
|
|
|
var date = document.getElementById('getFiatRatesTickersListDate').value;
|
|
|
|
const params = {
|
|
|
|
date,
|
|
|
|
};
|
|
|
|
send(method, params, function (result) {
|
|
|
|
document.getElementById('getFiatRatesTickersListResult').innerText = JSON.stringify(result).replace(/,/g, ", ");
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
function subscribeNewFiatRatesTicker() {
|
|
|
|
const method = 'subscribeFiatRates';
|
|
|
|
var currency = document.getElementById('subscribeFiatRatesCurrency').value;
|
|
|
|
const params = {
|
|
|
|
"currency": currency
|
|
|
|
};
|
|
|
|
if (subscribeNewFiatRatesTickerId) {
|
|
|
|
delete subscriptions[subscribeNewFiatRatesTickerId];
|
|
|
|
subscribeNewFiatRatesTickerId = "";
|
|
|
|
}
|
|
|
|
subscribeNewFiatRatesTickerId = subscribe(method, params, function (result) {
|
|
|
|
document.getElementById('subscribeNewFiatRatesTickerResult').innerText += JSON.stringify(result).replace(/,/g, ", ") + "\n";
|
|
|
|
});
|
|
|
|
document.getElementById('subscribeNewFiatRatesTickerId').innerText = subscribeNewFiatRatesTickerId;
|
|
|
|
document.getElementById('unsubscribeNewFiatRatesTickerButton').setAttribute("style", "display: inherit;");
|
|
|
|
}
|
|
|
|
|
|
|
|
function unsubscribeNewFiatRatesTicker() {
|
|
|
|
const method = 'unsubscribeFiatRates';
|
|
|
|
const params = {
|
|
|
|
};
|
|
|
|
unsubscribe(method, subscribeNewFiatRatesTickerId, params, function (result) {
|
|
|
|
subscribeNewFiatRatesTickerId = "";
|
|
|
|
document.getElementById('subscribeNewFiatRatesTickerResult').innerText += JSON.stringify(result).replace(/,/g, ", ") + "\n";
|
|
|
|
document.getElementById('subscribeNewFiatRatesTickerId').innerText = "";
|
|
|
|
document.getElementById('unsubscribeNewFiatRatesTickerButton').setAttribute("style", "display: none;");
|
|
|
|
});
|
|
|
|
}
|
2018-12-09 16:26:04 -07:00
|
|
|
</script>
|
|
|
|
</head>
|
|
|
|
|
|
|
|
<body>
|
|
|
|
<div class="container">
|
|
|
|
<div class="row justify-content-center">
|
2018-12-10 09:22:37 -07:00
|
|
|
<h1>Blockbook Websocket Test Page</h1>
|
2018-12-09 16:26:04 -07:00
|
|
|
</div>
|
|
|
|
<div class="row">
|
|
|
|
<div class="col">
|
|
|
|
<input class="btn btn-secondary" type="button" value="Login" onclick="connect(document.getElementById('serverAddress').value)">
|
|
|
|
</div>
|
|
|
|
<div class="col-8">
|
|
|
|
<input type="text" class="form-control" id="serverAddress" value="">
|
|
|
|
</div>
|
|
|
|
<div class="col form-inline">
|
|
|
|
<label id="connectionStatus">not connected</label>
|
|
|
|
</div>
|
|
|
|
</div>
|
2018-12-18 01:52:46 -07:00
|
|
|
<div class="row">
|
|
|
|
<div class="col">
|
|
|
|
<input class="btn btn-secondary" type="button" value="getInfo" onclick="getInfo()">
|
|
|
|
</div>
|
|
|
|
<div class="col-10" id="getInfoResult">
|
|
|
|
</div>
|
|
|
|
</div>
|
2019-07-19 06:59:03 -06:00
|
|
|
<div class="row">
|
|
|
|
<div class="col">
|
|
|
|
<input class="btn btn-secondary" type="button" value="ping" onclick="ping()">
|
|
|
|
</div>
|
|
|
|
<div class="col-10" id="pingResult">
|
|
|
|
</div>
|
|
|
|
</div>
|
2019-01-04 08:10:24 -07:00
|
|
|
<div class="row">
|
|
|
|
<div class="col">
|
|
|
|
<input class="btn btn-secondary" type="button" value="getBlockHash" onclick="getBlockHash()">
|
|
|
|
</div>
|
|
|
|
<div class="col-8">
|
|
|
|
<input type="text" class="form-control" placeholder="height" id="getBlockHashHeight" value="0">
|
|
|
|
</div>
|
|
|
|
<div class="col">
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="row">
|
|
|
|
<div class="col" id="getBlockHashResult"></div>
|
|
|
|
</div>
|
2018-12-09 16:26:04 -07:00
|
|
|
<div class="row">
|
|
|
|
<div class="col">
|
|
|
|
<input class="btn btn-secondary" type="button" value="getAccountInfo" onclick="getAccountInfo()">
|
|
|
|
</div>
|
|
|
|
<div class="col-8">
|
|
|
|
<div class="row" style="margin: 0;">
|
2019-01-16 08:10:30 -07:00
|
|
|
<input type="text" placeholder="descriptor" style="width: 79%" class="form-control" id="getAccountInfoDescriptor" value="0xba98d6a5ac827632e3457de7512d211e4ff7e8bd">
|
2018-12-09 16:26:04 -07:00
|
|
|
<select id="getAccountInfoDetails" style="width: 20%; margin-left: 5px;">
|
|
|
|
<option value="basic">Basic</option>
|
2019-02-12 07:15:10 -07:00
|
|
|
<option value="tokens">Tokens</option>
|
2019-02-28 07:07:07 -07:00
|
|
|
<option value="tokenBalances">TokenBalances</option>
|
2018-12-09 16:26:04 -07:00
|
|
|
<option value="txids">Txids</option>
|
|
|
|
<option value="txs">Transactions</option>
|
|
|
|
</select>
|
2018-12-14 08:42:35 -07:00
|
|
|
</div>
|
|
|
|
<div class="row" style="margin: 0; margin-top: 5px;">
|
|
|
|
<input type="text" placeholder="page" style="width: 10%; margin-right: 5px;" class="form-control" id="getAccountInfoPage">
|
|
|
|
<input type="text" placeholder="from" style="width: 15%;margin-left: 5px;margin-right: 5px;" class="form-control" id="getAccountInfoFrom">
|
|
|
|
<input type="text" placeholder="to" style="width: 15%; margin-left: 5px; margin-right: 5px;" class="form-control" id="getAccountInfoTo">
|
|
|
|
<input type="text" placeholder="contract" style="width: 55%; margin-left: 5px; margin-right: 5px;" class="form-control" id="getAccountInfoContract">
|
2018-12-09 16:26:04 -07:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="col form-inline"></div>
|
|
|
|
</div>
|
|
|
|
<div class="row">
|
|
|
|
<div class="col" id="getAccountInfoResult">
|
|
|
|
</div>
|
|
|
|
</div>
|
2019-01-14 09:12:33 -07:00
|
|
|
<div class="row">
|
|
|
|
<div class="col">
|
|
|
|
<input class="btn btn-secondary" type="button" value="getAccountUtxo" onclick="getAccountUtxo()">
|
|
|
|
</div>
|
|
|
|
<div class="col-8">
|
|
|
|
<div class="row" style="margin: 0;">
|
2019-01-16 08:10:30 -07:00
|
|
|
<input type="text" placeholder="descriptor" class="form-control" id="getAccountUtxoDescriptor" value="0xba98d6a5ac827632e3457de7512d211e4ff7e8bd">
|
2019-01-14 09:12:33 -07:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="col form-inline"></div>
|
|
|
|
</div>
|
|
|
|
<div class="row">
|
|
|
|
<div class="col" id="getAccountUtxoResult">
|
|
|
|
</div>
|
|
|
|
</div>
|
2019-12-17 06:37:24 -07:00
|
|
|
<div class="row">
|
|
|
|
<div class="col">
|
|
|
|
<input class="btn btn-secondary" type="button" value="getBalanceHistory" onclick="getBalanceHistory()">
|
|
|
|
</div>
|
|
|
|
<div class="col-8">
|
|
|
|
<div class="row" style="margin: 0;">
|
|
|
|
<input type="text" placeholder="descriptor" class="form-control" id="getBalanceHistoryDescriptor" value="0xba98d6a5ac827632e3457de7512d211e4ff7e8bd">
|
|
|
|
</div>
|
|
|
|
<div class="row" style="margin: 0; margin-top: 5px;">
|
|
|
|
<input type="text" placeholder="from YYYY-MM-DD" style="width: 30%;margin-left: 5px;margin-right: 5px;" class="form-control" id="getBalanceHistoryFrom">
|
|
|
|
<input type="text" placeholder="to YYYY-MM-DD" style="width: 30%; margin-left: 5px; margin-right: 5px;" class="form-control" id="getBalanceHistoryTo">
|
|
|
|
<input type="text" placeholder="fiat" style="width: 20%; margin-left: 5px; margin-right: 5px;" class="form-control" id="getBalanceHistoryFiat">
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="col form-inline"></div>
|
|
|
|
</div>
|
|
|
|
<div class="row">
|
|
|
|
<div class="col" id="getBalanceHistoryResult">
|
|
|
|
</div>
|
|
|
|
</div>
|
2019-01-16 08:10:30 -07:00
|
|
|
<div class="row">
|
|
|
|
<div class="col">
|
|
|
|
<input class="btn btn-secondary" type="button" value="getTransaction" onclick="getTransaction()">
|
|
|
|
</div>
|
|
|
|
<div class="col-8">
|
|
|
|
<div class="row" style="margin: 0;">
|
|
|
|
<input type="text" placeholder="txid" class="form-control" id="getTransactionTxid" value="0xb266c89f9bfefa4aa2fca4e65b7d6c918d5407f464be781c2803f3546d34a574">
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="col form-inline"></div>
|
|
|
|
</div>
|
|
|
|
<div class="row">
|
|
|
|
<div class="col" id="getTransactionResult">
|
|
|
|
</div>
|
|
|
|
</div>
|
2019-03-01 07:37:38 -07:00
|
|
|
<div class="row">
|
|
|
|
<div class="col">
|
|
|
|
<input class="btn btn-secondary" type="button" value="getTransactionSpecific" onclick="getTransactionSpecific()">
|
|
|
|
</div>
|
|
|
|
<div class="col-8">
|
|
|
|
<div class="row" style="margin: 0;">
|
|
|
|
<input type="text" placeholder="txid" class="form-control" id="getTransactionSpecificTxid" value="0xb266c89f9bfefa4aa2fca4e65b7d6c918d5407f464be781c2803f3546d34a574">
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="col form-inline"></div>
|
|
|
|
</div>
|
|
|
|
<div class="row">
|
|
|
|
<div class="col" id="getTransactionSpecificResult">
|
|
|
|
</div>
|
|
|
|
</div>
|
2018-12-09 16:26:04 -07:00
|
|
|
<div class="row">
|
|
|
|
<div class="col">
|
|
|
|
<input class="btn btn-secondary" type="button" value="estimateFee" onclick="estimateFee()">
|
|
|
|
</div>
|
|
|
|
<div class="col-8">
|
2018-12-18 01:52:46 -07:00
|
|
|
<div class="row" style="margin: 0;">
|
|
|
|
<input type="text" placeholder="comma separated list of block targets" class="form-control" id="estimateFeeBlocks" value="2,5,10,20">
|
|
|
|
</div>
|
|
|
|
<div class="row" style="margin: 0; margin-top: 5px;">
|
|
|
|
<input type="text" placeholder="tx specific JSON" class="form-control" id="estimateFeeSpecific" value="">
|
|
|
|
</div>
|
2018-12-09 16:26:04 -07:00
|
|
|
</div>
|
|
|
|
<div class="col"></div>
|
|
|
|
</div>
|
|
|
|
<div class="row">
|
|
|
|
<div class="col" id="estimateFeeResult">
|
|
|
|
</div>
|
2018-12-18 01:52:46 -07:00
|
|
|
</div>
|
2018-12-09 16:26:04 -07:00
|
|
|
<div class="row">
|
|
|
|
<div class="col">
|
|
|
|
<input class="btn btn-secondary" type="button" value="sendTransaction" onclick="sendTransaction()">
|
|
|
|
</div>
|
|
|
|
<div class="col-8">
|
|
|
|
<input type="text" class="form-control" id="sendTransactionHex" value="010000000001019d64f0c72a0d206001decbffaa722eb1044534c74eee7a5df8318e42a4323ec10000000017160014550da1f5d25a9dae2eafd6902b4194c4c6500af6ffffffff02809698000000000017a914cd668d781ece600efa4b2404dc91fd26b8b8aed8870553d7360000000017a914246655bdbd54c7e477d0ea2375e86e0db2b8f80a8702473044022076aba4ad559616905fa51d4ddd357fc1fdb428d40cb388e042cdd1da4a1b7357022011916f90c712ead9a66d5f058252efd280439ad8956a967e95d437d246710bc9012102a80a5964c5612bb769ef73147b2cf3c149bc0fd4ecb02f8097629c94ab013ffd00000000">
|
|
|
|
</div>
|
|
|
|
<div class="col">
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="row">
|
|
|
|
<div class="col" id="sendTransactionResult"></div>
|
|
|
|
</div>
|
|
|
|
<div class="row">
|
2019-12-17 06:37:24 -07:00
|
|
|
<div class="col-2">
|
|
|
|
<input class="btn btn-secondary" type="button" value="get fiat rates for dates" onclick="getFiatRatesForDates()">
|
2018-12-09 16:26:04 -07:00
|
|
|
</div>
|
2019-12-17 06:37:24 -07:00
|
|
|
<div class="col-1">
|
|
|
|
<input type="text" class="form-control" id="getFiatRatesForDatesCurrency" value="usd">
|
2018-12-09 16:26:04 -07:00
|
|
|
</div>
|
2019-12-17 06:37:24 -07:00
|
|
|
<div class="col-7">
|
|
|
|
<input type="text" class="form-control" id="getFiatRatesForDatesList" value="20191121140000,20191121143015">
|
2018-12-11 03:50:43 -07:00
|
|
|
</div>
|
2018-12-09 16:26:04 -07:00
|
|
|
</div>
|
|
|
|
<div class="row">
|
2019-12-17 06:37:24 -07:00
|
|
|
<div class="col" id="getFiatRatesForDatesResult"></div>
|
2018-12-09 16:26:04 -07:00
|
|
|
</div>
|
|
|
|
<div class="row">
|
2019-12-17 06:37:24 -07:00
|
|
|
<div class="col-2">
|
|
|
|
<input class="btn btn-secondary" type="button" value="get current fiat rates" onclick="getCurrentFiatRates()">
|
2018-12-09 16:26:04 -07:00
|
|
|
</div>
|
2019-12-17 06:37:24 -07:00
|
|
|
<div class="col-1">
|
|
|
|
<input type="text" class="form-control" id="getCurrentFiatRatesCurrency" value="usd">
|
2018-12-09 16:26:04 -07:00
|
|
|
</div>
|
2018-12-11 04:14:05 -07:00
|
|
|
</div>
|
2018-12-11 03:50:43 -07:00
|
|
|
<div class="row">
|
2019-12-17 06:37:24 -07:00
|
|
|
<div class="col" id="getCurrentFiatRatesResult"></div>
|
2018-12-09 16:26:04 -07:00
|
|
|
</div>
|
Add fiat rates functionality (#316)
* Add initial commit for fiat rates functionality
* templates.go: use bash from current user's environment
* bitcoinrpc.go: add FiatRates and FiatRatesParams to config
* blockbook.go: add initFiatRatesDownloader kickoff
* bitcoin.json: add coingecko API URL
* rockdb.go: add FindTicker and StoreTicker functions
* rocksdb_test.go: add a simple test for storing and getting FiatRate tickers
* rocksdb: add FindLastTicker and convertDate, make FindTicker return strings
* rocksdb: add ConvertDate function and CoinGeckoTicker struct, update tests
* blockbook.go, fiat: finalize the CoinGecko downloader
* coingecko.go: do not stop syncing when encountered an error
* rocksdb_test: fix the exported function name
* worker.go: make getBlockInfoFromBlockID a public function
* public.go: apiTickers kickoff
* rocksdb_test: fix the unittest comment
* coingecko.go: update comments
* blockbook.go, fiat: reword CoinGecko -> FiatRates, fix binary search upper bound, remove assignment of goroutine call result
* rename coingecko -> fiat_rates
* fiat_rates: export only the necessary methods
* blockbook.go: update log message
* bitcoinrpc.go: remove fiatRates settings
* use CurrencyRatesTicker structure everywhere, fix time format string, update tests, use UTC time
* add /api/v2/tickers tests, store rates as strings (json.Number)
* fiat_rates: add more tests, metrics and tickers-list endpoint, make the "currency" parameter mandatory
* public, worker: move FiatRates API logic to worker.go
* fiat_rates: add a future date test, fix comments, add more checks, store time as a pointer
* rocksdb_test: remove unneeded code
* fiat_rates: add a "ping" call to check server availability
* fiat_rates: do not return empty ticker, return nil instead if not found
add a test for non-existent ticker
* rocksdb_test: remove Sleep from tests
* worker.go: do not propagate all API errors to the client
* move InitTestFiatRates from rocksdb.go to public_test.go
* public.go: fix FiatRatesFindLastTicker result check
* fiat_rates: mock API server responses
* remove commented-out code
* fiat_rates: add comment explaining what periodSeconds attribute is used for
* websocket.go: implement fiatRates websocket endpoints & add tests
* fiatRates: add getFiatRatesTickersList websocket endpoint & test
* fiatRates: make websocket getFiatRatesByDate accept an array of dates, add more tests
* fiatRates: remove getFiatRatesForBlockID from websocket endpoints
* fiatRates: remove "if test", use custom startTime instead
Update tests and mock data
* fiatRates: finalize websocket functionality
add "date" parameter to TickerList
return data timestamps where needed
fix sync bugs (nil timestamp, duplicate save)
* fiatRates: add FiatRates configs for different coins
* worker.go: make GetBlockInfoFromBlockID private again
* fiatRates: wait & retry on errors, remove Ping function
* websocket.go: remove incorrect comment
* fiatRates: move coingecko-related code to a separate file, use interface
* fiatRates: if the new rates are the same as previous, try five more times, and only then store them
* coingecko: fix getting actual rates, add a timestamp parameter to get uncached responses
* vertcoin_testnet.json: remove fiat rates parameters
* fiat_rates: add timestamp to log message about skipping the repeating rates
2019-12-17 02:40:02 -07:00
|
|
|
<div class="row">
|
2019-12-17 06:37:24 -07:00
|
|
|
<div class="col-2">
|
|
|
|
<input class="btn btn-secondary" type="button" value="get fiat rates tickers" onclick="getFiatRatesTickersList()">
|
Add fiat rates functionality (#316)
* Add initial commit for fiat rates functionality
* templates.go: use bash from current user's environment
* bitcoinrpc.go: add FiatRates and FiatRatesParams to config
* blockbook.go: add initFiatRatesDownloader kickoff
* bitcoin.json: add coingecko API URL
* rockdb.go: add FindTicker and StoreTicker functions
* rocksdb_test.go: add a simple test for storing and getting FiatRate tickers
* rocksdb: add FindLastTicker and convertDate, make FindTicker return strings
* rocksdb: add ConvertDate function and CoinGeckoTicker struct, update tests
* blockbook.go, fiat: finalize the CoinGecko downloader
* coingecko.go: do not stop syncing when encountered an error
* rocksdb_test: fix the exported function name
* worker.go: make getBlockInfoFromBlockID a public function
* public.go: apiTickers kickoff
* rocksdb_test: fix the unittest comment
* coingecko.go: update comments
* blockbook.go, fiat: reword CoinGecko -> FiatRates, fix binary search upper bound, remove assignment of goroutine call result
* rename coingecko -> fiat_rates
* fiat_rates: export only the necessary methods
* blockbook.go: update log message
* bitcoinrpc.go: remove fiatRates settings
* use CurrencyRatesTicker structure everywhere, fix time format string, update tests, use UTC time
* add /api/v2/tickers tests, store rates as strings (json.Number)
* fiat_rates: add more tests, metrics and tickers-list endpoint, make the "currency" parameter mandatory
* public, worker: move FiatRates API logic to worker.go
* fiat_rates: add a future date test, fix comments, add more checks, store time as a pointer
* rocksdb_test: remove unneeded code
* fiat_rates: add a "ping" call to check server availability
* fiat_rates: do not return empty ticker, return nil instead if not found
add a test for non-existent ticker
* rocksdb_test: remove Sleep from tests
* worker.go: do not propagate all API errors to the client
* move InitTestFiatRates from rocksdb.go to public_test.go
* public.go: fix FiatRatesFindLastTicker result check
* fiat_rates: mock API server responses
* remove commented-out code
* fiat_rates: add comment explaining what periodSeconds attribute is used for
* websocket.go: implement fiatRates websocket endpoints & add tests
* fiatRates: add getFiatRatesTickersList websocket endpoint & test
* fiatRates: make websocket getFiatRatesByDate accept an array of dates, add more tests
* fiatRates: remove getFiatRatesForBlockID from websocket endpoints
* fiatRates: remove "if test", use custom startTime instead
Update tests and mock data
* fiatRates: finalize websocket functionality
add "date" parameter to TickerList
return data timestamps where needed
fix sync bugs (nil timestamp, duplicate save)
* fiatRates: add FiatRates configs for different coins
* worker.go: make GetBlockInfoFromBlockID private again
* fiatRates: wait & retry on errors, remove Ping function
* websocket.go: remove incorrect comment
* fiatRates: move coingecko-related code to a separate file, use interface
* fiatRates: if the new rates are the same as previous, try five more times, and only then store them
* coingecko: fix getting actual rates, add a timestamp parameter to get uncached responses
* vertcoin_testnet.json: remove fiat rates parameters
* fiat_rates: add timestamp to log message about skipping the repeating rates
2019-12-17 02:40:02 -07:00
|
|
|
</div>
|
|
|
|
<div class="col-8">
|
2019-12-17 06:37:24 -07:00
|
|
|
<input type="text" class="form-control" id="getFiatRatesTickersListDate" value="20191121140000">
|
Add fiat rates functionality (#316)
* Add initial commit for fiat rates functionality
* templates.go: use bash from current user's environment
* bitcoinrpc.go: add FiatRates and FiatRatesParams to config
* blockbook.go: add initFiatRatesDownloader kickoff
* bitcoin.json: add coingecko API URL
* rockdb.go: add FindTicker and StoreTicker functions
* rocksdb_test.go: add a simple test for storing and getting FiatRate tickers
* rocksdb: add FindLastTicker and convertDate, make FindTicker return strings
* rocksdb: add ConvertDate function and CoinGeckoTicker struct, update tests
* blockbook.go, fiat: finalize the CoinGecko downloader
* coingecko.go: do not stop syncing when encountered an error
* rocksdb_test: fix the exported function name
* worker.go: make getBlockInfoFromBlockID a public function
* public.go: apiTickers kickoff
* rocksdb_test: fix the unittest comment
* coingecko.go: update comments
* blockbook.go, fiat: reword CoinGecko -> FiatRates, fix binary search upper bound, remove assignment of goroutine call result
* rename coingecko -> fiat_rates
* fiat_rates: export only the necessary methods
* blockbook.go: update log message
* bitcoinrpc.go: remove fiatRates settings
* use CurrencyRatesTicker structure everywhere, fix time format string, update tests, use UTC time
* add /api/v2/tickers tests, store rates as strings (json.Number)
* fiat_rates: add more tests, metrics and tickers-list endpoint, make the "currency" parameter mandatory
* public, worker: move FiatRates API logic to worker.go
* fiat_rates: add a future date test, fix comments, add more checks, store time as a pointer
* rocksdb_test: remove unneeded code
* fiat_rates: add a "ping" call to check server availability
* fiat_rates: do not return empty ticker, return nil instead if not found
add a test for non-existent ticker
* rocksdb_test: remove Sleep from tests
* worker.go: do not propagate all API errors to the client
* move InitTestFiatRates from rocksdb.go to public_test.go
* public.go: fix FiatRatesFindLastTicker result check
* fiat_rates: mock API server responses
* remove commented-out code
* fiat_rates: add comment explaining what periodSeconds attribute is used for
* websocket.go: implement fiatRates websocket endpoints & add tests
* fiatRates: add getFiatRatesTickersList websocket endpoint & test
* fiatRates: make websocket getFiatRatesByDate accept an array of dates, add more tests
* fiatRates: remove getFiatRatesForBlockID from websocket endpoints
* fiatRates: remove "if test", use custom startTime instead
Update tests and mock data
* fiatRates: finalize websocket functionality
add "date" parameter to TickerList
return data timestamps where needed
fix sync bugs (nil timestamp, duplicate save)
* fiatRates: add FiatRates configs for different coins
* worker.go: make GetBlockInfoFromBlockID private again
* fiatRates: wait & retry on errors, remove Ping function
* websocket.go: remove incorrect comment
* fiatRates: move coingecko-related code to a separate file, use interface
* fiatRates: if the new rates are the same as previous, try five more times, and only then store them
* coingecko: fix getting actual rates, add a timestamp parameter to get uncached responses
* vertcoin_testnet.json: remove fiat rates parameters
* fiat_rates: add timestamp to log message about skipping the repeating rates
2019-12-17 02:40:02 -07:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="row">
|
2019-12-17 06:37:24 -07:00
|
|
|
<div class="col" id="getFiatRatesTickersListResult"></div>
|
Add fiat rates functionality (#316)
* Add initial commit for fiat rates functionality
* templates.go: use bash from current user's environment
* bitcoinrpc.go: add FiatRates and FiatRatesParams to config
* blockbook.go: add initFiatRatesDownloader kickoff
* bitcoin.json: add coingecko API URL
* rockdb.go: add FindTicker and StoreTicker functions
* rocksdb_test.go: add a simple test for storing and getting FiatRate tickers
* rocksdb: add FindLastTicker and convertDate, make FindTicker return strings
* rocksdb: add ConvertDate function and CoinGeckoTicker struct, update tests
* blockbook.go, fiat: finalize the CoinGecko downloader
* coingecko.go: do not stop syncing when encountered an error
* rocksdb_test: fix the exported function name
* worker.go: make getBlockInfoFromBlockID a public function
* public.go: apiTickers kickoff
* rocksdb_test: fix the unittest comment
* coingecko.go: update comments
* blockbook.go, fiat: reword CoinGecko -> FiatRates, fix binary search upper bound, remove assignment of goroutine call result
* rename coingecko -> fiat_rates
* fiat_rates: export only the necessary methods
* blockbook.go: update log message
* bitcoinrpc.go: remove fiatRates settings
* use CurrencyRatesTicker structure everywhere, fix time format string, update tests, use UTC time
* add /api/v2/tickers tests, store rates as strings (json.Number)
* fiat_rates: add more tests, metrics and tickers-list endpoint, make the "currency" parameter mandatory
* public, worker: move FiatRates API logic to worker.go
* fiat_rates: add a future date test, fix comments, add more checks, store time as a pointer
* rocksdb_test: remove unneeded code
* fiat_rates: add a "ping" call to check server availability
* fiat_rates: do not return empty ticker, return nil instead if not found
add a test for non-existent ticker
* rocksdb_test: remove Sleep from tests
* worker.go: do not propagate all API errors to the client
* move InitTestFiatRates from rocksdb.go to public_test.go
* public.go: fix FiatRatesFindLastTicker result check
* fiat_rates: mock API server responses
* remove commented-out code
* fiat_rates: add comment explaining what periodSeconds attribute is used for
* websocket.go: implement fiatRates websocket endpoints & add tests
* fiatRates: add getFiatRatesTickersList websocket endpoint & test
* fiatRates: make websocket getFiatRatesByDate accept an array of dates, add more tests
* fiatRates: remove getFiatRatesForBlockID from websocket endpoints
* fiatRates: remove "if test", use custom startTime instead
Update tests and mock data
* fiatRates: finalize websocket functionality
add "date" parameter to TickerList
return data timestamps where needed
fix sync bugs (nil timestamp, duplicate save)
* fiatRates: add FiatRates configs for different coins
* worker.go: make GetBlockInfoFromBlockID private again
* fiatRates: wait & retry on errors, remove Ping function
* websocket.go: remove incorrect comment
* fiatRates: move coingecko-related code to a separate file, use interface
* fiatRates: if the new rates are the same as previous, try five more times, and only then store them
* coingecko: fix getting actual rates, add a timestamp parameter to get uncached responses
* vertcoin_testnet.json: remove fiat rates parameters
* fiat_rates: add timestamp to log message about skipping the repeating rates
2019-12-17 02:40:02 -07:00
|
|
|
</div>
|
|
|
|
<div class="row">
|
|
|
|
<div class="col">
|
2019-12-17 06:37:24 -07:00
|
|
|
<input class="btn btn-secondary" type="button" value="subscribe new block" onclick="subscribeNewBlock()">
|
Add fiat rates functionality (#316)
* Add initial commit for fiat rates functionality
* templates.go: use bash from current user's environment
* bitcoinrpc.go: add FiatRates and FiatRatesParams to config
* blockbook.go: add initFiatRatesDownloader kickoff
* bitcoin.json: add coingecko API URL
* rockdb.go: add FindTicker and StoreTicker functions
* rocksdb_test.go: add a simple test for storing and getting FiatRate tickers
* rocksdb: add FindLastTicker and convertDate, make FindTicker return strings
* rocksdb: add ConvertDate function and CoinGeckoTicker struct, update tests
* blockbook.go, fiat: finalize the CoinGecko downloader
* coingecko.go: do not stop syncing when encountered an error
* rocksdb_test: fix the exported function name
* worker.go: make getBlockInfoFromBlockID a public function
* public.go: apiTickers kickoff
* rocksdb_test: fix the unittest comment
* coingecko.go: update comments
* blockbook.go, fiat: reword CoinGecko -> FiatRates, fix binary search upper bound, remove assignment of goroutine call result
* rename coingecko -> fiat_rates
* fiat_rates: export only the necessary methods
* blockbook.go: update log message
* bitcoinrpc.go: remove fiatRates settings
* use CurrencyRatesTicker structure everywhere, fix time format string, update tests, use UTC time
* add /api/v2/tickers tests, store rates as strings (json.Number)
* fiat_rates: add more tests, metrics and tickers-list endpoint, make the "currency" parameter mandatory
* public, worker: move FiatRates API logic to worker.go
* fiat_rates: add a future date test, fix comments, add more checks, store time as a pointer
* rocksdb_test: remove unneeded code
* fiat_rates: add a "ping" call to check server availability
* fiat_rates: do not return empty ticker, return nil instead if not found
add a test for non-existent ticker
* rocksdb_test: remove Sleep from tests
* worker.go: do not propagate all API errors to the client
* move InitTestFiatRates from rocksdb.go to public_test.go
* public.go: fix FiatRatesFindLastTicker result check
* fiat_rates: mock API server responses
* remove commented-out code
* fiat_rates: add comment explaining what periodSeconds attribute is used for
* websocket.go: implement fiatRates websocket endpoints & add tests
* fiatRates: add getFiatRatesTickersList websocket endpoint & test
* fiatRates: make websocket getFiatRatesByDate accept an array of dates, add more tests
* fiatRates: remove getFiatRatesForBlockID from websocket endpoints
* fiatRates: remove "if test", use custom startTime instead
Update tests and mock data
* fiatRates: finalize websocket functionality
add "date" parameter to TickerList
return data timestamps where needed
fix sync bugs (nil timestamp, duplicate save)
* fiatRates: add FiatRates configs for different coins
* worker.go: make GetBlockInfoFromBlockID private again
* fiatRates: wait & retry on errors, remove Ping function
* websocket.go: remove incorrect comment
* fiatRates: move coingecko-related code to a separate file, use interface
* fiatRates: if the new rates are the same as previous, try five more times, and only then store them
* coingecko: fix getting actual rates, add a timestamp parameter to get uncached responses
* vertcoin_testnet.json: remove fiat rates parameters
* fiat_rates: add timestamp to log message about skipping the repeating rates
2019-12-17 02:40:02 -07:00
|
|
|
</div>
|
2019-12-17 06:37:24 -07:00
|
|
|
<div class="col-4">
|
|
|
|
<span id="subscribeNewBlockId"></span>
|
|
|
|
</div>
|
|
|
|
<div class="col">
|
|
|
|
<input class="btn btn-secondary" id="unsubscribeNewBlockButton" style="display: none;" type="button" value="unsubscribe" onclick="unsubscribeNewBlock()">
|
Add fiat rates functionality (#316)
* Add initial commit for fiat rates functionality
* templates.go: use bash from current user's environment
* bitcoinrpc.go: add FiatRates and FiatRatesParams to config
* blockbook.go: add initFiatRatesDownloader kickoff
* bitcoin.json: add coingecko API URL
* rockdb.go: add FindTicker and StoreTicker functions
* rocksdb_test.go: add a simple test for storing and getting FiatRate tickers
* rocksdb: add FindLastTicker and convertDate, make FindTicker return strings
* rocksdb: add ConvertDate function and CoinGeckoTicker struct, update tests
* blockbook.go, fiat: finalize the CoinGecko downloader
* coingecko.go: do not stop syncing when encountered an error
* rocksdb_test: fix the exported function name
* worker.go: make getBlockInfoFromBlockID a public function
* public.go: apiTickers kickoff
* rocksdb_test: fix the unittest comment
* coingecko.go: update comments
* blockbook.go, fiat: reword CoinGecko -> FiatRates, fix binary search upper bound, remove assignment of goroutine call result
* rename coingecko -> fiat_rates
* fiat_rates: export only the necessary methods
* blockbook.go: update log message
* bitcoinrpc.go: remove fiatRates settings
* use CurrencyRatesTicker structure everywhere, fix time format string, update tests, use UTC time
* add /api/v2/tickers tests, store rates as strings (json.Number)
* fiat_rates: add more tests, metrics and tickers-list endpoint, make the "currency" parameter mandatory
* public, worker: move FiatRates API logic to worker.go
* fiat_rates: add a future date test, fix comments, add more checks, store time as a pointer
* rocksdb_test: remove unneeded code
* fiat_rates: add a "ping" call to check server availability
* fiat_rates: do not return empty ticker, return nil instead if not found
add a test for non-existent ticker
* rocksdb_test: remove Sleep from tests
* worker.go: do not propagate all API errors to the client
* move InitTestFiatRates from rocksdb.go to public_test.go
* public.go: fix FiatRatesFindLastTicker result check
* fiat_rates: mock API server responses
* remove commented-out code
* fiat_rates: add comment explaining what periodSeconds attribute is used for
* websocket.go: implement fiatRates websocket endpoints & add tests
* fiatRates: add getFiatRatesTickersList websocket endpoint & test
* fiatRates: make websocket getFiatRatesByDate accept an array of dates, add more tests
* fiatRates: remove getFiatRatesForBlockID from websocket endpoints
* fiatRates: remove "if test", use custom startTime instead
Update tests and mock data
* fiatRates: finalize websocket functionality
add "date" parameter to TickerList
return data timestamps where needed
fix sync bugs (nil timestamp, duplicate save)
* fiatRates: add FiatRates configs for different coins
* worker.go: make GetBlockInfoFromBlockID private again
* fiatRates: wait & retry on errors, remove Ping function
* websocket.go: remove incorrect comment
* fiatRates: move coingecko-related code to a separate file, use interface
* fiatRates: if the new rates are the same as previous, try five more times, and only then store them
* coingecko: fix getting actual rates, add a timestamp parameter to get uncached responses
* vertcoin_testnet.json: remove fiat rates parameters
* fiat_rates: add timestamp to log message about skipping the repeating rates
2019-12-17 02:40:02 -07:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="row">
|
2019-12-17 06:37:24 -07:00
|
|
|
<div class="col" id="subscribeNewBlockResult"></div>
|
Add fiat rates functionality (#316)
* Add initial commit for fiat rates functionality
* templates.go: use bash from current user's environment
* bitcoinrpc.go: add FiatRates and FiatRatesParams to config
* blockbook.go: add initFiatRatesDownloader kickoff
* bitcoin.json: add coingecko API URL
* rockdb.go: add FindTicker and StoreTicker functions
* rocksdb_test.go: add a simple test for storing and getting FiatRate tickers
* rocksdb: add FindLastTicker and convertDate, make FindTicker return strings
* rocksdb: add ConvertDate function and CoinGeckoTicker struct, update tests
* blockbook.go, fiat: finalize the CoinGecko downloader
* coingecko.go: do not stop syncing when encountered an error
* rocksdb_test: fix the exported function name
* worker.go: make getBlockInfoFromBlockID a public function
* public.go: apiTickers kickoff
* rocksdb_test: fix the unittest comment
* coingecko.go: update comments
* blockbook.go, fiat: reword CoinGecko -> FiatRates, fix binary search upper bound, remove assignment of goroutine call result
* rename coingecko -> fiat_rates
* fiat_rates: export only the necessary methods
* blockbook.go: update log message
* bitcoinrpc.go: remove fiatRates settings
* use CurrencyRatesTicker structure everywhere, fix time format string, update tests, use UTC time
* add /api/v2/tickers tests, store rates as strings (json.Number)
* fiat_rates: add more tests, metrics and tickers-list endpoint, make the "currency" parameter mandatory
* public, worker: move FiatRates API logic to worker.go
* fiat_rates: add a future date test, fix comments, add more checks, store time as a pointer
* rocksdb_test: remove unneeded code
* fiat_rates: add a "ping" call to check server availability
* fiat_rates: do not return empty ticker, return nil instead if not found
add a test for non-existent ticker
* rocksdb_test: remove Sleep from tests
* worker.go: do not propagate all API errors to the client
* move InitTestFiatRates from rocksdb.go to public_test.go
* public.go: fix FiatRatesFindLastTicker result check
* fiat_rates: mock API server responses
* remove commented-out code
* fiat_rates: add comment explaining what periodSeconds attribute is used for
* websocket.go: implement fiatRates websocket endpoints & add tests
* fiatRates: add getFiatRatesTickersList websocket endpoint & test
* fiatRates: make websocket getFiatRatesByDate accept an array of dates, add more tests
* fiatRates: remove getFiatRatesForBlockID from websocket endpoints
* fiatRates: remove "if test", use custom startTime instead
Update tests and mock data
* fiatRates: finalize websocket functionality
add "date" parameter to TickerList
return data timestamps where needed
fix sync bugs (nil timestamp, duplicate save)
* fiatRates: add FiatRates configs for different coins
* worker.go: make GetBlockInfoFromBlockID private again
* fiatRates: wait & retry on errors, remove Ping function
* websocket.go: remove incorrect comment
* fiatRates: move coingecko-related code to a separate file, use interface
* fiatRates: if the new rates are the same as previous, try five more times, and only then store them
* coingecko: fix getting actual rates, add a timestamp parameter to get uncached responses
* vertcoin_testnet.json: remove fiat rates parameters
* fiat_rates: add timestamp to log message about skipping the repeating rates
2019-12-17 02:40:02 -07:00
|
|
|
</div>
|
|
|
|
<div class="row">
|
|
|
|
<div class="col">
|
2019-12-17 06:37:24 -07:00
|
|
|
<input class="btn btn-secondary" type="button" value="subscribe address" onclick="subscribeAddresses()">
|
Add fiat rates functionality (#316)
* Add initial commit for fiat rates functionality
* templates.go: use bash from current user's environment
* bitcoinrpc.go: add FiatRates and FiatRatesParams to config
* blockbook.go: add initFiatRatesDownloader kickoff
* bitcoin.json: add coingecko API URL
* rockdb.go: add FindTicker and StoreTicker functions
* rocksdb_test.go: add a simple test for storing and getting FiatRate tickers
* rocksdb: add FindLastTicker and convertDate, make FindTicker return strings
* rocksdb: add ConvertDate function and CoinGeckoTicker struct, update tests
* blockbook.go, fiat: finalize the CoinGecko downloader
* coingecko.go: do not stop syncing when encountered an error
* rocksdb_test: fix the exported function name
* worker.go: make getBlockInfoFromBlockID a public function
* public.go: apiTickers kickoff
* rocksdb_test: fix the unittest comment
* coingecko.go: update comments
* blockbook.go, fiat: reword CoinGecko -> FiatRates, fix binary search upper bound, remove assignment of goroutine call result
* rename coingecko -> fiat_rates
* fiat_rates: export only the necessary methods
* blockbook.go: update log message
* bitcoinrpc.go: remove fiatRates settings
* use CurrencyRatesTicker structure everywhere, fix time format string, update tests, use UTC time
* add /api/v2/tickers tests, store rates as strings (json.Number)
* fiat_rates: add more tests, metrics and tickers-list endpoint, make the "currency" parameter mandatory
* public, worker: move FiatRates API logic to worker.go
* fiat_rates: add a future date test, fix comments, add more checks, store time as a pointer
* rocksdb_test: remove unneeded code
* fiat_rates: add a "ping" call to check server availability
* fiat_rates: do not return empty ticker, return nil instead if not found
add a test for non-existent ticker
* rocksdb_test: remove Sleep from tests
* worker.go: do not propagate all API errors to the client
* move InitTestFiatRates from rocksdb.go to public_test.go
* public.go: fix FiatRatesFindLastTicker result check
* fiat_rates: mock API server responses
* remove commented-out code
* fiat_rates: add comment explaining what periodSeconds attribute is used for
* websocket.go: implement fiatRates websocket endpoints & add tests
* fiatRates: add getFiatRatesTickersList websocket endpoint & test
* fiatRates: make websocket getFiatRatesByDate accept an array of dates, add more tests
* fiatRates: remove getFiatRatesForBlockID from websocket endpoints
* fiatRates: remove "if test", use custom startTime instead
Update tests and mock data
* fiatRates: finalize websocket functionality
add "date" parameter to TickerList
return data timestamps where needed
fix sync bugs (nil timestamp, duplicate save)
* fiatRates: add FiatRates configs for different coins
* worker.go: make GetBlockInfoFromBlockID private again
* fiatRates: wait & retry on errors, remove Ping function
* websocket.go: remove incorrect comment
* fiatRates: move coingecko-related code to a separate file, use interface
* fiatRates: if the new rates are the same as previous, try five more times, and only then store them
* coingecko: fix getting actual rates, add a timestamp parameter to get uncached responses
* vertcoin_testnet.json: remove fiat rates parameters
* fiat_rates: add timestamp to log message about skipping the repeating rates
2019-12-17 02:40:02 -07:00
|
|
|
</div>
|
|
|
|
<div class="col-8">
|
2019-12-17 06:37:24 -07:00
|
|
|
<input type="text" class="form-control" id="subscribeAddressesName" value="0xba98d6a5ac827632e3457de7512d211e4ff7e8bd,0x73d0385f4d8e00c5e6504c6030f47bf6212736a8">
|
|
|
|
</div>
|
|
|
|
<div class="col">
|
|
|
|
<span id="subscribeAddressesIds"></span>
|
|
|
|
</div>
|
|
|
|
<div class="col">
|
|
|
|
<input class="btn btn-secondary" id="unsubscribeAddressesButton" style="display: none;" type="button" value="unsubscribe" onclick="unsubscribeAddresses()">
|
Add fiat rates functionality (#316)
* Add initial commit for fiat rates functionality
* templates.go: use bash from current user's environment
* bitcoinrpc.go: add FiatRates and FiatRatesParams to config
* blockbook.go: add initFiatRatesDownloader kickoff
* bitcoin.json: add coingecko API URL
* rockdb.go: add FindTicker and StoreTicker functions
* rocksdb_test.go: add a simple test for storing and getting FiatRate tickers
* rocksdb: add FindLastTicker and convertDate, make FindTicker return strings
* rocksdb: add ConvertDate function and CoinGeckoTicker struct, update tests
* blockbook.go, fiat: finalize the CoinGecko downloader
* coingecko.go: do not stop syncing when encountered an error
* rocksdb_test: fix the exported function name
* worker.go: make getBlockInfoFromBlockID a public function
* public.go: apiTickers kickoff
* rocksdb_test: fix the unittest comment
* coingecko.go: update comments
* blockbook.go, fiat: reword CoinGecko -> FiatRates, fix binary search upper bound, remove assignment of goroutine call result
* rename coingecko -> fiat_rates
* fiat_rates: export only the necessary methods
* blockbook.go: update log message
* bitcoinrpc.go: remove fiatRates settings
* use CurrencyRatesTicker structure everywhere, fix time format string, update tests, use UTC time
* add /api/v2/tickers tests, store rates as strings (json.Number)
* fiat_rates: add more tests, metrics and tickers-list endpoint, make the "currency" parameter mandatory
* public, worker: move FiatRates API logic to worker.go
* fiat_rates: add a future date test, fix comments, add more checks, store time as a pointer
* rocksdb_test: remove unneeded code
* fiat_rates: add a "ping" call to check server availability
* fiat_rates: do not return empty ticker, return nil instead if not found
add a test for non-existent ticker
* rocksdb_test: remove Sleep from tests
* worker.go: do not propagate all API errors to the client
* move InitTestFiatRates from rocksdb.go to public_test.go
* public.go: fix FiatRatesFindLastTicker result check
* fiat_rates: mock API server responses
* remove commented-out code
* fiat_rates: add comment explaining what periodSeconds attribute is used for
* websocket.go: implement fiatRates websocket endpoints & add tests
* fiatRates: add getFiatRatesTickersList websocket endpoint & test
* fiatRates: make websocket getFiatRatesByDate accept an array of dates, add more tests
* fiatRates: remove getFiatRatesForBlockID from websocket endpoints
* fiatRates: remove "if test", use custom startTime instead
Update tests and mock data
* fiatRates: finalize websocket functionality
add "date" parameter to TickerList
return data timestamps where needed
fix sync bugs (nil timestamp, duplicate save)
* fiatRates: add FiatRates configs for different coins
* worker.go: make GetBlockInfoFromBlockID private again
* fiatRates: wait & retry on errors, remove Ping function
* websocket.go: remove incorrect comment
* fiatRates: move coingecko-related code to a separate file, use interface
* fiatRates: if the new rates are the same as previous, try five more times, and only then store them
* coingecko: fix getting actual rates, add a timestamp parameter to get uncached responses
* vertcoin_testnet.json: remove fiat rates parameters
* fiat_rates: add timestamp to log message about skipping the repeating rates
2019-12-17 02:40:02 -07:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="row">
|
2019-12-17 06:37:24 -07:00
|
|
|
<div class="col" id="subscribeAddressesResult"></div>
|
Add fiat rates functionality (#316)
* Add initial commit for fiat rates functionality
* templates.go: use bash from current user's environment
* bitcoinrpc.go: add FiatRates and FiatRatesParams to config
* blockbook.go: add initFiatRatesDownloader kickoff
* bitcoin.json: add coingecko API URL
* rockdb.go: add FindTicker and StoreTicker functions
* rocksdb_test.go: add a simple test for storing and getting FiatRate tickers
* rocksdb: add FindLastTicker and convertDate, make FindTicker return strings
* rocksdb: add ConvertDate function and CoinGeckoTicker struct, update tests
* blockbook.go, fiat: finalize the CoinGecko downloader
* coingecko.go: do not stop syncing when encountered an error
* rocksdb_test: fix the exported function name
* worker.go: make getBlockInfoFromBlockID a public function
* public.go: apiTickers kickoff
* rocksdb_test: fix the unittest comment
* coingecko.go: update comments
* blockbook.go, fiat: reword CoinGecko -> FiatRates, fix binary search upper bound, remove assignment of goroutine call result
* rename coingecko -> fiat_rates
* fiat_rates: export only the necessary methods
* blockbook.go: update log message
* bitcoinrpc.go: remove fiatRates settings
* use CurrencyRatesTicker structure everywhere, fix time format string, update tests, use UTC time
* add /api/v2/tickers tests, store rates as strings (json.Number)
* fiat_rates: add more tests, metrics and tickers-list endpoint, make the "currency" parameter mandatory
* public, worker: move FiatRates API logic to worker.go
* fiat_rates: add a future date test, fix comments, add more checks, store time as a pointer
* rocksdb_test: remove unneeded code
* fiat_rates: add a "ping" call to check server availability
* fiat_rates: do not return empty ticker, return nil instead if not found
add a test for non-existent ticker
* rocksdb_test: remove Sleep from tests
* worker.go: do not propagate all API errors to the client
* move InitTestFiatRates from rocksdb.go to public_test.go
* public.go: fix FiatRatesFindLastTicker result check
* fiat_rates: mock API server responses
* remove commented-out code
* fiat_rates: add comment explaining what periodSeconds attribute is used for
* websocket.go: implement fiatRates websocket endpoints & add tests
* fiatRates: add getFiatRatesTickersList websocket endpoint & test
* fiatRates: make websocket getFiatRatesByDate accept an array of dates, add more tests
* fiatRates: remove getFiatRatesForBlockID from websocket endpoints
* fiatRates: remove "if test", use custom startTime instead
Update tests and mock data
* fiatRates: finalize websocket functionality
add "date" parameter to TickerList
return data timestamps where needed
fix sync bugs (nil timestamp, duplicate save)
* fiatRates: add FiatRates configs for different coins
* worker.go: make GetBlockInfoFromBlockID private again
* fiatRates: wait & retry on errors, remove Ping function
* websocket.go: remove incorrect comment
* fiatRates: move coingecko-related code to a separate file, use interface
* fiatRates: if the new rates are the same as previous, try five more times, and only then store them
* coingecko: fix getting actual rates, add a timestamp parameter to get uncached responses
* vertcoin_testnet.json: remove fiat rates parameters
* fiat_rates: add timestamp to log message about skipping the repeating rates
2019-12-17 02:40:02 -07:00
|
|
|
</div>
|
|
|
|
<div class="row">
|
2019-12-17 06:37:24 -07:00
|
|
|
<div class="col-3">
|
Add fiat rates functionality (#316)
* Add initial commit for fiat rates functionality
* templates.go: use bash from current user's environment
* bitcoinrpc.go: add FiatRates and FiatRatesParams to config
* blockbook.go: add initFiatRatesDownloader kickoff
* bitcoin.json: add coingecko API URL
* rockdb.go: add FindTicker and StoreTicker functions
* rocksdb_test.go: add a simple test for storing and getting FiatRate tickers
* rocksdb: add FindLastTicker and convertDate, make FindTicker return strings
* rocksdb: add ConvertDate function and CoinGeckoTicker struct, update tests
* blockbook.go, fiat: finalize the CoinGecko downloader
* coingecko.go: do not stop syncing when encountered an error
* rocksdb_test: fix the exported function name
* worker.go: make getBlockInfoFromBlockID a public function
* public.go: apiTickers kickoff
* rocksdb_test: fix the unittest comment
* coingecko.go: update comments
* blockbook.go, fiat: reword CoinGecko -> FiatRates, fix binary search upper bound, remove assignment of goroutine call result
* rename coingecko -> fiat_rates
* fiat_rates: export only the necessary methods
* blockbook.go: update log message
* bitcoinrpc.go: remove fiatRates settings
* use CurrencyRatesTicker structure everywhere, fix time format string, update tests, use UTC time
* add /api/v2/tickers tests, store rates as strings (json.Number)
* fiat_rates: add more tests, metrics and tickers-list endpoint, make the "currency" parameter mandatory
* public, worker: move FiatRates API logic to worker.go
* fiat_rates: add a future date test, fix comments, add more checks, store time as a pointer
* rocksdb_test: remove unneeded code
* fiat_rates: add a "ping" call to check server availability
* fiat_rates: do not return empty ticker, return nil instead if not found
add a test for non-existent ticker
* rocksdb_test: remove Sleep from tests
* worker.go: do not propagate all API errors to the client
* move InitTestFiatRates from rocksdb.go to public_test.go
* public.go: fix FiatRatesFindLastTicker result check
* fiat_rates: mock API server responses
* remove commented-out code
* fiat_rates: add comment explaining what periodSeconds attribute is used for
* websocket.go: implement fiatRates websocket endpoints & add tests
* fiatRates: add getFiatRatesTickersList websocket endpoint & test
* fiatRates: make websocket getFiatRatesByDate accept an array of dates, add more tests
* fiatRates: remove getFiatRatesForBlockID from websocket endpoints
* fiatRates: remove "if test", use custom startTime instead
Update tests and mock data
* fiatRates: finalize websocket functionality
add "date" parameter to TickerList
return data timestamps where needed
fix sync bugs (nil timestamp, duplicate save)
* fiatRates: add FiatRates configs for different coins
* worker.go: make GetBlockInfoFromBlockID private again
* fiatRates: wait & retry on errors, remove Ping function
* websocket.go: remove incorrect comment
* fiatRates: move coingecko-related code to a separate file, use interface
* fiatRates: if the new rates are the same as previous, try five more times, and only then store them
* coingecko: fix getting actual rates, add a timestamp parameter to get uncached responses
* vertcoin_testnet.json: remove fiat rates parameters
* fiat_rates: add timestamp to log message about skipping the repeating rates
2019-12-17 02:40:02 -07:00
|
|
|
<input class="btn btn-secondary" type="button" value="subscribe new fiat rates" onclick="subscribeNewFiatRatesTicker()">
|
|
|
|
</div>
|
2019-12-17 06:37:24 -07:00
|
|
|
<div class="col-1">
|
Add fiat rates functionality (#316)
* Add initial commit for fiat rates functionality
* templates.go: use bash from current user's environment
* bitcoinrpc.go: add FiatRates and FiatRatesParams to config
* blockbook.go: add initFiatRatesDownloader kickoff
* bitcoin.json: add coingecko API URL
* rockdb.go: add FindTicker and StoreTicker functions
* rocksdb_test.go: add a simple test for storing and getting FiatRate tickers
* rocksdb: add FindLastTicker and convertDate, make FindTicker return strings
* rocksdb: add ConvertDate function and CoinGeckoTicker struct, update tests
* blockbook.go, fiat: finalize the CoinGecko downloader
* coingecko.go: do not stop syncing when encountered an error
* rocksdb_test: fix the exported function name
* worker.go: make getBlockInfoFromBlockID a public function
* public.go: apiTickers kickoff
* rocksdb_test: fix the unittest comment
* coingecko.go: update comments
* blockbook.go, fiat: reword CoinGecko -> FiatRates, fix binary search upper bound, remove assignment of goroutine call result
* rename coingecko -> fiat_rates
* fiat_rates: export only the necessary methods
* blockbook.go: update log message
* bitcoinrpc.go: remove fiatRates settings
* use CurrencyRatesTicker structure everywhere, fix time format string, update tests, use UTC time
* add /api/v2/tickers tests, store rates as strings (json.Number)
* fiat_rates: add more tests, metrics and tickers-list endpoint, make the "currency" parameter mandatory
* public, worker: move FiatRates API logic to worker.go
* fiat_rates: add a future date test, fix comments, add more checks, store time as a pointer
* rocksdb_test: remove unneeded code
* fiat_rates: add a "ping" call to check server availability
* fiat_rates: do not return empty ticker, return nil instead if not found
add a test for non-existent ticker
* rocksdb_test: remove Sleep from tests
* worker.go: do not propagate all API errors to the client
* move InitTestFiatRates from rocksdb.go to public_test.go
* public.go: fix FiatRatesFindLastTicker result check
* fiat_rates: mock API server responses
* remove commented-out code
* fiat_rates: add comment explaining what periodSeconds attribute is used for
* websocket.go: implement fiatRates websocket endpoints & add tests
* fiatRates: add getFiatRatesTickersList websocket endpoint & test
* fiatRates: make websocket getFiatRatesByDate accept an array of dates, add more tests
* fiatRates: remove getFiatRatesForBlockID from websocket endpoints
* fiatRates: remove "if test", use custom startTime instead
Update tests and mock data
* fiatRates: finalize websocket functionality
add "date" parameter to TickerList
return data timestamps where needed
fix sync bugs (nil timestamp, duplicate save)
* fiatRates: add FiatRates configs for different coins
* worker.go: make GetBlockInfoFromBlockID private again
* fiatRates: wait & retry on errors, remove Ping function
* websocket.go: remove incorrect comment
* fiatRates: move coingecko-related code to a separate file, use interface
* fiatRates: if the new rates are the same as previous, try five more times, and only then store them
* coingecko: fix getting actual rates, add a timestamp parameter to get uncached responses
* vertcoin_testnet.json: remove fiat rates parameters
* fiat_rates: add timestamp to log message about skipping the repeating rates
2019-12-17 02:40:02 -07:00
|
|
|
<span id="subscribeNewFiatRatesTickerId"></span>
|
|
|
|
</div>
|
2019-12-17 06:37:24 -07:00
|
|
|
<div class="col-1">
|
Add fiat rates functionality (#316)
* Add initial commit for fiat rates functionality
* templates.go: use bash from current user's environment
* bitcoinrpc.go: add FiatRates and FiatRatesParams to config
* blockbook.go: add initFiatRatesDownloader kickoff
* bitcoin.json: add coingecko API URL
* rockdb.go: add FindTicker and StoreTicker functions
* rocksdb_test.go: add a simple test for storing and getting FiatRate tickers
* rocksdb: add FindLastTicker and convertDate, make FindTicker return strings
* rocksdb: add ConvertDate function and CoinGeckoTicker struct, update tests
* blockbook.go, fiat: finalize the CoinGecko downloader
* coingecko.go: do not stop syncing when encountered an error
* rocksdb_test: fix the exported function name
* worker.go: make getBlockInfoFromBlockID a public function
* public.go: apiTickers kickoff
* rocksdb_test: fix the unittest comment
* coingecko.go: update comments
* blockbook.go, fiat: reword CoinGecko -> FiatRates, fix binary search upper bound, remove assignment of goroutine call result
* rename coingecko -> fiat_rates
* fiat_rates: export only the necessary methods
* blockbook.go: update log message
* bitcoinrpc.go: remove fiatRates settings
* use CurrencyRatesTicker structure everywhere, fix time format string, update tests, use UTC time
* add /api/v2/tickers tests, store rates as strings (json.Number)
* fiat_rates: add more tests, metrics and tickers-list endpoint, make the "currency" parameter mandatory
* public, worker: move FiatRates API logic to worker.go
* fiat_rates: add a future date test, fix comments, add more checks, store time as a pointer
* rocksdb_test: remove unneeded code
* fiat_rates: add a "ping" call to check server availability
* fiat_rates: do not return empty ticker, return nil instead if not found
add a test for non-existent ticker
* rocksdb_test: remove Sleep from tests
* worker.go: do not propagate all API errors to the client
* move InitTestFiatRates from rocksdb.go to public_test.go
* public.go: fix FiatRatesFindLastTicker result check
* fiat_rates: mock API server responses
* remove commented-out code
* fiat_rates: add comment explaining what periodSeconds attribute is used for
* websocket.go: implement fiatRates websocket endpoints & add tests
* fiatRates: add getFiatRatesTickersList websocket endpoint & test
* fiatRates: make websocket getFiatRatesByDate accept an array of dates, add more tests
* fiatRates: remove getFiatRatesForBlockID from websocket endpoints
* fiatRates: remove "if test", use custom startTime instead
Update tests and mock data
* fiatRates: finalize websocket functionality
add "date" parameter to TickerList
return data timestamps where needed
fix sync bugs (nil timestamp, duplicate save)
* fiatRates: add FiatRates configs for different coins
* worker.go: make GetBlockInfoFromBlockID private again
* fiatRates: wait & retry on errors, remove Ping function
* websocket.go: remove incorrect comment
* fiatRates: move coingecko-related code to a separate file, use interface
* fiatRates: if the new rates are the same as previous, try five more times, and only then store them
* coingecko: fix getting actual rates, add a timestamp parameter to get uncached responses
* vertcoin_testnet.json: remove fiat rates parameters
* fiat_rates: add timestamp to log message about skipping the repeating rates
2019-12-17 02:40:02 -07:00
|
|
|
<input type="text" class="form-control" id="subscribeFiatRatesCurrency" value="usd">
|
|
|
|
</div>
|
2019-12-17 06:37:24 -07:00
|
|
|
<div class="col-5">
|
Add fiat rates functionality (#316)
* Add initial commit for fiat rates functionality
* templates.go: use bash from current user's environment
* bitcoinrpc.go: add FiatRates and FiatRatesParams to config
* blockbook.go: add initFiatRatesDownloader kickoff
* bitcoin.json: add coingecko API URL
* rockdb.go: add FindTicker and StoreTicker functions
* rocksdb_test.go: add a simple test for storing and getting FiatRate tickers
* rocksdb: add FindLastTicker and convertDate, make FindTicker return strings
* rocksdb: add ConvertDate function and CoinGeckoTicker struct, update tests
* blockbook.go, fiat: finalize the CoinGecko downloader
* coingecko.go: do not stop syncing when encountered an error
* rocksdb_test: fix the exported function name
* worker.go: make getBlockInfoFromBlockID a public function
* public.go: apiTickers kickoff
* rocksdb_test: fix the unittest comment
* coingecko.go: update comments
* blockbook.go, fiat: reword CoinGecko -> FiatRates, fix binary search upper bound, remove assignment of goroutine call result
* rename coingecko -> fiat_rates
* fiat_rates: export only the necessary methods
* blockbook.go: update log message
* bitcoinrpc.go: remove fiatRates settings
* use CurrencyRatesTicker structure everywhere, fix time format string, update tests, use UTC time
* add /api/v2/tickers tests, store rates as strings (json.Number)
* fiat_rates: add more tests, metrics and tickers-list endpoint, make the "currency" parameter mandatory
* public, worker: move FiatRates API logic to worker.go
* fiat_rates: add a future date test, fix comments, add more checks, store time as a pointer
* rocksdb_test: remove unneeded code
* fiat_rates: add a "ping" call to check server availability
* fiat_rates: do not return empty ticker, return nil instead if not found
add a test for non-existent ticker
* rocksdb_test: remove Sleep from tests
* worker.go: do not propagate all API errors to the client
* move InitTestFiatRates from rocksdb.go to public_test.go
* public.go: fix FiatRatesFindLastTicker result check
* fiat_rates: mock API server responses
* remove commented-out code
* fiat_rates: add comment explaining what periodSeconds attribute is used for
* websocket.go: implement fiatRates websocket endpoints & add tests
* fiatRates: add getFiatRatesTickersList websocket endpoint & test
* fiatRates: make websocket getFiatRatesByDate accept an array of dates, add more tests
* fiatRates: remove getFiatRatesForBlockID from websocket endpoints
* fiatRates: remove "if test", use custom startTime instead
Update tests and mock data
* fiatRates: finalize websocket functionality
add "date" parameter to TickerList
return data timestamps where needed
fix sync bugs (nil timestamp, duplicate save)
* fiatRates: add FiatRates configs for different coins
* worker.go: make GetBlockInfoFromBlockID private again
* fiatRates: wait & retry on errors, remove Ping function
* websocket.go: remove incorrect comment
* fiatRates: move coingecko-related code to a separate file, use interface
* fiatRates: if the new rates are the same as previous, try five more times, and only then store them
* coingecko: fix getting actual rates, add a timestamp parameter to get uncached responses
* vertcoin_testnet.json: remove fiat rates parameters
* fiat_rates: add timestamp to log message about skipping the repeating rates
2019-12-17 02:40:02 -07:00
|
|
|
<input class="btn btn-secondary" id="unsubscribeNewFiatRatesTickerButton" style="display: none;" type="button" value="unsubscribe" onclick="unsubscribeNewFiatRatesTicker()">
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="row">
|
|
|
|
<div class="col" id="subscribeNewFiatRatesTickerResult"></div>
|
|
|
|
</div>
|
2018-12-09 16:26:04 -07:00
|
|
|
</div>
|
2019-12-17 06:37:24 -07:00
|
|
|
<br><br>
|
2018-12-09 16:26:04 -07:00
|
|
|
</body>
|
|
|
|
<script>
|
2018-12-11 03:50:43 -07:00
|
|
|
document.getElementById('serverAddress').value = window.location.protocol + "//" + window.location.host;
|
2018-12-09 16:26:04 -07:00
|
|
|
</script>
|
|
|
|
|
|
|
|
</html>
|