Skip to content

Commit

Permalink
removed some account references
Browse files Browse the repository at this point in the history
  • Loading branch information
Brord van Wierst committed Dec 11, 2023
1 parent fc8f1f5 commit 60aa91f
Show file tree
Hide file tree
Showing 24 changed files with 28 additions and 31 deletions.
10 changes: 5 additions & 5 deletions bindings/python/examples/exchange/1_create_account.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from dotenv import load_dotenv

from iota_sdk import (ClientOptions, CoinType, StrongholdSecretManager,
SyncOptions, Wallet, WalletOptions, Bip44)
SecretManager, SyncOptions, Wallet, WalletOptions, Bip44)

# This example uses secrets in environment variables for simplicity which
# should not be done in production.
Expand All @@ -24,16 +24,16 @@
secret_manager = StrongholdSecretManager(
os.environ.get('STRONGHOLD_SNAPSHOT_PATH'), os.environ['STRONGHOLD_PASSWORD'])

# Store the mnemonic in the Stronghold snapshot, this only needs to be
# done once.
SecretManager(secret_manager).store_mnemonic(os.environ['MNEMONIC'])

bib_path = Bip44(
coin_type=CoinType.SHIMMER
)
wallet_options = WalletOptions(None, None, bib_path, client_options, secret_manager, os.environ.get('WALLET_DB_PATH'))
wallet = Wallet(wallet_options)

# Store the mnemonic in the Stronghold snapshot, this only needs to be
# done once.
wallet.store_mnemonic(os.environ['MNEMONIC'])

# 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/account/foundry outputs.
wallet.set_default_sync_options(
Expand Down
4 changes: 1 addition & 3 deletions bindings/python/examples/exchange/2_generate_address.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,8 @@
if env_var not in os.environ:
raise Exception(f'.env {env_var} is undefined, see .env.example')

client_options = ClientOptions(nodes=[os.environ.get('NODE_URL')])

secret_manager = SecretManager(StrongholdSecretManager(
os.environ.get('STRONGHOLD_SNAPSHOT_PATH'), os.environ['STRONGHOLD_PASSWORD']))

address = secret_manager.generate_ed25519_addresses(1)[0]
print('Address:', address.address)
print('Address:', address)
2 changes: 1 addition & 1 deletion bindings/python/examples/exchange/3_check_balance.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
wallet = Wallet(WalletOptions(storage_path=os.environ.get('WALLET_DB_PATH')))

address = wallet.address()
print('address:', address)
print('Address:', address)

# 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/account/foundry outputs.
Expand Down
2 changes: 1 addition & 1 deletion bindings/python/examples/how_tos/account_output/create.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

wallet = Wallet(WalletOptions(storage_path=os.environ.get('WALLET_DB_PATH')))

# Sync account with the node
# Sync wallet with the node
balance = wallet.sync()
print(f'Accounts BEFORE: {balance.accounts}')

Expand Down
2 changes: 1 addition & 1 deletion bindings/python/examples/how_tos/account_output/destroy.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

wallet = Wallet(WalletOptions(storage_path=os.environ.get('WALLET_DB_PATH')))

# Sync account with the node
# Sync wallet with the node
balance = wallet.sync()

# We try to destroy the first account in the account
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,11 @@
if env_var not in os.environ:
raise Exception(f".env {env_var} is undefined, see .env.example")

sync_options = SyncOptions(account=WalletSyncOptions(basic_outputs=True))

wallet = Wallet(WalletOptions(storage_path=os.environ.get('WALLET_DB_PATH')))

wallet.set_stronghold_password(os.environ["STRONGHOLD_PASSWORD"])

sync_options = SyncOptions(account=WalletSyncOptions(basic_outputs=True))
balance = wallet.sync(sync_options)

total_base_token_balance = balance.base_coin.total
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

wallet = Wallet(WalletOptions(storage_path=os.environ.get('WALLET_DB_PATH')))

# Sync account with the node
# Sync wallet with the node
_balance = wallet.sync()

# Just calculate the balance with the known state
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
wallet = Wallet(WalletOptions(storage_path=os.environ.get('WALLET_DB_PATH')))
wallet.set_stronghold_password(os.environ['STRONGHOLD_PASSWORD'])

# Sync account to make sure account is updated with outputs from previous
# Sync wallet to make sure account is updated with outputs from previous
# examples.
wallet.sync()
print('Account synced')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

wallet = Wallet(WalletOptions(storage_path=os.environ.get('WALLET_DB_PATH')))

# Sync account with the node
# Sync wallet with the node
response = wallet.sync()

if 'STRONGHOLD_PASSWORD' not in os.environ:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

wallet.set_stronghold_password(os.environ["STRONGHOLD_PASSWORD"])

# Sync account with the node
# Sync wallet with the node
response = wallet.sync()

# Only the unspent outputs in the account
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

wallet = Wallet(WalletOptions(storage_path=os.environ.get('WALLET_DB_PATH')))

# Sync account with the node
# Sync wallet with the node
response = wallet.sync()

if 'STRONGHOLD_PASSWORD' not in os.environ:
Expand Down
2 changes: 1 addition & 1 deletion bindings/python/examples/how_tos/native_tokens/burn.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

wallet = Wallet(WalletOptions(storage_path=os.environ.get('WALLET_DB_PATH')))

# Sync account with the node
# Sync wallet with the node
balance = wallet.sync()

if 'STRONGHOLD_PASSWORD' not in os.environ:
Expand Down
2 changes: 1 addition & 1 deletion bindings/python/examples/how_tos/native_tokens/create.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

wallet.set_stronghold_password(os.environ["STRONGHOLD_PASSWORD"])

# Sync account with the node
# Sync wallet with the node
balance = wallet.sync()

# We can first check if we already have an account output in our account, because
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

wallet = Wallet(WalletOptions(storage_path=os.environ.get('WALLET_DB_PATH')))

# Sync account with the node
# Sync wallet with the node
balance = wallet.sync()
print(f'Foundries before destroying: {len(balance.foundries)}')

Expand Down
2 changes: 1 addition & 1 deletion bindings/python/examples/how_tos/native_tokens/melt.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

wallet = Wallet(WalletOptions(storage_path=os.environ.get('WALLET_DB_PATH')))

# Sync account with the node
# Sync wallet with the node
balance = wallet.sync()

# Find first foundry and corresponding token id
Expand Down
2 changes: 1 addition & 1 deletion bindings/python/examples/how_tos/native_tokens/mint.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

wallet = Wallet(WalletOptions(storage_path=os.environ.get('WALLET_DB_PATH')))

# Sync account with the node
# Sync wallet with the node
balance = wallet.sync()

# Find first foundry and corresponding token id
Expand Down
2 changes: 1 addition & 1 deletion bindings/python/examples/how_tos/native_tokens/send.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

wallet = Wallet(WalletOptions(storage_path=os.environ.get('WALLET_DB_PATH')))

# Sync account with the node
# Sync wallet with the node
balance = wallet.sync()

token = [native_balance for native_balance in balance.native_tokens if int(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

wallet.set_stronghold_password(os.environ["STRONGHOLD_PASSWORD"])

# Sync account with the node
# Sync wallet with the node
wallet.sync()

# Issue the minting transaction and wait for its inclusion
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

wallet.set_stronghold_password(os.environ["STRONGHOLD_PASSWORD"])

# Sync account with the node
# Sync wallet with the node
wallet.sync()

bech32_hrp = wallet.get_client().get_bech32_hrp()
Expand Down
2 changes: 1 addition & 1 deletion bindings/python/examples/how_tos/nfts/burn_nft.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

wallet.set_stronghold_password(os.environ["STRONGHOLD_PASSWORD"])

# Sync account with the node
# Sync wallet with the node
balance = wallet.sync()

nftId = balance.nfts[0]
Expand Down
2 changes: 1 addition & 1 deletion bindings/python/examples/how_tos/nfts/mint_nft.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

wallet.set_stronghold_password(os.environ["STRONGHOLD_PASSWORD"])

# Sync account with the node
# Sync wallet with the node
response = wallet.sync()

outputs = [MintNftParams(
Expand Down
2 changes: 1 addition & 1 deletion bindings/python/examples/how_tos/nfts/send_nft.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

wallet.set_stronghold_password(os.environ["STRONGHOLD_PASSWORD"])

# Sync account with the node
# Sync wallet with the node
balance = wallet.sync()

outputs = [SendNftParams(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

wallet = Wallet(WalletOptions(storage_path=os.environ.get('WALLET_DB_PATH')))

# Sync account with the node
# Sync wallet with the node
response = wallet.sync()

if 'STRONGHOLD_PASSWORD' not in os.environ:
Expand Down
2 changes: 1 addition & 1 deletion bindings/python/iota_sdk/wallet/wallet.py
Original file line number Diff line number Diff line change
Expand Up @@ -737,7 +737,7 @@ def sign_transaction(

def sign_and_submit_transaction(
self, prepared_transaction_data: PreparedTransactionData) -> TransactionWithMetadata:
"""Validate the transaction, sign it, submit it to a node and store it in the account.
"""Validate the transaction, sign it, submit it to a node and store it in the wallet.
"""
return TransactionWithMetadata.from_dict(self._call_method(
'signAndSubmitTransaction', {
Expand Down

0 comments on commit 60aa91f

Please sign in to comment.