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

@exodus/address-provider

Package Overview
Dependencies
Maintainers
0
Versions
73
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@exodus/address-provider - npm Package Compare versions

Comparing version 6.0.0 to 6.1.0

module/errors.js

7

CHANGELOG.md

@@ -6,2 +6,9 @@ # Change Log

## [6.1.0](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/address-provider@6.0.0...@exodus/address-provider@6.1.0) (2023-07-10)
### Features
- move address-provider to feature dir ([#2375](https://github.com/ExodusMovement/exodus-hydra/issues/2375)) ([e44ac1e](https://github.com/ExodusMovement/exodus-hydra/commit/e44ac1e80728151996313857510931182e5bc74a))
- validate supported trezor assets ([#2205](https://github.com/ExodusMovement/exodus-hydra/issues/2205)) ([ec40a7d](https://github.com/ExodusMovement/exodus-hydra/commit/ec40a7d5db13bd38d491da42be6e413b90c6a469))
## [6.0.0](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/address-provider@5.0.2...@exodus/address-provider@6.0.0) (2023-07-06)

@@ -8,0 +15,0 @@

6

module/seed/mock.js

@@ -14,5 +14,7 @@ import addressCacheMemoryModuleDefinition from '@exodus/address-cache/module/memory'

mockConfigAtom,
...rest
keychain,
keyIdentifierProvider,
blockchainMetadata,
}) {
super({ addressCache, assetsModule, ...rest })
super({ assetsModule, keychain, keyIdentifierProvider, addressCache, blockchainMetadata })

@@ -19,0 +21,0 @@ this.#assetsModule = assetsModule

import typeforce from '@exodus/typeforce'
import { getDefaultPurpose, getSupportedPurposes } from './utils'
import { getDefaultPurpose, getSupportedPurposes, isSupportedAsset } from './utils'
import { Address, WalletAccount } from '@exodus/models'

@@ -8,2 +8,3 @@ import BipPath from 'bip32-path'

import { parseDerivationPath } from '@exodus/bip32/lib/derivation-path'
import { UnsupportedAssetError } from '../errors'

@@ -25,4 +26,22 @@ export class TrezorAddressProvider {

#getAsset = (assetName) => this.#assetsModule.getAsset(assetName)
#getAsset = ({ walletAccount, assetName }) => {
typeforce(
{
assetName: 'String',
walletAccount: (value) => value instanceof WalletAccount,
},
{ walletAccount, assetName }
)
const asset = this.#assetsModule.getAsset(assetName)
const { model } = walletAccount
if (!isSupportedAsset({ model, asset })) {
throw new UnsupportedAssetError(
`Trezor model "${model}" doesn't support asset "${assetName}"`
)
}
return asset
}
getAddress = async (opts) => {

@@ -51,3 +70,3 @@ typeforce(

const asset = this.#getAsset(assetName)
const asset = this.#getAsset(opts)

@@ -171,3 +190,3 @@ const { derivationPath } = this.#keyIdentifierProvider.createKeyIdentifier({

const asset = this.#getAsset(assetName)
const asset = this.#getAsset({ walletAccount, assetName })
const purposes = getSupportedPurposes(asset)

@@ -189,11 +208,12 @@ const accountByPurpose = await this.#getAccounts({ walletAccount, assetName })

getSupportedPurposes = ({ assetName }) => {
getSupportedPurposes = (opts) => {
typeforce(
{
walletAccount: (value) => value instanceof WalletAccount,
assetName: 'String',
},
{ assetName }
opts
)
const asset = this.#getAsset(assetName)
const asset = this.#getAsset(opts)
return getSupportedPurposes(asset)

@@ -261,3 +281,3 @@ }

const accountByPurpose = await this.#getAccounts({ walletAccount, assetName })
const asset = this.#getAsset(assetName)
const asset = this.#getAsset({ walletAccount, assetName })

@@ -264,0 +284,0 @@ purpose = purpose ?? getDefaultPurpose({ asset, accountByPurpose })

import { createMeta } from '@exodus/trezor-meta'
import { memoize } from 'lodash'
import assert from 'minimalistic-assert'

@@ -31,1 +32,9 @@ export const getDefaultPurpose = ({ asset, accountByPurpose }) => {

}
export const isSupportedAsset = ({ asset, model }) => {
const meta = getTrezorMeta({ asset })
const assetNames = meta.ASSETS_BY_MODEL[model]
assert(assetNames, `Unknown model: ${model}`)
return assetNames.includes(asset.name)
}
{
"name": "@exodus/address-provider",
"version": "6.0.0",
"version": "6.1.0",
"description": "Address provider for deriving and tracking used and unused addresses.",

@@ -29,7 +29,7 @@ "author": "Exodus Movement Inc.",

"dependencies": {
"@exodus/address-cache": "^2.0.0",
"@exodus/address-cache": "^2.0.1",
"@exodus/atoms": "^5.2.1",
"@exodus/key-identifier-provider": "^1.2.0",
"@exodus/models": "^8.9.0",
"@exodus/trezor-meta": "^3.2.7",
"@exodus/trezor-meta": "^3.2.13",
"@exodus/typeforce": "^1.18.0",

@@ -55,6 +55,6 @@ "bip32-path": "^0.4.2",

"coininfo": "^5.2.1",
"eslint": "^8.33.0",
"eslint": "^8.44.0",
"jest": "^29.1.2"
},
"gitHead": "ea31e65df21404fc765c8513fbc9e5d754e7fa1f"
"gitHead": "1f26096f4ae3f5492e534b4bb15db4cf2c750b9f"
}
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