From 9fddf5ea18f98c6de09b8a9bae6ea8e2976da9ae Mon Sep 17 00:00:00 2001 From: Tom Beynon Date: Sat, 18 Jan 2025 14:08:09 +0000 Subject: [PATCH 1/2] Fix Injective ledger voting --- src/adapters/InjectiveSigningAdapter.mjs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/adapters/InjectiveSigningAdapter.mjs b/src/adapters/InjectiveSigningAdapter.mjs index 1833ed2..d8a21a3 100644 --- a/src/adapters/InjectiveSigningAdapter.mjs +++ b/src/adapters/InjectiveSigningAdapter.mjs @@ -84,6 +84,18 @@ export default class InjectiveSigningAdapter extends DefaultSigningAdapter { return txRawEip712 } + toProto(message){ + if(!this.signerProvider.isLedger()){ + return super.toProto(message) + } + + const injMessage = message.toInjective() + return { + typeUrl: injMessage.toDirectSign().type, + value: injMessage.toBinary() + } + } + pubkeyTypeUrl(pub_key){ if(pub_key && pub_key['@type']) return pub_key['@type'] From db66f9786eb9c012c31f5124aec363c7df5e1ed0 Mon Sep 17 00:00:00 2001 From: Tom Beynon Date: Sat, 18 Jan 2025 14:08:56 +0000 Subject: [PATCH 2/2] Support Leap Injective ledger signing --- src/utils/LeapSignerProvider.mjs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/utils/LeapSignerProvider.mjs b/src/utils/LeapSignerProvider.mjs index 449e959..f04ba58 100644 --- a/src/utils/LeapSignerProvider.mjs +++ b/src/utils/LeapSignerProvider.mjs @@ -18,6 +18,10 @@ export default class LeapSignerProvider extends SignerProvider { } } + signEIP712(...args){ + return this.provider.experimentalSignEIP712CosmosTx_v0(...args) + } + available() { return !!this.provider || isMobile() }