Skip to content

Commit

Permalink
Add WalletEventType (#762)
Browse files Browse the repository at this point in the history
  • Loading branch information
Thoralf-M committed Jul 11, 2023
1 parent 3718d1b commit 136bad1
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bindings/python/examples/exchange/4_listen_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

# This example listens to the NewOutput event.

from iota_sdk import Wallet, SyncOptions
from iota_sdk import Wallet, SyncOptions, WalletEventType
from dotenv import load_dotenv
import json
import os
Expand Down Expand Up @@ -33,7 +33,7 @@ def callback(event):


# Only interested in new outputs here.
wallet.listen(callback, [2])
wallet.listen(callback, [WalletEventType.NewOutput])

account = wallet.get_account('Alice')

Expand Down
1 change: 1 addition & 0 deletions bindings/python/iota_sdk/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from .types.block import *
from .types.burn import *
from .types.common import *
from .types.event import *
from .types.feature import *
from .types.native_token import *
from .types.node_info import *
Expand Down
12 changes: 12 additions & 0 deletions bindings/python/iota_sdk/types/event.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Copyright 2023 IOTA Stiftung
# SPDX-License-Identifier: Apache-2.0

from enum import IntEnum

class WalletEventType(IntEnum):
ConsolidationRequired = 0,
LedgerAddressGeneration = 1,
NewOutput = 2,
SpentOutput = 3,
TransactionInclusion = 4,
TransactionProgress = 5,

0 comments on commit 136bad1

Please sign in to comment.