Skip to content

feat(cli): add --sender flag for transactions #6777

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 23 commits into from
Jul 3, 2025

Conversation

arjanjohan
Copy link
Contributor

@arjanjohan arjanjohan commented May 6, 2025

Description of change

Add an option --sender to iota client to set a custom sender when creating a transaction.

$ iota client call -h
Call Move function

Usage: iota client call [OPTIONS] --package <PACKAGE> --module <MODULE> --function <FUNCTION>

Options:
      --package <PACKAGE>               Object ID of the package, which contains the module
      --module <MODULE>                 The name of the module in the package
      --function <FUNCTION>             Function name in module
      --type-args <TYPE_ARGS>...        Type arguments to the generic function being called. All must be specified, or the call will fail
      --args <ARGS>...                  Simplified ordered args like in the function syntax ObjectIDs, Addresses must be hex strings
      --gas <GAS>                       ID of the gas object for gas payment. If not provided, a gas object with at least gas_budget value will be selected
      --gas-budget <GAS_BUDGET>         An optional gas budget for this transaction (in NANOS). If gas budget is not provided, the tool will first perform a dry run to estimate the gas cost, and then it will execute the
                                        transaction. Please note that this incurs a small cost in performance due to the additional dry run call
      --dry-run                         Perform a dry run of the transaction, without executing it
      --dev-inspect                     Perform a dev inspect of the transaction, without executing it
      --serialize-unsigned-transaction  Instead of executing the transaction, serialize the bcs bytes of the unsigned transaction data (TransactionData) using base64 encoding, and print out the string <TX_BYTES>. The
                                        string can be used to execute transaction with `iota client execute-signed-tx --tx-bytes <TX_BYTES>`
      --serialize-signed-transaction    Instead of executing the transaction, serialize the bcs bytes of the signed transaction data (SenderSignedData) using base64 encoding, and print out the string <SIGNED_TX_BYTES>.
                                        The string can be used to execute transaction with `iota client execute-combined-signed-tx --signed-tx-bytes <SIGNED_TX_BYTES>`
      --sender <SENDER>   Set the sender to this address instead of the active address.
      --display [<DISPLAY>...]          Select which fields of the response to display. If not provided, all fields are displayed. The fields are: input, effects, events, object_changes, balance_changes [default:
                                        input,effects,events,object_changes,balance_changes]
      --json                            Return command outputs in json format
  -h, --help                            Print help
  -V, --version                         Print version

For a hackathon project we built a CLI tool to interact with the IOTA multisig. Under the hood it uses the IOTA CLI, but setting a custom signer on transactions made it impossible to create multisig transactions. See project here.

Links to any relevant issues

  • The IOTA docs on working with multisigs instruct users to create multisig transactions using the IOTA CLI. But these transactions cannot be executed from a multisig, since the signer will be the active address and not the multisig.

Type of change

  • Enhancement (a non-breaking change which adds functionality)

How the change has been tested

Describe the tests that you ran to verify your changes.

In our hackathon project this version of the IOTA CLI is used to creating and executing multisig transactions.

Make sure to provide instructions for the maintainer as well as any relevant configurations.

  • Basic tests (linting, compilation, formatting, unit/integration tests)
  • Patch-specific tests (correctness, functionality coverage)

Change checklist

Tick the boxes that are relevant to your changes, and delete any items that are not.

  • I have followed the contribution guidelines for this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • I have checked that new and existing unit tests pass locally with my changes

Release Notes

  • Protocol:
  • Nodes (Validators and Full nodes):
  • Indexer:
  • JSON-RPC:
  • GraphQL:
  • CLI: Add --sender option to iota client call and iota client ptb commands, allowing users to override the default sender address when creating transactions. This enables compatibility with multisig workflows that require specifying a custom sender.
  • Rust SDK:
  • REST API:

@arjanjohan arjanjohan requested a review from a team as a code owner May 6, 2025 19:41
Copy link

vercel bot commented May 6, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
apps-backend ⬜️ Ignored (Inspect) Visit Preview Jul 3, 2025 9:17am
apps-ui-kit ⬜️ Ignored (Inspect) Visit Preview Jul 3, 2025 9:17am

Copy link

vercel bot commented May 6, 2025

@arjanjohan is attempting to deploy a commit to the IOTA Foundation Team on Vercel.

A member of the Team first needs to authorize it.

@arjanjohan arjanjohan requested a review from a team as a code owner May 7, 2025 05:40
@github-actions github-actions bot added the documentation Improvements or additions to documentation label May 7, 2025
@thibault-martinez thibault-martinez added the dev-tools Issues related to the Developer Tools Team label May 7, 2025
@DaughterOfMars
Copy link
Contributor

Mind making the release note a bit more descriptive?

@arjanjohan
Copy link
Contributor Author

Mind making the release note a bit more descriptive?

I just updated the release not

@arjanjohan arjanjohan closed this May 14, 2025
@arjanjohan arjanjohan deleted the custom-sender-cli branch May 14, 2025 19:27
@arjanjohan arjanjohan restored the custom-sender-cli branch May 18, 2025 19:42
@arjanjohan arjanjohan reopened this May 18, 2025
@Thoralf-M Thoralf-M changed the title feat(cli) add --custom_signer flag for transactions feat(cli) add --sender flag for transactions Jun 16, 2025
@Thoralf-M Thoralf-M changed the title feat(cli) add --sender flag for transactions feat(cli): add --sender flag for transactions Jun 16, 2025
Copy link
Member

@Thoralf-M Thoralf-M left a comment

Choose a reason for hiding this comment

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

Thanks for the PR!

@thibault-martinez
Copy link
Member

Hello, are you planning on applying this patch from SUI? MystenLabs/sui#22302

@arjanjohan
Copy link
Contributor Author

Hello, are you planning on applying this patch from SUI? MystenLabs/sui#22302

Hi, I just applied part of this patch (removing sender_set) to this PR. The description was already updated here.

Copy link
Member

@thibault-martinez thibault-martinez left a comment

Choose a reason for hiding this comment

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

Please fix the compilation issue (see clippy CI) 🙏🏻

@thibault-martinez
Copy link
Member

Thank you 🙏🏻

@alexsporn alexsporn merged commit c61f0e5 into iotaledger:develop Jul 3, 2025
33 of 38 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dev-tools Issues related to the Developer Tools Team documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants