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

Function assertCurrentChain

src/utils/chain/assertCurrentChain.ts:20–27  ·  view source on GitHub ↗
({
  chain,
  currentChainId,
}: AssertCurrentChainParameters)

Source from the content-addressed store, hash-verified

18 | ErrorType
19
20export function assertCurrentChain({
21 chain,
22 currentChainId,
23}: AssertCurrentChainParameters): void {
24 if (!chain) throw new ChainNotFoundError()
25 if (currentChainId !== chain.id)
26 throw new ChainMismatchError({ chain, currentChainId })
27}

Callers 6

signTransactionFunction · 0.85
sendTransactionSyncFunction · 0.85
sendTransactionFunction · 0.85
signEip712TransactionFunction · 0.85
sendEip712TransactionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected