Skip to content

Commit

Permalink
Add NetworkGetBlockOptions type (#6)
Browse files Browse the repository at this point in the history
* Add NetworkGetBlockOptions type

* Add changeset for network patch

* Update changset PR names
  • Loading branch information
ryangoree authored Feb 12, 2024
1 parent fd5f1b3 commit 6d60418
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 21 deletions.
5 changes: 5 additions & 0 deletions .changeset/curvy-grapes-roll.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@delvtech/evm-client": patch
---

Added NetworkGetBlockOptions type
2 changes: 2 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ jobs:
id: changesets
uses: changesets/action@v1
with:
commit: 'chore: version packages'
title: 'chore: version packages'
publish: yarn release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
1 change: 1 addition & 0 deletions packages/evm-client/src/exports/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export type { Block, BlockTag } from 'src/network/types/Block';
export type {
Network,
NetworkGetBlockArgs,
NetworkGetBlockOptions,
NetworkGetTransactionArgs,
} from 'src/network/types/Network';
export type {
Expand Down
39 changes: 18 additions & 21 deletions packages/evm-client/src/network/types/Network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,26 +21,23 @@ export interface Network {
): Promise<Transaction | undefined>;
}

export type NetworkGetBlockArgs = [
options?:
| {
blockHash?: `0x${string}`;
blockNumber?: never;
blockTag?: never;
}
| {
blockHash?: never;
blockNumber?: bigint;
blockTag?: never;
}
| {
blockHash?: never;
blockNumber?: never;
/**
* @default 'latest'
*/
blockTag?: BlockTag;
},
];
export type NetworkGetBlockOptions =
| {
blockHash?: `0x${string}`;
blockNumber?: never;
blockTag?: never;
}
| {
blockHash?: never;
blockNumber?: bigint;
blockTag?: never;
}
| {
blockHash?: never;
blockNumber?: never;
blockTag?: BlockTag;
};

export type NetworkGetBlockArgs = [options?: NetworkGetBlockOptions];

export type NetworkGetTransactionArgs = [hash: `0x${string}`];

0 comments on commit 6d60418

Please sign in to comment.