:doc:`ManagedBlockchainQuery <../../managedblockchain-query>` / Paginator / ListTokenBalances

*****************
ListTokenBalances
*****************



.. py:class:: ManagedBlockchainQuery.Paginator.ListTokenBalances

  ::

    
    paginator = client.get_paginator('list_token_balances')

  
  

  .. py:method:: paginate(**kwargs)

    Creates an iterator that will paginate through responses from :py:meth:`ManagedBlockchainQuery.Client.list_token_balances`.

    See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/managedblockchain-query-2023-05-04/ListTokenBalances>`_    


    **Request Syntax**
    ::

      response_iterator = paginator.paginate(
          ownerFilter={
              'address': 'string'
          },
          tokenFilter={
              'network': 'ETHEREUM_MAINNET'|'ETHEREUM_SEPOLIA_TESTNET'|'BITCOIN_MAINNET'|'BITCOIN_TESTNET',
              'contractAddress': 'string',
              'tokenId': 'string'
          },
          PaginationConfig={
              'MaxItems': 123,
              'PageSize': 123,
              'StartingToken': 'string'
          }
      )
      
    :type ownerFilter: dict
    :param ownerFilter: 

      The contract or wallet address on the blockchain network by which to filter the request. You must specify the ``address`` property of the ``ownerFilter`` when listing balances of tokens owned by the address.

      

    
      - **address** *(string) --* **[REQUIRED]** 

        The contract or wallet address.

        

      
    
    :type tokenFilter: dict
    :param tokenFilter: **[REQUIRED]** 

      The contract address or a token identifier on the blockchain network by which to filter the request. You must specify the ``contractAddress`` property of this container when listing tokens minted by a contract.

       

      .. note::

        

        You must always specify the network property of this container when using this operation.

        

      

    
      - **network** *(string) --* **[REQUIRED]** 

        The blockchain network of the token.

        

      
      - **contractAddress** *(string) --* 

        This is the address of the contract.

        

      
      - **tokenId** *(string) --* 

        The unique identifier of the token.

        

      
    
    :type PaginationConfig: dict
    :param PaginationConfig: 

      A dictionary that provides parameters to control pagination.

      

    
      - **MaxItems** *(integer) --* 

        The total number of items to return. If the total number of items available is more than the value specified in max-items then a ``NextToken`` will be provided in the output that you can use to resume pagination.

        

      
      - **PageSize** *(integer) --* 

        The size of each page.

        

      
      - **StartingToken** *(string) --* 

        A token to specify where to start paginating. This is the ``NextToken`` from a previous response.

        

      
    
    
    :rtype: dict
    :returns: 
      
      **Response Syntax**

      
      ::

        {
            'tokenBalances': [
                {
                    'ownerIdentifier': {
                        'address': 'string'
                    },
                    'tokenIdentifier': {
                        'network': 'ETHEREUM_MAINNET'|'ETHEREUM_SEPOLIA_TESTNET'|'BITCOIN_MAINNET'|'BITCOIN_TESTNET',
                        'contractAddress': 'string',
                        'tokenId': 'string'
                    },
                    'balance': 'string',
                    'atBlockchainInstant': {
                        'time': datetime(2015, 1, 1)
                    },
                    'lastUpdatedTime': {
                        'time': datetime(2015, 1, 1)
                    }
                },
            ],
            'NextToken': 'string'
        }
        
      **Response Structure**

      

      - *(dict) --* 
        

        - **tokenBalances** *(list) --* 

          An array of ``TokenBalance`` objects. Each object contains details about the token balance.

          
          

          - *(dict) --* 

            The balance of the token.

            
            

            - **ownerIdentifier** *(dict) --* 

              The container for the identifier of the owner.

              
              

              - **address** *(string) --* 

                The contract or wallet address for the owner.

                
          
            

            - **tokenIdentifier** *(dict) --* 

              The identifier for the token, including the unique token ID and its blockchain network.

              
              

              - **network** *(string) --* 

                The blockchain network of the token.

                
              

              - **contractAddress** *(string) --* 

                This is the token's contract address.

                
              

              - **tokenId** *(string) --* 

                The unique identifier of the token.

                 

                .. note::

                  

                  For native tokens, use the 3 character abbreviation that best matches your token. For example, btc for Bitcoin, eth for Ether, etc. For all other token types you must specify the ``tokenId`` in the 64 character hexadecimal ``tokenid`` format.

                  

                
          
            

            - **balance** *(string) --* 

              The container of the token balance.

              
            

            - **atBlockchainInstant** *(dict) --* 

              The time for when the TokenBalance is requested or the current time if a time is not provided in the request.

               

              .. note::

                

                This time will only be recorded up to the second.

                

              
              

              - **time** *(datetime) --* 

                The container of the ``Timestamp`` of the blockchain instant.

                 

                .. note::

                  

                  This ``timestamp`` will only be recorded up to the second.

                  

                
          
            

            - **lastUpdatedTime** *(dict) --* 

              The ``Timestamp`` of the last transaction at which the balance for the token in the wallet was updated.

              
              

              - **time** *(datetime) --* 

                The container of the ``Timestamp`` of the blockchain instant.

                 

                .. note::

                  

                  This ``timestamp`` will only be recorded up to the second.

                  

                
          
        
      
        

        - **NextToken** *(string) --* 

          A token to resume pagination.

          
    