New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@exodus/trezor-meta

Package Overview
Dependencies
Maintainers
0
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@exodus/trezor-meta - npm Package Compare versions

Comparing version 2.3.2 to 3.0.0

3

package.json
{
"name": "@exodus/trezor-meta",
"version": "2.3.2",
"version": "3.0.0",
"description": "trezor constants, firmware, and utils",

@@ -56,3 +56,2 @@ "main": "src/index.js",

"dependencies": {
"@exodus/assets-base": "^8.0.53",
"lodash": "^4.17.19"

@@ -59,0 +58,0 @@ },

const lodash = require('lodash')
const semver = require('semver')
const { default: assets } = require('@exodus/assets-base')
const constants = require('./constants')
const coinUtil = require('./coin-util')
const ERC20_TOKEN_NAMES = Object.keys(assets).filter(
(assetName) => assets[assetName].assetType === 'ETHEREUM_ERC20'
)
module.exports = (assets) => {
const ERC20_TOKEN_NAMES = Object.keys(assets).filter(
(assetName) => assets[assetName].assetType === 'ETHEREUM_ERC20'
)
const isSupportedFirmware = ({
model,
major_version: major,
minor_version: minor,
patch_version: patch,
}) => semver.gte([major, minor, patch].join('.'), constants.MINIMUM_FIRMWARE_VERSIONS[model])
const isSupportedFirmware = ({
model,
major_version: major,
minor_version: minor,
patch_version: patch,
}) => semver.gte([major, minor, patch].join('.'), constants.MINIMUM_FIRMWARE_VERSIONS[model])
const SUPPORTED_MODELS = ['T', '1']
const SUPPORTED_MODELS = ['T', '1']
// Assets supported by both trezor models on Exodus
const BASE_SUPPORTED_ASSETS = [
'bitcoin',
'ethereum',
'dash',
'dogecoin',
'decred',
'bgold',
'litecoin',
'bcash',
'ethereumclassic',
'zcash',
'stellar',
'digibyte',
...ERC20_TOKEN_NAMES,
].sort()
// Assets supported by both trezor models on Exodus
const BASE_SUPPORTED_ASSETS = [
'bitcoin',
'ethereum',
'dash',
'dogecoin',
'decred',
'bgold',
'litecoin',
'bcash',
'ethereumclassic',
'zcash',
'stellar',
'digibyte',
...ERC20_TOKEN_NAMES,
].sort()
// Assets supported by specific Trezor models on Exodus.
const ASSETS_BY_MODEL = {
T: [...BASE_SUPPORTED_ASSETS, 'ripple'].sort(),
1: [...BASE_SUPPORTED_ASSETS],
}
// Assets supported by specific Trezor models on Exodus.
const ASSETS_BY_MODEL = {
T: [...BASE_SUPPORTED_ASSETS, 'ripple'].sort(),
1: [...BASE_SUPPORTED_ASSETS],
}
// An object of asset names sorted by the device model which supports them.
// Indicates assets supported on the firmware, but not necessarily
// supported by our trezor integration yet
const FIRMWARE_ASSETS_BY_MODEL = {
T: [...constants.ASSETS_BY_MODEL.T, ...ERC20_TOKEN_NAMES],
1: [...constants.ASSETS_BY_MODEL['1'], ...ERC20_TOKEN_NAMES],
}
// An object of asset names sorted by the device model which supports them.
// Indicates assets supported on the firmware, but not necessarily
// supported by our trezor integration yet
const FIRMWARE_ASSETS_BY_MODEL = {
T: [...constants.ASSETS_BY_MODEL.T, ...ERC20_TOKEN_NAMES],
1: [...constants.ASSETS_BY_MODEL['1'], ...ERC20_TOKEN_NAMES],
}
// Assets supported by either model.
const SUPPORTED_ASSETS = lodash.uniq([].concat(...Object.values(ASSETS_BY_MODEL))).sort()
// Assets supported by either model.
const SUPPORTED_ASSETS = lodash.uniq([].concat(...Object.values(ASSETS_BY_MODEL))).sort()
// Assets supported only by model T.
const SUPPORTED_ONLY_BY_MODEL_T = lodash.difference(ASSETS_BY_MODEL.T, ASSETS_BY_MODEL['1'])
// Assets supported only by model T.
const SUPPORTED_ONLY_BY_MODEL_T = lodash.difference(ASSETS_BY_MODEL.T, ASSETS_BY_MODEL['1'])
// Assets we are planning to support in future.
const FUTURE_SUPPORTED_ASSETS = ['tezos', 'lisk', 'ravencoin']
// Assets we are planning to support in future.
const FUTURE_SUPPORTED_ASSETS = ['tezos', 'lisk', 'ravencoin']
const isSegwit = (assetName) =>
assets[assetName].assetType !== 'ETHEREUM_ERC20' && coinUtil.isSegwit(assetName)
const isSegwit = (assetName) =>
assets[assetName].assetType !== 'ETHEREUM_ERC20' && coinUtil.isSegwit(assetName)
const isSupportedByTrezor = (assetName) => SUPPORTED_ASSETS.includes(assetName)
const isSupportedByTrezor = (assetName) => SUPPORTED_ASSETS.includes(assetName)
const isSupportedOnlyByModelT = (assetName) => SUPPORTED_ONLY_BY_MODEL_T.includes(assetName)
const isSupportedOnlyByModelT = (assetName) => SUPPORTED_ONLY_BY_MODEL_T.includes(assetName)
module.exports = {
isSupportedFirmware,
SUPPORTED_MODELS,
BASE_SUPPORTED_ASSETS,
ASSETS_BY_MODEL,
FIRMWARE_ASSETS_BY_MODEL,
SUPPORTED_ASSETS,
SUPPORTED_ONLY_BY_MODEL_T,
FUTURE_SUPPORTED_ASSETS,
isSegwit,
isSupportedByTrezor,
isSupportedOnlyByModelT,
module.exports = {
isSupportedFirmware,
SUPPORTED_MODELS,
BASE_SUPPORTED_ASSETS,
ASSETS_BY_MODEL,
FIRMWARE_ASSETS_BY_MODEL,
SUPPORTED_ASSETS,
SUPPORTED_ONLY_BY_MODEL_T,
FUTURE_SUPPORTED_ASSETS,
isSegwit,
isSupportedByTrezor,
isSupportedOnlyByModelT,
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc