From 0207d99f1f9bd6602598b56b87f80e60253da021 Mon Sep 17 00:00:00 2001 From: Julian Compagni Portis Date: Thu, 13 Jun 2024 14:43:45 -0400 Subject: [PATCH 1/5] add updateDexParamsProposal --- src/proposal.ts | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/src/proposal.ts b/src/proposal.ts index 103e805..605fee0 100644 --- a/src/proposal.ts +++ b/src/proposal.ts @@ -61,6 +61,13 @@ export type ParamsCronInfo = { limit: number; }; +export type ParamsDexInfo = { + fee_tiers: number[]; + paused: bool; + max_jits_per_block: number; + good_til_purge_allowance: number; +}; + export type ParamsContractmanagerInfo = { sudo_call_gas_limit: string; }; @@ -437,6 +444,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 => ({ From abda0723771a50266665046e8fd932d3e1ded927 Mon Sep 17 00:00:00 2001 From: Julian Compagni Portis Date: Thu, 13 Jun 2024 14:51:22 -0400 Subject: [PATCH 2/5] fix typo --- src/proposal.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/proposal.ts b/src/proposal.ts index 605fee0..ce6147c 100644 --- a/src/proposal.ts +++ b/src/proposal.ts @@ -63,7 +63,7 @@ export type ParamsCronInfo = { export type ParamsDexInfo = { fee_tiers: number[]; - paused: bool; + paused: boolean; max_jits_per_block: number; good_til_purge_allowance: number; }; From 3c4f6c98b01b388d210105672855c46e70c19194 Mon Sep 17 00:00:00 2001 From: Julian Compagni Portis Date: Thu, 13 Jun 2024 14:56:51 -0400 Subject: [PATCH 3/5] Add submitUpdateParamsDexProposal --- src/dao.ts | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) 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. */ From 623bddc17ce7c539759a2a95ecf99258ec3c34a0 Mon Sep 17 00:00:00 2001 From: Julian Compagni Portis Date: Thu, 13 Jun 2024 15:00:04 -0400 Subject: [PATCH 4/5] add queryDexParams --- src/cosmos.ts | 14 +++++++++----- src/types.ts | 5 +++++ 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/cosmos.ts b/src/cosmos.ts index 060116c..eac50ac 100644 --- a/src/cosmos.ts +++ b/src/cosmos.ts @@ -30,7 +30,8 @@ import { ParamsContractmanagerResponse, ParamsCronResponse, ParamsTokenfactoryResponse, - Strategy, TransferParamsResponse, + Strategy, + TransferParamsResponse, } from './types'; import { DEBUG_SUBMIT_TX, getContractBinary, getHeight } from './env'; import { Message } from '@bufbuild/protobuf'; @@ -213,12 +214,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 +247,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/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; }; From 74dc2097fa80d6bb827766c80141fedd31484441 Mon Sep 17 00:00:00 2001 From: Julian Compagni Portis Date: Thu, 13 Jun 2024 15:02:58 -0400 Subject: [PATCH 5/5] add missing dep --- src/cosmos.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/cosmos.ts b/src/cosmos.ts index eac50ac..229634e 100644 --- a/src/cosmos.ts +++ b/src/cosmos.ts @@ -29,6 +29,7 @@ import { ParamsFeerefunderResponse, ParamsContractmanagerResponse, ParamsCronResponse, + ParamsDexResponse, ParamsTokenfactoryResponse, Strategy, TransferParamsResponse,