import tinkoff_grpc
import market_trade.constants
import tinkoff_grpc.src.users

if __name__ == '__main__':
    api_address = market_trade.constants.TINKOFF_API_ADDRESS
    token = market_trade.constants.TINKOFF_BEARER_TOKEN
    authorization_field = market_trade.constants.TINKOFF_AUTHORIZATION_HEADER
    with tinkoff_grpc.Channel(api_address=api_address,
                              token=token,
                              authorization_field=authorization_field) as tinkoff_channel:
        user_service = tinkoff_grpc.src.users.UserService(tinkoff_channel)
        limits = user_service.get_tariff()
        print(limits)
