feat(sdk-coin-polyx): add HexTokenTransferBuilder for POLYX security token NEW memo encoding (CECHO-1381)#9058
Merged
nvrakesh06 merged 1 commit intoJun 18, 2026
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds support for the NEW Polymesh memo encoding for settlement.addAndAffirmWithMediators token transfers by introducing a dedicated builder and updating factory routing so decoded transactions round-trip through the correct encoding behavior.
Changes:
- Add
HexTokenTransferBuilder(extendsTokenTransferBuilder) that encodes memos as UTF-8 hex (0x-prefixed) right-padded with0x00to 32 bytes, while preserving already-encoded 32-byte hex memos. - Update
TransactionBuilderFactory.from()to detect NEW memo encoding forAddAndAffirmWithMediatorsand returnHexTokenTransferBuilderautomatically. - Add comprehensive unit tests covering NEW vs OLD encoding differences, transaction build behavior, and
factory.from()round-trips.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| modules/sdk-coin-polyx/test/unit/transactionBuilder/hexTokenTransferBuilder.ts | Adds unit tests for NEW token-transfer memo encoding, build outputs, and factory round-trips. |
| modules/sdk-coin-polyx/src/lib/transactionBuilderFactory.ts | Routes decoded AddAndAffirmWithMediators txs to HexTokenTransferBuilder when NEW memo encoding is detected. |
| modules/sdk-coin-polyx/src/lib/index.ts | Exports HexTokenTransferBuilder from the module public surface. |
| modules/sdk-coin-polyx/src/lib/hexTokenTransferBuilder.ts | Implements NEW Polymesh memo encoding behavior for token transfers. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
rohitsaw115
previously approved these changes
Jun 18, 2026
venkateshv1266
previously approved these changes
Jun 18, 2026
…encoding (CECHO-1381) Adds HexTokenTransferBuilder extending TokenTransferBuilder to produce the NEW Polymesh memo encoding (UTF-8 hex, right-padded with 0x00) for the settlement.addAndAffirmWithMediators instructionMemo field. Registers getHexTokenTransferBuilder() on TransactionBuilderFactory and wires auto- detection into factory.from() so round-trips route to the correct builder. Ticket: CECHO-1381 Co-authored-by: Cursor <cursoragent@cursor.com>
a87e4ca
7e254ff to
a87e4ca
Compare
MohammedRyaan786
approved these changes
Jun 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
HexTokenTransferBuilderextendingTokenTransferBuilder— overridesmemo()to use NEW Polymesh encoding (UTF-8 hex, right-padded with0x00) for thesettlement.addAndAffirmWithMediatorsinstructionMemofieldgetHexTokenTransferBuilder()onTransactionBuilderFactoryisNewMemoEncodingdetection intofactory.from()forAddAndAffirmWithMediatorsso round-trips automatically route to the correct builder (mirrors existing pattern forTransferWithMemo)Jira
CECHO-1381
Test plan
npm run unit-testpasses (179 tests) inmodules/sdk-coin-polyxHexTokenTransferBuilderproduces0x-prefixed 66-char hex memoTokenTransferBuilderstill produces OLD left-padded encoding (no regression)factory.from()returnsHexTokenTransferBuilderfor NEW-encoded token transfer txsfactory.from()→ build → identical bytes🤖 Generated with Claude Code