Skip to content

Conversation

yhabib
Copy link
Contributor

@yhabib yhabib commented Oct 7, 2025

Motivation

Support the transaction memo for both ICP and ICRC1 addresses for ICP transaction flows. This PR adds utils to validate the provided memo:

  • The memo field for ICP account transactions is an unsigned 64-bit integer.
  • The icrc1Memo field for ICRC1 account transactions is a byte array with a length of up to 32 bytes.

Changes

  • Updated mapIcpTransactionToUi to prepare the memo field for the UI when the value is present. It check first for icrc1Memo as this value is optional, if not present it uses the value from the memo field that is always present.
  • Added isValidIcpMemo, isValidIcrc1Memo, and validateTransactionMemo to validate the different types of memos.

Tests

Todos

  • Accessibility (a11y) – any impact?
  • Changelog – is it needed?

@yhabib yhabib marked this pull request as ready for review October 7, 2025 15:22
@yhabib yhabib requested a review from a team as a code owner October 7, 2025 15:22
Copy link
Contributor

@mstrasinskis mstrasinskis left a comment

Choose a reason for hiding this comment

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

Thanks, just a couple of minor comments.

@yhabib yhabib enabled auto-merge October 8, 2025 10:00
@yhabib yhabib added this pull request to the merge queue Oct 8, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Oct 8, 2025
@yhabib yhabib added this pull request to the merge queue Oct 8, 2025
Merged via the queue into main with commit db33e7f Oct 8, 2025
36 checks passed
@yhabib yhabib deleted the yhabib/transactios/utils branch October 8, 2025 10:33
github-merge-queue bot pushed a commit that referenced this pull request Oct 8, 2025
# Motivation

Support the transaction memo for both ICP and ICRC1 addresses in ICP
transaction flows. This PR implements the necessary changes to the
service layer to encode the memo according to the target address type.

Previous PR #7399

# Changes

- Update `transferICP` to process the memo field and encode based on the
target address type.
- Added utils for the conversion.

# Tests

- Added unit tests for the change.

# Todos

- [x] Accessibility (a11y) – any impact?
- [x] Changelog – is it needed?
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.

2 participants