signerOptions={{
signing: (chain) => {
if (chain === 'chainName') {
return {
signerOptions: {
// Custom account parsing for Ethereum-compatible accounts
parseAccount: (encodedAccount: EncodedMessage) => {
if (encodedAccount.typeUrl === '/ethermint.types.v1.EthAccount') {
const decoder = toDecoder(EthAccount);
const account = decoder.fromPartial(
decoder.decode(encodedAccount.value)
);
const baseAccount =
account.baseVestingAccount?.baseAccount ||
account.baseAccount ||
account;
return baseAccount;
}
},
// Custom public key encoding for Ethereum-compatible accounts
encodePublicKey: (key: IKey): EncodedMessage => {
return {
typeUrl: '/ethermint.crypto.v1.ethsecp256k1.PubKey',
value: Secp256k1PubKey.encode(
Secp256k1PubKey.fromPartial({ key: key.value })
).finish(),
};
},
},
};
}
},
preferredSignType: (chain) => {
if (chain === 'chainName') {
return 'direct';
}
return 'amino';
}
}}