Skip to content

Commit

Permalink
fix: transports property type on FallbackTransport (#317)
Browse files Browse the repository at this point in the history
  • Loading branch information
jxom authored Apr 6, 2023
1 parent ca239e1 commit 2720ba5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/thick-owls-obey.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"viem": patch
---

Fixed `transports` property type on `FallbackTransport`.
6 changes: 2 additions & 4 deletions src/clients/transports/fallback.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export type FallbackTransportConfig = {

export type FallbackTransport = Transport<
'fallback',
{ transports: Transport[] }
{ transports: ReturnType<Transport>[] }
>

export function fallback(
Expand Down Expand Up @@ -100,9 +100,7 @@ export function fallback(
type: 'fallback',
},
{
transports: transports.map(
(fn) => fn({ chain, retryCount: 0 }) as unknown as Transport,
),
transports: transports.map((fn) => fn({ chain, retryCount: 0 })),
},
)

Expand Down

2 comments on commit 2720ba5

@vercel
Copy link

@vercel vercel bot commented on 2720ba5 Apr 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

viem-playground – ./playgrounds/browser

viem-playground.vercel.app
viem-playground-wagmi-dev.vercel.app
viem-playground-git-main-wagmi-dev.vercel.app

@vercel
Copy link

@vercel vercel bot commented on 2720ba5 Apr 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.