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

Method create_sub_account

python/ccxt/lighter.py:510–529  ·  view source on GitHub ↗
(self, name: str, params={})

Source from the content-addressed store, hash-verified

508 return [self.parse_to_int(accountIndex), params]
509
510 def create_sub_account(self, name: str, params={}):
511 apiKeyIndex = None
512 apiKeyIndex, params = self.handle_api_key_index(params, 'createSubAccount', 'apiKeyIndex', 'api_key_index')
513 accountIndex = None
514 accountIndex, params = self.handle_account_index(params, 'createSubAccount', 'accountIndex', 'account_index')
515 nonce = self.fetch_nonce(accountIndex, apiKeyIndex, params)
516 signRaw = {
517 'nonce': nonce,
518 'api_key_index': apiKeyIndex,
519 'account_index': accountIndex,
520 }
521 strAccountIndex = self.number_to_string(accountIndex)
522 strApiKeyIndex = self.number_to_string(apiKeyIndex)
523 signer = self.load_account(self.options['chainId'], self.get_lighter_private_key(strAccountIndex, strApiKeyIndex), strApiKeyIndex, strAccountIndex, params)
524 txType, txInfo = self.lighter_sign_create_sub_account(signer, self.extend(signRaw, params))
525 request = {
526 'tx_type': txType,
527 'tx_info': txInfo,
528 }
529 return self.publicPostSendTx(request)
530
531 def create_auth(self, params={}):
532 # don't omit [accountIndex, apiKeyIndex], request may need them

Callers

nothing calls this directly

Calls 8

handle_api_key_indexMethod · 0.95
handle_account_indexMethod · 0.95
fetch_nonceMethod · 0.95
load_accountMethod · 0.95
publicPostSendTxMethod · 0.65
extendMethod · 0.45

Tested by

no test coverage detected