mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2025-03-03 12:06:21 +01:00
Update psbtWithHardwareWallet.js
This commit is contained in:
parent
2beed9984f
commit
84b0baf086
1 changed files with 20 additions and 13 deletions
|
@ -204,20 +204,27 @@ export default class PsbtWithHardwareWallet extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
exportPSBT = async () => {
|
exportPSBT = async () => {
|
||||||
const filePath = RNFS.TemporaryDirectoryPath + `/${Date.now()}.psbt`;
|
if (Platform.OS === 'ios') {
|
||||||
await RNFS.writeFile(filePath, this.state.isFirstPSBTAlreadyBase64 ? this.state.psbt : this.state.psbt.toBase64(), 'ascii');
|
const filePath = RNFS.TemporaryDirectoryPath + `/${Date.now()}.psbt`;
|
||||||
Share.open({
|
await RNFS.writeFile(filePath, this.state.isFirstPSBTAlreadyBase64 ? this.state.psbt : this.state.psbt.toBase64(), 'ascii');
|
||||||
url: Platform.OS === 'ios' ? 'file://' : 'content://' + filePath,
|
Share.open({
|
||||||
})
|
url: 'file://' + filePath,
|
||||||
.catch(error => console.log(error))
|
})
|
||||||
.finally(() => {
|
.catch(error => console.log(error))
|
||||||
if (Platform.OS === 'android') {
|
.finally(() => {
|
||||||
|
RNFS.unlink(filePath);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
Share.open({
|
||||||
|
url: `data:text/psbt;base64,${this.state.isFirstPSBTAlreadyBase64 ? this.state.psbt : this.state.psbt.toBase64()}`,
|
||||||
|
})
|
||||||
|
.catch(error => console.log(error))
|
||||||
|
.finally(() =>
|
||||||
alert(
|
alert(
|
||||||
'In order for your hardware wallet to read this transaction, you must rename the exported file to have a "psbt" extension. Example: From transaction.null to transaction.psbt',
|
'In order for your hardware wallet to read this transaction, you must rename the shared file to have a "psbt" extension. Example: From transaction.null to transaction.psbt',
|
||||||
);
|
),
|
||||||
}
|
);
|
||||||
RNFS.unlink(filePath);
|
}
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
openSignedTransaction = async () => {
|
openSignedTransaction = async () => {
|
||||||
|
|
Loading…
Add table
Reference in a new issue