Skip to content

How can I determine the specific staking transaction associated with this unstaking transaction? #21418

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

Open
nishitCrowe opened this issue Mar 5, 2025 · 3 comments

Comments

@nishitCrowe
Copy link

While checking the response of query_transaction_block json RPC API, I got below response in an unstake transaction-

"events": [
{
"id": {
"txDigest": "DZaDtRkjVzZqSuiF5bddT8AxTVcPDKe8WLz7TMemkgaU",
"eventSeq": "0"
},
"packageId": "0x0000000000000000000000000000000000000000000000000000000000000003",
"transactionModule": "sui_system",
"sender": "0xcd57cb92c4380df9284d730bc7fa8810ddb784045b91299c3ae59556ed38374c",
"type": "0x3::validator::UnstakingRequestEvent",
"parsedJson": {
"pool_id": "0xf1861222d449dd268a71e84bedc8d517196862aa563091487d9ab54c42aef6e6",
"principal_amount": "5000000000000000",
"reward_amount": "22116891598947",
"stake_activation_epoch": "594",
"staker_address": "0xcd57cb92c4380df9284d730bc7fa8810ddb784045b91299c3ae59556ed38374c",
"unstaking_epoch": "658",
"validator_address": "0x92c7bf9914897e8878e559c19a6cffd22e6a569a6dd4d26f8e82e0f2ad1873d6"
},
"bcsEncoding": "base64",
"bcs": "8YYSItRJ3SaKcehL7cjVFxloYqpWMJFIfZq1TEKu9uaSx7+ZFIl+iHjlWcGabP/SLmpWmm3U0m+OguDyrRhz1s1Xy5LEOA35KE1zC8f6iBDdt4QEW5EpnDrllVbtODdMUgIAAAAAAACSAgAAAAAAAACA4Dd5wxEAY6B3fR0UAAA="
}
],

Here we get stake_activated_epoch which says that in this epoch, the stake was happened. but how to identify against which specific transaction under that epoch, the staking transaction is related to.

Copy link
Contributor

github-actions bot commented Mar 5, 2025

Thank you for opening this issue, a team member will review it shortly. Until then, please do not interact with any users that claim to be from Sui support and do not click on any links!

@stefan-mysten
Copy link
Contributor

You probably need to make a query on events and set a filter to sender, and then check for an event where staking is called. Or find all the transaction blocks made by this address, and then go one by one to find the one that did the staking.

@nishitCrowe
Copy link
Author

Actually I find a transaction where couple of staking transaction took place in same epoch, same amount, same validator and same staking pool. and then same with unstake transaction, found couple of unstake transaction in same epoch. so how to identify which staking txn is related to which unstaking txn.

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

No branches or pull requests

2 participants