Skip to content

feat(sdk-coin-xrp): add AccountDelete#8761

Merged
dgm003 merged 1 commit into
masterfrom
feat/xrp-account-delete-recovery
May 14, 2026
Merged

feat(sdk-coin-xrp): add AccountDelete#8761
dgm003 merged 1 commit into
masterfrom
feat/xrp-account-delete-recovery

Conversation

@dgm003
Copy link
Copy Markdown
Contributor

@dgm003 dgm003 commented May 13, 2026

Ticket: CSHLD-716

Summary

Adds support for the XRPL AccountDelete transaction type to the XRP SDK, enabling
full reserve withdrawal recovery via the Wallet Recovery Wizard.(PR: BitGo/wallet-recovery-wizard#709)

Problem

XRP accounts hold a base reserve (1.2 XRP on mainnet, 0.2 XRP on testnet) that
standard Payment recovery transactions cannot access. Users with compromised or
abandoned wallets were unable to recover this locked balance.

Solution

Implement the XRPL AccountDelete transaction type, which permanently deletes an
account and transfers its entire balance including the base reserve to a
destination address.

Changes

sdk-core

  • enum.ts — Added TransactionType.AccountDelete = 65 to the shared transaction type enum

sdk-coin-xrp — Builder layer

  • iface.ts — Added AccountDelete to XrpTransactionType enum, extended XrpTransaction
    union type, added reserveWithdrawal?: boolean to RecoveryOptions and TxData
  • accountDeleteBuilder.ts (new) — Builder for AccountDelete transactions, handles
    destination address and optional destination tag
  • transactionBuilderFactory.ts — Wired getAccountDeleteBuilder() and routing in from()
  • transaction.ts — Added serialisation (toJson), explanation
    (explainAccountDeleteTransaction), input/output extraction, and type mapping for
    AccountDelete
  • index.ts — Exported AccountDeleteBuilder

sdk-coin-xrp — Recovery layer

  • xrp.ts — Added reserveWithdrawal branch in recover() with the following
    precondition checks before building the AccountDelete transaction:
    • No trustlines with non-zero balances
    • No owned objects other than SignerList
    • Account age: Sequence + 256 ≤ currentLedger
    • Destination account must exist on the ledger
      Supports all three recovery modes: fully signed (non-KRS), half-signed (KRS), and
      unsigned sweep.

Tests

  • test/resources/xrp.ts — Added mock fixtures: accountlinesResponseEmpty,
    accountObjectsResponse, accountObjectsResponseBlocking,
    destAccountInfoResponse, destAccountInfoNotFound
  • test/unit/transactionBuilder/accountDeleteBuilder.ts (new) — 6 unit tests
    covering build with/without destination tag, round-trip rebuild from raw, and
    error cases for missing sender/destination
  • test/unit/xrp.ts — 5 new tests for the recover() AccountDelete path covering
    fully signed, unsigned sweep, and all 3 precondition failure cases

Testing

Verified end-to-end on XRPL testnet via Wallet Recovery Wizard — transaction
broadcast with tesSUCCESS, account deleted and full balance (including reserve)
transferred to destination.

@dgm003 dgm003 marked this pull request as ready for review May 13, 2026 06:51
@dgm003 dgm003 requested review from a team as code owners May 13, 2026 06:51
@dgm003 dgm003 requested review from bdesoky and lokesh-bitgo May 13, 2026 06:51
Copy link
Copy Markdown
Contributor

@kisslove-dewangan kisslove-dewangan left a comment

Choose a reason for hiding this comment

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

lgtm, based on codeowners

@abhi-bitgo
Copy link
Copy Markdown
Contributor

@claude

@dgm003 dgm003 merged commit be24a63 into master May 14, 2026
22 checks passed
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.

4 participants