use std::path::{Path, PathBuf};
#[allow(dead_code)] pub fn coinbase_buy_sell_send(dir: &Path) -> PathBuf {
let p = dir.join("coinbase.csv");
std::fs::write(
&p,
"\r\nTransactions\r\nUser,00000000-0000-0000-0000-000000000000\r\n\
ID,Timestamp,Transaction Type,Asset,Quantity Transacted,Price Currency,Price at Transaction,Subtotal,Total (inclusive of fees and/or spread),Fees and/or Spread,Notes,Sender Address,Recipient Address\r\n\
cb-buy,2025-03-01 12:00:00 UTC,Buy,BTC,0.10000000,USD,84000.00,8400.00,8450.00,50.00,,,\r\n\
cb-sell,2025-06-15 12:00:00 UTC,Sell,BTC,0.02000000,USD,67500.00,1350.00,1340.00,10.00,,,\r\n\
cb-send,2025-06-20 12:00:00 UTC,Send,BTC,0.03000000,USD,68000.00,,,,,,bc1qsyntheticdest\r\n",
)
.unwrap();
p
}
#[allow(dead_code)]
pub fn coinbase_buy_receive(dir: &Path) -> PathBuf {
let p = dir.join("coinbase_recv.csv");
std::fs::write(
&p,
"\r\nTransactions\r\nUser,00000000-0000-0000-0000-000000000000\r\n\
ID,Timestamp,Transaction Type,Asset,Quantity Transacted,Price Currency,Price at Transaction,Subtotal,Total (inclusive of fees and/or spread),Fees and/or Spread,Notes,Sender Address,Recipient Address\r\n\
cb-buy3,2025-04-01 12:00:00 UTC,Buy,BTC,0.05000000,USD,85000.00,4250.00,4265.00,15.00,,,\r\n\
cb-recv,2025-05-01 12:00:00 UTC,Receive,BTC,0.02000000,USD,90000.00,,,,,,\r\n",
)
.unwrap();
p
}
#[allow(dead_code)]
pub fn coinbase_two_lot_donation(dir: &Path) -> PathBuf {
let p = dir.join("coinbase_two_lot_donation.csv");
std::fs::write(
&p,
"\r\nTransactions\r\nUser,00000000-0000-0000-0000-000000000000\r\n\
ID,Timestamp,Transaction Type,Asset,Quantity Transacted,Price Currency,Price at Transaction,Subtotal,Total (inclusive of fees and/or spread),Fees and/or Spread,Notes,Sender Address,Recipient Address\r\n\
cb-donate-buy-a,2024-01-01 12:00:00 UTC,Buy,BTC,1.00000000,USD,5000.00,5000.00,5000.00,0.00,,,\r\n\
cb-donate-buy-b,2025-12-01 12:00:00 UTC,Buy,BTC,1.00000000,USD,2000.00,2000.00,2000.00,0.00,,,\r\n\
cb-donate-send,2026-03-01 12:00:00 UTC,Send,BTC,2.00000000,USD,50000.00,,,,,,bc1qsyntheticcharity\r\n",
)
.unwrap();
p
}
#[allow(dead_code)]
pub fn income_fmv_missing_batch(n: usize) -> Vec<btctax_core::LedgerEvent> {
use btctax_core::event::{EventPayload, Income, LedgerEvent};
use btctax_core::identity::{EventId, Source, SourceRef};
use btctax_core::{FmvStatus, IncomeKind, WalletId};
use time::macros::datetime;
let base = datetime!(2025-06-01 12:00:00 UTC);
let wallet = WalletId::Exchange {
provider: "River".into(),
account: "main".into(),
};
(0..n)
.map(|i| LedgerEvent {
id: EventId::import(
Source::River,
SourceRef::new(format!("inc-fmv-missing-{i}")),
),
utc_timestamp: base + time::Duration::days(i as i64),
original_tz: time::UtcOffset::UTC,
wallet: Some(wallet.clone()),
payload: EventPayload::Income(Income {
sat: 10_000,
usd_fmv: None,
fmv_status: FmvStatus::Missing,
kind: IncomeKind::Staking,
business: false,
}),
})
.collect()
}
#[allow(dead_code)] pub fn coinbase_single_buy(dir: &Path) -> PathBuf {
let p = dir.join("coinbase_buy.csv");
std::fs::write(
&p,
"\r\nTransactions\r\nUser,00000000-0000-0000-0000-000000000000\r\n\
ID,Timestamp,Transaction Type,Asset,Quantity Transacted,Price Currency,Price at Transaction,Subtotal,Total (inclusive of fees and/or spread),Fees and/or Spread,Notes,Sender Address,Recipient Address\r\n\
cb-buy,2025-03-01 12:00:00 UTC,Buy,BTC,0.10000000,USD,84000.00,8400.00,8450.00,50.00,,,\r\n\
cb-eth,2025-03-01 08:00:00 UTC,Buy,ETH,1.00000000,USD,2000.00,2000.00,2010.00,10.00,,,\r\n",
)
.unwrap();
p
}