Skip to content
This repository was archived by the owner on Oct 17, 2025. It is now read-only.

Commit d737357

Browse files
authored
Merge pull request #1212 from hirosystems/release/memo-warnings
Release/memo warnings
2 parents c99e4af + f2df060 commit d737357

File tree

5 files changed

+24
-8
lines changed

5 files changed

+24
-8
lines changed

.github/workflows/debug-build.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ jobs:
9292

9393
- uses: actions/setup-python@v4
9494
with:
95-
python-version: '2.7.18'
9695
architecture: x64
9796

9897
#

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
## [4.10.1-dev.1](https://github.com/blockstack/stacks-wallet/compare/v4.10.0...v4.10.1-dev.1) (2023-06-22)
2+
3+
4+
### Bug Fixes
5+
6+
* only show memo for sent transactions ([bbfeb04](https://github.com/blockstack/stacks-wallet/commit/bbfeb0498f63da50a3ff7141d225f8f13e694071))
7+
18
# [4.10.0](https://github.com/blockstack/stacks-wallet/compare/v4.9.1...v4.10.0) (2023-05-25)
29

310

app/components/home/transaction-list/transaction-list-item.tsx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import {
2121
isDelegatedStackingTx,
2222
inferSendManyTransferOperation,
2323
isSendManyTx,
24+
getMemoForTx,
2425
} from '@utils/tx-utils';
2526
import { toHumanReadableStx } from '@utils/unit-convert';
2627
import React, {
@@ -106,12 +107,8 @@ export const TransactionListItem: FC<TransactionListItemProps> = props => {
106107
}, [direction, poxInfo?.contract_id, tx]);
107108

108109
const sumPrefix = direction === 'sent' && !isStackingTx(tx, poxInfo?.contract_id) ? '−' : '';
109-
const memo =
110-
tx.tx_type === 'token_transfer' &&
111-
Buffer.from(
112-
tx.token_transfer.memo.replace('0x', '').replace(/^(0{2})+|(0{2})+$/g, ''),
113-
'hex'
114-
).toString('utf8');
110+
const memo = getMemoForTx(tx, direction);
111+
115112
const txDate = new Date(tx.burn_block_time_iso || (tx as any).parent_burn_block_time_iso);
116113
const txDateShort = txDate.toLocaleString();
117114

app/utils/tx-utils.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,3 +112,16 @@ export const truncateMiddle = (input: string, offset = 5): string => {
112112
return `${start}${end}`;
113113
}
114114
};
115+
116+
export const getMemoForTx = (tx: Transaction, direction: StxTxDirection) => {
117+
if (tx.tx_type !== 'token_transfer' || direction !== 'sent') {
118+
return undefined;
119+
}
120+
121+
const utf8Memo = Buffer.from(
122+
tx.token_transfer.memo.replace('0x', '').replace(/^(0{2})+|(0{2})+$/g, ''),
123+
'hex'
124+
).toString('utf8');
125+
126+
return utf8Memo;
127+
};

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "stacks-wallet",
3-
"version": "4.10.0",
3+
"version": "4.10.1-dev.1",
44
"description": "Hiro Wallet 2.0 — Stacking",
55
"prettier": "@stacks/prettier-config",
66
"homepage": "https://hiro.so/wallet",

0 commit comments

Comments
 (0)