From 2ed9613a0bf6a4ca627e7869a990d2ef7c2d7a9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thoralf=20M=C3=BCller?= Date: Wed, 6 Sep 2023 11:36:38 +0200 Subject: [PATCH 1/2] Python: rename alias to account --- .../python/examples/client/build_alias.py | 10 ++--- .../python/examples/client/build_foundry.py | 4 +- .../examples/exchange/1_create_account.py | 2 +- .../examples/exchange/3_check_balance.py | 2 +- .../examples/exchange/4_listen_events.py | 2 +- .../python/examples/exchange/5_send_amount.py | 2 +- .../{alias => account_output}/create.py | 4 +- .../{alias => account_output}/destroy.py | 8 ++-- .../how_tos/account_wallet/request_funds.py | 38 +++++++++++++++++++ .../transaction.py | 24 ++++++------ .../how_tos/alias_wallet/request_funds.py | 38 ------------------- .../examples/how_tos/native_tokens/create.py | 10 ++--- .../how_tos/outputs/unlock_conditions.py | 14 +++---- .../python/examples/wallet/create_alias.py | 4 +- bindings/python/iota_sdk/__init__.py | 2 +- .../iota_sdk/client/_node_indexer_api.py | 24 ++++++------ bindings/python/iota_sdk/client/_utils.py | 8 ++-- bindings/python/iota_sdk/client/client.py | 38 +++++++++---------- bindings/python/iota_sdk/types/address.py | 14 +++---- bindings/python/iota_sdk/types/balance.py | 8 ++-- bindings/python/iota_sdk/types/burn.py | 14 +++---- bindings/python/iota_sdk/types/feature.py | 6 +-- .../python/iota_sdk/types/filter_options.py | 2 +- bindings/python/iota_sdk/types/output.py | 34 ++++++++--------- bindings/python/iota_sdk/types/output_data.py | 8 ++-- bindings/python/iota_sdk/types/payload.py | 4 +- bindings/python/iota_sdk/types/send_params.py | 16 ++++---- .../python/iota_sdk/types/transaction_data.py | 10 ++--- bindings/python/iota_sdk/types/unlock.py | 8 ++-- .../python/iota_sdk/types/unlock_condition.py | 26 ++++++------- bindings/python/iota_sdk/utils.py | 24 ++++++------ bindings/python/iota_sdk/wallet/account.py | 24 ++++++------ .../python/iota_sdk/wallet/sync_options.py | 24 ++++++------ bindings/python/tests/test_block.py | 2 +- bindings/python/tests/test_output.py | 22 +++++------ 35 files changed, 241 insertions(+), 239 deletions(-) rename bindings/python/examples/how_tos/{alias => account_output}/create.py (80%) rename bindings/python/examples/how_tos/{alias => account_output}/destroy.py (71%) create mode 100644 bindings/python/examples/how_tos/account_wallet/request_funds.py rename bindings/python/examples/how_tos/{alias_wallet => account_wallet}/transaction.py (62%) delete mode 100644 bindings/python/examples/how_tos/alias_wallet/request_funds.py diff --git a/bindings/python/examples/client/build_alias.py b/bindings/python/examples/client/build_alias.py index f9112674d8..bb39ce8eb5 100644 --- a/bindings/python/examples/client/build_alias.py +++ b/bindings/python/examples/client/build_alias.py @@ -13,7 +13,7 @@ hexAddress = Utils.bech32_to_hex( 'rms1qpllaj0pyveqfkwxmnngz2c488hfdtmfrj3wfkgxtk4gtyrax0jaxzt70zy') -alias_id = '0x0000000000000000000000000000000000000000000000000000000000000000' +account_id = '0x0000000000000000000000000000000000000000000000000000000000000000' state_metadata = data = utf8_to_hex('Hello, World!') unlock_conditions = [ StateControllerAddressUnlockCondition(Ed25519Address(hexAddress)), @@ -28,9 +28,9 @@ MetadataFeature(utf8_to_hex('Hello, World!')) ] -# Build alias output -alias_output = client.build_alias_output( - alias_id=alias_id, +# Build account output +account_output = client.build_account_output( + account_id=account_id, state_metadata=state_metadata, unlock_conditions=unlock_conditions, features=features, @@ -38,4 +38,4 @@ ) # Print the output -print(json.dumps(alias_output.to_dict(), indent=4)) +print(json.dumps(account_output.to_dict(), indent=4)) diff --git a/bindings/python/examples/client/build_foundry.py b/bindings/python/examples/client/build_foundry.py index 45a47c17c3..87fdf334a8 100644 --- a/bindings/python/examples/client/build_foundry.py +++ b/bindings/python/examples/client/build_foundry.py @@ -15,8 +15,8 @@ serial_number = 1 token_scheme = SimpleTokenScheme(32, 0, 64) unlock_conditions = [ - ImmutableAliasAddressUnlockCondition( - AliasAddress( + ImmutableAccountAddressUnlockCondition( + AccountAddress( '0xa5c28d5baa951de05e375fb19134ea51a918f03acc2d0cee011a42b298d3effa') ) ] diff --git a/bindings/python/examples/exchange/1_create_account.py b/bindings/python/examples/exchange/1_create_account.py index 2ab4707e80..c7fcf281da 100644 --- a/bindings/python/examples/exchange/1_create_account.py +++ b/bindings/python/examples/exchange/1_create_account.py @@ -39,7 +39,7 @@ account = wallet.create_account('Alice') # Set sync_only_most_basic_outputs to True if not interested in outputs that are timelocked, -# have a storage deposit return, expiration or are nft/alias/foundry outputs. +# have a storage deposit return, expiration or are nft/account/foundry outputs. account.set_default_sync_options( SyncOptions(sync_only_most_basic_outputs=True)) diff --git a/bindings/python/examples/exchange/3_check_balance.py b/bindings/python/examples/exchange/3_check_balance.py index c5a3430e1c..a7d0ebd4f5 100644 --- a/bindings/python/examples/exchange/3_check_balance.py +++ b/bindings/python/examples/exchange/3_check_balance.py @@ -22,7 +22,7 @@ print(f'Addresses:', addresses) # Set sync_only_most_basic_outputs to True if not interested in outputs that are timelocked, -# have a storage deposit return, expiration or are nft/alias/foundry outputs. +# have a storage deposit return, expiration or are nft/account/foundry outputs. balance = account.sync(SyncOptions(sync_only_most_basic_outputs=True)) print('Balance', balance) diff --git a/bindings/python/examples/exchange/4_listen_events.py b/bindings/python/examples/exchange/4_listen_events.py index d466d2d600..68a25aa6c9 100644 --- a/bindings/python/examples/exchange/4_listen_events.py +++ b/bindings/python/examples/exchange/4_listen_events.py @@ -52,6 +52,6 @@ def callback(event): # Sync to detect new outputs # Set sync_only_most_basic_outputs to True if not interested in outputs that are timelocked, - # have a storage deposit return , expiration or are nft/alias/foundry + # have a storage deposit return , expiration or are nft/account/foundry # outputs. account.sync(SyncOptions(sync_only_most_basic_outputs=True)) diff --git a/bindings/python/examples/exchange/5_send_amount.py b/bindings/python/examples/exchange/5_send_amount.py index 14e0426bcc..9853dbf4d5 100644 --- a/bindings/python/examples/exchange/5_send_amount.py +++ b/bindings/python/examples/exchange/5_send_amount.py @@ -25,7 +25,7 @@ wallet.set_stronghold_password(os.environ["STRONGHOLD_PASSWORD"]) # Set sync_only_most_basic_outputs to True if not interested in outputs that are timelocked, -# have a storage deposit return, expiration or are nft/alias/foundry outputs. +# have a storage deposit return, expiration or are nft/account/foundry outputs. balance = account.sync(SyncOptions(sync_only_most_basic_outputs=True)) print('Balance', balance) diff --git a/bindings/python/examples/how_tos/alias/create.py b/bindings/python/examples/how_tos/account_output/create.py similarity index 80% rename from bindings/python/examples/how_tos/alias/create.py rename to bindings/python/examples/how_tos/account_output/create.py index 693007a271..fe216b636a 100644 --- a/bindings/python/examples/how_tos/alias/create.py +++ b/bindings/python/examples/how_tos/account_output/create.py @@ -4,7 +4,7 @@ load_dotenv() -# In this example we will create an alias ouput +# In this example we will create an account output wallet = Wallet(os.environ['WALLET_DB_PATH']) @@ -19,5 +19,5 @@ wallet.set_stronghold_password(os.environ["STRONGHOLD_PASSWORD"]) # Send transaction. -transaction = account.prepare_create_alias_output(None, None).send() +transaction = account.prepare_create_account_output(None, None).send() print(f'Block sent: {os.environ["EXPLORER_URL"]}/block/{transaction.block_id}') diff --git a/bindings/python/examples/how_tos/alias/destroy.py b/bindings/python/examples/how_tos/account_output/destroy.py similarity index 71% rename from bindings/python/examples/how_tos/alias/destroy.py rename to bindings/python/examples/how_tos/account_output/destroy.py index 4c63770ff9..b45da420f7 100644 --- a/bindings/python/examples/how_tos/alias/destroy.py +++ b/bindings/python/examples/how_tos/account_output/destroy.py @@ -4,7 +4,7 @@ load_dotenv() -# In this example we will destroy an alias output +# In this example we will destroy an account output wallet = Wallet(os.environ['WALLET_DB_PATH']) @@ -13,8 +13,8 @@ # Sync account with the node balance = account.sync() -# We try to destroy the first alias in the account -alias_id = balance.aliases[0] +# We try to destroy the first account in the account +account_id = balance.accounts[0] if 'STRONGHOLD_PASSWORD' not in os.environ: raise Exception(".env STRONGHOLD_PASSWORD is undefined, see .env.example") @@ -22,5 +22,5 @@ wallet.set_stronghold_password(os.environ["STRONGHOLD_PASSWORD"]) # Send transaction. -transaction = account.prepare_destroy_alias(alias_id).send() +transaction = account.prepare_destroy_account(account_id).send() print(f'Block sent: {os.environ["EXPLORER_URL"]}/block/{transaction.block_id}') diff --git a/bindings/python/examples/how_tos/account_wallet/request_funds.py b/bindings/python/examples/how_tos/account_wallet/request_funds.py new file mode 100644 index 0000000000..7c5d17a8a8 --- /dev/null +++ b/bindings/python/examples/how_tos/account_wallet/request_funds.py @@ -0,0 +1,38 @@ +from iota_sdk import Wallet, Utils, SyncOptions, AccountSyncOptions +from dotenv import load_dotenv +import os +import time + +# In this example we request funds to an account wallet. + +load_dotenv() + +FAUCET_URL = os.environ.get( + 'FAUCET_URL', 'https://faucet.testnet.shimmer.network/api/enqueue') + +wallet = Wallet(os.environ['WALLET_DB_PATH']) + +account = wallet.get_account('Alice') +balance = account.sync(None) + +total_base_token_balance = balance.base_coin.total +print( + f'Balance before requesting funds on account address: {total_base_token_balance}') + +account_id = balance.accounts[0] +print(f'Account Id: {account_id}') + +# Get Account address +account_address = Utils.account_id_to_bech32( + account_id, wallet.get_client().get_bech32_hrp()) +faucet_response = wallet.get_client().request_funds_from_faucet( + FAUCET_URL, account_address) +print(faucet_response) + +time.sleep(10) + +sync_options = SyncOptions(alias=AccountSyncOptions(basic_outputs=True)) + +total_base_token_balance = account.sync(sync_options).base_coin.total +print( + f'Balance after requesting funds on account address: {total_base_token_balance}') diff --git a/bindings/python/examples/how_tos/alias_wallet/transaction.py b/bindings/python/examples/how_tos/account_wallet/transaction.py similarity index 62% rename from bindings/python/examples/how_tos/alias_wallet/transaction.py rename to bindings/python/examples/how_tos/account_wallet/transaction.py index eab6e73a91..c518d10885 100644 --- a/bindings/python/examples/how_tos/alias_wallet/transaction.py +++ b/bindings/python/examples/how_tos/account_wallet/transaction.py @@ -1,12 +1,12 @@ -from iota_sdk import Wallet, Utils, NodeIndexerAPI, SyncOptions, AliasSyncOptions, SendParams +from iota_sdk import Wallet, Utils, NodeIndexerAPI, SyncOptions, AccountSyncOptions, SendParams from dotenv import load_dotenv import os -# In this example we send funds from an alias wallet. +# In this example we send funds from an account wallet. load_dotenv() -sync_options = SyncOptions(alias=AliasSyncOptions(basic_outputs=True)) +sync_options = SyncOptions(alias=AccountSyncOptions(basic_outputs=True)) wallet = Wallet(os.environ['WALLET_DB_PATH']) @@ -20,17 +20,17 @@ balance = account.sync(sync_options) total_base_token_balance = balance.base_coin.total -print(f'Balance before sending funds from alias: {total_base_token_balance}') +print(f'Balance before sending funds from account: {total_base_token_balance}') -alias_id = balance.aliases[0] -print(f'Alias Id: {alias_id}') +account_id = balance.accounts[0] +print(f'Account Id: {account_id}') -# Get alias address -alias_address = Utils.alias_id_to_bech32( - alias_id, wallet.get_client().get_bech32_hrp()) +# Get account address +account_address = Utils.account_id_to_bech32( + account_id, wallet.get_client().get_bech32_hrp()) -# Find first output unlockable by the alias address -query_parameters = NodeIndexerAPI.QueryParameters(alias_address) +# Find first output unlockable by the account address +query_parameters = NodeIndexerAPI.QueryParameters(account_address) input = wallet.get_client().basic_output_ids(query_parameters).items[0] params = [SendParams( @@ -47,4 +47,4 @@ f'Transaction with custom input: https://explorer.shimmer.network/testnet/transaction/{transaction.transaction_id}') total_base_token_balance = account.sync(sync_options).base_coin.total -print(f'Balance after sending funds from alias: {total_base_token_balance}') +print(f'Balance after sending funds from account: {total_base_token_balance}') diff --git a/bindings/python/examples/how_tos/alias_wallet/request_funds.py b/bindings/python/examples/how_tos/alias_wallet/request_funds.py deleted file mode 100644 index d0104694fe..0000000000 --- a/bindings/python/examples/how_tos/alias_wallet/request_funds.py +++ /dev/null @@ -1,38 +0,0 @@ -from iota_sdk import Wallet, Utils, SyncOptions, AliasSyncOptions -from dotenv import load_dotenv -import os -import time - -# In this example we request funds to an alias wallet. - -load_dotenv() - -FAUCET_URL = os.environ.get( - 'FAUCET_URL', 'https://faucet.testnet.shimmer.network/api/enqueue') - -wallet = Wallet(os.environ['WALLET_DB_PATH']) - -account = wallet.get_account('Alice') -balance = account.sync(None) - -total_base_token_balance = balance.base_coin.total -print( - f'Balance before requesting funds on alias address: {total_base_token_balance}') - -alias_id = balance.aliases[0] -print(f'Alias Id: {alias_id}') - -# Get Alias address -alias_address = Utils.alias_id_to_bech32( - alias_id, wallet.get_client().get_bech32_hrp()) -faucet_response = wallet.get_client().request_funds_from_faucet( - FAUCET_URL, alias_address) -print(faucet_response) - -time.sleep(10) - -sync_options = SyncOptions(alias=AliasSyncOptions(basic_outputs=True)) - -total_base_token_balance = account.sync(sync_options).base_coin.total -print( - f'Balance after requesting funds on alias address: {total_base_token_balance}') diff --git a/bindings/python/examples/how_tos/native_tokens/create.py b/bindings/python/examples/how_tos/native_tokens/create.py index dd7da9c1b5..df0f19d715 100644 --- a/bindings/python/examples/how_tos/native_tokens/create.py +++ b/bindings/python/examples/how_tos/native_tokens/create.py @@ -18,12 +18,12 @@ # Sync account with the node balance = account.sync() -# We can first check if we already have an alias in our account, because -# an alias can have many foundry outputs and therefore we can reuse an +# We can first check if we already have an account in our account, because +# an account can have many foundry outputs and therefore we can reuse an # existing one. -if not balance.aliases: - # If we don't have an alias, we need to create one - transaction = account.prepare_create_alias_output(None, None).send() +if not balance.accounts: + # If we don't have an account, we need to create one + transaction = account.prepare_create_account_output(None, None).send() print(f'Transaction sent: {transaction.transaction_id}') # Wait for transaction to get included diff --git a/bindings/python/examples/how_tos/outputs/unlock_conditions.py b/bindings/python/examples/how_tos/outputs/unlock_conditions.py index f4cd649d7e..5e1447ba63 100644 --- a/bindings/python/examples/how_tos/outputs/unlock_conditions.py +++ b/bindings/python/examples/how_tos/outputs/unlock_conditions.py @@ -9,7 +9,7 @@ hex_address = Utils.bech32_to_hex( 'rms1qpllaj0pyveqfkwxmnngz2c488hfdtmfrj3wfkgxtk4gtyrax0jaxzt70zy') -alias_hex_address = Utils.bech32_to_hex( +account_hex_address = Utils.bech32_to_hex( 'rms1pr59qm43mjtvhcajfmupqf23x29llam88yecn6pyul80rx099krmv2fnnux') address_unlock_condition = AddressUnlockCondition( @@ -58,8 +58,8 @@ outputs.append(basic_output) # Output with governor and state controller unlock condition -alias_output = client.build_alias_output( - alias_id='0x0000000000000000000000000000000000000000000000000000000000000000', +account_output = client.build_account_output( + account_id='0x0000000000000000000000000000000000000000000000000000000000000000', unlock_conditions=[ GovernorAddressUnlockCondition( Ed25519Address(hex_address), @@ -69,15 +69,15 @@ ), ], ) -outputs.append(alias_output) +outputs.append(account_output) -# Output with immutable alias unlock condition +# Output with immutable account unlock condition foundry_output = client.build_foundry_output( serial_number=1, token_scheme=token_scheme, unlock_conditions=[ - ImmutableAliasAddressUnlockCondition( - AliasAddress(alias_hex_address), + ImmutableAccountAddressUnlockCondition( + AccountAddress(account_hex_address), ), ], ) diff --git a/bindings/python/examples/wallet/create_alias.py b/bindings/python/examples/wallet/create_alias.py index d7376fb137..fe216b636a 100644 --- a/bindings/python/examples/wallet/create_alias.py +++ b/bindings/python/examples/wallet/create_alias.py @@ -4,7 +4,7 @@ load_dotenv() -# In this example we will create an alias output +# In this example we will create an account output wallet = Wallet(os.environ['WALLET_DB_PATH']) @@ -19,5 +19,5 @@ wallet.set_stronghold_password(os.environ["STRONGHOLD_PASSWORD"]) # Send transaction. -transaction = account.prepare_create_alias_output(None, None).send() +transaction = account.prepare_create_account_output(None, None).send() print(f'Block sent: {os.environ["EXPLORER_URL"]}/block/{transaction.block_id}') diff --git a/bindings/python/iota_sdk/__init__.py b/bindings/python/iota_sdk/__init__.py index 8371099ee9..d59e9e0a47 100644 --- a/bindings/python/iota_sdk/__init__.py +++ b/bindings/python/iota_sdk/__init__.py @@ -7,7 +7,7 @@ from .utils import Utils from .wallet.wallet import Wallet, Account from .wallet.common import WalletError -from .wallet.sync_options import AccountSyncOptions, AliasSyncOptions, NftSyncOptions, SyncOptions +from .wallet.sync_options import AccountSyncOptions, AccountSyncOptions, NftSyncOptions, SyncOptions from .secret_manager.secret_manager import * from .prefix_hex import * from .types.address import * diff --git a/bindings/python/iota_sdk/client/_node_indexer_api.py b/bindings/python/iota_sdk/client/_node_indexer_api.py index 47f0c9eba0..5d7127b554 100644 --- a/bindings/python/iota_sdk/client/_node_indexer_api.py +++ b/bindings/python/iota_sdk/client/_node_indexer_api.py @@ -20,8 +20,8 @@ class QueryParameters: **Attributes:** address : Bech32-encoded address that should be searched for. - alias_address : - Filter foundry outputs based on bech32-encoded address of the controlling alias. + account_address : + Filter foundry outputs based on bech32-encoded address of the controlling account. created_after : Returns outputs that were created after a certain Unix timestamp. created_before : @@ -69,7 +69,7 @@ class QueryParameters: Returns outputs that are timelocked before a certain Unix timestamp. """ address: Optional[str] = None - alias_address: Optional[str] = None + account_address: Optional[str] = None created_after: Optional[int] = None created_before: Optional[int] = None cursor: Optional[str] = None @@ -122,29 +122,29 @@ def basic_output_ids( }) return self.OutputIdsResponse(response) - def alias_output_ids( + def account_output_ids( self, query_parameters: QueryParameters) -> OutputIdsResponse: - """Fetch alias output IDs from the given query parameters. + """Fetch account output IDs from the given query parameters. Returns: - The corresponding output IDs of the alias outputs. + The corresponding output IDs of the account outputs. """ query_parameters_camelized = query_parameters.to_dict() - response = self._call_method('aliasOutputIds', { + response = self._call_method('accountOutputIds', { 'queryParameters': query_parameters_camelized, }) return self.OutputIdsResponse(response) - def alias_output_id(self, alias_id: HexStr) -> OutputId: - """Fetch alias output ID from the given alias ID. + def account_output_id(self, account_id: HexStr) -> OutputId: + """Fetch account output ID from the given account ID. Returns: - The output ID of the alias output. + The output ID of the account output. """ - return OutputId.from_string(self._call_method('aliasOutputId', { - 'aliasId': alias_id + return OutputId.from_string(self._call_method('accountOutputId', { + 'accountId': account_id })) def nft_output_ids( diff --git a/bindings/python/iota_sdk/client/_utils.py b/bindings/python/iota_sdk/client/_utils.py index 20f93d0716..e61b01b360 100644 --- a/bindings/python/iota_sdk/client/_utils.py +++ b/bindings/python/iota_sdk/client/_utils.py @@ -18,11 +18,11 @@ def hex_to_bech32(self, hex: HexStr, bech32_hrp: str) -> str: 'bech32Hrp': bech32_hrp }) - def alias_id_to_bech32(self, alias_id: HexStr, bech32_hrp: str) -> str: - """Transforms an alias id to a bech32 encoded address. + def account_id_to_bech32(self, account_id: HexStr, bech32_hrp: str) -> str: + """Transforms an account id to a bech32 encoded address. """ - return self._call_method('aliasIdToBech32', { - 'aliasId': alias_id, + return self._call_method('accountIdToBech32', { + 'accountId': account_id, 'bech32Hrp': bech32_hrp }) diff --git a/bindings/python/iota_sdk/client/client.py b/bindings/python/iota_sdk/client/client.py index 035598823d..c4d2c1a98c 100644 --- a/bindings/python/iota_sdk/client/client.py +++ b/bindings/python/iota_sdk/client/client.py @@ -13,7 +13,7 @@ from iota_sdk.types.feature import Feature from iota_sdk.types.native_token import NativeToken from iota_sdk.types.network_info import NetworkInfo -from iota_sdk.types.output import AliasOutput, BasicOutput, FoundryOutput, NftOutput, output_from_dict +from iota_sdk.types.output import AccountOutput, BasicOutput, FoundryOutput, NftOutput, output_from_dict from iota_sdk.types.payload import Payload, TransactionPayload from iota_sdk.types.token_scheme import SimpleTokenScheme from iota_sdk.types.unlock_condition import UnlockCondition @@ -150,31 +150,31 @@ def get_handle(self): """ return self.handle - def build_alias_output(self, - alias_id: HexStr, - unlock_conditions: List[UnlockCondition], - amount: Optional[int] = None, - native_tokens: Optional[List[NativeToken]] = None, - state_index: Optional[int] = None, - state_metadata: Optional[str] = None, - foundry_counter: Optional[int] = None, - features: Optional[List[Feature]] = None, - immutable_features: Optional[List[Feature]] = None) -> AliasOutput: - """Build an AliasOutput. + def build_account_output(self, + account_id: HexStr, + unlock_conditions: List[UnlockCondition], + amount: Optional[int] = None, + native_tokens: Optional[List[NativeToken]] = None, + state_index: Optional[int] = None, + state_metadata: Optional[str] = None, + foundry_counter: Optional[int] = None, + features: Optional[List[Feature]] = None, + immutable_features: Optional[List[Feature]] = None) -> AccountOutput: + """Build an AccountOutput. Args: - alias_id: A unique ID for the new alias. + account_id: A unique ID for the new account. unlock_conditions: The unlock conditions for the new output. amount: The amount of base coins in the new output. native_tokens: Native tokens added to the new output. - state_index: A counter that must increase by 1 every time the alias is state transitioned. + state_index: A counter that must increase by 1 every time the account is state transitioned. state_metadata: Metadata that can only be changed by the state controller. - foundry_counter: A counter that denotes the number of foundries created by this alias account. + foundry_counter: A counter that denotes the number of foundries created by this account output. features: A list of features. immutable_features: A list of immutable features. Returns: - The alias output as dict. + The account output as dict. """ unlock_conditions = [unlock_condition.to_dict() @@ -193,8 +193,8 @@ def build_alias_output(self, if amount: amount = str(amount) - return output_from_dict(self._call_method('buildAliasOutput', { - 'aliasId': alias_id, + return output_from_dict(self._call_method('buildAccountOutput', { + 'accountId': account_id, 'unlockConditions': unlock_conditions, 'amount': amount, 'nativeTokens': native_tokens, @@ -253,7 +253,7 @@ def build_foundry_output(self, """Build a FoundryOutput. Args: - serial_number: The serial number of the foundry with respect to the controlling alias. + serial_number: The serial number of the foundry with respect to the controlling account. token_scheme: Defines the supply control scheme of the tokens controlled by the foundry. Currently only a simple scheme is supported. unlock_conditions: The unlock conditions for the new output. amount: The amount of base coins in the new output. diff --git a/bindings/python/iota_sdk/types/address.py b/bindings/python/iota_sdk/types/address.py index cd5d467bf2..17a88fdd67 100644 --- a/bindings/python/iota_sdk/types/address.py +++ b/bindings/python/iota_sdk/types/address.py @@ -14,11 +14,11 @@ class AddressType(IntEnum): Attributes: ED25519 (0): Ed25519 address. - ALIAS (8): Alias address. + ACCOUNT (8): Account address. NFT (16): Nft address. """ ED25519 = 0 - ALIAS = 8 + ACCOUNT = 8 NFT = 16 @@ -46,15 +46,15 @@ class Ed25519Address(Address): @json @dataclass -class AliasAddress(Address): - """Represents an Alias address. +class AccountAddress(Address): + """Represents an Account address. Attributes: - alias_id: The hex encoded alias id. + account_id: The hex encoded account id. """ - alias_id: HexStr + account_id: HexStr type: int = field( default_factory=lambda: int( - AddressType.ALIAS), + AddressType.ACCOUNT), init=False) diff --git a/bindings/python/iota_sdk/types/balance.py b/bindings/python/iota_sdk/types/balance.py index 53db92f798..fb9fdf22bd 100644 --- a/bindings/python/iota_sdk/types/balance.py +++ b/bindings/python/iota_sdk/types/balance.py @@ -26,12 +26,12 @@ class RequiredStorageDeposit: """Required storage deposit for the outputs in the account. Attributes: - alias: The required amount for alias outputs. + account: The required amount for account outputs. basic: The required amount for basic outputs. foundry: The required amount for foundry outputs. nft: The required amount for nft outputs. """ - alias: str + account: str basic: str foundry: str nft: str @@ -64,7 +64,7 @@ class Balance: required_storage_deposit: The required storage deposit. native_tokens: The balances of all native tokens. nfts: All owned NFTs. - aliases: All owned aliases. + accounts: All owned accounts. foundries: All owned foundries. potentially_locked_outputs: A list of potentially locked outputs. """ @@ -72,6 +72,6 @@ class Balance: required_storage_deposit: RequiredStorageDeposit native_tokens: List[NativeTokensBalance] nfts: List[HexStr] - aliases: List[HexStr] + accounts: List[HexStr] foundries: List[HexStr] potentially_locked_outputs: dict[HexStr, bool] diff --git a/bindings/python/iota_sdk/types/burn.py b/bindings/python/iota_sdk/types/burn.py index 1bc41c30b9..6ee1cc126e 100644 --- a/bindings/python/iota_sdk/types/burn.py +++ b/bindings/python/iota_sdk/types/burn.py @@ -14,23 +14,23 @@ class Burn: """A DTO for `Burn`. Attributes: - aliases: The aliases to burn. + accounts: The accounts to burn. nfts: The NFTs to burn. foundries: The foundries to burn. native_tokens: The native tokens to burn. """ - aliases: Optional[List[HexStr]] = None + accounts: Optional[List[HexStr]] = None nfts: Optional[List[HexStr]] = None foundries: Optional[List[HexStr]] = None native_tokens: Optional[List[NativeToken]] = None - def add_alias(self, alias: HexStr) -> Burn: - """Add an alias to the burn. + def add_account(self, account: HexStr) -> Burn: + """Add an account to the burn. """ - if self.aliases is None: - self.aliases = [] - self.aliases.append(alias) + if self.accounts is None: + self.accounts = [] + self.accounts.append(account) return self def add_nft(self, nft: HexStr) -> Burn: diff --git a/bindings/python/iota_sdk/types/feature.py b/bindings/python/iota_sdk/types/feature.py index bd5fbb8e05..52be6bbe97 100644 --- a/bindings/python/iota_sdk/types/feature.py +++ b/bindings/python/iota_sdk/types/feature.py @@ -5,7 +5,7 @@ from dataclasses import dataclass, field -from iota_sdk.types.address import Ed25519Address, AliasAddress, NFTAddress +from iota_sdk.types.address import Ed25519Address, AccountAddress, NFTAddress from iota_sdk.types.common import HexStr, json @@ -39,7 +39,7 @@ class SenderFeature(Feature): Attributes: address: A given sender address. """ - address: Ed25519Address | AliasAddress | NFTAddress + address: Ed25519Address | AccountAddress | NFTAddress type: int = field( default_factory=lambda: int( FeatureType.Sender), @@ -53,7 +53,7 @@ class IssuerFeature(Feature): Attributes: address: A given issuer address. """ - address: Ed25519Address | AliasAddress | NFTAddress + address: Ed25519Address | AccountAddress | NFTAddress type: int = field( default_factory=lambda: int( FeatureType.Issuer), diff --git a/bindings/python/iota_sdk/types/filter_options.py b/bindings/python/iota_sdk/types/filter_options.py index 6425c7b755..c4b13a485e 100644 --- a/bindings/python/iota_sdk/types/filter_options.py +++ b/bindings/python/iota_sdk/types/filter_options.py @@ -18,6 +18,6 @@ class FilterOptions: lowerBoundBookedTimestamp: Optional[int] = None upperBoundBookedTimestamp: Optional[int] = None outputTypes: Optional[List[int]] = None - aliasIds: Optional[List[str]] = None + accountIds: Optional[List[str]] = None foundryIds: Optional[List[str]] = None nftIds: Optional[List[str]] = None diff --git a/bindings/python/iota_sdk/types/output.py b/bindings/python/iota_sdk/types/output.py index 88b4b6ecb8..5ed633c8c6 100644 --- a/bindings/python/iota_sdk/types/output.py +++ b/bindings/python/iota_sdk/types/output.py @@ -10,7 +10,7 @@ from iota_sdk.types.feature import SenderFeature, IssuerFeature, MetadataFeature, TagFeature from iota_sdk.types.native_token import NativeToken from iota_sdk.types.token_scheme import SimpleTokenScheme -from iota_sdk.types.unlock_condition import AddressUnlockCondition, StorageDepositReturnUnlockCondition, TimelockUnlockCondition, ExpirationUnlockCondition, StateControllerAddressUnlockCondition, GovernorAddressUnlockCondition, ImmutableAliasAddressUnlockCondition +from iota_sdk.types.unlock_condition import AddressUnlockCondition, StorageDepositReturnUnlockCondition, TimelockUnlockCondition, ExpirationUnlockCondition, StateControllerAddressUnlockCondition, GovernorAddressUnlockCondition, ImmutableAccountAddressUnlockCondition class OutputType(IntEnum): @@ -18,12 +18,12 @@ class OutputType(IntEnum): Attributes: Basic (3): A basic output. - Alias (4): An alias output. + Account (4): An account output. Foundry (5): A foundry output. Nft (6): An NFT output. """ Basic = 3 - Alias = 4 + Account = 4 Foundry = 5 Nft = 6 @@ -66,21 +66,21 @@ class BasicOutput(Output): @json @dataclass -class AliasOutput(Output): - """Describes an alias output. +class AccountOutput(Output): + """Describes an account output. Attributes: amount : The base coin amount of the output. unlock_conditions: The conditions to unlock the output. - alias_id : - The alias ID if it's an alias output. + account_id : + The account ID if it's an account output. state_index : - A counter that must increase by 1 every time the alias is state transitioned. + A counter that must increase by 1 every time the account is state transitioned. state_metadata : Metadata that can only be changed by the state controller. foundry_counter : - A counter that denotes the number of foundries created by this alias account. + A counter that denotes the number of foundries created by this account output. features : Features that add utility to the output but do not impose unlocking conditions. native_tokens : @@ -91,7 +91,7 @@ class AliasOutput(Output): The type of output. """ amount: str - alias_id: HexStr + account_id: HexStr state_index: int foundry_counter: int unlock_conditions: List[StateControllerAddressUnlockCondition | @@ -104,7 +104,7 @@ class AliasOutput(Output): native_tokens: Optional[List[NativeToken]] = None type: int = field( default_factory=lambda: int( - OutputType.Alias), + OutputType.Account), init=False) @@ -124,7 +124,7 @@ class FoundryOutput(Output): immutable_features : Features that add utility to the output but do not impose unlocking conditions. These features need to be kept in future transitions of the UTXO state machine. serial_number : - The serial number of the foundry with respect to the controlling alias. + The serial number of the foundry with respect to the controlling account. token_scheme : Defines the supply control scheme of the tokens controlled by the foundry. Currently only a simple scheme is supported. type : @@ -133,7 +133,7 @@ class FoundryOutput(Output): amount: str serial_number: int token_scheme: SimpleTokenScheme - unlock_conditions: List[ImmutableAliasAddressUnlockCondition] + unlock_conditions: List[ImmutableAccountAddressUnlockCondition] features: Optional[List[MetadataFeature]] = None immutable_features: Optional[List[MetadataFeature]] = None native_tokens: Optional[List[NativeToken]] = None @@ -215,17 +215,17 @@ class OutputWithMetadata: """ metadata: OutputMetadata - output: AliasOutput | FoundryOutput | NftOutput | BasicOutput + output: AccountOutput | FoundryOutput | NftOutput | BasicOutput def output_from_dict( - output: Dict[str, any]) -> BasicOutput | AliasOutput | FoundryOutput | NftOutput | Output: + output: Dict[str, any]) -> BasicOutput | AccountOutput | FoundryOutput | NftOutput | Output: output_type = OutputType(output['type']) if output_type == OutputType.Basic: return BasicOutput.from_dict(output) - if output_type == OutputType.Alias: - return AliasOutput.from_dict(output) + if output_type == OutputType.Account: + return AccountOutput.from_dict(output) if output_type == OutputType.Foundry: return FoundryOutput.from_dict(output) if output_type == OutputType.Nft: diff --git a/bindings/python/iota_sdk/types/output_data.py b/bindings/python/iota_sdk/types/output_data.py index 65db8a3a03..3cea71b9eb 100644 --- a/bindings/python/iota_sdk/types/output_data.py +++ b/bindings/python/iota_sdk/types/output_data.py @@ -4,9 +4,9 @@ from __future__ import annotations from dataclasses import dataclass from typing import Optional -from iota_sdk.types.address import Ed25519Address, AliasAddress, NFTAddress +from iota_sdk.types.address import Ed25519Address, AccountAddress, NFTAddress from iota_sdk.types.common import HexStr, json -from iota_sdk.types.output import BasicOutput, AliasOutput, FoundryOutput, NftOutput, OutputMetadata +from iota_sdk.types.output import BasicOutput, AccountOutput, FoundryOutput, NftOutput, OutputMetadata from iota_sdk.types.signature import Bip44 @@ -28,9 +28,9 @@ class OutputData(): output_id: HexStr metadata: OutputMetadata - output: AliasOutput | FoundryOutput | NftOutput | BasicOutput + output: AccountOutput | FoundryOutput | NftOutput | BasicOutput is_spent: bool - address: Ed25519Address | AliasAddress | NFTAddress + address: Ed25519Address | AccountAddress | NFTAddress network_id: str remainder: bool chain: Optional[Bip44] = None diff --git a/bindings/python/iota_sdk/types/payload.py b/bindings/python/iota_sdk/types/payload.py index 2843bd891c..bf60855c5e 100644 --- a/bindings/python/iota_sdk/types/payload.py +++ b/bindings/python/iota_sdk/types/payload.py @@ -8,7 +8,7 @@ from dataclasses import dataclass, field from iota_sdk.types.common import HexStr, json -from iota_sdk.types.output import BasicOutput, AliasOutput, FoundryOutput, NftOutput +from iota_sdk.types.output import BasicOutput, AccountOutput, FoundryOutput, NftOutput from iota_sdk.types.input import UtxoInput from iota_sdk.types.unlock import SignatureUnlock, ReferenceUnlock @@ -36,7 +36,7 @@ class RegularTransactionEssence(TransactionEssence): network_id: str inputs_commitment: HexStr inputs: List[UtxoInput] - outputs: List[AliasOutput | FoundryOutput | NftOutput | BasicOutput] + outputs: List[AccountOutput | FoundryOutput | NftOutput | BasicOutput] payload: Optional[TaggedDataPayload] = None type: int = field(default_factory=lambda: 1, init=False) diff --git a/bindings/python/iota_sdk/types/send_params.py b/bindings/python/iota_sdk/types/send_params.py index 557efb63ee..316318f041 100644 --- a/bindings/python/iota_sdk/types/send_params.py +++ b/bindings/python/iota_sdk/types/send_params.py @@ -64,12 +64,12 @@ class CreateNativeTokenParams(): circulating_supply: The circulating supply of the native token. maximum_supply: The maximum supply of the native token. foundry_metadata: The foundry metadata of the native token. - alias_id: The ID of the corresponding alias. + account_id: The ID of the corresponding account. """ circulating_supply: int maximum_supply: int foundry_metadata: Optional[str] = None - alias_id: Optional[str] = None + account_id: Optional[str] = None @staticmethod def _to_dict_custom(config): @@ -102,14 +102,14 @@ class MintNftParams(): @json @dataclass -class CreateAliasOutputParams(): - """Parameters for creating aliases. +class CreateAccountOutputParams(): + """Parameters for creating accounts. Attributes: - address: A Bech32 encoded address which will control the alias. Default will use the first address of the account. - immutable_metadata: Immutable alias metadata. - metadata: Alias metadata. - state_metadata: Alias state metadata. + address: A Bech32 encoded address which will control the account. Default will use the first address of the account. + immutable_metadata: Immutable account metadata. + metadata: Account metadata. + state_metadata: Account state metadata. """ address: str immutable_metadata: Optional[str] = None diff --git a/bindings/python/iota_sdk/types/transaction_data.py b/bindings/python/iota_sdk/types/transaction_data.py index e50d6b84aa..d0aff3cb40 100644 --- a/bindings/python/iota_sdk/types/transaction_data.py +++ b/bindings/python/iota_sdk/types/transaction_data.py @@ -4,8 +4,8 @@ from __future__ import annotations from dataclasses import dataclass from typing import Optional, List -from iota_sdk.types.address import Ed25519Address, AliasAddress, NFTAddress -from iota_sdk.types.output import BasicOutput, AliasOutput, FoundryOutput, NftOutput, OutputMetadata +from iota_sdk.types.address import Ed25519Address, AccountAddress, NFTAddress +from iota_sdk.types.output import BasicOutput, AccountOutput, FoundryOutput, NftOutput, OutputMetadata from iota_sdk.types.payload import RegularTransactionEssence, TransactionPayload from iota_sdk.types.signature import Bip44 from iota_sdk.types.common import json @@ -21,7 +21,7 @@ class InputSigningData: output_metadata: The output metadata. chain: The BIP44 chain for the address to unlock the output. """ - output: AliasOutput | FoundryOutput | NftOutput | BasicOutput + output: AccountOutput | FoundryOutput | NftOutput | BasicOutput output_metadata: OutputMetadata chain: Optional[Bip44] = None @@ -36,8 +36,8 @@ class RemainderData: address: The remainder address. chain: The BIP44 chain for the remainder address. """ - output: AliasOutput | FoundryOutput | NftOutput | BasicOutput - address: Ed25519Address | AliasAddress | NFTAddress + output: AccountOutput | FoundryOutput | NftOutput | BasicOutput + address: Ed25519Address | AccountAddress | NFTAddress chain: Optional[Bip44] = None diff --git a/bindings/python/iota_sdk/types/unlock.py b/bindings/python/iota_sdk/types/unlock.py index 1b6dbbc648..68bfd18fbc 100644 --- a/bindings/python/iota_sdk/types/unlock.py +++ b/bindings/python/iota_sdk/types/unlock.py @@ -11,7 +11,7 @@ class UnlockType(IntEnum): Signature = 0 Reference = 1 - Alias = 2 + Account = 2 Nft = 3 @@ -49,13 +49,13 @@ class ReferenceUnlock(Unlock): @json @dataclass -class AliasUnlock: - """An unlock which must reference a previous unlock which unlocks the alias that the input is locked to. +class AccountUnlock: + """An unlock which must reference a previous unlock which unlocks the account that the input is locked to. """ reference: int type: int = field( default_factory=lambda: int( - UnlockType.Alias), + UnlockType.Account), init=False) diff --git a/bindings/python/iota_sdk/types/unlock_condition.py b/bindings/python/iota_sdk/types/unlock_condition.py index 8da50bfa1e..b4a62524eb 100644 --- a/bindings/python/iota_sdk/types/unlock_condition.py +++ b/bindings/python/iota_sdk/types/unlock_condition.py @@ -5,7 +5,7 @@ from dataclasses import dataclass, field -from iota_sdk.types.address import Ed25519Address, AliasAddress, NFTAddress +from iota_sdk.types.address import Ed25519Address, AccountAddress, NFTAddress from iota_sdk.types.common import json @@ -19,7 +19,7 @@ class UnlockConditionType(IntEnum): Expiration (3): An expiration unlock condition. StateControllerAddress (4): A state controller address unlock condition. GovernorAddress (5): A governor address unlock condition. - ImmutableAliasAddress (6): An immutable alias address unlock condition. + ImmutableAccountAddress (6): An immutable account address unlock condition. """ Address = 0 StorageDepositReturn = 1 @@ -27,7 +27,7 @@ class UnlockConditionType(IntEnum): Expiration = 3 StateControllerAddress = 4 GovernorAddress = 5 - ImmutableAliasAddress = 6 + ImmutableAccountAddress = 6 @json @@ -45,7 +45,7 @@ class AddressUnlockCondition(UnlockCondition): Args: address: An address unlocked with a private key. """ - address: Ed25519Address | AliasAddress | NFTAddress + address: Ed25519Address | AccountAddress | NFTAddress type: int = field( default_factory=lambda: int( UnlockConditionType.Address), @@ -61,7 +61,7 @@ class StorageDepositReturnUnlockCondition(UnlockCondition): return_address: The address to return the amount to. """ amount: str - return_address: Ed25519Address | AliasAddress | NFTAddress + return_address: Ed25519Address | AccountAddress | NFTAddress type: int = field(default_factory=lambda: int( UnlockConditionType.StorageDepositReturn), init=False) @@ -89,7 +89,7 @@ class ExpirationUnlockCondition(UnlockCondition): return_address: The return address if the output was not claimed in time. """ unix_time: int - return_address: Ed25519Address | AliasAddress | NFTAddress + return_address: Ed25519Address | AccountAddress | NFTAddress type: int = field( default_factory=lambda: int( UnlockConditionType.Expiration), @@ -103,7 +103,7 @@ class StateControllerAddressUnlockCondition(UnlockCondition): Args: address: The state controller address that owns the output. """ - address: Ed25519Address | AliasAddress | NFTAddress + address: Ed25519Address | AccountAddress | NFTAddress type: int = field(default_factory=lambda: int( UnlockConditionType.StateControllerAddress), init=False) @@ -115,18 +115,18 @@ class GovernorAddressUnlockCondition(UnlockCondition): Args: address: The governor address that owns the output. """ - address: Ed25519Address | AliasAddress | NFTAddress + address: Ed25519Address | AccountAddress | NFTAddress type: int = field(default_factory=lambda: int( UnlockConditionType.GovernorAddress), init=False) @json @dataclass -class ImmutableAliasAddressUnlockCondition(UnlockCondition): - """An immutable alias address unlock condition. +class ImmutableAccountAddressUnlockCondition(UnlockCondition): + """An immutable account address unlock condition. Args: - address: The permanent alias address that owns this output. + address: The permanent account address that owns this output. """ - address: AliasAddress + address: AccountAddress type: int = field(default_factory=lambda: int( - UnlockConditionType.ImmutableAliasAddress), init=False) + UnlockConditionType.ImmutableAccountAddress), init=False) diff --git a/bindings/python/iota_sdk/utils.py b/bindings/python/iota_sdk/utils.py index 2569239d32..90fb42ae18 100644 --- a/bindings/python/iota_sdk/utils.py +++ b/bindings/python/iota_sdk/utils.py @@ -39,11 +39,11 @@ def hex_to_bech32(hex: HexStr, bech32_hrp: str) -> str: }) @staticmethod - def alias_id_to_bech32(alias_id: HexStr, bech32_hrp: str) -> str: - """Convert an alias id to a Bech32 encoded address. + def account_id_to_bech32(account_id: HexStr, bech32_hrp: str) -> str: + """Convert an account id to a Bech32 encoded address. """ - return _call_method('aliasIdToBech32', { - 'aliasId': alias_id, + return _call_method('accountIdToBech32', { + 'accountId': account_id, 'bech32Hrp': bech32_hrp }) @@ -96,20 +96,20 @@ def mnemonic_to_hex_seed(mnemonic: str) -> HexStr: }) @staticmethod - def compute_alias_id(output_id: OutputId) -> HexStr: - """Compute the alias id for the given alias output id. + def compute_account_id(output_id: OutputId) -> HexStr: + """Compute the account id for the given account output id. """ - return _call_method('computeAliasId', { + return _call_method('computeAccountId', { 'outputId': repr(output_id) }) @staticmethod - def compute_foundry_id(alias_id: HexStr, serial_number: int, + def compute_foundry_id(account_id: HexStr, serial_number: int, token_scheme_type: int) -> HexStr: """Compute the foundry id. """ return _call_method('computeFoundryId', { - 'aliasId': alias_id, + 'accountId': account_id, 'serialNumber': serial_number, 'tokenSchemeType': token_scheme_type }) @@ -149,12 +149,12 @@ def compute_output_id(transaction_id: HexStr, index: int) -> OutputId: })) @staticmethod - def compute_token_id(alias_id: HexStr, serial_number: int, + def compute_token_id(account_id: HexStr, serial_number: int, token_scheme_type: int) -> HexStr: - """Compute a token id from the alias id, serial number and token scheme type. + """Compute a token id from the account id, serial number and token scheme type. """ return _call_method('computeTokenId', { - 'aliasId': alias_id, + 'accountId': account_id, 'serialNumber': serial_number, 'tokenSchemeType': token_scheme_type }) diff --git a/bindings/python/iota_sdk/wallet/account.py b/bindings/python/iota_sdk/wallet/account.py index 41e5156e10..2de2bc9b2e 100644 --- a/bindings/python/iota_sdk/wallet/account.py +++ b/bindings/python/iota_sdk/wallet/account.py @@ -15,7 +15,7 @@ from iota_sdk.types.output import BasicOutput, NftOutput, Output, output_from_dict from iota_sdk.types.output_params import OutputParams from iota_sdk.types.transaction_data import PreparedTransactionData, SignedTransactionData -from iota_sdk.types.send_params import CreateAliasOutputParams, CreateNativeTokenParams, MintNftParams, SendNativeTokensParams, SendNftParams, SendParams +from iota_sdk.types.send_params import CreateAccountOutputParams, CreateNativeTokenParams, MintNftParams, SendNativeTokensParams, SendNftParams, SendParams from iota_sdk.types.transaction import Transaction from iota_sdk.types.transaction_options import TransactionOptions from iota_sdk.types.consolidation_params import ConsolidationParams @@ -80,7 +80,7 @@ def get_metadata(self) -> AccountMetadata: def prepare_burn( self, burn: Burn, options: Optional[TransactionOptions] = None) -> PreparedTransaction: - """A generic `prepare_burn()` function that can be used to prepare the burn of native tokens, nfts, foundries and aliases. + """A generic `prepare_burn()` function that can be used to prepare the burn of native tokens, nfts, foundries and accounts. """ prepared = self._call_account_method( 'prepareBurn', { @@ -130,27 +130,27 @@ def prepare_consolidate_outputs( ) return PreparedTransaction(self, prepared) - def prepare_create_alias_output(self, - params: Optional[CreateAliasOutputParams] = None, - options: Optional[TransactionOptions] = None) -> PreparedTransaction: - """Create an alias output. + def prepare_create_account_output(self, + params: Optional[CreateAccountOutputParams] = None, + options: Optional[TransactionOptions] = None) -> PreparedTransaction: + """Create an account output. """ prepared = self._call_account_method( - 'prepareCreateAliasOutput', { + 'prepareCreateAccountOutput', { 'params': params, 'options': options } ) return PreparedTransaction(self, prepared) - def prepare_destroy_alias(self, - alias_id: HexStr, - options: Optional[TransactionOptions] = None) -> PreparedTransaction: - """Destroy an alias output. + def prepare_destroy_account(self, + account_id: HexStr, + options: Optional[TransactionOptions] = None) -> PreparedTransaction: + """Destroy an account output. """ prepared = self._call_account_method( 'prepareBurn', { - 'burn': Burn().add_alias(alias_id).to_dict(), + 'burn': Burn().add_account(account_id).to_dict(), 'options': options }, ) diff --git a/bindings/python/iota_sdk/wallet/sync_options.py b/bindings/python/iota_sdk/wallet/sync_options.py index 8f4ad050f2..44b230cec5 100644 --- a/bindings/python/iota_sdk/wallet/sync_options.py +++ b/bindings/python/iota_sdk/wallet/sync_options.py @@ -7,40 +7,40 @@ class AccountSyncOptions(): Attributes: basic_outputs: Whether to sync basic outputs. nft_outputs: Whether to sync NFT outputs. - alias_outputs: whether to sync alias outputs. + account_outputs: whether to sync account outputs. """ def __init__(self, basic_outputs: Optional[bool] = None, nft_outputs: Optional[bool] = None, - alias_outputs: Optional[bool] = None): + account_outputs: Optional[bool] = None): """Initialize `Self`. """ self.basicOutputs = basic_outputs self.nftOutputs = nft_outputs - self.aliasOutputs = alias_outputs + self.accountOutputs = account_outputs class AliasSyncOptions(): - """Sync options for addresses from alias outputs. + """Sync options for addresses from account outputs. Attributes: basic_outputs: Whether to sync basic outputs. nft_outputs: Whether to sync NFT outputs. - alias_outputs: Whether to sync alias outputs. + account_outputs: Whether to sync account outputs. foundry_outputs: Whether to sync foundry outputs. """ def __init__(self, basic_outputs: Optional[bool] = None, nft_outputs: Optional[bool] = None, - alias_outputs: Optional[bool] = None, + account_outputs: Optional[bool] = None, foundry_outputs: Optional[bool] = None): """Initialize `Self`. """ self.basicOutputs = basic_outputs self.nftOutputs = nft_outputs - self.aliasOutputs = alias_outputs + self.accountOutputs = account_outputs self.foundryOutputs = foundry_outputs @@ -50,18 +50,18 @@ class NftSyncOptions(): Attributes: basic_outputs: Whether to sync basic outputs. nft_outputs: Whether to sync NFT outputs. - alias_outputs: Whether to sync alias outputs. + account_outputs: Whether to sync account outputs. """ def __init__(self, basic_outputs: Optional[bool] = None, nft_outputs: Optional[bool] = None, - alias_outputs: Optional[bool] = None): + account_outputs: Optional[bool] = None): """Initialize `Self`. """ self.basicOutputs = basic_outputs self.nftOutputs = nft_outputs - self.aliasOutputs = alias_outputs + self.accountOutputs = account_outputs class SyncOptions(): @@ -92,7 +92,7 @@ class SyncOptions(): account : Specifies what outputs should be synced for the Ed25519 addresses from the account. alias : - Specifies what outputs should be synced for the address of an alias output. + Specifies what outputs should be synced for the address of an account output. nft : Specifies what outputs should be synced for the address of an nft output. sync_only_most_basic_outputs : @@ -123,6 +123,8 @@ def __init__(self, self.syncIncomingTransactions = sync_incoming_transactions self.syncPendingTransactions = sync_pending_transactions self.account = account + # TODO Rename when we are done with Account changes + # https://github.com/iotaledger/iota-sdk/issues/647. self.alias = alias self.nft = nft self.syncOnlyMostBasicOutputs = sync_only_most_basic_outputs diff --git a/bindings/python/tests/test_block.py b/bindings/python/tests/test_block.py index 35e2967d8a..d1093197a1 100644 --- a/bindings/python/tests/test_block.py +++ b/bindings/python/tests/test_block.py @@ -14,7 +14,7 @@ def test_block(): assert block.payload.type == PayloadType.Transaction # with tx payload, all output types - block_dict = {"protocolVersion": 2, "parents": ["0x053296e7434e8a4d602f8db30a5aaf16c01140212fe79d8132137cda1c38a60a", "0x559ec1d9a31c55bd27588ada2ade70fb5b13764ddd600e29c3b018761ba30e15", "0xe78e8cdbbeda89e3408eed51b77e0db5ba035f5f3bf79a8365435bba40697693", "0xee9d6e45dbc080694e6c827fecbc31ad9f654cf57404bc98f4cbca033f8e3139"], "payload": {"type": 6, "essence": {"type": 1, "networkId": "1856588631910923207", "inputs": [{"type": 0, "transactionId": "0xa49f5a764c3fe22f702b5b238a75a648faae1863f61c14fac51ba58d26acb823", "transactionOutputIndex": 9}, {"type": 0, "transactionId": "0x6f23b39ebe433f8b522d2e4360186cd3e6b21baf46c0a591c801161e505330b4", "transactionOutputIndex": 0}, {"type": 0, "transactionId": "0x6f23b39ebe433f8b522d2e4360186cd3e6b21baf46c0a591c801161e505330b4", "transactionOutputIndex": 1}, {"type": 0, "transactionId": "0x6f23b39ebe433f8b522d2e4360186cd3e6b21baf46c0a591c801161e505330b4", "transactionOutputIndex": 2}], "inputsCommitment": "0xb6913235037feeeb74ea54ca0354bd7daee95e5a4fc65b67c960e5f0df6a339f", "outputs": [{"type": 4, "amount": "1000000", "aliasId": "0xf90a577f1bae4587fdb00752a847b3a2a9d623743993e9e7abdd0440a004caee", "stateIndex": 2, "foundryCounter": 1, "unlockConditions": [{"type": 4, "address": {"type": 0, "pubKeyHash": "0x7ffec9e1233204d9c6dce6812b1539ee96af691ca2e4d9065daa85907d33e5d3"}}, {"type": 5, "address": {"type": 0, "pubKeyHash": "0x7ffec9e1233204d9c6dce6812b1539ee96af691ca2e4d9065daa85907d33e5d3"}}], "features": [{"type": 0, "address": {"type": 0, "pubKeyHash": "0x7ffec9e1233204d9c6dce6812b1539ee96af691ca2e4d9065daa85907d33e5d3"}}, {"type": 2, "data": "0x010203"}], "immutableFeatures": [{"type": 1, "address": {"type": 0, "pubKeyHash": "0x7ffec9e1233204d9c6dce6812b1539ee96af691ca2e4d9065daa85907d33e5d3"}}]}, {"type": 5, "amount": "1000000", "serialNumber": 1, "tokenScheme": {"type": 0, "mintedTokens": "0x32", "meltedTokens": "0x0", "maximumSupply": "0x64"}, "unlockConditions": [{"type": 6, "address": {"type": 8, "aliasId": "0xf90a577f1bae4587fdb00752a847b3a2a9d623743993e9e7abdd0440a004caee"}}]}, {"type": 6, "amount": "1000000", "nftId": "0xbe01be2aa284eb07d1ec4ab8099c86c6cac38d8207d440dafa9560feeac49c62", "unlockConditions": [{"type": 0, "address": {"type": 0, "pubKeyHash": "0x7ffec9e1233204d9c6dce6812b1539ee96af691ca2e4d9065daa85907d33e5d3"}}]}, {"type": 3, "amount": "1000000", "nativeTokens": [{"id": "0x08f90a577f1bae4587fdb00752a847b3a2a9d623743993e9e7abdd0440a004caee0100000000", "amount": "0x32"}], "unlockConditions": [{"type": 0, "address": {"type": 0, "pubKeyHash": "0x7ffec9e1233204d9c6dce6812b1539ee96af691ca2e4d9065daa85907d33e5d3"}}]}, {"type": 3, "amount": "1000000", "unlockConditions": [{"type": 0, "address": {"type": 0, "pubKeyHash": "0x7ffec9e1233204d9c6dce6812b1539ee96af691ca2e4d9065daa85907d33e5d3"}}]}, {"type": 3, "amount": "1000000", "unlockConditions": [{"type": 0, "address": {"type": 0, "pubKeyHash": "0x7ffec9e1233204d9c6dce6812b1539ee96af691ca2e4d9065daa85907d33e5d3"}}], "features": [{"type": 2, "data": "0x0d25"}]}, {"type": 3, "amount": "234100", "unlockConditions": [{"type": 0, "address": {"type": 0, "pubKeyHash": "0x7ffec9e1233204d9c6dce6812b1539ee96af691ca2e4d9065daa85907d33e5d3"}}, {"type": 1, "returnAddress": {"type": 0, "pubKeyHash": "0x7ffec9e1233204d9c6dce6812b1539ee96af691ca2e4d9065daa85907d33e5d3"}, "amount": "234000"}]}, {"type": 3, "amount": "1000000", "unlockConditions": [{"type": 0, "address": {"type": 0, "pubKeyHash": "0x7ffec9e1233204d9c6dce6812b1539ee96af691ca2e4d9065daa85907d33e5d3"}}, {"type": 3, "returnAddress": {"type": 0, "pubKeyHash": "0x7ffec9e1233204d9c6dce6812b1539ee96af691ca2e4d9065daa85907d33e5d3"}, "unixTime": 1}]}, {"type": 3, "amount": "1000000", "unlockConditions": [{"type": 0, "address": {"type": 0, "pubKeyHash": "0x7ffec9e1233204d9c6dce6812b1539ee96af691ca2e4d9065daa85907d33e5d3"}}, {"type": 2, "unixTime": 1}]}, {"type": 3, "amount": "5578452198", "nativeTokens": [{"id": "0x080021bcfa2252a500348f73c939722d65c0354eab33b753ab09bc80a7f592c9a40100000000", "amount": "0x41"}, {"id": "0x0808fb702d67fdb320b5959f152c0f962630515d904c71ed09447c341a6cc171de0100000000", "amount": "0x50"}, {"id": "0x0808fb702d67fdb320b5959f152c0f962630515d904c71ed09447c341a6cc171de0200000000", "amount": "0x64"}, {"id": "0x0808fb702d67fdb320b5959f152c0f962630515d904c71ed09447c341a6cc171de0300000000", "amount": "0x64"}, {"id": "0x080906d8ff0afdcb941cd3867186c8f23d5c889c7a1a8842a001871c8f76bcaf890100000000", "amount": "0xa"}, {"id": "0x08179dc4b298721f8bb60a591d5a00edc6e62ed941c133c4a4415b1ccc7d3804d90100000000", "amount": "0x42"}, {"id": "0x081d30f89a8655ce7514b5724ebae8c8f2160a223a6d8c91edca72de5e1477337b0100000000", "amount": "0x1a"}, {"id": "0x0822ceb3166ad125d310e6660f5fc292356f87f2f9566e982ea22154cec3847b3f0100000000", "amount": "0x64"}, {"id": "0x0822ceb3166ad125d310e6660f5fc292356f87f2f9566e982ea22154cec3847b3f0200000000", "amount": "0x3e8"}, {"id": "0x08261d3aa7f731a9ff784d6f239bfdc505bbe9902d8eace89c91c8e58429c200cb0100000000", "amount": "0x42"}, {"id": "0x082a1d58d3d725f9d3af50699c2cfa022274b199a9f4060b2331bf059e285bd2730100000000", "amount": "0x313030"}, {"id": "0x082ae3fdb7c757dbaae9d9463b63e7e3897f145c8c4a149bfe0ce4d316dc78f2500100000000", "amount": "0x1a"}, { + block_dict = {"protocolVersion": 2, "parents": ["0x053296e7434e8a4d602f8db30a5aaf16c01140212fe79d8132137cda1c38a60a", "0x559ec1d9a31c55bd27588ada2ade70fb5b13764ddd600e29c3b018761ba30e15", "0xe78e8cdbbeda89e3408eed51b77e0db5ba035f5f3bf79a8365435bba40697693", "0xee9d6e45dbc080694e6c827fecbc31ad9f654cf57404bc98f4cbca033f8e3139"], "payload": {"type": 6, "essence": {"type": 1, "networkId": "1856588631910923207", "inputs": [{"type": 0, "transactionId": "0xa49f5a764c3fe22f702b5b238a75a648faae1863f61c14fac51ba58d26acb823", "transactionOutputIndex": 9}, {"type": 0, "transactionId": "0x6f23b39ebe433f8b522d2e4360186cd3e6b21baf46c0a591c801161e505330b4", "transactionOutputIndex": 0}, {"type": 0, "transactionId": "0x6f23b39ebe433f8b522d2e4360186cd3e6b21baf46c0a591c801161e505330b4", "transactionOutputIndex": 1}, {"type": 0, "transactionId": "0x6f23b39ebe433f8b522d2e4360186cd3e6b21baf46c0a591c801161e505330b4", "transactionOutputIndex": 2}], "inputsCommitment": "0xb6913235037feeeb74ea54ca0354bd7daee95e5a4fc65b67c960e5f0df6a339f", "outputs": [{"type": 4, "amount": "1000000", "accountId": "0xf90a577f1bae4587fdb00752a847b3a2a9d623743993e9e7abdd0440a004caee", "stateIndex": 2, "foundryCounter": 1, "unlockConditions": [{"type": 4, "address": {"type": 0, "pubKeyHash": "0x7ffec9e1233204d9c6dce6812b1539ee96af691ca2e4d9065daa85907d33e5d3"}}, {"type": 5, "address": {"type": 0, "pubKeyHash": "0x7ffec9e1233204d9c6dce6812b1539ee96af691ca2e4d9065daa85907d33e5d3"}}], "features": [{"type": 0, "address": {"type": 0, "pubKeyHash": "0x7ffec9e1233204d9c6dce6812b1539ee96af691ca2e4d9065daa85907d33e5d3"}}, {"type": 2, "data": "0x010203"}], "immutableFeatures": [{"type": 1, "address": {"type": 0, "pubKeyHash": "0x7ffec9e1233204d9c6dce6812b1539ee96af691ca2e4d9065daa85907d33e5d3"}}]}, {"type": 5, "amount": "1000000", "serialNumber": 1, "tokenScheme": {"type": 0, "mintedTokens": "0x32", "meltedTokens": "0x0", "maximumSupply": "0x64"}, "unlockConditions": [{"type": 6, "address": {"type": 8, "accountId": "0xf90a577f1bae4587fdb00752a847b3a2a9d623743993e9e7abdd0440a004caee"}}]}, {"type": 6, "amount": "1000000", "nftId": "0xbe01be2aa284eb07d1ec4ab8099c86c6cac38d8207d440dafa9560feeac49c62", "unlockConditions": [{"type": 0, "address": {"type": 0, "pubKeyHash": "0x7ffec9e1233204d9c6dce6812b1539ee96af691ca2e4d9065daa85907d33e5d3"}}]}, {"type": 3, "amount": "1000000", "nativeTokens": [{"id": "0x08f90a577f1bae4587fdb00752a847b3a2a9d623743993e9e7abdd0440a004caee0100000000", "amount": "0x32"}], "unlockConditions": [{"type": 0, "address": {"type": 0, "pubKeyHash": "0x7ffec9e1233204d9c6dce6812b1539ee96af691ca2e4d9065daa85907d33e5d3"}}]}, {"type": 3, "amount": "1000000", "unlockConditions": [{"type": 0, "address": {"type": 0, "pubKeyHash": "0x7ffec9e1233204d9c6dce6812b1539ee96af691ca2e4d9065daa85907d33e5d3"}}]}, {"type": 3, "amount": "1000000", "unlockConditions": [{"type": 0, "address": {"type": 0, "pubKeyHash": "0x7ffec9e1233204d9c6dce6812b1539ee96af691ca2e4d9065daa85907d33e5d3"}}], "features": [{"type": 2, "data": "0x0d25"}]}, {"type": 3, "amount": "234100", "unlockConditions": [{"type": 0, "address": {"type": 0, "pubKeyHash": "0x7ffec9e1233204d9c6dce6812b1539ee96af691ca2e4d9065daa85907d33e5d3"}}, {"type": 1, "returnAddress": {"type": 0, "pubKeyHash": "0x7ffec9e1233204d9c6dce6812b1539ee96af691ca2e4d9065daa85907d33e5d3"}, "amount": "234000"}]}, {"type": 3, "amount": "1000000", "unlockConditions": [{"type": 0, "address": {"type": 0, "pubKeyHash": "0x7ffec9e1233204d9c6dce6812b1539ee96af691ca2e4d9065daa85907d33e5d3"}}, {"type": 3, "returnAddress": {"type": 0, "pubKeyHash": "0x7ffec9e1233204d9c6dce6812b1539ee96af691ca2e4d9065daa85907d33e5d3"}, "unixTime": 1}]}, {"type": 3, "amount": "1000000", "unlockConditions": [{"type": 0, "address": {"type": 0, "pubKeyHash": "0x7ffec9e1233204d9c6dce6812b1539ee96af691ca2e4d9065daa85907d33e5d3"}}, {"type": 2, "unixTime": 1}]}, {"type": 3, "amount": "5578452198", "nativeTokens": [{"id": "0x080021bcfa2252a500348f73c939722d65c0354eab33b753ab09bc80a7f592c9a40100000000", "amount": "0x41"}, {"id": "0x0808fb702d67fdb320b5959f152c0f962630515d904c71ed09447c341a6cc171de0100000000", "amount": "0x50"}, {"id": "0x0808fb702d67fdb320b5959f152c0f962630515d904c71ed09447c341a6cc171de0200000000", "amount": "0x64"}, {"id": "0x0808fb702d67fdb320b5959f152c0f962630515d904c71ed09447c341a6cc171de0300000000", "amount": "0x64"}, {"id": "0x080906d8ff0afdcb941cd3867186c8f23d5c889c7a1a8842a001871c8f76bcaf890100000000", "amount": "0xa"}, {"id": "0x08179dc4b298721f8bb60a591d5a00edc6e62ed941c133c4a4415b1ccc7d3804d90100000000", "amount": "0x42"}, {"id": "0x081d30f89a8655ce7514b5724ebae8c8f2160a223a6d8c91edca72de5e1477337b0100000000", "amount": "0x1a"}, {"id": "0x0822ceb3166ad125d310e6660f5fc292356f87f2f9566e982ea22154cec3847b3f0100000000", "amount": "0x64"}, {"id": "0x0822ceb3166ad125d310e6660f5fc292356f87f2f9566e982ea22154cec3847b3f0200000000", "amount": "0x3e8"}, {"id": "0x08261d3aa7f731a9ff784d6f239bfdc505bbe9902d8eace89c91c8e58429c200cb0100000000", "amount": "0x42"}, {"id": "0x082a1d58d3d725f9d3af50699c2cfa022274b199a9f4060b2331bf059e285bd2730100000000", "amount": "0x313030"}, {"id": "0x082ae3fdb7c757dbaae9d9463b63e7e3897f145c8c4a149bfe0ce4d316dc78f2500100000000", "amount": "0x1a"}, { "id": "0x082ae3fdb7c757dbaae9d9463b63e7e3897f145c8c4a149bfe0ce4d316dc78f2500200000000", "amount": "0x3d2"}, {"id": "0x082cdf4c519401df914bf8ab3ebd1a1bb18da5babe7be82188f586a9c9a7bbdc160100000000", "amount": "0x64"}, {"id": "0x083156fbacf47e0b3ccaa5f4ffcbb9ae333fefcb4016261edfb302668eae242b050100000000", "amount": "0x64"}, {"id": "0x0833b41872b4ef228c10a99456fb08088a52a71f3ff23330287f6c8978bc5dd6df0100000000", "amount": "0x64"}, {"id": "0x083637f9940377b8e461d66e09f73e61b4186dd63deca2ed518b8ea87c410492e80100000000", "amount": "0x3c"}, {"id": "0x083c39ef7bd9a2eb640df6a36319a7fd51d4ca190ffd5d14572c9ebb54bdc6ecab0100000000", "amount": "0x64"}, {"id": "0x083c39ef7bd9a2eb640df6a36319a7fd51d4ca190ffd5d14572c9ebb54bdc6ecab0200000000", "amount": "0x45"}, {"id": "0x08475073881df12705fc6f18f228385ac3d499d21e5e36333c78f3c7e124c4b1e60100000000", "amount": "0x64"}, {"id": "0x084bd1dbdfecb771b4c56aa196cf90ca722ef489f5c12f2e11adb0fad4da8020060100000000", "amount": "0x5a"}, {"id": "0x084bd1dbdfecb771b4c56aa196cf90ca722ef489f5c12f2e11adb0fad4da8020060200000000", "amount": "0x64"}, {"id": "0x084bd1dbdfecb771b4c56aa196cf90ca722ef489f5c12f2e11adb0fad4da8020060300000000", "amount": "0x64"}, {"id": "0x0856ed1d7e6c86cf41c2978a700db8fe2686500f7d6e35f7ef15aecdb799833e5c0100000000", "amount": "0x64"}, {"id": "0x085c6b799750bdf7e5a5c81144465a0676bc11dab74b997444ca369949341720e80100000000", "amount": "0x64"}, {"id": "0x085fbfe07b06a54fda8ab7b6c72c49a34c4dcafaf1e5ba1f145fb06da1bba72a8d0100000000", "amount": "0xa"}, {"id": "0x086a62922fd743b541c987020d2cb2942cf789bcefe41572854119180cb8e037a90100000000", "amount": "0x46"}, {"id": "0x086f7011adb53642e8ed7db230c2307fe980f4aff2685c22f7c84a61ec558f691b0100000000", "amount": "0x3c"}, {"id": "0x086f7011adb53642e8ed7db230c2307fe980f4aff2685c22f7c84a61ec558f691b0200000000", "amount": "0x3de"}, {"id": "0x0871493f8559908cf5825e1a0334fa184f0e8b42136e472ec7e2e8127bc14202f70100000000", "amount": "0x46"}, {"id": "0x08722b1bf4f0295866c8bc75590d83b7422e47739e4b0048126fae45d0b5d330f90100000000", "amount": "0x64"}, {"id": "0x08722b1bf4f0295866c8bc75590d83b7422e47739e4b0048126fae45d0b5d330f90200000000", "amount": "0x3e8"}, {"id": "0x089694cbf1a422b1262d3b34810b7b0a53f49b6b0856388f8121b5d681b23c38e10100000000", "amount": "0x14"}, {"id": "0x089694cbf1a422b1262d3b34810b7b0a53f49b6b0856388f8121b5d681b23c38e10200000000", "amount": "0x64"}, {"id": "0x089694cbf1a422b1262d3b34810b7b0a53f49b6b0856388f8121b5d681b23c38e10300000000", "amount": "0x3e8"}, {"id": "0x089694cbf1a422b1262d3b34810b7b0a53f49b6b0856388f8121b5d681b23c38e10400000000", "amount": "0x64"}, {"id": "0x089786a7641d1268cb3b1cc7b514828f1511e3ae0b885835d284d3af85e1c3d3950100000000", "amount": "0x3e8"}, {"id": "0x0897e215b1e3ccb05c63842dc38db5007241cca966f341d674db2d9e886dc0ed410100000000", "amount": "0x64"}, {"id": "0x089ad7373abf3a4dda4a8a2e64b112ac25dca24efcf51346f8b2d0212961234d0b0100000000", "amount": "0x64"}, {"id": "0x089c130fa264a23492f5876e4c2673154689fa8e30945c7b60c59050b20336d2b70100000000", "amount": "0x32"}, {"id": "0x089c130fa264a23492f5876e4c2673154689fa8e30945c7b60c59050b20336d2b70200000000", "amount": "0x64"}, {"id": "0x089cfeccd4b71fc3d425755d972c1671346903dab3fda81ee54b807b752487d8250100000000", "amount": "0x3e8"}, {"id": "0x08aa2f74dc19d68bd3eb44f5b6648548b42b55f88c62374993301fd15c9ccf21270100000000", "amount": "0x32"}, {"id": "0x08aa2f74dc19d68bd3eb44f5b6648548b42b55f88c62374993301fd15c9ccf21270200000000", "amount": "0x31303030"}, {"id": "0x08ac83d1ce645b025a4a412f22e573973aadb50de1f8407d87b3cca4ed3e779a360100000000", "amount": "0x28"}, {"id": "0x08d1bcfd507246eac6d93fee125e36e5eb8f62afc25bfff09785b6bcc560cf5dc00100000000", "amount": "0x3e8"}, {"id": "0x08dc44610c24f32f26330440f3f0d4afb562a8dfd81afe7c2f79024f8f1b9e21940100000000", "amount": "0x63"}, {"id": "0x08dda479a9d366af826f1a8e3f3290a6c230c39b8d2d1ba165bf737c71856e92640100000000", "amount": "0x14"}, {"id": "0x08ea1cab7a1ba4ae5bdca654fdfe618fc92337030ecbae1d1f6b2b1fe4c6b569940200000000", "amount": "0x64"}, {"id": "0x08ec6d781c5bdb7faebfa66dc529dc46e82a26fb90c5a5de07ee77d357d62529360100000000", "amount": "0x32"}, {"id": "0x08f1802858831220b282ccc4c557676d61f79833869de378ce9a81f736976ce39f0100000000", "amount": "0x32"}, {"id": "0x08f708a29e9619e847916de76c2e167e87a704c235dcbd7cda018865be7f561b5a0100000000", "amount": "0x4c"}, {"id": "0x08f708a29e9619e847916de76c2e167e87a704c235dcbd7cda018865be7f561b5a0200000000", "amount": "0x20"}, {"id": "0x08fb64703098e00d81c5962f28d8504eae5998cf99ab4e37af0d3ea99180b2f6580100000000", "amount": "0x14"}, {"id": "0x08fe4090ca7623deffc5a570898d0844fe9f4763175af2c88a00958b26525b2b420100000000", "amount": "0x22"}], "unlockConditions": [{"type": 0, "address": {"type": 0, "pubKeyHash": "0x7ffec9e1233204d9c6dce6812b1539ee96af691ca2e4d9065daa85907d33e5d3"}}]}]}, "unlocks": [{"type": 0, "signature": {"type": 0, "publicKey": "0x67b7fc3f78763c9394fc4fcdb52cf3a973b6e064bdc3defb40a6cb2c880e6f5c", "signature": "0xc9ec7eba19c11b7a76f33a7781415a2f28fc3cf077fff4627f8c49604c77a5c6b4b4688a56bbe6e35a38bd97f1d03f5589050bd1f3372fc0ad57f8cb26f0da0e"}}, {"type": 1, "reference": 0}, {"type": 2, "reference": 1}, {"type": 1, "reference": 0}]}} block = Block.from_dict(block_dict) assert block.to_dict() == block_dict diff --git a/bindings/python/tests/test_output.py b/bindings/python/tests/test_output.py index 2332a145ca..4398411b82 100644 --- a/bindings/python/tests/test_output.py +++ b/bindings/python/tests/test_output.py @@ -2,7 +2,7 @@ # Copyright 2023 IOTA Stiftung # SPDX-License-Identifier: Apache-2.0 -from iota_sdk import BasicOutput, AliasOutput, FoundryOutput, NftOutput, IssuerFeature, MetadataFeature +from iota_sdk import BasicOutput, AccountOutput, FoundryOutput, NftOutput, IssuerFeature, MetadataFeature from dacite import from_dict @@ -106,10 +106,10 @@ def test_output(): basic_output = BasicOutput.from_dict(basic_output_dict) assert basic_output.to_dict() == basic_output_dict - alias_output_dict = { + account_output_dict = { "type": 4, "amount": "168200", - "aliasId": "0x8d073d15074834785046d9cacec7ac4d672dcb6dad342624a936f3c4334520f1", + "accountId": "0x8d073d15074834785046d9cacec7ac4d672dcb6dad342624a936f3c4334520f1", "stateIndex": 4, "stateMetadata": "0x14bd8ce73814dfe5d6f30f65a11bfd6d0b9e5d29c90aff9d71ec4b3d3a2984386a312295fc8b79cd", "foundryCounter": 0, @@ -134,18 +134,18 @@ def test_output(): "type": 0, "address": { "type": 8, - "aliasId": "0x8d073d15074834785046d9cacec7ac4d672dcb6dad342624a936f3c4334520f1" + "accountId": "0x8d073d15074834785046d9cacec7ac4d672dcb6dad342624a936f3c4334520f1" } } ] } - alias_output = AliasOutput.from_dict(alias_output_dict) - assert alias_output.to_dict() == alias_output_dict + account_output = AccountOutput.from_dict(account_output_dict) + assert account_output.to_dict() == account_output_dict - alias_output_dict = { + account_output_dict = { "type": 4, "amount": "55100", - "aliasId": "0x5380cce0ac342b8fa3e9c4f46d5b473ee9e824f0017fe43682dca77e6b875354", + "accountId": "0x5380cce0ac342b8fa3e9c4f46d5b473ee9e824f0017fe43682dca77e6b875354", "stateIndex": 2, "stateMetadata": "0x", "foundryCounter": 1, @@ -179,8 +179,8 @@ def test_output(): } ] } - alias_output = AliasOutput.from_dict(alias_output_dict) - assert alias_output.to_dict() == alias_output_dict + account_output = AccountOutput.from_dict(account_output_dict) + assert account_output.to_dict() == account_output_dict foundry_output_dict = { "type": 5, @@ -197,7 +197,7 @@ def test_output(): "type": 6, "address": { "type": 8, - "aliasId": "0xf89cfa69c0dd2946ae207f2fcae34b1b1ffa5cefdb5d6fd9ccaa068629803ff5" + "accountId": "0xf89cfa69c0dd2946ae207f2fcae34b1b1ffa5cefdb5d6fd9ccaa068629803ff5" } } ], From ccc029e3a26c4ae4063d8df574f78a820d62cb3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thoralf=20M=C3=BCller?= Date: Thu, 7 Sep 2023 11:54:50 +0200 Subject: [PATCH 2/2] Comment --- bindings/python/examples/how_tos/native_tokens/create.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bindings/python/examples/how_tos/native_tokens/create.py b/bindings/python/examples/how_tos/native_tokens/create.py index df0f19d715..971743e0ab 100644 --- a/bindings/python/examples/how_tos/native_tokens/create.py +++ b/bindings/python/examples/how_tos/native_tokens/create.py @@ -18,7 +18,7 @@ # Sync account with the node balance = account.sync() -# We can first check if we already have an account in our account, because +# We can first check if we already have an account output in our account, because # an account can have many foundry outputs and therefore we can reuse an # existing one. if not balance.accounts: