Пример #1
0
    def get_balances(self, addresses, threshold=100):
        # type: (Iterable[Address], int) -> dict
        """
    Similar to :py:meth:`get_inclusion_states`. Returns the confirmed
    balance which a list of addresses have at the latest confirmed
    milestone.

    In addition to the balances, it also returns the milestone as well
    as the index with which the confirmed balance was determined.
    The balances are returned as a list in the same order as the
    addresses were provided as input.

    :param addresses:
      List of addresses to get the confirmed balance for.

    :param threshold:
      Confirmation threshold.

    References:
      - https://iota.readme.io/docs/getbalances
    """
        return core.GetBalancesCommand(self.adapter)(
            addresses=addresses,
            threshold=threshold,
        )
Пример #2
0
    def get_balances(
            self,
            addresses,  # type: Iterable[Address]
            threshold=100,  # type: int
            tips=None,  # type: Optional[Iterable[TransactionHash]]
    ):
        # type: (...) -> dict
        """
        Similar to :py:meth:`get_inclusion_states`. Returns the
        confirmed balance which a list of addresses have at the latest
        confirmed milestone.

        In addition to the balances, it also returns the milestone as
        well as the index with which the confirmed balance was
        determined.  The balances are returned as a list in the same
        order as the addresses were provided as input.

        :param addresses:
            List of addresses to get the confirmed balance for.

        :param threshold:
            Confirmation threshold between 0 and 100.

        :param tips:
            Tips whose history of transactions to traverse to find the balance.

        References:

        - https://docs.iota.org/docs/node-software/0.1/iri/references/api-reference#getbalances
        """
        return core.GetBalancesCommand(self.adapter)(
            addresses=addresses,
            threshold=threshold,
            tips=tips,
        )