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

Update queryStakes JSONRPC method to support staking in different applications #2552

Closed
Tommytrg opened this issue Dec 11, 2024 · 1 comment · Fixed by #2560
Closed

Update queryStakes JSONRPC method to support staking in different applications #2552

Tommytrg opened this issue Dec 11, 2024 · 1 comment · Fixed by #2560
Assignees
Labels
2.0 enhancement 📈 New feature or request
Milestone

Comments

@Tommytrg
Copy link
Member

Tommytrg commented Dec 11, 2024

To support staking in myWitWallet and other libraries, the queryStakes JSONRPC method needs to support the following features:

  • Include the nonce in the response to facilitate the unstaking process.
  • Instead of returning only the total staked amount, queryStakes should return a map with two keys:
    • total: The total staked amount.
    • stakes: An array of stake objects filtered by the specified parameter (withdrawer, validator, or stakeKey).

To keep the JSONRPC and the CLI consistent, the changes should also be applied to the CLI method.

Issue related with witnet/my-wit-wallet#618.

@aesedepece
Copy link
Member

  * `total`: The total staked amount.

The total might be irrelevant depending if we query by withdrawer, validator, or stakeKey. I'd leave it out and stick to just returning a vector of stake entries, with their corresponding keys, amounts and nonces. Calculating the total on the client side—when it makes sense—is trivial.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.0 enhancement 📈 New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants