-
Notifications
You must be signed in to change notification settings - Fork 92
feat: implement account creation with EVM-style alias transaction #922
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
base: main
Are you sure you want to change the base?
Changes from all commits
3418206
a2a2087
d08f2b4
90248d9
5152e6e
c8ac3aa
1c49004
c10d99d
3a22283
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -11,6 +11,8 @@ This changelog is based on [Keep a Changelog](https://keepachangelog.com/en/1.1. | |||||
| - Added docs/sdk_developers/training/setup: a training to set up as a developer to the python sdk | ||||||
| - Add example demonstrating usage of `CustomFeeLimit` in `examples/transaction/custom_fee_limit.py` | ||||||
| - Added `.github/workflows/merge-conflict-bot.yml` to automatically detect and notify users of merge conflicts in Pull Requests. | ||||||
| - Added `.github/workflows/bot-office-hours.yml` to automate the Weekly Office Hour Reminder. | ||||||
| - feat: Implement account creation with EVM-style alias transaction example. | ||||||
|
||||||
| - feat: Implement account creation with EVM-style alias transaction example. | |
| - Add example demonstrating account creation with EVM-style alias transaction in `examples/account/create_account_with_alias_transaction.py` |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,115 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # uv run examples/account/account_create_transaction_evm_alias.py | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # python examples/account/account_create_transaction_evm_alias.py | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| """ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Example: Create an account using an EVM-style alias (evm_address). | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Example: Create an account using an EVM-style alias (evm_address). | |
| Example: Create a Hedera account using an EVM-style alias (evm_address). | |
| This example demonstrates how to: | |
| - Generate a new ECDSA key pair. | |
| - Derive an EVM-compatible address (alias) from the public key. | |
| - Create a new Hedera account using the EVM address as an alias. | |
| - Query and display the account information, including the contract account ID (alias). | |
| Features showcased: | |
| - ECDSA key generation | |
| - EVM aliasing (evm_address) | |
| - Account creation with alias | |
| - Account info query | |
| Usage: | |
| uv run examples/account/create_account_with_alias_transaction.py | |
| python examples/account/create_account_with_alias_transaction.py | |
| Required environment variables (set in a .env file or your environment): | |
| - OPERATOR_ID: The account ID of the operator (payer) account. | |
| - OPERATOR_KEY: The private key of the operator account. | |
| - NETWORK: (Optional) The Hedera network to use (default: testnet). | |
| - KEY_TYPE: (Optional) The key type to use for the new account (default: ecdsa). | |
| Expected outcome: | |
| - A new Hedera account is created with an EVM-style alias. | |
| - The script outputs the new account ID, EVM address, and detailed account information. | |
| - The contract account ID (alias) is displayed if available. |
Copilot
AI
Nov 28, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The docstring "Setup Client " is incomplete and lacks detail. Following the pattern in account_create_transaction.py, consider expanding this to document:
- What the function does (connects to network, configures operator)
- Return type and what's returned
- Exceptions that may be raised
- Required environment variables
Also note the trailing space in "Client " which should be removed.
| """Setup Client """ | |
| """ | |
| Set up and return a Hedera Client configured for the specified network and operator. | |
| This function connects to the Hedera network specified by the NETWORK environment variable, | |
| and configures the client with the operator account and private key from the environment. | |
| Returns: | |
| Client: A configured Hedera Client instance. | |
| Raises: | |
| SystemExit: If required environment variables are missing or invalid. | |
| Required Environment Variables: | |
| - OPERATOR_ID: The account ID of the operator (payer) account. | |
| - OPERATOR_KEY: The private key of the operator account. | |
| - NETWORK: The Hedera network to connect to (e.g., 'testnet', 'mainnet', 'previewnet'). Defaults to 'testnet'. | |
| - KEY_TYPE: The type of key to use (e.g., 'ecdsa'). Defaults to 'ecdsa'. | |
| """ |
Copilot
AI
Nov 28, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing whitespace after "Client".
| """Setup Client """ | |
| """Setup Client""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing whitespace at the end of the line.