-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: add optimism-decoder package * feat: Add error handling for undefined bytes in utils.ts * feat: added download.ts script + refactor * feat: Added saveFilesToDB * chore: Update npm scripts for saveFilesToDB * chore: update pnpm-lock.yaml * chore: Update pnpm-lock.yaml and package.json dependencies * chore: Add decoded transaction fields to transaction page * Update packages/optimism-decoder/src/decoder.ts Co-authored-by: Francisco Jiménez Aguilera <franjimenezaguilera@gmail.com> * add TODO issue links * refactor: move commands to its own package * fix: blob-decoder package import * pnpm lock * fix migration * chore: update turbo * op:generate-import-csv * add summary * Refactor transaction page to display decoded transaction data * chore: Add links to etherscan in the optimism decoded blob data * chore: bump turbo * chore: update turbo commands to v2 * Revert "chore: update turbo commands to v2" This reverts commit b58c63f. * Revert "chore: bump turbo" This reverts commit 441efd2. * Revert "chore: update turbo" This reverts commit 9a6ea15. * test: check for `decodedFields` * chore: resolve lint warnings * chore: add changeset * test(db): fix tests --------- Co-authored-by: Luis Herasme <luis.alberto.herasme.cuevas@gmail.com> Co-authored-by: Francisco Jiménez Aguilera <franjimenezaguilera@gmail.com> Co-authored-by: PJColombo <paulo.colombo@pm.me>
- Loading branch information
1 parent
5a4a662
commit 78468dd
Showing
30 changed files
with
1,264 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
"@blobscan/api": minor | ||
"@blobscan/web": minor | ||
--- | ||
|
||
Displayed Optimism decoded blob data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@blobscan/db": minor | ||
--- | ||
|
||
Added `decodedFields` JSON field for storing decoded-blob-related data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { z } from "zod"; | ||
|
||
export const OptimismDecodedDataSchema = z.object({ | ||
timestampSinceL2Genesis: z.number(), | ||
lastL1OriginNumber: z.number(), | ||
parentL2BlockHash: z.string(), | ||
l1OriginBlockHash: z.string(), | ||
numberOfL2Blocks: z.number(), | ||
changedByL1Origin: z.number(), | ||
totalTxs: z.number(), | ||
contractCreationTxsNumber: z.number(), | ||
}); | ||
|
||
type OptimismDecodedData = z.infer<typeof OptimismDecodedDataSchema>; | ||
|
||
export function parseDecodedData(data: string): OptimismDecodedData | null { | ||
let json; | ||
|
||
try { | ||
json = JSON.parse(data); | ||
} catch (error) { | ||
return null; | ||
} | ||
|
||
const decoded = OptimismDecodedDataSchema.safeParse(json); | ||
|
||
if (!decoded.success) { | ||
return null; | ||
} | ||
|
||
return decoded.data; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.