From 6d604185765556934db2de756adc767466e6d6ca Mon Sep 17 00:00:00 2001 From: Ryan Goree Date: Sun, 11 Feb 2024 23:37:33 -0600 Subject: [PATCH] Add `NetworkGetBlockOptions` type (#6) * Add NetworkGetBlockOptions type * Add changeset for network patch * Update changset PR names --- .changeset/curvy-grapes-roll.md | 5 +++ .github/workflows/release.yml | 2 + packages/evm-client/src/exports/types.ts | 1 + .../evm-client/src/network/types/Network.ts | 39 +++++++++---------- 4 files changed, 26 insertions(+), 21 deletions(-) create mode 100644 .changeset/curvy-grapes-roll.md diff --git a/.changeset/curvy-grapes-roll.md b/.changeset/curvy-grapes-roll.md new file mode 100644 index 00000000..376c0475 --- /dev/null +++ b/.changeset/curvy-grapes-roll.md @@ -0,0 +1,5 @@ +--- +"@delvtech/evm-client": patch +--- + +Added NetworkGetBlockOptions type diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4a3a6723..da7a80ec 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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 }} diff --git a/packages/evm-client/src/exports/types.ts b/packages/evm-client/src/exports/types.ts index bc73df0d..5b8f978e 100644 --- a/packages/evm-client/src/exports/types.ts +++ b/packages/evm-client/src/exports/types.ts @@ -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 { diff --git a/packages/evm-client/src/network/types/Network.ts b/packages/evm-client/src/network/types/Network.ts index 868e0e08..d957f04d 100644 --- a/packages/evm-client/src/network/types/Network.ts +++ b/packages/evm-client/src/network/types/Network.ts @@ -21,26 +21,23 @@ export interface Network { ): Promise; } -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}`];