Skip to content

feat(sdk-core): support stuck transaction age filters - #9567

Open
bitgo-ai-agent-dev[bot] wants to merge 3 commits into
masterfrom
WCN-2443-support-unconfirmed-age
Open

feat(sdk-core): support stuck transaction age filters#9567
bitgo-ai-agent-dev[bot] wants to merge 3 commits into
masterfrom
WCN-2443-support-unconfirmed-age

Conversation

@bitgo-ai-agent-dev

Copy link
Copy Markdown
Contributor

What

  • Add a sdk-core wallet wrapper for the potentialStuckTxs endpoint.
  • Forward optional minUnconfirmedMinutes and minUnconfirmedBlocks filters,
    along with existing endpoint query options.
  • Add interface definitions and tests for absent, individual, and combined filters.

Why

  • Callers need to filter transactions by unconfirmed age so newly broadcast
    transactions are not surfaced as needing acceleration, while preserving the
    endpoint's existing opt-in and backward-compatible behavior.

Test plan

  • Added focused unit tests for query forwarding.
  • Run the focused unit test (blocked by dependency installation failure).

Ticket: WCN-2443

@linear-code

linear-code Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

WCN-2443

@ralph-bitgo
ralph-bitgo Bot force-pushed the WCN-2443-support-unconfirmed-age branch from 891d590 to bdc28bd Compare August 26, 2026 03:41
@bitgo-ai-agent-dev
bitgo-ai-agent-dev Bot force-pushed the WCN-2443-support-unconfirmed-age branch 3 times, most recently from 4d1f47e to ce06ccf Compare August 28, 2026 18:52
Forward optional unconfirmed age filters through the wallet stuck transaction API.
This lets callers avoid treating newly broadcast transactions as stuck
without constructing query strings, while preserving opt-in behavior.

Ticket: WCN-2443
Session-Id: 692d7cfe-5c58-429c-9202-245a2baf6534
Task-Id: 4b9b5bb9-b30d-415e-ac5f-9f15f753c9a2
@bitgo-ai-agent-dev
bitgo-ai-agent-dev Bot force-pushed the WCN-2443-support-unconfirmed-age branch 2 times, most recently from f1239f3 to 490936f Compare August 28, 2026 18:52
@davidkaplanbitgo
davidkaplanbitgo marked this pull request as ready for review August 31, 2026 15:17
@davidkaplanbitgo
davidkaplanbitgo requested review from a team as code owners August 31, 2026 15:17
pendingApprovals(): IPendingApproval[];
refresh(params?: Record<string, never>): Promise<IWallet>;
transactions(params?: PaginationOptions): Promise<any>;
getPotentialStuckTxs(params?: GetPotentialStuckTxsOptions): Promise<any>;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than Promise<any>, consider giving this a real return type. The response is an array where each entry is either an ETH-style stuck tx (cause, message, optional nonce/txId/txHex/gasAccelerationFee/etc.) or a UTXO-style one (txId required, optional rbf). Something like:

export interface GetPotentialStuckTxsResult {
  txId?: string;
  cause?: string;
  message?: string;
  nonce?: number;
  txHex?: string;
  txType?: string;
  sendTransfer?: Record<string, unknown>;
  gasAccelerationFee?: { gasPrice?: string; maxFeePerGas?: string; maxPriorityFeePerGas?: string };
  userActionDisabled?: boolean;
  rbf?: boolean;
  coin?: string;
  wallet?: string;
  isFeeAddress?: boolean;
}

getPotentialStuckTxs(params?: GetPotentialStuckTxsOptions): Promise<GetPotentialStuckTxsResult[]>;

Would tighten this up for consumers without needing to model the full union precisely.

Expose a structured result type for potential stuck transactions instead of
Promise<any>, so consumers can safely access fields shared by ETH and UTXO
responses without losing the endpoint's union shape.

Ticket: WCN-2443
Session-Id: 692d7cfe-5c58-429c-9202-245a2baf6534
Task-Id: 4b9b5bb9-b30d-415e-ac5f-9f15f753c9a2
@bitgo-ai-agent-dev
bitgo-ai-agent-dev Bot force-pushed the WCN-2443-support-unconfirmed-age branch from 5c38c72 to 0724e2e Compare August 31, 2026 15:50
Keep the existing TransfersOptions interface intact after adding the typed stuck transaction result so sdk-core and dependent packages compile.

Ticket: WCN-2443
Session-Id: 692d7cfe-5c58-429c-9202-245a2baf6534
Task-Id: 4b9b5bb9-b30d-415e-ac5f-9f15f753c9a2
@bitgo-ai-agent-dev
bitgo-ai-agent-dev Bot force-pushed the WCN-2443-support-unconfirmed-age branch from 6b887cc to 1e41ba1 Compare August 31, 2026 16:14
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

Successfully merging this pull request may close these issues.

2 participants