Skip to content

[FIX] TransactionRaw.toJson data serialization fix#30

Merged
mrtnetwork merged 1 commit into
mrtnetwork:mainfrom
KabaDH:fixes/transactionRaw-to-json-data-fix
Sep 17, 2025
Merged

[FIX] TransactionRaw.toJson data serialization fix#30
mrtnetwork merged 1 commit into
mrtnetwork:mainfrom
KabaDH:fixes/transactionRaw-to-json-data-fix

Conversation

@KabaDH

@KabaDH KabaDH commented Sep 17, 2025

Copy link
Copy Markdown
Contributor

Hi @mrtnetwork !
First of all, thanks again for the awesome Dart SDKs for working with blockchains — they are just 🔥

Description

Recently we faced an issue: when trying to send a transaction with the data field filled through the wallet/broadcasttransaction endpoint, it was rejected by the node.

Example with the node error

imgtrxfix

Problem

As you can see, here the data field is encoded in UTF-8, which leads to the node rejecting the transaction.
Instead, it must be encoded in hex.

Fix

Ensure that the data field inside raw_data is properly hex-encoded before broadcasting.

  • fix in TransactionRaw.toJson
  • tests updated

@mrtnetwork
mrtnetwork merged commit c38b8cd into mrtnetwork:main Sep 17, 2025
1 check passed
@mrtnetwork

Copy link
Copy Markdown
Owner

@KabaDH Thanks

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