Skip to content
Snippets Groups Projects
Commit f4d88abf authored by Dima Rifai's avatar Dima Rifai
Browse files

Issue 328 - Create convertBalanceHistoryResultsToTableOperations

parent 8f5789d3
No related branches found
No related tags found
1 merge request!495Delrifai/#328 create balance history page
...@@ -208,3 +208,21 @@ export const createPathFilterString = ( ...@@ -208,3 +208,21 @@ export const createPathFilterString = (
} }
return undefined; return undefined;
}; };
export const convertBalanceHistoryResultsToTableOperations = (
response: Hive.AccountBalanceHistoryResponse
): Explorer.BalanceHistoryForTable[] => {
if (!response || !response.operations_result) {
return [];
}
return response.operations_result.map((operation) => ({
operationId: Number(operation.operation_id),
blockNumber: operation.block_num,
timestamp: operation.timestamp,
opTypeId: operation.op_type_id,
balance: operation.balance,
prev_balance: operation.prev_balance,
balanceChange: operation.balance_change,
}));
};
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment