From 02b4f749149d87fde288781b48adf79ad9068586 Mon Sep 17 00:00:00 2001 From: abefernan <44572727+abefernan@users.noreply.github.com> Date: Mon, 10 Jul 2023 18:40:48 +0200 Subject: [PATCH] Add new types --- lib/txMsgHelpers.ts | 6 ++++++ types/txMsg.ts | 11 +++++++++++ 2 files changed, 17 insertions(+) diff --git a/lib/txMsgHelpers.ts b/lib/txMsgHelpers.ts index 0654314..9e2f0b9 100644 --- a/lib/txMsgHelpers.ts +++ b/lib/txMsgHelpers.ts @@ -20,6 +20,12 @@ const gasOfMsg = (msgType: MsgTypeUrl): number => { return 100_000; case MsgTypeUrls.Transfer: return 180_000; + case MsgTypeUrls.Execute: + return 150_000; + case MsgTypeUrls.Instantiate: + return 150_000; + case MsgTypeUrls.Instantiate2: + return 150_000; default: throw new Error("Unknown msg type"); } diff --git a/types/txMsg.ts b/types/txMsg.ts index 3c7afc9..0c6db2c 100644 --- a/types/txMsg.ts +++ b/types/txMsg.ts @@ -9,6 +9,11 @@ import { MsgUndelegate, } from "cosmjs-types/cosmos/staking/v1beta1/tx"; import { MsgCreateVestingAccount } from "cosmjs-types/cosmos/vesting/v1beta1/tx"; +import { + MsgExecuteContract, + MsgInstantiateContract, + MsgInstantiateContract2, +} from "cosmjs-types/cosmwasm/wasm/v1/tx"; import { MsgTransfer } from "cosmjs-types/ibc/applications/transfer/v1/tx"; export const MsgTypeUrls = { @@ -20,6 +25,9 @@ export const MsgTypeUrls = { Undelegate: "/cosmos.staking.v1beta1.MsgUndelegate", CreateVestingAccount: "/cosmos.vesting.v1beta1.MsgCreateVestingAccount", Transfer: "/ibc.applications.transfer.v1.MsgTransfer", + Execute: "/cosmwasm.wasm.v1.MsgExecuteContract", + Instantiate: "/cosmwasm.wasm.v1.MsgInstantiateContract", + Instantiate2: "/cosmwasm.wasm.v1.MsgInstantiateContract2", } as const; export type MsgTypeUrl = (typeof MsgTypeUrls)[keyof typeof MsgTypeUrls]; @@ -33,4 +41,7 @@ export const MsgCodecs = { [MsgTypeUrls.Undelegate]: MsgUndelegate, [MsgTypeUrls.CreateVestingAccount]: MsgCreateVestingAccount, [MsgTypeUrls.Transfer]: MsgTransfer, + [MsgTypeUrls.Execute]: MsgExecuteContract, + [MsgTypeUrls.Instantiate]: MsgInstantiateContract, + [MsgTypeUrls.Instantiate2]: MsgInstantiateContract2, };