Skip to content

Conversation

@at31416
Copy link
Contributor

@at31416 at31416 commented Oct 23, 2025

This pull request adds support for VET token (specifically VTHO) recovery transactions using MPCv2 TSS, including both signed and unsigned sweep recoveries. It introduces a new recover method for VET tokens, updates the types and constants to support token contract addresses, and adds comprehensive tests and mocks for token recovery flows.

VET Token Recovery Support:

  • Added a recover method to the VetToken class that supports both signed and unsigned sweep token recoveries using MPCv2 TSS, handling key derivation, transaction construction, signing, and broadcasting.
  • Implemented a buildRecoveryTransaction method in VetToken to construct token recovery transactions, including fee estimation, balance checks, and clause creation for token transfers.

Type and Constant Updates:

  • Extended RecoverOptions to include an optional tokenContractAddress for specifying the token contract in recovery operations.
  • Added a feeEstimateData export to constants.ts for consistent fee calculation in token recovery.
  • Updated imports and removed redundant local definitions to use the new shared feeEstimateData. [1] [2]
  • Changed access modifiers in Vet to make fee calculation and recovery transaction building methods protected for subclass use. [1] [2]

Testing Improvements:

  • Added unit tests to cover token recovery and unsigned sweep scenarios for VTHO using the new recovery logic.
  • Introduced nockVetTokenRecovery in test mocks to simulate VET token recovery flows, including account balance, block info, and transaction submission.

Ticket: COIN-6042

@at31416 at31416 marked this pull request as ready for review October 23, 2025 07:22
@at31416 at31416 requested review from a team as code owners October 23, 2025 07:22
@at31416 at31416 requested review from kisslove-dewangan and zahin-mohammad and removed request for a team October 23, 2025 07:22
@at31416 at31416 requested review from a team as code owners October 23, 2025 09:40
@at31416 at31416 changed the base branch from vechain-wrw to master October 23, 2025 10:09
Copy link
Contributor

@MohammedRyaan786 MohammedRyaan786 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@MohammedRyaan786 MohammedRyaan786 left a comment

Choose a reason for hiding this comment

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

LGTM

@at31416 at31416 merged commit fe96f7f into master Oct 23, 2025
14 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