1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-07-10 00:28:07 +00:00

fixup! feat(core): add Solana get_public_key and get_address calls

This commit is contained in:
gabrielkerekes 2023-08-09 14:54:41 +02:00
parent e4b0e4d0c0
commit 9cfe8ab7dd
3 changed files with 12 additions and 5 deletions

View File

@ -1,4 +1,8 @@
CURVE = "ed25519"
SLIP44_ID = 501
# TODO SOL: other patterns?
PATTERN = "m/44'/coin_type'/account'/address_index'"
PATTERNS = (
"m/44'/coin_type'", # Ledger compatibility
"m/44'/coin_type'/account'", # Ledger compatibility
"m/44'/coin_type'/account'/address_index'"
)

View File

@ -1,8 +1,9 @@
from typing import TYPE_CHECKING
from trezor.crypto import base58
from apps.common.keychain import with_slip44_keychain
from apps.common.keychain import auto_keychain
from . import CURVE, PATTERNS, SLIP44_ID
if TYPE_CHECKING:
from trezor.messages import SolanaGetAddress, SolanaAddress
@ -10,7 +11,7 @@ if TYPE_CHECKING:
from apps.common.keychain import Keychain
@auto_keychain(__name__)
@with_slip44_keychain(*PATTERNS, slip44_id=SLIP44_ID, curve=CURVE)
async def get_address(
msg: SolanaGetAddress,
keychain: Keychain,

View File

@ -2,7 +2,9 @@ from typing import TYPE_CHECKING
from ubinascii import hexlify
from apps.common import seed
from apps.common.keychain import auto_keychain
from apps.common.keychain import with_slip44_keychain
from . import CURVE, PATTERNS, SLIP44_ID
if TYPE_CHECKING:
from trezor.messages import SolanaGetPublicKey, SolanaPublicKey
@ -10,7 +12,7 @@ if TYPE_CHECKING:
# TODO SOL: maybe only get_address is needed?
@auto_keychain(__name__)
@with_slip44_keychain(*PATTERNS, slip44_id=SLIP44_ID, curve=CURVE)
async def get_public_key(
msg: SolanaGetPublicKey, keychain: Keychain
) -> SolanaPublicKey: