Skip to content
This repository has been archived by the owner on Jan 13, 2023. It is now read-only.

Removing transaction symbols from package namespace (2) #202

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions docs/types.rst
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,9 @@ Transaction

.. code:: python

from iota import Address, ProposedTransaction, Tag, Transaction
from iota import Address, Tag
from iota.transaction.base import Transaction
from iota.transaction.creation import ProposedTransaction

txn_1 =\
Transaction.from_tryte_string(
Expand Down Expand Up @@ -263,7 +265,7 @@ Bundle

.. code:: python

from iota import Bundle
from iota.transaction.base import Bundle

bundle = Bundle.from_tryte_strings([
b'GYPRVHBEZOOFXSHQBLCYW9ICTCISLHDBNMMVYD9JJHQMPQCTIQAQTJNNNJ9IDXLRCC...',
Expand Down Expand Up @@ -293,7 +295,8 @@ ProposedBundle

.. code:: python

from iota import Address, ProposedBundle, ProposedTransaction
from iota import Address
from iota.transaction.creation import ProposedBundle, ProposedTransaction
from iota.crypto.signing import KeyGenerator

bundle = ProposedBundle()
Expand Down
4 changes: 3 additions & 1 deletion examples/mam_js_send.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@
import filters as f
from six import binary_type, text_type

from iota import Bundle, Iota, TransactionTrytes
from iota import Iota
from iota.bin import IotaCommandLineApp
from iota.crypto.addresses import AddressGenerator
from iota.filters import Trytes
from iota.json import JsonEncoder
from iota.transaction.base import Bundle
from iota.transaction.types import TransactionTrytes


class IotaMamExample(IotaCommandLineApp):
Expand Down
7 changes: 5 additions & 2 deletions examples/multisig.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,14 @@

from typing import List

from iota import Address, Bundle, BundleValidator, ProposedTransaction, Tag, \
TransactionTrytes, TryteString
from iota import Address, Tag, TryteString
from iota.crypto.types import Digest, PrivateKey, Seed
from iota.multisig import MultisigIota
from iota.multisig.types import MultisigAddress
from iota.transaction.base import Bundle
from iota.transaction.creation import ProposedTransaction
from iota.transaction.types import TransactionTrytes
from iota.transaction.validator import BundleValidator

"""
Step 1: Each participant generates one or more digests that will be
Expand Down
3 changes: 2 additions & 1 deletion examples/routingwrapper_pow.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@

- https://pyota.readthedocs.io/en/develop/adapters.html#routingwrapper
"""
from iota import Address, Iota, ProposedTransaction, Tag, TryteString
from iota import Address, Iota, Tag, TryteString
from iota.adapter.wrappers import RoutingWrapper
from iota.transaction.creation import ProposedTransaction

# Send PoW requests to local node.
# All other requests go to light wallet node.
Expand Down
3 changes: 2 additions & 1 deletion examples/sandbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
from __future__ import absolute_import, division, print_function, \
unicode_literals

from iota import Address, Iota, ProposedTransaction, Tag, TryteString
from iota import Address, Iota, Tag, TryteString
from iota.adapter.sandbox import SandboxAdapter
from iota.transaction.creation import ProposedTransaction

# Create the API client.
api = Iota(
Expand Down
7 changes: 4 additions & 3 deletions examples/send_transfer.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,20 @@
"""
Example script that shows how to use PyOTA to send a transfer to an address.
"""

from argparse import ArgumentParser
from six import text_type
from sys import argv

from address_generator import get_seed, output_seed
from iota import (
__version__,
Address,
Iota,
ProposedTransaction,
Tag,
TryteString,
)
from six import text_type
from address_generator import get_seed, output_seed
from iota.transaction.creation import ProposedTransaction


def main(address, depth, message, tag, uri, value):
Expand Down
1 change: 0 additions & 1 deletion iota/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
# Make some imports accessible from the top level of the package.
# Note that order is important, to prevent circular imports.
from .types import *
from .transaction import *
from .adapter import *
from .api import *
from .trits import *
Expand Down
9 changes: 5 additions & 4 deletions iota/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,19 @@
from __future__ import absolute_import, division, print_function, \
unicode_literals

from typing import Dict, Iterable, Optional, Text

from six import with_metaclass
from typing import Dict, Iterable, Optional, Text

from iota import AdapterSpec, Address, BundleHash, ProposedTransaction, Tag, \
TransactionHash, TransactionTrytes, TryteString, TrytesCompatible
from iota import AdapterSpec, Address, Tag, TryteString, TrytesCompatible
from iota.adapter import BaseAdapter, resolve_adapter
from iota.commands import BaseCommand, CustomCommand, core, \
discover_commands, extended
from iota.commands.extended.helpers import Helpers
from iota.crypto.addresses import AddressGenerator
from iota.crypto.types import Seed
from iota.transaction.creation import ProposedTransaction
from iota.transaction.types import BundleHash, TransactionHash, \
TransactionTrytes

__all__ = [
'InvalidCommand',
Expand Down
2 changes: 1 addition & 1 deletion iota/commands/core/attach_to_tangle.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

import filters as f

from iota import TransactionHash, TransactionTrytes
from iota.commands import FilterCommand, RequestFilter, ResponseFilter
from iota.transaction.types import TransactionHash, TransactionTrytes
from iota.filters import Trytes

__all__ = [
Expand Down
2 changes: 1 addition & 1 deletion iota/commands/core/broadcast_transactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

import filters as f

from iota import TransactionTrytes
from iota.commands import FilterCommand, RequestFilter
from iota.filters import Trytes
from iota.transaction.types import TransactionTrytes

__all__ = [
'BroadcastTransactionsCommand',
Expand Down
2 changes: 1 addition & 1 deletion iota/commands/core/check_consistency.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

import filters as f

from iota import TransactionHash
from iota.commands import FilterCommand, RequestFilter
from iota.filters import Trytes
from iota.transaction.types import TransactionHash

__all__ = [
'CheckConsistencyCommand',
Expand Down
3 changes: 2 additions & 1 deletion iota/commands/core/find_transactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
import filters as f
from six import iteritems

from iota import BundleHash, Tag, TransactionHash
from iota import Tag
from iota.commands import FilterCommand, RequestFilter, ResponseFilter
from iota.filters import AddressNoChecksum, Trytes
from iota.transaction.types import BundleHash, TransactionHash

__all__ = [
'FindTransactionsCommand',
Expand Down
2 changes: 1 addition & 1 deletion iota/commands/core/get_inclusion_states.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

import filters as f

from iota import TransactionHash
from iota.commands import FilterCommand, RequestFilter
from iota.filters import Trytes
from iota.transaction.types import TransactionHash

__all__ = [
'GetInclusionStatesCommand',
Expand Down
2 changes: 1 addition & 1 deletion iota/commands/core/get_node_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

import filters as f

from iota import TransactionHash
from iota.commands import FilterCommand, RequestFilter, ResponseFilter
from iota.filters import Trytes
from iota.transaction.types import TransactionHash

__all__ = [
'GetNodeInfoCommand',
Expand Down
2 changes: 1 addition & 1 deletion iota/commands/core/get_transactions_to_approve.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

import filters as f

from iota import TransactionHash
from iota.commands import FilterCommand, RequestFilter, ResponseFilter
from iota.filters import Trytes
from iota.transaction.types import TransactionHash

__all__ = [
'GetTransactionsToApproveCommand',
Expand Down
2 changes: 1 addition & 1 deletion iota/commands/core/get_trytes.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

import filters as f

from iota import TransactionHash
from iota.commands import FilterCommand, RequestFilter, ResponseFilter
from iota.filters import Trytes
from iota.transaction.types import TransactionHash

__all__ = [
'GetTrytesCommand',
Expand Down
2 changes: 1 addition & 1 deletion iota/commands/core/store_transactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

import filters as f

from iota import TransactionTrytes
from iota.commands import FilterCommand, RequestFilter
from iota.filters import Trytes
from iota.transaction.types import TransactionTrytes

__all__ = [
'StoreTransactionsCommand',
Expand Down
3 changes: 2 additions & 1 deletion iota/commands/extended/get_account_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import filters as f

from iota import Address, TransactionHash
from iota import Address
from iota.commands import FilterCommand, RequestFilter
from iota.commands.core.find_transactions import FindTransactionsCommand
from iota.commands.core.get_balances import GetBalancesCommand
Expand All @@ -16,6 +16,7 @@
from iota.crypto.addresses import AddressGenerator
from iota.crypto.types import Seed
from iota.filters import Trytes, SecurityLevel
from iota.transaction.types import TransactionHash

__all__ = [
'GetAccountDataCommand',
Expand Down
5 changes: 3 additions & 2 deletions iota/commands/extended/get_bundles.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@

import filters as f

from iota import BadApiResponse, Bundle, BundleHash, Transaction, \
TransactionHash, TryteString
from iota import BadApiResponse, TryteString
from iota.commands import FilterCommand, RequestFilter
from iota.commands.core.get_trytes import GetTrytesCommand
from iota.exceptions import with_context
from iota.filters import Trytes
from iota.transaction.base import Bundle, Transaction
from iota.transaction.types import BundleHash, TransactionHash
from iota.transaction.validator import BundleValidator

__all__ = [
Expand Down
2 changes: 1 addition & 1 deletion iota/commands/extended/get_latest_inclusion.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@

import filters as f

from iota import TransactionHash
from iota.commands import FilterCommand, RequestFilter
from iota.commands.core.get_inclusion_states import GetInclusionStatesCommand
from iota.commands.core.get_node_info import GetNodeInfoCommand
from iota.filters import Trytes
from iota.transaction.types import TransactionHash

__all__ = [
'GetLatestInclusionCommand',
Expand Down
4 changes: 2 additions & 2 deletions iota/commands/extended/prepare_transfer.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@

import filters as f

from iota import Address, BadApiResponse, ProposedBundle, \
ProposedTransaction
from iota import Address, BadApiResponse
from iota.commands import FilterCommand, RequestFilter
from iota.commands.core.get_balances import GetBalancesCommand
from iota.commands.extended.get_inputs import GetInputsCommand
Expand All @@ -16,6 +15,7 @@
from iota.crypto.types import Seed
from iota.exceptions import with_context
from iota.filters import GeneratedAddress, SecurityLevel, Trytes
from iota.transaction.creation import ProposedBundle, ProposedTransaction

__all__ = [
'PrepareTransferCommand',
Expand Down
4 changes: 3 additions & 1 deletion iota/commands/extended/promote_transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@

import filters as f

from iota import Address, BadApiResponse, ProposedTransaction, TransactionHash
from iota import Address, BadApiResponse
from iota.commands import FilterCommand, RequestFilter
from iota.commands.core.check_consistency import CheckConsistencyCommand
from iota.commands.extended.send_transfer import SendTransferCommand
from iota.filters import Trytes
from iota.transaction.creation import ProposedTransaction
from iota.transaction.types import TransactionHash

__all__ = [
'PromoteTransactionCommand',
Expand Down
3 changes: 2 additions & 1 deletion iota/commands/extended/replay_bundle.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@

import filters as f

from iota import Bundle, TransactionHash
from iota.commands import FilterCommand, RequestFilter
from iota.commands.extended.get_bundles import GetBundlesCommand
from iota.commands.extended.send_trytes import SendTrytesCommand
from iota.filters import Trytes
from iota.transaction.base import Bundle
from iota.transaction.types import TransactionHash

__all__ = [
'ReplayBundleCommand',
Expand Down
5 changes: 4 additions & 1 deletion iota/commands/extended/send_transfer.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,15 @@

import filters as f

from iota import Address, Bundle, ProposedTransaction, TransactionHash
from iota import Address
from iota.commands import FilterCommand, RequestFilter
from iota.commands.extended.prepare_transfer import PrepareTransferCommand
from iota.commands.extended.send_trytes import SendTrytesCommand
from iota.crypto.types import Seed
from iota.filters import SecurityLevel, Trytes
from iota.transaction.base import Bundle
from iota.transaction.creation import ProposedTransaction
from iota.transaction.types import TransactionHash

__all__ = [
'SendTransferCommand',
Expand Down
3 changes: 2 additions & 1 deletion iota/commands/extended/send_trytes.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@

import filters as f

from iota import TransactionHash, TransactionTrytes, TryteString
from iota import TryteString
from iota.commands import FilterCommand, RequestFilter
from iota.commands.core.attach_to_tangle import AttachToTangleCommand
from iota.commands.core.get_transactions_to_approve import \
GetTransactionsToApproveCommand
from iota.commands.extended.broadcast_and_store import BroadcastAndStoreCommand
from iota.filters import Trytes
from iota.transaction.types import TransactionTrytes, TransactionHash

__all__ = [
'SendTrytesCommand',
Expand Down
5 changes: 3 additions & 2 deletions iota/commands/extended/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@

from typing import Generator, Iterable, List, Optional, Tuple

from iota import Address, Bundle, Transaction, \
TransactionHash
from iota import Address
from iota.adapter import BaseAdapter
from iota.commands.core.find_transactions import FindTransactionsCommand
from iota.commands.core.get_trytes import GetTrytesCommand
Expand All @@ -14,6 +13,8 @@
GetLatestInclusionCommand
from iota.crypto.addresses import AddressGenerator
from iota.crypto.types import Seed
from iota.transaction.base import Bundle, Transaction
from iota.transaction.types import TransactionHash


def find_transaction_objects(adapter, **kwargs):
Expand Down
3 changes: 2 additions & 1 deletion iota/multisig/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@

from typing import Iterable, Optional

from iota import Address, Iota, ProposedTransaction
from iota import Address, Iota
from iota.commands import discover_commands
from iota.crypto.addresses import AddressGenerator
from iota.crypto.types import Digest
from iota.multisig import commands
from iota.multisig.types import MultisigAddress
from iota.transaction.creation import ProposedTransaction

__all__ = [
'MultisigIota',
Expand Down
Loading