-
Notifications
You must be signed in to change notification settings - Fork 42
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
Binance.US Implementation #228
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is on the right course. I just remembered, we do have exchange locked aliases that you could try to implement.
You could also give that a try. Sorry I didn't think of it earlier. Since USD and USD4 are one-to-one, you can follow the example of the ETH2 -> ETH alias on Coinbase.
raise RP2RuntimeError("Exchange is not instance of class binanceus.") | ||
return super_client | ||
|
||
def _get_algos(self) -> List[str]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function is associated with mining so it can be deleted too if Binance.us doesn't deal with mining.
self.__api_key = api_key | ||
self.__api_secret = api_secret | ||
# We will have a default start time of July 13th, 2017 since Binance Exchange officially launched on July 14th Beijing Time. | ||
super().__init__(account_holder, datetime(2017, 7, 13, 0, 0, 0, 0), native_fiat, thread_count) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you track down the start date for Binance.us?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How exact do I need to be? I think it is 09/22/2019 to the nearest day.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An safe approximation is okay. Err on the side of being too early. For example, if you think it might be 9/22/2019 EST, you might as well make it 9/21/2019 just to be safe.
This just helps with optimization, so that we don't pull unnecessary information.
@@ -0,0 +1,1329 @@ | |||
# Copyright 2022 macanudo527 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Be sure to take credit for this.
|
||
|
||
""" | ||
def test_gains(self, mocker: Any) -> None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you want to disable a test, you can simply put disabled in front of the method name:
def test_gains(self, mocker: Any) -> None: | |
def disabled_test_gains(self, mocker: Any) -> None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Of course, if you never need gains, you can just delete the test entirely. You can always copy and paste the code from binance in the future if you think you need it.
I just realized that the plugin does not load my deposits or withdrawals. Are deposits and withdrawals processed in the _process_fiat_order method? |
They should be covered by the abstract plugin. Something might be wrong with the pagination details. You'll have to look into it. Is it missing fiat deposits and withdrawals only? |
I believe it is only fiat. |
OK, well, my guess is that there is an implicit API function that covers fiat withdrawal/deposit you will have to look up. This looks like it right here: And the withdrawal Endpoint is there too. |
The sapiGetFiatpaymentQueryWithdrawHistory and sapiGetFiatpaymentQueryDepositHistory end points are not available in the version of ccxt that dali-rp2 uses (3.0.79), but they are available in the current version (4.2.86). Is it possible to upgrade? Or would there be a way for me to use them with the current version? |
Yeah, that was on the todo list. Upgrades tend to break things. You can give it a try and I'll try with my exchanges as well, but these days I don't use as many advanced features. Be sure to double-check all your math. If something doesn't look right, there is probably a bug. CCXT is pretty finicky. |
Is this ready to merge? I'm in need of a plugin for binance.us. If there's anything left to do I'd be happy help get this across the finish line with a few pointers :) |
@savgrace, thanks for offering to help (sorry, this fell through the cracks and I just noticed your message now). @tpaynter4 and @macanudo527, is there any way @savgrace can help with this? |
I've been pretty busy lately, but I am still having problems with deposits and withdrawals. I think there are pagination issues when using the CCXT endpoints for deposits and withdrawals, but I am not sure. |
Have you looked at the API feed with Postman? In my experience, that has been a huge help for troubleshooting what the feed looks like. |
Implement Binance.US Plugin