diff --git a/package.json b/package.json index 5808eeb2..d3a4445b 100644 --- a/package.json +++ b/package.json @@ -45,8 +45,8 @@ "@cosmjs/tendermint-rpc": "^0.32.3", "bignumber.js": "^9.1.1", "cross-fetch": "4.0.0", - "graphql": "^16.7.1", - "graphql-ws": "^5.14.0", + "graphql": "^16.9.0", + "graphql-ws": "^5.16.0", "pako": "^2.1.0" }, "peerDependencies": { @@ -54,7 +54,7 @@ "@cosmjs/proto-signing": "^0.32.3", "@cosmjs/stargate": "^0.32.3", "@cosmjs/tendermint-rpc": "^0.32.3", - "graphql": "^16.7.1" + "graphql": "^16.9.0" }, "devDependencies": { "@bufbuild/buf": "^1.28.1", 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 { diff --git a/yarn.lock b/yarn.lock index bfd407e7..12f6bb98 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4802,10 +4802,15 @@ graphql-ws@^5.14.0: resolved "https://registry.npmjs.org/graphql-ws/-/graphql-ws-5.14.0.tgz" integrity sha512-itrUTQZP/TgswR4GSSYuwWUzrE/w5GhbwM2GX3ic2U7aw33jgEsayfIlvaj7/GcIvZgNMzsPTrE5hqPuFUiE5g== -graphql@^16.7.1: - version "16.8.0" - resolved "https://registry.npmjs.org/graphql/-/graphql-16.8.0.tgz" - integrity sha512-0oKGaR+y3qcS5mCu1vb7KG+a89vjn06C7Ihq/dDl3jA+A8B3TKomvi3CiEcVLJQGalbu8F52LxkOym7U5sSfbg== +graphql-ws@^5.16.0: + version "5.16.0" + resolved "https://registry.yarnpkg.com/graphql-ws/-/graphql-ws-5.16.0.tgz#849efe02f384b4332109329be01d74c345842729" + integrity sha512-Ju2RCU2dQMgSKtArPbEtsK5gNLnsQyTNIo/T7cZNp96niC1x0KdJNZV0TIoilceBPQwfb5itrGl8pkFeOUMl4A== + +graphql@^16.9.0: + version "16.9.0" + resolved "https://registry.yarnpkg.com/graphql/-/graphql-16.9.0.tgz#1c310e63f16a49ce1fbb230bd0a000e99f6f115f" + integrity sha512-GGTKBX4SD7Wdb8mqeDLni2oaRGYQWjWHGKPQ24ZMnUtKfcsVoiv4uX8+LJr1K6U5VW2Lu1BwJnj7uiori0YtRw== handlebars@^4.7.7: version "4.7.8"