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

cowprotocol / cow-sdk / 13979843919

20 Mar 2025 09:35PM UTC coverage: 77.102% (-1.6%) from 78.663%
13979843919

Pull #251

github

anxolin
chore: improve error handling in the api
Pull Request #251: feat(bridging): bridge using across

376 of 514 branches covered (73.15%)

Branch coverage included in aggregate %.

84 of 138 new or added lines in 10 files covered. (60.87%)

816 of 1032 relevant lines covered (79.07%)

17.74 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 {
NEW
9
  if (isSupportedChain(chainId)) {
×
NEW
10
    return ALL_SUPPORTED_CHAINS_MAP[chainId]
×
11
  }
12

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

17
  // Unknown chain
NEW
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 {
NEW
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 {
NEW
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 {
NEW
39
  return isSupportedChain(chainId) || isAdditionalTargetChain(chainId)
×
40
}
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