@exodus/trezor-meta
Advanced tools
Comparing version 3.3.7 to 3.3.8
{ | ||
"name": "@exodus/trezor-meta", | ||
"version": "3.3.7", | ||
"version": "3.3.8", | ||
"description": "trezor constants, firmware, and utils", | ||
"main": "src/index.js", | ||
"author": "Exodus", | ||
"license": "UNLICENSED", | ||
"author": "Exodus Movement, Inc.", | ||
"license": "MIT", | ||
"files": [ | ||
"src/**", | ||
"!src/__tests__/**" | ||
"!src/__tests__/**", | ||
"CHANGELOG.md" | ||
], | ||
"scripts": { | ||
"lint": "eslint .", | ||
"lint": "run -T eslint", | ||
"pretest": "yarn lint", | ||
"test": "jest" | ||
"test": "run -T exodus-test --jest" | ||
}, | ||
"eslintConfig": { | ||
"parser": "babel-eslint", | ||
"extends": [ | ||
"standard", | ||
"prettier", | ||
"prettier/standard" | ||
], | ||
"plugins": [ | ||
"jest" | ||
], | ||
"env": { | ||
"jest/globals": true | ||
} | ||
"dependencies": { | ||
"semver": "^6.3.0" | ||
}, | ||
"prettier": { | ||
"printWidth": 100, | ||
"semi": false, | ||
"singleQuote": true, | ||
"arrowParens": "always", | ||
"trailingComma": "es5" | ||
"homepage": "https://github.com/ExodusMovement/hydra/tree/master/libraries/trezor-meta", | ||
"bugs": { | ||
"url": "https://github.com/ExodusMovement/hydra/issues?q=is%3Aissue+is%3Aopen+label%3Atrezor-meta" | ||
}, | ||
"husky": { | ||
"hooks": { | ||
"pre-commit": "lint-staged" | ||
} | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/ExodusMovement/hydra.git" | ||
}, | ||
"lint-staged": { | ||
"*.{js,json,md}": [ | ||
"prettier --write" | ||
] | ||
}, | ||
"jest": { | ||
"transform": { | ||
"\\.js$": "babel-jest", | ||
"^(?!.*\\.(js|json)$)": "jest-transforms/file" | ||
} | ||
}, | ||
"dependencies": { | ||
"semver": "^6.3.0" | ||
}, | ||
"devDependencies": { | ||
"babel-eslint": "^10.1.0", | ||
"doctoc": "^1.4.0", | ||
"eslint": "^5.16.0", | ||
"eslint-config-prettier": "^4.0.0", | ||
"eslint-config-standard": "^12.0.0", | ||
"eslint-plugin-import": "^2.15.0", | ||
"eslint-plugin-jest": "^22.5.1", | ||
"eslint-plugin-node": "^8.0.1", | ||
"eslint-plugin-prettier": "^3.1.2", | ||
"eslint-plugin-promise": "^4.0.1", | ||
"eslint-plugin-standard": "^4.0.0", | ||
"husky": "^1.3.1", | ||
"jest": "^24.8.0", | ||
"jest-transforms": "^1.0.0", | ||
"lint-staged": "^8.1.1", | ||
"node-fetch": "^2.6.1", | ||
"prettier": "^1.16.1" | ||
} | ||
"gitHead": "2de0257f0ed62679c297cfc80a27fdda50bb57f1" | ||
} |
const coins = require('./data/coins') | ||
/** Finds the coin data from src/data/coins.json for a given name. | ||
** Throws if the coin is not found. | ||
* @param {String} rawName The coin's name or symbol, upper or lower case. | ||
/** | ||
* Finds the coin data from src/data/coins.json for a given name. | ||
*Throws if the coin is not found. | ||
* @param {string} rawName The coin's name or symbol, upper or lower case. | ||
*/ | ||
@@ -16,3 +17,3 @@ const findCoin = (rawName) => { | ||
] | ||
.filter((s) => s) | ||
.filter(Boolean) | ||
.map((s) => s.toLowerCase()) | ||
@@ -23,2 +24,3 @@ if (possibilities.includes(rawName.toLowerCase())) { | ||
} | ||
throw new Error(`not a supported coin: ${rawName}`) | ||
@@ -25,0 +27,0 @@ } |
@@ -38,3 +38,4 @@ const gte = require('semver').gte | ||
module.exports = { | ||
/** Get the available assets known to trezor. | ||
/** | ||
* Get the available assets known to trezor. | ||
* @returns {Array} An array of asset names (exodus format). | ||
@@ -44,12 +45,15 @@ */ | ||
/** Determine if an asset is segwit-enabled on trezor or not. | ||
* @param {String} coinName The asset's name. | ||
* @returns {Boolean} | ||
/** | ||
* Determine if an asset is segwit-enabled on trezor or not. | ||
* @param {string} coinName The asset's name. | ||
* @returns {boolean} | ||
*/ | ||
/** The minimum firmware versions supported by this library. | ||
/** | ||
The minimum firmware versions supported by this library. | ||
*/ | ||
MINIMUM_FIRMWARE_VERSIONS, | ||
/** The latest available firmware versions known to this library. | ||
/** | ||
The latest available firmware versions known to this library. | ||
*/ | ||
@@ -60,3 +64,3 @@ LATEST_FIRMWARE_VERSIONS, | ||
* Export all asset data on a per-model basis as used by this library. | ||
* @returns {Object} | ||
* @returns {object} | ||
*/ | ||
@@ -63,0 +67,0 @@ ASSETS_BY_MODEL, |
@@ -10,3 +10,3 @@ const constants = require('./constants') | ||
module.exports = (assets) => { | ||
const getTrezorMeta = (assets) => { | ||
const ERC20_TOKEN_NAMES = Object.keys(assets).filter( | ||
@@ -55,3 +55,3 @@ (assetName) => assets[assetName].assetType === 'ETHEREUM_ERC20' | ||
// Assets supported by Trezor but may differ between models. | ||
const SUPPORTED_ASSETS = uniq([].concat(...Object.values(ASSETS_BY_MODEL))).sort() | ||
const SUPPORTED_ASSETS = uniq(Object.values(ASSETS_BY_MODEL).flat()).sort() | ||
@@ -67,2 +67,3 @@ // Assets supported exclusively on model T. | ||
// eslint-disable-next-line @exodus/hydra/no-asset-conditions | ||
const isBip84 = (assetName) => ['bitcoin', 'litecoin'].includes(assetName) | ||
@@ -90,1 +91,3 @@ | ||
} | ||
module.exports = getTrezorMeta |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
Misc. License Issues
License(Experimental) A package's licensing information has fine-grained problems.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
27168
0
9
0
937
0