mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-07-12 01:28:10 +00:00
fixup! feat(core): add Solana get_public_key and get_address calls
This commit is contained in:
parent
e4b0e4d0c0
commit
9cfe8ab7dd
@ -1,4 +1,8 @@
|
|||||||
CURVE = "ed25519"
|
CURVE = "ed25519"
|
||||||
SLIP44_ID = 501
|
SLIP44_ID = 501
|
||||||
# TODO SOL: other patterns?
|
# 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'"
|
||||||
|
)
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from trezor.crypto import base58
|
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:
|
if TYPE_CHECKING:
|
||||||
from trezor.messages import SolanaGetAddress, SolanaAddress
|
from trezor.messages import SolanaGetAddress, SolanaAddress
|
||||||
@ -10,7 +11,7 @@ if TYPE_CHECKING:
|
|||||||
from apps.common.keychain import Keychain
|
from apps.common.keychain import Keychain
|
||||||
|
|
||||||
|
|
||||||
@auto_keychain(__name__)
|
@with_slip44_keychain(*PATTERNS, slip44_id=SLIP44_ID, curve=CURVE)
|
||||||
async def get_address(
|
async def get_address(
|
||||||
msg: SolanaGetAddress,
|
msg: SolanaGetAddress,
|
||||||
keychain: Keychain,
|
keychain: Keychain,
|
||||||
|
@ -2,7 +2,9 @@ from typing import TYPE_CHECKING
|
|||||||
from ubinascii import hexlify
|
from ubinascii import hexlify
|
||||||
|
|
||||||
from apps.common import seed
|
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:
|
if TYPE_CHECKING:
|
||||||
from trezor.messages import SolanaGetPublicKey, SolanaPublicKey
|
from trezor.messages import SolanaGetPublicKey, SolanaPublicKey
|
||||||
@ -10,7 +12,7 @@ if TYPE_CHECKING:
|
|||||||
|
|
||||||
|
|
||||||
# TODO SOL: maybe only get_address is needed?
|
# 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(
|
async def get_public_key(
|
||||||
msg: SolanaGetPublicKey, keychain: Keychain
|
msg: SolanaGetPublicKey, keychain: Keychain
|
||||||
) -> SolanaPublicKey:
|
) -> SolanaPublicKey:
|
||||||
|
Loading…
Reference in New Issue
Block a user