Skip to content

Commit

Permalink
Create data-utils.js
Browse files Browse the repository at this point in the history
  • Loading branch information
KOSASIH authored Aug 27, 2024
1 parent 5adf4e2 commit 368808e
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions pi-nexus-explorer/utils/data-utils.js
Original file line number Diff line number Diff line change
@@ -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,
};
};

0 comments on commit 368808e

Please sign in to comment.