def __init__(self, api_client=None):
     if api_client is None:
         api_client = ApiClient()
     self.api_client = api_client
예제 #2
0
def sandbox_api_client(token):
    sandbox_host = 'https://api-invest.tinkoff.ru/openapi/sandbox/'
    conf = Configuration(host=sandbox_host)

    conf.access_token = token
    return SandboxOpenApi(ApiClient(configuration=conf))
예제 #3
0
def api_client(token):
    host = 'https://api-invest.tinkoff.ru/openapi/'
    conf = Configuration(host=host)
    conf.access_token = token
    return OpenApi(ApiClient(configuration=conf))
예제 #4
0
 def __init__(self, token: str, brocker_id: int):
     self.host = 'https://api-invest.tinkoff.ru/openapi/'
     self.conf = Configuration(host=self.host)
     self.conf.access_token = token
     self.brocker_id = brocker_id
     super().__init__(ApiClient(configuration=self.conf))