Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
maxrobot committed Apr 2, 2024
1 parent fd55e7f commit a088c23
Show file tree
Hide file tree
Showing 5 changed files with 5,407 additions and 0 deletions.
70 changes: 70 additions & 0 deletions contracts/swap/msg.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
use cosmwasm_std::{Addr, Coin};
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};

use injective_cosmwasm::MarketId;
use injective_math::FPDecimal;

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum FeeRecipient {
Address(Addr),
SwapContract,
}

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)]
pub struct InstantiateMsg {
pub fee_recipient: FeeRecipient,
pub admin: Addr,
}

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum ExecuteMsg {
SwapMinOutput {
target_denom: String,
min_output_quantity: FPDecimal,
},
SwapExactOutput {
target_denom: String,
target_output_quantity: FPDecimal,
},
SetRoute {
source_denom: String,
target_denom: String,
route: Vec<MarketId>,
},
DeleteRoute {
source_denom: String,
target_denom: String,
},
UpdateConfig {
admin: Option<Addr>,
fee_recipient: Option<FeeRecipient>,
},
WithdrawSupportFunds {
coins: Vec<Coin>,
target_address: Addr,
},
}

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum QueryMsg {
GetRoute {
source_denom: String,
target_denom: String,
},
GetOutputQuantity {
from_quantity: FPDecimal,
source_denom: String,
target_denom: String,
},
GetInputQuantity {
to_quantity: FPDecimal,
source_denom: String,
target_denom: String,
},
GetAllRoutes {},
GetConfig {},
}
Loading

0 comments on commit a088c23

Please sign in to comment.