Skip to content

Commit

Permalink
feat: update block type
Browse files Browse the repository at this point in the history
  • Loading branch information
ponyjackal committed Feb 2, 2024
1 parent 5d3770a commit 60aad61
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
8 changes: 7 additions & 1 deletion src/transformers/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { RawBlock } from 'src/types';
import { makeTransform } from '../helpers/utils';
import * as transactionAssetTransfers from './_common/assetTransfers';
import * as transactionDelegateCalls from './_common/delegateCalls';
Expand Down Expand Up @@ -31,7 +32,12 @@ const transformers = Object.fromEntries(

const transform = makeTransform(transformers);

export const transformer = {
type UsabilityTransformer = {
transform: (block: RawBlock) => RawBlock;
children: Record<string, unknown>;
};

export const transformer: UsabilityTransformer = {
transform,
children,
};
12 changes: 8 additions & 4 deletions src/types/block.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
import { StdObj } from './shared';
import { RawTransaction } from './transaction';
import { Contract } from './contract';

export type RawBlock = StdObj & {
chainId?: number;
number: number;
timestamp: number;
transactions: RawTransaction[];
chainId: number;
gasUsed: string;
gasLimit: string;
baseFeePerGas: number | string;
number: number;
timestamp: number;
transactions: RawTransaction[];
contracts: Contract[];
transactionCount: number;
transactionHashes: string[];
};

0 comments on commit 60aad61

Please sign in to comment.