Skip to content

Commit 71ad615

Browse files
committed
feat: add account as a transport config parameter
1 parent 8d24f14 commit 71ad615

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

.changeset/lovely-lizards-trade.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"viem": patch
3+
---
4+
5+
Added `account` as a transport config parameter.

src/clients/createClient.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,7 @@ export function createClient(parameters: ClientConfig): Client {
255255
? parseAccount(parameters.account)
256256
: undefined
257257
const { config, request, value } = parameters.transport({
258+
account,
258259
chain,
259260
pollingInterval,
260261
})

src/clients/transports/createTransport.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import type { ErrorType } from '../../errors/utils.js'
2+
import type { Account } from '../../types/account.js'
23
import type { Chain } from '../../types/chain.js'
34
import type { EIP1193RequestFn } from '../../types/eip1193.js'
45
import type { OneOf } from '../../types/utils.js'
@@ -44,6 +45,7 @@ export type Transport<
4445
> = <chain extends Chain | undefined = Chain>({
4546
chain,
4647
}: {
48+
account?: Account | undefined
4749
chain?: chain | undefined
4850
pollingInterval?: ClientConfig['pollingInterval'] | undefined
4951
retryCount?: TransportConfig['retryCount'] | undefined

0 commit comments

Comments
 (0)