1
0
crypto-tax/crypto_tax/__main__.py
2024-12-22 06:10:23 +01:00

51 lines
1.1 KiB
Python

import sys
import requests
import fin_depo
from . import secrets
from fin_defs import CryptoCurrency, AssetAmount, MPC, Asset, USDT
from decimal import Decimal
from collections import deque
from fin_depo.data import *
import datetime
import dataclasses
import logging
from . import compute_tax
KUCOIN_CLIENT = fin_depo.defi_kucoin.KucoinDepoFetcher(
secrets.KUCOIN_KEY,
secrets.KUCOIN_SECRET,
secrets.KUCOIN_PASS,
)
KRAKEN_CLIENT = fin_depo.defi_kraken.KrakenDepoFetcher(
secrets.KRAKEN_KEY,
secrets.KRAKEN_SECRET,
)
def main():
"""Main function."""
logger = logging.getLogger('crypto_tax')
logger.setLevel('INFO')
TRANSFERS = list(KRAKEN_CLIENT._get_double_registers())
#TRANSFERS += list(KUCOIN_CLIENT._get_double_registers())
tax_report = compute_tax(TRANSFERS)
logger.info('-'*80)
for bas in tax_report.bought_and_sold_for:
logger.info(f'{bas.amount} ({bas.time_bought} ----> {bas.time_sold})')
for c, prices in tax_report.current_assets.items():
logger.info('%s', c)
logger.info('%s', prices)
if __name__ == '__main__':
main()