-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Python: rename alias to account (#1151)
* Python: rename alias to account * Comment
- Loading branch information
Showing
35 changed files
with
241 additions
and
239 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
bindings/python/examples/how_tos/account_wallet/request_funds.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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}') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 0 additions & 38 deletions
38
bindings/python/examples/how_tos/alias_wallet/request_funds.py
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.