Skip to content
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

feat: Wallet events improvements #2100

Merged
6 changes: 3 additions & 3 deletions bindings/python/examples/exchange/4_listen_events.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright 2023 IOTA Stiftung
# SPDX-License-Identifier: Apache-2.0

# This example listens to the NewOutput event.
# This example listens to the SelectingInputs event.

import json
import os
Expand Down Expand Up @@ -35,8 +35,8 @@ def callback(event):
received_event = True


# Only interested in new outputs here.
wallet.listen(callback, [WalletEventType.NewOutput])
# Only interested when inputs are being selected.
wallet.listen(callback, [WalletEventType.SelectingInputs])
Thoralf-M marked this conversation as resolved.
Show resolved Hide resolved

# Use the faucet to send testnet tokens to your address.
print(f'Fill your address with the Faucet: {os.environ["FAUCET_URL"]}')
Expand Down
24 changes: 14 additions & 10 deletions bindings/python/iota_sdk/types/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,18 @@ class WalletEventType(IntEnum):
"""Types of wallet events.

Attributes:
LedgerAddressGeneration (0): Nano Ledger has generated an address.
NewOutput (1): A new output was created.
SpentOutput (2): An output was spent.
TransactionInclusion (3): A transaction was included into the ledger.
TransactionProgress (4): A progress update while submitting a transaction.
SelectingInputs (0): Performing input selection.
GeneratingRemainderDepositAddress (1): Generating remainder value deposit address.
PreparedTransaction (2): Prepared transaction.
SigningTransaction (3): Signing the transaction.
PreparedTransactionSigningHash (4): Prepared transaction signing hash hex encoded, required for blindsigning with a Ledger Nano.
PreparedBlockSigningInput (5): Prepared block signing input, required for blindsigning with a Ledger Nano.
Broadcasting (6): Broadcasting.
"""
LedgerAddressGeneration = 0
NewOutput = 1
SpentOutput = 2
TransactionInclusion = 3
TransactionProgress = 4
SelectingInputs = 0
GeneratingRemainderDepositAddress = 1
PreparedTransaction = 2
SigningTransaction = 3
PreparedTransactionSigningHash = 4
PreparedBlockSigningInput = 5
Broadcasting = 6
Loading