-
Notifications
You must be signed in to change notification settings - Fork 32
Open
Description
Viem adapter will not sign when configured with HDAccount, even though this partially inherits the same parent type as an Account class in viem created via other methods (like privateKeyToAccount). Nor does it work supplying the full optional walletClient to the adapter constructor (created with the HDAccount as account).
I don't have the exact error message as I've already implemented the workaround and moved on.
const account: HDAccount = mnemonicToAccount("test test test test test test test test test test test junk");
const options: ViemAdapterOptions = {
provider: publicClient,
signer: account,
};
const adapter = new ViemAdapter(options);
<sign transaction, fails....>
Current workaround:
const privateKey = (walletClient.account as HDAccount).getHdKey().privateKey;
const options: ViemAdapterOptions = {
provider: publicClient,
signer: toHex(privateKey),
};
const adapter = new ViemAdapter(options);
<sign transaction, succeeds....>
Expectation:
- Can instantiate the dapter signer with any account that interfaces
LocalAccount?
I was asked to tag @jeffersonBastos
Metadata
Metadata
Assignees
Labels
No labels