eprbell / dali-rp2

DaLI (Data Loader Interface) is a data loader and input generator for RP2 (https://pypi.org/project/rp2), the privacy-focused, free, open-source cryptocurrency tax calculator: DaLI removes the need to manually prepare RP2 input files. Just like RP2, DaLI is also free, open-source and it prioritizes user privacy.
https://pypi.org/project/dali-rp2/
Apache License 2.0
65 stars 42 forks source link

dali.plugin.input.rest.binance_com issue with using the interestHistory api endpoint from binance #233

Closed jakubikan closed 1 month ago

jakubikan commented 5 months ago

Seems like that the rest dataloader has some issue with a deprecated api call which in the end gives a 405 even tough its just deprecated ^^

Stacktrace:

 File "/home/jakub/.pyenv/versions/3.12.2/lib/python3.12/site-packages/dali/dali_main.py", line 214, in _input_plugin_helper
    plugin_transactions = input_plugin.load(country)
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/jakub/.pyenv/versions/3.12.2/lib/python3.12/site-packages/dali/abstract_ccxt_input_plugin.py", line 187, in load
    self._process_gains(in_transactions, out_transactions)
  File "/home/jakub/.pyenv/versions/3.12.2/lib/python3.12/site-packages/dali/plugin/input/rest/binance_com.py", line 492, in _process_gains
    flexible_saving = self._client.sapi_get_lending_union_interesthistory(
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/jakub/.pyenv/versions/3.12.2/lib/python3.12/site-packages/ccxt/base/exchange.py", line 507, in inner
    return entry(_self, **inner_kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/jakub/.pyenv/versions/3.12.2/lib/python3.12/site-packages/ccxt/binance.py", line 6993, in request
    response = self.fetch2(path, api, method, params, headers, body, config, context)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/jakub/.pyenv/versions/3.12.2/lib/python3.12/site-packages/ccxt/base/exchange.py", line 2886, in fetch2
    return self.fetch(request['url'], request['method'], request['headers'], request['body'])
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/jakub/.pyenv/versions/3.12.2/lib/python3.12/site-packages/ccxt/base/exchange.py", line 645, in fetch
    self.handle_http_status_code(http_status_code, http_status_text, url, method, http_response)
  File "/home/jakub/.pyenv/versions/3.12.2/lib/python3.12/site-packages/ccxt/base/exchange.py", line 1694, in handle_http_status_code
    raise ErrorClass(self.id + ' ' + method + ' ' + url + ' ' + codeAsString + ' ' + reason + ' ' + body)
ccxt.base.errors.ExchangeNotAvailable: binance GET https://api.binance.com/sapi/v1/lending/union/interestHistory?timestamp=1712698862833&startTime=1499896800000&endTime=1502488800000&lendingType=DAILY&size=100&recvWindow=10000&signature=<rededcated> 405  This endpoint has been deprecated, please remove as soon as possible.
macanudo527 commented 5 months ago

Yeah, I removed this in a recent commit , but it isn't in the release yet.

@eprbell Can you make another release?

@jakubikan Do you have Pre-May 8th, 2021 earn income? if you do, the data is no longer available via REST. You'll have to get a CSV file. Also, just a heads up, I'm no longer with Binance.com since they booted Japanese residents, so I can't actively support this plugin, but I'll try my best to walk you through this. Sorry!

eprbell commented 5 months ago

@eprbell Can you make another release?

Yes, we're due for one! Will do that in the weekend.

eprbell commented 5 months ago

Actually I just finished new releases for both RP2 and DaLI: 1.5.1 and 0.6.10 respectively.

jakubikan commented 5 months ago

@jakubikan Do you have Pre-May 8th, 2021 earn income? if you do, the data is no longer available via REST. You'll have to get a CSV file. Also, just a heads up, I'm no longer with Binance.com since they booted Japanese residents, so I can't actively support this plugin, but I'll try my best to walk you through this. Sorry!

hmm not sure i was trying to load the data for the 2023 tax report but could be that it tries to load more data via the tax api from binance - so not sure if i need to limit the loader to load only the data needed

jakubikan commented 5 months ago

Seems to be working with the new release :rocket:

macanudo527 commented 5 months ago

@jakubikan dali-rp2 pulls your entire history so that rp2 can calculate cost basis. You'll need the earn history to calculate cost basis if you have it.

macanudo527 commented 1 month ago

I'm closing this as resolved for now. If you have further issues, please let us know.