@@ -4,6 +4,7 @@ import { Secp256k1, Secp256k1Signature } from '@cosmjs/crypto';
44import { makeAuthInfoBytes , makeSignBytes } from '@cosmjs/proto-signing' ;
55
66import { TxRaw } from '../codec/cosmos/tx/v1beta1/tx' ;
7+ import { SignMode } from '../codec/cosmos/tx/signing/v1beta1/signing' ;
78
89import { sha256 } from './encoding' ;
910import { Fee , Doc , SignDoc } from '../types' ;
@@ -17,19 +18,20 @@ import { LumRegistry } from '../registry';
1718 * @param fee requested fee
1819 * @param sequence account sequence number
1920 */
20- export const generateAuthInfoBytes = ( publicKey : Uint8Array , fee : Fee , sequence : number ) : Uint8Array => {
21+ export const generateAuthInfoBytes = ( publicKey : Uint8Array , fee : Fee , sequence : number , signMode : SignMode ) : Uint8Array => {
2122 const pubkeyAny = publicKeyToProto ( publicKey ) ;
2223 const gasLimit = Int53 . fromString ( fee . gas ) . toNumber ( ) ;
23- return makeAuthInfoBytes ( [ pubkeyAny ] , fee . amount , gasLimit , sequence ) ;
24+ return makeAuthInfoBytes ( [ pubkeyAny ] , fee . amount , gasLimit , sequence , signMode ) ;
2425} ;
2526
2627/**
2728 * Generate transaction doc to be signed
2829 *
2930 * @param doc document to create the sign version
3031 * @param publicKey public key used for signature
32+ * @param signMode signing mode for the transaction
3133 */
32- export const generateSignDoc = ( doc : Doc , publicKey : Uint8Array ) : SignDoc => {
34+ export const generateSignDoc = ( doc : Doc , publicKey : Uint8Array , signMode : SignMode ) : SignDoc => {
3335 const txBody = {
3436 messages : doc . messages ,
3537 memo : doc . memo ,
@@ -41,7 +43,7 @@ export const generateSignDoc = (doc: Doc, publicKey: Uint8Array): SignDoc => {
4143
4244 return {
4345 bodyBytes,
44- authInfoBytes : generateAuthInfoBytes ( publicKey , doc . fee , doc . sequence ) ,
46+ authInfoBytes : generateAuthInfoBytes ( publicKey , doc . fee , doc . sequence , signMode ) ,
4547 chainId : doc . chainId ,
4648 accountNumber : Long . fromNumber ( doc . accountNumber ) ,
4749 } ;
0 commit comments