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'] 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() }