Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jakubikan opened this issue Apr 9, 2024 · 6 comments

Comments

@jakubikan
Copy link

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
Copy link
Collaborator

macanudo527 commented Apr 10, 2024

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
Copy link
Owner

eprbell commented Apr 10, 2024

@eprbell Can you make another release?

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

@eprbell
Copy link
Owner

eprbell commented Apr 10, 2024

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

@jakubikan
Copy link
Author

@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
Copy link
Author

Seems to be working with the new release 🚀

@macanudo527
Copy link
Collaborator

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants