Class: CustomExportExtendedPublicKey

custom.CustomExportExtendedPublicKey(options)

Base class for text-based (or clipboard pasted) ExtendedPublicKey This class handles parsing/validating the xpub and relevant derivation properties. If no root fingerprint is provided, one will be deterministically assigned.

Constructor

new CustomExportExtendedPublicKey(options)

Parameters:
Name Type Description
options object

options argument

Properties
Name Type Description
network string

bitcoin network (needed for derivations)

bip32Path string

bip32Path to interrogate

Source:
Example
const interaction = new CustomExportExtendedPublicKey({network: MAINNET, bip32Path: "m/45'/0'/0'"});
const {xpub, rootFingerprint, bip32Path} = interaction.parse({xpub: xpub..., rootFingerprint: 0f056943});
console.log(xpub);
// "xpub..."
console.log(rootFingerprint);
// "0f056943"
console.log(bip32Path);
// "m/45'/0'/0'"
** OR **
* const {xpub, rootFingerprint, bip32Path} = interaction.parse({xpub: xpub...});
console.log(xpub);
// "xpub..."
console.log(rootFingerprint);
// "096aed5e"
console.log(bip32Path);
// "m/45'/0'/0'"

Extends

Methods

parse(data) → {Object}

Parse the provided JSON and do some basic error checking

Parameters:
Name Type Description
data Object

JSON object with incoming data to be parsed (read: reformatted)

Overrides:
Source:
Returns:

Object - ExtendedPublicKeyDerivation {xpub, bip32path, rootFingerprint}

Type
Object

request() → {Object}

Provide the request.

Subclasses may override this function. It can return any kind of object. Strings, data for QR codes, HTTP requests, command lines, functions, &c. are all allowed. Whatever is appropriate for the interaction.

Overrides:
Source:
Returns:

the request data

Type
Object

(async) run() → {void}

Throws an error.

Overrides:
Source:
Throws:

An error since this is an indirect interaction.

Returns:
Type
void