Skip to content

Commit

Permalink
;examples:csv:daedalus-transactions: update for current daedalus [#2171]
Browse files Browse the repository at this point in the history
  • Loading branch information
simonmichael committed Feb 15, 2024
1 parent 876bbf1 commit 65b15a1
Showing 1 changed file with 56 additions and 10 deletions.
66 changes: 56 additions & 10 deletions examples/csv/daedalus-transactions.csv.rules
Original file line number Diff line number Diff line change
@@ -1,14 +1,60 @@
# Sample hledger CSV conversion rules for Daedalus's transactions export, tested with daedalus 5.3.

# The account corresponding to the CSV. This could be in a parent rules file including this one.
account1 assets:cc:cardano:wallet1:YYYY-MM-DD

# ID,Type,TOTAL (ADA),Sent amount (ADA),Deposit amount (ADA),Fee (ADA),Tokens (unformatted amounts),Date & time,Status,Addresses from,Addresses to,Withdrawals
fields id, type, total_ada, sent_ada, deposit_ada, fee_ada, tokens, datetime, status_, addresses_from, addresses_to, withdrawals
skip 1
# ID,Type,Amount,Date & time,Status,Addresses from,Addresses to,Withdrawals
fields id,type,amount,date,status_,addressesfrom,addressesto,withdrawals
date-format %Y-%m-%dT%s%Q%Z
newest-first
status *
code %id
description | from %addressesfrom
comment cc-ada-acquire:, datetime:%date, status: %status_, TODO: fix lot, add cost basis
date %datetime
date-format %Y-%m-%dT%T%Q%Z
if ! %status_ Confirmed
status !
description %type %tokens

# Received
# posting 1 is for the wallet
# posting 2 is for the source

# The from: and to: tag values should probably have their commas removed.

if %type Received
comment \nfrom: %addresses_from\nto: %addresses_to\nwithdrawals: %withdrawals\nid: %id\ndatetime: %datetime\nstatus: %status_\ncc-ada-acquire:
amount %total_ada ADA
comment1 TODO: add lot date & cost

# Sent
# posting 1 is for the wallet
# posting 2 is for deposits
# posting 3 is for fees
# posting 4 is for the destination

if %type Sent
comment \nfrom: %addresses_from\nto: %addresses_to\nwithdrawals: %withdrawals\nid: %id\ndatetime: %datetime\nstatus: %status_\ncc-ada-dispose:\nTODO: select source lots; add costs & prices & gain/loss
amount1 %total_ada ADA

if %type Sent
& %deposit_ada [1-9]
amount2 %deposit_ada ADA
account2 assets:cc:cardano:wallet1:deposit
description %type deposit

if %type Sent
amount -%amount
description | to %addressesto
comment cc-ada-dispose:, datetime:%date, status: %status_, TODO: select lot, add cost basis & disposal price & gain
& %fee_ada [1-9]
amount3 %fee_ada ADA
account3 expenses:fees:cardano

# The CSV duplicates the amount in sent deposit transactions so we need to avoid those here.
# &! is not yet supported, work around with a regexp.
if %type Sent
& %sent_ada [1-9]
& %deposit_ada ^[^1-9]*$
amount4 %sent_ada ADA
account4 expenses:unknown

# Categorise manually, or add categorising rules below.

if %addresses_to addr1alksjdflkjsadfff098234lkjlkjasfd09234jlljkasdf09234jl
account4 assets:cc:cardano:wallet2:YYYY-MM-DD
comment4 TODO: add lot date & cost

0 comments on commit 65b15a1

Please sign in to comment.