Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into feat/cosmjs
Browse files Browse the repository at this point in the history
  • Loading branch information
NeverHappened committed Aug 1, 2024
2 parents 9eb605f + 649e7d9 commit 6c4fb9d
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/dao.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
ParamChangeProposalInfo,
ParamsContractmanagerInfo,
ParamsCronInfo,
ParamsDexInfo,
ParamsFeeburnerInfo,
ParamsFeerefunderInfo,
ParamsGlobalfeeInfo,
Expand Down Expand Up @@ -1496,6 +1497,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<number> {
return await this.submitSingleChoiceProposal(
title,
description,
[chainManagerWrapper(chainManagerAddress, message)],
amount,
);
}

/**
* submitUpdateParamsContractmanagerProposal creates proposal which changes some params of contractmanager module.
*/
Expand Down
28 changes: 28 additions & 0 deletions src/proposal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,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;
};
Expand Down Expand Up @@ -498,6 +505,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 => ({
Expand Down

0 comments on commit 6c4fb9d

Please sign in to comment.