Skip to content

How to fetch staking amount and claimable rewards #510

Answered by minukkk
minukkk asked this question in Questions
Discussion options

You must be logged in to vote

Below way, I could fetch initial deposit and rewards after that.

    def get_active_and_pending_inactive_principals(self):
        activities_query = """
        query getDelegatedStakingActivities($delegatorAddress: String!, $pool_address: String!) {
        delegated_staking_activities(
            where: {
            delegator_address: {_eq: $delegatorAddress}
            pool_address: {_eq: $pool_address}
            }
            order_by: {transaction_version: desc}
        ) {
            amount
            event_type
            transaction_version
        }
        }
        """
        endpoint = "https://api.mainnet.aptoslabs.com/v1/graphql"  # Replace with your actual endpoin…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by minukkk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant