(self, name: str, params={})
| 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 |
nothing calls this directly
no test coverage detected