MCPcopy Create free account
hub / github.com/ccxt/ccxt / pre_load_lighter_library

Method pre_load_lighter_library

python/ccxt/lighter.py:435–455  ·  view source on GitHub ↗

if the required credentials are available in options, it will pre-load the lighter Signer to avoid delaying sensitive calls like createOrder the first time they're executed :param dict [params]: extra parameters specific to the exchange API endpoint :returns boolean: True if

(self, params={})

Source from the content-addressed store, hash-verified

433 return self.options['auths'][strAccountIndex][strApiKeyIndex]['lighterPrivateKey']
434
435 def pre_load_lighter_library(self, params={}):
436 """
437 if the required credentials are available in options, it will pre-load the lighter Signer to avoid delaying sensitive calls like createOrder the first time they're executed
438 :param dict [params]: extra parameters specific to the exchange API endpoint
439 :returns boolean: True if the signer was loaded, False otherwise
440 """
441 apiKeyIndex = None
442 apiKeyIndex, params = self.handle_api_key_index(params, 'loadAccount', 'apiKeyIndex', 'api_key_index')
443 accountIndex = None
444 accountIndex, params = self.handle_account_index(params, 'loadAccount', 'accountIndex', 'account_index')
445 if accountIndex is None:
446 raise ArgumentsRequired(self.id + ' requires accountIndex or account_index')
447 strAccountIndex = self.number_to_string(accountIndex)
448 strApiKeyIndex = self.number_to_string(apiKeyIndex)
449 self.init_auth_object(strAccountIndex, strApiKeyIndex)
450 signer = self.safe_dict(self.options['auths'][strAccountIndex][strApiKeyIndex], 'signer')
451 if signer is not None:
452 return True
453 signer = self.load_account(self.options['chainId'], self.get_lighter_private_key(strAccountIndex, strApiKeyIndex), strApiKeyIndex, strAccountIndex)
454 self.handle_builder_fee_approval(accountIndex, apiKeyIndex)
455 return(signer is not None)
456
457 def handle_api_key_index(self, params: object, methodName1: str, optionName1: str, optionName2: str, defaultValue=None) -> List[Any]:
458 apiKeyIndex = None

Callers 1

fetch_currenciesMethod · 0.95

Calls 8

handle_api_key_indexMethod · 0.95
handle_account_indexMethod · 0.95
init_auth_objectMethod · 0.95
load_accountMethod · 0.95
ArgumentsRequiredClass · 0.90
safe_dictMethod · 0.80

Tested by

no test coverage detected