View Rewards and Delegations

Overview

Staking delegates assets to a staking address. Depending on the asset, the staking address could be the validator's address, an address linked to your wallet, or a smart-contract address.

Once staked, you can retrieve the following delegation details:

  • Delegated balance
  • Delegation address
  • Delegation ID
  • Expected APR or APY
  • Rewards accrued
  • Withdrawal address (for unstaking)

Depending on the asset, multiple staking requests could result in 1 or more staking delegations. For example, ETH is staked in multiples of 32, so a staking request for 64 ETH, entails 2 staking delegations. Conversely, if an asset doesn't require staking in multiples, you can create multiple staking requests, from the same wallet, and all the requests have to the same staking delegation.

Prerequisites

View Rewards

Endpoint: List staking details by wallet

export COIN="<ASSET_ID>"
export WALLET_ID="<YOUR_WALLET_ID>"
export ACCESS_TOKEN="<YOUR_ACCESS_TOKEN>"

curl -X GET \
  "https://app.bitgo-test.com/api/staking/v1/$COIN/wallets/$WALLET_ID" \
  -H 'Content-Type: application/json' \
  -H "Authorization: Bearer $ACCESS_TOKEN"
query BitgoStakingWalletQuery($coin: String!, $walletId: String!) {
  bitgoStakingWallet(coin: $coin, walletId: $walletId)
    @rest(
      type: "BitgoStakingWalletResponse"
      path: "api/staking/v1/{args.coin}/wallets/{args.walletId}"
    ) {
    enterpriseId
    walletId
    walletType
    coin
    delegated
    pendingUnstake
    rewards
    apy
    creationDate
    modifiedDate
  }
}

Step Result

{
  "enterpriseId": "1032e75c451052000436831deb797af1",
  "walletId": "2032e75g451052000636831abd797bd3",
  "walletType": "custodial",
  "coin": "eth",
  "delegated": 6400000000000000000,
  "pendingStake":0,
  "pendingUnstake": 0,
  "rewards": 1000000000000000,
  "apy": 8.2,
  "createdDate": "2022-01-10T14:32:28Z",
  "modifiedDate": "2022-01-10T14:32:28Z"
}

View Delegations

Endpoint: List staking delegations

export COIN="<ASSET_ID>"
export WALLET_ID="<YOUR_WALLET_ID>"
export ACCESS_TOKEN="<YOUR_ACCESS_TOKEN>"
export DELEGATION_IDS="<DELEGATION_IDS>"
export DELEGATION_STATUS="<DELEGATION_STATUS>"

curl -X GET \
  "https://app.bitgo-test.com/api/staking/v1/$COIN/wallets/$WALLET_ID/delegations?delegationIds=$DELEGATION_IDS&delegationStatus=$DELEGATION_STATUS" \
  -H 'Content-Type: application/json' \
  -H "Authorization: Bearer $ACCESS_TOKEN"
export const BitgoWalletDelegationsQuery = gql`
  query BitgoWalletDelegationsQuery($coin: String!, $walletId: String!) {
    bitgoWalletDelegations(coin: $coin, walletId: $walletId)
      @rest(
        type: "BitgoWalletDelegationsResponse"
        path: "api/staking/v1/{args.coin}/wallets/{args.walletId}/delegations"
      ) {
        delegations {
          id
          delegationsAddress
          withdrawalAddress
          delegated
          coin
          walletId
          status
          rewards
          pendingUnstake
          apy
          unstakingMin
          unstakingFee
        }
        page
        totalPages
        totalElements
      }
  }
`;

Step Result

{
  "page": 1,
  "totalPages": 1,
  "totalElements": 2,
  "delegations": [
    {
      "id": "e0225adbc-66a3-4ccd-9a9d-726a05bca0cf",
      "delegationAddress": "0x5a6406c9710f588ca733360bfa8033d0ef9ecdy5",
      "withdrawalAddress": "0x5a6406c9710f588ca733360bfa8033d0ef9ecd7c",
      "delegated": 3200000000000000000,
      "status": "ACTIVE",
      "rewards": 0,
      "pendingUnstake": 3200000000000000000,
      "apy": 8.3,
      "coin": "hteth",
      "walletId": "2032e75g451052000636831abd797bd3",
      "unstakingFee": 100000000000000,
      "unstakingMin": 0
    },
    {
      "id": "e0225adbc-55b43-5tta-9a9d-726a05bca0ai",
      "delegationAddress": "0x3b6406c9710f588ca733360bfa8033d0ef9ecre4",
      "withdrawalAddress": "0x5a6406c9710f588ca733360bfa8033d0ef9ecd7c",
      "delegated": 3200000000000000000,
      "status": "ACTIVE",
      "rewards": 0,
      "pendingUnstake": 0,
      "apy": 8.3,
      "coin": "hteth",
      "walletId": "2032e75g451052000636831abd797bd3",
      "unstakingFee": 1000000000000000,
      "unstakingMin": 0
    }
  ]
}

Next

Use the delegation ID to Unstaking from Custody Wallet or Unstaking from Self-Custody Wallet.

See Also