|
|
@ -84,6 +84,7 @@ export default class SendDetails extends Component { |
|
|
|
showSendMax: false, |
|
|
|
isFeeSelectionModalVisible: false, |
|
|
|
isAdvancedTransactionOptionsVisible: false, |
|
|
|
isTransactionReplaceable: fromWallet.type === HDSegwitBech32Wallet.type, |
|
|
|
recipientsScrollIndex: 0, |
|
|
|
fromAddress, |
|
|
|
fromWallet, |
|
|
@ -495,8 +496,6 @@ export default class SendDetails extends Component { |
|
|
|
this.setState({ isLoading: false }); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
this.setState({ isLoading: false }, () => |
|
|
|
this.props.navigation.navigate('Confirm', { |
|
|
|
recipients: [firstTransaction], |
|
|
|
// HD wallet's utxo is in sats, classic segwit wallet utxos are in btc
|
|
|
@ -509,8 +508,8 @@ export default class SendDetails extends Component { |
|
|
|
fromWallet: this.state.fromWallet, |
|
|
|
tx: tx, |
|
|
|
satoshiPerByte: actualSatoshiPerByte.toFixed(2), |
|
|
|
}), |
|
|
|
); |
|
|
|
}); |
|
|
|
this.setState({ isLoading: false }); |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
@ -537,20 +536,24 @@ export default class SendDetails extends Component { |
|
|
|
targets = [{ address: firstTransaction.address, amount: BitcoinUnit.MAX }]; |
|
|
|
} |
|
|
|
|
|
|
|
let { tx, fee, psbt } = wallet.createTransaction(wallet.getUtxo(), targets, requestedSatPerByte, changeAddress); |
|
|
|
let { tx, fee, psbt } = wallet.createTransaction( |
|
|
|
wallet.getUtxo(), |
|
|
|
targets, |
|
|
|
requestedSatPerByte, |
|
|
|
changeAddress, |
|
|
|
this.state.isTransactionReplaceable ? HDSegwitBech32Wallet.defaultRBFSequence : HDSegwitBech32Wallet.finalRBFSequence, |
|
|
|
); |
|
|
|
|
|
|
|
if (wallet.type === WatchOnlyWallet.type) { |
|
|
|
// watch-only wallets with enabled HW wallet support have different flow. we have to show PSBT to user as QR code
|
|
|
|
// so he can scan it and sign it. then we have to scan it back from user (via camera and QR code), and ask
|
|
|
|
// user whether he wants to broadcast it
|
|
|
|
|
|
|
|
this.setState({ isLoading: false }, () => |
|
|
|
this.props.navigation.navigate('PsbtWithHardwareWallet', { |
|
|
|
memo: this.state.memo, |
|
|
|
fromWallet: wallet, |
|
|
|
psbt, |
|
|
|
}), |
|
|
|
); |
|
|
|
}); |
|
|
|
this.setState({ isLoading: false }); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
@ -560,7 +563,6 @@ export default class SendDetails extends Component { |
|
|
|
memo: this.state.memo, |
|
|
|
}; |
|
|
|
await BlueApp.saveToDisk(); |
|
|
|
this.setState({ isLoading: false }, () => |
|
|
|
this.props.navigation.navigate('Confirm', { |
|
|
|
fee: new BigNumber(fee).dividedBy(100000000).toNumber(), |
|
|
|
memo: this.state.memo, |
|
|
@ -568,8 +570,8 @@ export default class SendDetails extends Component { |
|
|
|
tx: tx.toHex(), |
|
|
|
recipients: targets, |
|
|
|
satoshiPerByte: requestedSatPerByte, |
|
|
|
}), |
|
|
|
); |
|
|
|
}); |
|
|
|
this.setState({ isLoading: false }); |
|
|
|
} |
|
|
|
|
|
|
|
onWalletSelect = wallet => { |
|
|
@ -725,6 +727,15 @@ export default class SendDetails extends Component { |
|
|
|
onPress={this.onUseAllPressed} |
|
|
|
/> |
|
|
|
)} |
|
|
|
{this.state.fromWallet.type === HDSegwitBech32Wallet.type && ( |
|
|
|
<BlueListItem |
|
|
|
title="Allow Fee Bump" |
|
|
|
hideChevron |
|
|
|
switchButton |
|
|
|
switched={this.state.isTransactionReplaceable} |
|
|
|
onSwitch={this.onReplaceableFeeSwitchValueChanged} |
|
|
|
/> |
|
|
|
)} |
|
|
|
{this.state.fromWallet.allowBatchSend() && ( |
|
|
|
<> |
|
|
|
<BlueListItem |
|
|
@ -775,6 +786,10 @@ export default class SendDetails extends Component { |
|
|
|
); |
|
|
|
}; |
|
|
|
|
|
|
|
onReplaceableFeeSwitchValueChanged = value => { |
|
|
|
this.setState({ isTransactionReplaceable: value }); |
|
|
|
}; |
|
|
|
|
|
|
|
renderCreateButton = () => { |
|
|
|
return ( |
|
|
|
<View style={{ marginHorizontal: 56, marginVertical: 16, alignContent: 'center', backgroundColor: '#FFFFFF', minHeight: 44 }}> |
|
|
|