Skip to content

fix(sdk-coin-ton): expose memo from TON transfer transactions#9338

Draft
bitgo-ai-agent-dev[bot] wants to merge 1 commit into
masterfrom
coins-1247-ton-deposit-memo
Draft

fix(sdk-coin-ton): expose memo from TON transfer transactions#9338
bitgo-ai-agent-dev[bot] wants to merge 1 commit into
masterfrom
coins-1247-ton-deposit-memo

Conversation

@bitgo-ai-agent-dev

Copy link
Copy Markdown

What

  • Add optional memoId field to TxData interface in iface.ts
  • Populate memoId in Transaction.toJson() from this.message when the transaction type is a plain Send transfer (guarded against structured opcode payloads)
  • Propagate memo into inputs/outputs entries in parseTransaction() in ton.ts
  • Extract action.memo from WASM-parsed send actions in explainTransactionWasm.ts and include it in output objects
  • Add signedSendTransactionWithNumericMemo test fixture and a parseTransaction test asserting the memo is correctly returned

Why

Bullish reported (support ticket #369734) that TON deposits with an on-chain text comment returned memoId=null in the BitGo transfer response. On the TON blockchain, text comments encoded in transaction bodies are the standard way to route deposits to the correct customer account. Without the memo being propagated through the SDK's parsed transaction output, integrators cannot credit the depositing user, causing stuck/unattributed funds.

The root cause was that Transaction.toJson() never surfaced the message field (which holds the parsed text comment), and parseTransaction() in ton.ts only returned address and amount in its inputs/outputs entries — the memo was silently dropped.

Test plan

  • Existing 134 unit tests pass
  • New test: should parse a TON transfer transaction with numeric memo (memoId) verifies that parseTransaction() returns memo: '572826509' in both inputs and outputs for a transfer with a numeric text comment
  • Withdraw/staking transaction types are unaffected — memoId is only populated for TransactionType.Send

Ticket: COINS-1247

Include the on-chain text comment (used as routing memoId) in the
parsed transaction output for TON transfers.

- Add optional `memoId` field to `TxData` interface in `iface.ts`
- Populate `memoId` in `Transaction.toJson()` from `this.message`
  when transaction type is a plain `Send` transfer
- Propagate `memo` into `inputs`/`outputs` entries in the
  `parseTransaction()` method in `ton.ts`
- Extract `action.memo` from WASM-parsed send actions in
  `explainTransactionWasm.ts` and include it in output objects

Without this fix, TON deposit transfers with a text comment
(e.g. a customer's routing memoId like 572826509) returned
`memoId=null` in the BitGo transfer response, making it impossible
for Bullish and other integrators to credit the depositing user.

Ticket: COINS-1247
Session-Id: f01b1f1e-d256-4604-bfdb-c17205eda6f3
Task-Id: 6eefbcbb-ceb1-4c13-b32f-be3cc12e6c2c
@linear-code

linear-code Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

COINS-1247

@bitgo-ai-agent-dev
bitgo-ai-agent-dev Bot force-pushed the coins-1247-ton-deposit-memo branch from 8ee8c15 to 8ddf8ae Compare July 23, 2026 02:46
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.

0 participants