From 2720ba566d02fdb2c6ddc8d016ec252606a9cb95 Mon Sep 17 00:00:00 2001 From: jxom Date: Thu, 6 Apr 2023 14:05:38 +1000 Subject: [PATCH] fix: `transports` property type on `FallbackTransport` (#317) --- .changeset/thick-owls-obey.md | 5 +++++ src/clients/transports/fallback.ts | 6 ++---- 2 files changed, 7 insertions(+), 4 deletions(-) create mode 100644 .changeset/thick-owls-obey.md diff --git a/.changeset/thick-owls-obey.md b/.changeset/thick-owls-obey.md new file mode 100644 index 0000000000..cc7505c484 --- /dev/null +++ b/.changeset/thick-owls-obey.md @@ -0,0 +1,5 @@ +--- +"viem": patch +--- + +Fixed `transports` property type on `FallbackTransport`. diff --git a/src/clients/transports/fallback.ts b/src/clients/transports/fallback.ts index e90871eff6..307ec85955 100644 --- a/src/clients/transports/fallback.ts +++ b/src/clients/transports/fallback.ts @@ -52,7 +52,7 @@ export type FallbackTransportConfig = { export type FallbackTransport = Transport< 'fallback', - { transports: Transport[] } + { transports: ReturnType[] } > export function fallback( @@ -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 })), }, )