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

Add functions to fetch funding rate data from market #552

Merged
merged 2 commits into from
May 11, 2024

Conversation

Issengaard
Copy link
Contributor

The market client has been modified to enable the retrieval of funding rate data with the following changes:

  • NewFundingRateHistoryService now fetches funding rate history data using the Rest API.
  • NewFundingRateInfoService now retrieves symbols' funding rate information using the Rest API.

Tests for the new functions have been created following the same approach as other tests in the package.

@adshao
Copy link
Owner

adshao commented Apr 22, 2024

thank you @Issengaard

Comment on lines 66 to 78
func TestName(t *testing.T) {
client := NewClient("", "")

ctx, cancelFunc := context.WithDeadline(context.Background(), time.Now().Add(time.Second*5))
defer cancelFunc()

rateHistory, err := client.NewFundingRateHistoryService().Do(ctx)
require.NoError(t, err)

for i := 0; i < 5; i++ {
fmt.Printf("%+v\n", rateHistory[i])
}
}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove these lines of code which make unit tests failed: https://github.com/adshao/go-binance/actions/runs/8418016069/job/24101016684?pr=552#step:6:554

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good day! Upps, I'm sorry, I have forgot to remove test function, that had made to check function results. I have removed it in new commit.

@adshao adshao merged commit dc7abf8 into adshao:master May 11, 2024
1 check passed
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