3.7.0 • Published 9 months ago

@exodus/key-utils v3.7.0

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

@exodus/key-utils

Utilities to manage derivation paths and key identifier aspects.

Usage

assertKeyIdentifierParameters can be used to verify that getKeyIdentifer is supplied with the right arguments.

import { assertKeyIdentifierParameters } from '@exodus/key-utils'

export function createGetKeyIdentifier({
  bip44,
  assetName,
  derivationAlgorithm = 'BIP32',
  keyType = 'secp256k1',
}) {
  return (params = {}) => {
    params = { accountIndex: 0, addressIndex: 0, chainIndex: 0, ...params }
    assertKeyIdentifierParameters(params)

    // ...
  }
}

This library also comes with a getKeyIdentifier factory, that is configurable and should be able to fit most assets needs:

const getKeyIdentifier = createGetKeyIdentifier({
  bip44: assets.solana.bip44,
  validationRules: { allowedChainIndices: [0, 1] },
})

// or for assets that support purpose 84, 86 as well
const getKeyIdentifier = createGetKeyIdentifier({
  bip44: assets.bitcoin.bip44,
  validationRules: { allowedChainIndices: [0, 1], allowedPurposes: [44, 84, 86] },
})
3.7.0

9 months ago

4.0.0

9 months ago

3.4.0

1 year ago

3.6.1

12 months ago

3.6.0

12 months ago

3.5.1

1 year ago

3.5.0

1 year ago

3.3.0

1 year ago

3.2.1

1 year ago

3.2.0

1 year ago

3.1.0

2 years ago

3.0.0

2 years ago

2.0.0

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago