2026-05-15 19:18:10 +03:00

20 lines
444 B
TypeScript

import { toUtf8 } from "@cosmjs/encoding";
import { EncodeObject } from "@cosmjs/proto-signing";
export function createExecuteMsg(
sender: string,
contract: string,
msg: Record<string, unknown>,
funds: { denom: string; amount: string }[] = []
): EncodeObject {
return {
typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract",
value: {
sender,
contract,
msg: toUtf8(JSON.stringify(msg)),
funds,
},
};
}