Skip to content

Fix: Update External Field Encoding#346

Open
sephynox wants to merge 13 commits into
mainfrom
fix/external-field-encoding
Open

Fix: Update External Field Encoding#346
sephynox wants to merge 13 commits into
mainfrom
fix/external-field-encoding

Conversation

@sephynox

@sephynox sephynox commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Summary

Invert external field to v2 (per-anchor encrypted containers) and add provider-independent AnchorTransactionStatus with lib-owned interfaces implemented by services/asset-movement.

@sephynox sephynox self-assigned this Jun 1, 2026
@sephynox sephynox added bug Something isn't working enhancement New feature or request anchor:sdk Updates to the Anchor SDK labels Jun 1, 2026

Copilot AI left a comment

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.

Pull request overview

This PR updates the anchor external field encoding to a new v2 format that stores per-anchor data in independently framed EncryptedContainers, and introduces a provider-independent AnchorTransactionStatus facade with lib-owned interfaces that services can implement (asset-movement added as the first implementation).

Changes:

  • Switch AnchorExternal to v2: plaintext outer envelope mapping anchor id → base64 EncryptedContainer slice, with per-slice signing/binding and optional per-slice encryption.
  • Add AnchorTransactionStatus (plus ports/types) and an asset-movement AnchorStatusSource implementation to read standardized transfer statuses.
  • Add/adjust tests covering v2 external encoding/decoding behavior and transaction status reading.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/services/asset-movement/status-source.ts Adds an AnchorStatusSource implementation backed by the asset-movement client/provider resolution.
src/services/asset-movement/common.ts Refines TransactionStatus typing to standardize COMPLETE while allowing provider-specific strings.
src/lib/index.ts Re-exports AnchorTransactionStatus from the lib entrypoint.
src/lib/anchor-status.ts Introduces provider-independent status reader interfaces and the AnchorTransactionStatus facade.
src/lib/anchor-status.test.ts Adds integration-style tests for status reading and external-driven status lookups.
src/lib/anchor-external.ts Implements v2 external encoding/decoding with per-anchor slices (independent signing/encryption).
src/lib/anchor-external.test.ts Updates tests to v2 semantics and adds coverage for multi-anchor and opaque-slice behavior.
src/lib/anchor-external.generated.ts Updates typia-generated validators for the new v2 envelope and v1 slice shapes.
src/client/index.ts Exposes the asset-movement status source via the client namespace exports.

Comment thread src/lib/anchor-status.ts Outdated
Comment thread src/lib/anchor-external.ts
Comment thread src/lib/anchor-external.test.ts
Comment thread src/lib/anchor-status.ts
@sephynox sephynox changed the title fix: Update External Field Encoding Fix: Update External Field Encoding Jun 3, 2026
@sephynox sephynox requested review from Srayman and rkeene June 3, 2026 16:11

Copilot AI left a comment

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.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

Comment thread src/lib/anchor-external.ts
@sonarqubecloud

sonarqubecloud Bot commented Jun 5, 2026

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

anchor:sdk Updates to the Anchor SDK bug Something isn't working enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants