mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2025-02-24 15:36:59 +01:00
Update addMultisigStep2.js
This commit is contained in:
parent
5829290501
commit
5428e10b01
1 changed files with 34 additions and 31 deletions
|
@ -130,40 +130,43 @@ const WalletsAddMultisigStep2 = () => {
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const onCreate = async () => {
|
const onCreate = () => {
|
||||||
setIsLoading(true);
|
setIsLoading(true);
|
||||||
const w = new MultisigHDWallet();
|
// give it time to show loading indicator
|
||||||
w.setM(m);
|
setTimeout(async () => {
|
||||||
switch (format) {
|
const w = new MultisigHDWallet();
|
||||||
case MultisigHDWallet.FORMAT_P2WSH:
|
w.setM(m);
|
||||||
w.setNativeSegwit();
|
switch (format) {
|
||||||
w.setDerivationPath(MultisigHDWallet.PATH_NATIVE_SEGWIT);
|
case MultisigHDWallet.FORMAT_P2WSH:
|
||||||
break;
|
w.setNativeSegwit();
|
||||||
case MultisigHDWallet.FORMAT_P2SH_P2WSH:
|
w.setDerivationPath(MultisigHDWallet.PATH_NATIVE_SEGWIT);
|
||||||
w.setWrappedSegwit();
|
break;
|
||||||
w.setDerivationPath(MultisigHDWallet.PATH_WRAPPED_SEGWIT);
|
case MultisigHDWallet.FORMAT_P2SH_P2WSH:
|
||||||
break;
|
w.setWrappedSegwit();
|
||||||
case MultisigHDWallet.FORMAT_P2SH:
|
w.setDerivationPath(MultisigHDWallet.PATH_WRAPPED_SEGWIT);
|
||||||
w.setLegacy();
|
break;
|
||||||
w.setDerivationPath(MultisigHDWallet.PATH_LEGACY);
|
case MultisigHDWallet.FORMAT_P2SH:
|
||||||
break;
|
w.setLegacy();
|
||||||
default:
|
w.setDerivationPath(MultisigHDWallet.PATH_LEGACY);
|
||||||
throw new Error('This should never happen');
|
break;
|
||||||
}
|
default:
|
||||||
for (const cc of cosigners) {
|
throw new Error('This should never happen');
|
||||||
const fp = cc[1] || getFpCacheForMnemonics(cc[0]);
|
}
|
||||||
w.addCosigner(cc[0], fp, cc[2]);
|
for (const cc of cosigners) {
|
||||||
}
|
const fp = cc[1] || getFpCacheForMnemonics(cc[0]);
|
||||||
w.setLabel('Multisig Vault');
|
w.addCosigner(cc[0], fp, cc[2]);
|
||||||
await w.fetchBalance();
|
}
|
||||||
|
w.setLabel('Multisig Vault');
|
||||||
|
await w.fetchBalance();
|
||||||
|
|
||||||
addWallet(w);
|
addWallet(w);
|
||||||
await saveToDisk();
|
await saveToDisk();
|
||||||
setNewWalletAdded(true);
|
setNewWalletAdded(true);
|
||||||
A(A.ENUM.CREATED_WALLET);
|
A(A.ENUM.CREATED_WALLET);
|
||||||
ReactNativeHapticFeedback.trigger('notificationSuccess', { ignoreAndroidSystemSettings: false });
|
ReactNativeHapticFeedback.trigger('notificationSuccess', { ignoreAndroidSystemSettings: false });
|
||||||
|
|
||||||
navigation.dangerouslyGetParent().pop();
|
navigation.dangerouslyGetParent().pop();
|
||||||
|
}, 100);
|
||||||
};
|
};
|
||||||
|
|
||||||
const generateNewKey = () => {
|
const generateNewKey = () => {
|
||||||
|
|
Loading…
Add table
Reference in a new issue