Exemple #1
0
    def get_new_addresses(self, index=0, count=1):
        # type: (int, Optional[int]) -> dict
        """
    Generates one or more new addresses from the seed.

    :param index:
      Specify the index of the new address (must be >= 1).

    :param count:
      Number of addresses to generate (must be >= 1).

      Note: This is more efficient than calling ``get_new_address``
      inside a loop.

      If ``None``, this method will scan the Tangle to find the next
      available unused address and return that.

    :return:
      Dict with the following items::

         {
           'addresses': List[Address],
             Always a list, even if only one address was generated.
         }

    References:
      - https://github.com/iotaledger/wiki/blob/master/api-proposal.md#getnewaddress
    """
        return extended.GetNewAddressesCommand(self.adapter)(
            seed=self.seed,
            index=index,
            count=count,
        )
Exemple #2
0
    def get_new_addresses(
        self,
        index=0,
        count=1,
        security_level=AddressGenerator.DEFAULT_SECURITY_LEVEL,
        checksum=False,
    ):
        # type: (int, Optional[int], int, bool) -> dict
        """
        Generates one or more new addresses from the seed.

        :param index:
            The key index of the first new address to generate (must be
            >= 1).

        :param count:
            Number of addresses to generate (must be >= 1).

            .. tip::
                This is more efficient than calling ``get_new_address``
                inside a loop.

            If ``None``, this method will progressively generate
            addresses and scan the Tangle until it finds one that has no
            transactions referencing it.

        :param security_level:
            Number of iterations to use when generating new addresses.

            Larger values take longer, but the resulting signatures are
            more secure.

            This value must be between 1 and 3, inclusive.

        :param checksum:
            Specify whether to return the address with the checksum.
            Defaults to ``False``.

        :return:
            Dict with the following structure::

            {
                'addresses': List[Address],
                    Always a list, even if only one address was
                    generated.
            }

        References:

        - https://github.com/iotaledger/wiki/blob/master/api-proposal.md#getnewaddress
        """
        return extended.GetNewAddressesCommand(self.adapter)(
            count=count,
            index=index,
            securityLevel=security_level,
            checksum=checksum,
            seed=self.seed,
        )
Exemple #3
0
    def get_new_addresses(
        self,
        index=0,
        count=1,
        security_level=AddressGenerator.DEFAULT_SECURITY_LEVEL,
    ):
        # type: (int, Optional[int], int) -> dict
        """
    Generates one or more new addresses from the seed.

    :param index:
      Specify the index of the new address (must be >= 1).

    :param count:
      Number of addresses to generate (must be >= 1).

      Note: This is more efficient than calling ``get_new_address``
      inside a loop.

      If ``None``, this method will scan the Tangle to find the next
      available unused address and return that.

    :param security_level:
      Number of iterations to use when generating new addresses.

      Larger values take longer, but the resulting signatures are more
      secure.

      This value must be between 1 and 3, inclusive.

    :return:
      Dict with the following items::

         {
           'addresses': List[Address],
             Always a list, even if only one address was generated.
         }

    References:
      - https://github.com/iotaledger/wiki/blob/master/api-proposal.md#getnewaddress
    """
        return extended.GetNewAddressesCommand(self.adapter)(
            count=count,
            index=index,
            securityLevel=security_level,
            seed=self.seed,
        )