Class: ColdcardMultisigSettingsFileParser

coldcard~ColdcardMultisigSettingsFileParser(options)

Base class for JSON Multisig file-based interactions with Coldcard This class handles the file that comes from the Export XPUB menu item.

Constructor

new ColdcardMultisigSettingsFileParser(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:

Extends

Methods

deriveDeeperXpubIfNecessary(result) → {Object}

This method will take the result from the Coldcard JSON and:

  1. determine which t/U/V/x/Y/Zpub to use
  2. derive deeper if necessary (and able) using functionality from unchained-bitcoin
Parameters:
Name Type Description
result Object

parsed data from ColdcardJSON

Source:
Returns:

the desired xpub (if possible)

Type
Object

parse(file) → {Object}

Parse the Coldcard JSON file and do some basic error checking add a field for rootFingerprint (it can sometimes be calculated if not explicitly included)

Parameters:
Name Type Description
file Object

JSON file exported from Coldcard

Overrides:
Source:
Returns:

the parsed response

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

validateColdcardBip32Path(bip32Path) → {string}

This validates three things for an incoming Coldcard bip32Path

  1. Is the bip32path valid syntactically?
  2. Does the bip32path start with one of the known Coldcard chroots?
  3. Are there any hardened indices in the relative path below the chroot?
Parameters:
Name Type Description
bip32Path string

bip32Path to validate against Coldcard chroots

Source:
Returns:

empty or with the appropriate error message

Type
string