/cosmwasm.wasm.v1.MsgInstantiateContract2 is one of the few messages that uses a []byte type. The salt field is a byte array, which becomes Uint8Array in JavaScript. Amino encodes byte arrays as base64 strings, but the generated type is just passing the Uint8Array through, which causes signature validation errors.
To fix this, I found the utility function base64FromBytes, which I use in toAmino, and bytesFromBase64, which I use in fromAmino. This seems to work perfectly.
/cosmwasm.wasm.v1.MsgInstantiateContract2
is one of the few messages that uses a[]byte
type. Thesalt
field is a byte array, which becomesUint8Array
in JavaScript. Amino encodes byte arrays as base64 strings, but the generated type is just passing theUint8Array
through, which causes signature validation errors.To fix this, I found the utility function
base64FromBytes
, which I use intoAmino
, andbytesFromBase64
, which I use infromAmino
. This seems to work perfectly.