mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2025-02-22 23:08:07 +01:00
TST
This commit is contained in:
parent
447d0e3042
commit
d11a9456d6
3 changed files with 9 additions and 5 deletions
|
@ -759,7 +759,7 @@ export class AbstractHDElectrumWallet extends AbstractHDWallet {
|
|||
let pubkey = this._getPubkeyByAddress(input.address);
|
||||
let masterFingerprintBuffer;
|
||||
if (masterFingerprint) {
|
||||
const hexBuffer = Buffer.from(Number(masterFingerprint).toString(16), 'hex');
|
||||
const hexBuffer = masterFingerprint;
|
||||
masterFingerprintBuffer = Buffer.from(reverse(hexBuffer));
|
||||
} else {
|
||||
masterFingerprintBuffer = Buffer.from([0x00, 0x00, 0x00, 0x00]);
|
||||
|
@ -799,9 +799,9 @@ export class AbstractHDElectrumWallet extends AbstractHDWallet {
|
|||
let masterFingerprintBuffer;
|
||||
|
||||
if (masterFingerprint) {
|
||||
const hexBuffer = Buffer.from(Number(masterFingerprint).toString(16), 'hex')
|
||||
const hexBuffer = Buffer.from(masterFingerprint);
|
||||
masterFingerprintBuffer = Buffer.from(reverse(hexBuffer));
|
||||
} else {
|
||||
} else {
|
||||
masterFingerprintBuffer = Buffer.from([0x00, 0x00, 0x00, 0x00]);
|
||||
}
|
||||
|
||||
|
|
|
@ -51,7 +51,7 @@ export class WatchOnlyWallet extends LegacyWallet {
|
|||
let masterFingerprint = false;
|
||||
if (parsedSecret.keystore.ckcc_xfp) {
|
||||
// It is a ColdCard Hardware Wallet
|
||||
masterFingerprint = parsedSecret.keystore.ckcc_xfp;
|
||||
masterFingerprint = Buffer.from(Number(parsedSecret.keystore.ckcc_xfp).toString(16), 'hex').toString('hex');
|
||||
}
|
||||
this.setSecret(parsedSecret.keystore.xpub);
|
||||
this.masterFingerprint = masterFingerprint;
|
||||
|
|
|
@ -46,7 +46,11 @@ const ScanQRCode = ({
|
|||
const file = await RNFS.readFile(res.uri);
|
||||
const fileParsed = JSON.parse(file);
|
||||
if (fileParsed.keystore.xpub) {
|
||||
onBarCodeRead({ data: fileParsed.keystore.xpub, additionalProperties: { masterFingerprint: fileParsed.keystore.ckcc_xfp } });
|
||||
let masterFingerprint;
|
||||
if (fileParsed.keystore.ckcc_xfp) {
|
||||
masterFingerprint = Buffer.from(Number(fileParsed.keystore.ckcc_xfp).toString(16), 'hex').toString('hex');
|
||||
}
|
||||
onBarCodeRead({ data: fileParsed.keystore.xpub, additionalProperties: { masterFingerprint } });
|
||||
} else {
|
||||
throw new Error();
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue