(self, chainId, privateKey, apiKeyIndex: str, accountIndex: str, params={})
| 383 | }) |
| 384 | |
| 385 | def load_account(self, chainId, privateKey, apiKeyIndex: str, accountIndex: str, params={}): |
| 386 | self.init_auth_object(accountIndex, apiKeyIndex) |
| 387 | cachedAuths = self.safe_dict(self.options['auths'][accountIndex], apiKeyIndex) |
| 388 | signer = self.safe_value(cachedAuths, 'signer') |
| 389 | if signer is not None: |
| 390 | return signer |
| 391 | libraryPath = None |
| 392 | libraryPath, params = self.handle_option_and_params(params, 'loadAccount', 'libraryPath') |
| 393 | lighterPrivateKeyIsSet = (privateKey is not None) and (privateKey != '') |
| 394 | if lighterPrivateKeyIsSet and (libraryPath is not None) and (apiKeyIndex is not None) and (accountIndex is not None): |
| 395 | # load lighter library, and create lighter client |
| 396 | signer = self.load_lighter_library(libraryPath, chainId, privateKey, self.parse_to_int(apiKeyIndex), self.parse_to_int(accountIndex), True) |
| 397 | self.options['auths'][accountIndex][apiKeyIndex]['signer'] = signer |
| 398 | return signer |
| 399 | privateKeyIsSet = (self.privateKey is not None) and (self.privateKey != '') |
| 400 | if privateKeyIsSet and (apiKeyIndex is not None) and (accountIndex is not None): |
| 401 | if len(self.privateKey) > 66: |
| 402 | raise NotSupported(self.id + ' after the latest update(v4.5.50), CCXT now expects the l1 private key to be provided in the credentials. Please check for more details: https://github.com/ccxt/ccxt/wiki/FAQ#how-to-use-the-lighter-exchange-in-ccxt') |
| 403 | # load lighter library without creating lighter client |
| 404 | signer = self.load_lighter_library(libraryPath, chainId, '', self.parse_to_int(apiKeyIndex), self.parse_to_int(accountIndex), False) |
| 405 | self.options['auths'][accountIndex][apiKeyIndex]['signer'] = signer |
| 406 | res = self.change_api_key() |
| 407 | self.handle_builder_fee_approval(self.parse_to_int(accountIndex), self.parse_to_int(apiKeyIndex)) |
| 408 | return res |
| 409 | return signer |
| 410 | |
| 411 | def init_auth_object(self, strAccountIndex: str, strApiKeyIndex: str): |
| 412 | if not ('auths' in self.options): |
no test coverage detected