-
Notifications
You must be signed in to change notification settings - Fork 142
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: ledger wallet #530
fix: ledger wallet #530
Conversation
- Fixes the missing `getOfflineSigner` implementation - Fixes `StdSignDoc` serialization to JSON. The object MUST be serialized in lexicographical key order - Replace the encoding of `pubkey` in `getAccount` from a `TextEncoder` to using the `fromHex` function.
@@ -1,7 +1,7 @@ | |||
import { ChainRecord, ChainWalletBase, Wallet } from '@cosmos-kit/core'; | |||
|
|||
export class LedgerChianWallet extends ChainWalletBase { | |||
export class LedgerChainWallet extends ChainWalletBase { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix typo and prettify
@@ -39,16 +47,44 @@ export class LedgerClient implements WalletClient { | |||
username: username ?? path, | |||
address, | |||
algo: 'secp256k1' as Algo, | |||
pubkey: new TextEncoder().encode(publicKey), | |||
pubkey: fromHex(publicKey), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We want the publicKey as an hex byte array, not a UTF-8 byte array
Only |
import TransportWebUSB from '@ledgerhq/hw-transport-webusb'; | ||
import TransportWebHID from '@ledgerhq/hw-transport-webhid' | ||
import { chains } from 'chain-registry'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should re-think this
Thanks so much @fmorency :) |
getOfflineSigner
implementationStdSignDoc
serialization to JSON. The object MUST be serialized in lexicographical key order 1pubkey
ingetAccount
from aTextEncoder
to using thefromHex
function@ledgerhq/*
dependenciesFixes #497