• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

cowprotocol / cow-sdk / 17236649112

26 Aug 2025 11:25AM UTC coverage: 73.931% (-0.03%) from 73.959%
17236649112

push

github

web-flow
feat(networks): add `isZkSync` flag to chaininfo (#431)

* feat(networks): add `isZkSync` flag to chaininfo

* feat: add isZkSyncChain util fn

632 of 903 branches covered (69.99%)

Branch coverage included in aggregate %.

0 of 1 new or added line in 1 file covered. (0.0%)

1322 of 1740 relevant lines covered (75.98%)

19.12 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/chains/utils.ts
1
import { ADDITIONAL_TARGET_CHAINS_MAP, ALL_SUPPORTED_CHAINS_MAP } from './const'
2
import { AdditionalTargetChainId, ChainId, ChainInfo, SupportedChainId, TargetChainId } from './types'
3

4
/**
5
 * Return the chain info for a given chain id or undefined if the chain is not known (not supported by CoW Protocol or the bridge providers).
6
 * @param chainId
7
 */
8
export function getChainInfo(chainId: ChainId): ChainInfo | undefined {
9
  if (isSupportedChain(chainId)) {
×
10
    return ALL_SUPPORTED_CHAINS_MAP[chainId]
×
11
  }
12

13
  if (isAdditionalTargetChain(chainId)) {
×
14
    return ADDITIONAL_TARGET_CHAINS_MAP[chainId]
×
15
  }
16

17
  // Unknown chain
18
  return undefined
×
19
}
20

21
/**
22
 * Check if the chain is supported by CoW Protocol.
23
 */
24
export function isSupportedChain(chainId: ChainId): chainId is SupportedChainId {
25
  return chainId in ALL_SUPPORTED_CHAINS_MAP
×
26
}
27

28
/**
29
 * Check if the chain is supported by the bridge providers.
30
 */
31
export function isAdditionalTargetChain(chainId: ChainId): chainId is AdditionalTargetChainId {
32
  return chainId in ADDITIONAL_TARGET_CHAINS_MAP
×
33
}
34

35
/**
36
 * Check if the chain is supported by CoW Swap or the bridge providers.
37
 */
38
export function isTargetChainId(chainId: ChainId): chainId is TargetChainId {
39
  return isSupportedChain(chainId) || isAdditionalTargetChain(chainId)
×
40
}
41

42
export function isZkSyncChain(chainId: ChainId): boolean {
NEW
43
  return !!getChainInfo(chainId)?.isZkSync
×
44
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc