2025-11-24 19:55:38 +01:00

13 lines
665 B
Python

import tinkoff_grpc
import market_trade.constants
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:
instrument_service = tinkoff_grpc.InstrumentsService(tinkoff_channel)
currencies = instrument_service.get_currencies(market_trade.constants.DEFAULT_INSTRUMENT_STATUS)
for currency in currencies:
print(currency.figi, currency.iso_code)