Resolve Nonce Holes - cURL

Identify and resolve nonce holes that cause stuck transactions on ETH-like coins using the REST API. Includes flows for Custody MPC, Self-Custody MPC (Manual), and Go Account (Simple and Manual) wallets. For the Self-Custody MPC (Simple) flow, see the JavaScript cookbook. See the Guide.

  1. Query the wallet for potentially stuck transactions on ETH-like coins. Stuck transactions caused by nonce holes return "cause": "nonceHole" and "userActionDisabled": false. Save the nonce value from the response for use in the next step.

    You can subscribe to the stuckTx wallet webhook to receive notifications when a transaction becomes stuck. For more information, see Create Wallet Webhooks.

    Prerequisites: You must have completed the Get Started guide and initiated a withdrawal (see Withdraw Overview).

    API Reference

  2. Create a new transaction that includes the nonce value from the stuck transaction identified in the prior step. The endpoint and parameters depend on your wallet type:

    • Custody MPC and Self-Custody MPC (Manual): Use Create Transaction Request with intentType: "fillNonce".
    • Go Account (Simple): Use Send Transaction through BitGo Express with type: "fillNonce". If withdrawing to another Go Account, pass walletId instead of address.
    • Go Account (Manual): Use Build Transaction with type: "fillNonce". If sending to another Go Account, use walletId instead of address.

    For the Self-Custody MPC (Simple) flow, see the JavaScript cookbook.

    Withdrawal flows differ by wallet type. View the end-to-end transaction flow and integration guides for your wallet type at Withdraw Overview.

// 1. Identify Stuck Transactions
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/v2/$COIN/wallet/$WALLET_ID/potentialStuckTxs" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $ACCESS_TOKEN"

// 2. Resolve Nonce Holes
export NONCE="<NONCE_VALUE_OF_STUCK_TRANSACTION>"

curl -X POST "https://app.bitgo-test.com/api/v2/wallet/$WALLET_ID/txrequests" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -d '{
    "idempotencyKey": "string",
    "intent": {
      "intentType": "fillNonce",
      "nonce": "'"$NONCE"'",
      "sequenceId": "4dEeycHsDSsCAG1zYPKGSxyPkHQ",
      "feeOptions": {
        "unit": "baseUnit",
        "formula": "fixed",
        "feeType": "base",
        "gasLimit": 0,
        "gasPrice": 0
      },
      "receiveAddress": "string",
      "senderAddressIndex": 0
    },
    "videoApprovers": [
      "585951a5df8380e0e3063e9f",
      "585951a5df8380e0e304a553"
    ],
    "apiVersion": "lite",
    "preview": false
  }'
Response
// 1. Identify Stuck Transactions Response
[
  {
    "nonce": 200000,
    "txHex": "01000000000101d...a53aec8b11400",
    "txId": "b8a828b98dbf32d9fd1875cbace9640ceb8c82626716b4a64203fdc79bb46d26",
    "sendTransfer": {
      "baseValueString": "2000000",
      "bitgoOrg": "BitGo Trust",
      "coin": "hteth",
      "date": "2025-01-24T14:15:22Z",
      "enterprise": "59cd72485007a239fb00282ed480da1f",
      "history": [
        {
          "action": "created",
          "date": "2025-01-24T14:15:22Z",
          "txid": "b8a828b98dbf32d9fd1875cbace9640ceb8c82626716b4a64203fdc79bb46d26",
          "user": "59cd72485007a239fb00282ed480da1f"
        }
      ],
      "id": "59cd72485007a239fb00282ed480da1f",
      "organization": "59cd72485007a239fb00282ed480da1f",
      "pendingApproval": "664ed267aad92c62a183ac5f28883495",
      "state": "initialized",
      "txid": "b8a828b98dbf32d9fd1875cbace9640ceb8c82626716b4a64203fdc79bb46d26",
      "type": "send",
      "valueString": "2000000",
      "wallet": "59cd72485007a239fb00282ed480da1f",
      "walletType": "custodial"
    },
    "cause": "nonceHole",
    "gasAccelerationFee": {
      "gasPrice": "200000",
      "maxFeePerGas": "200000",
      "maxPriorityFeePerGas": "200000"
    },
    "userActionDisabled": false
  }
]

// 2. Resolve Nonce Holes Response
{
  "txRequestId": "string",
  "version": 0,
  "latest": true,
  "walletId": "string",
  "walletType": "cold",
  "enterpriseId": "string",
  "state": "initialized",
  "date": {},
  "createdDate": {},
  "userId": "string",
  "initiatedBy": "string",
  "updatedBy": "string",
  "intent": {
    "intentType": "fillNonce",
    "nonce": "string",
    "sequenceId": "string",
    "comment": "string",
    "feeOptions": {
      "unit": "baseUnit",
      "formula": "fixed",
      "feeType": "base",
      "gasLimit": 0,
      "gasPrice": 0
    },
    "receiveAddress": "string",
    "senderAddressIndex": 0
  },
  "pendingApprovalId": "string",
  "isCanceled": true
}