@dynamic-labs/utils
Advanced tools
Comparing version 2.5.2 to 2.5.3
{ | ||
"name": "@dynamic-labs/utils", | ||
"version": "2.5.2", | ||
"version": "2.5.3", | ||
"repository": { | ||
@@ -31,4 +31,4 @@ "type": "git", | ||
"tldts": "6.0.16", | ||
"@dynamic-labs/logger": "2.5.2", | ||
"@dynamic-labs/types": "2.5.2", | ||
"@dynamic-labs/logger": "2.5.3", | ||
"@dynamic-labs/types": "2.5.3", | ||
"buffer": "6.0.3", | ||
@@ -35,0 +35,0 @@ "stream": "0.0.2" |
'use client' | ||
import * as chains from 'viem/chains'; | ||
import { logger } from './logger/logger.js'; | ||
@@ -41,12 +42,17 @@ // eslint-disable-next-line import/no-namespace | ||
const getOrMapViemChain = (network) => { | ||
let chain; | ||
let viemChain; | ||
try { | ||
chain = getChain(network.chainId); | ||
viemChain = getChain(network.chainId); | ||
} | ||
catch (_a) { | ||
chain = mapChain(network); | ||
logger.debug(`Chain with id ${network.chainId} not found in viem's chains`); | ||
} | ||
return chain; | ||
const mappedChain = mapChain(network); | ||
if (!viemChain) { | ||
return mappedChain; | ||
} | ||
// even if a chain is found in viem's chains, we still want to overwrite some values | ||
return Object.assign(Object.assign({}, viemChain), mappedChain); | ||
}; | ||
export { getChain, getOrMapViemChain, mapChain }; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
451845
3466
+ Added@dynamic-labs/logger@2.5.3(transitive)
+ Added@dynamic-labs/types@2.5.3(transitive)
- Removed@dynamic-labs/logger@2.5.2(transitive)
- Removed@dynamic-labs/types@2.5.2(transitive)
Updated@dynamic-labs/logger@2.5.3
Updated@dynamic-labs/types@2.5.3