Skip to content

Commit

Permalink
#23 Remove all no longer used routes that were replaced by new univer…
Browse files Browse the repository at this point in the history
…sal history route
  • Loading branch information
ihorml committed Nov 23, 2022
1 parent 8ae52d8 commit ed47c4b
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 123 deletions.
41 changes: 0 additions & 41 deletions app/core/service.account.js
Original file line number Diff line number Diff line change
Expand Up @@ -287,47 +287,6 @@
callback(results);
}
},
getAccountHistory: function(account_id, limit, from, callback) {
return $http.get(appConfig.urls.elasticsearch_wrapper() + "/account_history"
+ "?account_id=" + account_id
+ "&offset=" + from
+ "&limit=" + limit
+ (from == 0 ? "&from_date=now-1y" : "&from_date=2015-10-10")
).then(response => {
let last_ops = [];

// only add if the op id is not already added (transfer appears in both accounts!)
const unique_data = response.data.filter((v,i,a)=>a.findIndex(t=>(t.operation_id_num === v.operation_id_num))===i);

angular.forEach(unique_data, function (value) {
let operation = {};
operation.block_num = value.block_data.block_num;
operation.operation_id = value.account_history.operation_id;
operation.operation_id_num = value.operation_id_num;
operation.time = value.block_data.block_time;
operation.witness = value.witness;
operation.sequence = value.account_history.sequence;

let parsed_op = value.operation_history.op_object;
if (parsed_op == undefined)
parsed_op = JSON.parse(value.operation_history.op)[1];
if (parsed_op.amount)
parsed_op.amount_ = parsed_op.amount;
const _with_result = {...parsed_op, result: value.operation_history.operation_result};
if (typeof _with_result.result === "string") _with_result.result = JSON.parse(value.operation_history.operation_result);
utilities.opText(appConfig, $http, value.operation_type, _with_result, function(returnData) {
operation.operation_text = returnData;
});

const type_res = utilities.operationType(value.operation_type);
operation.type = type_res[0];
operation.color = type_res[1];

last_ops.push(operation);
});
callback(last_ops);
});
},
exportAccountHistory: function(account_id, premium_code = null, document=null) {
let url = appConfig.urls.elasticsearch_wrapper() + "/export/account_history"
+ "?account_id=" + account_id
Expand Down
82 changes: 0 additions & 82 deletions app/core/service.market.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,47 +169,6 @@
callback(response.data);
});
},
getLiquidityPoolHistory: function(pool_id, limit, from, callback) {
return $http.get(appConfig.urls.elasticsearch_wrapper() + "/pool_operation_history"
+ "?pool_id=" + pool_id
+ "&offset=" + from
+ "&limit=" + limit
+ (from == 0 ? "&from_date=now-1y" : "&from_date=2015-10-10")
).then(response => {
let last_ops = [];

// only add if the op id is not already added (transfer appears in both accounts!)
const unique_data = response.data.filter((v,i,a)=>a.findIndex(t=>(t.operation_id_num === v.operation_id_num))===i);

angular.forEach(unique_data, function (value) {
let operation = {};
operation.block_num = value.block_data.block_num;
operation.operation_id = value.account_history.operation_id;
operation.operation_id_num = value.operation_id_num;
operation.time = value.block_data.block_time;
operation.witness = value.witness;
operation.sequence = value.account_history.sequence;

let parsed_op = value.operation_history.op_object;
if (parsed_op == undefined)
parsed_op = JSON.parse(value.operation_history.op)[1];
if (parsed_op.amount)
parsed_op.amount_ = parsed_op.amount;
const _with_result = {...parsed_op, result: value.operation_history.operation_result};
if (typeof _with_result.result === "string") _with_result.result = JSON.parse(value.operation_history.operation_result);
utilities.opText(appConfig, $http, value.operation_type, _with_result, function(returnData) {
operation.operation_text = returnData;
});

const type_res = utilities.operationType(value.operation_type);
operation.type = type_res[0];
operation.color = type_res[1];

last_ops.push(operation);
});
callback(last_ops);
});
},
getCreditOffers: function () {
return $http.get(appConfig.urls.python_backend() + "/creditoffers").then((response) => {
const data = response && response.data;
Expand All @@ -223,47 +182,6 @@
})
})
},
getCreditOfferOperationsHistory: function (credit_offer_id, limit, offset, from) {
let last_ops = [];

return $http.get(appConfig.urls.python_backend() + "/creditoffer_operation_history", { params: {
creditoffer_id: credit_offer_id,
offset: offset,
limit: limit,
from: (from == 0 ? "now-1y" : "2015-10-10")
}}).then((response) => {
const unique_data = response.data.filter((v,i,a)=>a.findIndex(t=>(t.operation_id_num === v.operation_id_num))===i);

angular.forEach(unique_data, function (value) {
let operation = {};
operation.block_num = value.block_data.block_num;
operation.operation_id = value.account_history.operation_id;
operation.operation_id_num = value.operation_id_num;
operation.time = value.block_data.block_time;
operation.witness = value.witness;
operation.sequence = value.account_history.sequence;

let parsed_op = value.operation_history.op_object;
if (parsed_op == undefined)
parsed_op = JSON.parse(value.operation_history.op)[1];
if (parsed_op.amount)
parsed_op.amount_ = parsed_op.amount;
const _with_result = {...parsed_op, result: value.operation_history.operation_result};
if (typeof _with_result.result === "string") _with_result.result = JSON.parse(value.operation_history.operation_result);
utilities.opText(appConfig, $http, value.operation_type, _with_result, function(returnData) {
operation.operation_text = returnData;
});

const type_res = utilities.operationType(value.operation_type);
operation.type = type_res[0];
operation.color = type_res[1];

last_ops.push(operation);
});

return last_ops
})
}
};
}

Expand Down

0 comments on commit ed47c4b

Please sign in to comment.