Skip to content

Add tx decode/encode subcommands#1785

Merged
leighmcculloch merged 11 commits into
mainfrom
tx-decode
Sep 7, 2025
Merged

Add tx decode/encode subcommands#1785
leighmcculloch merged 11 commits into
mainfrom
tx-decode

Conversation

@leighmcculloch
Copy link
Copy Markdown
Member

@leighmcculloch leighmcculloch commented Dec 10, 2024

What

Add tx decode and encode subcommands.

Why

To make decoding tx's to JSON more discoverable and convenient. It's the most common XDR to want to decode.

Including encode for symmetry.

Dependent on:

@leighmcculloch leighmcculloch changed the title Add tx decode subcommand Add tx decode/encode subcommands Dec 10, 2024
@willemneal
Copy link
Copy Markdown
Contributor

I just had this same idea. This could be very useful for the tx edit functionality. E.g.

{
    "tx": {
      "tx": {
        "source_account":  "alice",
        "fee": 5000,
        "seq_num": 61499636711945,
        "cond": {
          "time": {
            "min_time": 0,
            "max_time": 1733772281
          }
        },
        "memo": {
          "text": "Load lumens"
        },
        "operations": [
          {
            "source_account": null,
            "body": {
              "payment": {
                "destination": "bob",
                "asset": "native", // could also handle `usdc:cicle` here
                "amount": 50000000
              }
            }
          }
        ],
        "ext": "v0"
      },
      "signatures": [
        {
          "hint": "26f802ad",
          "signature": "b26cde9fc068173241013279207343d17124488de0d44e43858faab093aca30efee4dbbce8a9fd96b11b7e36bd21db355c77fbe9bc2c493545b1bf19e31f5109"
        }
      ]
    }
  }

Perhaps we could add a tx update, which would then resolve all of the accounts and also maybe update the seq_num and fees?

@leighmcculloch
Copy link
Copy Markdown
Member Author

leighmcculloch commented Dec 11, 2024

Perhaps we could add a tx update, which would then resolve all of the accounts and also maybe update the seq_num and fees?

+1. Replying to this over here:

@leighmcculloch leighmcculloch marked this pull request as ready for review September 7, 2025 22:04
@leighmcculloch leighmcculloch enabled auto-merge (squash) September 7, 2025 22:13
@leighmcculloch leighmcculloch merged commit 5d66803 into main Sep 7, 2025
35 checks passed
@leighmcculloch leighmcculloch deleted the tx-decode branch September 7, 2025 22:37
@github-project-automation github-project-automation Bot moved this from Backlog (Not Ready) to Done in DevX Sep 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants