|
|
|
@ -1,25 +1,17 @@
|
|
|
|
|
from apps.common import HARDENED
|
|
|
|
|
from apps.monero import CURVE
|
|
|
|
|
|
|
|
|
|
if False:
|
|
|
|
|
from apps.monero.xmr.types import *
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def get_creds(keychain, address_n=None, network_type=None):
|
|
|
|
|
from apps.monero.xmr import crypto, monero
|
|
|
|
|
from apps.monero.xmr import monero
|
|
|
|
|
from apps.monero.xmr.credentials import AccountCreds
|
|
|
|
|
|
|
|
|
|
use_slip0010 = 0 not in address_n # If path contains 0 it is not SLIP-0010
|
|
|
|
|
node = keychain.derive(address_n, CURVE)
|
|
|
|
|
|
|
|
|
|
if use_slip0010:
|
|
|
|
|
curve = "ed25519"
|
|
|
|
|
else:
|
|
|
|
|
curve = "secp256k1"
|
|
|
|
|
node = keychain.derive(address_n, curve)
|
|
|
|
|
|
|
|
|
|
if use_slip0010:
|
|
|
|
|
key_seed = node.private_key()
|
|
|
|
|
else:
|
|
|
|
|
key_seed = crypto.cn_fast_hash(node.private_key())
|
|
|
|
|
key_seed = node.private_key()
|
|
|
|
|
spend_sec, _, view_sec, _ = monero.generate_monero_keys(key_seed)
|
|
|
|
|
|
|
|
|
|
creds = AccountCreds.new_wallet(view_sec, spend_sec, network_type)
|
|
|
|
|