diff --git a/src/cosmos.ts b/src/cosmos.ts index 060116c..229634e 100644 --- a/src/cosmos.ts +++ b/src/cosmos.ts @@ -29,8 +29,10 @@ import { ParamsFeerefunderResponse, ParamsContractmanagerResponse, ParamsCronResponse, + ParamsDexResponse, ParamsTokenfactoryResponse, - Strategy, TransferParamsResponse, + Strategy, + TransferParamsResponse, } from './types'; import { DEBUG_SUBMIT_TX, getContractBinary, getHeight } from './env'; import { Message } from '@bufbuild/protobuf'; @@ -213,12 +215,9 @@ export class CosmosWrapper { } async queryTransferParams(): Promise { - const req = await axios.get( - `${this.sdk.url}/ibc/apps/transfer/v1/params`, - ); + const req = await axios.get(`${this.sdk.url}/ibc/apps/transfer/v1/params`); return req.data; - } async queryFeeburnerParams(): Promise { @@ -249,6 +248,12 @@ export class CosmosWrapper { return req.data; } + async queryDexParams(): Promise { + const req = await axios.get(`${this.sdk.url}/neutron/dex/params`); + + return req.data; + } + async queryTokenfactoryParams(): Promise { const req = await axios.get( `${this.sdk.url}/osmosis/tokenfactory/v1beta1/params`, diff --git a/src/dao.ts b/src/dao.ts index f92e2d2..e988d24 100644 --- a/src/dao.ts +++ b/src/dao.ts @@ -27,6 +27,7 @@ import { ParamChangeProposalInfo, ParamsContractmanagerInfo, ParamsCronInfo, + ParamsDexInfo, ParamsFeeburnerInfo, ParamsFeerefunderInfo, ParamsGlobalfeeInfo, @@ -1622,6 +1623,25 @@ export class DaoMember { ); } + /** + * submitUpdateParamsDexProposal creates proposal which changes soe params of dex module. + */ + + async submitUpdateParamsDexProposal( + chainManagerAddress: string, + title: string, + description: string, + message: ParamsDexInfo, + amount: string, + ): Promise { + return await this.submitSingleChoiceProposal( + title, + description, + [chainManagerWrapper(chainManagerAddress, message)], + amount, + ); + } + /** * submitUpdateParamsContractmanagerProposal creates proposal which changes some params of contractmanager module. */ diff --git a/src/proposal.ts b/src/proposal.ts index 2b5c0c7..bf89b9d 100644 --- a/src/proposal.ts +++ b/src/proposal.ts @@ -66,6 +66,13 @@ export type ParamsCronInfo = { limit: number; }; +export type ParamsDexInfo = { + fee_tiers: number[]; + paused: boolean; + max_jits_per_block: number; + good_til_purge_allowance: number; +}; + export type ParamsContractmanagerInfo = { sudo_call_gas_limit: string; }; @@ -443,6 +450,27 @@ export const updateCronParamsProposal = (info: ParamsCronInfo): any => ({ }, }); +export const updateDexParamsProposal = (info: ParamsDexInfo): any => ({ + custom: { + submit_admin_proposal: { + admin_proposal: { + proposal_execute_message: { + message: JSON.stringify({ + '@type': '/neutron.dex.MsgUpdateParams', + authority: ADMIN_MODULE_ADDRESS, + params: { + fee_tiers: info.fee_tiers, + paused: info.paused, + max_jits_per_block: info.max_jits_per_block, + good_til_purge_allowance: info.good_til_purge_allowance, + }, + }), + }, + }, + }, + }, +}); + export const updateContractmanagerParamsProposal = ( info: ParamsContractmanagerInfo, ): any => ({ diff --git a/src/types.ts b/src/types.ts index 2dd25cc..24bc8b1 100644 --- a/src/types.ts +++ b/src/types.ts @@ -3,6 +3,7 @@ import bech32 from 'bech32'; import { ParamsContractmanagerInfo, ParamsCronInfo, + ParamsDexInfo, ParamsFeeburnerInfo, ParamsFeerefunderInfo, ParamsInterchainqueriesInfo, @@ -345,6 +346,10 @@ export type ParamsCronResponse = { params: ParamsCronInfo; }; +export type ParamsDexResponse = { + params: ParamsDexInfo; +}; + export type ParamsFeerefunderResponse = { params: ParamsFeerefunderInfo; };