View Source BitcoinLib.Key.HD.DerivationPath.Parser.Index (BitcoinLib v0.4.2)

Addresses are numbered from index 0 in sequentially increasing manner. This number is used as child index in BIP32 derivation.

Public derivation is used at this level.

See: https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki#index

Link to this section Summary

Functions

Converts a list of path levels managed up until the index value, extracts the index

Link to this section Functions

@spec extract(list()) :: {:ok, nil} | {:ok, integer()} | {:error, binary()}

Converts a list of path levels managed up until the index value, extracts the index

examples

Examples

iex> ["2"]
...> |> BitcoinLib.Key.HD.DerivationPath.Parser.Index.extract()
{:ok, 2}