Add new types

This commit is contained in:
abefernan
2023-07-10 18:40:48 +02:00
parent a272a3c2af
commit 02b4f74914
2 changed files with 17 additions and 0 deletions
+6
View File
@@ -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");
}
+11
View File
@@ -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,
};