diff --git a/src/sdk/msg/eth.ts b/src/sdk/msg/eth.ts index 8f9af639..d93db7bf 100644 --- a/src/sdk/msg/eth.ts +++ b/src/sdk/msg/eth.ts @@ -1,5 +1,6 @@ import { createProtobufRpcClient, QueryClient } from "@cosmjs/stargate" import { + MsgServiceName, MsgClientImpl, MsgConvertCoinToEvm, MsgConvertCoinToEvmResponse, @@ -10,6 +11,21 @@ import { MsgUpdateParams, MsgUpdateParamsResponse, } from "../../protojs/eth/evm/v1/tx" +import { GeneratedType } from "@cosmjs/proto-signing" + +export const ETH_MSG_TYPE_URLS = { + MsgEthereumTx: `/${MsgServiceName}EthereumTx`, + MsgUpdateParams: `/${MsgServiceName}UpdateParams`, + MsgCreateFunToken: `/${MsgServiceName}CreateFunToken`, + MsgConvertCoinToEvm: `/${MsgServiceName}ConvertCoinToEvm`, +} + +export const ethTypes: ReadonlyArray<[string, GeneratedType]> = [ + [ETH_MSG_TYPE_URLS.MsgEthereumTx, MsgEthereumTx], + [ETH_MSG_TYPE_URLS.MsgUpdateParams, MsgUpdateParams], + [ETH_MSG_TYPE_URLS.MsgCreateFunToken, MsgCreateFunToken], + [ETH_MSG_TYPE_URLS.MsgConvertCoinToEvm, MsgConvertCoinToEvm], +] export interface EthMsgExtension { ethereumTx: (body: MsgEthereumTx) => Promise diff --git a/src/sdk/msg/tokenfactory.ts b/src/sdk/msg/tokenfactory.ts index 2b6c1d85..0028c274 100644 --- a/src/sdk/msg/tokenfactory.ts +++ b/src/sdk/msg/tokenfactory.ts @@ -1,5 +1,6 @@ import { createProtobufRpcClient, QueryClient } from "@cosmjs/stargate" import { + MsgServiceName, MsgCreateDenom, MsgClientImpl, MsgCreateDenomResponse, @@ -16,6 +17,27 @@ import { MsgBurnNative, MsgBurnNativeResponse, } from "../../protojs/nibiru/tokenfactory/v1/tx" +import { GeneratedType } from "@cosmjs/proto-signing" + +export const TOKENFACTORY_MSG_TYPE_URLS = { + MsgCreateDenom: `/${MsgServiceName}CreateDenom`, + MsgChangeAdmin: `/${MsgServiceName}ChangeAdmin`, + MsgUpdateModuleParams: `/${MsgServiceName}UpdateModuleParams`, + MsgMint: `/${MsgServiceName}Mint`, + MsgBurn: `/${MsgServiceName}Burn`, + MsgSetDenomMetadata: `/${MsgServiceName}SetDenomMetadata`, + MsgBurnNative: `/${MsgServiceName}BurnNative`, +} + +export const tokenfactoryTypes: ReadonlyArray<[string, GeneratedType]> = [ + [TOKENFACTORY_MSG_TYPE_URLS.MsgCreateDenom, MsgCreateDenom], + [TOKENFACTORY_MSG_TYPE_URLS.MsgChangeAdmin, MsgChangeAdmin], + [TOKENFACTORY_MSG_TYPE_URLS.MsgUpdateModuleParams, MsgUpdateModuleParams], + [TOKENFACTORY_MSG_TYPE_URLS.MsgMint, MsgMint], + [TOKENFACTORY_MSG_TYPE_URLS.MsgBurn, MsgBurn], + [TOKENFACTORY_MSG_TYPE_URLS.MsgSetDenomMetadata, MsgSetDenomMetadata], + [TOKENFACTORY_MSG_TYPE_URLS.MsgBurnNative, MsgBurnNative], +] export interface TokenFactoryMsgExtension { createDenom: (body: MsgCreateDenom) => Promise @@ -57,3 +79,21 @@ export const setupTokenFactoryMsgExtension = ( queryService.BurnNative(MsgBurnNative.fromPartial(body)), } } + +export { + MsgCreateDenom, + MsgClientImpl, + MsgCreateDenomResponse, + MsgChangeAdmin, + MsgChangeAdminResponse, + MsgUpdateModuleParams, + MsgUpdateModuleParamsResponse, + MsgBurn, + MsgBurnResponse, + MsgMint, + MsgMintResponse, + MsgSetDenomMetadata, + MsgSetDenomMetadataResponse, + MsgBurnNative, + MsgBurnNativeResponse, +} diff --git a/src/sdk/tx/txClient.ts b/src/sdk/tx/txClient.ts index 1f1c10fd..4c1ddec8 100644 --- a/src/sdk/tx/txClient.ts +++ b/src/sdk/tx/txClient.ts @@ -13,7 +13,12 @@ import { } from "@cosmjs/stargate" import { Tendermint37Client } from "@cosmjs/tendermint-rpc" import { setupWasmExtension } from "@cosmjs/cosmwasm-stargate" -import { NibiruExtensions, setupNibiruExtension } from ".." +import { + ethTypes, + NibiruExtensions, + setupNibiruExtension, + tokenfactoryTypes, +} from ".." import { accountFromNibiru } from "./account" import { NibiSigningCosmWasmClient, @@ -22,6 +27,8 @@ import { export const nibiruRegistryTypes: ReadonlyArray<[string, GeneratedType]> = [ ...defaultRegistryTypes, + ...tokenfactoryTypes, + ...ethTypes, ] export class NibiruTxClient extends SigningStargateClient {