mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2024-11-19 09:50:15 +01:00
ADD: Enable lightning/offchain wallet transactions to be exported to csv
This commit is contained in:
parent
6700284896
commit
f273cc6170
@ -433,9 +433,15 @@ const WalletDetails = () => {
|
||||
|
||||
for (const transaction of transactions) {
|
||||
const value = formatBalanceWithoutSuffix(transaction.value, BitcoinUnit.BTC, true);
|
||||
csvFile +=
|
||||
'\n' +
|
||||
[new Date(transaction.received).toString(), transaction.hash, value, txMetadata[transaction.hash]?.memo?.trim() ?? ''].join(','); // CSV line
|
||||
|
||||
let hash = transaction.hash;
|
||||
let memo = txMetadata[transaction.hash]?.memo?.trim() ?? '';
|
||||
|
||||
if (wallet.chain === Chain.OFFCHAIN) {
|
||||
hash = transaction.payment_hash;
|
||||
memo = transaction.description;
|
||||
}
|
||||
csvFile += '\n' + [new Date(transaction.received).toString(), hash, value, memo].join(','); // CSV line
|
||||
}
|
||||
|
||||
await writeFileAndExport(`${wallet.label.replace(' ', '-')}-history.csv`, csvFile);
|
||||
@ -629,7 +635,7 @@ const WalletDetails = () => {
|
||||
<View>
|
||||
<BlueSpacing20 />
|
||||
<SecondButton onPress={navigateToWalletExport} testID="WalletExport" title={loc.wallets.details_export_backup} />
|
||||
{wallet.chain === Chain.ONCHAIN && walletTransactionsLength > 0 && (
|
||||
{walletTransactionsLength > 0 && (
|
||||
<>
|
||||
<BlueSpacing20 />
|
||||
<SecondButton onPress={onExportHistoryPressed} title={loc.wallets.details_export_history} />
|
||||
|
Loading…
Reference in New Issue
Block a user