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 modifiably Nonce #240

Closed
Trevypants opened this issue Jun 15, 2024 · 0 comments · Fixed by #242 or #230
Closed

Add modifiably Nonce #240

Trevypants opened this issue Jun 15, 2024 · 0 comments · Fixed by #242 or #230
Assignees
Labels
enhancement New feature or request Futures Topic related to Futures trading Spot Topic related to Spot trading
Milestone

Comments

@Trevypants
Copy link

Describe the solution you'd like

Currently the code has a pre-defined nonce as follows:

params["nonce"] = str(int(time.time() * 100_000_000))

In most cases, this nonce definition poses no problems. However, in integrated applications, it could be that an individual would like to define their own custom nonce function. I believe that it would be very helpful for users to be able to provide their own custom nonce function.

This has the extra benefit in helping avoid invalid nonce errors with asynchronous API calls. When performing concurrent API calls, it could be that the nonces are just off (not sequential) that Kraken returns an invalid nonce error. However Kraken offers a nonce error window that allows for a certain leeway in the nonce values provided (which can work well with asynchronous API calls). However, the nonce error window is dependent on the nonce function. The custom nonce function can help users define these windows so asynchronous API calls can work.

A possible solution implementation is to include a nonce function input on the client initializer which is used on every API call.

@btschwertfeger btschwertfeger changed the title Custom Nonce Add modifiably Nonce Jun 20, 2024
@btschwertfeger btschwertfeger self-assigned this Jun 20, 2024
@btschwertfeger btschwertfeger added enhancement New feature or request Futures Topic related to Futures trading Spot Topic related to Spot trading labels Jun 20, 2024
@btschwertfeger btschwertfeger added this to the v3.0.0 milestone Jun 20, 2024
This was linked to pull requests Jun 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Futures Topic related to Futures trading Spot Topic related to Spot trading
Projects
None yet
2 participants