`ib/kraken`: adjust to new default of not-writing in `open_pps()`
parent
d04fe366ab
commit
f53f4df583
|
@ -480,10 +480,17 @@ async def trades_dialogue(
|
||||||
# open ledger and pptable wrapper for each
|
# open ledger and pptable wrapper for each
|
||||||
# detected account.
|
# detected account.
|
||||||
ledger = ledgers[acctid] = lstack.enter_context(
|
ledger = ledgers[acctid] = lstack.enter_context(
|
||||||
open_trade_ledger('ib', acctid)
|
open_trade_ledger(
|
||||||
|
'ib',
|
||||||
|
acctid,
|
||||||
|
)
|
||||||
)
|
)
|
||||||
table = tables[acctid] = lstack.enter_context(
|
table = tables[acctid] = lstack.enter_context(
|
||||||
open_pps('ib', acctid)
|
open_pps(
|
||||||
|
'ib',
|
||||||
|
acctid,
|
||||||
|
write_on_exit=True,
|
||||||
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
for account, proxy in proxies.items():
|
for account, proxy in proxies.items():
|
||||||
|
|
|
@ -470,6 +470,7 @@ async def trades_dialogue(
|
||||||
open_pps(
|
open_pps(
|
||||||
'kraken',
|
'kraken',
|
||||||
acctid,
|
acctid,
|
||||||
|
write_on_exit=True,
|
||||||
) as table,
|
) as table,
|
||||||
|
|
||||||
open_trade_ledger(
|
open_trade_ledger(
|
||||||
|
@ -627,7 +628,7 @@ async def trades_dialogue(
|
||||||
cost_scalar=1,
|
cost_scalar=1,
|
||||||
)
|
)
|
||||||
log.info(
|
log.info(
|
||||||
'Updated {dst} from transfers:\n'
|
f'Updated {dst} from transfers:\n'
|
||||||
f'{pformat(updated)}'
|
f'{pformat(updated)}'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -1212,23 +1213,3 @@ def norm_trade_records(
|
||||||
)
|
)
|
||||||
|
|
||||||
return records
|
return records
|
||||||
|
|
||||||
|
|
||||||
@cm
|
|
||||||
def open_ledger(
|
|
||||||
acctid: str,
|
|
||||||
trade_entries: list[dict[str, Any]],
|
|
||||||
|
|
||||||
) -> set[Transaction]:
|
|
||||||
'''
|
|
||||||
Write recent session's trades to the user's (local) ledger file.
|
|
||||||
|
|
||||||
'''
|
|
||||||
with open_trade_ledger(
|
|
||||||
'kraken',
|
|
||||||
acctid,
|
|
||||||
) as ledger:
|
|
||||||
yield ledger
|
|
||||||
|
|
||||||
# update on exit
|
|
||||||
ledger.update(trade_entries)
|
|
||||||
|
|
Loading…
Reference in New Issue