Skip to content

feat(account): implement mergeAccount()#92

Open
Andreschuks101 wants to merge 1 commit intoamina69:developfrom
Andreschuks101:feat/merge-account
Open

feat(account): implement mergeAccount()#92
Andreschuks101 wants to merge 1 commit intoamina69:developfrom
Andreschuks101:feat/merge-account

Conversation

@Andreschuks101
Copy link
Copy Markdown

Summary

  • Implemented mergeAccount() to merge settled escrow accounts back into destination accounts
  • Validates both escrowAccountId and destinationAccountId public keys
  • Builds AccountMerge operation, signs with masterSecretKey, and submits
  • Returns { mergedAccountId, txHash } on success
  • Throws TrustlineError when escrow has non-native trustlines (cannot merge)
  • Added comprehensive unit tests (validation, trustline error case, correct merge destination)

Test plan

  • npm test — all 84 tests pass
  • Validation rejects invalid escrow/destination keys
  • TrustlineError thrown when escrow has non-native trustlines
  • Correct merge destination set in transaction
  • Returns correct mergedAccountId and txHash

Closes #58

…andling

- Accept escrowAccountId and destinationAccountId params
- Validate both public keys and master secret key
- Build AccountMerge operation from escrow account
- Sign with masterSecretKey (platform holds medium threshold weight)
- Submit and return mergedAccountId and txHash
- Throw TrustlineError when escrow has non-native trustlines
- Add unit tests for validation, trustline error, and merge result

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@drips-wave
Copy link
Copy Markdown

drips-wave bot commented Mar 27, 2026

@Andreschuks101 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Andreschuks101 Andreschuks101 changed the base branch from main to develop March 28, 2026 08:16
@amina69
Copy link
Copy Markdown
Owner

amina69 commented Mar 28, 2026

@Andreschuks101 fix conflict

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.

[SDK · Account management] Implement mergeAccount()

2 participants