Returns the decoded data as a hex string.
Returns the error message.
Is this decoder complete?
Will return true if there was an error.
Was this decoder successful?
Will return false if completed because of an error.
Returns the current progress of this decoder.
import {BCURDecoder} from "@caravan/wallets";
const decoder = BCURDecoder();
console.log(decoder.progress())
// { totalParts: 0, partsReceived: 0 }
decoder.receivePart(part);
...
decoder.receivePart(part);
...
decoder.receivePart(part);
...
console.log(decoder.progress())
// { totalParts: 10, partsReceived: 3 }
Receive a new UR part.
It's OK to call this method multiple times for the same UR part.
Reset this decoder.
Clears any error message and received parts and returns counts to zero.
Decoder class for BC UR data.
Decodes a hex string from a collection of UR parts.
Designed for use by a calling application which is typically in a loop parsing an animated sequence of QR codes.
Example