Creates a new BCUR2 sign multisig transaction interaction
Parameters for the interaction
Optionaldecoder?: BCUR2DecoderThe BCUR2Decoder instance to use
OptionalencoderFactory?: BCUR2EncoderFactoryFactory function for creating BCUR2Encoder instances
OptionalmaxFragmentLength?: numberMaximum QR code fragment length (default: 100)
Optionalnetwork?: BitcoinNetworkThe Bitcoin network
Base64 encoded PSBT to sign
ProtecteddecoderProtectednetworkGets any error that occurred during scanning
Error message or null if no error
Gets the current progress of QR code scanning
A string describing the current progress
Gets the encoded QR code frames for the transaction
Array of QR code frame strings
Return whether there are any messages matching the given options.
Checks if the QR code scanning is complete
True if all parts have been scanned
Subclasses can override this method to indicate they are not supported.
This method has access to whatever options may have been passed
in by the constructor as well as the ability to interact with
this.environment to determine whether the functionality is
supported. See the Bowser documentation for more details:
https://github.com/lancedikson/bowser
isSupported() {
return this.environment.satisfies({
* declare browsers per OS
windows: {
"internet explorer": ">10",
},
macos: {
safari: ">10.1"
},
* per platform (mobile, desktop or tablet)
mobile: {
safari: '>=9',
'android browser': '>3.10'
},
* or in general
chrome: "~20.1.1432",
firefox: ">31",
opera: ">=22",
* also supports equality operator
chrome: "=20.1.1432", * will match particular build only
* and loose-equality operator
chrome: "~20", * will match any 20.* sub-version
chrome: "~20.1" * will match any 20.1.* sub-version (20.1.19 as well as 20.1.12.42-alpha.1)
});
}
Return the first message matching the given options (or null if none is found).
Returns the status messages for the interaction
Array of message objects describing the current state
Return messages filtered by the given options.
Multiple options can be given at once to filter along multiple dimensions.
import {PENDING, ACTIVE} from "@caravan/bitcoin";
// Create any interaction instance
interaction.messages().forEach(msg => console.log(msg));
{ code: "device.connect", state: "pending", level: "info", text: "Please plug in your device."}
{ code: "device.active", state: "active", level: "info", text: "Communicating with your device..."}
{ code: "device.active.warning", state: "active", level: "warning", text: "Your device will warn you about...", version: "2.x"}
interaction.messagesFor({state: PENDING}).forEach(msg => console.log(msg));
{ code: "device.connect", state: "pending", level: "info", text: "Please plug in your device."}
interaction.messagesFor({code: ACTIVE}).forEach(msg => console.log(msg));
{ code: "device.active", state: "active", level: "info", text: "Communicating with your device..."}
{ code: "device.active.warning", state: "active", level: "warning", text: "Your device will warn you about...", version: "2.x"}
interaction.messagesFor({version: /^2/}).forEach(msg => console.log(msg));
{ code: "device.active", state: "active", level: "warning", text: "Your device will warn you about...", version: "2.x"}
Retrieve the text of the first message matching the given options
(or null if none is found).
Parses a signed PSBT and extracts signatures
The signed PSBT data (base64 or UR format)
Object with signatures property for test framework compatibility
Generates the request data for the signing process
Request data containing QR code frames for display
Resets the decoder state
Throws an error.
Interaction class for signing multisig transactions using BCUR2 QR codes. This class handles the complete signing workflow: