|
|
|
@ -18,17 +18,20 @@ WizardComponent { |
|
|
|
property int participants: 0 |
|
|
|
property int participants: 0 |
|
|
|
property string multisigMasterPubkey: wizard_data['multisig_master_pubkey'] |
|
|
|
property string multisigMasterPubkey: wizard_data['multisig_master_pubkey'] |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
property string _seedType |
|
|
|
|
|
|
|
property string _validationMessage |
|
|
|
|
|
|
|
|
|
|
|
function apply() { |
|
|
|
function apply() { |
|
|
|
if (cosigner) { |
|
|
|
if (cosigner) { |
|
|
|
wizard_data['multisig_cosigner_data'][cosigner.toString()]['seed'] = seedtext.text |
|
|
|
wizard_data['multisig_cosigner_data'][cosigner.toString()]['seed'] = seedtext.text |
|
|
|
wizard_data['multisig_cosigner_data'][cosigner.toString()]['seed_variant'] = seed_variant_cb.currentValue |
|
|
|
wizard_data['multisig_cosigner_data'][cosigner.toString()]['seed_variant'] = seed_variant_cb.currentValue |
|
|
|
wizard_data['multisig_cosigner_data'][cosigner.toString()]['seed_type'] = bitcoin.seedType |
|
|
|
wizard_data['multisig_cosigner_data'][cosigner.toString()]['seed_type'] = _seedType |
|
|
|
wizard_data['multisig_cosigner_data'][cosigner.toString()]['seed_extend'] = extendcb.checked |
|
|
|
wizard_data['multisig_cosigner_data'][cosigner.toString()]['seed_extend'] = extendcb.checked |
|
|
|
wizard_data['multisig_cosigner_data'][cosigner.toString()]['seed_extra_words'] = extendcb.checked ? customwordstext.text : '' |
|
|
|
wizard_data['multisig_cosigner_data'][cosigner.toString()]['seed_extra_words'] = extendcb.checked ? customwordstext.text : '' |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
wizard_data['seed'] = seedtext.text |
|
|
|
wizard_data['seed'] = seedtext.text |
|
|
|
wizard_data['seed_variant'] = seed_variant_cb.currentValue |
|
|
|
wizard_data['seed_variant'] = seed_variant_cb.currentValue |
|
|
|
wizard_data['seed_type'] = bitcoin.seedType |
|
|
|
wizard_data['seed_type'] = _seedType |
|
|
|
wizard_data['seed_extend'] = extendcb.checked |
|
|
|
wizard_data['seed_extend'] = extendcb.checked |
|
|
|
wizard_data['seed_extra_words'] = extendcb.checked ? customwordstext.text : '' |
|
|
|
wizard_data['seed_extra_words'] = extendcb.checked ? customwordstext.text : '' |
|
|
|
|
|
|
|
|
|
|
|
@ -38,7 +41,7 @@ WizardComponent { |
|
|
|
wizard_data['script_type'] = { |
|
|
|
wizard_data['script_type'] = { |
|
|
|
'standard': 'p2sh', |
|
|
|
'standard': 'p2sh', |
|
|
|
'segwit': 'p2wsh' |
|
|
|
'segwit': 'p2wsh' |
|
|
|
}[bitcoin.seedType] |
|
|
|
}[_seedType] |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
@ -66,14 +69,18 @@ WizardComponent { |
|
|
|
|
|
|
|
|
|
|
|
function checkValid() { |
|
|
|
function checkValid() { |
|
|
|
valid = false |
|
|
|
valid = false |
|
|
|
validationtext.text = '' |
|
|
|
_validationMessage = '' |
|
|
|
|
|
|
|
|
|
|
|
if (extendcb.checked && customwordstext.text == '') |
|
|
|
if (extendcb.checked && customwordstext.text == '') |
|
|
|
return |
|
|
|
return |
|
|
|
|
|
|
|
|
|
|
|
var validSeed = bitcoin.verifySeed(seedtext.text, seed_variant_cb.currentValue, wizard_data['wallet_type']) |
|
|
|
var verifyResult = wiz.verifySeed(seedtext.text, seed_variant_cb.currentValue, wizard_data['wallet_type']) |
|
|
|
if (!cosigner || !validSeed) { |
|
|
|
|
|
|
|
valid = validSeed |
|
|
|
_validationMessage = verifyResult.message |
|
|
|
|
|
|
|
_seedType = verifyResult.type |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!cosigner || !verifyResult.valid) { |
|
|
|
|
|
|
|
valid = verifyResult.valid |
|
|
|
return |
|
|
|
return |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
// bip39 validate after derivation path is known |
|
|
|
// bip39 validate after derivation path is known |
|
|
|
@ -196,21 +203,19 @@ WizardComponent { |
|
|
|
placeholderText: cosigner ? qsTr('Enter cosigner seed') : qsTr('Enter your seed') |
|
|
|
placeholderText: cosigner ? qsTr('Enter cosigner seed') : qsTr('Enter your seed') |
|
|
|
|
|
|
|
|
|
|
|
indicatorValid: root.valid |
|
|
|
indicatorValid: root.valid |
|
|
|
|
|
|
|
? root._seedType == 'bip39' && root._validationMessage |
|
|
|
|
|
|
|
? false |
|
|
|
|
|
|
|
: root.valid |
|
|
|
|
|
|
|
: root.valid |
|
|
|
|
|
|
|
indicatorText: root.valid |
|
|
|
|
|
|
|
? root._validationMessage |
|
|
|
|
|
|
|
? root._validationMessage |
|
|
|
|
|
|
|
: root._seedType |
|
|
|
|
|
|
|
: '' |
|
|
|
onTextChanged: { |
|
|
|
onTextChanged: { |
|
|
|
startValidationTimer() |
|
|
|
startValidationTimer() |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
TextArea { |
|
|
|
|
|
|
|
id: validationtext |
|
|
|
|
|
|
|
visible: text |
|
|
|
|
|
|
|
Layout.fillWidth: true |
|
|
|
|
|
|
|
readOnly: true |
|
|
|
|
|
|
|
wrapMode: TextInput.WordWrap |
|
|
|
|
|
|
|
background: Rectangle { |
|
|
|
|
|
|
|
color: 'transparent' |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ElCheckBox { |
|
|
|
ElCheckBox { |
|
|
|
id: extendcb |
|
|
|
id: extendcb |
|
|
|
@ -231,14 +236,10 @@ WizardComponent { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Bitcoin { |
|
|
|
|
|
|
|
id: bitcoin |
|
|
|
|
|
|
|
onSeedTypeChanged: seedtext.indicatorText = bitcoin.seedType |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function startValidationTimer() { |
|
|
|
function startValidationTimer() { |
|
|
|
valid = false |
|
|
|
valid = false |
|
|
|
seedtext.indicatorText = '' |
|
|
|
root._seedType = '' |
|
|
|
|
|
|
|
root._validationMessage = '' |
|
|
|
validationTimer.restart() |
|
|
|
validationTimer.restart() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|