@exodus/models
Advanced tools
Comparing version 8.5.10 to 8.5.11
@@ -0,1 +1,5 @@ | ||
## 8.5.11 / 2021-05-14 | ||
- Feat: add wallet custodial flag and ftx support | ||
## 8.5.10 / 2021-04-28 | ||
@@ -2,0 +6,0 @@ |
@@ -6,3 +6,3 @@ "use strict"; | ||
}); | ||
exports.default = exports.getDefaultLabel = exports.LABEL_MAX_LENGTH = exports.DEFAULT_ICONS = exports.DEFAULT_COLORS = exports.LEDGER_SRC = exports.TREZOR_SRC = exports.EXODUS_SRC = void 0; | ||
exports.default = exports.getDefaultLabel = exports.LABEL_MAX_LENGTH = exports.DEFAULT_ICONS = exports.DEFAULT_COLORS = exports.HARDWARE_SOURCES = exports.CUSTODIAL_SOURCES = exports.FTX_SRC = exports.LEDGER_SRC = exports.TREZOR_SRC = exports.EXODUS_SRC = void 0; | ||
@@ -23,6 +23,13 @@ var _proxyFreeze = _interopRequireDefault(require("proxy-freeze")); | ||
exports.LEDGER_SRC = LEDGER_SRC; | ||
const FTX_SRC = 'ftx'; | ||
exports.FTX_SRC = FTX_SRC; | ||
const CUSTODIAL_SOURCES = [FTX_SRC]; | ||
exports.CUSTODIAL_SOURCES = CUSTODIAL_SOURCES; | ||
const HARDWARE_SOURCES = [TREZOR_SRC, LEDGER_SRC]; | ||
exports.HARDWARE_SOURCES = HARDWARE_SOURCES; | ||
const DEFAULT_COLORS = Object.freeze({ | ||
exodus: '#ff3974', | ||
trezor: '#7b39ff', | ||
ledger: '#f5e400' | ||
ledger: '#f5e400', | ||
ftx: '#00b4c2' | ||
}); | ||
@@ -33,3 +40,4 @@ exports.DEFAULT_COLORS = DEFAULT_COLORS; | ||
trezor: 'trezor', | ||
ledger: 'trezor' | ||
ledger: 'trezor', | ||
ftx: 'ftx' | ||
}); | ||
@@ -86,5 +94,7 @@ exports.DEFAULT_ICONS = DEFAULT_ICONS; | ||
const isCustodial = CUSTODIAL_SOURCES.includes(source); | ||
if (!source) { | ||
throw new Error('expected "source" for a wallet account'); | ||
} else if (index == null) { | ||
} else if (index == null && !isCustodial) { | ||
throw new Error('expected "index" for a wallet account'); | ||
@@ -125,3 +135,3 @@ } else if (source === EXODUS_SRC && id) { | ||
this.source = source; | ||
this.index = index; | ||
this.index = (0, _lodash.isNil)(index) ? null : index; | ||
this.id = id; | ||
@@ -180,5 +190,9 @@ this.label = label || ''; | ||
get isHardware() { | ||
return [TREZOR_SRC, LEDGER_SRC].includes(this.source); | ||
return HARDWARE_SOURCES.includes(this.source); | ||
} | ||
get isCustodial() { | ||
return CUSTODIAL_SOURCES.includes(this.source); | ||
} | ||
static get DEFAULT_NAME() { | ||
@@ -209,2 +223,4 @@ return WalletAccount.DEFAULT.toString(); | ||
_defineProperty(WalletAccount, "LEDGER_SRC", LEDGER_SRC); | ||
_defineProperty(WalletAccount, "LEDGER_SRC", LEDGER_SRC); | ||
_defineProperty(WalletAccount, "FTX_SRC", FTX_SRC); |
{ | ||
"name": "@exodus/models", | ||
"version": "8.5.10", | ||
"version": "8.5.11", | ||
"description": "Exodus models", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
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
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
54569
1326