Skip to content

Commit

Permalink
fix: wallet_sendCalls types
Browse files Browse the repository at this point in the history
  • Loading branch information
jxom committed May 6, 2024
1 parent 72c406d commit 6e28131
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 9 deletions.
5 changes: 5 additions & 0 deletions .changeset/witty-fans-worry.md
@@ -0,0 +1,5 @@
---
"viem": patch
---

Fixed types for `wallet_sendCalls`.
21 changes: 13 additions & 8 deletions src/types/eip1193.ts
Expand Up @@ -16,7 +16,7 @@ import type {
RpcTransactionRequest as TransactionRequest,
RpcUncle as Uncle,
} from './rpc.js'
import type { ExactPartial, Prettify } from './utils.js'
import type { ExactPartial, OneOf, Prettify } from './utils.js'

//////////////////////////////////////////////////
// Provider
Expand Down Expand Up @@ -155,15 +155,20 @@ export type WalletSendCallsParameters<
quantity extends Quantity | bigint = Quantity,
> = [
{
version: string
calls: OneOf<
| {
to: Address
data?: Hex | undefined
value?: quantity | undefined
}
| {
data: Hex
}
>[]
capabilities?: capabilities | undefined
chainId: chainId
from: Address
calls: {
to: Address
data: Hex
value: quantity
}[]
capabilities?: capabilities | undefined
version: string
},
]

Expand Down
2 changes: 1 addition & 1 deletion src/types/transaction.ts
Expand Up @@ -157,7 +157,7 @@ export type TransactionEIP4844<
/** EIP-2930 Access List. */
accessList: AccessList
/** List of versioned blob hashes associated with the transaction's blobs. */
blobVersionedHashes: Hex[]
blobVersionedHashes: readonly Hex[]
/** Chain ID that this transaction is valid on. */
chainId: TIndex
type: TType
Expand Down

0 comments on commit 6e28131

Please sign in to comment.