diff --git a/pi-nexus-explorer/utils/data-utils.js b/pi-nexus-explorer/utils/data-utils.js new file mode 100644 index 000000000..7e9fff2f6 --- /dev/null +++ b/pi-nexus-explorer/utils/data-utils.js @@ -0,0 +1,25 @@ +export const formatBlock = (block: any) => { + return { + number: block.number, + hash: block.hash, + transactions: block.transactions, + }; +}; + +export const formatTransaction = (transaction: any) => { + return { + hash: transaction.hash, + from: transaction.from, + to: transaction.to, + value: transaction.value, + contractAddress: transaction.contractAddress, + }; +}; + +export const formatContract = (contract: any) => { + return { + address: contract.address, + bytecode: contract.bytecode, + abi: contract.abi, + }; +};