Stake Assets - Self-Custody Wallet

Create staking requests with full signing control. See the Guide.

  1. Create a staking request by specifying the staking details and sending them to BitGo. The example shows the minimum required parameters for staking ether.

    Prerequisites:

    API Reference

  2. Validators must process your staking request before the request is ready for approval and signing. To get notified when staking requests are pending approval, you can Create Webhooks.

    API Reference

  3. If you have a policy that requires approval, you must approve the staking request before signing and broadcasting. You cannot approve your own transactions — another admin must approve them.

    API Reference

  4. After an admin approves the staking request (or if no approval is required), sign the transactions and send them to BitGo for final signing and broadcasting to the blockchain.

// 1. Create Staking Request
export COIN="<ASSET_ID>"
export WALLET_ID="<YOUR_WALLET_ID>"
export ACCESS_TOKEN="<YOUR_ACCESS_TOKEN>"
export AMOUNT="<AMOUNT_IN_BASE_UNITS>"

curl -X POST \
  https://app.bitgo-test.com/api/staking/v1/$COIN/wallets/$WALLET_ID/requests \
  -H 'Content-Type: application/json' \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -d '{
    "amount": "'"$AMOUNT"'",
    "type": "STAKE"
  }'
// 2. Get Request Status (Optional)
export ENTERPRISE_ID="<YOUR_ENTERPRISE_ID>"
export ACCESS_TOKEN="<YOUR_ACCESS_TOKEN>"
export WALLET_TYPE="<YOUR_WALLET_TYPE>"
export WALLET_ID="<YOUR_WALLET_ID>"

curl -X GET \
  https://app.bitgo-test.com/api/staking/v1/enterprises/$ENTERPRISE_ID/requests/transactions \
  -H 'Content-Type: application/json' \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -d '{
    "walletType": "'"$WALLET_TYPE"'",
    "walletId": "'"$WALLET_ID"'",
    "requestType": "STAKE",
    "requestStatus": "PENDING_APPROVAL"
  }'
// 3. Approve Request (Optional)
export APPROVAL_ID="<APPROVAL_ID>"
export ACCESS_TOKEN="<YOUR_ACCESS_TOKEN>"
export OTP="<YOUR_OTP>"

curl -X PUT \
  https://app.bitgo-test.com/api/v2/pendingApprovals/$APPROVAL_ID \
  -H 'Content-Type: application/json' \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -d '{
    "state": "approved",
    "otp": "'"$OTP"'"
  }'
// 4. Sign and Send Request
// Use the JavaScript SDK for signing (see JavaScript tab)
Response
// 1. Create Staking Request Response
{
  "id": "e055adbc-66a3-4ccd-9a9d-726a05bca0cf",
  "clientId": "e055adbc-66a3-4ccd-9a9d-726a05bca0cf",
  "requestUserId": "6092e75c451052000636831deb797bd1",
  "enterpriseId": "1032e75c451052000436831deb797af1",
  "walletId": "2032e75g451052000636831abd797bd3",
  "walletType": "hot",
  "type": "STAKE",
  "coin": "hteth",
  "createdDate": "2022-01-10T14:32:28Z",
  "statusModifiedDate": "2022-01-10T14:32:28Z",
  "status": "NEW",
  "withdrawalAddress": "0x5a6406c9710f588ca733360bfa8033d0ef9ecd7c",
  "amount": 6400000000000000000,
  "gasPrice": 1000000000000000
}

// 2. Get Request Status Response
{
  "page": 1,
  "totalPages": 1,
  "totalElements": 1,
  "requests": [
    {
      "id": "e055adbc-66a3-4ccd-9a9d-726a05bca0cf",
      "status": "PENDING_APPROVAL",
      "transactions": [
        {
          "id": "d0355adbc-55b43-5tta-9a9d-726a05bca0ai",
          "status": "PENDING_APPROVAL",
          "amount": "3200000000000000000",
          "transactionType": "delegate"
        }
      ]
    }
  ]
}

// 3. Approve Request Response
{
  "id": "e055adbc-66a3-4ccd-9a9d-726a05bca0cf",
  "coin": "hteth",
  "wallet": "2032e75g451052000636831abd797bd3",
  "enterprise": "1032e75c451052000436831deb797af1",
  "state": "approved",
  "approvalsRequired": 1
}

// 4. Sign and Send Request Response
{
  "id": "e055adbc-66a3-4ccd-9a9d-726a05bca0cf",
  "walletType": "hot",
  "type": "STAKE",
  "coin": "hteth",
  "status": "NEW",
  "delegations": [
    {
      "id": "e0225adbc-66a3-4ccd-9a9d-726a05bca0cf",
      "delegationAddress": "0x5a6406c9710f588ca733360bfa8033d0ef9ecdy5",
      "delegated": 3200000000000000000,
      "status": "PENDING"
    }
  ],
  "transactions": [
    {
      "stakingRequestId": "e055adbc-66a3-4ccd-9a9d-726a05bca0cf",
      "status": "PENDING",
      "amount": 3200000000000000000,
      "transactionType": "delegate"
    }
  ],
  "amount": 6400000000000000000
}