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

fix - wallet api: AccountSnapshotQuery field name error. #36

Closed
wants to merge 13 commits into from

Conversation

hhstore
Copy link
Contributor

@hhstore hhstore commented Jun 9, 2022

Update:

  • I have done all the wallet APIs fixes and tests.
  • You can review the codes. This PR is ready to be merged.

Wallet API List:

Add New APIs:

for quick query.

  • wallet.deposit_history_quick()
    • By default, Binance only supports querying records within 90 days.
    • It is very inconvenient.
    • Therefore, I extended a method to implement a wider range of query (like 5years etc).
    • It is very simple to use, just need to pass additional years or months or days parameters.
    // a usage case 
    pub async fn deposit_history(&self, coin: Option<&str>) {
        let req = DepositHistoryQuery {
            coin: coin.map(|c| c.to_string()),
            status: None,
            start_time: None,
            end_time: None,
            limit: None,
            offset: None,
        };

        // here: 
        match self.client.deposit_history_quick(req, None, None, None, None).await {
            Ok(answer) =>
                for r in answer {
                    info!(
                        "💰 deposit history: [{:?}, {:?}], length={}",
                        r.start_at,
                        r.end_at,
                        r.records.len()
                    );
                    for item in r.records {
                        info!("💎 deposit: {:?}", item);
                    }
                },
            Err(e) => error!("Error: {:?}", e),
        }
    }
  • wallet.withdraw_history_quick()
    • use like wallet.deposit_history_quick()
  • utils.duration_by() // for easy query
  • utils.ago_by() // for easy query

@hhstore hhstore mentioned this pull request Jun 9, 2022
@hhstore
Copy link
Contributor Author

hhstore commented Jun 22, 2022

Remaining unverified APIs:

  • wallet.disable_fast_withdraw_switch()
  • wallet.enable_fast_withdraw_switch()
  • wallet.withdraw()
  • wallet.dust_transfer()
  • wallet.universal_transfer()

Except these APIs are not verified.

  • All other wallet APIs have fixed bugs and passed the test.
  • Because the test API-key I'm currently using only has read-only permissions, I haven't verified these APIs.
  • I don't currently have a withdrawal request.

All Test Cases Here:

@Igosuki
Copy link
Owner

Igosuki commented Jul 15, 2022

Closing in favor of #37

@Igosuki Igosuki closed this Jul 15, 2022
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

Successfully merging this pull request may close these issues.

None yet

2 participants