Skip to content

Conversation

@AntonioCeppellini
Copy link
Member

Description:
This PR allows AccountCreateTransaction to accept both PrivateKey and PublicKey like the other SDKs.

  • Add support for using PrivateKey as key in AccountCreateTransaction
  • Now key setters accept Key = Union[PrivateKey, PublicKey]
  • Add _to_proto_key helper to correctly serialize PrivateKey as its corresponding PublicKey
  • Add _derive_evm_address helper to derive EVM aliases from PrivateKey and PublicKey
  • Add unit and integration tests

Related issue(s):

Fixes #939

Checklist

  • Documented (Code comments, README, etc.)
  • Tested (unit, integration, etc.)

@github-actions
Copy link

github-actions bot commented Dec 3, 2025

Hi, this is MergeConflictBot.
Your pull request cannot be merged because it contains merge conflicts.

Please resolve these conflicts locally and push the changes.

To assist you, please read:

Thank you for contributing!

From the Hiero Python SDK Team

@AntonioCeppellini AntonioCeppellini changed the title 939 account create transaction support private key feat: account create transaction support private key Dec 3, 2025
@github-actions
Copy link

github-actions bot commented Dec 3, 2025

Hi, this is WorkflowBot.
Your pull request cannot be merged as it is not passing all our workflow checks.
Please click on each check to review the logs and resolve issues so all checks pass.
To help you:

@exploreriii
Copy link
Contributor

@tech0priyanshu request review if available

@AntonioCeppellini AntonioCeppellini force-pushed the 939-AccountCreateTransaction-support-PrivateKey branch from af4c1c3 to 54cd7cf Compare December 3, 2025 17:18
@tech0priyanshu
Copy link
Contributor

@AntonioCeppellini @exploreriii Everything else looks good to me

@tech0priyanshu
Copy link
Contributor

@AntonioCeppellini please resolve your merge conflict . For additional help read merge conflict guide .

@AntonioCeppellini AntonioCeppellini force-pushed the 939-AccountCreateTransaction-support-PrivateKey branch from 96795ca to 5a5d67d Compare December 4, 2025 14:01
@AntonioCeppellini
Copy link
Member Author

AntonioCeppellini commented Dec 4, 2025

@AntonioCeppellini please resolve your merge conflict . For additional help read merge conflict guide .

@tech0priyanshu resolved, thank you! :D

@exploreriii
Copy link
Contributor

Request review @manishdait if available please

Copy link
Contributor

@manishdait manishdait left a comment

Choose a reason for hiding this comment

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

Hi @AntonioCeppellini, Just a small change, Rest looks good to me.

manishdait
manishdait previously approved these changes Dec 5, 2025
@nadineloepfe
Copy link
Contributor

@AntonioCeppellini: quick rebase pls and then that's ready to go! Thank you for your contribution

Copy link
Contributor

@exploreriii exploreriii left a comment

Choose a reason for hiding this comment

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

Hi @AntonioCeppellini
#946
we just merged, therefore, please refactor to use the utils 👍

…both PublicKey and PrivateKey, added unit and integration tests

Signed-off-by: Antonio Ceppellini <antonio.ceppellini@gmail.com>
… removed typo error

Signed-off-by: Antonio Ceppellini <antonio.ceppellini@gmail.com>
…h public and private

Signed-off-by: Antonio Ceppellini <antonio.ceppellini@gmail.com>
Signed-off-by: Antonio Ceppellini <antonio.ceppellini@gmail.com>
Signed-off-by: Antonio Ceppellini <antonio.ceppellini@gmail.com>
@AntonioCeppellini
Copy link
Member Author

@exploreriii i have removed the method to get the evm adress that i wrote because i saw that was already implemented in the class PublicKey .

Copy link
Contributor

@exploreriii exploreriii left a comment

Choose a reason for hiding this comment

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

Hi @AntonioCeppellini I think this is looking great, it may already be enough but it could be worth either in this or a separte issue expanding the test coverage and also adding examples

Signed-off-by: Antonio Ceppellini <antonio.ceppellini@gmail.com>
@AntonioCeppellini AntonioCeppellini marked this pull request as draft December 7, 2025 22:27
AntonioCeppellini and others added 3 commits December 7, 2025 23:30
…de duplication

Signed-off-by: Antonio Ceppellini <antonio.ceppellini@gmail.com>
Signed-off-by: AntonioCeppellini <128388022+AntonioCeppellini@users.noreply.github.com>
@AntonioCeppellini AntonioCeppellini marked this pull request as ready for review December 8, 2025 10:54
@exploreriii exploreriii merged commit 43ece01 into hiero-ledger:main Dec 8, 2025
14 checks passed
@exploreriii
Copy link
Contributor

Hi @AntonioCeppellini nice work! Merged!

I noticed your examples follow a similar style to the other account create alias

We should update these examples to be more modular, in my opinion

for example, you generally just have a set up client and then one final functionat the end - but that can have lots of different functionality, making it very difficult for a user - wanting examples - to understand how to do each part

if you agree, would you be able to help me create a couple of these good first issues (keep to one example per good first issue) to refactor these monolithic examples into more modular functions? for example, pulling out the account info query into its own function <-- also idea for @tech0priyanshu @MonaaEid @Akshat1931
Thank you

@AntonioCeppellini
Copy link
Member Author

Hi @AntonioCeppellini nice work! Merged!

I noticed your examples follow a similar style to the other account create alias

We should update these examples to be more modular, in my opinion

for example, you generally just have a set up client and then one final functionat the end - but that can have lots of different functionality, making it very difficult for a user - wanting examples - to understand how to do each part

if you agree, would you be able to help me create a couple of these good first issues (keep to one example per good first issue) to refactor these monolithic examples into more modular functions? for example, pulling out the account info query into its own function <-- also idea for @tech0priyanshu @MonaaEid @Akshat1931

Thank you

Yes, I agree with you, I will help you crate some good first issues :D @exploreriii

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.

Allow AccountCreateTransaction to Support PrivateKey

5 participants