|
|
|
@ -25,15 +25,33 @@ thinwalletCtrls.controller('TransactionDetailsCtrl', function ($scope,
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$scope.tx_hash = tx_hash;
|
|
|
|
|
|
|
|
|
|
// check the tx_hash if it has expected format
|
|
|
|
|
if (tx_hash.length !== 64 || !(/^[0-9a-fA-F]{64}$/.test(tx_hash)))
|
|
|
|
|
{
|
|
|
|
|
$scope.error = "Tx hash has incorrect format";
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// tx_hash seems ok, so ask the backed for its details.
|
|
|
|
|
ApiCalls.get_tx(tx_hash)
|
|
|
|
|
.then(function(response) {
|
|
|
|
|
var data = response.data;
|
|
|
|
|
console.log(data);
|
|
|
|
|
|
|
|
|
|
$scope.ring_size = data.mixin_no;
|
|
|
|
|
$scope.fee = data.fee;
|
|
|
|
|
if (data.error) {
|
|
|
|
|
$scope.error = data.status;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// set data to be shown in the modal window
|
|
|
|
|
$scope.ring_size = data.mixin_no;
|
|
|
|
|
$scope.fee = data.fee;
|
|
|
|
|
$scope.tx_size = Math.round(data.size*1e3) / 1e3;
|
|
|
|
|
$scope.no_confirmations = no_confirmations;
|
|
|
|
|
$scope.tx_height = tx_height;
|
|
|
|
|
$scope.tx_pub_key = pub_key;
|
|
|
|
|
|
|
|
|
|
}, function(data) {
|
|
|
|
|
$scope.error = 'Failed to get tx detailed from the backend';
|
|
|
|
|