MCPcopy Create free account
hub / github.com/wevm/viem / assertRequest

Function assertRequest

src/utils/transaction/assertRequest.ts:35–50  ·  view source on GitHub ↗
(args: AssertRequestParameters)

Source from the content-addressed store, hash-verified

33 | ErrorType
34
35export function assertRequest(args: AssertRequestParameters) {
36 const { account: account_, maxFeePerGas, maxPriorityFeePerGas, to } = args
37 const account = account_ ? parseAccount(account_) : undefined
38 if (account && !isAddress(account.address))
39 throw new InvalidAddressError({ address: account.address })
40 if (to && !isAddress(to)) throw new InvalidAddressError({ address: to })
41
42 if (maxFeePerGas && maxFeePerGas > maxUint256)
43 throw new FeeCapTooHighError({ maxFeePerGas })
44 if (
45 maxPriorityFeePerGas &&
46 maxFeePerGas &&
47 maxPriorityFeePerGas > maxFeePerGas
48 )
49 throw new TipAboveFeeCapError({ maxFeePerGas, maxPriorityFeePerGas })
50}

Callers 13

createAccessListFunction · 0.85
callFunction · 0.85
fillTransactionFunction · 0.85
simulateBlocksFunction · 0.85
estimateGasFunction · 0.85
signTransactionFunction · 0.85
sendTransactionSyncFunction · 0.85
sendTransactionFunction · 0.85
assertEip712RequestFunction · 0.85
simulateBlocksFunction · 0.85

Calls 2

parseAccountFunction · 0.85
isAddressFunction · 0.50

Tested by

no test coverage detected