Description
Hi guys, I have a huge problem broadcasting transactions on Cosmos using cosmjs and Ledger connected via Keplr wallet.
My code is working as expected for direct Keplr signing but when it comes to Ledger - some messages works and some not. Usually authz ones are the ones that are not working and return enigmatic cosmos error:
BroadcastTxError: Broadcasting transaction failed with code 4 (codespace: sdk).
Log: signature verification failed; please verify account number (1525623),
sequence (0) and chain-id (cosmoshub-4): unauthorized
I've realized that this error is returned when I am trying to brodcast:
- FeeGrant
- SendAuthorization
Isnt that cosmjs & ledger issue?
EDIT #1
Looks like for both I may have wrong amino converters OR this is not supported by sdk, anyone can point me to how such amino converters should look like or examples for SendAuthorization
and MsgGrantAllowance
with BasicAllowance
(Fee grant)?|
These are messages I want to convert using amino (they are working with direct signing):
#1 Fee grant
{
typeUrl: COSMOS_MESSAGE_TYPE_URL.GRANT_ALLOWANCE,
value: MsgGrantAllowance.fromPartial({
granter: granterAddress,
grantee: granteeAddress,
allowance: {
typeUrl: COSMOS_MESSAGE_TYPE_URL.BASIC_ALLOWANCE,
value: BasicAllowance.encode(
BasicAllowance.fromPartial({
spendLimit: [givenGrantsAmount],
expiration: {
seconds: expiredDateInS,
},
})
).finish(),
},
}),
};
#2 Send Grant
{
typeUrl: COSMOS_MESSAGE_TYPE_URL.GRANT,
value: MsgGrant.fromPartial({
granter: granterAddress,
grantee: granteeAddress,
grant: Grant.fromPartial({
expiration: {
seconds: expiredDateInS,
},
authorization: {
typeUrl: COSMOS_MESSAGE_TYPE_URL.SEND_AUTHORIZATION,
value: SendAuthorization.encode(
SendAuthorization.fromPartial({
allowList: [granteeAddress],
spendLimit: [
formatCompoundSpendLimit(
calculateTransferGrantLimit(delegationAmount)
),
],
})
).finish(),
},
}),
}),
}
PS: MsgGrant converter I was able to create based on restake-ui but with the rest - no luck, any tips and tricks appreciated