diff --git a/Cargo.lock b/Cargo.lock index bb48fb95..ffd4913a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2179,6 +2179,7 @@ dependencies = [ "mars-account-nft", "mars-address-provider", "mars-liquidation", + "mars-mock-astroport-incentives", "mars-mock-incentives", "mars-mock-oracle", "mars-mock-red-bank", @@ -2242,6 +2243,7 @@ name = "mars-integration-tests" version = "2.0.0" dependencies = [ "anyhow", + "astroport 5.0.0-rc.1-tokenfactory", "cosmwasm-std", "cw-it", "cw-multi-test", @@ -2280,6 +2282,19 @@ dependencies = [ "thiserror", ] +[[package]] +name = "mars-mock-astroport-incentives" +version = "2.0.0" +dependencies = [ + "astroport 5.0.0-rc.1-tokenfactory", + "cosmwasm-schema", + "cosmwasm-std", + "cw-storage-plus 1.2.0", + "cw-utils 1.0.3", + "mars-types", + "thiserror", +] + [[package]] name = "mars-mock-credit-manager" version = "2.0.0" @@ -2295,6 +2310,7 @@ name = "mars-mock-incentives" version = "2.0.0" dependencies = [ "cosmwasm-std", + "cw-paginate", "cw-storage-plus 1.2.0", "mars-types", ] @@ -2703,6 +2719,7 @@ dependencies = [ "mars-address-provider", "mars-credit-manager", "mars-incentives", + "mars-mock-astroport-incentives", "mars-mock-incentives", "mars-mock-oracle", "mars-mock-pyth", diff --git a/Cargo.toml b/Cargo.toml index 31216b84..9c38fa1f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,6 +16,7 @@ members = [ "contracts/vault", # mock contracts + "contracts/mock-astroport-incentives", "contracts/mock-credit-manager", "contracts/mock-health", "contracts/mock-incentives", @@ -131,14 +132,15 @@ mars-vault = { path = "./contracts/vault" } mars-zapper-base = { path = "./contracts/v2-zapper/base" } # mocks -mars-mock-credit-manager = { path = "./contracts/mock-credit-manager" } -mars-mock-incentives = { path = "./contracts/mock-incentives" } -mars-mock-oracle = { path = "./contracts/mock-oracle" } -mars-mock-red-bank = { path = "./contracts/mock-red-bank" } -mars-mock-vault = { path = "./contracts/mock-vault" } -mars-mock-rover-health = { path = "./contracts/mock-health" } -mars-swapper-mock = { path = "./contracts/swapper/mock" } -mars-zapper-mock = { path = "./contracts/v2-zapper/mock" } +mars-mock-astroport-incentives = { path = "./contracts/mock-astroport-incentives" } +mars-mock-credit-manager = { path = "./contracts/mock-credit-manager" } +mars-mock-incentives = { path = "./contracts/mock-incentives" } +mars-mock-oracle = { path = "./contracts/mock-oracle" } +mars-mock-red-bank = { path = "./contracts/mock-red-bank" } +mars-mock-vault = { path = "./contracts/mock-vault" } +mars-mock-rover-health = { path = "./contracts/mock-health" } +mars-swapper-mock = { path = "./contracts/swapper/mock" } +mars-zapper-mock = { path = "./contracts/v2-zapper/mock" } [profile.release] codegen-units = 1 diff --git a/contracts/credit-manager/Cargo.toml b/contracts/credit-manager/Cargo.toml index eff6bbcb..f1a768f5 100644 --- a/contracts/credit-manager/Cargo.toml +++ b/contracts/credit-manager/Cargo.toml @@ -36,18 +36,19 @@ mars-vault = { workspace = true } thiserror = { workspace = true } [dev-dependencies] -anyhow = { workspace = true } -cw-multi-test = { workspace = true } -itertools = { workspace = true } -mars-account-nft = { workspace = true } -mars-address-provider = { workspace = true } -mars-mock-incentives = { workspace = true } -mars-mock-oracle = { workspace = true } -mars-mock-red-bank = { workspace = true } -mars-mock-vault = { workspace = true } -mars-params = { workspace = true } -mars-rover-health = { workspace = true } -mars-swapper-mock = { workspace = true } -mars-testing = { workspace = true } -mars-zapper-mock = { workspace = true } -test-case = { workspace = true } +anyhow = { workspace = true } +cw-multi-test = { workspace = true } +itertools = { workspace = true } +mars-account-nft = { workspace = true } +mars-address-provider = { workspace = true } +mars-mock-astroport-incentives = { workspace = true } +mars-mock-incentives = { workspace = true } +mars-mock-oracle = { workspace = true } +mars-mock-red-bank = { workspace = true } +mars-mock-vault = { workspace = true } +mars-params = { workspace = true } +mars-rover-health = { workspace = true } +mars-swapper-mock = { workspace = true } +mars-testing = { workspace = true } +mars-zapper-mock = { workspace = true } +test-case = { workspace = true } diff --git a/contracts/credit-manager/src/claim_astro_lp_rewards.rs b/contracts/credit-manager/src/claim_astro_lp_rewards.rs new file mode 100644 index 00000000..14d46698 --- /dev/null +++ b/contracts/credit-manager/src/claim_astro_lp_rewards.rs @@ -0,0 +1,38 @@ +use cosmwasm_std::{DepsMut, Response}; +use mars_types::traits::Stringify; + +use crate::{ + error::{ContractError, ContractResult}, + state::INCENTIVES, + utils::increment_coin_balance, +}; + +pub fn claim_lp_rewards( + deps: DepsMut, + account_id: &str, + lp_denom: &str, +) -> ContractResult { + let incentives = INCENTIVES.load(deps.storage)?; + + // Query rewards user is receiving, update balance + let rewards = incentives.query_staked_astro_lp_rewards(&deps.querier, account_id, lp_denom)?; + if rewards.is_empty() { + return Err(ContractError::NoAmount); + } + + for reward in rewards.iter() { + increment_coin_balance(deps.storage, account_id, reward)?; + } + + let claim_rewards_msg = incentives.claim_staked_astro_lp_rewards_msg(account_id, lp_denom)?; + let mut res = Response::new() + .add_message(claim_rewards_msg) + .add_attribute("action", "claim_astro_lp_rewards") + .add_attribute("account_id", account_id); + + if !rewards.is_empty() { + res = res.add_attribute("rewards", rewards.as_slice().to_string()); + } + + Ok(res) +} diff --git a/contracts/credit-manager/src/error.rs b/contracts/credit-manager/src/error.rs index 7eb0de9a..7c598ee9 100644 --- a/contracts/credit-manager/src/error.rs +++ b/contracts/credit-manager/src/error.rs @@ -90,6 +90,12 @@ pub enum ContractError { reason: String, }, + #[error("Insufficient funds. Requested {requested:?}, available {available:?}")] + InsufficientFunds { + requested: Uint128, + available: Uint128, + }, + #[error("{reason:?}")] InvalidConfig { reason: String, diff --git a/contracts/credit-manager/src/execute.rs b/contracts/credit-manager/src/execute.rs index 2280bda0..1fe67568 100644 --- a/contracts/credit-manager/src/execute.rs +++ b/contracts/credit-manager/src/execute.rs @@ -13,6 +13,7 @@ use mars_vault::msg::{ExecuteMsg, ExtensionExecuteMsg}; use crate::{ borrow::borrow, + claim_astro_lp_rewards::claim_lp_rewards, claim_rewards::{claim_rewards, send_rewards}, deposit::{assert_deposit_caps, deposit}, error::{ContractError, ContractResult}, @@ -25,8 +26,10 @@ use crate::{ reclaim::reclaim, refund::refund_coin_balances, repay::{repay, repay_for_recipient}, + stake_astro_lp::stake_lp, state::{ACCOUNT_KINDS, ACCOUNT_NFT, REENTRANCY_GUARD}, swap::swap_exact_in, + unstake_astro_lp::unstake_lp, update_coin_balances::{update_coin_balance, update_coin_balance_after_vault_liquidation}, utils::{assert_is_token_owner, get_account_kind}, vault::{ @@ -316,6 +319,24 @@ pub fn dispatch_actions( lp_token, slippage, }), + Action::StakeAstroLp { + lp_token, + } => callbacks.push(CallbackMsg::StakeAstroLp { + account_id: account_id.to_string(), + lp_token, + }), + Action::UnstakeAstroLp { + lp_token, + } => callbacks.push(CallbackMsg::UnstakeAstroLp { + account_id: account_id.to_string(), + lp_token, + }), + Action::ClaimAstroLpRewards { + lp_denom, + } => callbacks.push(CallbackMsg::ClaimAstroLpRewards { + account_id: account_id.to_string(), + lp_denom, + }), Action::RefundAllCoinBalances {} => { callbacks.push(CallbackMsg::RefundAllCoinBalances { account_id: account_id.to_string(), @@ -580,5 +601,17 @@ pub fn execute_callback( previous_balances, recipient, } => send_rewards(deps, &env.contract.address, &account_id, recipient, previous_balances), + CallbackMsg::StakeAstroLp { + account_id, + lp_token, + } => stake_lp(deps, &account_id, lp_token), + CallbackMsg::UnstakeAstroLp { + account_id, + lp_token, + } => unstake_lp(deps, &account_id, lp_token), + CallbackMsg::ClaimAstroLpRewards { + account_id, + lp_denom, + } => claim_lp_rewards(deps, &account_id, &lp_denom), } } diff --git a/contracts/credit-manager/src/lib.rs b/contracts/credit-manager/src/lib.rs index fe6be5fe..5fc323d7 100644 --- a/contracts/credit-manager/src/lib.rs +++ b/contracts/credit-manager/src/lib.rs @@ -1,4 +1,5 @@ pub mod borrow; +pub mod claim_astro_lp_rewards; pub mod claim_rewards; pub mod contract; pub mod deposit; @@ -16,8 +17,10 @@ pub mod query; pub mod reclaim; pub mod refund; pub mod repay; +pub mod stake_astro_lp; pub mod state; pub mod swap; +pub mod unstake_astro_lp; pub mod update_coin_balances; pub mod update_config; pub mod utils; diff --git a/contracts/credit-manager/src/query.rs b/contracts/credit-manager/src/query.rs index 4dba4e0d..ff683361 100644 --- a/contracts/credit-manager/src/query.rs +++ b/contracts/credit-manager/src/query.rs @@ -70,6 +70,9 @@ pub fn query_positions(deps: Deps, account_id: &str) -> ContractResult ContractResult { + let incentives = INCENTIVES.load(deps.storage)?; + + // Query rewards user is receiving to update their balances + let rewards = incentives.query_staked_astro_lp_rewards( + &deps.querier, + account_id, + lp_coin.denom.as_str(), + )?; + + let coin_balance = + COIN_BALANCES.may_load(deps.storage, (account_id, &lp_coin.denom))?.unwrap_or_default(); + let new_amount = match lp_coin.amount { + ActionAmount::Exact(amt) => amt, + ActionAmount::AccountBalance => coin_balance, + }; + + let updated_coin = coin(new_amount.u128(), lp_coin.denom.as_str()); + + decrement_coin_balance(deps.storage, account_id, &updated_coin)?; + + for reward in rewards.iter() { + increment_coin_balance(deps.storage, account_id, reward)?; + } + + // stake msg + let stake_msg = incentives.stake_astro_lp_msg(account_id, updated_coin)?; + let mut res = Response::new() + .add_message(stake_msg) + .add_attribute("action", "stake_astro_lp") + .add_attribute("account_id", account_id); + + if !rewards.is_empty() { + res = res.add_attribute("rewards", rewards.as_slice().to_string()); + } + + Ok(res) +} diff --git a/contracts/credit-manager/src/unstake_astro_lp.rs b/contracts/credit-manager/src/unstake_astro_lp.rs new file mode 100644 index 00000000..c04ec4e0 --- /dev/null +++ b/contracts/credit-manager/src/unstake_astro_lp.rs @@ -0,0 +1,63 @@ +use cosmwasm_std::{coin, DepsMut, Response}; +use mars_types::{ + credit_manager::{ActionAmount, ActionCoin}, + traits::Stringify, +}; + +use crate::{ + error::{ContractError, ContractResult}, + state::INCENTIVES, + utils::increment_coin_balance, +}; + +pub fn unstake_lp( + deps: DepsMut, + account_id: &str, + lp_coin: ActionCoin, +) -> ContractResult { + let incentives = INCENTIVES.load(deps.storage)?; + + // Query rewards user is receiving, update balance + let lp_position = incentives.query_staked_astro_lp_position( + &deps.querier, + account_id, + lp_coin.denom.as_str(), + )?; + + for reward in lp_position.rewards.iter() { + increment_coin_balance(deps.storage, account_id, reward)?; + } + + let new_amount = match lp_coin.amount { + ActionAmount::Exact(amt) => { + if lp_position.lp_coin.amount.lt(&amt) { + return Err(ContractError::InsufficientFunds { + requested: amt, + available: lp_position.lp_coin.amount, + }); + } else { + lp_position.lp_coin.amount.checked_sub(amt)? + } + } + ActionAmount::AccountBalance => lp_position.lp_coin.amount, + }; + + let updated_coin = coin(new_amount.u128(), lp_coin.denom.as_str()); + + increment_coin_balance(deps.storage, account_id, &updated_coin)?; + + // unstake msg + let unstake_msg = incentives.unstake_astro_lp_msg(account_id, &updated_coin)?; + + let mut res = Response::new() + .add_message(unstake_msg) + .add_attribute("action", "unstake_astro_lp") + .add_attribute("account_id", account_id) + .add_attribute("lp_unstaked", updated_coin.to_string()); + + if !lp_position.rewards.is_empty() { + res = res.add_attribute("rewards", lp_position.rewards.as_slice().to_string()); + } + + Ok(res) +} diff --git a/contracts/credit-manager/tests/tests/mod.rs b/contracts/credit-manager/tests/tests/mod.rs index 64fac5af..60f0c45e 100644 --- a/contracts/credit-manager/tests/tests/mod.rs +++ b/contracts/credit-manager/tests/tests/mod.rs @@ -1,6 +1,7 @@ pub use mars_testing::multitest::helpers; mod test_borrow; +mod test_claim_astro_lp_rewards; mod test_claim_rewards; mod test_coin_balances; mod test_create_credit_account; @@ -30,7 +31,9 @@ mod test_refund_balances; mod test_repay; mod test_repay_for_recipient; mod test_repay_from_wallet; +mod test_stake_astro_lp; mod test_swap; +mod test_unstake_astro_lp; mod test_update_admin; mod test_update_config; mod test_update_credit_account_with_new_acc; diff --git a/contracts/credit-manager/tests/tests/test_claim_astro_lp_rewards.rs b/contracts/credit-manager/tests/tests/test_claim_astro_lp_rewards.rs new file mode 100644 index 00000000..7449949c --- /dev/null +++ b/contracts/credit-manager/tests/tests/test_claim_astro_lp_rewards.rs @@ -0,0 +1,135 @@ +use cosmwasm_std::{Addr, Coin, Uint128}; +use mars_credit_manager::error::ContractError; +use mars_testing::multitest::helpers::{assert_err, coin_info}; +use mars_types::credit_manager::Action; + +use super::helpers::{uosmo_info, MockEnv}; + +#[test] +fn claiming_rewards_when_there_are_none() { + let mut mock = MockEnv::new().build().unwrap(); + + let user = Addr::unchecked("user"); + let account_id = mock.create_credit_account(&user).unwrap(); + let lp_denom = "factory12345"; + + let unclaimed = mock.query_staked_astro_lp_rewards(&account_id, lp_denom); + assert!(unclaimed.is_empty()); + + let res = mock.update_credit_account( + &account_id, + &user, + vec![Action::ClaimAstroLpRewards { + lp_denom: lp_denom.to_string(), + }], + &[], + ); + assert_err(res, ContractError::NoAmount); +} + +#[test] +fn claiming_a_single_reward() { + let coin_info = uosmo_info(); + let mut mock = MockEnv::new().build().unwrap(); + + let user = Addr::unchecked("user"); + let account_id = mock.create_credit_account(&user).unwrap(); + let lp_denom = "factory12345"; + let reward = Coin { + denom: coin_info.denom.clone(), + amount: Uint128::new(1000000), + }; + + let unclaimed = mock.query_staked_astro_lp_rewards(&account_id, lp_denom); + assert!(unclaimed.is_empty()); + + mock.add_astro_incentive_reward(&account_id, lp_denom, reward.clone()); + + let unclaimed = mock.query_staked_astro_lp_rewards(&account_id, lp_denom); + assert_eq!(unclaimed.len(), 1); + + // Check account id deposit balance + let positions = mock.query_positions(&account_id); + assert_eq!(positions.deposits.len(), 0); + + mock.update_credit_account( + &account_id, + &user, + vec![Action::ClaimAstroLpRewards { + lp_denom: lp_denom.to_string(), + }], + &[], + ) + .unwrap(); + + // Check account id deposit balance + let positions = mock.query_positions(&account_id); + assert_eq!(positions.deposits.len(), 1); + assert_eq!(positions.deposits[0].denom, reward.denom.clone()); + assert_eq!(positions.deposits[0].amount, reward.amount); + + let coin = mock.query_balance(&mock.rover, &reward.denom); + assert_eq!(coin.amount, reward.amount); +} + +#[test] +fn claiming_multiple_rewards() { + let osmo_info = uosmo_info(); + let atom_info = coin_info("atom"); + let mut mock = MockEnv::new().build().unwrap(); + + let user = Addr::unchecked("user"); + let account_id = mock.create_credit_account(&user).unwrap(); + let lp_denom = "factory12345"; + + let reward_1 = Coin { + denom: osmo_info.denom.clone(), + amount: Uint128::new(1000000), + }; + + let reward_2 = Coin { + denom: atom_info.denom.clone(), + amount: Uint128::new(1000000), + }; + + let unclaimed = mock.query_staked_astro_lp_rewards(&account_id, lp_denom); + assert!(unclaimed.is_empty()); + + mock.add_astro_incentive_reward(&account_id, lp_denom, reward_1.clone()); + mock.add_astro_incentive_reward(&account_id, lp_denom, reward_2.clone()); + + let unclaimed = mock.query_staked_astro_lp_rewards(&account_id, lp_denom); + assert_eq!(unclaimed.len(), 2); + + // Check account id deposit balance + let positions = mock.query_positions(&account_id); + assert_eq!(positions.deposits.len(), 0); + + mock.update_credit_account( + &account_id, + &user, + vec![Action::ClaimAstroLpRewards { + lp_denom: lp_denom.to_string(), + }], + &[], + ) + .unwrap(); + + // Check account id deposit balance + let positions = mock.query_positions(&account_id); + assert_eq!(positions.deposits.len(), 2); + assert_eq!(positions.deposits[1].denom, reward_1.denom.clone()); + assert_eq!(positions.deposits[1].amount, reward_1.amount); + assert_eq!(positions.deposits[0].denom, reward_2.denom.clone()); + assert_eq!(positions.deposits[0].amount, reward_2.amount); + + // Check contract has assets + let reward_balance_1 = mock.query_balance(&mock.rover, &reward_1.denom); + assert_eq!(reward_balance_1.amount, reward_1.amount); + let reward_balance_2 = mock.query_balance(&mock.rover, &reward_2.denom); + assert_eq!(reward_balance_2.amount, reward_2.amount); + + // Assert no LP coins in the contract + let lp_coin = mock.query_balance(&mock.rover, lp_denom); + assert!(lp_coin.amount.is_zero()); +} diff --git a/contracts/credit-manager/tests/tests/test_stake_astro_lp.rs b/contracts/credit-manager/tests/tests/test_stake_astro_lp.rs new file mode 100644 index 00000000..7fb26f9d --- /dev/null +++ b/contracts/credit-manager/tests/tests/test_stake_astro_lp.rs @@ -0,0 +1,97 @@ +use cosmwasm_std::{coins, Addr, Coin, Uint128}; +use mars_testing::multitest::helpers::AccountToFund; +use mars_types::credit_manager::{Action, ActionAmount, ActionCoin}; + +use super::helpers::MockEnv; + +#[test] +fn stake_claims_rewards() { + let user = Addr::unchecked("user"); + let lp_denom = "factory12345"; + + let mut mock = MockEnv::new() + .fund_account(AccountToFund { + addr: user.clone(), + funds: coins(200, lp_denom), + }) + .build() + .unwrap(); + + let account_id: String = mock.create_credit_account(&user).unwrap(); + + // Query staked LP, verify is 0 + let staked_lp_response = mock.query_staked_lp_position(&account_id, lp_denom); + assert!(staked_lp_response.lp_coin.amount.is_zero()); + + let lp_coin = Coin { + denom: lp_denom.to_string(), + amount: Uint128::new(200), + }; + + // stake + mock.update_credit_account( + &account_id, + &user, + vec![ + Action::Deposit(lp_coin.clone()), + Action::StakeAstroLp { + lp_token: ActionCoin { + denom: lp_denom.to_string(), + amount: ActionAmount::Exact(Uint128::new(100)), + }, + }, + ], + &[lp_coin.clone()], + ) + .unwrap(); + + // Add rewards + let reward = Coin { + denom: "uastro".to_string(), + amount: Uint128::new(10000000), + }; + + mock.add_astro_incentive_reward(&account_id, lp_denom, reward.clone()); + + let unclaimed = mock.query_staked_astro_lp_rewards(&account_id, lp_denom); + assert_eq!(unclaimed.len(), 1); + + let positions = mock.query_positions(&account_id); + assert_eq!(positions.staked_lp.len(), 1); + // 100 staked LP, 100 unstaked lp + assert_eq!(positions.staked_lp[0].denom, lp_coin.denom); + assert_eq!(positions.staked_lp[0].amount, Uint128::new(100)); + assert_eq!(positions.deposits.len(), 1); + assert_eq!(positions.deposits[0].denom, lp_coin.denom); + assert_eq!(positions.deposits[0].amount, Uint128::new(100)); + + // Assert correct lp balance in contract + let lp_coin = mock.query_balance(&mock.rover, lp_denom); + assert_eq!(positions.deposits[0].amount, lp_coin.amount); + + // stake again + mock.update_credit_account( + &account_id, + &user, + vec![Action::StakeAstroLp { + lp_token: ActionCoin { + denom: lp_denom.to_string(), + amount: ActionAmount::AccountBalance, + }, + }], + &[], + ) + .unwrap(); + + let positions = mock.query_positions(&account_id); + assert_eq!(positions.staked_lp.len(), 1); + assert_eq!(positions.staked_lp[0].denom, lp_denom); + assert_eq!(positions.staked_lp[0].amount, Uint128::new(200)); + assert_eq!(positions.deposits.len(), 1); + assert_eq!(positions.deposits[0].denom, reward.denom); + assert_eq!(positions.deposits[0].amount, reward.amount); + + // Assert correct lp balance in contract + let lp_coin = mock.query_balance(&mock.rover, lp_denom); + assert!(lp_coin.amount.is_zero()); +} diff --git a/contracts/credit-manager/tests/tests/test_unstake_astro_lp.rs b/contracts/credit-manager/tests/tests/test_unstake_astro_lp.rs new file mode 100644 index 00000000..2aea4c89 --- /dev/null +++ b/contracts/credit-manager/tests/tests/test_unstake_astro_lp.rs @@ -0,0 +1,196 @@ +use cosmwasm_std::{coin, coins, Addr, Coin, Uint128}; +use mars_credit_manager::error::ContractError; +use mars_testing::multitest::helpers::{assert_err, uosmo_info, AccountToFund}; +use mars_types::credit_manager::{Action, ActionAmount, ActionCoin}; + +use super::helpers::MockEnv; + +#[test] +fn unstake_fails_if_no_lp_staked() { + let mut mock = MockEnv::new().build().unwrap(); + + let user = Addr::unchecked("user"); + let account_id: String = mock.create_credit_account(&user).unwrap(); + let lp_denom = "factory12345"; + + // Query staked LP, verify is 0 + let staked_lp = mock.query_staked_lp_position(&account_id, lp_denom); + assert!(staked_lp.lp_coin.amount.is_zero()); + + // Unstake + let res = mock.update_credit_account( + &account_id, + &user, + vec![Action::UnstakeAstroLp { + lp_token: ActionCoin { + denom: lp_denom.to_string(), + amount: ActionAmount::Exact(Uint128::new(100)), + }, + }], + &[], + ); + assert_err( + res, + ContractError::InsufficientFunds { + requested: Uint128::new(100u128), + available: Uint128::zero(), + }, + ); +} + +#[test] +fn unstake() { + let user = Addr::unchecked("user"); + let lp_denom = "factory12345"; + + let mut mock = MockEnv::new() + .fund_account(AccountToFund { + addr: user.clone(), + funds: coins(100, lp_denom), + }) + .build() + .unwrap(); + + let account_id: String = mock.create_credit_account(&user).unwrap(); + + // Query staked LP, verify is 0 + let staked_lp_response = mock.query_staked_lp_position(&account_id, lp_denom); + + assert!(staked_lp_response.lp_coin.amount.is_zero()); + + let lp_coin = Coin { + denom: lp_denom.to_string(), + amount: Uint128::new(100), + }; + + // stake + mock.update_credit_account( + &account_id, + &user, + vec![ + Action::Deposit(lp_coin.clone()), + Action::StakeAstroLp { + lp_token: ActionCoin::from(&lp_coin.clone()), + }, + ], + &[lp_coin.clone()], + ) + .unwrap(); + + // Unstake 50% + mock.update_credit_account( + &account_id, + &user, + vec![Action::UnstakeAstroLp { + lp_token: ActionCoin { + denom: lp_denom.to_string(), + amount: ActionAmount::Exact(Uint128::new(50)), + }, + }], + &[], + ) + .unwrap(); + + let positions = mock.query_positions(&account_id); + assert_eq!(positions.staked_lp.len(), 1); + assert_eq!(positions.deposits[0].denom, lp_denom.to_string()); + assert_eq!(positions.deposits[0].amount, Uint128::new(50)); + + // Assert correct lp balance in contract + let cm_lp_coin = mock.query_balance(&mock.rover, lp_denom); + assert_eq!(positions.deposits[0].amount, cm_lp_coin.amount); + + // Entire remaining amount + mock.update_credit_account( + &account_id, + &user, + vec![Action::UnstakeAstroLp { + lp_token: ActionCoin { + denom: lp_denom.to_string(), + amount: ActionAmount::AccountBalance, + }, + }], + &[], + ) + .unwrap(); + + let positions = mock.query_positions(&account_id); + assert_eq!(positions.staked_lp.len(), 0); + assert_eq!(positions.deposits.len(), 1); + assert_eq!(positions.deposits[0].denom, lp_denom.to_string()); + assert_eq!(positions.deposits[0].amount, Uint128::new(100)); + + // Assert correct lp balance in contract + let cm_lp_coin = mock.query_balance(&mock.rover, lp_denom); + assert_eq!(cm_lp_coin.amount, lp_coin.amount); +} + +#[test] +fn unstake_claims_rewards() { + let user = Addr::unchecked("user"); + let lp_denom = "factory12345"; + let coin_info = uosmo_info(); + + let mut mock = MockEnv::new() + .fund_account(AccountToFund { + addr: user.clone(), + funds: coins(100, lp_denom), + }) + .build() + .unwrap(); + + let user = Addr::unchecked("user"); + let account_id = mock.create_credit_account(&user).unwrap(); + let lp_amount = Uint128::new(100); + + let reward = coin(1000000u128, coin_info.denom.clone()); + let lp_coin = coin(lp_amount.u128(), lp_denom.to_string()); + + // stake + mock.update_credit_account( + &account_id, + &user, + vec![ + Action::Deposit(lp_coin.clone()), + Action::StakeAstroLp { + lp_token: ActionCoin { + denom: lp_denom.to_string(), + amount: ActionAmount::AccountBalance, + }, + }, + ], + &[lp_coin], + ) + .unwrap(); + + // add rewards + mock.add_astro_incentive_reward(&account_id, lp_denom, reward.clone()); + + // Unstake 50% + mock.update_credit_account( + &account_id, + &user, + vec![Action::UnstakeAstroLp { + lp_token: ActionCoin { + denom: lp_denom.to_string(), + amount: ActionAmount::Exact(Uint128::new(50)), + }, + }], + &[], + ) + .unwrap(); + + let positions = mock.query_positions(&account_id); + assert_eq!(positions.staked_lp.len(), 1); + assert_eq!(positions.staked_lp[0].denom, lp_denom.to_string()); + assert_eq!(positions.staked_lp[0].amount, Uint128::new(50)); + assert_eq!(positions.deposits.len(), 2); + assert_eq!(positions.deposits[0].denom, lp_denom.to_string()); + assert_eq!(positions.deposits[0].amount, Uint128::new(50)); + assert_eq!(positions.deposits[1].denom, coin_info.denom); + assert_eq!(positions.deposits[1].amount, reward.amount); + + // Assert correct lp balance in contract + let lp_coin = mock.query_balance(&mock.rover, lp_denom); + assert_eq!(positions.deposits[0].amount, lp_coin.amount); +} diff --git a/contracts/health/tests/tests/test_health_state.rs b/contracts/health/tests/tests/test_health_state.rs index 747c3102..9432b27d 100644 --- a/contracts/health/tests/tests/test_health_state.rs +++ b/contracts/health/tests/tests/test_health_state.rs @@ -25,6 +25,7 @@ fn zero_debts_results_in_healthy_state() { debts: vec![], lends: vec![], vaults: vec![], + staked_lp: vec![], }, ); @@ -61,6 +62,7 @@ fn computing_health_when_healthy() { }], lends: vec![], vaults: vec![], + staked_lp: vec![], }, ); @@ -96,6 +98,7 @@ fn computing_health_when_unhealthy() { }], lends: vec![], vaults: vec![], + staked_lp: vec![], }, ); diff --git a/contracts/health/tests/tests/test_health_values.rs b/contracts/health/tests/tests/test_health_values.rs index 7e415733..a65ea123 100644 --- a/contracts/health/tests/tests/test_health_values.rs +++ b/contracts/health/tests/tests/test_health_values.rs @@ -58,6 +58,7 @@ fn computes_correct_position_with_zero_assets() { debts: vec![], lends: vec![], vaults: vec![], + staked_lp: vec![], }, ); @@ -104,6 +105,7 @@ fn adds_vault_base_denoms_to_oracle_and_red_bank() { }]), }), }], + staked_lp: vec![], }, ); @@ -219,6 +221,7 @@ fn whitelisted_coins_work() { debts: vec![], lends: vec![], vaults: vec![], + staked_lp: vec![], }, ); @@ -276,6 +279,7 @@ fn vault_whitelist_affects_max_ltv() { vault: vault.clone(), amount: VaultPositionAmount::Unlocked(VaultAmount::new(vault_token_amount)), }], + staked_lp: vec![], }, ); @@ -377,6 +381,7 @@ fn not_whitelisted_coins_work() { debts: vec![], lends: vec![], vaults: vec![], + staked_lp: vec![], }, ); diff --git a/contracts/health/tests/tests/test_hls.rs b/contracts/health/tests/tests/test_hls.rs index 5b58082a..1d9485a4 100644 --- a/contracts/health/tests/tests/test_hls.rs +++ b/contracts/health/tests/tests/test_hls.rs @@ -40,6 +40,7 @@ fn hls_account_kind_passed_along() { vault: vault.clone(), amount: VaultPositionAmount::Unlocked(VaultAmount::new(vault_token_amount)), }], + staked_lp: vec![], }; mock.set_positions_response(account_id, &positions); mock.set_price(debt_token, Decimal::one(), ActionKind::Default); diff --git a/contracts/health/tests/tests/test_liquidation_pricing.rs b/contracts/health/tests/tests/test_liquidation_pricing.rs index 8aec6a6a..98b532ca 100644 --- a/contracts/health/tests/tests/test_liquidation_pricing.rs +++ b/contracts/health/tests/tests/test_liquidation_pricing.rs @@ -67,6 +67,7 @@ fn uses_liquidation_pricing() { }], lends: vec![], vaults: vec![], + staked_lp: vec![], }, ); diff --git a/contracts/incentives/README.md b/contracts/incentives/README.md index 7e75b3b4..3478f23c 100644 --- a/contracts/incentives/README.md +++ b/contracts/incentives/README.md @@ -1,6 +1,31 @@ # Mars Incentives -A smart contract that manages MARS incentives for depositors. +A smart contract that manages both MARS incentives for redbank deposits, and Astroport LP incentives for staked LP positions + +## Astroport + +Astroport requires users to 'stake' their Lp positions in the Astroport incentives +contract in order to accrue externally added incentives for that LP position. + +Mars facilitates the ability for a credit account to stake into this contract via the Mars incentives contract, in order +to accrue these additional rewards whilst using that lp position as collateral in +that credit account. + +The Mars Incentives contract pools all LP positions together in one staked position in Astroport, managing the accounting for each individual user internally. + +Rewards are also pooled, and are distributed to the user based on their LP share amount since their last claim. +Because of this, we must claim rewards for a user each time they update their staked LP balance + +This functionality is exposed through the stake, unstake, and claim actions via credit manager + +### Stake +![stake](files/stake.png) + +### Unstake +![unstake](files/unstake.png) + +### Claim Rewards +![claim rewards](files/claim.png) ## License diff --git a/contracts/incentives/files/claim.png b/contracts/incentives/files/claim.png new file mode 100644 index 00000000..f6cea1f3 Binary files /dev/null and b/contracts/incentives/files/claim.png differ diff --git a/contracts/incentives/files/stake.png b/contracts/incentives/files/stake.png new file mode 100644 index 00000000..afeed3fc Binary files /dev/null and b/contracts/incentives/files/stake.png differ diff --git a/contracts/incentives/files/unstake.png b/contracts/incentives/files/unstake.png new file mode 100644 index 00000000..a6993985 Binary files /dev/null and b/contracts/incentives/files/unstake.png differ diff --git a/contracts/incentives/src/astroport_incentives.rs b/contracts/incentives/src/astro_incentives.rs similarity index 89% rename from contracts/incentives/src/astroport_incentives.rs rename to contracts/incentives/src/astro_incentives.rs index b96154df..148a964a 100644 --- a/contracts/incentives/src/astroport_incentives.rs +++ b/contracts/incentives/src/astro_incentives.rs @@ -14,36 +14,36 @@ use mars_types::{ use crate::{ helpers::{ - calculate_rewards_from_astroport_incentive_state, claim_rewards_msg, - compute_updated_astroport_incentive_states, MaybeMutStorage, + calculate_rewards_for_staked_astro_lp_position, claim_rewards_msg, + compute_updated_astro_incentive_states, MaybeMutStorage, }, - query::query_unclaimed_astroport_rewards, + query::query_unclaimed_astro_lp_rewards, state::{ASTRO_INCENTIVE_STATES, ASTRO_TOTAL_LP_DEPOSITS, ASTRO_USER_LP_DEPOSITS, CONFIG}, ContractError::{self, NoStakedLp}, }; -/// Fetch the new rewards from astroport, and update our global incentive states. -fn claim_rewards_from_astro( +/// Fetches all pending rewards from all users LP in astroport, and updates the lp incentive states +fn claim_global_staked_lp_rewards( deps: &mut DepsMut, astroport_incentives_addr: &str, mars_incentives_addr: &str, lp_denom: &str, ) -> Result { - let pending_rewards: Vec = query_unclaimed_astroport_rewards( + let pending_rewards: Vec = query_unclaimed_astro_lp_rewards( deps.as_ref(), mars_incentives_addr, astroport_incentives_addr, lp_denom, )?; - let res = update_incentive_states(deps.storage, lp_denom, pending_rewards)?; + let res = update_incentive_states_for_lp_denom(deps.storage, lp_denom, pending_rewards)?; Ok(res .add_event(Event::new("mars/incentives/claimed_astro_incentive_rewards")) .add_message(claim_rewards_msg(astroport_incentives_addr, lp_denom)?)) } -pub fn execute_unstake_astro_lp( +pub fn execute_unstake_lp( deps: DepsMut, env: Env, info: MessageInfo, @@ -92,7 +92,7 @@ pub fn execute_unstake_astro_lp( ) } -pub fn execute_stake_astro_lp( +pub fn execute_stake_lp( deps: DepsMut, env: Env, info: MessageInfo, @@ -137,7 +137,7 @@ fn update_user_lp_position( .unwrap_or(Uint128::zero()); // Claim all rewards from astroport before any modification - let mut res = claim_astro_rewards_for_lp_position( + let mut res = claim_rewards_for_staked_lp_position( &mut deps, astroport_incentives_addr, mars_incentives_addr, @@ -151,7 +151,7 @@ fn update_user_lp_position( // Deposit stakes lp coin in astroport incentives LpModification::Deposit => { // Update our accounting - increment_lp_deposit(deps.storage, account_id, &lp_coin)?; + increment_staked_lp(deps.storage, account_id, &lp_coin)?; // stake in astroport incentives res.add_message(CosmosMsg::Wasm(WasmMsg::Execute { @@ -165,7 +165,7 @@ fn update_user_lp_position( LpModification::Withdraw => { // Update our lp amount accounting - decrement_lp_deposit(deps.storage, account_id, &lp_coin)?; + decrement_staked_lp(deps.storage, account_id, &lp_coin)?; // Add two messages // - unstake from astroport incentives (lp_amount) @@ -196,7 +196,7 @@ fn update_user_lp_position( Ok(res.add_event(modification_event)) } -fn increment_lp_deposit( +fn increment_staked_lp( store: &mut dyn Storage, account_id: &str, lp_coin: &Coin, @@ -218,7 +218,7 @@ fn increment_lp_deposit( Ok(()) } -fn decrement_lp_deposit( +fn decrement_staked_lp( store: &mut dyn Storage, account_id: &str, lp_coin: &Coin, @@ -249,14 +249,14 @@ fn decrement_lp_deposit( Ok(()) } -fn update_incentive_states( +fn update_incentive_states_for_lp_denom( storage: &mut dyn Storage, lp_denom: &str, pending_rewards: Vec, ) -> Result { // Update our global indexes for each reward. We only accept native tokens, cw20 will be ignored let updated_incentives: HashMap = - compute_updated_astroport_incentive_states(storage, pending_rewards, lp_denom)?; + compute_updated_astro_incentive_states(storage, pending_rewards, lp_denom)?; for (incentive_denom, updated_incentive) in updated_incentives.iter() { // Store latest state @@ -266,7 +266,7 @@ fn update_incentive_states( Ok(Response::new()) } -pub fn execute_claim_astro_rewards_for_lp_position( +pub fn execute_claim_rewards_for_staked_lp_position( mut deps: DepsMut, env: Env, info: MessageInfo, @@ -298,7 +298,7 @@ pub fn execute_claim_astro_rewards_for_lp_position( denom: lp_denom.to_string(), })?; - claim_astro_rewards_for_lp_position( + claim_rewards_for_staked_lp_position( &mut deps, astroport_incentives_addr.as_str(), &mars_incentives_addr, @@ -312,7 +312,7 @@ pub fn execute_claim_astro_rewards_for_lp_position( /// Claims astroport rewards for a user. /// /// Response returned includes msg to send rewards to credit manager -fn claim_astro_rewards_for_lp_position( +fn claim_rewards_for_staked_lp_position( deps: &mut DepsMut, astroport_incentives_addr: &str, mars_incentives_addr: &str, @@ -321,8 +321,12 @@ fn claim_astro_rewards_for_lp_position( lp_denom: &str, staked_lp_amount: Uint128, ) -> Result { - let mut res = - claim_rewards_from_astro(deps, astroport_incentives_addr, mars_incentives_addr, lp_denom)?; + let mut res = claim_global_staked_lp_rewards( + deps, + astroport_incentives_addr, + mars_incentives_addr, + lp_denom, + )?; let mut event = Event::new("mars/incentives/claimed_lp_rewards") .add_attribute("account_id", account_id.to_string()); @@ -370,7 +374,7 @@ fn calculate_claimable_rewards( .range(storage.to_storage(), None, None, Ascending) .collect::>>()?; - calculate_rewards_from_astroport_incentive_state( + calculate_rewards_for_staked_astro_lp_position( storage, account_id, &lp_coin, diff --git a/contracts/incentives/src/contract.rs b/contracts/incentives/src/contract.rs index 3114b5f5..84a2dd4d 100644 --- a/contracts/incentives/src/contract.rs +++ b/contracts/incentives/src/contract.rs @@ -8,7 +8,7 @@ use mars_owner::OwnerInit::SetInitialOwner; use mars_types::incentives::{Config, ExecuteMsg, InstantiateMsg, QueryMsg}; use crate::{ - astroport_incentives, config, + astro_incentives, config, error::ContractError, mars_incentives, migrations, query, state::{CONFIG, EPOCH_DURATION, MIGRATION_GUARD, OWNER}, @@ -106,6 +106,16 @@ pub fn execute( total_amount_scaled_before, ) } + ExecuteMsg::ClaimStakedAstroLpRewards { + account_id, + lp_denom, + } => astro_incentives::execute_claim_rewards_for_staked_lp_position( + deps, + env, + info, + &account_id, + &lp_denom, + ), ExecuteMsg::ClaimRewards { account_id, start_after_collateral_denom, @@ -126,21 +136,11 @@ pub fn execute( ExecuteMsg::StakeAstroLp { account_id, lp_coin, - } => astroport_incentives::execute_stake_astro_lp(deps, env, info, account_id, lp_coin), + } => astro_incentives::execute_stake_lp(deps, env, info, account_id, lp_coin), ExecuteMsg::UnstakeAstroLp { account_id, lp_coin, - } => astroport_incentives::execute_unstake_astro_lp(deps, env, info, account_id, lp_coin), - ExecuteMsg::ClaimAstroLpRewards { - account_id, - lp_denom, - } => astroport_incentives::execute_claim_astro_rewards_for_lp_position( - deps, - env, - info, - &account_id, - &lp_denom, - ), + } => astro_incentives::execute_unstake_lp(deps, env, info, account_id, lp_coin), ExecuteMsg::UpdateConfig { address_provider, max_whitelisted_denoms, @@ -161,6 +161,16 @@ pub fn execute( #[cfg_attr(not(feature = "library"), entry_point)] pub fn query(deps: Deps, env: Env, msg: QueryMsg) -> StdResult { match msg { + QueryMsg::StakedAstroLpRewards { + account_id, + lp_denom, + } => to_json_binary(&query::query_staked_astro_lp_rewards_for_denom( + deps, + &env, + &account_id, + &lp_denom, + )?), + QueryMsg::Config {} => to_json_binary(&query::query_config(deps)?), QueryMsg::IncentiveState { collateral_denom, @@ -219,21 +229,23 @@ pub fn query(deps: Deps, env: Env, msg: QueryMsg) -> StdResult { QueryMsg::ActiveEmissions { collateral_denom, } => to_json_binary(&query::query_active_emissions(deps, env, &collateral_denom)?), - QueryMsg::StakedLpPositions { + QueryMsg::StakedAstroLpPositions { account_id, start_after, limit, - } => to_json_binary(&query::query_user_lp_positions( + } => to_json_binary(&query::query_staked_astro_lp_positions( deps, env, account_id, start_after, limit, )?), - QueryMsg::StakedLpPosition { + QueryMsg::StakedAstroLpPosition { account_id, lp_denom, - } => to_json_binary(&query::query_user_lp_position(deps, env, account_id, lp_denom)?), + } => { + to_json_binary(&query::query_staked_astro_lp_position(deps, env, account_id, lp_denom)?) + } } } diff --git a/contracts/incentives/src/helpers.rs b/contracts/incentives/src/helpers.rs index db82e33a..39b30141 100644 --- a/contracts/incentives/src/helpers.rs +++ b/contracts/incentives/src/helpers.rs @@ -217,7 +217,7 @@ pub fn update_incentive_index( } /// Compute the incentive states for the lp based on the rewards given -pub fn compute_updated_astroport_incentive_states( +pub fn compute_updated_astro_incentive_states( storage: &dyn Storage, pending_rewards: Vec, lp_denom: &str, @@ -240,7 +240,7 @@ pub fn compute_updated_astroport_incentive_states( .unwrap_or(Decimal::zero()); let updated_incentive = - compute_astroport_incentive_index(&previous_index, reward.amount, total_lp_amount)?; + compute_astro_incentive_index(&previous_index, reward.amount, total_lp_amount)?; updated_incentives.insert(reward_denom, updated_incentive); } @@ -248,7 +248,7 @@ pub fn compute_updated_astroport_incentive_states( Ok(updated_incentives) } -pub fn calculate_rewards_from_astroport_incentive_state( +pub fn calculate_rewards_for_staked_astro_lp_position( mut storage: &mut MaybeMutStorage, account_id: &str, lp_coin: &Coin, @@ -289,7 +289,7 @@ pub fn calculate_rewards_from_astroport_incentive_state( Ok(payables) } -pub fn compute_astroport_incentive_index( +pub fn compute_astro_incentive_index( previous_index: &Decimal, claimed_rewards_amount: Uint128, total_lp_amount: Uint128, diff --git a/contracts/incentives/src/lib.rs b/contracts/incentives/src/lib.rs index 37d694ad..c2825f0f 100644 --- a/contracts/incentives/src/lib.rs +++ b/contracts/incentives/src/lib.rs @@ -1,4 +1,4 @@ -pub mod astroport_incentives; +pub mod astro_incentives; pub mod config; pub mod contract; mod error; diff --git a/contracts/incentives/src/query.rs b/contracts/incentives/src/query.rs index 9e2aa979..bea95056 100644 --- a/contracts/incentives/src/query.rs +++ b/contracts/incentives/src/query.rs @@ -17,12 +17,11 @@ use mars_types::{ use crate::{ helpers::{ - calculate_rewards_from_astroport_incentive_state, - compute_updated_astroport_incentive_states, compute_user_unclaimed_rewards, + calculate_rewards_for_staked_astro_lp_position, compute_updated_astro_incentive_states, + compute_user_unclaimed_rewards, }, - state, state::{ - ASTRO_INCENTIVE_STATES, ASTRO_USER_LP_DEPOSITS, CONFIG, DEFAULT_LIMIT, EMISSIONS, + self, ASTRO_INCENTIVE_STATES, ASTRO_USER_LP_DEPOSITS, CONFIG, DEFAULT_LIMIT, EMISSIONS, EPOCH_DURATION, INCENTIVE_STATES, MAX_LIMIT, OWNER, WHITELIST, WHITELIST_COUNT, }, ContractError, @@ -93,8 +92,7 @@ pub fn query_incentive_states( .collect() } -/// Query the unclaimed astroport rewards -pub fn query_unclaimed_astroport_rewards( +pub fn query_unclaimed_astro_lp_rewards( deps: Deps, mars_incentives_addr: &str, astroport_incentives_addr: &str, @@ -115,9 +113,7 @@ pub fn query_unclaimed_astroport_rewards( Ok(native_coins) } -/// Fetch rewards for a user, grouped by LP position -/// Has optional pagination on LP denom -pub fn query_lp_rewards_for_user( +pub fn query_staked_astro_lp_rewards_for_user( deps: Deps, env: &Env, astroport_incentives_addr: &Addr, @@ -145,7 +141,7 @@ pub fn query_lp_rewards_for_user( denom, amount, }; - let rewards = query_lp_rewards_for_position( + let rewards = query_staked_astro_lp_rewards_for_coin( deps, env, astroport_incentives_addr, @@ -158,12 +154,36 @@ pub fn query_lp_rewards_for_user( ) } -/// Fetch the rewards owed to a user. -/// -/// The incentives contract deposits / stakes all LP on behalf -/// off the user, so the rewards accounting is all tracked internally -/// by the incentives contract. -pub fn query_lp_rewards_for_position( +pub fn query_staked_astro_lp_rewards_for_denom( + deps: Deps, + env: &Env, + account_id: &str, + lp_denom: &str, +) -> Result, ContractError> { + let lp_amount = + ASTRO_USER_LP_DEPOSITS.may_load(deps.storage, (&account_id, lp_denom))?.unwrap_or_default(); + + let lp_coin = Coin { + denom: lp_denom.to_string(), + amount: lp_amount, + }; + + let astroport_incentives_addr = address_provider::helpers::query_contract_addr( + deps, + &CONFIG.load(deps.storage)?.address_provider, + MarsAddressType::AstroportIncentives, + )?; + + query_staked_astro_lp_rewards_for_coin( + deps, + env, + &astroport_incentives_addr, + account_id, + &lp_coin, + ) +} + +pub fn query_staked_astro_lp_rewards_for_coin( deps: Deps, env: &Env, astroport_incentives_addr: &Addr, @@ -171,7 +191,7 @@ pub fn query_lp_rewards_for_position( lp_coin: &Coin, ) -> Result, ContractError> { let lp_denom = &lp_coin.denom; - let pending_rewards: Vec = query_unclaimed_astroport_rewards( + let pending_rewards: Vec = query_unclaimed_astro_lp_rewards( deps, env.contract.address.as_ref(), astroport_incentives_addr.as_ref(), @@ -182,7 +202,7 @@ pub fn query_lp_rewards_for_position( // Update our global indexes for each reward. We only accept native tokens, // cw20 will just be swallowed by contract let incentives_to_update = - compute_updated_astroport_incentive_states(deps.storage, pending_rewards, lp_denom)?; + compute_updated_astro_incentive_states(deps.storage, pending_rewards, lp_denom)?; let mut incentive_states: HashMap = ASTRO_INCENTIVE_STATES .prefix(lp_denom) @@ -192,7 +212,7 @@ pub fn query_lp_rewards_for_position( // Update our incentive states with the newly updated incentive states to ensure we are up to date. incentive_states.extend(incentives_to_update); - let reward_coins = calculate_rewards_from_astroport_incentive_state( + let reward_coins = calculate_rewards_for_staked_astro_lp_position( &mut deps.storage.into(), account_id, lp_coin, @@ -308,13 +328,12 @@ pub fn query_emissions( Ok(emissions.into_iter().map(|x| x.into()).collect()) } -pub fn query_user_lp_position( +pub fn query_staked_astro_lp_position( deps: Deps, env: Env, account_id: String, denom: String, ) -> StdResult { - // fetch position for lp position let config = CONFIG.load(deps.storage)?; let astroport_incentive_addr = address_provider::helpers::query_contract_addr( deps, @@ -322,7 +341,6 @@ pub fn query_user_lp_position( MarsAddressType::AstroportIncentives, )?; - // query the position let amount = ASTRO_USER_LP_DEPOSITS.may_load(deps.storage, (&account_id, &denom))?.ok_or( ContractError::NoStakedLp { account_id: account_id.clone(), @@ -335,7 +353,7 @@ pub fn query_user_lp_position( amount, }; - let rewards = query_lp_rewards_for_position( + let rewards = query_staked_astro_lp_rewards_for_coin( deps, &env, &astroport_incentive_addr, @@ -351,7 +369,7 @@ pub fn query_user_lp_position( Ok(result) } -pub fn query_user_lp_positions( +pub fn query_staked_astro_lp_positions( deps: Deps, env: Env, account_id: String, @@ -379,7 +397,7 @@ pub fn query_user_lp_positions( denom, amount, }; - let rewards = query_lp_rewards_for_position( + let rewards = query_staked_astro_lp_rewards_for_coin( deps, &env, &astroport_incentive_addr, diff --git a/contracts/incentives/tests/tests/test_claim_astro_lp_rewards.rs b/contracts/incentives/tests/tests/test_claim_astro_lp_rewards.rs index 8afd36d0..4aabe46d 100644 --- a/contracts/incentives/tests/tests/test_claim_astro_lp_rewards.rs +++ b/contracts/incentives/tests/tests/test_claim_astro_lp_rewards.rs @@ -44,7 +44,7 @@ fn claim_for_user( lp_denom: String, ) -> Result { let info = mock_info(sender, &[]); - let msg = ExecuteMsg::ClaimAstroLpRewards { + let msg = ExecuteMsg::ClaimStakedAstroLpRewards { account_id, lp_denom, }; @@ -76,8 +76,7 @@ fn assert_user_rewards( lp_coin: Coin, rewards: Vec, ) { - println!("assert rewards"); - let actual_rewards = query::query_lp_rewards_for_position( + let actual_rewards = query::query_staked_astro_lp_rewards_for_coin( deps, &env, &astroport_incentives_addr, @@ -114,7 +113,7 @@ fn lp_lifecycle() { // - LP in incentives = 0 // - Rewards available = 0 assert_eq!(ASTRO_TOTAL_LP_DEPOSITS.may_load(&deps.storage, lp_denom).unwrap(), None); - let rewards = query::query_unclaimed_astroport_rewards( + let rewards = query::query_unclaimed_astro_lp_rewards( deps.as_ref(), env.contract.address.as_ref(), astroport_incentives_addr.as_ref(), diff --git a/contracts/incentives/tests/tests/test_quering.rs b/contracts/incentives/tests/tests/test_quering.rs index 2f1b20d7..74cc3243 100644 --- a/contracts/incentives/tests/tests/test_quering.rs +++ b/contracts/incentives/tests/tests/test_quering.rs @@ -1,8 +1,13 @@ -use cosmwasm_std::{Decimal, Timestamp, Uint128}; -use mars_incentives::state::{EMISSIONS, INCENTIVE_STATES}; +use astroport_v5::asset::Asset; +use cosmwasm_std::{Addr, Coin, Decimal, Timestamp, Uint128}; +use mars_incentives::state::{ + ASTRO_INCENTIVE_STATES, ASTRO_TOTAL_LP_DEPOSITS, ASTRO_USER_LP_DEPOSITS, EMISSIONS, + INCENTIVE_STATES, +}; use mars_testing::{mock_env, MockEnvParams}; use mars_types::incentives::{ - ActiveEmission, EmissionResponse, IncentiveState, IncentiveStateResponse, QueryMsg, + ActiveEmission, EmissionResponse, IncentiveState, IncentiveStateResponse, + PaginatedStakedLpResponse, QueryMsg, StakedLpPositionResponse, }; use test_case::test_case; @@ -309,3 +314,95 @@ fn query_active_emissions(query_at_time: u64) -> Vec<(String, Uint128)> { .map(|x| (x.denom, x.emission_rate)) .collect() } + +#[test] +fn query_staked_lp_positions_with_pagination() { + let mut deps = th_setup(); + + let astroport_incentives_addr = Addr::unchecked("astroport_incentives"); + deps.querier.set_astroport_incentives_address(astroport_incentives_addr.clone()); + + let mut count = 0; + let account_id = "1".to_string(); + + // save 50 different deposits + while count < 50 { + count += 1; + ASTRO_USER_LP_DEPOSITS + .save(deps.as_mut().storage, (&account_id, &count.to_string()), &Uint128::new(count)) + .unwrap(); + } + + let page_1: PaginatedStakedLpResponse = th_query( + deps.as_ref(), + QueryMsg::StakedAstroLpPositions { + account_id: account_id.clone(), + start_after: None, + limit: Some(51), + }, + ); + + // ensure we cap to 10 + assert_eq!(page_1.data.len(), 10); + + let page_2: PaginatedStakedLpResponse = th_query( + deps.as_ref(), + QueryMsg::StakedAstroLpPositions { + account_id: account_id.clone(), + start_after: page_1.data.last().map(|x| x.lp_coin.denom.clone()), + limit: None, + }, + ); + + // Default length should be 5. + assert_eq!(page_2.data.len(), 5); + + // Pages are sorted alphabetically (1, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 2, 20) + assert_eq!(page_2.data.first().map(|x| x.lp_coin.denom.clone()), Some("19".to_string())); +} + +#[test] +fn query_staked_astro_lp_position() { + let env = mock_env(MockEnvParams { + block_time: Timestamp::from_seconds(1), + ..Default::default() + }); + let mut deps = th_setup(); + let account_id = "1".to_string(); + let lp_denom = "uastro".to_string(); + let reward_denom = "uusdc".to_string(); + let reward_amount = Uint128::new(100u128); + let reward_coin = Coin { + denom: reward_denom.clone(), + amount: reward_amount, + }; + + let astroport_incentives_addr = Addr::unchecked("astroport_incentives"); + deps.querier.set_astroport_incentives_address(astroport_incentives_addr.clone()); + deps.querier.set_unclaimed_astroport_lp_rewards( + &lp_denom, + env.contract.address.as_ref(), + vec![Asset::from(reward_coin.clone())], + ); + ASTRO_TOTAL_LP_DEPOSITS.save(deps.as_mut().storage, &lp_denom, &Uint128::new(100u128)).unwrap(); + ASTRO_USER_LP_DEPOSITS + .save(deps.as_mut().storage, (&account_id, &lp_denom), &Uint128::new(100u128)) + .unwrap(); + ASTRO_INCENTIVE_STATES + .save(deps.as_mut().storage, (&lp_denom, &reward_denom), &Decimal::zero()) + .unwrap(); + + let res: StakedLpPositionResponse = th_query( + deps.as_ref(), + QueryMsg::StakedAstroLpPosition { + account_id: account_id.clone(), + lp_denom: lp_denom.clone(), + }, + ); + + assert_eq!(res.lp_coin.denom, "uastro".to_string()); + assert_eq!(res.lp_coin.amount, Uint128::new(100u128)); + assert_eq!(res.rewards[0].amount, reward_coin.amount); + assert_eq!(res.rewards[0].denom, reward_coin.denom); + assert_eq!(res.rewards.len(), 1); +} diff --git a/contracts/mock-astroport-incentives/Cargo.toml b/contracts/mock-astroport-incentives/Cargo.toml new file mode 100644 index 00000000..b27b3e6b --- /dev/null +++ b/contracts/mock-astroport-incentives/Cargo.toml @@ -0,0 +1,28 @@ +[package] +name = "mars-mock-astroport-incentives" +version = { workspace = true } +authors = { workspace = true } +license = { workspace = true } +edition = { workspace = true } +repository = { workspace = true } +homepage = { workspace = true } +documentation = { workspace = true } +keywords = { workspace = true } + +[lib] +crate-type = ["cdylib", "rlib"] + +[features] +# for quicker tests, cargo test --lib +# for more explicit tests, cargo test --features=backtraces +backtraces = ["cosmwasm-std/backtraces"] +library = [] + +[dependencies] +astroport = "=5.0.0-rc.1-tokenfactory" +cosmwasm-schema = { workspace = true } +cosmwasm-std = { workspace = true } +cw-storage-plus = { workspace = true } +cw-utils = { workspace = true } +mars-types = { workspace = true } +thiserror = { workspace = true } \ No newline at end of file diff --git a/contracts/mock-astroport-incentives/src/contract.rs b/contracts/mock-astroport-incentives/src/contract.rs new file mode 100644 index 00000000..06ac24fa --- /dev/null +++ b/contracts/mock-astroport-incentives/src/contract.rs @@ -0,0 +1,52 @@ +use astroport::incentives::{ExecuteMsg, QueryMsg}; +#[cfg(not(feature = "library"))] +use cosmwasm_std::entry_point; +use cosmwasm_std::{ + to_json_binary, Binary, Deps, DepsMut, Empty, Env, MessageInfo, Response, StdResult, +}; + +use crate::{ + execute::{claim_rewards, deposit, incentivise, withdraw}, + query::query_rewards, +}; +#[entry_point] +pub fn instantiate( + _deps: DepsMut, + _env: Env, + _info: MessageInfo, + _msg: Empty, +) -> StdResult { + Ok(Response::default()) +} + +#[cfg_attr(not(feature = "library"), entry_point)] +pub fn execute(deps: DepsMut, env: Env, info: MessageInfo, msg: ExecuteMsg) -> StdResult { + match msg { + ExecuteMsg::Deposit { + recipient: _, + } => deposit(deps, env, info), + ExecuteMsg::Withdraw { + lp_token, + amount, + } => withdraw(deps, env, info, lp_token, amount), + ExecuteMsg::ClaimRewards { + lp_tokens, + } => claim_rewards(deps, env, info, lp_tokens), + ExecuteMsg::Incentivize { + lp_token, + schedule, + } => incentivise(deps, env, lp_token, schedule), + _ => unimplemented!("Msg not supported! : {:?}", msg), + } +} + +#[entry_point] +pub fn query(deps: Deps, env: Env, msg: QueryMsg) -> StdResult { + match msg { + QueryMsg::PendingRewards { + lp_token, + user, + } => to_json_binary(&query_rewards(deps, env, user, lp_token)?), + _ => panic!("Unsupported query!"), + } +} diff --git a/contracts/mock-astroport-incentives/src/execute.rs b/contracts/mock-astroport-incentives/src/execute.rs new file mode 100644 index 00000000..b9c5a131 --- /dev/null +++ b/contracts/mock-astroport-incentives/src/execute.rs @@ -0,0 +1,110 @@ +use astroport::{ + asset::AssetInfo, + incentives::{IncentivesSchedule, InputSchedule}, +}; +use cosmwasm_std::{Coin, DepsMut, Env, MessageInfo, Response, StdError, StdResult, Uint128}; + +use crate::{ + query::query_rewards, + state::{ASTRO_LP_INCENTIVE_DEPOSITS, INCENTIVE_SCHEDULES}, +}; + +pub fn incentivise( + deps: DepsMut, + env: Env, + lp_token: String, + schedule: InputSchedule, +) -> StdResult { + let incentives_schedule = IncentivesSchedule::from_input(&env, &schedule)?; + + let reward_denom = match &incentives_schedule.reward_info { + AssetInfo::NativeToken { + denom, + } => denom.to_string(), + _ => unimplemented!("mock does not support cw20 assets!"), + }; + + // Store the incentive schedule in the state + INCENTIVE_SCHEDULES.save(deps.storage, (&lp_token, &reward_denom), &incentives_schedule)?; + + Ok(Response::new()) +} + +// We just use this as a blank to consume the deposit message. This mock assumes only the incentives contract +// will ever deposit / withdraw / interact +pub fn deposit(deps: DepsMut, _: Env, info: MessageInfo) -> StdResult { + let sender = info.sender.to_string(); + let coins = info.funds; + + for coin in coins { + let lp_token = coin.denom.clone(); + ASTRO_LP_INCENTIVE_DEPOSITS.update(deps.storage, (&sender, &lp_token), |value_opt| { + value_opt + .unwrap_or_else(Uint128::zero) + .checked_add(coin.amount) + .map_err(|_| StdError::generic_err("overflow")) + })?; + } + + Ok(Response::new()) +} + +pub fn withdraw( + deps: DepsMut, + _: Env, + info: MessageInfo, + lp_token: String, + amount: Uint128, +) -> StdResult { + let sender = info.sender.to_string(); + + // Send the rewards to the user + let withdraw_lp_msg = cosmwasm_std::CosmosMsg::Bank(cosmwasm_std::BankMsg::Send { + to_address: info.sender.to_string(), + amount: vec![Coin { + amount, + denom: lp_token.clone(), + }], + }); + + ASTRO_LP_INCENTIVE_DEPOSITS.update(deps.storage, (&sender, &lp_token), |value_opt| { + value_opt + .unwrap_or_else(Uint128::zero) + .checked_sub(amount) + .map_err(|_| StdError::generic_err("overflow")) + })?; + + Ok(Response::new().add_message(withdraw_lp_msg)) +} + +pub fn claim_rewards( + deps: DepsMut, + env: Env, + info: MessageInfo, + lp_tokens: Vec, +) -> StdResult { + let rewards = lp_tokens + .iter() + .map(|lp_token: &String| { + query_rewards(deps.as_ref(), env.clone(), info.sender.to_string(), lp_token.to_string()) + .unwrap() + }) + .fold(vec![], |mut acc, item| { + acc.extend(item); + acc + }); + + let response = Response::new(); + + if rewards.is_empty() { + return Ok(response); + } + + // Send the rewards to the user + let reward_msg = cosmwasm_std::CosmosMsg::Bank(cosmwasm_std::BankMsg::Send { + to_address: info.sender.to_string(), + amount: rewards.into_iter().map(|asset| asset.as_coin().unwrap()).collect(), + }); + + Ok(response.add_message(reward_msg)) +} diff --git a/contracts/mock-astroport-incentives/src/lib.rs b/contracts/mock-astroport-incentives/src/lib.rs new file mode 100644 index 00000000..b3684924 --- /dev/null +++ b/contracts/mock-astroport-incentives/src/lib.rs @@ -0,0 +1,4 @@ +pub mod contract; +pub mod execute; +pub mod query; +pub mod state; diff --git a/contracts/mock-astroport-incentives/src/query.rs b/contracts/mock-astroport-incentives/src/query.rs new file mode 100644 index 00000000..0c8c2871 --- /dev/null +++ b/contracts/mock-astroport-incentives/src/query.rs @@ -0,0 +1,39 @@ +use std::str::FromStr; + +use astroport::asset::Asset; +use cosmwasm_std::{Coin, Decimal256, Deps, Env, StdResult, Uint128}; + +use crate::state::{ASTRO_LP_INCENTIVE_DEPOSITS, INCENTIVE_SCHEDULES}; + +pub fn query_rewards( + deps: Deps, + _: Env, + sender: String, + lp_token: String, +) -> StdResult> { + let deposits = ASTRO_LP_INCENTIVE_DEPOSITS.may_load(deps.storage, (&sender, &lp_token))?; + match deposits { + Some(_) => Ok(INCENTIVE_SCHEDULES + .prefix(&lp_token) + .range(deps.storage, None, None, cosmwasm_std::Order::Ascending) + .map( + |item: Result< + (String, astroport::incentives::IncentivesSchedule), + cosmwasm_std::StdError, + >| { + let (reward_denom, schedule) = item.unwrap(); + // Note - this gives all rewards to the claimer, but in reality we would need to calculate the rewards for each user. + let amount = + schedule.rps.checked_mul(Decimal256::from_str("5000").unwrap()).unwrap(); + Coin { + amount: Uint128::try_from(amount.to_uint_floor()).unwrap(), + denom: reward_denom, + } + .into() + }, + ) + .collect()), + + None => Ok(vec![]), + } +} diff --git a/contracts/mock-astroport-incentives/src/state.rs b/contracts/mock-astroport-incentives/src/state.rs new file mode 100644 index 00000000..58984460 --- /dev/null +++ b/contracts/mock-astroport-incentives/src/state.rs @@ -0,0 +1,9 @@ +use astroport::incentives::IncentivesSchedule; +use cosmwasm_std::Uint128; +use cw_storage_plus::Map; + +// Storage for our mock incentive schedules. Key is lp_denom, reward_asset_denom +pub const INCENTIVE_SCHEDULES: Map<(&str, &str), IncentivesSchedule> = + Map::new("astro_incentive_schedules"); +pub const ASTRO_LP_INCENTIVE_DEPOSITS: Map<(&str, &str), Uint128> = + Map::new("astro_incentive_lp_deposits"); diff --git a/contracts/mock-incentives/Cargo.toml b/contracts/mock-incentives/Cargo.toml index 404feab8..ad1f3186 100644 --- a/contracts/mock-incentives/Cargo.toml +++ b/contracts/mock-incentives/Cargo.toml @@ -20,5 +20,6 @@ library = [] [dependencies] cosmwasm-std = { workspace = true } +cw-paginate = { workspace = true } cw-storage-plus = { workspace = true } mars-types = { workspace = true } diff --git a/contracts/mock-incentives/src/contract.rs b/contracts/mock-incentives/src/contract.rs index f066b16e..82d9b416 100644 --- a/contracts/mock-incentives/src/contract.rs +++ b/contracts/mock-incentives/src/contract.rs @@ -1,13 +1,16 @@ #[cfg(not(feature = "library"))] use cosmwasm_std::entry_point; use cosmwasm_std::{ - to_json_binary, Binary, Deps, DepsMut, Empty, Env, MessageInfo, Response, StdResult, + to_json_binary, Binary, Coin, Deps, DepsMut, Empty, Env, MessageInfo, Response, StdResult, }; use mars_types::incentives; use crate::{ - execute::{balance_change, claim_rewards}, - query::query_unclaimed_rewards, + execute::{ + balance_change, claim_astro_lp_rewards, claim_rewards, set_incentive_rewards, + stake_astro_lp, unstake_astro_lp, + }, + query::{self, query_unclaimed_rewards}, }; #[cfg_attr(not(feature = "library"), entry_point)] @@ -32,6 +35,10 @@ pub fn execute( account_id, .. } => claim_rewards(deps, info, account_id), + incentives::ExecuteMsg::ClaimStakedAstroLpRewards { + account_id, + lp_denom, + } => claim_astro_lp_rewards(deps, info, account_id, lp_denom), incentives::ExecuteMsg::BalanceChange { user_addr, account_id, @@ -39,6 +46,36 @@ pub fn execute( user_amount_scaled_before, .. } => balance_change(deps, info, user_addr, account_id, denom, user_amount_scaled_before), + incentives::ExecuteMsg::SetAssetIncentive { + collateral_denom, + incentive_denom, + emission_per_second, + start_time, + .. + } => set_incentive_rewards( + deps, + info, + collateral_denom, + incentive_denom, + emission_per_second, + start_time, + ), + incentives::ExecuteMsg::StakeAstroLp { + account_id, + lp_coin, + } => stake_astro_lp(deps, info, account_id, lp_coin), + incentives::ExecuteMsg::UnstakeAstroLp { + account_id, + lp_coin, + } => unstake_astro_lp( + deps, + info, + account_id, + Coin { + denom: lp_coin.denom, + amount: lp_coin.amount.value().unwrap(), + }, + ), _ => unimplemented!("Msg not supported!"), } } @@ -51,6 +88,28 @@ pub fn query(deps: Deps, _env: Env, msg: incentives::QueryMsg) -> StdResult to_json_binary(&query_unclaimed_rewards(deps, &user, &account_id)?), + incentives::QueryMsg::StakedAstroLpRewards { + account_id, + lp_denom, + .. + } => to_json_binary(&query::query_staked_astro_lp_rewards_for_user( + deps, account_id, lp_denom, + )?), + incentives::QueryMsg::StakedAstroLpPosition { + account_id, + lp_denom, + .. + } => to_json_binary(&query::query_staked_lp_astro_lp_position(deps, account_id, lp_denom)?), + incentives::QueryMsg::StakedAstroLpPositions { + account_id, + start_after, + limit, + } => to_json_binary(&query::query_all_staked_lp_positions_for_account( + deps, + account_id, + start_after, + limit, + )?), _ => unimplemented!("Query not supported!"), } } diff --git a/contracts/mock-incentives/src/execute.rs b/contracts/mock-incentives/src/execute.rs index 350112dd..f0338812 100644 --- a/contracts/mock-incentives/src/execute.rs +++ b/contracts/mock-incentives/src/execute.rs @@ -2,7 +2,30 @@ use cosmwasm_std::{ Addr, BankMsg, Coin, CosmosMsg, DepsMut, MessageInfo, Response, StdResult, Uint128, }; -use crate::{query::query_unclaimed_rewards, state::UNCLAIMED_REWARDS}; +use crate::{ + query::{ + query_staked_astro_lp_amount, query_staked_astro_lp_rewards_for_user, + query_unclaimed_rewards, + }, + state::{PENDING_ASTRO_REWARDS, STAKED_ASTRO_LP_POSITIONS, UNCLAIMED_REWARDS}, +}; + +pub fn claim_astro_lp_rewards( + deps: DepsMut, + info: MessageInfo, + account_id: String, + lp_denom: String, +) -> StdResult { + let pending_astro_rewards: Vec = + query_staked_astro_lp_rewards_for_user(deps.as_ref(), account_id.clone(), lp_denom)?; + + let transfer_msg = CosmosMsg::Bank(BankMsg::Send { + to_address: info.sender.to_string(), + amount: pending_astro_rewards, + }); + + Ok(Response::new().add_message(transfer_msg)) +} pub fn claim_rewards( deps: DepsMut, @@ -46,3 +69,79 @@ pub fn balance_change( Ok(Response::new()) } + +/// Privileged sudo message for setting incentive rewards for astroport LP's +pub fn set_incentive_rewards( + deps: DepsMut, + _: MessageInfo, + collateral_denom: String, + incentive_denom: String, + emission_per_second: Uint128, + start_time: u64, +) -> StdResult { + // Rename variables to match the desired usage + let account_id = start_time.to_string(); + let lp_denom = collateral_denom; + let incentive_amount = emission_per_second; + + let mut pending_astro_rewards: Vec = query_staked_astro_lp_rewards_for_user( + deps.as_ref(), + account_id.clone(), + lp_denom.clone(), + )?; + + pending_astro_rewards.push(Coin { + denom: incentive_denom, + amount: incentive_amount, + }); + + PENDING_ASTRO_REWARDS.save(deps.storage, (account_id, lp_denom), &pending_astro_rewards)?; + + Ok(Response::new()) +} + +pub fn stake_astro_lp( + deps: DepsMut, + _: MessageInfo, + account_id: String, + lp_coin: Coin, +) -> StdResult { + let staked_coin = + query_staked_astro_lp_amount(deps.as_ref(), account_id.clone(), lp_coin.denom.clone())?; + + let new_amount = staked_coin.amount.checked_add(lp_coin.amount)?; + + STAKED_ASTRO_LP_POSITIONS.save(deps.storage, (account_id, lp_coin.denom), &new_amount)?; + + Ok(Response::new()) +} + +pub fn unstake_astro_lp( + deps: DepsMut, + info: MessageInfo, + account_id: String, + lp_coin: Coin, +) -> StdResult { + let staked_coin = + query_staked_astro_lp_amount(deps.as_ref(), account_id.clone(), lp_coin.denom.clone())?; + + let new_amount = staked_coin.amount.checked_sub(lp_coin.amount)?; + + if new_amount.is_zero() { + STAKED_ASTRO_LP_POSITIONS.remove(deps.storage, (account_id, lp_coin.denom.clone())); + } else { + STAKED_ASTRO_LP_POSITIONS.save( + deps.storage, + (account_id, lp_coin.denom.clone()), + &new_amount, + )?; + } + + // Mock env responsible for seeding contract with coins + let transfer_msg = CosmosMsg::Bank(BankMsg::Send { + to_address: info.sender.to_string(), + amount: vec![lp_coin], + }); + + Ok(Response::new().add_message(transfer_msg)) +} diff --git a/contracts/mock-incentives/src/query.rs b/contracts/mock-incentives/src/query.rs index 422e6877..c9ab0d1b 100644 --- a/contracts/mock-incentives/src/query.rs +++ b/contracts/mock-incentives/src/query.rs @@ -1,6 +1,11 @@ use cosmwasm_std::{Coin, Deps, StdResult}; +use cw_paginate::paginate_prefix_query; +use cw_storage_plus::Bound; +use mars_types::incentives::{PaginatedStakedLpResponse, StakedLpPositionResponse}; -use crate::state::UNCLAIMED_REWARDS; +use crate::state::{ + DEFAULT_LIMIT, MAX_LIMIT, PENDING_ASTRO_REWARDS, STAKED_ASTRO_LP_POSITIONS, UNCLAIMED_REWARDS, +}; pub fn query_unclaimed_rewards( deps: Deps, @@ -12,3 +17,73 @@ pub fn query_unclaimed_rewards( .may_load(deps.storage, (user_addr, account_id.clone().unwrap_or_default()))? .unwrap_or_default()) } + +pub fn query_staked_astro_lp_rewards_for_user( + deps: Deps, + account_id: String, + lp_denom: String, +) -> StdResult> { + Ok(PENDING_ASTRO_REWARDS.may_load(deps.storage, (account_id, lp_denom))?.unwrap_or_default()) +} + +pub fn query_staked_lp_astro_lp_position( + deps: Deps, + account_id: String, + lp_denom: String, +) -> StdResult { + let staked_coin = query_staked_astro_lp_amount(deps, account_id.clone(), lp_denom.clone())?; + let rewards = query_staked_astro_lp_rewards_for_user(deps, account_id, lp_denom)?; + + Ok(StakedLpPositionResponse { + lp_coin: staked_coin, + rewards, + }) +} + +pub fn query_all_staked_lp_positions_for_account( + deps: Deps, + account_id: String, + start_after: Option, + limit: Option, +) -> StdResult { + let start = start_after.as_ref().map(|denom| Bound::exclusive(denom.as_str())); + let limit: u32 = limit.unwrap_or(DEFAULT_LIMIT).min(MAX_LIMIT); + + paginate_prefix_query( + &STAKED_ASTRO_LP_POSITIONS, + deps.storage, + account_id.clone(), + start, + Some(limit), + |denom, amount| { + let lp_coin = Coin { + denom, + amount, + }; + let rewards = query_staked_astro_lp_rewards_for_user( + deps, + account_id.clone(), + lp_coin.denom.clone(), + )?; + + Ok(StakedLpPositionResponse { + lp_coin, + rewards, + }) + }, + ) +} + +pub fn query_staked_astro_lp_amount( + deps: Deps, + account_id: String, + lp_denom: String, +) -> StdResult { + let staked_amount = crate::state::STAKED_ASTRO_LP_POSITIONS + .may_load(deps.storage, (account_id, lp_denom.clone()))? + .unwrap_or_default(); + Ok(Coin { + denom: lp_denom, + amount: staked_amount, + }) +} diff --git a/contracts/mock-incentives/src/state.rs b/contracts/mock-incentives/src/state.rs index 7c6c2b94..895a67a3 100644 --- a/contracts/mock-incentives/src/state.rs +++ b/contracts/mock-incentives/src/state.rs @@ -1,5 +1,15 @@ -use cosmwasm_std::{Addr, Coin}; +use cosmwasm_std::{Addr, Coin, Uint128}; use cw_storage_plus::Map; +pub const DEFAULT_LIMIT: u32 = 10; +pub const MAX_LIMIT: u32 = 30; // Map<(Addr, CmAccountId), Unclaimed Coins> pub const UNCLAIMED_REWARDS: Map<(Addr, String), Vec> = Map::new("unclaimed_rewards"); + +// Map<(account_id, lp_denom), PendingRewards> +pub const PENDING_ASTRO_REWARDS: Map<(String, String), Vec> = + Map::new("pending_astro_rewards"); + +// Map<(account_id, lp_denom), staked amount> +pub const STAKED_ASTRO_LP_POSITIONS: Map<(String, String), Uint128> = + Map::new("staked_astro_lp_positions"); diff --git a/integration-tests/Cargo.toml b/integration-tests/Cargo.toml index 58332a01..3358607c 100755 --- a/integration-tests/Cargo.toml +++ b/integration-tests/Cargo.toml @@ -18,6 +18,7 @@ backtraces = ["cosmwasm-std/backtraces"] [dev-dependencies] anyhow = { workspace = true } +astroport-v5 = { workspace = true } cosmwasm-std = { workspace = true } cw-it = { workspace = true, features = ["osmosis-test-tube"] } cw-multi-test = { workspace = true } diff --git a/integration-tests/tests/test_astro_lp_incentives.rs b/integration-tests/tests/test_astro_lp_incentives.rs new file mode 100644 index 00000000..fae6da5d --- /dev/null +++ b/integration-tests/tests/test_astro_lp_incentives.rs @@ -0,0 +1,176 @@ +use astroport_v5::{ + asset::{Asset, AssetInfo}, + incentives::InputSchedule, +}; +use cosmwasm_std::{coin, Addr, Coin, Uint128}; +use mars_testing::integration::mock_env::MockEnvBuilder; + +use crate::helpers::default_asset_params; +mod helpers; + +// User A stakes lp in astro and claims rewards +#[test] +fn claim_rewards() { + let owner = Addr::unchecked("owner"); + let mut mock_env = MockEnvBuilder::new(None, owner).build(); + + // Contracts + let params = mock_env.params.clone(); + let astro_incentives = mock_env.astro_incentives.clone(); + let incentives = mock_env.incentives.clone(); + let credit_manager = mock_env.credit_manager.clone(); + + // Params + let lp_denom = "factory12345"; + let reward_denom = "uusd"; + let lp_coin = Coin { + denom: lp_denom.to_string(), + amount: Uint128::new(1_000_000_000), + }; + let reward_asset = Asset { + info: AssetInfo::NativeToken { + denom: reward_denom.to_string(), + }, + amount: Uint128::new(10_000_000_000), + }; + + // Set asset params for lp token + let (_, asset_params) = default_asset_params(lp_denom); + params.init_params(&mut mock_env, asset_params); + + // Fund accounts + let funded_amt = 10_000_000_000u128; + mock_env.fund_account(&mock_env.owner.clone(), &[coin(funded_amt, reward_denom)]); + mock_env.fund_account(&credit_manager, &[coin(funded_amt, lp_denom)]); + + // set up our astroport incentives + let incentives_for_astro = &InputSchedule { + reward: reward_asset.clone(), + duration_periods: 1, + }; + + let rewards = vec![Coin::try_from(reward_asset.clone()).unwrap()]; + astro_incentives.set_incentive_schedule(&mut mock_env, lp_denom, incentives_for_astro, rewards); + + incentives.stake_astro_lp(&mut mock_env, &credit_manager, "1".to_string(), lp_coin); + // increase blocks? + mock_env.increment_by_blocks(1); + + let lp_rewards: Vec = + incentives.query_unclaimed_astroport_rewards(&mock_env, "1".to_string(), lp_denom).unwrap(); + + assert_eq!(lp_rewards.len(), 1); + let balance = mock_env.query_balance(&credit_manager, reward_denom).unwrap(); + assert_eq!(balance, coin(0, reward_denom)); + // claim rewards + incentives + .claim_astro_rewards(&mut mock_env, &credit_manager, "1".to_string(), lp_denom) + .unwrap(); + + // Ensure that balance of credit manager is updated with rewards paid + let balance = mock_env.query_balance(&credit_manager, reward_denom).unwrap(); + assert_eq!(balance, lp_rewards[0]); +} + +#[test] +fn claim_rewards_without_active_schedule() { + let owner = Addr::unchecked("owner"); + let mut mock_env = MockEnvBuilder::new(None, owner).build(); + + // Contracts + let params = mock_env.params.clone(); + let incentives = mock_env.incentives.clone(); + let credit_manager = mock_env.credit_manager.clone(); + + // Params + let lp_denom = "factory12345"; + + let lp_coin = Coin { + denom: lp_denom.to_string(), + amount: Uint128::new(1_000_000_000), + }; + + // Set asset params for lp token + let (_, asset_params) = default_asset_params(lp_denom); + params.init_params(&mut mock_env, asset_params); + + // Fund accounts + let funded_amt = 1_000_000_000u128; + mock_env.fund_account(&credit_manager, &[coin(funded_amt, lp_denom)]); + + incentives.stake_astro_lp(&mut mock_env, &credit_manager, "1".to_string(), lp_coin); + + mock_env.increment_by_blocks(1); + + // claim rewards + incentives + .claim_astro_rewards(&mut mock_env, &credit_manager, "1".to_string(), lp_denom) + .unwrap(); + let lp_balance = mock_env.query_balance(&mock_env.credit_manager, lp_denom).unwrap(); + assert_eq!(lp_balance.amount, Uint128::new(0)); +} + +#[test] +fn unstake_claims_rewards() { + let owner = Addr::unchecked("owner"); + let mut mock_env = MockEnvBuilder::new(None, owner).build(); + + // Contracts + let params = mock_env.params.clone(); + let astro_incentives = mock_env.astro_incentives.clone(); + let incentives = mock_env.incentives.clone(); + let credit_manager = mock_env.credit_manager.clone(); + + let funded_amt = 2_000_000_000u128; + + // Params + let lp_denom = "factory12345"; + let reward_denom = "uusd"; + + let lp_coin = Coin { + denom: lp_denom.to_string(), + amount: Uint128::new(funded_amt), + }; + + let reward_asset = Asset { + info: AssetInfo::NativeToken { + denom: reward_denom.to_string(), + }, + amount: Uint128::new(funded_amt), + }; + + // Set asset params for lp token + let (_, asset_params) = default_asset_params(lp_denom); + params.init_params(&mut mock_env, asset_params); + + // Fund accounts + mock_env.fund_account(&mock_env.owner.clone(), &[coin(funded_amt, reward_denom)]); + mock_env.fund_account(&credit_manager, &[coin(funded_amt, lp_denom)]); + + // set up our astroport incentives + let incentives_for_astro = &InputSchedule { + reward: reward_asset.clone(), + duration_periods: 1, + }; + + let rewards = vec![Coin::try_from(reward_asset.clone()).unwrap()]; + astro_incentives.set_incentive_schedule(&mut mock_env, lp_denom, incentives_for_astro, rewards); + + incentives.stake_astro_lp(&mut mock_env, &credit_manager, "1".to_string(), lp_coin.clone()); + + mock_env.increment_by_blocks(1); + + let lp_rewards: Vec = + incentives.query_unclaimed_astroport_rewards(&mock_env, "1".to_string(), lp_denom).unwrap(); + + incentives.unstake_astro_lp(&mut mock_env, &credit_manager, "1".to_string(), lp_coin.clone()); + + // Ensure that balance of credit manager is updated with rewards paid + let reward_balance = mock_env.query_balance(&credit_manager, reward_denom).unwrap(); + assert_eq!(reward_balance, lp_rewards[0]); + assert_eq!(lp_rewards.len(), 1); + + // Ensure our lp balance is incremented in credit manager + let lp_balance = mock_env.query_balance(&credit_manager, lp_denom).unwrap(); + assert_eq!(lp_balance, lp_coin); +} diff --git a/packages/health-computer/src/health_computer.rs b/packages/health-computer/src/health_computer.rs index a7facb5e..9d695ca5 100644 --- a/packages/health-computer/src/health_computer.rs +++ b/packages/health-computer/src/health_computer.rs @@ -494,20 +494,24 @@ impl HealthComputer { let deposits = self.coins_value(&self.positions.deposits)?; let lends = self.coins_value(&self.positions.lends)?; let vaults = self.vaults_value()?; + let staked_lp = self.coins_value(&self.positions.staked_lp)?; Ok(CollateralValue { total_collateral_value: deposits .total_collateral_value .checked_add(vaults.total_collateral_value)? - .checked_add(lends.total_collateral_value)?, + .checked_add(lends.total_collateral_value)? + .checked_add(staked_lp.total_collateral_value)?, max_ltv_adjusted_collateral: deposits .max_ltv_adjusted_collateral .checked_add(vaults.max_ltv_adjusted_collateral)? - .checked_add(lends.max_ltv_adjusted_collateral)?, + .checked_add(lends.max_ltv_adjusted_collateral)? + .checked_add(staked_lp.max_ltv_adjusted_collateral)?, liquidation_threshold_adjusted_collateral: deposits .liquidation_threshold_adjusted_collateral .checked_add(vaults.liquidation_threshold_adjusted_collateral)? - .checked_add(lends.liquidation_threshold_adjusted_collateral)?, + .checked_add(lends.liquidation_threshold_adjusted_collateral)? + .checked_add(staked_lp.liquidation_threshold_adjusted_collateral)?, }) } diff --git a/packages/health-computer/tests/tests/helpers/prop_test_strategies.rs b/packages/health-computer/tests/tests/helpers/prop_test_strategies.rs index 50968986..3eb5cc36 100644 --- a/packages/health-computer/tests/tests/helpers/prop_test_strategies.rs +++ b/packages/health-computer/tests/tests/helpers/prop_test_strategies.rs @@ -283,6 +283,7 @@ pub fn random_health_computer() -> impl Strategy { debts, lends, vaults, + staked_lp: vec![], }, denoms_data: denoms_data.clone(), vaults_data: vaults_data.clone(), diff --git a/packages/health-computer/tests/tests/test_health_scenarios.rs b/packages/health-computer/tests/tests/test_health_scenarios.rs index 0dec9840..2d255080 100644 --- a/packages/health-computer/tests/tests/test_health_scenarios.rs +++ b/packages/health-computer/tests/tests/test_health_scenarios.rs @@ -47,6 +47,7 @@ fn only_assets_with_no_debts() { debts: vec![], lends: vec![], vaults: vec![], + staked_lp: vec![], }, denoms_data, vaults_data, @@ -114,6 +115,7 @@ fn terra_ragnarok() { }], lends: vec![], vaults: vec![], + staked_lp: vec![], }, denoms_data, vaults_data: vaults_data.clone(), @@ -175,6 +177,7 @@ fn terra_ragnarok() { }], lends: vec![], vaults: vec![], + staked_lp: vec![], }, denoms_data, vaults_data, @@ -244,6 +247,7 @@ fn ltv_and_lqdt_adjusted_values() { }], lends: vec![], vaults: vec![], + staked_lp: vec![], }, denoms_data, vaults_data, @@ -366,6 +370,7 @@ fn debt_value() { ], lends: vec![], vaults: vec![], + staked_lp: vec![], }, denoms_data, vaults_data, @@ -470,6 +475,7 @@ fn above_max_ltv_below_liq_threshold() { }], lends: vec![], vaults: vec![], + staked_lp: vec![], }, denoms_data, vaults_data, @@ -534,6 +540,7 @@ fn liquidatable() { ], lends: vec![], vaults: vec![], + staked_lp: vec![], }, denoms_data, vaults_data, @@ -600,6 +607,7 @@ fn rover_whitelist_influences_max_ltv() { ], lends: vec![], vaults: vec![], + staked_lp: vec![], }, denoms_data, vaults_data, @@ -693,6 +701,7 @@ fn unlocked_vault() { vault, amount: VaultPositionAmount::Unlocked(VaultAmount::new(Uint128::new(5264))), }], + staked_lp: vec![], }, denoms_data, vaults_data, @@ -789,6 +798,7 @@ fn locked_vault() { unlocking: UnlockingPositions::new(vec![]), }), }], + staked_lp: vec![], }, denoms_data, vaults_data, @@ -894,6 +904,7 @@ fn locked_vault_with_unlocking_positions() { ]), }), }], + staked_lp: vec![], }, denoms_data, vaults_data, @@ -987,6 +998,7 @@ fn vault_is_not_whitelisted() { vault, amount: VaultPositionAmount::Unlocked(VaultAmount::new(Uint128::new(5264))), }], + staked_lp: vec![], }, denoms_data, vaults_data, @@ -1098,6 +1110,7 @@ fn vault_base_token_is_not_whitelisted() { ]), }), }], + staked_lp: vec![], }, denoms_data, vaults_data, @@ -1158,6 +1171,7 @@ fn lent_coins_used_as_collateral() { }], lends: vec![coin(10, udai.denom), coin(2, uluna.denom)], vaults: vec![], + staked_lp: vec![], }, denoms_data, vaults_data, @@ -1220,6 +1234,7 @@ fn allowed_lent_coins_influence_max_ltv() { }], lends: vec![coin(10, udai.denom), coin(2, uluna.denom)], vaults: vec![], + staked_lp: vec![], }, denoms_data, vaults_data, diff --git a/packages/health-computer/tests/tests/test_hls.rs b/packages/health-computer/tests/tests/test_hls.rs index 55e92222..94d97679 100644 --- a/packages/health-computer/tests/tests/test_hls.rs +++ b/packages/health-computer/tests/tests/test_hls.rs @@ -41,6 +41,7 @@ fn hls_deposit() { debts: vec![], lends: vec![], vaults: vec![], + staked_lp: vec![], }, denoms_data, vaults_data, @@ -142,6 +143,7 @@ fn hls_vault() { vault, amount: VaultPositionAmount::Unlocked(VaultAmount::new(Uint128::new(5264))), }], + staked_lp: vec![], }, denoms_data, vaults_data, @@ -192,6 +194,7 @@ fn hls_on_blacklisted_asset() { debts: vec![], lends: vec![], vaults: vec![], + staked_lp: vec![], }, denoms_data, vaults_data, @@ -288,6 +291,7 @@ fn hls_on_blacklisted_vault() { vault, amount: VaultPositionAmount::Unlocked(VaultAmount::new(Uint128::new(5264))), }], + staked_lp: vec![], }, denoms_data, vaults_data, diff --git a/packages/health-computer/tests/tests/test_input_validation.rs b/packages/health-computer/tests/tests/test_input_validation.rs index 82822929..f8062a89 100644 --- a/packages/health-computer/tests/tests/test_input_validation.rs +++ b/packages/health-computer/tests/tests/test_input_validation.rs @@ -52,6 +52,7 @@ fn missing_price_data() { ], lends: vec![], vaults: vec![], + staked_lp: vec![], }, denoms_data, vaults_data, @@ -100,6 +101,7 @@ fn missing_params() { ], lends: vec![], vaults: vec![], + staked_lp: vec![], }, denoms_data, vaults_data, @@ -179,6 +181,7 @@ fn missing_market_data_for_vault_base_token() { vault, amount: VaultPositionAmount::Unlocked(VaultAmount::new(Uint128::one())), }], + staked_lp: vec![], }, denoms_data, vaults_data, @@ -225,6 +228,7 @@ fn missing_vault_value() { vault: vault.clone(), amount: VaultPositionAmount::Unlocked(VaultAmount::new(Uint128::one())), }], + staked_lp: vec![], }, denoms_data, vaults_data, @@ -275,6 +279,7 @@ fn missing_vault_config() { vault: vault.clone(), amount: VaultPositionAmount::Unlocked(VaultAmount::new(Uint128::one())), }], + staked_lp: vec![], }, denoms_data, vaults_data, @@ -312,6 +317,7 @@ fn missing_hls_params() { }], lends: vec![], vaults: vec![], + staked_lp: vec![], }, denoms_data, vaults_data, diff --git a/packages/health-computer/tests/tests/test_max_borrow_deposit.rs b/packages/health-computer/tests/tests/test_max_borrow_deposit.rs index 04a4f5ba..69cad399 100644 --- a/packages/health-computer/tests/tests/test_max_borrow_deposit.rs +++ b/packages/health-computer/tests/tests/test_max_borrow_deposit.rs @@ -33,6 +33,7 @@ fn max_borrow_deposit_offset_good() { debts: vec![], lends: vec![], vaults: vec![], + staked_lp: vec![], }, denoms_data, vaults_data, @@ -67,6 +68,7 @@ fn max_borrow_deposit_offset_margin_of_error() { debts: vec![], lends: vec![], vaults: vec![], + staked_lp: vec![], }, denoms_data, vaults_data, diff --git a/packages/health-computer/tests/tests/test_max_borrow_validation.rs b/packages/health-computer/tests/tests/test_max_borrow_validation.rs index 28249966..4ca32a23 100644 --- a/packages/health-computer/tests/tests/test_max_borrow_validation.rs +++ b/packages/health-computer/tests/tests/test_max_borrow_validation.rs @@ -51,6 +51,7 @@ fn missing_borrow_denom_price_data() { ], lends: vec![], vaults: vec![], + staked_lp: vec![], }, denoms_data, vaults_data, @@ -99,6 +100,7 @@ fn missing_borrow_denom_params() { ], lends: vec![], vaults: vec![], + staked_lp: vec![], }, denoms_data, vaults_data, @@ -150,6 +152,7 @@ fn cannot_borrow_when_unhealthy() { ], lends: vec![], vaults: vec![], + staked_lp: vec![], }, denoms_data, vaults_data, @@ -235,6 +238,7 @@ fn hls_influences_max_borrow() { vault, amount: VaultPositionAmount::Unlocked(VaultAmount::new(Uint128::new(5264))), }], + staked_lp: vec![], }, denoms_data, vaults_data, diff --git a/packages/health-computer/tests/tests/test_max_borrow_vault.rs b/packages/health-computer/tests/tests/test_max_borrow_vault.rs index d6bc0d86..9c497d22 100644 --- a/packages/health-computer/tests/tests/test_max_borrow_vault.rs +++ b/packages/health-computer/tests/tests/test_max_borrow_vault.rs @@ -36,6 +36,7 @@ fn max_borrow_vault_offset_good() { debts: vec![], lends: vec![], vaults: vec![], + staked_lp: vec![], }, denoms_data, vaults_data, @@ -81,6 +82,7 @@ fn max_borrow_vault_offset_margin_of_error() { debts: vec![], lends: vec![], vaults: vec![], + staked_lp: vec![], }, denoms_data, vaults_data, diff --git a/packages/health-computer/tests/tests/test_max_borrow_wallet.rs b/packages/health-computer/tests/tests/test_max_borrow_wallet.rs index 46070402..0f3665a4 100644 --- a/packages/health-computer/tests/tests/test_max_borrow_wallet.rs +++ b/packages/health-computer/tests/tests/test_max_borrow_wallet.rs @@ -32,6 +32,7 @@ fn max_borrow_wallet_offset_good() { debts: vec![], lends: vec![], vaults: vec![], + staked_lp: vec![], }, denoms_data, vaults_data, @@ -65,6 +66,7 @@ fn max_borrow_wallet_offset_margin_of_error() { debts: vec![], lends: vec![], vaults: vec![], + staked_lp: vec![], }, denoms_data, vaults_data, diff --git a/packages/health-computer/tests/tests/test_max_swap.rs b/packages/health-computer/tests/tests/test_max_swap.rs index c195e203..84c2923a 100644 --- a/packages/health-computer/tests/tests/test_max_swap.rs +++ b/packages/health-computer/tests/tests/test_max_swap.rs @@ -40,6 +40,7 @@ fn max_swap_default() { debts: vec![], lends: vec![], vaults: vec![], + staked_lp: vec![], }, denoms_data, vaults_data, @@ -82,6 +83,7 @@ fn max_swap_margin() { debts: vec![], lends: vec![], vaults: vec![], + staked_lp: vec![], }, denoms_data, vaults_data, diff --git a/packages/health-computer/tests/tests/test_max_swap_validation.rs b/packages/health-computer/tests/tests/test_max_swap_validation.rs index bd7cc2aa..b061fe24 100644 --- a/packages/health-computer/tests/tests/test_max_swap_validation.rs +++ b/packages/health-computer/tests/tests/test_max_swap_validation.rs @@ -52,6 +52,7 @@ fn missing_price_data() { ], lends: vec![], vaults: vec![], + staked_lp: vec![], }, denoms_data, vaults_data, @@ -102,6 +103,7 @@ fn missing_params() { ], lends: vec![], vaults: vec![], + staked_lp: vec![], }, denoms_data, vaults_data, @@ -137,6 +139,7 @@ fn deposit_not_present() { debts: vec![], lends: vec![], vaults: vec![], + staked_lp: vec![], }, denoms_data, vaults_data, @@ -190,6 +193,7 @@ fn zero_when_unhealthy() { ], lends: vec![], vaults: vec![], + staked_lp: vec![], }, denoms_data, vaults_data, @@ -235,6 +239,7 @@ fn no_debts() { debts: vec![], lends: vec![], vaults: vec![], + staked_lp: vec![], }, denoms_data, vaults_data, @@ -282,6 +287,7 @@ fn should_allow_max_swap() { }], lends: vec![], vaults: vec![], + staked_lp: vec![], }, denoms_data, vaults_data, @@ -369,6 +375,7 @@ fn hls_with_max_withdraw() { vault, amount: VaultPositionAmount::Unlocked(VaultAmount::new(Uint128::new(5264))), }], + staked_lp: vec![], }, denoms_data, vaults_data, diff --git a/packages/health-computer/tests/tests/test_max_withdraw.rs b/packages/health-computer/tests/tests/test_max_withdraw.rs index b05478a2..ee01e9f3 100644 --- a/packages/health-computer/tests/tests/test_max_withdraw.rs +++ b/packages/health-computer/tests/tests/test_max_withdraw.rs @@ -52,6 +52,7 @@ fn missing_price_data() { ], lends: vec![], vaults: vec![], + staked_lp: vec![], }, denoms_data, vaults_data, @@ -100,6 +101,7 @@ fn missing_params() { ], lends: vec![], vaults: vec![], + staked_lp: vec![], }, denoms_data, vaults_data, @@ -131,6 +133,7 @@ fn deposit_not_present() { debts: vec![], lends: vec![], vaults: vec![], + staked_lp: vec![], }, denoms_data, vaults_data, @@ -186,6 +189,7 @@ fn blacklisted_assets_should_be_able_be_fully_withdrawn() { ], lends: vec![], vaults: vec![], + staked_lp: vec![], }, denoms_data, vaults_data, @@ -241,6 +245,7 @@ fn zero_when_unhealthy() { ], lends: vec![], vaults: vec![], + staked_lp: vec![], }, denoms_data, vaults_data, @@ -277,6 +282,7 @@ fn no_debts() { debts: vec![], lends: vec![], vaults: vec![], + staked_lp: vec![], }, denoms_data, vaults_data, @@ -321,6 +327,7 @@ fn should_allow_max_withdraw() { }], lends: vec![], vaults: vec![], + staked_lp: vec![], }, denoms_data, vaults_data, @@ -405,6 +412,7 @@ fn hls_with_max_withdraw() { vault, amount: VaultPositionAmount::Unlocked(VaultAmount::new(Uint128::new(5264))), }], + staked_lp: vec![], }, denoms_data, vaults_data, diff --git a/packages/testing/Cargo.toml b/packages/testing/Cargo.toml index eb6c9646..34b0610d 100644 --- a/packages/testing/Cargo.toml +++ b/packages/testing/Cargo.toml @@ -36,6 +36,7 @@ mars-account-nft = { workspace = true } mars-address-provider = { workspace = true } mars-credit-manager = { workspace = true } mars-incentives = { workspace = true } +mars-mock-astroport-incentives = { workspace = true } mars-mock-incentives = { workspace = true } mars-mock-oracle = { workspace = true } mars-mock-pyth = { workspace = true } diff --git a/packages/testing/src/integration/mock_contracts.rs b/packages/testing/src/integration/mock_contracts.rs index 826fb98a..e766e881 100644 --- a/packages/testing/src/integration/mock_contracts.rs +++ b/packages/testing/src/integration/mock_contracts.rs @@ -14,6 +14,15 @@ pub fn mock_address_provider_contract() -> Box> { Box::new(contract) } +pub fn mock_astroport_incentives() -> Box> { + let contract = ContractWrapper::new( + mars_mock_astroport_incentives::contract::execute, + mars_mock_astroport_incentives::contract::instantiate, + mars_mock_astroport_incentives::contract::query, + ); + Box::new(contract) +} + pub fn mock_incentives_contract() -> Box> { let contract = ContractWrapper::new( mars_incentives::contract::execute, diff --git a/packages/testing/src/integration/mock_env.rs b/packages/testing/src/integration/mock_env.rs index 486ce5e4..47b8cae0 100644 --- a/packages/testing/src/integration/mock_env.rs +++ b/packages/testing/src/integration/mock_env.rs @@ -3,12 +3,14 @@ use std::{collections::HashMap, default::Default, mem::take, str::FromStr}; use anyhow::Result as AnyResult; +use astroport_v5::incentives::InputSchedule; use cosmwasm_std::{coin, Addr, Coin, Decimal, Empty, StdResult, Uint128}; use cw_multi_test::{App, AppResponse, BankSudo, BasicApp, Executor, SudoMsg}; use cw_paginate::PaginationResponse; use mars_oracle_osmosis::OsmosisPriceSourceUnchecked; use mars_types::{ address_provider::{self, MarsAddressType}, + credit_manager::ActionCoin, incentives, oracle::{ self, @@ -24,6 +26,7 @@ use mars_types::{ }; use pyth_sdk_cw::PriceIdentifier; +use super::mock_contracts::mock_astroport_incentives; use crate::integration::mock_contracts::{ mock_address_provider_contract, mock_incentives_contract, mock_oracle_osmosis_contract, mock_params_osmosis_contract, mock_pyth_contract, mock_red_bank_contract, @@ -34,6 +37,7 @@ pub struct MockEnv { pub app: App, pub owner: Addr, pub address_provider: AddressProvider, + pub astro_incentives: AstroIncentives, pub incentives: Incentives, pub oracle: Oracle, pub red_bank: RedBank, @@ -48,6 +52,11 @@ pub struct AddressProvider { pub contract_addr: Addr, } +#[derive(Clone)] +pub struct AstroIncentives { + pub contract_addr: Addr, +} + #[derive(Clone)] pub struct Incentives { pub contract_addr: Addr, @@ -116,6 +125,28 @@ impl MockEnv { } } +impl AstroIncentives { + pub fn set_incentive_schedule( + &self, + env: &mut MockEnv, + lp_denom: &str, + incentive_schedule: &InputSchedule, + funds: Vec, + ) { + env.app + .execute_contract( + env.owner.clone(), + self.contract_addr.clone(), + &astroport_v5::incentives::ExecuteMsg::Incentivize { + lp_token: lp_denom.to_string(), + schedule: incentive_schedule.clone(), + }, + &funds, + ) + .unwrap(); + } +} + impl Incentives { pub fn whitelist_incentive_denoms(&self, env: &mut MockEnv, incentive_denoms: &[(&str, u128)]) { env.app @@ -206,6 +237,64 @@ impl Incentives { ) } + pub fn claim_astro_rewards( + &self, + env: &mut MockEnv, + sender: &Addr, + account_id: String, + lp_denom: &str, + ) -> AnyResult { + env.app.execute_contract( + sender.clone(), + self.contract_addr.clone(), + &incentives::ExecuteMsg::ClaimStakedAstroLpRewards { + account_id, + lp_denom: lp_denom.to_string(), + }, + &[], + ) + } + + pub fn stake_astro_lp( + &self, + env: &mut MockEnv, + sender: &Addr, + account_id: String, + lp_coin: Coin, + ) { + env.app + .execute_contract( + sender.clone(), + self.contract_addr.clone(), + &incentives::ExecuteMsg::StakeAstroLp { + account_id, + lp_coin: lp_coin.clone(), + }, + &[lp_coin], + ) + .unwrap(); + } + + pub fn unstake_astro_lp( + &self, + env: &mut MockEnv, + sender: &Addr, + account_id: String, + lp_coin: Coin, + ) { + env.app + .execute_contract( + sender.clone(), + self.contract_addr.clone(), + &incentives::ExecuteMsg::UnstakeAstroLp { + account_id, + lp_coin: ActionCoin::from(&lp_coin.clone()), + }, + &[], + ) + .unwrap(); + } + pub fn query_unclaimed_rewards(&self, env: &mut MockEnv, user: &Addr) -> StdResult> { self.query_unclaimed_rewards_with_acc_id(env, user, None) } @@ -227,6 +316,21 @@ impl Incentives { }, ) } + + pub fn query_unclaimed_astroport_rewards( + &self, + env: &MockEnv, + account_id: String, + lp_denom: &str, + ) -> StdResult> { + env.app.wrap().query_wasm_smart( + self.contract_addr.clone(), + &incentives::QueryMsg::StakedAstroLpRewards { + account_id, + lp_denom: lp_denom.to_string(), + }, + ) + } } impl Oracle { @@ -816,6 +920,7 @@ impl MockEnvBuilder { let rewards_collector_addr = self.deploy_rewards_collector_osmosis(&address_provider_addr); let params_addr = self.deploy_params_osmosis(&address_provider_addr); let pyth_addr = self.deploy_mock_pyth(); + let astroport_incentives_addr = self.deploy_mock_astroport_incentives(); self.update_address_provider( &address_provider_addr, @@ -840,6 +945,11 @@ impl MockEnvBuilder { MarsAddressType::CreditManager, &cm_addr, ); + self.update_address_provider( + &address_provider_addr, + MarsAddressType::AstroportIncentives, + &astroport_incentives_addr, + ); MockEnv { app: take(&mut self.app), @@ -847,6 +957,9 @@ impl MockEnvBuilder { address_provider: AddressProvider { contract_addr: address_provider_addr, }, + astro_incentives: AstroIncentives { + contract_addr: astroport_incentives_addr, + }, incentives: Incentives { contract_addr: incentives_addr, }, @@ -996,6 +1109,21 @@ impl MockEnvBuilder { .unwrap() } + pub fn deploy_mock_astroport_incentives(&mut self) -> Addr { + let code_id = self.app.store_code(mock_astroport_incentives()); + + self.app + .instantiate_contract( + code_id, + self.owner.clone(), + &Empty {}, + &[], + "mock-astroport-incentives", + None, + ) + .unwrap() + } + fn update_address_provider( &mut self, address_provider_addr: &Addr, diff --git a/packages/testing/src/mars_mock_querier.rs b/packages/testing/src/mars_mock_querier.rs index ae56cadf..4ab4d534 100644 --- a/packages/testing/src/mars_mock_querier.rs +++ b/packages/testing/src/mars_mock_querier.rs @@ -112,12 +112,12 @@ impl MarsMockQuerier { &mut self, lp_denom: &str, // We will only every use the incentives contract as the user addr - user_addr: &str, + account_id: &str, reward_assets: Vec, ) { self.astroport_incentives_querier .unclaimed_rewards - .insert((user_addr.to_string(), lp_denom.to_string()), reward_assets); + .insert((account_id.to_string(), lp_denom.to_string()), reward_assets); } pub fn set_query_pool_response(&mut self, pool_id: u64, pool_response: PoolResponse) { diff --git a/packages/testing/src/multitest/helpers/contracts.rs b/packages/testing/src/multitest/helpers/contracts.rs index d72fa6ac..e519cfc6 100644 --- a/packages/testing/src/multitest/helpers/contracts.rs +++ b/packages/testing/src/multitest/helpers/contracts.rs @@ -101,6 +101,15 @@ pub fn mock_params_contract() -> Box> { Box::new(contract) } +pub fn mock_astro_incentives_contract() -> Box> { + let contract = ContractWrapper::new( + mars_mock_astroport_incentives::contract::execute, + mars_mock_astroport_incentives::contract::instantiate, + mars_mock_astroport_incentives::contract::query, + ); + Box::new(contract) +} + pub fn mock_managed_vault_contract() -> Box> { let contract = ContractWrapper::new( mars_vault::contract::execute, diff --git a/packages/testing/src/multitest/helpers/mock_env.rs b/packages/testing/src/multitest/helpers/mock_env.rs index 84765c84..c631f95e 100644 --- a/packages/testing/src/multitest/helpers/mock_env.rs +++ b/packages/testing/src/multitest/helpers/mock_env.rs @@ -46,7 +46,11 @@ use mars_types::{ AccountKind, ExecuteMsg::UpdateConfig, HealthValuesResponse, InstantiateMsg as HealthInstantiateMsg, QueryMsg::HealthValues, }, - incentives::{ExecuteMsg::BalanceChange, QueryMsg::UserUnclaimedRewards}, + incentives::{ + ExecuteMsg::{BalanceChange, SetAssetIncentive}, + QueryMsg::{StakedAstroLpPosition, StakedAstroLpRewards, UserUnclaimedRewards}, + StakedLpPositionResponse, + }, oracle::{ActionKind, PriceResponse, QueryMsg::Price as OraclePrice}, params::{ AssetParams, @@ -71,10 +75,11 @@ use mars_vault::{ use mars_zapper_mock::msg::{InstantiateMsg as ZapperInstantiateMsg, LpConfig}; use super::{ - lp_token_info, mock_account_nft_contract, mock_address_provider_contract, mock_health_contract, - mock_incentives_contract, mock_managed_vault_contract, mock_oracle_contract, - mock_params_contract, mock_red_bank_contract, mock_rover_contract, mock_swapper_contract, - mock_v2_zapper_contract, mock_vault_contract, AccountToFund, CoinInfo, VaultTestInfo, + lp_token_info, mock_account_nft_contract, mock_address_provider_contract, + mock_astro_incentives_contract, mock_health_contract, mock_incentives_contract, + mock_managed_vault_contract, mock_oracle_contract, mock_params_contract, + mock_red_bank_contract, mock_rover_contract, mock_swapper_contract, mock_v2_zapper_contract, + mock_vault_contract, AccountToFund, CoinInfo, VaultTestInfo, }; use crate::multitest::modules::token_factory::{CustomApp, TokenFactory}; @@ -419,6 +424,34 @@ impl MockEnv { .unwrap(); } + pub fn add_astro_incentive_reward(&mut self, account_id: &str, lp_denom: &str, coin: Coin) { + // This is a bit of a hack to set up astroport lp rewards in our mock contract, using the existing API. + self.app + .execute_contract( + self.rover.clone(), + self.incentives.addr.clone(), + &SetAssetIncentive { + collateral_denom: lp_denom.to_string(), + incentive_denom: coin.denom.clone(), + // Emision per second is used for amount + emission_per_second: coin.amount, + // Start time is used for account_id. The account id is parsed as a u64 + start_time: account_id.parse().unwrap(), + duration: Default::default(), + }, + &[], + ) + .unwrap(); + + // Mint token for incentives contract so it can be claimed + self.app + .sudo(SudoMsg::Bank(BankSudo::Mint { + to_address: self.incentives.addr.to_string(), + amount: vec![coin], + })) + .unwrap(); + } + //-------------------------------------------------------------------------------------------------- // Queries //-------------------------------------------------------------------------------------------------- @@ -454,6 +487,23 @@ impl MockEnv { .unwrap() } + pub fn query_unclaimed_astroport_rewards_for_lp( + &self, + account_id: &str, + lp_denom: &str, + ) -> Vec { + self.app + .wrap() + .query_wasm_smart( + self.incentives.clone().addr, + &StakedAstroLpRewards { + account_id: account_id.to_string(), + lp_denom: lp_denom.to_string(), + }, + ) + .unwrap() + } + pub fn query_unclaimed_rewards(&self, account_id: &str) -> Vec { self.app .wrap() @@ -470,6 +520,36 @@ impl MockEnv { .unwrap() } + pub fn query_staked_astro_lp_rewards(&self, account_id: &str, lp_denom: &str) -> Vec { + self.app + .wrap() + .query_wasm_smart( + self.incentives.clone().addr, + &StakedAstroLpRewards { + account_id: account_id.to_string(), + lp_denom: lp_denom.to_string(), + }, + ) + .unwrap() + } + + pub fn query_staked_lp_position( + &self, + account_id: &str, + lp_denom: &str, + ) -> StakedLpPositionResponse { + self.app + .wrap() + .query_wasm_smart( + self.incentives.clone().addr, + &StakedAstroLpPosition { + account_id: account_id.to_string(), + lp_denom: lp_denom.to_string(), + }, + ) + .unwrap() + } + pub fn query_balance(&self, addr: &Addr, denom: &str) -> Coin { self.app.wrap().query_balance(addr.clone(), denom).unwrap() } @@ -835,7 +915,7 @@ impl MockEnvBuilder { let incentives = Incentives::new(Addr::unchecked(self.get_incentives().address()), rover.clone()); - let params = self.get_params_contract(); + let params: mars_types::adapters::params::ParamsBase = self.get_params_contract(); self.add_params_to_contract(); let health_contract = self.get_health_contract(); @@ -1254,6 +1334,20 @@ impl MockEnvBuilder { IncentivesUnchecked::new(addr.to_string()) } + pub fn deploy_astroport_incentives(&mut self) -> Addr { + let code_id = self.app.store_code(mock_astro_incentives_contract()); + self.app + .instantiate_contract( + code_id, + Addr::unchecked("astroport_incentives_owner"), + &Empty {}, + &[], + "mock-astroport-incentives", + None, + ) + .unwrap() + } + fn deploy_vault(&mut self, vault: &VaultTestInfo) -> Addr { let code_id = self.app.store_code(mock_vault_contract()); let oracle = self.get_oracle().into(); diff --git a/packages/types/src/adapters/incentives.rs b/packages/types/src/adapters/incentives.rs index 43be2981..fa56dfc7 100644 --- a/packages/types/src/adapters/incentives.rs +++ b/packages/types/src/adapters/incentives.rs @@ -3,7 +3,10 @@ use cosmwasm_std::{ to_json_binary, Addr, Api, Coin, CosmosMsg, QuerierWrapper, StdResult, WasmMsg, }; -use crate::incentives::{ExecuteMsg, QueryMsg}; +use crate::{ + credit_manager::ActionCoin, + incentives::{ExecuteMsg, PaginatedStakedLpResponse, QueryMsg, StakedLpPositionResponse}, +}; #[cw_serde] pub struct IncentivesUnchecked(String); @@ -56,6 +59,43 @@ impl Incentives { })) } + pub fn claim_staked_astro_lp_rewards_msg( + &self, + account_id: &str, + lp_denom: &str, + ) -> StdResult { + Ok(CosmosMsg::Wasm(WasmMsg::Execute { + contract_addr: self.addr.to_string(), + msg: to_json_binary(&ExecuteMsg::ClaimStakedAstroLpRewards { + account_id: account_id.to_string(), + lp_denom: lp_denom.to_string(), + })?, + funds: vec![], + })) + } + + pub fn stake_astro_lp_msg(&self, account_id: &str, lp_coin: Coin) -> StdResult { + Ok(CosmosMsg::Wasm(WasmMsg::Execute { + contract_addr: self.addr.to_string(), + msg: to_json_binary(&ExecuteMsg::StakeAstroLp { + account_id: account_id.to_string(), + lp_coin: lp_coin.clone(), + })?, + funds: vec![lp_coin], + })) + } + + pub fn unstake_astro_lp_msg(&self, account_id: &str, lp_coin: &Coin) -> StdResult { + Ok(CosmosMsg::Wasm(WasmMsg::Execute { + contract_addr: self.addr.to_string(), + msg: to_json_binary(&ExecuteMsg::UnstakeAstroLp { + account_id: account_id.to_string(), + lp_coin: ActionCoin::from(lp_coin), + })?, + funds: vec![], + })) + } + pub fn query_unclaimed_rewards( &self, querier: &QuerierWrapper, @@ -72,4 +112,73 @@ impl Incentives { }, ) } + + pub fn query_staked_astro_lp_rewards( + &self, + querier: &QuerierWrapper, + account_id: &str, + lp_denom: &str, + ) -> StdResult> { + querier.query_wasm_smart( + self.addr.to_string(), + &QueryMsg::StakedAstroLpRewards { + account_id: account_id.to_string(), + lp_denom: lp_denom.to_string(), + }, + ) + } + + pub fn query_staked_astro_lp_position( + &self, + querier: &QuerierWrapper, + account_id: &str, + lp_denom: &str, + ) -> StdResult { + querier.query_wasm_smart( + self.addr.to_string(), + &QueryMsg::StakedAstroLpPosition { + account_id: account_id.to_string(), + lp_denom: lp_denom.to_string(), + }, + ) + } + + pub fn query_staked_astro_lp_positions( + &self, + querier: &QuerierWrapper, + account_id: &str, + start_after: Option, + limit: Option, + ) -> StdResult { + querier.query_wasm_smart( + self.addr.to_string(), + &QueryMsg::StakedAstroLpPositions { + account_id: account_id.to_string(), + start_after, + limit, + }, + ) + } + + pub fn query_all_staked_astro_lp_coins( + &self, + querier: &QuerierWrapper, + account_id: &str, + ) -> StdResult> { + let mut start_after = Option::::None; + let mut has_more = true; + let mut all_coins = Vec::new(); + + while has_more { + let response = + self.query_staked_astro_lp_positions(querier, account_id, start_after, None)?; + for item in response.data { + all_coins.push(item.lp_coin); + } + start_after = all_coins.last().map(|item| item.denom.clone()); + has_more = response.metadata.has_more; + } + + Ok(all_coins) + } } diff --git a/packages/types/src/credit_manager/execute.rs b/packages/types/src/credit_manager/execute.rs index d0b7ee0d..30e2f2a7 100644 --- a/packages/types/src/credit_manager/execute.rs +++ b/packages/types/src/credit_manager/execute.rs @@ -199,6 +199,18 @@ pub enum Action { lp_token: ActionCoin, slippage: Decimal, }, + /// Stake lp token in astroport incentives contract via mars incentives + StakeAstroLp { + lp_token: ActionCoin, + }, + /// Unstake lp token from astroport incentives contract via mars incentives + UnstakeAstroLp { + lp_token: ActionCoin, + }, + /// Claim accrued LP incentive rewards from astroport incentives contract via mars incentives + ClaimAstroLpRewards { + lp_denom: String, + }, /// Refunds all coin balances back to user wallet RefundAllCoinBalances {}, } @@ -340,6 +352,25 @@ pub enum CallbackMsg { lp_token_out: String, slippage: Decimal, }, + /// Stake lp token in astroport incentives contract via mars incentives + StakeAstroLp { + // Account id staking the LP + account_id: String, + // Amount / denom to stake + lp_token: ActionCoin, + }, + /// Unstake lp token from astroport incentives contract via mars incentives. + UnstakeAstroLp { + // account id unstaking the LP + account_id: String, + // lp coin to unstake + lp_token: ActionCoin, + }, + /// Claim all accrued rewards for LP position in astroport incentives + ClaimAstroLpRewards { + account_id: String, + lp_denom: String, + }, /// Send LP token and withdraw corresponding reserve assets from pool. /// If `lp_token.amount: AccountBalance`, the account balance of `lp_token.denom` will be used. WithdrawLiquidity { diff --git a/packages/types/src/credit_manager/query.rs b/packages/types/src/credit_manager/query.rs index 651aea7a..dae38792 100644 --- a/packages/types/src/credit_manager/query.rs +++ b/packages/types/src/credit_manager/query.rs @@ -152,6 +152,7 @@ pub struct Positions { pub debts: Vec, pub lends: Vec, pub vaults: Vec, + pub staked_lp: Vec, } #[cw_serde] diff --git a/packages/types/src/incentives.rs b/packages/types/src/incentives.rs index b552f535..0b6e991f 100644 --- a/packages/types/src/incentives.rs +++ b/packages/types/src/incentives.rs @@ -153,7 +153,7 @@ pub enum ExecuteMsg { limit: Option, }, - ClaimAstroLpRewards { + ClaimStakedAstroLpRewards { account_id: String, lp_denom: String, }, @@ -205,6 +205,15 @@ pub enum MigrateV1ToV2 { #[cw_serde] #[derive(QueryResponses)] pub enum QueryMsg { + /// Query account staked LP rewards + #[returns(PaginatedLpRewardsResponse)] + StakedAstroLpRewards { + /// The id of the account who owns the LP + account_id: String, + /// Denom of LP that is accruing rewards + lp_denom: String, + }, + /// Query all active incentive emissions for a collateral denom #[returns(Vec)] ActiveEmissions { @@ -238,27 +247,6 @@ pub enum QueryMsg { limit: Option, }, - /// Enumerate a users LP positions with pagination - #[returns(PaginatedStakedLpResponse)] - StakedLpPositions { - /// The id of the account who owns the LP - account_id: String, - /// Start pagination after this lp denom, if used. - start_after: Option, - /// The maximum number of results to return. If not set, 5 is used. If larger than 10, - /// 10 is used. - limit: Option, - }, - - /// Get specific details on a users LP Position - #[returns(StakedLpPositionResponse)] - StakedLpPosition { - /// The id of the account who owns the LP - account_id: String, - /// The denom of the LP position - lp_denom: String, - }, - /// Queries the planned emission rate for a given collateral and incentive denom tuple at the /// specified unix timestamp. The emission rate returned is the amount of incentive tokens /// that will be emitted per second for each unit of collateral supplied during the epoch. @@ -288,6 +276,27 @@ pub enum QueryMsg { limit: Option, }, + /// Enumerate a users LP positions with pagination + #[returns(PaginatedStakedLpResponse)] + StakedAstroLpPositions { + /// The id of the account who owns the LP + account_id: String, + /// Start pagination after this lp denom, if used. + start_after: Option, + /// The maximum number of results to return. If not set, 5 is used. If larger than 10, + /// 10 is used. + limit: Option, + }, + + /// Get specific details on a users LP Position + #[returns(StakedLpPositionResponse)] + StakedAstroLpPosition { + /// The id of the account who owns the LP + account_id: String, + /// The denom of the LP position + lp_denom: String, + }, + /// Query user current unclaimed rewards #[returns(Vec)] UserUnclaimedRewards { diff --git a/schemas/mars-credit-manager/mars-credit-manager.json b/schemas/mars-credit-manager/mars-credit-manager.json index cf76b430..c2ac67d3 100644 --- a/schemas/mars-credit-manager/mars-credit-manager.json +++ b/schemas/mars-credit-manager/mars-credit-manager.json @@ -741,6 +741,72 @@ }, "additionalProperties": false }, + { + "description": "Stake lp token in astroport incentives contract via mars incentives", + "type": "object", + "required": [ + "stake_astro_lp" + ], + "properties": { + "stake_astro_lp": { + "type": "object", + "required": [ + "lp_token" + ], + "properties": { + "lp_token": { + "$ref": "#/definitions/ActionCoin" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Unstake lp token from astroport incentives contract via mars incentives", + "type": "object", + "required": [ + "unstake_astro_lp" + ], + "properties": { + "unstake_astro_lp": { + "type": "object", + "required": [ + "lp_token" + ], + "properties": { + "lp_token": { + "$ref": "#/definitions/ActionCoin" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Claim accrued LP incentive rewards from astroport incentives contract via mars incentives", + "type": "object", + "required": [ + "claim_astro_lp_rewards" + ], + "properties": { + "claim_astro_lp_rewards": { + "type": "object", + "required": [ + "lp_denom" + ], + "properties": { + "lp_denom": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, { "description": "Refunds all coin balances back to user wallet", "type": "object", @@ -1484,6 +1550,84 @@ }, "additionalProperties": false }, + { + "description": "Stake lp token in astroport incentives contract via mars incentives", + "type": "object", + "required": [ + "stake_astro_lp" + ], + "properties": { + "stake_astro_lp": { + "type": "object", + "required": [ + "account_id", + "lp_token" + ], + "properties": { + "account_id": { + "type": "string" + }, + "lp_token": { + "$ref": "#/definitions/ActionCoin" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Unstake lp token from astroport incentives contract via mars incentives.", + "type": "object", + "required": [ + "unstake_astro_lp" + ], + "properties": { + "unstake_astro_lp": { + "type": "object", + "required": [ + "account_id", + "lp_token" + ], + "properties": { + "account_id": { + "type": "string" + }, + "lp_token": { + "$ref": "#/definitions/ActionCoin" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Claim all accrued rewards for LP position in astroport incentives", + "type": "object", + "required": [ + "claim_astro_lp_rewards" + ], + "properties": { + "claim_astro_lp_rewards": { + "type": "object", + "required": [ + "account_id", + "lp_denom" + ], + "properties": { + "account_id": { + "type": "string" + }, + "lp_denom": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, { "description": "Send LP token and withdraw corresponding reserve assets from pool. If `lp_token.amount: AccountBalance`, the account balance of `lp_token.denom` will be used.", "type": "object", @@ -3294,6 +3438,7 @@ "debts", "deposits", "lends", + "staked_lp", "vaults" ], "properties": { @@ -3321,6 +3466,12 @@ "$ref": "#/definitions/Coin" } }, + "staked_lp": { + "type": "array", + "items": { + "$ref": "#/definitions/Coin" + } + }, "vaults": { "type": "array", "items": { diff --git a/schemas/mars-incentives/mars-incentives.json b/schemas/mars-incentives/mars-incentives.json index 29972c1e..009c5e83 100644 --- a/schemas/mars-incentives/mars-incentives.json +++ b/schemas/mars-incentives/mars-incentives.json @@ -231,10 +231,10 @@ { "type": "object", "required": [ - "claim_astro_lp_rewards" + "claim_staked_astro_lp_rewards" ], "properties": { - "claim_astro_lp_rewards": { + "claim_staked_astro_lp_rewards": { "type": "object", "required": [ "account_id", @@ -584,6 +584,34 @@ "$schema": "http://json-schema.org/draft-07/schema#", "title": "QueryMsg", "oneOf": [ + { + "description": "Query account staked LP rewards", + "type": "object", + "required": [ + "staked_astro_lp_rewards" + ], + "properties": { + "staked_astro_lp_rewards": { + "type": "object", + "required": [ + "account_id", + "lp_denom" + ], + "properties": { + "account_id": { + "description": "The id of the account who owns the LP", + "type": "string" + }, + "lp_denom": { + "description": "Denom of LP that is accruing rewards", + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, { "description": "Query all active incentive emissions for a collateral denom", "type": "object", @@ -688,73 +716,6 @@ }, "additionalProperties": false }, - { - "description": "Enumerate a users LP positions with pagination", - "type": "object", - "required": [ - "staked_lp_positions" - ], - "properties": { - "staked_lp_positions": { - "type": "object", - "required": [ - "account_id" - ], - "properties": { - "account_id": { - "description": "The id of the account who owns the LP", - "type": "string" - }, - "limit": { - "description": "The maximum number of results to return. If not set, 5 is used. If larger than 10, 10 is used.", - "type": [ - "integer", - "null" - ], - "format": "uint32", - "minimum": 0.0 - }, - "start_after": { - "description": "Start pagination after this lp denom, if used.", - "type": [ - "string", - "null" - ] - } - }, - "additionalProperties": false - } - }, - "additionalProperties": false - }, - { - "description": "Get specific details on a users LP Position", - "type": "object", - "required": [ - "staked_lp_position" - ], - "properties": { - "staked_lp_position": { - "type": "object", - "required": [ - "account_id", - "lp_denom" - ], - "properties": { - "account_id": { - "description": "The id of the account who owns the LP", - "type": "string" - }, - "lp_denom": { - "description": "The denom of the LP position", - "type": "string" - } - }, - "additionalProperties": false - } - }, - "additionalProperties": false - }, { "description": "Queries the planned emission rate for a given collateral and incentive denom tuple at the specified unix timestamp. The emission rate returned is the amount of incentive tokens that will be emitted per second for each unit of collateral supplied during the epoch. NB: that the returned value can change if someone adds incentives to the contract.", "type": "object", @@ -836,6 +797,73 @@ }, "additionalProperties": false }, + { + "description": "Enumerate a users LP positions with pagination", + "type": "object", + "required": [ + "staked_astro_lp_positions" + ], + "properties": { + "staked_astro_lp_positions": { + "type": "object", + "required": [ + "account_id" + ], + "properties": { + "account_id": { + "description": "The id of the account who owns the LP", + "type": "string" + }, + "limit": { + "description": "The maximum number of results to return. If not set, 5 is used. If larger than 10, 10 is used.", + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "start_after": { + "description": "Start pagination after this lp denom, if used.", + "type": [ + "string", + "null" + ] + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Get specific details on a users LP Position", + "type": "object", + "required": [ + "staked_astro_lp_position" + ], + "properties": { + "staked_astro_lp_position": { + "type": "object", + "required": [ + "account_id", + "lp_denom" + ], + "properties": { + "account_id": { + "description": "The id of the account who owns the LP", + "type": "string" + }, + "lp_denom": { + "description": "The denom of the LP position", + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, { "description": "Query user current unclaimed rewards", "type": "object", @@ -1141,7 +1169,7 @@ } } }, - "staked_lp_position": { + "staked_astro_lp_position": { "$schema": "http://json-schema.org/draft-07/schema#", "title": "StakedLpPositionResponse", "type": "object", @@ -1183,7 +1211,7 @@ } } }, - "staked_lp_positions": { + "staked_astro_lp_positions": { "$schema": "http://json-schema.org/draft-07/schema#", "title": "PaginationResponse_for_StakedLpPositionResponse", "type": "object", @@ -1256,6 +1284,73 @@ } } }, + "staked_astro_lp_rewards": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "PaginationResponse_for_Tuple_of_String_and_Array_of_Coin", + "type": "object", + "required": [ + "data", + "metadata" + ], + "properties": { + "data": { + "type": "array", + "items": { + "type": "array", + "items": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "$ref": "#/definitions/Coin" + } + } + ], + "maxItems": 2, + "minItems": 2 + } + }, + "metadata": { + "$ref": "#/definitions/Metadata" + } + }, + "additionalProperties": false, + "definitions": { + "Coin": { + "type": "object", + "required": [ + "amount", + "denom" + ], + "properties": { + "amount": { + "$ref": "#/definitions/Uint128" + }, + "denom": { + "type": "string" + } + } + }, + "Metadata": { + "type": "object", + "required": [ + "has_more" + ], + "properties": { + "has_more": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "Uint128": { + "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```", + "type": "string" + } + } + }, "user_unclaimed_rewards": { "$schema": "http://json-schema.org/draft-07/schema#", "title": "Array_of_Coin", diff --git a/schemas/mars-rewards-collector-base/mars-rewards-collector-base.json b/schemas/mars-rewards-collector-base/mars-rewards-collector-base.json index e4bffea4..7f5f7fc2 100644 --- a/schemas/mars-rewards-collector-base/mars-rewards-collector-base.json +++ b/schemas/mars-rewards-collector-base/mars-rewards-collector-base.json @@ -731,6 +731,72 @@ }, "additionalProperties": false }, + { + "description": "Stake lp token in astroport incentives contract via mars incentives", + "type": "object", + "required": [ + "stake_astro_lp" + ], + "properties": { + "stake_astro_lp": { + "type": "object", + "required": [ + "lp_token" + ], + "properties": { + "lp_token": { + "$ref": "#/definitions/ActionCoin" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Unstake lp token from astroport incentives contract via mars incentives", + "type": "object", + "required": [ + "unstake_astro_lp" + ], + "properties": { + "unstake_astro_lp": { + "type": "object", + "required": [ + "lp_token" + ], + "properties": { + "lp_token": { + "$ref": "#/definitions/ActionCoin" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Claim accrued LP incentive rewards from astroport incentives contract via mars incentives", + "type": "object", + "required": [ + "claim_astro_lp_rewards" + ], + "properties": { + "claim_astro_lp_rewards": { + "type": "object", + "required": [ + "lp_denom" + ], + "properties": { + "lp_denom": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, { "description": "Refunds all coin balances back to user wallet", "type": "object", diff --git a/schemas/mars-rover-health-computer/mars-rover-health-computer.json b/schemas/mars-rover-health-computer/mars-rover-health-computer.json index fab20c0c..b86a5c66 100644 --- a/schemas/mars-rover-health-computer/mars-rover-health-computer.json +++ b/schemas/mars-rover-health-computer/mars-rover-health-computer.json @@ -355,6 +355,7 @@ "debts", "deposits", "lends", + "staked_lp", "vaults" ], "properties": { @@ -382,6 +383,12 @@ "$ref": "#/definitions/Coin" } }, + "staked_lp": { + "type": "array", + "items": { + "$ref": "#/definitions/Coin" + } + }, "vaults": { "type": "array", "items": { diff --git a/scripts/health/example-react/dist/assets/index-0d6505f2.js b/scripts/health/example-react/dist/assets/index-0d6505f2.js index 84ebb287..e14e51fc 100644 --- a/scripts/health/example-react/dist/assets/index-0d6505f2.js +++ b/scripts/health/example-react/dist/assets/index-0d6505f2.js @@ -15,8 +15,8 @@ $.crossorigin === 'use-credentials' ? (en.credentials = 'include') : $.crossorigin === 'anonymous' - ? (en.credentials = 'omit') - : (en.credentials = 'same-origin'), + ? (en.credentials = 'omit') + : (en.credentials = 'same-origin'), en ) } @@ -31,12 +31,12 @@ var commonjsGlobal = typeof globalThis < 'u' ? globalThis : typeof window < 'u' - ? window - : typeof global < 'u' - ? global - : typeof self < 'u' - ? self - : {} + ? window + : typeof global < 'u' + ? global + : typeof self < 'u' + ? self + : {} function getDefaultExportFromCjs(e) { return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, 'default') ? e.default : e } @@ -842,8 +842,8 @@ function pa(e, o, _, b) { return b ? !1 : _ !== null - ? !_.acceptsBooleans - : ((e = e.toLowerCase().slice(0, 5)), e !== 'data-' && e !== 'aria-') + ? !_.acceptsBooleans + : ((e = e.toLowerCase().slice(0, 5)), e !== 'data-' && e !== 'aria-') default: return !1 } @@ -948,14 +948,14 @@ function ta(e, o, _, b) { b || $ === null ? oa(o) && (_ === null ? e.removeAttribute(o) : e.setAttribute(o, '' + _)) : $.mustUseProperty - ? (e[$.propertyName] = _ === null ? ($.type === 3 ? !1 : '') : _) - : ((o = $.attributeName), - (b = $.attributeNamespace), - _ === null - ? e.removeAttribute(o) - : (($ = $.type), - (_ = $ === 3 || ($ === 4 && _ === !0) ? '' : '' + _), - b ? e.setAttributeNS(b, o, _) : e.setAttribute(o, _)))) + ? (e[$.propertyName] = _ === null ? ($.type === 3 ? !1 : '') : _) + : ((o = $.attributeName), + (b = $.attributeNamespace), + _ === null + ? e.removeAttribute(o) + : (($ = $.type), + (_ = $ === 3 || ($ === 4 && _ === !0) ? '' : '' + _), + b ? e.setAttributeNS(b, o, _) : e.setAttribute(o, _)))) } var ua = aa.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, va = Symbol.for('react.element'), @@ -1396,8 +1396,8 @@ function lb(e, o) { return e == null || e === 'http://www.w3.org/1999/xhtml' ? kb(o) : e === 'http://www.w3.org/2000/svg' && o === 'foreignObject' - ? 'http://www.w3.org/1999/xhtml' - : e + ? 'http://www.w3.org/1999/xhtml' + : e } var mb, nb = (function (e) { @@ -1487,8 +1487,8 @@ function rb(e, o, _) { return o == null || typeof o == 'boolean' || o === '' ? '' : _ || typeof o != 'number' || o === 0 || (pb.hasOwnProperty(e) && pb[e]) - ? ('' + o).trim() - : o + 'px' + ? ('' + o).trim() + : o + 'px' } function sb(e, o) { e = e.style @@ -2458,8 +2458,8 @@ var Qd = A({}, ud, { return e.type === 'keypress' ? ((e = od(e)), e === 13 ? 'Enter' : String.fromCharCode(e)) : e.type === 'keydown' || e.type === 'keyup' - ? Nd[e.keyCode] || 'Unidentified' - : '' + ? Nd[e.keyCode] || 'Unidentified' + : '' }, code: 0, location: 0, @@ -2480,8 +2480,8 @@ var Qd = A({}, ud, { return e.type === 'keypress' ? od(e) : e.type === 'keydown' || e.type === 'keyup' - ? e.keyCode - : 0 + ? e.keyCode + : 0 }, }), Rd = rd(Qd), @@ -2519,10 +2519,10 @@ var Qd = A({}, ud, { return 'deltaY' in e ? e.deltaY : 'wheelDeltaY' in e - ? -e.wheelDeltaY - : 'wheelDelta' in e - ? -e.wheelDelta - : 0 + ? -e.wheelDeltaY + : 'wheelDelta' in e + ? -e.wheelDelta + : 0 }, deltaZ: 0, deltaMode: 0, @@ -2707,14 +2707,14 @@ function Le(e, o) { ? e === o ? !0 : e && e.nodeType === 3 - ? !1 - : o && o.nodeType === 3 - ? Le(e, o.parentNode) - : 'contains' in e - ? e.contains(o) - : e.compareDocumentPosition - ? !!(e.compareDocumentPosition(o) & 16) - : !1 + ? !1 + : o && o.nodeType === 3 + ? Le(e, o.parentNode) + : 'contains' in e + ? e.contains(o) + : e.compareDocumentPosition + ? !!(e.compareDocumentPosition(o) & 16) + : !1 : !1 } function Me() { @@ -2962,8 +2962,8 @@ function pf(e, o, _, b) { ? e.addEventListener(o, _, { capture: !0, passive: $ }) : e.addEventListener(o, _, !0) : $ !== void 0 - ? e.addEventListener(o, _, { passive: $ }) - : e.addEventListener(o, _, !1) + ? e.addEventListener(o, _, { passive: $ }) + : e.addEventListener(o, _, !1) } function hd(e, o, _, b, $) { var en = b @@ -3113,8 +3113,8 @@ function hd(e, o, _, b, $) { Jn.window === Jn ? Jn : (Kn = Jn.ownerDocument) - ? Kn.defaultView || Kn.parentWindow - : window), + ? Kn.defaultView || Kn.parentWindow + : window), an ? ((xn = _.relatedTarget || _.toElement), (an = In), @@ -3328,10 +3328,10 @@ var Ff = typeof setTimeout == 'function' ? setTimeout : void 0, typeof queueMicrotask == 'function' ? queueMicrotask : typeof Hf < 'u' - ? function (e) { - return Hf.resolve(null).then(e).catch(If) - } - : Ff + ? function (e) { + return Hf.resolve(null).then(e).catch(If) + } + : Ff function If(e) { setTimeout(function () { throw e @@ -3972,8 +3972,8 @@ function oh(e, o, _, b, $, en, nn) { typeof e.shouldComponentUpdate == 'function' ? e.shouldComponentUpdate(b, en, nn) : o.prototype && o.prototype.isPureReactComponent - ? !Ie(_, b) || !Ie($, en) - : !0 + ? !Ie(_, b) || !Ie($, en) + : !0 ) } function ph(e, o, _) { @@ -4107,13 +4107,13 @@ function vh(e) { return Tn === ya ? Jn(kn, ln, yn.props.children, Cn, yn.key) : ln !== null && - (ln.elementType === Tn || - (typeof Tn == 'object' && Tn !== null && Tn.$$typeof === Ha && uh(Tn) === ln.type)) - ? ((Cn = $(ln, yn.props)), (Cn.ref = sh$1(kn, ln, yn)), (Cn.return = kn), Cn) - : ((Cn = yh(yn.type, yn.key, yn.props, null, kn.mode, Cn)), - (Cn.ref = sh$1(kn, ln, yn)), - (Cn.return = kn), - Cn) + (ln.elementType === Tn || + (typeof Tn == 'object' && Tn !== null && Tn.$$typeof === Ha && uh(Tn) === ln.type)) + ? ((Cn = $(ln, yn.props)), (Cn.ref = sh$1(kn, ln, yn)), (Cn.return = kn), Cn) + : ((Cn = yh(yn.type, yn.key, yn.props, null, kn.mode, Cn)), + (Cn.ref = sh$1(kn, ln, yn)), + (Cn.return = kn), + Cn) } function In(kn, ln, yn, Cn) { return ln === null || @@ -5368,20 +5368,20 @@ function sj(e, o, _, b, $, en, nn) { return o.flags & 256 ? ((o.flags &= -257), (b = Li(Error(p(422)))), tj(e, o, nn, b)) : o.memoizedState !== null - ? ((o.child = e.child), (o.flags |= 128), null) - : ((en = b.fallback), - ($ = o.mode), - (b = qj({ mode: 'visible', children: b.children }, $, 0, null)), - (en = Ah(en, $, nn, null)), - (en.flags |= 2), - (b.return = o), - (en.return = o), - (b.sibling = en), - (o.child = b), - o.mode & 1 && Bh(o, e.child, null, nn), - (o.child.memoizedState = oj(nn)), - (o.memoizedState = nj), - en) + ? ((o.child = e.child), (o.flags |= 128), null) + : ((en = b.fallback), + ($ = o.mode), + (b = qj({ mode: 'visible', children: b.children }, $, 0, null)), + (en = Ah(en, $, nn, null)), + (en.flags |= 2), + (b.return = o), + (en.return = o), + (b.sibling = en), + (o.child = b), + o.mode & 1 && Bh(o, e.child, null, nn), + (o.child.memoizedState = oj(nn)), + (o.memoizedState = nj), + en) if (!(o.mode & 1)) return tj(e, o, nn, null) if ($.data === '$!') { if (((b = $.nextSibling && $.nextSibling.dataset), b)) var sn = b.dgst @@ -5560,8 +5560,8 @@ function zj(e, o, _) { return b.dehydrated !== null ? (G(M, M.current & 1), (o.flags |= 128), null) : _ & o.child.childLanes - ? pj(e, o, _) - : (G(M, M.current & 1), (e = $i(e, o, _)), e !== null ? e.sibling : null) + ? pj(e, o, _) + : (G(M, M.current & 1), (e = $i(e, o, _)), e !== null ? e.sibling : null) G(M, M.current & 1) break case 19: @@ -5651,14 +5651,12 @@ Cj = function (e, o, _, b) { (sn = sn ? sn.__html : void 0), gn != null && sn !== gn && (en = en || []).push(In, gn)) : In === 'children' - ? (typeof gn != 'string' && typeof gn != 'number') || - (en = en || []).push(In, '' + gn) - : In !== 'suppressContentEditableWarning' && - In !== 'suppressHydrationWarning' && - (ea.hasOwnProperty(In) - ? (gn != null && In === 'onScroll' && D('scroll', e), - en || sn === gn || (en = [])) - : (en = en || []).push(In, gn)) + ? (typeof gn != 'string' && typeof gn != 'number') || (en = en || []).push(In, '' + gn) + : In !== 'suppressContentEditableWarning' && + In !== 'suppressHydrationWarning' && + (ea.hasOwnProperty(In) + ? (gn != null && In === 'onScroll' && D('scroll', e), en || sn === gn || (en = [])) + : (en = en || []).push(In, gn)) } _ && (en = en || []).push('style', _) var In = en @@ -5824,10 +5822,10 @@ function Fj(e, o, _) { (e.innerHTML = ''), (e = e.removeChild(e.firstChild))) : typeof b.is == 'string' - ? (e = nn.createElement(_, { is: b.is })) - : ((e = nn.createElement(_)), - _ === 'select' && - ((nn = e), b.multiple ? (nn.multiple = !0) : b.size && (nn.size = b.size))) + ? (e = nn.createElement(_, { is: b.is })) + : ((e = nn.createElement(_)), + _ === 'select' && + ((nn = e), b.multiple ? (nn.multiple = !0) : b.size && (nn.size = b.size))) : (e = nn.createElementNS(e, _)), (e[Of] = o), (e[Pf] = b), @@ -5883,17 +5881,17 @@ function Fj(e, o, _) { en === 'style' ? sb(e, gn) : en === 'dangerouslySetInnerHTML' - ? ((gn = gn ? gn.__html : void 0), gn != null && nb(e, gn)) - : en === 'children' - ? typeof gn == 'string' - ? (_ !== 'textarea' || gn !== '') && ob(e, gn) - : typeof gn == 'number' && ob(e, '' + gn) - : en !== 'suppressContentEditableWarning' && - en !== 'suppressHydrationWarning' && - en !== 'autoFocus' && - (ea.hasOwnProperty(en) - ? gn != null && en === 'onScroll' && D('scroll', e) - : gn != null && ta(e, en, gn, nn)) + ? ((gn = gn ? gn.__html : void 0), gn != null && nb(e, gn)) + : en === 'children' + ? typeof gn == 'string' + ? (_ !== 'textarea' || gn !== '') && ob(e, gn) + : typeof gn == 'number' && ob(e, '' + gn) + : en !== 'suppressContentEditableWarning' && + en !== 'suppressHydrationWarning' && + en !== 'autoFocus' && + (ea.hasOwnProperty(en) + ? gn != null && en === 'onScroll' && D('scroll', e) + : gn != null && ta(e, en, gn, nn)) } switch (_) { case 'input': @@ -6519,10 +6517,10 @@ function ek(e, o) { Jn === 'style' ? sb($, qn) : Jn === 'dangerouslySetInnerHTML' - ? nb($, qn) - : Jn === 'children' - ? ob($, qn) - : ta($, Jn, qn, In) + ? nb($, qn) + : Jn === 'children' + ? ob($, qn) + : ta($, Jn, qn, In) } switch (sn) { case 'input': @@ -6734,8 +6732,8 @@ function jk(e, o, _) { nn.tag === 22 && nn.memoizedState !== null ? kk($) : gn !== null - ? ((gn.return = nn), (V = gn)) - : kk($) + ? ((gn.return = nn), (V = gn)) + : kk($) for (; en !== null; ) (V = en), jk(en), (en = en.sibling) ;(V = $), (Kj = sn), (U = In) } @@ -6950,8 +6948,8 @@ function lh(e) { ? K$1 & 2 && Z !== 0 ? Z & -Z : Kg.transition !== null - ? (Ck === 0 && (Ck = yc()), Ck) - : ((e = C), e !== 0 || ((e = window.event), (e = e === void 0 ? 16 : jd(e.type))), e) + ? (Ck === 0 && (Ck = yc()), Ck) + : ((e = C), e !== 0 || ((e = window.event), (e = e === void 0 ? 16 : jd(e.type))), e) : 1 } function mh(e, o, _, b) { @@ -7065,16 +7063,16 @@ function Hk(e, o) { (120 > b ? 120 : 480 > b - ? 480 - : 1080 > b - ? 1080 - : 1920 > b - ? 1920 - : 3e3 > b - ? 3e3 - : 4320 > b - ? 4320 - : 1960 * mk(b / 1960)) - b), + ? 480 + : 1080 > b + ? 1080 + : 1920 > b + ? 1920 + : 3e3 > b + ? 3e3 + : 4320 > b + ? 4320 + : 1960 * mk(b / 1960)) - b), 10 < b) ) { e.timeoutHandle = Ff(Qk.bind(null, e, uk, vk), b) @@ -8669,12 +8667,12 @@ function partialDeepEqual(e, o) { return e === o ? !0 : typeof e != typeof o - ? !1 - : e && o && typeof e == 'object' && typeof o == 'object' - ? !Object.keys(o).some(function (_) { - return !partialDeepEqual(e[_], o[_]) - }) - : !1 + ? !1 + : e && o && typeof e == 'object' && typeof o == 'object' + ? !Object.keys(o).some(function (_) { + return !partialDeepEqual(e[_], o[_]) + }) + : !1 } function replaceEqualDeep(e, o) { if (e === o) return e @@ -8789,8 +8787,8 @@ var FocusManager = (function (e) { return typeof this.focused == 'boolean' ? this.focused : typeof document > 'u' - ? !0 - : [void 0, 'visible', 'prerender'].includes(document.visibilityState) + ? !0 + : [void 0, 'visible', 'prerender'].includes(document.visibilityState) }), o ) @@ -8852,8 +8850,8 @@ var FocusManager = (function (e) { return typeof this.online == 'boolean' ? this.online : typeof navigator > 'u' || typeof navigator.onLine > 'u' - ? !0 - : navigator.onLine + ? !0 + : navigator.onLine }), o ) @@ -10207,8 +10205,8 @@ var QueryClient$1 = (function () { return typeof this.options.refetchInterval == 'function' ? this.options.refetchInterval(this.currentResult.data, this.currentQuery) : ($ = this.options.refetchInterval) != null - ? $ - : !1 + ? $ + : !1 }), (_.updateRefetchInterval = function ($) { var en = this @@ -11426,10 +11424,10 @@ const __viteBrowserExternal = {}, dn < 67108864 ? ((this.words = [dn & 67108863]), (this.length = 1)) : dn < 4503599627370496 - ? ((this.words = [dn & 67108863, (dn / 67108864) & 67108863]), (this.length = 2)) - : (b(dn < 9007199254740992), - (this.words = [dn & 67108863, (dn / 67108864) & 67108863, 1]), - (this.length = 3)), + ? ((this.words = [dn & 67108863, (dn / 67108864) & 67108863]), (this.length = 2)) + : (b(dn < 9007199254740992), + (this.words = [dn & 67108863, (dn / 67108864) & 67108863, 1]), + (this.length = 3)), fn === 'le' && this._initArray(this.toArray(), Nn, fn) }), (en.prototype._initArray = function (dn, Nn, fn) { @@ -11631,8 +11629,8 @@ const __viteBrowserExternal = {}, this.length === 2 ? (dn += this.words[1] * 67108864) : this.length === 3 && this.words[2] === 1 - ? (dn += 4503599627370496 + this.words[1] * 67108864) - : this.length > 2 && b(!1, 'Number can only safely store up to 53 bits'), + ? (dn += 4503599627370496 + this.words[1] * 67108864) + : this.length > 2 && b(!1, 'Number can only safely store up to 53 bits'), this.negative !== 0 ? -dn : dn ) }), @@ -11840,10 +11838,10 @@ const __viteBrowserExternal = {}, return dn.negative !== 0 && this.negative === 0 ? ((dn.negative = 0), (Nn = this.sub(dn)), (dn.negative ^= 1), Nn) : dn.negative === 0 && this.negative !== 0 - ? ((this.negative = 0), (Nn = dn.sub(this)), (this.negative = 1), Nn) - : this.length > dn.length - ? this.clone().iadd(dn) - : dn.clone().iadd(this) + ? ((this.negative = 0), (Nn = dn.sub(this)), (this.negative = 1), Nn) + : this.length > dn.length + ? this.clone().iadd(dn) + : dn.clone().iadd(this) }), (en.prototype.isub = function (dn) { if (dn.negative !== 0) { @@ -12493,10 +12491,10 @@ const __viteBrowserExternal = {}, this.length === 10 && dn.length === 10 ? (fn = ln(this, dn, Nn)) : _n < 63 - ? (fn = kn(this, dn, Nn)) - : _n < 1024 - ? (fn = yn(this, dn, Nn)) - : (fn = Cn(this, dn, Nn)), + ? (fn = kn(this, dn, Nn)) + : _n < 1024 + ? (fn = yn(this, dn, Nn)) + : (fn = Cn(this, dn, Nn)), fn ) }), @@ -12641,10 +12639,10 @@ const __viteBrowserExternal = {}, dn < 0 ? this.isubn(-dn) : this.negative !== 0 - ? this.length === 1 && (this.words[0] | 0) <= dn - ? ((this.words[0] = dn - (this.words[0] | 0)), (this.negative = 0), this) - : ((this.negative = 0), this.isubn(dn), (this.negative = 1), this) - : this._iaddn(dn) + ? this.length === 1 && (this.words[0] | 0) <= dn + ? ((this.words[0] = dn - (this.words[0] | 0)), (this.negative = 0), this) + : ((this.negative = 0), this.isubn(dn), (this.negative = 1), this) + : this._iaddn(dn) ) }), (en.prototype._iaddn = function (dn) { @@ -12741,22 +12739,22 @@ const __viteBrowserExternal = {}, Nn !== 'div' && ((Ln = zn.mod.neg()), fn && Ln.negative !== 0 && Ln.iadd(dn)), { div: _n, mod: Ln }) : this.negative === 0 && dn.negative !== 0 - ? ((zn = this.divmod(dn.neg(), Nn)), - Nn !== 'mod' && (_n = zn.div.neg()), - { div: _n, mod: zn.mod }) - : this.negative & dn.negative - ? ((zn = this.neg().divmod(dn.neg(), Nn)), - Nn !== 'div' && ((Ln = zn.mod.neg()), fn && Ln.negative !== 0 && Ln.isub(dn)), - { div: zn.div, mod: Ln }) - : dn.length > this.length || this.cmp(dn) < 0 - ? { div: new en(0), mod: this } - : dn.length === 1 - ? Nn === 'div' - ? { div: this.divn(dn.words[0]), mod: null } - : Nn === 'mod' - ? { div: null, mod: new en(this.modrn(dn.words[0])) } - : { div: this.divn(dn.words[0]), mod: new en(this.modrn(dn.words[0])) } - : this._wordDiv(dn, Nn) + ? ((zn = this.divmod(dn.neg(), Nn)), + Nn !== 'mod' && (_n = zn.div.neg()), + { div: _n, mod: zn.mod }) + : this.negative & dn.negative + ? ((zn = this.neg().divmod(dn.neg(), Nn)), + Nn !== 'div' && ((Ln = zn.mod.neg()), fn && Ln.negative !== 0 && Ln.isub(dn)), + { div: zn.div, mod: Ln }) + : dn.length > this.length || this.cmp(dn) < 0 + ? { div: new en(0), mod: this } + : dn.length === 1 + ? Nn === 'div' + ? { div: this.divn(dn.words[0]), mod: null } + : Nn === 'mod' + ? { div: null, mod: new en(this.modrn(dn.words[0])) } + : { div: this.divn(dn.words[0]), mod: new en(this.modrn(dn.words[0])) } + : this._wordDiv(dn, Nn) }), (en.prototype.div = function (dn) { return this.divmod(dn, 'div', !1).div @@ -12777,8 +12775,8 @@ const __viteBrowserExternal = {}, return zn < 0 || (Ln === 1 && zn === 0) ? Nn.div : Nn.div.negative !== 0 - ? Nn.div.isubn(1) - : Nn.div.iaddn(1) + ? Nn.div.isubn(1) + : Nn.div.iaddn(1) }), (en.prototype.modrn = function (dn) { var Nn = dn < 0 @@ -13075,10 +13073,10 @@ const __viteBrowserExternal = {}, _n === 0 ? ((Nn.words[0] = 0), (Nn.length = 1)) : _n > 0 - ? Nn.isub(this.p) - : Nn.strip !== void 0 - ? Nn.strip() - : Nn._strip(), + ? Nn.isub(this.p) + : Nn.strip !== void 0 + ? Nn.strip() + : Nn._strip(), Nn ) }), @@ -13849,8 +13847,8 @@ function factory(e) { ? NaN : sn * (1 / 0) : gn === 0 - ? sn * 1401298464324817e-60 * In - : sn * Math.pow(2, gn - 150) * (In + 8388608) + ? sn * 1401298464324817e-60 * In + : sn * Math.pow(2, gn - 150) * (In + 8388608) } ;(e.readFloatLE = _.bind(null, readUintLE)), (e.readFloatBE = _.bind(null, readUintBE)) })(), @@ -13950,8 +13948,8 @@ function factory(e) { ? NaN : Jn * (1 / 0) : qn === 0 - ? Jn * 5e-324 * Kn - : Jn * Math.pow(2, qn - 1075) * (Kn + 4503599627370496) + ? Jn * 5e-324 * Kn + : Jn * Math.pow(2, qn - 1075) * (Kn + 4503599627370496) } ;(e.readDoubleLE = _.bind(null, readUintLE, 0, 4)), (e.readDoubleBE = _.bind(null, readUintBE, 4, 0)) @@ -13994,10 +13992,10 @@ var utf8$2 = {} en < 128 ? ($ += 1) : en < 2048 - ? ($ += 2) - : (en & 64512) === 55296 && (b.charCodeAt(nn + 1) & 64512) === 56320 - ? (++nn, ($ += 4)) - : ($ += 3) + ? ($ += 2) + : (en & 64512) === 55296 && (b.charCodeAt(nn + 1) & 64512) === 56320 + ? (++nn, ($ += 4)) + : ($ += 3) return $ }), (o.read = function (b, $, en) { @@ -14008,17 +14006,14 @@ var utf8$2 = {} Jn < 128 ? (gn[In++] = Jn) : Jn > 191 && Jn < 224 - ? (gn[In++] = ((Jn & 31) << 6) | (b[$++] & 63)) - : Jn > 239 && Jn < 365 - ? ((Jn = - (((Jn & 7) << 18) | - ((b[$++] & 63) << 12) | - ((b[$++] & 63) << 6) | - (b[$++] & 63)) - - 65536), - (gn[In++] = 55296 + (Jn >> 10)), - (gn[In++] = 56320 + (Jn & 1023))) - : (gn[In++] = ((Jn & 15) << 12) | ((b[$++] & 63) << 6) | (b[$++] & 63)), + ? (gn[In++] = ((Jn & 31) << 6) | (b[$++] & 63)) + : Jn > 239 && Jn < 365 + ? ((Jn = + (((Jn & 7) << 18) | ((b[$++] & 63) << 12) | ((b[$++] & 63) << 6) | (b[$++] & 63)) - + 65536), + (gn[In++] = 55296 + (Jn >> 10)), + (gn[In++] = 56320 + (Jn & 1023))) + : (gn[In++] = ((Jn & 15) << 12) | ((b[$++] & 63) << 6) | (b[$++] & 63)), In > 8191 && ((sn || (sn = [])).push(String.fromCharCode.apply(String, gn)), (In = 0)) return sn ? (In && sn.push(String.fromCharCode.apply(String, gn.slice(0, In))), sn.join('')) @@ -14030,17 +14025,17 @@ var utf8$2 = {} sn < 128 ? ($[en++] = sn) : sn < 2048 - ? (($[en++] = (sn >> 6) | 192), ($[en++] = (sn & 63) | 128)) - : (sn & 64512) === 55296 && ((gn = b.charCodeAt(In + 1)) & 64512) === 56320 - ? ((sn = 65536 + ((sn & 1023) << 10) + (gn & 1023)), - ++In, - ($[en++] = (sn >> 18) | 240), - ($[en++] = ((sn >> 12) & 63) | 128), - ($[en++] = ((sn >> 6) & 63) | 128), - ($[en++] = (sn & 63) | 128)) - : (($[en++] = (sn >> 12) | 224), - ($[en++] = ((sn >> 6) & 63) | 128), - ($[en++] = (sn & 63) | 128)) + ? (($[en++] = (sn >> 6) | 192), ($[en++] = (sn & 63) | 128)) + : (sn & 64512) === 55296 && ((gn = b.charCodeAt(In + 1)) & 64512) === 56320 + ? ((sn = 65536 + ((sn & 1023) << 10) + (gn & 1023)), + ++In, + ($[en++] = (sn >> 18) | 240), + ($[en++] = ((sn >> 12) & 63) | 128), + ($[en++] = ((sn >> 6) & 63) | 128), + ($[en++] = (sn & 63) | 128)) + : (($[en++] = (sn >> 12) | 224), + ($[en++] = ((sn >> 6) & 63) | 128), + ($[en++] = (sn & 63) | 128)) return en - nn }) })(utf8$2) @@ -14168,18 +14163,18 @@ function requireLongbits() { ? 1 : 2 : nn < 2097152 - ? 3 - : 4 + ? 3 + : 4 : sn < 16384 - ? sn < 128 - ? 5 - : 6 - : sn < 2097152 - ? 7 - : 8 + ? sn < 128 + ? 5 + : 6 + : sn < 2097152 + ? 7 + : 8 : gn < 128 - ? 9 - : 10 + ? 9 + : 10 }), longbits ) @@ -14248,10 +14243,10 @@ function requireMinimal() { ? o._Buffer_allocUnsafe(en) : new o.Array(en) : o.Buffer - ? o._Buffer_from(en) - : typeof Uint8Array > 'u' - ? en - : new Uint8Array(en) + ? o._Buffer_from(en) + : typeof Uint8Array > 'u' + ? en + : new Uint8Array(en) }), (o.Array = typeof Uint8Array < 'u' ? Uint8Array : Array), (o.Long = @@ -14672,8 +14667,8 @@ Reader$1.prototype.bytes = function e() { Array.isArray(this.buf) ? this.buf.slice(_, b) : _ === b - ? new this.buf.constructor(0) - : this._slice.call(this.buf, _, b) + ? new this.buf.constructor(0) + : this._slice.call(this.buf, _, b) ) } Reader$1.prototype.string = function e() { @@ -14919,8 +14914,8 @@ function fromValue$3(e, o) { return typeof e == 'number' ? fromNumber$3(e, o) : typeof e == 'string' - ? fromString$3(e, o) - : fromBits$3(e.low, e.high, typeof o == 'boolean' ? o : e.unsigned) + ? fromString$3(e, o) + : fromBits$3(e.low, e.high, typeof o == 'boolean' ? o : e.unsigned) } Long$3.fromValue = fromValue$3 var TWO_PWR_16_DBL$3 = 1 << 16, @@ -15045,14 +15040,14 @@ LongPrototype$3.compare = function e(o) { return _ && !b ? -1 : !_ && b - ? 1 - : this.unsigned - ? o.high >>> 0 > this.high >>> 0 || (o.high === this.high && o.low >>> 0 > this.low >>> 0) - ? -1 - : 1 - : this.sub(o).isNegative() - ? -1 - : 1 + ? 1 + : this.unsigned + ? o.high >>> 0 > this.high >>> 0 || (o.high === this.high && o.low >>> 0 > this.low >>> 0) + ? -1 + : 1 + : this.sub(o).isNegative() + ? -1 + : 1 } LongPrototype$3.comp = LongPrototype$3.compare LongPrototype$3.negate = function e() { @@ -15225,8 +15220,8 @@ LongPrototype$3.shiftLeft = function e(o) { (o &= 63) === 0 ? this : o < 32 - ? fromBits$3(this.low << o, (this.high << o) | (this.low >>> (32 - o)), this.unsigned) - : fromBits$3(0, this.low << (o - 32), this.unsigned) + ? fromBits$3(this.low << o, (this.high << o) | (this.low >>> (32 - o)), this.unsigned) + : fromBits$3(0, this.low << (o - 32), this.unsigned) ) } LongPrototype$3.shl = LongPrototype$3.shiftLeft @@ -15236,8 +15231,8 @@ LongPrototype$3.shiftRight = function e(o) { (o &= 63) === 0 ? this : o < 32 - ? fromBits$3((this.low >>> o) | (this.high << (32 - o)), this.high >> o, this.unsigned) - : fromBits$3(this.high >> (o - 32), this.high >= 0 ? 0 : -1, this.unsigned) + ? fromBits$3((this.low >>> o) | (this.high << (32 - o)), this.high >> o, this.unsigned) + : fromBits$3(this.high >> (o - 32), this.high >= 0 ? 0 : -1, this.unsigned) ) } LongPrototype$3.shr = LongPrototype$3.shiftRight @@ -15451,8 +15446,8 @@ function fromJsonTimestamp(e) { return e instanceof Date ? toTimestamp(e) : typeof e == 'string' - ? toTimestamp(new Date(e)) - : timestampFromJSON(e) + ? toTimestamp(new Date(e)) + : timestampFromJSON(e) } helpers.fromJsonTimestamp = fromJsonTimestamp function numberToLong(e) { @@ -43490,8 +43485,9 @@ function requireLibsodiumSumo() { ((g = h) - (h = Vs(a))) | 0) >>> 0 < 2 || - ((pn[0 | (d = (a + h) | 0)] = - 36), + ((pn[ + 0 | (d = (a + h) | 0) + ] = 36), (pn[(d + 1) | 0] = 0), (d = Nr( (d + 1) | 0, @@ -67510,10 +67506,10 @@ function requireLibsodiumSumo() { ar >= 240 ? ((nr = 4), (Dt = !0)) : ar >= 224 - ? ((nr = 3), (Dt = !0)) - : ar >= 192 - ? ((nr = 2), (Dt = !0)) - : ar < 128 && ((nr = 1), (Dt = !0)) + ? ((nr = 3), (Dt = !0)) + : ar >= 192 + ? ((nr = 2), (Dt = !0)) + : ar < 128 && ((nr = 1), (Dt = !0)) } while (!Dt) for (var kr = nr - (Et.length - Yt), Nr = 0; Nr < kr; Nr++) lt--, Et.pop() it += Jn(Et) @@ -67623,8 +67619,8 @@ function requireLibsodiumSumo() { ct instanceof Uint8Array ? ct : typeof ct == 'string' - ? In(ct) - : void Sn(ot, 'unsupported input type for ' + ut) + ? In(ct) + : void Sn(ot, 'unsupported input type for ' + ut) ) } function En(ot, ct, ut, it, lt, vt) { @@ -70899,12 +70895,12 @@ function f$1(e, o, _, b) { return e === 0 ? o ^ _ ^ b : e === 1 - ? (o & _) | (~o & b) - : e === 2 - ? (o | ~_) ^ b - : e === 3 - ? (o & b) | (_ & ~b) - : o ^ (_ | ~b) + ? (o & _) | (~o & b) + : e === 2 + ? (o | ~_) ^ b + : e === 3 + ? (o & b) | (_ & ~b) + : o ^ (_ | ~b) } const BUF = new Uint32Array(16) let RIPEMD160$1 = class extends _sha2_js_1.SHA2 { @@ -71119,10 +71115,10 @@ var utils$x = {}, Hn < 67108864 ? ((this.words = [Hn & 67108863]), (this.length = 1)) : Hn < 4503599627370496 - ? ((this.words = [Hn & 67108863, (Hn / 67108864) & 67108863]), (this.length = 2)) - : (b(Hn < 9007199254740992), - (this.words = [Hn & 67108863, (Hn / 67108864) & 67108863, 1]), - (this.length = 3)), + ? ((this.words = [Hn & 67108863, (Hn / 67108864) & 67108863]), (this.length = 2)) + : (b(Hn < 9007199254740992), + (this.words = [Hn & 67108863, (Hn / 67108864) & 67108863, 1]), + (this.length = 3)), dn === 'le' && this._initArray(this.toArray(), un, dn) }), (en.prototype._initArray = function (Hn, un, dn) { @@ -71302,8 +71298,8 @@ var utils$x = {}, this.length === 2 ? (Hn += this.words[1] * 67108864) : this.length === 3 && this.words[2] === 1 - ? (Hn += 4503599627370496 + this.words[1] * 67108864) - : this.length > 2 && b(!1, 'Number can only safely store up to 53 bits'), + ? (Hn += 4503599627370496 + this.words[1] * 67108864) + : this.length > 2 && b(!1, 'Number can only safely store up to 53 bits'), this.negative !== 0 ? -Hn : Hn ) }), @@ -71495,10 +71491,10 @@ var utils$x = {}, return Hn.negative !== 0 && this.negative === 0 ? ((Hn.negative = 0), (un = this.sub(Hn)), (Hn.negative ^= 1), un) : Hn.negative === 0 && this.negative !== 0 - ? ((this.negative = 0), (un = Hn.sub(this)), (this.negative = 1), un) - : this.length > Hn.length - ? this.clone().iadd(Hn) - : Hn.clone().iadd(this) + ? ((this.negative = 0), (un = Hn.sub(this)), (this.negative = 1), un) + : this.length > Hn.length + ? this.clone().iadd(Hn) + : Hn.clone().iadd(this) }), (en.prototype.isub = function (Hn) { if (Hn.negative !== 0) { @@ -72149,10 +72145,10 @@ var utils$x = {}, this.length === 10 && Hn.length === 10 ? (dn = mn(this, Hn, un)) : Nn < 63 - ? (dn = xn(this, Hn, un)) - : Nn < 1024 - ? (dn = Bn(this, Hn, un)) - : (dn = kn(this, Hn, un)), + ? (dn = xn(this, Hn, un)) + : Nn < 1024 + ? (dn = Bn(this, Hn, un)) + : (dn = kn(this, Hn, un)), dn ) } @@ -72407,10 +72403,10 @@ var utils$x = {}, Hn < 0 ? this.isubn(-Hn) : this.negative !== 0 - ? this.length === 1 && (this.words[0] | 0) < Hn - ? ((this.words[0] = Hn - (this.words[0] | 0)), (this.negative = 0), this) - : ((this.negative = 0), this.isubn(Hn), (this.negative = 1), this) - : this._iaddn(Hn) + ? this.length === 1 && (this.words[0] | 0) < Hn + ? ((this.words[0] = Hn - (this.words[0] | 0)), (this.negative = 0), this) + : ((this.negative = 0), this.isubn(Hn), (this.negative = 1), this) + : this._iaddn(Hn) ) }), (en.prototype._iaddn = function (Hn) { @@ -72507,22 +72503,22 @@ var utils$x = {}, un !== 'div' && ((fn = _n.mod.neg()), dn && fn.negative !== 0 && fn.iadd(Hn)), { div: Nn, mod: fn }) : this.negative === 0 && Hn.negative !== 0 - ? ((_n = this.divmod(Hn.neg(), un)), - un !== 'mod' && (Nn = _n.div.neg()), - { div: Nn, mod: _n.mod }) - : this.negative & Hn.negative - ? ((_n = this.neg().divmod(Hn.neg(), un)), - un !== 'div' && ((fn = _n.mod.neg()), dn && fn.negative !== 0 && fn.isub(Hn)), - { div: _n.div, mod: fn }) - : Hn.length > this.length || this.cmp(Hn) < 0 - ? { div: new en(0), mod: this } - : Hn.length === 1 - ? un === 'div' - ? { div: this.divn(Hn.words[0]), mod: null } - : un === 'mod' - ? { div: null, mod: new en(this.modn(Hn.words[0])) } - : { div: this.divn(Hn.words[0]), mod: new en(this.modn(Hn.words[0])) } - : this._wordDiv(Hn, un) + ? ((_n = this.divmod(Hn.neg(), un)), + un !== 'mod' && (Nn = _n.div.neg()), + { div: Nn, mod: _n.mod }) + : this.negative & Hn.negative + ? ((_n = this.neg().divmod(Hn.neg(), un)), + un !== 'div' && ((fn = _n.mod.neg()), dn && fn.negative !== 0 && fn.isub(Hn)), + { div: _n.div, mod: fn }) + : Hn.length > this.length || this.cmp(Hn) < 0 + ? { div: new en(0), mod: this } + : Hn.length === 1 + ? un === 'div' + ? { div: this.divn(Hn.words[0]), mod: null } + : un === 'mod' + ? { div: null, mod: new en(this.modn(Hn.words[0])) } + : { div: this.divn(Hn.words[0]), mod: new en(this.modn(Hn.words[0])) } + : this._wordDiv(Hn, un) }), (en.prototype.div = function (Hn) { return this.divmod(Hn, 'div', !1).div @@ -72543,8 +72539,8 @@ var utils$x = {}, return _n < 0 || (fn === 1 && _n === 0) ? un.div : un.div.negative !== 0 - ? un.div.isubn(1) - : un.div.iaddn(1) + ? un.div.isubn(1) + : un.div.iaddn(1) }), (en.prototype.modn = function (Hn) { b(Hn <= 67108863) @@ -72836,10 +72832,10 @@ var utils$x = {}, Nn === 0 ? ((un.words[0] = 0), (un.length = 1)) : Nn > 0 - ? un.isub(this.p) - : un.strip !== void 0 - ? un.strip() - : un._strip(), + ? un.isub(this.p) + : un.strip !== void 0 + ? un.strip() + : un._strip(), un ) }), @@ -73234,14 +73230,14 @@ if (typeof self == 'object') return self.crypto.getRandomValues(_), _ }) : self.msCrypto && self.msCrypto.getRandomValues - ? (Rand.prototype._rand = function (o) { - var _ = new Uint8Array(o) - return self.msCrypto.getRandomValues(_), _ - }) - : typeof window == 'object' && - (Rand.prototype._rand = function () { - throw new Error('Not implemented yet') - }) + ? (Rand.prototype._rand = function (o) { + var _ = new Uint8Array(o) + return self.msCrypto.getRandomValues(_), _ + }) + : typeof window == 'object' && + (Rand.prototype._rand = function () { + throw new Error('Not implemented yet') + }) else try { var crypto = require$$0$2 @@ -73331,8 +73327,8 @@ BaseCurve.prototype._wnafMul = function e(o, _) { ? (sn = sn.mixedAdd(en[(Jn - 1) >> 1])) : (sn = sn.mixedAdd(en[(-Jn - 1) >> 1].neg())) : Jn > 0 - ? (sn = sn.add(en[(Jn - 1) >> 1])) - : (sn = sn.add(en[(-Jn - 1) >> 1].neg())) + ? (sn = sn.add(en[(Jn - 1) >> 1])) + : (sn = sn.add(en[(-Jn - 1) >> 1].neg())) } return o.type === 'affine' ? sn.toP() : sn } @@ -73363,8 +73359,8 @@ BaseCurve.prototype._wnafMulAdd = function e(o, _, b, $, en) { _[xn].y.cmp(_[mn].y) === 0 ? ((Bn[1] = _[xn].add(_[mn])), (Bn[2] = _[xn].toJ().mixedAdd(_[mn].neg()))) : _[xn].y.cmp(_[mn].y.redNeg()) === 0 - ? ((Bn[1] = _[xn].toJ().mixedAdd(_[mn])), (Bn[2] = _[xn].add(_[mn].neg()))) - : ((Bn[1] = _[xn].toJ().mixedAdd(_[mn])), (Bn[2] = _[xn].toJ().mixedAdd(_[mn].neg()))) + ? ((Bn[1] = _[xn].toJ().mixedAdd(_[mn])), (Bn[2] = _[xn].add(_[mn].neg()))) + : ((Bn[1] = _[xn].toJ().mixedAdd(_[mn])), (Bn[2] = _[xn].toJ().mixedAdd(_[mn].neg()))) var kn = [-3, -1, -5, -7, 0, 7, 5, 1, 3], ln = getJSF(b[xn], b[mn]) for ( @@ -73757,10 +73753,10 @@ Point$2.prototype.mul = function e(o) { this.isInfinity() ? this : this._hasDoubles(o) - ? this.curve._fixedNafMul(this, o) - : this.curve.endo - ? this.curve._endoWnafMulAdd([this], [o]) - : this.curve._wnafMul(this, o) + ? this.curve._fixedNafMul(this, o) + : this.curve.endo + ? this.curve._endoWnafMulAdd([this], [o]) + : this.curve._wnafMul(this, o) ) } Point$2.prototype.mulAdd = function e(o, _, b) { @@ -73901,10 +73897,10 @@ JPoint.prototype.dbl = function e() { return this.isInfinity() ? this : this.curve.zeroA - ? this._zeroDbl() - : this.curve.threeA - ? this._threeDbl() - : this._dbl() + ? this._zeroDbl() + : this.curve.threeA + ? this._threeDbl() + : this._dbl() } JPoint.prototype._zeroDbl = function e() { var o, _, b @@ -74363,10 +74359,10 @@ Point.prototype.add = function e(o) { return this.isInfinity() ? o : o.isInfinity() - ? this - : this.curve.extended - ? this._extAdd(o) - : this._projAdd(o) + ? this + : this.curve.extended + ? this._extAdd(o) + : this._projAdd(o) } Point.prototype.mul = function e(o) { return this._hasDoubles(o) ? this.curve._fixedNafMul(this, o) : this.curve._wnafMul(this, o) @@ -74445,16 +74441,16 @@ function toArray(e, o) { en < 128 ? (_[b++] = en) : en < 2048 - ? ((_[b++] = (en >> 6) | 192), (_[b++] = (en & 63) | 128)) - : isSurrogatePair(e, $) - ? ((en = 65536 + ((en & 1023) << 10) + (e.charCodeAt(++$) & 1023)), - (_[b++] = (en >> 18) | 240), - (_[b++] = ((en >> 12) & 63) | 128), - (_[b++] = ((en >> 6) & 63) | 128), - (_[b++] = (en & 63) | 128)) - : ((_[b++] = (en >> 12) | 224), - (_[b++] = ((en >> 6) & 63) | 128), - (_[b++] = (en & 63) | 128)) + ? ((_[b++] = (en >> 6) | 192), (_[b++] = (en & 63) | 128)) + : isSurrogatePair(e, $) + ? ((en = 65536 + ((en & 1023) << 10) + (e.charCodeAt(++$) & 1023)), + (_[b++] = (en >> 18) | 240), + (_[b++] = ((en >> 12) & 63) | 128), + (_[b++] = ((en >> 6) & 63) | 128), + (_[b++] = (en & 63) | 128)) + : ((_[b++] = (en >> 12) | 224), + (_[b++] = ((en >> 6) & 63) | 128), + (_[b++] = (en & 63) | 128)) } else for ($ = 0; $ < e.length; $++) _[$] = e[$] | 0 return _ @@ -74486,18 +74482,18 @@ function zero8(e) { return e.length === 7 ? '0' + e : e.length === 6 - ? '00' + e - : e.length === 5 - ? '000' + e - : e.length === 4 - ? '0000' + e - : e.length === 3 - ? '00000' + e - : e.length === 2 - ? '000000' + e - : e.length === 1 - ? '0000000' + e - : e + ? '00' + e + : e.length === 5 + ? '000' + e + : e.length === 4 + ? '0000' + e + : e.length === 3 + ? '00000' + e + : e.length === 2 + ? '000000' + e + : e.length === 1 + ? '0000000' + e + : e } utils$r.zero8 = zero8 function join32(e, o, _, b) { @@ -75172,34 +75168,34 @@ function f(e, o, _, b) { return e <= 15 ? o ^ _ ^ b : e <= 31 - ? (o & _) | (~o & b) - : e <= 47 - ? (o | ~_) ^ b - : e <= 63 - ? (o & b) | (_ & ~b) - : o ^ (_ | ~b) + ? (o & _) | (~o & b) + : e <= 47 + ? (o | ~_) ^ b + : e <= 63 + ? (o & b) | (_ & ~b) + : o ^ (_ | ~b) } function K(e) { return e <= 15 ? 0 : e <= 31 - ? 1518500249 - : e <= 47 - ? 1859775393 - : e <= 63 - ? 2400959708 - : 2840853838 + ? 1518500249 + : e <= 47 + ? 1859775393 + : e <= 63 + ? 2400959708 + : 2840853838 } function Kh(e) { return e <= 15 ? 1352829926 : e <= 31 - ? 1548603684 - : e <= 47 - ? 1836072691 - : e <= 63 - ? 2053994217 - : 0 + ? 1548603684 + : e <= 47 + ? 1836072691 + : e <= 63 + ? 2053994217 + : 0 } var r = [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, @@ -76059,8 +76055,8 @@ function requireSecp256k1() { In.type === 'short' ? (this.curve = new b.short(In)) : In.type === 'edwards' - ? (this.curve = new b.edwards(In)) - : (this.curve = new b.mont(In)), + ? (this.curve = new b.edwards(In)) + : (this.curve = new b.mont(In)), (this.g = this.curve.g), (this.n = this.curve.n), (this.hash = In.hash), @@ -76286,10 +76282,10 @@ KeyPair$3.prototype.validate = function e() { return o.isInfinity() ? { result: !1, reason: 'Invalid public key' } : o.validate() - ? o.mul(this.ec.curve.n).isInfinity() - ? { result: !0, reason: null } - : { result: !1, reason: 'Public key * N != O' } - : { result: !1, reason: 'Public key is not a point' } + ? o.mul(this.ec.curve.n).isInfinity() + ? { result: !0, reason: null } + : { result: !1, reason: 'Public key * N != O' } + : { result: !1, reason: 'Public key is not a point' } } KeyPair$3.prototype.getPublic = function e(o, _) { return ( @@ -78197,8 +78193,8 @@ function fromValue$2(e, o) { return typeof e == 'number' ? fromNumber$2(e, o) : typeof e == 'string' - ? fromString$2(e, o) - : fromBits$2(e.low, e.high, typeof o == 'boolean' ? o : e.unsigned) + ? fromString$2(e, o) + : fromBits$2(e.low, e.high, typeof o == 'boolean' ? o : e.unsigned) } Long$2.fromValue = fromValue$2 var TWO_PWR_16_DBL$2 = 1 << 16, @@ -78323,14 +78319,14 @@ LongPrototype$2.compare = function e(o) { return _ && !b ? -1 : !_ && b - ? 1 - : this.unsigned - ? o.high >>> 0 > this.high >>> 0 || (o.high === this.high && o.low >>> 0 > this.low >>> 0) - ? -1 - : 1 - : this.sub(o).isNegative() - ? -1 - : 1 + ? 1 + : this.unsigned + ? o.high >>> 0 > this.high >>> 0 || (o.high === this.high && o.low >>> 0 > this.low >>> 0) + ? -1 + : 1 + : this.sub(o).isNegative() + ? -1 + : 1 } LongPrototype$2.comp = LongPrototype$2.compare LongPrototype$2.negate = function e() { @@ -78503,8 +78499,8 @@ LongPrototype$2.shiftLeft = function e(o) { (o &= 63) === 0 ? this : o < 32 - ? fromBits$2(this.low << o, (this.high << o) | (this.low >>> (32 - o)), this.unsigned) - : fromBits$2(0, this.low << (o - 32), this.unsigned) + ? fromBits$2(this.low << o, (this.high << o) | (this.low >>> (32 - o)), this.unsigned) + : fromBits$2(0, this.low << (o - 32), this.unsigned) ) } LongPrototype$2.shl = LongPrototype$2.shiftLeft @@ -78514,8 +78510,8 @@ LongPrototype$2.shiftRight = function e(o) { (o &= 63) === 0 ? this : o < 32 - ? fromBits$2((this.low >>> o) | (this.high << (32 - o)), this.high >> o, this.unsigned) - : fromBits$2(this.high >> (o - 32), this.high >= 0 ? 0 : -1, this.unsigned) + ? fromBits$2((this.low >>> o) | (this.high << (32 - o)), this.high >> o, this.unsigned) + : fromBits$2(this.high >> (o - 32), this.high >= 0 ? 0 : -1, this.unsigned) ) } LongPrototype$2.shr = LongPrototype$2.shiftRight @@ -82887,16 +82883,16 @@ $root.ics23 = (function () { $.bytes === String ? $util.base64.encode(b.key, 0, b.key.length) : $.bytes === Array - ? Array.prototype.slice.call(b.key) - : b.key), + ? Array.prototype.slice.call(b.key) + : b.key), b.value != null && b.hasOwnProperty('value') && (en.value = $.bytes === String ? $util.base64.encode(b.value, 0, b.value.length) : $.bytes === Array - ? Array.prototype.slice.call(b.value) - : b.value), + ? Array.prototype.slice.call(b.value) + : b.value), b.leaf != null && b.hasOwnProperty('leaf') && (en.leaf = $root.ics23.LeafOp.toObject(b.leaf, $)), @@ -83030,8 +83026,8 @@ $root.ics23 = (function () { $.bytes === String ? $util.base64.encode(b.key, 0, b.key.length) : $.bytes === Array - ? Array.prototype.slice.call(b.key) - : b.key), + ? Array.prototype.slice.call(b.key) + : b.key), b.left != null && b.hasOwnProperty('left') && (en.left = $root.ics23.ExistenceProof.toObject(b.left, $)), @@ -83513,8 +83509,8 @@ $root.ics23 = (function () { $.bytes === String ? $util.base64.encode(b.prefix, 0, b.prefix.length) : $.bytes === Array - ? Array.prototype.slice.call(b.prefix) - : b.prefix), + ? Array.prototype.slice.call(b.prefix) + : b.prefix), en ) }), @@ -83597,10 +83593,10 @@ $root.ics23 = (function () { !((b.prefix && typeof b.prefix.length == 'number') || $util.isString(b.prefix)) ? 'prefix: buffer expected' : b.suffix != null && - b.hasOwnProperty('suffix') && - !((b.suffix && typeof b.suffix.length == 'number') || $util.isString(b.suffix)) - ? 'suffix: buffer expected' - : null + b.hasOwnProperty('suffix') && + !((b.suffix && typeof b.suffix.length == 'number') || $util.isString(b.suffix)) + ? 'suffix: buffer expected' + : null }), (o.fromObject = function (b) { if (b instanceof $root.ics23.InnerOp) return b @@ -83677,16 +83673,16 @@ $root.ics23 = (function () { $.bytes === String ? $util.base64.encode(b.prefix, 0, b.prefix.length) : $.bytes === Array - ? Array.prototype.slice.call(b.prefix) - : b.prefix), + ? Array.prototype.slice.call(b.prefix) + : b.prefix), b.suffix != null && b.hasOwnProperty('suffix') && (en.suffix = $.bytes === String ? $util.base64.encode(b.suffix, 0, b.suffix.length) : $.bytes === Array - ? Array.prototype.slice.call(b.suffix) - : b.suffix), + ? Array.prototype.slice.call(b.suffix) + : b.suffix), en ) }), @@ -83771,8 +83767,8 @@ $root.ics23 = (function () { return b.maxDepth != null && b.hasOwnProperty('maxDepth') && !$util.isInteger(b.maxDepth) ? 'maxDepth: integer expected' : b.minDepth != null && b.hasOwnProperty('minDepth') && !$util.isInteger(b.minDepth) - ? 'minDepth: integer expected' - : null + ? 'minDepth: integer expected' + : null }), (o.fromObject = function (b) { if (b instanceof $root.ics23.ProofSpec) return b @@ -84029,8 +84025,8 @@ $root.ics23 = (function () { $.bytes === String ? $util.base64.encode(b.emptyChild, 0, b.emptyChild.length) : $.bytes === Array - ? Array.prototype.slice.call(b.emptyChild) - : b.emptyChild), + ? Array.prototype.slice.call(b.emptyChild) + : b.emptyChild), b.hash != null && b.hasOwnProperty('hash') && (en.hash = $.enums === String ? $root.ics23.HashOp[b.hash] : b.hash), @@ -84619,16 +84615,16 @@ $root.ics23 = (function () { $.bytes === String ? $util.base64.encode(b.key, 0, b.key.length) : $.bytes === Array - ? Array.prototype.slice.call(b.key) - : b.key), + ? Array.prototype.slice.call(b.key) + : b.key), b.value != null && b.hasOwnProperty('value') && (en.value = $.bytes === String ? $util.base64.encode(b.value, 0, b.value.length) : $.bytes === Array - ? Array.prototype.slice.call(b.value) - : b.value), + ? Array.prototype.slice.call(b.value) + : b.value), b.leaf != null && b.hasOwnProperty('leaf') && (en.leaf = $root.ics23.LeafOp.toObject(b.leaf, $)), @@ -84762,8 +84758,8 @@ $root.ics23 = (function () { $.bytes === String ? $util.base64.encode(b.key, 0, b.key.length) : $.bytes === Array - ? Array.prototype.slice.call(b.key) - : b.key), + ? Array.prototype.slice.call(b.key) + : b.key), b.left != null && b.hasOwnProperty('left') && (en.left = $root.ics23.CompressedExistenceProof.toObject(b.left, $)), @@ -85887,8 +85883,8 @@ var defineProperties_1 = defineProperties$1, typeof self < 'u' ? (implementation_browser.exports = self) : typeof window < 'u' - ? (implementation_browser.exports = window) - : (implementation_browser.exports = Function('return this')()) + ? (implementation_browser.exports = window) + : (implementation_browser.exports = Function('return this')()) var implementation$1 = implementation_browserExports, polyfill$1 = function e() { return typeof commonjsGlobal != 'object' || @@ -87372,8 +87368,8 @@ function fromValue$1(e, o) { return typeof e == 'number' ? fromNumber$1(e, o) : typeof e == 'string' - ? fromString$1(e, o) - : fromBits$1(e.low, e.high, typeof o == 'boolean' ? o : e.unsigned) + ? fromString$1(e, o) + : fromBits$1(e.low, e.high, typeof o == 'boolean' ? o : e.unsigned) } Long$1.fromValue = fromValue$1 var TWO_PWR_16_DBL$1 = 1 << 16, @@ -87498,14 +87494,14 @@ LongPrototype$1.compare = function e(o) { return _ && !b ? -1 : !_ && b - ? 1 - : this.unsigned - ? o.high >>> 0 > this.high >>> 0 || (o.high === this.high && o.low >>> 0 > this.low >>> 0) - ? -1 - : 1 - : this.sub(o).isNegative() - ? -1 - : 1 + ? 1 + : this.unsigned + ? o.high >>> 0 > this.high >>> 0 || (o.high === this.high && o.low >>> 0 > this.low >>> 0) + ? -1 + : 1 + : this.sub(o).isNegative() + ? -1 + : 1 } LongPrototype$1.comp = LongPrototype$1.compare LongPrototype$1.negate = function e() { @@ -87678,8 +87674,8 @@ LongPrototype$1.shiftLeft = function e(o) { (o &= 63) === 0 ? this : o < 32 - ? fromBits$1(this.low << o, (this.high << o) | (this.low >>> (32 - o)), this.unsigned) - : fromBits$1(0, this.low << (o - 32), this.unsigned) + ? fromBits$1(this.low << o, (this.high << o) | (this.low >>> (32 - o)), this.unsigned) + : fromBits$1(0, this.low << (o - 32), this.unsigned) ) } LongPrototype$1.shl = LongPrototype$1.shiftLeft @@ -87689,8 +87685,8 @@ LongPrototype$1.shiftRight = function e(o) { (o &= 63) === 0 ? this : o < 32 - ? fromBits$1((this.low >>> o) | (this.high << (32 - o)), this.high >> o, this.unsigned) - : fromBits$1(this.high >> (o - 32), this.high >= 0 ? 0 : -1, this.unsigned) + ? fromBits$1((this.low >>> o) | (this.high << (32 - o)), this.high >> o, this.unsigned) + : fromBits$1(this.high >> (o - 32), this.high >= 0 ? 0 : -1, this.unsigned) ) } LongPrototype$1.shr = LongPrototype$1.shiftRight @@ -129379,10 +129375,10 @@ function merge() { isPlainObject(e[en]) && isPlainObject($) ? (e[en] = merge(e[en], $)) : isPlainObject($) - ? (e[en] = merge({}, $)) - : isArray($) - ? (e[en] = $.slice()) - : (e[en] = $) + ? (e[en] = merge({}, $)) + : isArray($) + ? (e[en] = $.slice()) + : (e[en] = $) } for (var _ = 0, b = arguments.length; _ < b; _++) forEach(arguments[_], o) return e @@ -129858,13 +129854,13 @@ var defaults$3 = { utils$5.isBlob(o) ? o : utils$5.isArrayBufferView(o) - ? o.buffer - : utils$5.isURLSearchParams(o) - ? (setContentTypeIfUnset(_, 'application/x-www-form-urlencoded;charset=utf-8'), - o.toString()) - : utils$5.isObject(o) || (_ && _['Content-Type'] === 'application/json') - ? (setContentTypeIfUnset(_, 'application/json'), stringifySafely(o)) - : o + ? o.buffer + : utils$5.isURLSearchParams(o) + ? (setContentTypeIfUnset(_, 'application/x-www-form-urlencoded;charset=utf-8'), + o.toString()) + : utils$5.isObject(o) || (_ && _['Content-Type'] === 'application/json') + ? (setContentTypeIfUnset(_, 'application/json'), stringifySafely(o)) + : o ) }, ], @@ -130000,10 +129996,10 @@ var dispatchRequest$1 = function e(o) { return utils$2.isPlainObject(Kn) && utils$2.isPlainObject(an) ? utils$2.merge(Kn, an) : utils$2.isPlainObject(an) - ? utils$2.merge({}, an) - : utils$2.isArray(an) - ? an.slice() - : an + ? utils$2.merge({}, an) + : utils$2.isArray(an) + ? an.slice() + : an } function In(Kn) { utils$2.isUndefined(_[Kn]) @@ -130181,8 +130177,8 @@ Axios$1.prototype.request = function e(o) { o.method ? (o.method = o.method.toLowerCase()) : this.defaults.method - ? (o.method = this.defaults.method.toLowerCase()) - : (o.method = 'get') + ? (o.method = this.defaults.method.toLowerCase()) + : (o.method = 'get') var _ = o.transitional _ !== void 0 && validator.assertOptions( @@ -130485,12 +130481,12 @@ var websocketclient = {}, typeof WebSocket < 'u' ? (ws = WebSocket) : typeof MozWebSocket < 'u' - ? (ws = MozWebSocket) - : typeof commonjsGlobal < 'u' - ? (ws = commonjsGlobal.WebSocket || commonjsGlobal.MozWebSocket) - : typeof window < 'u' - ? (ws = window.WebSocket || window.MozWebSocket) - : typeof self < 'u' && (ws = self.WebSocket || self.MozWebSocket) + ? (ws = MozWebSocket) + : typeof commonjsGlobal < 'u' + ? (ws = commonjsGlobal.WebSocket || commonjsGlobal.MozWebSocket) + : typeof window < 'u' + ? (ws = window.WebSocket || window.MozWebSocket) + : typeof self < 'u' && (ws = self.WebSocket || self.MozWebSocket) var browser = ws, __importDefault$2 = (commonjsGlobal && commonjsGlobal.__importDefault) || @@ -135343,8 +135339,8 @@ function fromValue(e, o) { return typeof e == 'number' ? fromNumber(e, o) : typeof e == 'string' - ? fromString(e, o) - : fromBits(e.low, e.high, typeof o == 'boolean' ? o : e.unsigned) + ? fromString(e, o) + : fromBits(e.low, e.high, typeof o == 'boolean' ? o : e.unsigned) } Long.fromValue = fromValue var TWO_PWR_16_DBL = 1 << 16, @@ -135469,14 +135465,14 @@ LongPrototype.compare = function e(o) { return _ && !b ? -1 : !_ && b - ? 1 - : this.unsigned - ? o.high >>> 0 > this.high >>> 0 || (o.high === this.high && o.low >>> 0 > this.low >>> 0) - ? -1 - : 1 - : this.sub(o).isNegative() - ? -1 - : 1 + ? 1 + : this.unsigned + ? o.high >>> 0 > this.high >>> 0 || (o.high === this.high && o.low >>> 0 > this.low >>> 0) + ? -1 + : 1 + : this.sub(o).isNegative() + ? -1 + : 1 } LongPrototype.comp = LongPrototype.compare LongPrototype.negate = function e() { @@ -135646,8 +135642,8 @@ LongPrototype.shiftLeft = function e(o) { (o &= 63) === 0 ? this : o < 32 - ? fromBits(this.low << o, (this.high << o) | (this.low >>> (32 - o)), this.unsigned) - : fromBits(0, this.low << (o - 32), this.unsigned) + ? fromBits(this.low << o, (this.high << o) | (this.low >>> (32 - o)), this.unsigned) + : fromBits(0, this.low << (o - 32), this.unsigned) ) } LongPrototype.shl = LongPrototype.shiftLeft @@ -135657,8 +135653,8 @@ LongPrototype.shiftRight = function e(o) { (o &= 63) === 0 ? this : o < 32 - ? fromBits((this.low >>> o) | (this.high << (32 - o)), this.high >> o, this.unsigned) - : fromBits(this.high >> (o - 32), this.high >= 0 ? 0 : -1, this.unsigned) + ? fromBits((this.low >>> o) | (this.high << (32 - o)), this.high >> o, this.unsigned) + : fromBits(this.high >> (o - 32), this.high >= 0 ? 0 : -1, this.unsigned) ) } LongPrototype.shr = LongPrototype.shiftRight @@ -139170,8 +139166,8 @@ var mainExports = {}, typeof window < 'u' && window.Math == Math ? window : typeof self < 'u' && self.Math == Math - ? self - : Function('return this')()) + ? self + : Function('return this')()) typeof __g == 'number' && (__g = en) }, function (b, $, en) { @@ -139287,28 +139283,28 @@ var mainExports = {}, yn && typeof En[mn] != 'function' ? xn[mn] : Gn && Bn - ? gn(kn, nn) - : Sn && En[mn] == kn - ? (function (Mn) { - var Hn = function (un, dn, Nn) { - if (this instanceof Mn) { - switch (arguments.length) { - case 0: - return new Mn() - case 1: - return new Mn(un) - case 2: - return new Mn(un, dn) - } - return new Mn(un, dn, Nn) - } - return Mn.apply(this, arguments) + ? gn(kn, nn) + : Sn && En[mn] == kn + ? (function (Mn) { + var Hn = function (un, dn, Nn) { + if (this instanceof Mn) { + switch (arguments.length) { + case 0: + return new Mn() + case 1: + return new Mn(un) + case 2: + return new Mn(un, dn) } - return (Hn.prototype = Mn.prototype), Hn - })(kn) - : Tn && typeof kn == 'function' - ? gn(Function.call, kn) - : kn), + return new Mn(un, dn, Nn) + } + return Mn.apply(this, arguments) + } + return (Hn.prototype = Mn.prototype), Hn + })(kn) + : Tn && typeof kn == 'function' + ? gn(Function.call, kn) + : kn), Tn && (((Zn.virtual || (Zn.virtual = {}))[mn] = kn), Kn & qn.R && tn && !tn[mn] && In(tn, mn, kn))) @@ -139645,18 +139641,18 @@ var mainExports = {}, return In === void 0 ? 'Undefined' : In === null - ? 'Null' - : typeof (qn = (function (an, xn) { - try { - return an[xn] - } catch {} - })((Jn = Object(In)), sn)) == 'string' - ? qn - : gn - ? nn(Jn) - : (Kn = nn(Jn)) == 'Object' && typeof Jn.callee == 'function' - ? 'Arguments' - : Kn + ? 'Null' + : typeof (qn = (function (an, xn) { + try { + return an[xn] + } catch {} + })((Jn = Object(In)), sn)) == 'string' + ? qn + : gn + ? nn(Jn) + : (Kn = nn(Jn)) == 'Object' && typeof Jn.callee == 'function' + ? 'Arguments' + : Kn } }, function (b, $) { @@ -139821,9 +139817,9 @@ var mainExports = {}, typeof _n == 'string' ? (fn.className = [fn.className, _n].filter(Boolean).join(' ')) : (_n === void 0 ? 'undefined' : (0, nn.default)(_n)) === 'object' - ? (fn.style = (0, sn.default)({}, fn.style, _n)) - : typeof _n == 'function' && - (fn = (0, sn.default)({}, fn, _n.apply(void 0, [fn].concat(Hn)))), + ? (fn.style = (0, sn.default)({}, fn.style, _n)) + : typeof _n == 'function' && + (fn = (0, sn.default)({}, fn, _n.apply(void 0, [fn].concat(Hn)))), fn ) }, @@ -139841,8 +139837,8 @@ var mainExports = {}, (En[Mn] = /^base/.test(Mn) ? yn(tn[Mn]) : Mn === 'scheme' - ? tn[Mn] + ':inverted' - : tn[Mn]), + ? tn[Mn] + ':inverted' + : tn[Mn]), En ) }, {}) @@ -139897,12 +139893,12 @@ var mainExports = {}, sn && typeof sn.ownKeys == 'function' ? sn.ownKeys : Object.getOwnPropertySymbols - ? function (Cn) { - return Object.getOwnPropertyNames(Cn).concat(Object.getOwnPropertySymbols(Cn)) - } - : function (Cn) { - return Object.getOwnPropertyNames(Cn) - } + ? function (Cn) { + return Object.getOwnPropertyNames(Cn).concat(Object.getOwnPropertySymbols(Cn)) + } + : function (Cn) { + return Object.getOwnPropertyNames(Cn) + } var In = Number.isNaN || function (Cn) { @@ -139956,8 +139952,8 @@ var mainExports = {}, (typeof En == 'function' ? (En = tn[Tn] = Sn ? [Gn, En] : [En, Gn]) : Sn - ? En.unshift(Gn) - : En.push(Gn), + ? En.unshift(Gn) + : En.push(Gn), (Zn = an(Cn)) > 0 && En.length > Zn && !En.warned) ) { En.warned = !0 @@ -139999,16 +139995,16 @@ var mainExports = {}, return Zn === void 0 ? [] : typeof Zn == 'function' - ? Gn - ? [Zn.listener || Zn] - : [Zn] - : Gn - ? (function (tn) { - for (var En = new Array(tn.length), Mn = 0; Mn < En.length; ++Mn) - En[Mn] = tn[Mn].listener || tn[Mn] - return En - })(Zn) - : yn(Zn, Zn.length) + ? Gn + ? [Zn.listener || Zn] + : [Zn] + : Gn + ? (function (tn) { + for (var En = new Array(tn.length), Mn = 0; Mn < En.length; ++Mn) + En[Mn] = tn[Mn].listener || tn[Mn] + return En + })(Zn) + : yn(Zn, Zn.length) } function ln(Cn) { var Tn = this._events @@ -140200,8 +140196,8 @@ var mainExports = {}, Jn !== sn.default.prototype ? 'symbol' : Jn === void 0 - ? 'undefined' - : gn(Jn) + ? 'undefined' + : gn(Jn) } }, function (b, $, en) { @@ -140225,16 +140221,16 @@ var mainExports = {}, ? '' : void 0 : (qn = an.charCodeAt(xn)) < 55296 || - qn > 56319 || - xn + 1 === mn || - (Kn = an.charCodeAt(xn + 1)) < 56320 || - Kn > 57343 - ? gn - ? an.charAt(xn) - : qn - : gn - ? an.slice(xn, xn + 2) - : Kn - 56320 + ((qn - 55296) << 10) + 65536 + qn > 56319 || + xn + 1 === mn || + (Kn = an.charCodeAt(xn + 1)) < 56320 || + Kn > 57343 + ? gn + ? an.charAt(xn) + : qn + : gn + ? an.slice(xn, xn + 2) + : Kn - 56320 + ((qn - 55296) << 10) + 65536 } } }, @@ -140341,10 +140337,10 @@ var mainExports = {}, nn(Jn, gn) ? Jn[gn] : typeof Jn.constructor == 'function' && Jn instanceof Jn.constructor - ? Jn.constructor.prototype - : Jn instanceof Object - ? In - : null + ? Jn.constructor.prototype + : Jn instanceof Object + ? In + : null ) } }, @@ -141201,26 +141197,26 @@ var mainExports = {}, } })(cr, ir, eo) : (ir != 32 && ir != 33) || Mr.length - ? Uo.apply(void 0, Pn) - : (function (dt, Ir, Lt, ur) { - var ho = 1 & Ir, - xo = mr(dt) - return function yo() { - for ( - var ga = -1, - Zo = arguments.length, - _o = -1, - zo = ur.length, - $a = Array(zo + Zo), - No = this && this !== Cn && this instanceof yo ? xo : dt; - ++_o < zo; + ? Uo.apply(void 0, Pn) + : (function (dt, Ir, Lt, ur) { + var ho = 1 & Ir, + xo = mr(dt) + return function yo() { + for ( + var ga = -1, + Zo = arguments.length, + _o = -1, + zo = ur.length, + $a = Array(zo + Zo), + No = this && this !== Cn && this instanceof yo ? xo : dt; + ++_o < zo; - ) - $a[_o] = ur[_o] - for (; Zo--; ) $a[_o++] = arguments[++ga] - return Tn(No, ho ? Lt : this, $a) - } - })(cr, ir, vn, gr) + ) + $a[_o] = ur[_o] + for (; Zo--; ) $a[_o++] = arguments[++ga] + return Tn(No, ho ? Lt : this, $a) + } + })(cr, ir, vn, gr) else var Xn = (function (dt, Ir, Lt) { var ur = 1 & Ir, @@ -141356,11 +141352,11 @@ var mainExports = {}, 1 / 0 || cr === -1 / 0 ? 17976931348623157e292 * (cr < 0 ? -1 : 1) : cr == cr - ? cr - : 0 - : cr === 0 ? cr : 0 + : cr === 0 + ? cr + : 0 } function $r(cr) { var ir = Fr(cr), @@ -142446,10 +142442,10 @@ var mainExports = {}, 6 * gn < 1 ? nn + 6 * (sn - nn) * gn : 2 * gn < 1 - ? sn - : 3 * gn < 2 - ? nn + (sn - nn) * (2 / 3 - gn) * 6 - : nn), + ? sn + : 3 * gn < 2 + ? nn + (sn - nn) * (2 / 3 - gn) * 6 + : nn), (In[xn] = 255 * Jn) return In } @@ -142737,10 +142733,10 @@ var mainExports = {}, nn(Kt, $t, Mt[$t]) }) : Object.getOwnPropertyDescriptors - ? Object.defineProperties(Kt, Object.getOwnPropertyDescriptors(Mt)) - : sn(Object(Mt)).forEach(function ($t) { - Object.defineProperty(Kt, $t, Object.getOwnPropertyDescriptor(Mt, $t)) - }) + ? Object.defineProperties(Kt, Object.getOwnPropertyDescriptors(Mt)) + : sn(Object(Mt)).forEach(function ($t) { + Object.defineProperty(Kt, $t, Object.getOwnPropertyDescriptor(Mt, $t)) + }) } return Kt } @@ -143544,8 +143540,8 @@ https://fb.me/react-async-component-lifecycle-hooks`, Mt === 'Map' || Mt === 'Set' ? Array.from(Kt) : Mt === 'Arguments' || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Mt) - ? An(Kt, Vt) - : void 0 + ? An(Kt, Vt) + : void 0 ) } } @@ -143697,8 +143693,8 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho ? Wr.splice(Jr, 1) : delete Wr[Jr] : Jr !== null - ? (Wr[Jr] = Po) - : (vr = Po), + ? (Wr[Jr] = Po) + : (vr = Po), $t.set(Sr, 'global', 'src', vr), vr ) @@ -146480,10 +146476,10 @@ function App() { $.isLoading ? jsx(SyncLoader, { color: '#36d7b7' }) : $.error - ? 'error ❌' - : $.data - ? jsx(ReactJson, { src: $.data }) - : void 0, + ? 'error ❌' + : $.data + ? jsx(ReactJson, { src: $.data }) + : void 0, ], }), jsxs('div', { @@ -146493,10 +146489,10 @@ function App() { en.isLoading ? jsx(SyncLoader, { color: '#36d7b7' }) : en.error - ? 'error ❌' - : en.data - ? jsx(ReactJson, { src: en.data }) - : void 0, + ? 'error ❌' + : en.data + ? jsx(ReactJson, { src: en.data }) + : void 0, ], }), ], diff --git a/scripts/types/generated/mars-account-nft/MarsAccountNft.client.ts b/scripts/types/generated/mars-account-nft/MarsAccountNft.client.ts index 0f54b3e2..e426677e 100644 --- a/scripts/types/generated/mars-account-nft/MarsAccountNft.client.ts +++ b/scripts/types/generated/mars-account-nft/MarsAccountNft.client.ts @@ -1,6 +1,6 @@ // @ts-nocheck /** - * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. + * This file was automatically generated by @cosmwasm/ts-codegen@0.35.3. * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ @@ -106,6 +106,7 @@ export interface MarsAccountNftReadOnlyInterface { export class MarsAccountNftQueryClient implements MarsAccountNftReadOnlyInterface { client: CosmWasmClient contractAddress: string + constructor(client: CosmWasmClient, contractAddress: string) { this.client = client this.contractAddress = contractAddress @@ -124,6 +125,7 @@ export class MarsAccountNftQueryClient implements MarsAccountNftReadOnlyInterfac this.minter = this.minter.bind(this) this.ownership = this.ownership.bind(this) } + config = async (): Promise => { return this.client.queryContractSmart(this.contractAddress, { config: {}, @@ -401,6 +403,7 @@ export class MarsAccountNftClient client: SigningCosmWasmClient sender: string contractAddress: string + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { super(client, contractAddress) this.client = client @@ -418,6 +421,7 @@ export class MarsAccountNftClient this.revokeAll = this.revokeAll.bind(this) this.updateOwnership = this.updateOwnership.bind(this) } + updateConfig = async ( { updates, diff --git a/scripts/types/generated/mars-account-nft/MarsAccountNft.react-query.ts b/scripts/types/generated/mars-account-nft/MarsAccountNft.react-query.ts index 577ddee2..385e0aaf 100644 --- a/scripts/types/generated/mars-account-nft/MarsAccountNft.react-query.ts +++ b/scripts/types/generated/mars-account-nft/MarsAccountNft.react-query.ts @@ -1,6 +1,6 @@ // @ts-nocheck /** - * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. + * This file was automatically generated by @cosmwasm/ts-codegen@0.35.3. * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ @@ -45,123 +45,48 @@ export const marsAccountNftQueryKeys = { }, ] as const, address: (contractAddress: string | undefined) => - [ - { - ...marsAccountNftQueryKeys.contract[0], - address: contractAddress, - }, - ] as const, + [{ ...marsAccountNftQueryKeys.contract[0], address: contractAddress }] as const, config: (contractAddress: string | undefined, args?: Record) => - [ - { - ...marsAccountNftQueryKeys.address(contractAddress)[0], - method: 'config', - args, - }, - ] as const, + [{ ...marsAccountNftQueryKeys.address(contractAddress)[0], method: 'config', args }] as const, nextId: (contractAddress: string | undefined, args?: Record) => - [ - { - ...marsAccountNftQueryKeys.address(contractAddress)[0], - method: 'next_id', - args, - }, - ] as const, + [{ ...marsAccountNftQueryKeys.address(contractAddress)[0], method: 'next_id', args }] as const, ownerOf: (contractAddress: string | undefined, args?: Record) => - [ - { - ...marsAccountNftQueryKeys.address(contractAddress)[0], - method: 'owner_of', - args, - }, - ] as const, + [{ ...marsAccountNftQueryKeys.address(contractAddress)[0], method: 'owner_of', args }] as const, approval: (contractAddress: string | undefined, args?: Record) => - [ - { - ...marsAccountNftQueryKeys.address(contractAddress)[0], - method: 'approval', - args, - }, - ] as const, + [{ ...marsAccountNftQueryKeys.address(contractAddress)[0], method: 'approval', args }] as const, approvals: (contractAddress: string | undefined, args?: Record) => [ - { - ...marsAccountNftQueryKeys.address(contractAddress)[0], - method: 'approvals', - args, - }, + { ...marsAccountNftQueryKeys.address(contractAddress)[0], method: 'approvals', args }, ] as const, allOperators: (contractAddress: string | undefined, args?: Record) => [ - { - ...marsAccountNftQueryKeys.address(contractAddress)[0], - method: 'all_operators', - args, - }, + { ...marsAccountNftQueryKeys.address(contractAddress)[0], method: 'all_operators', args }, ] as const, numTokens: (contractAddress: string | undefined, args?: Record) => [ - { - ...marsAccountNftQueryKeys.address(contractAddress)[0], - method: 'num_tokens', - args, - }, + { ...marsAccountNftQueryKeys.address(contractAddress)[0], method: 'num_tokens', args }, ] as const, contractInfo: (contractAddress: string | undefined, args?: Record) => [ - { - ...marsAccountNftQueryKeys.address(contractAddress)[0], - method: 'contract_info', - args, - }, + { ...marsAccountNftQueryKeys.address(contractAddress)[0], method: 'contract_info', args }, ] as const, nftInfo: (contractAddress: string | undefined, args?: Record) => - [ - { - ...marsAccountNftQueryKeys.address(contractAddress)[0], - method: 'nft_info', - args, - }, - ] as const, + [{ ...marsAccountNftQueryKeys.address(contractAddress)[0], method: 'nft_info', args }] as const, allNftInfo: (contractAddress: string | undefined, args?: Record) => [ - { - ...marsAccountNftQueryKeys.address(contractAddress)[0], - method: 'all_nft_info', - args, - }, + { ...marsAccountNftQueryKeys.address(contractAddress)[0], method: 'all_nft_info', args }, ] as const, tokens: (contractAddress: string | undefined, args?: Record) => - [ - { - ...marsAccountNftQueryKeys.address(contractAddress)[0], - method: 'tokens', - args, - }, - ] as const, + [{ ...marsAccountNftQueryKeys.address(contractAddress)[0], method: 'tokens', args }] as const, allTokens: (contractAddress: string | undefined, args?: Record) => [ - { - ...marsAccountNftQueryKeys.address(contractAddress)[0], - method: 'all_tokens', - args, - }, + { ...marsAccountNftQueryKeys.address(contractAddress)[0], method: 'all_tokens', args }, ] as const, minter: (contractAddress: string | undefined, args?: Record) => - [ - { - ...marsAccountNftQueryKeys.address(contractAddress)[0], - method: 'minter', - args, - }, - ] as const, + [{ ...marsAccountNftQueryKeys.address(contractAddress)[0], method: 'minter', args }] as const, ownership: (contractAddress: string | undefined, args?: Record) => [ - { - ...marsAccountNftQueryKeys.address(contractAddress)[0], - method: 'ownership', - args, - }, + { ...marsAccountNftQueryKeys.address(contractAddress)[0], method: 'ownership', args }, ] as const, } export interface MarsAccountNftReactQuery { @@ -182,10 +107,7 @@ export function useMarsAccountNftOwnershipQuery({ return useQuery( marsAccountNftQueryKeys.ownership(client?.contractAddress), () => (client ? client.ownership() : Promise.reject(new Error('Invalid client'))), - { - ...options, - enabled: !!client && (options?.enabled != undefined ? options.enabled : true), - }, + { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }, ) } export interface MarsAccountNftMinterQuery @@ -197,10 +119,7 @@ export function useMarsAccountNftMinterQuery({ return useQuery( marsAccountNftQueryKeys.minter(client?.contractAddress), () => (client ? client.minter() : Promise.reject(new Error('Invalid client'))), - { - ...options, - enabled: !!client && (options?.enabled != undefined ? options.enabled : true), - }, + { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }, ) } export interface MarsAccountNftAllTokensQuery @@ -224,10 +143,7 @@ export function useMarsAccountNftAllTokensQuery({ startAfter: args.startAfter, }) : Promise.reject(new Error('Invalid client')), - { - ...options, - enabled: !!client && (options?.enabled != undefined ? options.enabled : true), - }, + { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }, ) } export interface MarsAccountNftTokensQuery @@ -253,10 +169,7 @@ export function useMarsAccountNftTokensQuery({ startAfter: args.startAfter, }) : Promise.reject(new Error('Invalid client')), - { - ...options, - enabled: !!client && (options?.enabled != undefined ? options.enabled : true), - }, + { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }, ) } export interface MarsAccountNftAllNftInfoQuery @@ -280,10 +193,7 @@ export function useMarsAccountNftAllNftInfoQuery @@ -305,10 +215,7 @@ export function useMarsAccountNftNftInfoQuery({ tokenId: args.tokenId, }) : Promise.reject(new Error('Invalid client')), - { - ...options, - enabled: !!client && (options?.enabled != undefined ? options.enabled : true), - }, + { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }, ) } export interface MarsAccountNftContractInfoQuery @@ -320,10 +227,7 @@ export function useMarsAccountNftContractInfoQuery return useQuery( marsAccountNftQueryKeys.contractInfo(client?.contractAddress), () => (client ? client.contractInfo() : Promise.reject(new Error('Invalid client'))), - { - ...options, - enabled: !!client && (options?.enabled != undefined ? options.enabled : true), - }, + { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }, ) } export interface MarsAccountNftNumTokensQuery @@ -335,10 +239,7 @@ export function useMarsAccountNftNumTokensQuery({ return useQuery( marsAccountNftQueryKeys.numTokens(client?.contractAddress), () => (client ? client.numTokens() : Promise.reject(new Error('Invalid client'))), - { - ...options, - enabled: !!client && (options?.enabled != undefined ? options.enabled : true), - }, + { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }, ) } export interface MarsAccountNftAllOperatorsQuery @@ -366,10 +267,7 @@ export function useMarsAccountNftAllOperatorsQuery({ startAfter: args.startAfter, }) : Promise.reject(new Error('Invalid client')), - { - ...options, - enabled: !!client && (options?.enabled != undefined ? options.enabled : true), - }, + { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }, ) } export interface MarsAccountNftApprovalsQuery @@ -393,10 +291,7 @@ export function useMarsAccountNftApprovalsQuery({ tokenId: args.tokenId, }) : Promise.reject(new Error('Invalid client')), - { - ...options, - enabled: !!client && (options?.enabled != undefined ? options.enabled : true), - }, + { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }, ) } export interface MarsAccountNftApprovalQuery @@ -422,10 +317,7 @@ export function useMarsAccountNftApprovalQuery({ tokenId: args.tokenId, }) : Promise.reject(new Error('Invalid client')), - { - ...options, - enabled: !!client && (options?.enabled != undefined ? options.enabled : true), - }, + { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }, ) } export interface MarsAccountNftOwnerOfQuery @@ -449,10 +341,7 @@ export function useMarsAccountNftOwnerOfQuery({ tokenId: args.tokenId, }) : Promise.reject(new Error('Invalid client')), - { - ...options, - enabled: !!client && (options?.enabled != undefined ? options.enabled : true), - }, + { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }, ) } export interface MarsAccountNftNextIdQuery extends MarsAccountNftReactQuery {} @@ -463,10 +352,7 @@ export function useMarsAccountNftNextIdQuery({ return useQuery( marsAccountNftQueryKeys.nextId(client?.contractAddress), () => (client ? client.nextId() : Promise.reject(new Error('Invalid client'))), - { - ...options, - enabled: !!client && (options?.enabled != undefined ? options.enabled : true), - }, + { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }, ) } export interface MarsAccountNftConfigQuery @@ -478,10 +364,7 @@ export function useMarsAccountNftConfigQuery({ return useQuery( marsAccountNftQueryKeys.config(client?.contractAddress), () => (client ? client.config() : Promise.reject(new Error('Invalid client'))), - { - ...options, - enabled: !!client && (options?.enabled != undefined ? options.enabled : true), - }, + { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }, ) } export interface MarsAccountNftUpdateOwnershipMutation { diff --git a/scripts/types/generated/mars-account-nft/MarsAccountNft.types.ts b/scripts/types/generated/mars-account-nft/MarsAccountNft.types.ts index 775b714d..af857dcc 100644 --- a/scripts/types/generated/mars-account-nft/MarsAccountNft.types.ts +++ b/scripts/types/generated/mars-account-nft/MarsAccountNft.types.ts @@ -1,6 +1,6 @@ // @ts-nocheck /** - * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. + * This file was automatically generated by @cosmwasm/ts-codegen@0.35.3. * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ diff --git a/scripts/types/generated/mars-account-nft/bundle.ts b/scripts/types/generated/mars-account-nft/bundle.ts index 8d86beba..c7a0026c 100644 --- a/scripts/types/generated/mars-account-nft/bundle.ts +++ b/scripts/types/generated/mars-account-nft/bundle.ts @@ -1,6 +1,6 @@ // @ts-nocheck /** - * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. + * This file was automatically generated by @cosmwasm/ts-codegen@0.35.3. * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ @@ -9,9 +9,5 @@ import * as _0 from './MarsAccountNft.types' import * as _1 from './MarsAccountNft.client' import * as _2 from './MarsAccountNft.react-query' export namespace contracts { - export const MarsAccountNft = { - ..._0, - ..._1, - ..._2, - } + export const MarsAccountNft = { ..._0, ..._1, ..._2 } } diff --git a/scripts/types/generated/mars-address-provider/MarsAddressProvider.client.ts b/scripts/types/generated/mars-address-provider/MarsAddressProvider.client.ts index 5e3193c4..97b9cab8 100644 --- a/scripts/types/generated/mars-address-provider/MarsAddressProvider.client.ts +++ b/scripts/types/generated/mars-address-provider/MarsAddressProvider.client.ts @@ -1,6 +1,6 @@ // @ts-nocheck /** - * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. + * This file was automatically generated by @cosmwasm/ts-codegen@0.35.3. * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ @@ -33,6 +33,7 @@ export interface MarsAddressProviderReadOnlyInterface { export class MarsAddressProviderQueryClient implements MarsAddressProviderReadOnlyInterface { client: CosmWasmClient contractAddress: string + constructor(client: CosmWasmClient, contractAddress: string) { this.client = client this.contractAddress = contractAddress @@ -41,6 +42,7 @@ export class MarsAddressProviderQueryClient implements MarsAddressProviderReadOn this.addresses = this.addresses.bind(this) this.allAddresses = this.allAddresses.bind(this) } + config = async (): Promise => { return this.client.queryContractSmart(this.contractAddress, { config: {}, @@ -100,6 +102,7 @@ export class MarsAddressProviderClient client: SigningCosmWasmClient sender: string contractAddress: string + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { super(client, contractAddress) this.client = client @@ -108,6 +111,7 @@ export class MarsAddressProviderClient this.setAddress = this.setAddress.bind(this) this.updateOwner = this.updateOwner.bind(this) } + setAddress = async ( { address, diff --git a/scripts/types/generated/mars-address-provider/MarsAddressProvider.react-query.ts b/scripts/types/generated/mars-address-provider/MarsAddressProvider.react-query.ts index ba90f4c3..67df3695 100644 --- a/scripts/types/generated/mars-address-provider/MarsAddressProvider.react-query.ts +++ b/scripts/types/generated/mars-address-provider/MarsAddressProvider.react-query.ts @@ -1,6 +1,6 @@ // @ts-nocheck /** - * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. + * This file was automatically generated by @cosmwasm/ts-codegen@0.35.3. * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ @@ -29,35 +29,18 @@ export const marsAddressProviderQueryKeys = { }, ] as const, address: (contractAddress: string | undefined) => - [ - { - ...marsAddressProviderQueryKeys.contract[0], - address: contractAddress, - }, - ] as const, + [{ ...marsAddressProviderQueryKeys.contract[0], address: contractAddress }] as const, config: (contractAddress: string | undefined, args?: Record) => [ - { - ...marsAddressProviderQueryKeys.address(contractAddress)[0], - method: 'config', - args, - }, + { ...marsAddressProviderQueryKeys.address(contractAddress)[0], method: 'config', args }, ] as const, address: (contractAddress: string | undefined, args?: Record) => [ - { - ...marsAddressProviderQueryKeys.address(contractAddress)[0], - method: 'address', - args, - }, + { ...marsAddressProviderQueryKeys.address(contractAddress)[0], method: 'address', args }, ] as const, addresses: (contractAddress: string | undefined, args?: Record) => [ - { - ...marsAddressProviderQueryKeys.address(contractAddress)[0], - method: 'addresses', - args, - }, + { ...marsAddressProviderQueryKeys.address(contractAddress)[0], method: 'addresses', args }, ] as const, allAddresses: (contractAddress: string | undefined, args?: Record) => [ @@ -98,10 +81,7 @@ export function useMarsAddressProviderAllAddressesQuery @@ -113,10 +93,7 @@ export function useMarsAddressProviderAddressesQuery( marsAddressProviderQueryKeys.addresses(client?.contractAddress), () => (client ? client.addresses() : Promise.reject(new Error('Invalid client'))), - { - ...options, - enabled: !!client && (options?.enabled != undefined ? options.enabled : true), - }, + { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }, ) } export interface MarsAddressProviderAddressQuery @@ -128,10 +105,7 @@ export function useMarsAddressProviderAddressQuery( return useQuery( marsAddressProviderQueryKeys.address(client?.contractAddress), () => (client ? client.address() : Promise.reject(new Error('Invalid client'))), - { - ...options, - enabled: !!client && (options?.enabled != undefined ? options.enabled : true), - }, + { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }, ) } export interface MarsAddressProviderConfigQuery @@ -143,10 +117,7 @@ export function useMarsAddressProviderConfigQuery({ return useQuery( marsAddressProviderQueryKeys.config(client?.contractAddress), () => (client ? client.config() : Promise.reject(new Error('Invalid client'))), - { - ...options, - enabled: !!client && (options?.enabled != undefined ? options.enabled : true), - }, + { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }, ) } export interface MarsAddressProviderUpdateOwnerMutation { diff --git a/scripts/types/generated/mars-address-provider/MarsAddressProvider.types.ts b/scripts/types/generated/mars-address-provider/MarsAddressProvider.types.ts index a2545bd3..87688b41 100644 --- a/scripts/types/generated/mars-address-provider/MarsAddressProvider.types.ts +++ b/scripts/types/generated/mars-address-provider/MarsAddressProvider.types.ts @@ -1,6 +1,6 @@ // @ts-nocheck /** - * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. + * This file was automatically generated by @cosmwasm/ts-codegen@0.35.3. * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ diff --git a/scripts/types/generated/mars-address-provider/bundle.ts b/scripts/types/generated/mars-address-provider/bundle.ts index 65400353..4bcba804 100644 --- a/scripts/types/generated/mars-address-provider/bundle.ts +++ b/scripts/types/generated/mars-address-provider/bundle.ts @@ -1,6 +1,6 @@ // @ts-nocheck /** - * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. + * This file was automatically generated by @cosmwasm/ts-codegen@0.35.3. * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ @@ -9,9 +9,5 @@ import * as _3 from './MarsAddressProvider.types' import * as _4 from './MarsAddressProvider.client' import * as _5 from './MarsAddressProvider.react-query' export namespace contracts { - export const MarsAddressProvider = { - ..._3, - ..._4, - ..._5, - } + export const MarsAddressProvider = { ..._3, ..._4, ..._5 } } diff --git a/scripts/types/generated/mars-credit-manager/MarsCreditManager.client.ts b/scripts/types/generated/mars-credit-manager/MarsCreditManager.client.ts index f94341d1..1db80b33 100644 --- a/scripts/types/generated/mars-credit-manager/MarsCreditManager.client.ts +++ b/scripts/types/generated/mars-credit-manager/MarsCreditManager.client.ts @@ -1,6 +1,6 @@ // @ts-nocheck /** - * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. + * This file was automatically generated by @cosmwasm/ts-codegen@0.35.3. * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ @@ -144,6 +144,7 @@ export interface MarsCreditManagerReadOnlyInterface { export class MarsCreditManagerQueryClient implements MarsCreditManagerReadOnlyInterface { client: CosmWasmClient contractAddress: string + constructor(client: CosmWasmClient, contractAddress: string) { this.client = client this.contractAddress = contractAddress @@ -162,6 +163,7 @@ export class MarsCreditManagerQueryClient implements MarsCreditManagerReadOnlyIn this.estimateWithdrawLiquidity = this.estimateWithdrawLiquidity.bind(this) this.vaultPositionValue = this.vaultPositionValue.bind(this) } + accountKind = async ({ accountId }: { accountId: string }): Promise => { return this.client.queryContractSmart(this.contractAddress, { account_kind: { @@ -404,6 +406,7 @@ export class MarsCreditManagerClient client: SigningCosmWasmClient sender: string contractAddress: string + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { super(client, contractAddress) this.client = client @@ -418,6 +421,7 @@ export class MarsCreditManagerClient this.updateNftConfig = this.updateNftConfig.bind(this) this.callback = this.callback.bind(this) } + createCreditAccount = async ( accountKind: AccountKind, fee: number | StdFee | 'auto' = 'auto', diff --git a/scripts/types/generated/mars-credit-manager/MarsCreditManager.react-query.ts b/scripts/types/generated/mars-credit-manager/MarsCreditManager.react-query.ts index d239a18c..723192d8 100644 --- a/scripts/types/generated/mars-credit-manager/MarsCreditManager.react-query.ts +++ b/scripts/types/generated/mars-credit-manager/MarsCreditManager.react-query.ts @@ -1,6 +1,6 @@ // @ts-nocheck /** - * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. + * This file was automatically generated by @cosmwasm/ts-codegen@0.35.3. * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ @@ -85,35 +85,18 @@ export const marsCreditManagerQueryKeys = { }, ] as const, address: (contractAddress: string | undefined) => - [ - { - ...marsCreditManagerQueryKeys.contract[0], - address: contractAddress, - }, - ] as const, + [{ ...marsCreditManagerQueryKeys.contract[0], address: contractAddress }] as const, accountKind: (contractAddress: string | undefined, args?: Record) => [ - { - ...marsCreditManagerQueryKeys.address(contractAddress)[0], - method: 'account_kind', - args, - }, + { ...marsCreditManagerQueryKeys.address(contractAddress)[0], method: 'account_kind', args }, ] as const, accounts: (contractAddress: string | undefined, args?: Record) => [ - { - ...marsCreditManagerQueryKeys.address(contractAddress)[0], - method: 'accounts', - args, - }, + { ...marsCreditManagerQueryKeys.address(contractAddress)[0], method: 'accounts', args }, ] as const, config: (contractAddress: string | undefined, args?: Record) => [ - { - ...marsCreditManagerQueryKeys.address(contractAddress)[0], - method: 'config', - args, - }, + { ...marsCreditManagerQueryKeys.address(contractAddress)[0], method: 'config', args }, ] as const, vaultUtilization: (contractAddress: string | undefined, args?: Record) => [ @@ -133,11 +116,7 @@ export const marsCreditManagerQueryKeys = { ] as const, positions: (contractAddress: string | undefined, args?: Record) => [ - { - ...marsCreditManagerQueryKeys.address(contractAddress)[0], - method: 'positions', - args, - }, + { ...marsCreditManagerQueryKeys.address(contractAddress)[0], method: 'positions', args }, ] as const, allCoinBalances: (contractAddress: string | undefined, args?: Record) => [ @@ -235,10 +214,7 @@ export function useMarsCreditManagerVaultPositionValueQuery @@ -260,10 +236,7 @@ export function useMarsCreditManagerEstimateWithdrawLiquidityQuery @@ -287,10 +260,7 @@ export function useMarsCreditManagerEstimateProvideLiquidityQuery @@ -312,10 +282,7 @@ export function useMarsCreditManagerAllVaultPositionsQuery< startAfter: args.startAfter, }) : Promise.reject(new Error('Invalid client')), - { - ...options, - enabled: !!client && (options?.enabled != undefined ? options.enabled : true), - }, + { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }, ) } export interface MarsCreditManagerAllTotalDebtSharesQuery @@ -339,10 +306,7 @@ export function useMarsCreditManagerAllTotalDebtSharesQuery @@ -354,10 +318,7 @@ export function useMarsCreditManagerTotalDebtSharesQuery({ return useQuery( marsCreditManagerQueryKeys.totalDebtShares(client?.contractAddress), () => (client ? client.totalDebtShares() : Promise.reject(new Error('Invalid client'))), - { - ...options, - enabled: !!client && (options?.enabled != undefined ? options.enabled : true), - }, + { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }, ) } export interface MarsCreditManagerAllDebtSharesQuery @@ -381,10 +342,7 @@ export function useMarsCreditManagerAllDebtSharesQuery @@ -408,10 +366,7 @@ export function useMarsCreditManagerAllCoinBalancesQuery @@ -433,10 +388,7 @@ export function useMarsCreditManagerPositionsQuery({ accountId: args.accountId, }) : Promise.reject(new Error('Invalid client')), - { - ...options, - enabled: !!client && (options?.enabled != undefined ? options.enabled : true), - }, + { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }, ) } export interface MarsCreditManagerAllVaultUtilizationsQuery @@ -458,10 +410,7 @@ export function useMarsCreditManagerAllVaultUtilizationsQuery< startAfter: args.startAfter, }) : Promise.reject(new Error('Invalid client')), - { - ...options, - enabled: !!client && (options?.enabled != undefined ? options.enabled : true), - }, + { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }, ) } export interface MarsCreditManagerVaultUtilizationQuery @@ -483,10 +432,7 @@ export function useMarsCreditManagerVaultUtilizationQuery @@ -498,10 +444,7 @@ export function useMarsCreditManagerConfigQuery({ return useQuery( marsCreditManagerQueryKeys.config(client?.contractAddress), () => (client ? client.config() : Promise.reject(new Error('Invalid client'))), - { - ...options, - enabled: !!client && (options?.enabled != undefined ? options.enabled : true), - }, + { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }, ) } export interface MarsCreditManagerAccountsQuery @@ -527,10 +470,7 @@ export function useMarsCreditManagerAccountsQuery({ startAfter: args.startAfter, }) : Promise.reject(new Error('Invalid client')), - { - ...options, - enabled: !!client && (options?.enabled != undefined ? options.enabled : true), - }, + { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }, ) } export interface MarsCreditManagerAccountKindQuery @@ -552,10 +492,7 @@ export function useMarsCreditManagerAccountKindQuery({ accountId: args.accountId, }) : Promise.reject(new Error('Invalid client')), - { - ...options, - enabled: !!client && (options?.enabled != undefined ? options.enabled : true), - }, + { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }, ) } export interface MarsCreditManagerCallbackMutation { diff --git a/scripts/types/generated/mars-credit-manager/MarsCreditManager.types.ts b/scripts/types/generated/mars-credit-manager/MarsCreditManager.types.ts index 00e70cdb..a5bf6c21 100644 --- a/scripts/types/generated/mars-credit-manager/MarsCreditManager.types.ts +++ b/scripts/types/generated/mars-credit-manager/MarsCreditManager.types.ts @@ -1,6 +1,6 @@ // @ts-nocheck /** - * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. + * This file was automatically generated by @cosmwasm/ts-codegen@0.35.3. * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ @@ -155,6 +155,21 @@ export type Action = slippage: Decimal } } + | { + stake_astro_lp: { + lp_token: ActionCoin + } + } + | { + unstake_astro_lp: { + lp_token: ActionCoin + } + } + | { + claim_astro_lp_rewards: { + lp_denom: string + } + } | { refund_all_coin_balances: {} } @@ -351,6 +366,24 @@ export type CallbackMsg = slippage: Decimal } } + | { + stake_astro_lp: { + account_id: string + lp_token: ActionCoin + } + } + | { + unstake_astro_lp: { + account_id: string + lp_token: ActionCoin + } + } + | { + claim_astro_lp_rewards: { + account_id: string + lp_denom: string + } + } | { withdraw_liquidity: { account_id: string @@ -613,6 +646,7 @@ export interface Positions { debts: DebtAmount[] deposits: Coin[] lends: Coin[] + staked_lp: Coin[] vaults: VaultPosition[] } export interface DebtAmount { diff --git a/scripts/types/generated/mars-credit-manager/bundle.ts b/scripts/types/generated/mars-credit-manager/bundle.ts index 1e6f6811..5d5cd8bd 100644 --- a/scripts/types/generated/mars-credit-manager/bundle.ts +++ b/scripts/types/generated/mars-credit-manager/bundle.ts @@ -1,6 +1,6 @@ // @ts-nocheck /** - * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. + * This file was automatically generated by @cosmwasm/ts-codegen@0.35.3. * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ @@ -9,9 +9,5 @@ import * as _6 from './MarsCreditManager.types' import * as _7 from './MarsCreditManager.client' import * as _8 from './MarsCreditManager.react-query' export namespace contracts { - export const MarsCreditManager = { - ..._6, - ..._7, - ..._8, - } + export const MarsCreditManager = { ..._6, ..._7, ..._8 } } diff --git a/scripts/types/generated/mars-incentives/MarsIncentives.client.ts b/scripts/types/generated/mars-incentives/MarsIncentives.client.ts index d5b01536..179b43fa 100644 --- a/scripts/types/generated/mars-incentives/MarsIncentives.client.ts +++ b/scripts/types/generated/mars-incentives/MarsIncentives.client.ts @@ -1,6 +1,6 @@ // @ts-nocheck /** - * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. + * This file was automatically generated by @cosmwasm/ts-codegen@0.35.3. * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ @@ -30,11 +30,19 @@ import { StakedLpPositionResponse, PaginationResponseForStakedLpPositionResponse, Metadata, + PaginationResponseForTupleOfStringAndArrayOfCoin, ArrayOfCoin, ArrayOfWhitelistEntry, } from './MarsIncentives.types' export interface MarsIncentivesReadOnlyInterface { contractAddress: string + stakedAstroLpRewards: ({ + accountId, + lpDenom, + }: { + accountId: string + lpDenom: string + }) => Promise activeEmissions: ({ collateralDenom, }: { @@ -57,22 +65,6 @@ export interface MarsIncentivesReadOnlyInterface { startAfterCollateralDenom?: string startAfterIncentiveDenom?: string }) => Promise - stakedLpPositions: ({ - accountId, - limit, - startAfter, - }: { - accountId: string - limit?: number - startAfter?: string - }) => Promise - stakedLpPosition: ({ - accountId, - lpDenom, - }: { - accountId: string - lpDenom: string - }) => Promise emission: ({ collateralDenom, incentiveDenom, @@ -93,6 +85,22 @@ export interface MarsIncentivesReadOnlyInterface { limit?: number startAfterTimestamp?: number }) => Promise + stakedAstroLpPositions: ({ + accountId, + limit, + startAfter, + }: { + accountId: string + limit?: number + startAfter?: string + }) => Promise + stakedAstroLpPosition: ({ + accountId, + lpDenom, + }: { + accountId: string + lpDenom: string + }) => Promise userUnclaimedRewards: ({ accountId, limit, @@ -111,20 +119,37 @@ export interface MarsIncentivesReadOnlyInterface { export class MarsIncentivesQueryClient implements MarsIncentivesReadOnlyInterface { client: CosmWasmClient contractAddress: string + constructor(client: CosmWasmClient, contractAddress: string) { this.client = client this.contractAddress = contractAddress + this.stakedAstroLpRewards = this.stakedAstroLpRewards.bind(this) this.activeEmissions = this.activeEmissions.bind(this) this.config = this.config.bind(this) this.incentiveState = this.incentiveState.bind(this) this.incentiveStates = this.incentiveStates.bind(this) - this.stakedLpPositions = this.stakedLpPositions.bind(this) - this.stakedLpPosition = this.stakedLpPosition.bind(this) this.emission = this.emission.bind(this) this.emissions = this.emissions.bind(this) + this.stakedAstroLpPositions = this.stakedAstroLpPositions.bind(this) + this.stakedAstroLpPosition = this.stakedAstroLpPosition.bind(this) this.userUnclaimedRewards = this.userUnclaimedRewards.bind(this) this.whitelist = this.whitelist.bind(this) } + + stakedAstroLpRewards = async ({ + accountId, + lpDenom, + }: { + accountId: string + lpDenom: string + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + staked_astro_lp_rewards: { + account_id: accountId, + lp_denom: lpDenom, + }, + }) + } activeEmissions = async ({ collateralDenom, }: { @@ -172,37 +197,6 @@ export class MarsIncentivesQueryClient implements MarsIncentivesReadOnlyInterfac }, }) } - stakedLpPositions = async ({ - accountId, - limit, - startAfter, - }: { - accountId: string - limit?: number - startAfter?: string - }): Promise => { - return this.client.queryContractSmart(this.contractAddress, { - staked_lp_positions: { - account_id: accountId, - limit, - start_after: startAfter, - }, - }) - } - stakedLpPosition = async ({ - accountId, - lpDenom, - }: { - accountId: string - lpDenom: string - }): Promise => { - return this.client.queryContractSmart(this.contractAddress, { - staked_lp_position: { - account_id: accountId, - lp_denom: lpDenom, - }, - }) - } emission = async ({ collateralDenom, incentiveDenom, @@ -240,6 +234,37 @@ export class MarsIncentivesQueryClient implements MarsIncentivesReadOnlyInterfac }, }) } + stakedAstroLpPositions = async ({ + accountId, + limit, + startAfter, + }: { + accountId: string + limit?: number + startAfter?: string + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + staked_astro_lp_positions: { + account_id: accountId, + limit, + start_after: startAfter, + }, + }) + } + stakedAstroLpPosition = async ({ + accountId, + lpDenom, + }: { + accountId: string + lpDenom: string + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + staked_astro_lp_position: { + account_id: accountId, + lp_denom: lpDenom, + }, + }) + } userUnclaimedRewards = async ({ accountId, limit, @@ -336,7 +361,7 @@ export interface MarsIncentivesInterface extends MarsIncentivesReadOnlyInterface memo?: string, _funds?: Coin[], ) => Promise - claimAstroLpRewards: ( + claimStakedAstroLpRewards: ( { accountId, lpDenom, @@ -404,6 +429,7 @@ export class MarsIncentivesClient client: SigningCosmWasmClient sender: string contractAddress: string + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { super(client, contractAddress) this.client = client @@ -413,13 +439,14 @@ export class MarsIncentivesClient this.setAssetIncentive = this.setAssetIncentive.bind(this) this.balanceChange = this.balanceChange.bind(this) this.claimRewards = this.claimRewards.bind(this) - this.claimAstroLpRewards = this.claimAstroLpRewards.bind(this) + this.claimStakedAstroLpRewards = this.claimStakedAstroLpRewards.bind(this) this.stakeAstroLp = this.stakeAstroLp.bind(this) this.unstakeAstroLp = this.unstakeAstroLp.bind(this) this.updateConfig = this.updateConfig.bind(this) this.updateOwner = this.updateOwner.bind(this) this.migrate = this.migrate.bind(this) } + updateWhitelist = async ( { addDenoms, @@ -548,7 +575,7 @@ export class MarsIncentivesClient _funds, ) } - claimAstroLpRewards = async ( + claimStakedAstroLpRewards = async ( { accountId, lpDenom, @@ -564,7 +591,7 @@ export class MarsIncentivesClient this.sender, this.contractAddress, { - claim_astro_lp_rewards: { + claim_staked_astro_lp_rewards: { account_id: accountId, lp_denom: lpDenom, }, diff --git a/scripts/types/generated/mars-incentives/MarsIncentives.react-query.ts b/scripts/types/generated/mars-incentives/MarsIncentives.react-query.ts index 61315422..ffe0d82a 100644 --- a/scripts/types/generated/mars-incentives/MarsIncentives.react-query.ts +++ b/scripts/types/generated/mars-incentives/MarsIncentives.react-query.ts @@ -1,6 +1,6 @@ // @ts-nocheck /** - * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. + * This file was automatically generated by @cosmwasm/ts-codegen@0.35.3. * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ @@ -31,6 +31,7 @@ import { StakedLpPositionResponse, PaginationResponseForStakedLpPositionResponse, Metadata, + PaginationResponseForTupleOfStringAndArrayOfCoin, ArrayOfCoin, ArrayOfWhitelistEntry, } from './MarsIncentives.types' @@ -42,73 +43,48 @@ export const marsIncentivesQueryKeys = { }, ] as const, address: (contractAddress: string | undefined) => - [ - { - ...marsIncentivesQueryKeys.contract[0], - address: contractAddress, - }, - ] as const, - activeEmissions: (contractAddress: string | undefined, args?: Record) => + [{ ...marsIncentivesQueryKeys.contract[0], address: contractAddress }] as const, + stakedAstroLpRewards: (contractAddress: string | undefined, args?: Record) => [ { ...marsIncentivesQueryKeys.address(contractAddress)[0], - method: 'active_emissions', + method: 'staked_astro_lp_rewards', args, }, ] as const, - config: (contractAddress: string | undefined, args?: Record) => + activeEmissions: (contractAddress: string | undefined, args?: Record) => [ - { - ...marsIncentivesQueryKeys.address(contractAddress)[0], - method: 'config', - args, - }, + { ...marsIncentivesQueryKeys.address(contractAddress)[0], method: 'active_emissions', args }, ] as const, + config: (contractAddress: string | undefined, args?: Record) => + [{ ...marsIncentivesQueryKeys.address(contractAddress)[0], method: 'config', args }] as const, incentiveState: (contractAddress: string | undefined, args?: Record) => [ - { - ...marsIncentivesQueryKeys.address(contractAddress)[0], - method: 'incentive_state', - args, - }, + { ...marsIncentivesQueryKeys.address(contractAddress)[0], method: 'incentive_state', args }, ] as const, incentiveStates: (contractAddress: string | undefined, args?: Record) => [ - { - ...marsIncentivesQueryKeys.address(contractAddress)[0], - method: 'incentive_states', - args, - }, - ] as const, - stakedLpPositions: (contractAddress: string | undefined, args?: Record) => - [ - { - ...marsIncentivesQueryKeys.address(contractAddress)[0], - method: 'staked_lp_positions', - args, - }, + { ...marsIncentivesQueryKeys.address(contractAddress)[0], method: 'incentive_states', args }, ] as const, - stakedLpPosition: (contractAddress: string | undefined, args?: Record) => + emission: (contractAddress: string | undefined, args?: Record) => + [{ ...marsIncentivesQueryKeys.address(contractAddress)[0], method: 'emission', args }] as const, + emissions: (contractAddress: string | undefined, args?: Record) => [ - { - ...marsIncentivesQueryKeys.address(contractAddress)[0], - method: 'staked_lp_position', - args, - }, + { ...marsIncentivesQueryKeys.address(contractAddress)[0], method: 'emissions', args }, ] as const, - emission: (contractAddress: string | undefined, args?: Record) => + stakedAstroLpPositions: (contractAddress: string | undefined, args?: Record) => [ { ...marsIncentivesQueryKeys.address(contractAddress)[0], - method: 'emission', + method: 'staked_astro_lp_positions', args, }, ] as const, - emissions: (contractAddress: string | undefined, args?: Record) => + stakedAstroLpPosition: (contractAddress: string | undefined, args?: Record) => [ { ...marsIncentivesQueryKeys.address(contractAddress)[0], - method: 'emissions', + method: 'staked_astro_lp_position', args, }, ] as const, @@ -122,11 +98,7 @@ export const marsIncentivesQueryKeys = { ] as const, whitelist: (contractAddress: string | undefined, args?: Record) => [ - { - ...marsIncentivesQueryKeys.address(contractAddress)[0], - method: 'whitelist', - args, - }, + { ...marsIncentivesQueryKeys.address(contractAddress)[0], method: 'whitelist', args }, ] as const, } export interface MarsIncentivesReactQuery { @@ -147,10 +119,7 @@ export function useMarsIncentivesWhitelistQuery({ return useQuery( marsIncentivesQueryKeys.whitelist(client?.contractAddress), () => (client ? client.whitelist() : Promise.reject(new Error('Invalid client'))), - { - ...options, - enabled: !!client && (options?.enabled != undefined ? options.enabled : true), - }, + { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }, ) } export interface MarsIncentivesUserUnclaimedRewardsQuery @@ -180,10 +149,55 @@ export function useMarsIncentivesUserUnclaimedRewardsQuery( user: args.user, }) : Promise.reject(new Error('Invalid client')), - { - ...options, - enabled: !!client && (options?.enabled != undefined ? options.enabled : true), - }, + { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }, + ) +} +export interface MarsIncentivesStakedAstroLpPositionQuery + extends MarsIncentivesReactQuery { + args: { + accountId: string + lpDenom: string + } +} +export function useMarsIncentivesStakedAstroLpPositionQuery({ + client, + args, + options, +}: MarsIncentivesStakedAstroLpPositionQuery) { + return useQuery( + marsIncentivesQueryKeys.stakedAstroLpPosition(client?.contractAddress, args), + () => + client + ? client.stakedAstroLpPosition({ + accountId: args.accountId, + lpDenom: args.lpDenom, + }) + : Promise.reject(new Error('Invalid client')), + { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }, + ) +} +export interface MarsIncentivesStakedAstroLpPositionsQuery + extends MarsIncentivesReactQuery { + args: { + accountId: string + limit?: number + startAfter?: string + } +} +export function useMarsIncentivesStakedAstroLpPositionsQuery< + TData = PaginationResponseForStakedLpPositionResponse, +>({ client, args, options }: MarsIncentivesStakedAstroLpPositionsQuery) { + return useQuery( + marsIncentivesQueryKeys.stakedAstroLpPositions(client?.contractAddress, args), + () => + client + ? client.stakedAstroLpPositions({ + accountId: args.accountId, + limit: args.limit, + startAfter: args.startAfter, + }) + : Promise.reject(new Error('Invalid client')), + { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }, ) } export interface MarsIncentivesEmissionsQuery @@ -211,10 +225,7 @@ export function useMarsIncentivesEmissionsQuery startAfterTimestamp: args.startAfterTimestamp, }) : Promise.reject(new Error('Invalid client')), - { - ...options, - enabled: !!client && (options?.enabled != undefined ? options.enabled : true), - }, + { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }, ) } export interface MarsIncentivesEmissionQuery @@ -240,64 +251,7 @@ export function useMarsIncentivesEmissionQuery({ timestamp: args.timestamp, }) : Promise.reject(new Error('Invalid client')), - { - ...options, - enabled: !!client && (options?.enabled != undefined ? options.enabled : true), - }, - ) -} -export interface MarsIncentivesStakedLpPositionQuery - extends MarsIncentivesReactQuery { - args: { - accountId: string - lpDenom: string - } -} -export function useMarsIncentivesStakedLpPositionQuery({ - client, - args, - options, -}: MarsIncentivesStakedLpPositionQuery) { - return useQuery( - marsIncentivesQueryKeys.stakedLpPosition(client?.contractAddress, args), - () => - client - ? client.stakedLpPosition({ - accountId: args.accountId, - lpDenom: args.lpDenom, - }) - : Promise.reject(new Error('Invalid client')), - { - ...options, - enabled: !!client && (options?.enabled != undefined ? options.enabled : true), - }, - ) -} -export interface MarsIncentivesStakedLpPositionsQuery - extends MarsIncentivesReactQuery { - args: { - accountId: string - limit?: number - startAfter?: string - } -} -export function useMarsIncentivesStakedLpPositionsQuery< - TData = PaginationResponseForStakedLpPositionResponse, ->({ client, args, options }: MarsIncentivesStakedLpPositionsQuery) { - return useQuery( - marsIncentivesQueryKeys.stakedLpPositions(client?.contractAddress, args), - () => - client - ? client.stakedLpPositions({ - accountId: args.accountId, - limit: args.limit, - startAfter: args.startAfter, - }) - : Promise.reject(new Error('Invalid client')), - { - ...options, - enabled: !!client && (options?.enabled != undefined ? options.enabled : true), - }, + { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }, ) } export interface MarsIncentivesIncentiveStatesQuery @@ -323,10 +277,7 @@ export function useMarsIncentivesIncentiveStatesQuery @@ -350,10 +301,7 @@ export function useMarsIncentivesIncentiveStateQuery @@ -365,10 +313,7 @@ export function useMarsIncentivesConfigQuery({ return useQuery( marsIncentivesQueryKeys.config(client?.contractAddress), () => (client ? client.config() : Promise.reject(new Error('Invalid client'))), - { - ...options, - enabled: !!client && (options?.enabled != undefined ? options.enabled : true), - }, + { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }, ) } export interface MarsIncentivesActiveEmissionsQuery @@ -390,10 +335,29 @@ export function useMarsIncentivesActiveEmissionsQuery + extends MarsIncentivesReactQuery { + args: { + accountId: string + lpDenom: string + } +} +export function useMarsIncentivesStakedAstroLpRewardsQuery< + TData = PaginationResponseForTupleOfStringAndArrayOfCoin, +>({ client, args, options }: MarsIncentivesStakedAstroLpRewardsQuery) { + return useQuery( + marsIncentivesQueryKeys.stakedAstroLpRewards(client?.contractAddress, args), + () => + client + ? client.stakedAstroLpRewards({ + accountId: args.accountId, + lpDenom: args.lpDenom, + }) + : Promise.reject(new Error('Invalid client')), + { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }, ) } export interface MarsIncentivesMigrateMutation { @@ -508,7 +472,7 @@ export function useMarsIncentivesStakeAstroLpMutation( options, ) } -export interface MarsIncentivesClaimAstroLpRewardsMutation { +export interface MarsIncentivesClaimStakedAstroLpRewardsMutation { client: MarsIncentivesClient msg: { accountId: string @@ -520,15 +484,15 @@ export interface MarsIncentivesClaimAstroLpRewardsMutation { funds?: Coin[] } } -export function useMarsIncentivesClaimAstroLpRewardsMutation( +export function useMarsIncentivesClaimStakedAstroLpRewardsMutation( options?: Omit< - UseMutationOptions, + UseMutationOptions, 'mutationFn' >, ) { - return useMutation( + return useMutation( ({ client, msg, args: { fee, memo, funds } = {} }) => - client.claimAstroLpRewards(msg, fee, memo, funds), + client.claimStakedAstroLpRewards(msg, fee, memo, funds), options, ) } diff --git a/scripts/types/generated/mars-incentives/MarsIncentives.types.ts b/scripts/types/generated/mars-incentives/MarsIncentives.types.ts index 6965fb6f..a5309949 100644 --- a/scripts/types/generated/mars-incentives/MarsIncentives.types.ts +++ b/scripts/types/generated/mars-incentives/MarsIncentives.types.ts @@ -1,6 +1,6 @@ // @ts-nocheck /** - * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. + * This file was automatically generated by @cosmwasm/ts-codegen@0.35.3. * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ @@ -45,7 +45,7 @@ export type ExecuteMsg = } } | { - claim_astro_lp_rewards: { + claim_staked_astro_lp_rewards: { account_id: string lp_denom: string } @@ -119,6 +119,12 @@ export interface ActionCoin { denom: string } export type QueryMsg = + | { + staked_astro_lp_rewards: { + account_id: string + lp_denom: string + } + } | { active_emissions: { collateral_denom: string @@ -140,19 +146,6 @@ export type QueryMsg = start_after_incentive_denom?: string | null } } - | { - staked_lp_positions: { - account_id: string - limit?: number | null - start_after?: string | null - } - } - | { - staked_lp_position: { - account_id: string - lp_denom: string - } - } | { emission: { collateral_denom: string @@ -168,6 +161,19 @@ export type QueryMsg = start_after_timestamp?: number | null } } + | { + staked_astro_lp_positions: { + account_id: string + limit?: number | null + start_after?: string | null + } + } + | { + staked_astro_lp_position: { + account_id: string + lp_denom: string + } + } | { user_unclaimed_rewards: { account_id?: string | null @@ -217,5 +223,9 @@ export interface PaginationResponseForStakedLpPositionResponse { export interface Metadata { has_more: boolean } +export interface PaginationResponseForTupleOfStringAndArrayOfCoin { + data: [string, Coin[]][] + metadata: Metadata +} export type ArrayOfCoin = Coin[] export type ArrayOfWhitelistEntry = WhitelistEntry[] diff --git a/scripts/types/generated/mars-incentives/bundle.ts b/scripts/types/generated/mars-incentives/bundle.ts index 88c9525a..da717f0e 100644 --- a/scripts/types/generated/mars-incentives/bundle.ts +++ b/scripts/types/generated/mars-incentives/bundle.ts @@ -1,6 +1,6 @@ // @ts-nocheck /** - * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. + * This file was automatically generated by @cosmwasm/ts-codegen@0.35.3. * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ @@ -9,9 +9,5 @@ import * as _9 from './MarsIncentives.types' import * as _10 from './MarsIncentives.client' import * as _11 from './MarsIncentives.react-query' export namespace contracts { - export const MarsIncentives = { - ..._9, - ..._10, - ..._11, - } + export const MarsIncentives = { ..._9, ..._10, ..._11 } } diff --git a/scripts/types/generated/mars-mock-vault/MarsMockVault.client.ts b/scripts/types/generated/mars-mock-vault/MarsMockVault.client.ts index 2348405e..fd8ec78d 100644 --- a/scripts/types/generated/mars-mock-vault/MarsMockVault.client.ts +++ b/scripts/types/generated/mars-mock-vault/MarsMockVault.client.ts @@ -1,6 +1,6 @@ // @ts-nocheck /** - * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. + * This file was automatically generated by @cosmwasm/ts-codegen@0.35.3. * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ @@ -38,6 +38,7 @@ export interface MarsMockVaultReadOnlyInterface { export class MarsMockVaultQueryClient implements MarsMockVaultReadOnlyInterface { client: CosmWasmClient contractAddress: string + constructor(client: CosmWasmClient, contractAddress: string) { this.client = client this.contractAddress = contractAddress @@ -51,6 +52,7 @@ export class MarsMockVaultQueryClient implements MarsMockVaultReadOnlyInterface this.convertToAssets = this.convertToAssets.bind(this) this.vaultExtension = this.vaultExtension.bind(this) } + vaultStandardInfo = async (): Promise => { return this.client.queryContractSmart(this.contractAddress, { vault_standard_info: {}, @@ -146,6 +148,7 @@ export class MarsMockVaultClient client: SigningCosmWasmClient sender: string contractAddress: string + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { super(client, contractAddress) this.client = client @@ -155,6 +158,7 @@ export class MarsMockVaultClient this.redeem = this.redeem.bind(this) this.vaultExtension = this.vaultExtension.bind(this) } + deposit = async ( { amount, diff --git a/scripts/types/generated/mars-mock-vault/MarsMockVault.react-query.ts b/scripts/types/generated/mars-mock-vault/MarsMockVault.react-query.ts index 0f7588c4..c718b679 100644 --- a/scripts/types/generated/mars-mock-vault/MarsMockVault.react-query.ts +++ b/scripts/types/generated/mars-mock-vault/MarsMockVault.react-query.ts @@ -1,6 +1,6 @@ // @ts-nocheck /** - * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. + * This file was automatically generated by @cosmwasm/ts-codegen@0.35.3. * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ @@ -32,12 +32,7 @@ export const marsMockVaultQueryKeys = { }, ] as const, address: (contractAddress: string | undefined) => - [ - { - ...marsMockVaultQueryKeys.contract[0], - address: contractAddress, - }, - ] as const, + [{ ...marsMockVaultQueryKeys.contract[0], address: contractAddress }] as const, vaultStandardInfo: (contractAddress: string | undefined, args?: Record) => [ { @@ -47,36 +42,18 @@ export const marsMockVaultQueryKeys = { }, ] as const, info: (contractAddress: string | undefined, args?: Record) => - [ - { - ...marsMockVaultQueryKeys.address(contractAddress)[0], - method: 'info', - args, - }, - ] as const, + [{ ...marsMockVaultQueryKeys.address(contractAddress)[0], method: 'info', args }] as const, previewDeposit: (contractAddress: string | undefined, args?: Record) => [ - { - ...marsMockVaultQueryKeys.address(contractAddress)[0], - method: 'preview_deposit', - args, - }, + { ...marsMockVaultQueryKeys.address(contractAddress)[0], method: 'preview_deposit', args }, ] as const, previewRedeem: (contractAddress: string | undefined, args?: Record) => [ - { - ...marsMockVaultQueryKeys.address(contractAddress)[0], - method: 'preview_redeem', - args, - }, + { ...marsMockVaultQueryKeys.address(contractAddress)[0], method: 'preview_redeem', args }, ] as const, totalAssets: (contractAddress: string | undefined, args?: Record) => [ - { - ...marsMockVaultQueryKeys.address(contractAddress)[0], - method: 'total_assets', - args, - }, + { ...marsMockVaultQueryKeys.address(contractAddress)[0], method: 'total_assets', args }, ] as const, totalVaultTokenSupply: (contractAddress: string | undefined, args?: Record) => [ @@ -88,27 +65,15 @@ export const marsMockVaultQueryKeys = { ] as const, convertToShares: (contractAddress: string | undefined, args?: Record) => [ - { - ...marsMockVaultQueryKeys.address(contractAddress)[0], - method: 'convert_to_shares', - args, - }, + { ...marsMockVaultQueryKeys.address(contractAddress)[0], method: 'convert_to_shares', args }, ] as const, convertToAssets: (contractAddress: string | undefined, args?: Record) => [ - { - ...marsMockVaultQueryKeys.address(contractAddress)[0], - method: 'convert_to_assets', - args, - }, + { ...marsMockVaultQueryKeys.address(contractAddress)[0], method: 'convert_to_assets', args }, ] as const, vaultExtension: (contractAddress: string | undefined, args?: Record) => [ - { - ...marsMockVaultQueryKeys.address(contractAddress)[0], - method: 'vault_extension', - args, - }, + { ...marsMockVaultQueryKeys.address(contractAddress)[0], method: 'vault_extension', args }, ] as const, } export interface MarsMockVaultReactQuery { @@ -129,10 +94,7 @@ export function useMarsMockVaultVaultExtensionQuery({ return useQuery( marsMockVaultQueryKeys.vaultExtension(client?.contractAddress), () => (client ? client.vaultExtension() : Promise.reject(new Error('Invalid client'))), - { - ...options, - enabled: !!client && (options?.enabled != undefined ? options.enabled : true), - }, + { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }, ) } export interface MarsMockVaultConvertToAssetsQuery @@ -154,10 +116,7 @@ export function useMarsMockVaultConvertToAssetsQuery({ amount: args.amount, }) : Promise.reject(new Error('Invalid client')), - { - ...options, - enabled: !!client && (options?.enabled != undefined ? options.enabled : true), - }, + { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }, ) } export interface MarsMockVaultConvertToSharesQuery @@ -179,10 +138,7 @@ export function useMarsMockVaultConvertToSharesQuery({ amount: args.amount, }) : Promise.reject(new Error('Invalid client')), - { - ...options, - enabled: !!client && (options?.enabled != undefined ? options.enabled : true), - }, + { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }, ) } export interface MarsMockVaultTotalVaultTokenSupplyQuery @@ -194,10 +150,7 @@ export function useMarsMockVaultTotalVaultTokenSupplyQuery({ return useQuery( marsMockVaultQueryKeys.totalVaultTokenSupply(client?.contractAddress), () => (client ? client.totalVaultTokenSupply() : Promise.reject(new Error('Invalid client'))), - { - ...options, - enabled: !!client && (options?.enabled != undefined ? options.enabled : true), - }, + { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }, ) } export interface MarsMockVaultTotalAssetsQuery @@ -209,10 +162,7 @@ export function useMarsMockVaultTotalAssetsQuery({ return useQuery( marsMockVaultQueryKeys.totalAssets(client?.contractAddress), () => (client ? client.totalAssets() : Promise.reject(new Error('Invalid client'))), - { - ...options, - enabled: !!client && (options?.enabled != undefined ? options.enabled : true), - }, + { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }, ) } export interface MarsMockVaultPreviewRedeemQuery @@ -234,10 +184,7 @@ export function useMarsMockVaultPreviewRedeemQuery({ amount: args.amount, }) : Promise.reject(new Error('Invalid client')), - { - ...options, - enabled: !!client && (options?.enabled != undefined ? options.enabled : true), - }, + { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }, ) } export interface MarsMockVaultPreviewDepositQuery @@ -259,10 +206,7 @@ export function useMarsMockVaultPreviewDepositQuery({ amount: args.amount, }) : Promise.reject(new Error('Invalid client')), - { - ...options, - enabled: !!client && (options?.enabled != undefined ? options.enabled : true), - }, + { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }, ) } export interface MarsMockVaultInfoQuery @@ -274,10 +218,7 @@ export function useMarsMockVaultInfoQuery({ return useQuery( marsMockVaultQueryKeys.info(client?.contractAddress), () => (client ? client.info() : Promise.reject(new Error('Invalid client'))), - { - ...options, - enabled: !!client && (options?.enabled != undefined ? options.enabled : true), - }, + { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }, ) } export interface MarsMockVaultVaultStandardInfoQuery @@ -289,10 +230,7 @@ export function useMarsMockVaultVaultStandardInfoQuery( marsMockVaultQueryKeys.vaultStandardInfo(client?.contractAddress), () => (client ? client.vaultStandardInfo() : Promise.reject(new Error('Invalid client'))), - { - ...options, - enabled: !!client && (options?.enabled != undefined ? options.enabled : true), - }, + { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }, ) } export interface MarsMockVaultVaultExtensionMutation { diff --git a/scripts/types/generated/mars-mock-vault/MarsMockVault.types.ts b/scripts/types/generated/mars-mock-vault/MarsMockVault.types.ts index ae9bab1e..9db4ece1 100644 --- a/scripts/types/generated/mars-mock-vault/MarsMockVault.types.ts +++ b/scripts/types/generated/mars-mock-vault/MarsMockVault.types.ts @@ -1,6 +1,6 @@ // @ts-nocheck /** - * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. + * This file was automatically generated by @cosmwasm/ts-codegen@0.35.3. * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ diff --git a/scripts/types/generated/mars-mock-vault/bundle.ts b/scripts/types/generated/mars-mock-vault/bundle.ts index a3e22b9e..02170260 100644 --- a/scripts/types/generated/mars-mock-vault/bundle.ts +++ b/scripts/types/generated/mars-mock-vault/bundle.ts @@ -1,6 +1,6 @@ // @ts-nocheck /** - * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. + * This file was automatically generated by @cosmwasm/ts-codegen@0.35.3. * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ @@ -9,9 +9,5 @@ import * as _12 from './MarsMockVault.types' import * as _13 from './MarsMockVault.client' import * as _14 from './MarsMockVault.react-query' export namespace contracts { - export const MarsMockVault = { - ..._12, - ..._13, - ..._14, - } + export const MarsMockVault = { ..._12, ..._13, ..._14 } } diff --git a/scripts/types/generated/mars-oracle-osmosis/MarsOracleOsmosis.client.ts b/scripts/types/generated/mars-oracle-osmosis/MarsOracleOsmosis.client.ts index 6e1aa645..1cb05610 100644 --- a/scripts/types/generated/mars-oracle-osmosis/MarsOracleOsmosis.client.ts +++ b/scripts/types/generated/mars-oracle-osmosis/MarsOracleOsmosis.client.ts @@ -1,6 +1,6 @@ // @ts-nocheck /** - * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. + * This file was automatically generated by @cosmwasm/ts-codegen@0.35.3. * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ @@ -53,6 +53,7 @@ export interface MarsOracleOsmosisReadOnlyInterface { export class MarsOracleOsmosisQueryClient implements MarsOracleOsmosisReadOnlyInterface { client: CosmWasmClient contractAddress: string + constructor(client: CosmWasmClient, contractAddress: string) { this.client = client this.contractAddress = contractAddress @@ -62,6 +63,7 @@ export class MarsOracleOsmosisQueryClient implements MarsOracleOsmosisReadOnlyIn this.price = this.price.bind(this) this.prices = this.prices.bind(this) } + config = async (): Promise => { return this.client.queryContractSmart(this.contractAddress, { config: {}, @@ -164,6 +166,7 @@ export class MarsOracleOsmosisClient client: SigningCosmWasmClient sender: string contractAddress: string + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { super(client, contractAddress) this.client = client @@ -175,6 +178,7 @@ export class MarsOracleOsmosisClient this.updateConfig = this.updateConfig.bind(this) this.custom = this.custom.bind(this) } + setPriceSource = async ( { denom, diff --git a/scripts/types/generated/mars-oracle-osmosis/MarsOracleOsmosis.react-query.ts b/scripts/types/generated/mars-oracle-osmosis/MarsOracleOsmosis.react-query.ts index 31bb3814..10b6cc76 100644 --- a/scripts/types/generated/mars-oracle-osmosis/MarsOracleOsmosis.react-query.ts +++ b/scripts/types/generated/mars-oracle-osmosis/MarsOracleOsmosis.react-query.ts @@ -1,6 +1,6 @@ // @ts-nocheck /** - * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. + * This file was automatically generated by @cosmwasm/ts-codegen@0.35.3. * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ @@ -37,51 +37,24 @@ export const marsOracleOsmosisQueryKeys = { }, ] as const, address: (contractAddress: string | undefined) => - [ - { - ...marsOracleOsmosisQueryKeys.contract[0], - address: contractAddress, - }, - ] as const, + [{ ...marsOracleOsmosisQueryKeys.contract[0], address: contractAddress }] as const, config: (contractAddress: string | undefined, args?: Record) => [ - { - ...marsOracleOsmosisQueryKeys.address(contractAddress)[0], - method: 'config', - args, - }, + { ...marsOracleOsmosisQueryKeys.address(contractAddress)[0], method: 'config', args }, ] as const, priceSource: (contractAddress: string | undefined, args?: Record) => [ - { - ...marsOracleOsmosisQueryKeys.address(contractAddress)[0], - method: 'price_source', - args, - }, + { ...marsOracleOsmosisQueryKeys.address(contractAddress)[0], method: 'price_source', args }, ] as const, priceSources: (contractAddress: string | undefined, args?: Record) => [ - { - ...marsOracleOsmosisQueryKeys.address(contractAddress)[0], - method: 'price_sources', - args, - }, + { ...marsOracleOsmosisQueryKeys.address(contractAddress)[0], method: 'price_sources', args }, ] as const, price: (contractAddress: string | undefined, args?: Record) => - [ - { - ...marsOracleOsmosisQueryKeys.address(contractAddress)[0], - method: 'price', - args, - }, - ] as const, + [{ ...marsOracleOsmosisQueryKeys.address(contractAddress)[0], method: 'price', args }] as const, prices: (contractAddress: string | undefined, args?: Record) => [ - { - ...marsOracleOsmosisQueryKeys.address(contractAddress)[0], - method: 'prices', - args, - }, + { ...marsOracleOsmosisQueryKeys.address(contractAddress)[0], method: 'prices', args }, ] as const, } export interface MarsOracleOsmosisReactQuery { @@ -116,10 +89,7 @@ export function useMarsOracleOsmosisPricesQuery({ startAfter: args.startAfter, }) : Promise.reject(new Error('Invalid client')), - { - ...options, - enabled: !!client && (options?.enabled != undefined ? options.enabled : true), - }, + { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }, ) } export interface MarsOracleOsmosisPriceQuery @@ -143,10 +113,7 @@ export function useMarsOracleOsmosisPriceQuery({ kind: args.kind, }) : Promise.reject(new Error('Invalid client')), - { - ...options, - enabled: !!client && (options?.enabled != undefined ? options.enabled : true), - }, + { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }, ) } export interface MarsOracleOsmosisPriceSourcesQuery @@ -170,10 +137,7 @@ export function useMarsOracleOsmosisPriceSourcesQuery @@ -195,10 +159,7 @@ export function useMarsOracleOsmosisPriceSourceQuery @@ -210,10 +171,7 @@ export function useMarsOracleOsmosisConfigQuery({ return useQuery( marsOracleOsmosisQueryKeys.config(client?.contractAddress), () => (client ? client.config() : Promise.reject(new Error('Invalid client'))), - { - ...options, - enabled: !!client && (options?.enabled != undefined ? options.enabled : true), - }, + { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }, ) } export interface MarsOracleOsmosisCustomMutation { diff --git a/scripts/types/generated/mars-oracle-osmosis/MarsOracleOsmosis.types.ts b/scripts/types/generated/mars-oracle-osmosis/MarsOracleOsmosis.types.ts index c2c4a573..14650c33 100644 --- a/scripts/types/generated/mars-oracle-osmosis/MarsOracleOsmosis.types.ts +++ b/scripts/types/generated/mars-oracle-osmosis/MarsOracleOsmosis.types.ts @@ -1,6 +1,6 @@ // @ts-nocheck /** - * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. + * This file was automatically generated by @cosmwasm/ts-codegen@0.35.3. * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ diff --git a/scripts/types/generated/mars-oracle-osmosis/bundle.ts b/scripts/types/generated/mars-oracle-osmosis/bundle.ts index fecefc5f..9428a689 100644 --- a/scripts/types/generated/mars-oracle-osmosis/bundle.ts +++ b/scripts/types/generated/mars-oracle-osmosis/bundle.ts @@ -1,6 +1,6 @@ // @ts-nocheck /** - * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. + * This file was automatically generated by @cosmwasm/ts-codegen@0.35.3. * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ @@ -9,9 +9,5 @@ import * as _15 from './MarsOracleOsmosis.types' import * as _16 from './MarsOracleOsmosis.client' import * as _17 from './MarsOracleOsmosis.react-query' export namespace contracts { - export const MarsOracleOsmosis = { - ..._15, - ..._16, - ..._17, - } + export const MarsOracleOsmosis = { ..._15, ..._16, ..._17 } } diff --git a/scripts/types/generated/mars-oracle-wasm/MarsOracleWasm.client.ts b/scripts/types/generated/mars-oracle-wasm/MarsOracleWasm.client.ts index 2f9abfdd..cda2b0a7 100644 --- a/scripts/types/generated/mars-oracle-wasm/MarsOracleWasm.client.ts +++ b/scripts/types/generated/mars-oracle-wasm/MarsOracleWasm.client.ts @@ -1,6 +1,6 @@ // @ts-nocheck /** - * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. + * This file was automatically generated by @cosmwasm/ts-codegen@0.35.3. * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ @@ -51,6 +51,7 @@ export interface MarsOracleWasmReadOnlyInterface { export class MarsOracleWasmQueryClient implements MarsOracleWasmReadOnlyInterface { client: CosmWasmClient contractAddress: string + constructor(client: CosmWasmClient, contractAddress: string) { this.client = client this.contractAddress = contractAddress @@ -60,6 +61,7 @@ export class MarsOracleWasmQueryClient implements MarsOracleWasmReadOnlyInterfac this.price = this.price.bind(this) this.prices = this.prices.bind(this) } + config = async (): Promise => { return this.client.queryContractSmart(this.contractAddress, { config: {}, @@ -167,6 +169,7 @@ export class MarsOracleWasmClient client: SigningCosmWasmClient sender: string contractAddress: string + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { super(client, contractAddress) this.client = client @@ -178,6 +181,7 @@ export class MarsOracleWasmClient this.updateConfig = this.updateConfig.bind(this) this.custom = this.custom.bind(this) } + setPriceSource = async ( { denom, diff --git a/scripts/types/generated/mars-oracle-wasm/MarsOracleWasm.react-query.ts b/scripts/types/generated/mars-oracle-wasm/MarsOracleWasm.react-query.ts index 1b5becd2..1d2c23cf 100644 --- a/scripts/types/generated/mars-oracle-wasm/MarsOracleWasm.react-query.ts +++ b/scripts/types/generated/mars-oracle-wasm/MarsOracleWasm.react-query.ts @@ -1,6 +1,6 @@ // @ts-nocheck /** - * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. + * This file was automatically generated by @cosmwasm/ts-codegen@0.35.3. * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ @@ -35,52 +35,21 @@ export const marsOracleWasmQueryKeys = { }, ] as const, address: (contractAddress: string | undefined) => - [ - { - ...marsOracleWasmQueryKeys.contract[0], - address: contractAddress, - }, - ] as const, + [{ ...marsOracleWasmQueryKeys.contract[0], address: contractAddress }] as const, config: (contractAddress: string | undefined, args?: Record) => - [ - { - ...marsOracleWasmQueryKeys.address(contractAddress)[0], - method: 'config', - args, - }, - ] as const, + [{ ...marsOracleWasmQueryKeys.address(contractAddress)[0], method: 'config', args }] as const, priceSource: (contractAddress: string | undefined, args?: Record) => [ - { - ...marsOracleWasmQueryKeys.address(contractAddress)[0], - method: 'price_source', - args, - }, + { ...marsOracleWasmQueryKeys.address(contractAddress)[0], method: 'price_source', args }, ] as const, priceSources: (contractAddress: string | undefined, args?: Record) => [ - { - ...marsOracleWasmQueryKeys.address(contractAddress)[0], - method: 'price_sources', - args, - }, + { ...marsOracleWasmQueryKeys.address(contractAddress)[0], method: 'price_sources', args }, ] as const, price: (contractAddress: string | undefined, args?: Record) => - [ - { - ...marsOracleWasmQueryKeys.address(contractAddress)[0], - method: 'price', - args, - }, - ] as const, + [{ ...marsOracleWasmQueryKeys.address(contractAddress)[0], method: 'price', args }] as const, prices: (contractAddress: string | undefined, args?: Record) => - [ - { - ...marsOracleWasmQueryKeys.address(contractAddress)[0], - method: 'prices', - args, - }, - ] as const, + [{ ...marsOracleWasmQueryKeys.address(contractAddress)[0], method: 'prices', args }] as const, } export interface MarsOracleWasmReactQuery { client: MarsOracleWasmQueryClient | undefined @@ -114,10 +83,7 @@ export function useMarsOracleWasmPricesQuery({ startAfter: args.startAfter, }) : Promise.reject(new Error('Invalid client')), - { - ...options, - enabled: !!client && (options?.enabled != undefined ? options.enabled : true), - }, + { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }, ) } export interface MarsOracleWasmPriceQuery @@ -141,10 +107,7 @@ export function useMarsOracleWasmPriceQuery({ kind: args.kind, }) : Promise.reject(new Error('Invalid client')), - { - ...options, - enabled: !!client && (options?.enabled != undefined ? options.enabled : true), - }, + { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }, ) } export interface MarsOracleWasmPriceSourcesQuery @@ -168,10 +131,7 @@ export function useMarsOracleWasmPriceSourcesQuery @@ -193,10 +153,7 @@ export function useMarsOracleWasmPriceSourceQuery @@ -208,10 +165,7 @@ export function useMarsOracleWasmConfigQuery({ return useQuery( marsOracleWasmQueryKeys.config(client?.contractAddress), () => (client ? client.config() : Promise.reject(new Error('Invalid client'))), - { - ...options, - enabled: !!client && (options?.enabled != undefined ? options.enabled : true), - }, + { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }, ) } export interface MarsOracleWasmCustomMutation { diff --git a/scripts/types/generated/mars-oracle-wasm/MarsOracleWasm.types.ts b/scripts/types/generated/mars-oracle-wasm/MarsOracleWasm.types.ts index fb643cb5..9250d189 100644 --- a/scripts/types/generated/mars-oracle-wasm/MarsOracleWasm.types.ts +++ b/scripts/types/generated/mars-oracle-wasm/MarsOracleWasm.types.ts @@ -1,6 +1,6 @@ // @ts-nocheck /** - * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. + * This file was automatically generated by @cosmwasm/ts-codegen@0.35.3. * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ diff --git a/scripts/types/generated/mars-oracle-wasm/bundle.ts b/scripts/types/generated/mars-oracle-wasm/bundle.ts index 8555a023..96d688af 100644 --- a/scripts/types/generated/mars-oracle-wasm/bundle.ts +++ b/scripts/types/generated/mars-oracle-wasm/bundle.ts @@ -1,6 +1,6 @@ // @ts-nocheck /** - * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. + * This file was automatically generated by @cosmwasm/ts-codegen@0.35.3. * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ @@ -9,9 +9,5 @@ import * as _18 from './MarsOracleWasm.types' import * as _19 from './MarsOracleWasm.client' import * as _20 from './MarsOracleWasm.react-query' export namespace contracts { - export const MarsOracleWasm = { - ..._18, - ..._19, - ..._20, - } + export const MarsOracleWasm = { ..._18, ..._19, ..._20 } } diff --git a/scripts/types/generated/mars-params/MarsParams.client.ts b/scripts/types/generated/mars-params/MarsParams.client.ts index 40e7ea01..6b320bd9 100644 --- a/scripts/types/generated/mars-params/MarsParams.client.ts +++ b/scripts/types/generated/mars-params/MarsParams.client.ts @@ -1,6 +1,6 @@ // @ts-nocheck /** - * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. + * This file was automatically generated by @cosmwasm/ts-codegen@0.35.3. * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ @@ -83,6 +83,7 @@ export interface MarsParamsReadOnlyInterface { export class MarsParamsQueryClient implements MarsParamsReadOnlyInterface { client: CosmWasmClient contractAddress: string + constructor(client: CosmWasmClient, contractAddress: string) { this.client = client this.contractAddress = contractAddress @@ -97,6 +98,7 @@ export class MarsParamsQueryClient implements MarsParamsReadOnlyInterface { this.totalDeposit = this.totalDeposit.bind(this) this.allTotalDepositsV2 = this.allTotalDepositsV2.bind(this) } + owner = async (): Promise => { return this.client.queryContractSmart(this.contractAddress, { owner: {}, @@ -237,6 +239,7 @@ export class MarsParamsClient extends MarsParamsQueryClient implements MarsParam client: SigningCosmWasmClient sender: string contractAddress: string + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { super(client, contractAddress) this.client = client @@ -249,6 +252,7 @@ export class MarsParamsClient extends MarsParamsQueryClient implements MarsParam this.updateVaultConfig = this.updateVaultConfig.bind(this) this.emergencyUpdate = this.emergencyUpdate.bind(this) } + updateOwner = async ( ownerUpdate: OwnerUpdate, fee: number | StdFee | 'auto' = 'auto', diff --git a/scripts/types/generated/mars-params/MarsParams.react-query.ts b/scripts/types/generated/mars-params/MarsParams.react-query.ts index f39396e4..1325824b 100644 --- a/scripts/types/generated/mars-params/MarsParams.react-query.ts +++ b/scripts/types/generated/mars-params/MarsParams.react-query.ts @@ -1,6 +1,6 @@ // @ts-nocheck /** - * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. + * This file was automatically generated by @cosmwasm/ts-codegen@0.35.3. * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ @@ -52,91 +52,38 @@ export const marsParamsQueryKeys = { }, ] as const, address: (contractAddress: string | undefined) => - [ - { - ...marsParamsQueryKeys.contract[0], - address: contractAddress, - }, - ] as const, + [{ ...marsParamsQueryKeys.contract[0], address: contractAddress }] as const, owner: (contractAddress: string | undefined, args?: Record) => - [ - { - ...marsParamsQueryKeys.address(contractAddress)[0], - method: 'owner', - args, - }, - ] as const, + [{ ...marsParamsQueryKeys.address(contractAddress)[0], method: 'owner', args }] as const, config: (contractAddress: string | undefined, args?: Record) => - [ - { - ...marsParamsQueryKeys.address(contractAddress)[0], - method: 'config', - args, - }, - ] as const, + [{ ...marsParamsQueryKeys.address(contractAddress)[0], method: 'config', args }] as const, assetParams: (contractAddress: string | undefined, args?: Record) => - [ - { - ...marsParamsQueryKeys.address(contractAddress)[0], - method: 'asset_params', - args, - }, - ] as const, + [{ ...marsParamsQueryKeys.address(contractAddress)[0], method: 'asset_params', args }] as const, allAssetParams: (contractAddress: string | undefined, args?: Record) => [ - { - ...marsParamsQueryKeys.address(contractAddress)[0], - method: 'all_asset_params', - args, - }, + { ...marsParamsQueryKeys.address(contractAddress)[0], method: 'all_asset_params', args }, ] as const, vaultConfig: (contractAddress: string | undefined, args?: Record) => - [ - { - ...marsParamsQueryKeys.address(contractAddress)[0], - method: 'vault_config', - args, - }, - ] as const, + [{ ...marsParamsQueryKeys.address(contractAddress)[0], method: 'vault_config', args }] as const, allVaultConfigs: (contractAddress: string | undefined, args?: Record) => [ - { - ...marsParamsQueryKeys.address(contractAddress)[0], - method: 'all_vault_configs', - args, - }, + { ...marsParamsQueryKeys.address(contractAddress)[0], method: 'all_vault_configs', args }, ] as const, allVaultConfigsV2: (contractAddress: string | undefined, args?: Record) => [ - { - ...marsParamsQueryKeys.address(contractAddress)[0], - method: 'all_vault_configs_v2', - args, - }, + { ...marsParamsQueryKeys.address(contractAddress)[0], method: 'all_vault_configs_v2', args }, ] as const, targetHealthFactor: (contractAddress: string | undefined, args?: Record) => [ - { - ...marsParamsQueryKeys.address(contractAddress)[0], - method: 'target_health_factor', - args, - }, + { ...marsParamsQueryKeys.address(contractAddress)[0], method: 'target_health_factor', args }, ] as const, totalDeposit: (contractAddress: string | undefined, args?: Record) => [ - { - ...marsParamsQueryKeys.address(contractAddress)[0], - method: 'total_deposit', - args, - }, + { ...marsParamsQueryKeys.address(contractAddress)[0], method: 'total_deposit', args }, ] as const, allTotalDepositsV2: (contractAddress: string | undefined, args?: Record) => [ - { - ...marsParamsQueryKeys.address(contractAddress)[0], - method: 'all_total_deposits_v2', - args, - }, + { ...marsParamsQueryKeys.address(contractAddress)[0], method: 'all_total_deposits_v2', args }, ] as const, } export interface MarsParamsReactQuery { @@ -167,10 +114,7 @@ export function useMarsParamsAllTotalDepositsV2Query< startAfter: args.startAfter, }) : Promise.reject(new Error('Invalid client')), - { - ...options, - enabled: !!client && (options?.enabled != undefined ? options.enabled : true), - }, + { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }, ) } export interface MarsParamsTotalDepositQuery @@ -192,10 +136,7 @@ export function useMarsParamsTotalDepositQuery({ denom: args.denom, }) : Promise.reject(new Error('Invalid client')), - { - ...options, - enabled: !!client && (options?.enabled != undefined ? options.enabled : true), - }, + { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }, ) } export interface MarsParamsTargetHealthFactorQuery @@ -207,10 +148,7 @@ export function useMarsParamsTargetHealthFactorQuery({ return useQuery( marsParamsQueryKeys.targetHealthFactor(client?.contractAddress), () => (client ? client.targetHealthFactor() : Promise.reject(new Error('Invalid client'))), - { - ...options, - enabled: !!client && (options?.enabled != undefined ? options.enabled : true), - }, + { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }, ) } export interface MarsParamsAllVaultConfigsV2Query @@ -232,10 +170,7 @@ export function useMarsParamsAllVaultConfigsV2Query< startAfter: args.startAfter, }) : Promise.reject(new Error('Invalid client')), - { - ...options, - enabled: !!client && (options?.enabled != undefined ? options.enabled : true), - }, + { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }, ) } export interface MarsParamsAllVaultConfigsQuery @@ -259,10 +194,7 @@ export function useMarsParamsAllVaultConfigsQuery @@ -284,10 +216,7 @@ export function useMarsParamsVaultConfigQuery({ address: args.address, }) : Promise.reject(new Error('Invalid client')), - { - ...options, - enabled: !!client && (options?.enabled != undefined ? options.enabled : true), - }, + { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }, ) } export interface MarsParamsAllAssetParamsQuery @@ -311,10 +240,7 @@ export function useMarsParamsAllAssetParamsQuery @@ -336,10 +262,7 @@ export function useMarsParamsAssetParamsQuery extends MarsParamsReactQuery {} @@ -350,10 +273,7 @@ export function useMarsParamsConfigQuery({ return useQuery( marsParamsQueryKeys.config(client?.contractAddress), () => (client ? client.config() : Promise.reject(new Error('Invalid client'))), - { - ...options, - enabled: !!client && (options?.enabled != undefined ? options.enabled : true), - }, + { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }, ) } export interface MarsParamsOwnerQuery extends MarsParamsReactQuery {} @@ -364,10 +284,7 @@ export function useMarsParamsOwnerQuery({ return useQuery( marsParamsQueryKeys.owner(client?.contractAddress), () => (client ? client.owner() : Promise.reject(new Error('Invalid client'))), - { - ...options, - enabled: !!client && (options?.enabled != undefined ? options.enabled : true), - }, + { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }, ) } export interface MarsParamsEmergencyUpdateMutation { diff --git a/scripts/types/generated/mars-params/MarsParams.types.ts b/scripts/types/generated/mars-params/MarsParams.types.ts index c274a4f7..529ef565 100644 --- a/scripts/types/generated/mars-params/MarsParams.types.ts +++ b/scripts/types/generated/mars-params/MarsParams.types.ts @@ -1,6 +1,6 @@ // @ts-nocheck /** - * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. + * This file was automatically generated by @cosmwasm/ts-codegen@0.35.3. * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ diff --git a/scripts/types/generated/mars-params/bundle.ts b/scripts/types/generated/mars-params/bundle.ts index 595e7ecd..66f5f4a3 100644 --- a/scripts/types/generated/mars-params/bundle.ts +++ b/scripts/types/generated/mars-params/bundle.ts @@ -1,6 +1,6 @@ // @ts-nocheck /** - * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. + * This file was automatically generated by @cosmwasm/ts-codegen@0.35.3. * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ @@ -9,9 +9,5 @@ import * as _21 from './MarsParams.types' import * as _22 from './MarsParams.client' import * as _23 from './MarsParams.react-query' export namespace contracts { - export const MarsParams = { - ..._21, - ..._22, - ..._23, - } + export const MarsParams = { ..._21, ..._22, ..._23 } } diff --git a/scripts/types/generated/mars-red-bank/MarsRedBank.client.ts b/scripts/types/generated/mars-red-bank/MarsRedBank.client.ts index 8aa61f4b..10300bd5 100644 --- a/scripts/types/generated/mars-red-bank/MarsRedBank.client.ts +++ b/scripts/types/generated/mars-red-bank/MarsRedBank.client.ts @@ -1,6 +1,6 @@ // @ts-nocheck /** - * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. + * This file was automatically generated by @cosmwasm/ts-codegen@0.35.3. * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ @@ -126,6 +126,7 @@ export interface MarsRedBankReadOnlyInterface { export class MarsRedBankQueryClient implements MarsRedBankReadOnlyInterface { client: CosmWasmClient contractAddress: string + constructor(client: CosmWasmClient, contractAddress: string) { this.client = client this.contractAddress = contractAddress @@ -146,6 +147,7 @@ export class MarsRedBankQueryClient implements MarsRedBankReadOnlyInterface { this.underlyingLiquidityAmount = this.underlyingLiquidityAmount.bind(this) this.underlyingDebtAmount = this.underlyingDebtAmount.bind(this) } + config = async (): Promise => { return this.client.queryContractSmart(this.contractAddress, { config: {}, @@ -500,6 +502,7 @@ export class MarsRedBankClient extends MarsRedBankQueryClient implements MarsRed client: SigningCosmWasmClient sender: string contractAddress: string + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { super(client, contractAddress) this.client = client @@ -517,6 +520,7 @@ export class MarsRedBankClient extends MarsRedBankQueryClient implements MarsRed this.updateAssetCollateralStatus = this.updateAssetCollateralStatus.bind(this) this.migrate = this.migrate.bind(this) } + updateOwner = async ( ownerUpdate: OwnerUpdate, fee: number | StdFee | 'auto' = 'auto', diff --git a/scripts/types/generated/mars-red-bank/MarsRedBank.react-query.ts b/scripts/types/generated/mars-red-bank/MarsRedBank.react-query.ts index 7f848782..ed3631f2 100644 --- a/scripts/types/generated/mars-red-bank/MarsRedBank.react-query.ts +++ b/scripts/types/generated/mars-red-bank/MarsRedBank.react-query.ts @@ -1,6 +1,6 @@ // @ts-nocheck /** - * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. + * This file was automatically generated by @cosmwasm/ts-codegen@0.35.3. * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ @@ -41,99 +41,36 @@ export const marsRedBankQueryKeys = { }, ] as const, address: (contractAddress: string | undefined) => - [ - { - ...marsRedBankQueryKeys.contract[0], - address: contractAddress, - }, - ] as const, + [{ ...marsRedBankQueryKeys.contract[0], address: contractAddress }] as const, config: (contractAddress: string | undefined, args?: Record) => - [ - { - ...marsRedBankQueryKeys.address(contractAddress)[0], - method: 'config', - args, - }, - ] as const, + [{ ...marsRedBankQueryKeys.address(contractAddress)[0], method: 'config', args }] as const, market: (contractAddress: string | undefined, args?: Record) => - [ - { - ...marsRedBankQueryKeys.address(contractAddress)[0], - method: 'market', - args, - }, - ] as const, + [{ ...marsRedBankQueryKeys.address(contractAddress)[0], method: 'market', args }] as const, marketV2: (contractAddress: string | undefined, args?: Record) => - [ - { - ...marsRedBankQueryKeys.address(contractAddress)[0], - method: 'market_v2', - args, - }, - ] as const, + [{ ...marsRedBankQueryKeys.address(contractAddress)[0], method: 'market_v2', args }] as const, markets: (contractAddress: string | undefined, args?: Record) => - [ - { - ...marsRedBankQueryKeys.address(contractAddress)[0], - method: 'markets', - args, - }, - ] as const, + [{ ...marsRedBankQueryKeys.address(contractAddress)[0], method: 'markets', args }] as const, marketsV2: (contractAddress: string | undefined, args?: Record) => - [ - { - ...marsRedBankQueryKeys.address(contractAddress)[0], - method: 'markets_v2', - args, - }, - ] as const, + [{ ...marsRedBankQueryKeys.address(contractAddress)[0], method: 'markets_v2', args }] as const, userDebt: (contractAddress: string | undefined, args?: Record) => - [ - { - ...marsRedBankQueryKeys.address(contractAddress)[0], - method: 'user_debt', - args, - }, - ] as const, + [{ ...marsRedBankQueryKeys.address(contractAddress)[0], method: 'user_debt', args }] as const, userDebts: (contractAddress: string | undefined, args?: Record) => - [ - { - ...marsRedBankQueryKeys.address(contractAddress)[0], - method: 'user_debts', - args, - }, - ] as const, + [{ ...marsRedBankQueryKeys.address(contractAddress)[0], method: 'user_debts', args }] as const, userCollateral: (contractAddress: string | undefined, args?: Record) => [ - { - ...marsRedBankQueryKeys.address(contractAddress)[0], - method: 'user_collateral', - args, - }, + { ...marsRedBankQueryKeys.address(contractAddress)[0], method: 'user_collateral', args }, ] as const, userCollaterals: (contractAddress: string | undefined, args?: Record) => [ - { - ...marsRedBankQueryKeys.address(contractAddress)[0], - method: 'user_collaterals', - args, - }, + { ...marsRedBankQueryKeys.address(contractAddress)[0], method: 'user_collaterals', args }, ] as const, userCollateralsV2: (contractAddress: string | undefined, args?: Record) => [ - { - ...marsRedBankQueryKeys.address(contractAddress)[0], - method: 'user_collaterals_v2', - args, - }, + { ...marsRedBankQueryKeys.address(contractAddress)[0], method: 'user_collaterals_v2', args }, ] as const, userPosition: (contractAddress: string | undefined, args?: Record) => [ - { - ...marsRedBankQueryKeys.address(contractAddress)[0], - method: 'user_position', - args, - }, + { ...marsRedBankQueryKeys.address(contractAddress)[0], method: 'user_position', args }, ] as const, userPositionLiquidationPricing: ( contractAddress: string | undefined, @@ -156,11 +93,7 @@ export const marsRedBankQueryKeys = { ] as const, scaledDebtAmount: (contractAddress: string | undefined, args?: Record) => [ - { - ...marsRedBankQueryKeys.address(contractAddress)[0], - method: 'scaled_debt_amount', - args, - }, + { ...marsRedBankQueryKeys.address(contractAddress)[0], method: 'scaled_debt_amount', args }, ] as const, underlyingLiquidityAmount: ( contractAddress: string | undefined, @@ -212,10 +145,7 @@ export function useMarsRedBankUnderlyingDebtAmountQuery({ denom: args.denom, }) : Promise.reject(new Error('Invalid client')), - { - ...options, - enabled: !!client && (options?.enabled != undefined ? options.enabled : true), - }, + { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }, ) } export interface MarsRedBankUnderlyingLiquidityAmountQuery @@ -239,10 +169,7 @@ export function useMarsRedBankUnderlyingLiquidityAmountQuery({ denom: args.denom, }) : Promise.reject(new Error('Invalid client')), - { - ...options, - enabled: !!client && (options?.enabled != undefined ? options.enabled : true), - }, + { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }, ) } export interface MarsRedBankScaledDebtAmountQuery @@ -266,10 +193,7 @@ export function useMarsRedBankScaledDebtAmountQuery({ denom: args.denom, }) : Promise.reject(new Error('Invalid client')), - { - ...options, - enabled: !!client && (options?.enabled != undefined ? options.enabled : true), - }, + { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }, ) } export interface MarsRedBankScaledLiquidityAmountQuery @@ -293,10 +217,7 @@ export function useMarsRedBankScaledLiquidityAmountQuery({ denom: args.denom, }) : Promise.reject(new Error('Invalid client')), - { - ...options, - enabled: !!client && (options?.enabled != undefined ? options.enabled : true), - }, + { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }, ) } export interface MarsRedBankUserPositionLiquidationPricingQuery @@ -320,10 +241,7 @@ export function useMarsRedBankUserPositionLiquidationPricingQuery @@ -347,10 +265,7 @@ export function useMarsRedBankUserPositionQuery({ user: args.user, }) : Promise.reject(new Error('Invalid client')), - { - ...options, - enabled: !!client && (options?.enabled != undefined ? options.enabled : true), - }, + { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }, ) } export interface MarsRedBankUserCollateralsV2Query @@ -376,10 +291,7 @@ export function useMarsRedBankUserCollateralsV2Query< user: args.user, }) : Promise.reject(new Error('Invalid client')), - { - ...options, - enabled: !!client && (options?.enabled != undefined ? options.enabled : true), - }, + { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }, ) } export interface MarsRedBankUserCollateralsQuery @@ -407,10 +319,7 @@ export function useMarsRedBankUserCollateralsQuery @@ -436,10 +345,7 @@ export function useMarsRedBankUserCollateralQuery @@ -465,10 +371,7 @@ export function useMarsRedBankUserDebtsQuery({ user: args.user, }) : Promise.reject(new Error('Invalid client')), - { - ...options, - enabled: !!client && (options?.enabled != undefined ? options.enabled : true), - }, + { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }, ) } export interface MarsRedBankUserDebtQuery @@ -492,10 +395,7 @@ export function useMarsRedBankUserDebtQuery({ user: args.user, }) : Promise.reject(new Error('Invalid client')), - { - ...options, - enabled: !!client && (options?.enabled != undefined ? options.enabled : true), - }, + { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }, ) } export interface MarsRedBankMarketsV2Query @@ -519,10 +419,7 @@ export function useMarsRedBankMarketsV2Query @@ -546,10 +443,7 @@ export function useMarsRedBankMarketsQuery({ startAfter: args.startAfter, }) : Promise.reject(new Error('Invalid client')), - { - ...options, - enabled: !!client && (options?.enabled != undefined ? options.enabled : true), - }, + { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }, ) } export interface MarsRedBankMarketV2Query @@ -571,10 +465,7 @@ export function useMarsRedBankMarketV2Query({ denom: args.denom, }) : Promise.reject(new Error('Invalid client')), - { - ...options, - enabled: !!client && (options?.enabled != undefined ? options.enabled : true), - }, + { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }, ) } export interface MarsRedBankMarketQuery extends MarsRedBankReactQuery { @@ -595,10 +486,7 @@ export function useMarsRedBankMarketQuery({ denom: args.denom, }) : Promise.reject(new Error('Invalid client')), - { - ...options, - enabled: !!client && (options?.enabled != undefined ? options.enabled : true), - }, + { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }, ) } export interface MarsRedBankConfigQuery @@ -610,10 +498,7 @@ export function useMarsRedBankConfigQuery({ return useQuery( marsRedBankQueryKeys.config(client?.contractAddress), () => (client ? client.config() : Promise.reject(new Error('Invalid client'))), - { - ...options, - enabled: !!client && (options?.enabled != undefined ? options.enabled : true), - }, + { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }, ) } export interface MarsRedBankMigrateMutation { diff --git a/scripts/types/generated/mars-red-bank/MarsRedBank.types.ts b/scripts/types/generated/mars-red-bank/MarsRedBank.types.ts index bd54d453..31ae935e 100644 --- a/scripts/types/generated/mars-red-bank/MarsRedBank.types.ts +++ b/scripts/types/generated/mars-red-bank/MarsRedBank.types.ts @@ -1,6 +1,6 @@ // @ts-nocheck /** - * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. + * This file was automatically generated by @cosmwasm/ts-codegen@0.35.3. * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ diff --git a/scripts/types/generated/mars-red-bank/bundle.ts b/scripts/types/generated/mars-red-bank/bundle.ts index 706a30f9..6eed8763 100644 --- a/scripts/types/generated/mars-red-bank/bundle.ts +++ b/scripts/types/generated/mars-red-bank/bundle.ts @@ -1,6 +1,6 @@ // @ts-nocheck /** - * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. + * This file was automatically generated by @cosmwasm/ts-codegen@0.35.3. * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ @@ -9,9 +9,5 @@ import * as _24 from './MarsRedBank.types' import * as _25 from './MarsRedBank.client' import * as _26 from './MarsRedBank.react-query' export namespace contracts { - export const MarsRedBank = { - ..._24, - ..._25, - ..._26, - } + export const MarsRedBank = { ..._24, ..._25, ..._26 } } diff --git a/scripts/types/generated/mars-rewards-collector-base/MarsRewardsCollectorBase.client.ts b/scripts/types/generated/mars-rewards-collector-base/MarsRewardsCollectorBase.client.ts index 0c4d5c3f..2d05d8c9 100644 --- a/scripts/types/generated/mars-rewards-collector-base/MarsRewardsCollectorBase.client.ts +++ b/scripts/types/generated/mars-rewards-collector-base/MarsRewardsCollectorBase.client.ts @@ -1,6 +1,6 @@ // @ts-nocheck /** - * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. + * This file was automatically generated by @cosmwasm/ts-codegen@0.35.3. * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ @@ -39,11 +39,13 @@ export class MarsRewardsCollectorBaseQueryClient { client: CosmWasmClient contractAddress: string + constructor(client: CosmWasmClient, contractAddress: string) { this.client = client this.contractAddress = contractAddress this.config = this.config.bind(this) } + config = async (): Promise => { return this.client.queryContractSmart(this.contractAddress, { config: {}, @@ -144,6 +146,7 @@ export class MarsRewardsCollectorBaseClient client: SigningCosmWasmClient sender: string contractAddress: string + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { super(client, contractAddress) this.client = client @@ -157,6 +160,7 @@ export class MarsRewardsCollectorBaseClient this.swapAsset = this.swapAsset.bind(this) this.claimIncentiveRewards = this.claimIncentiveRewards.bind(this) } + updateOwner = async ( ownerUpdate: OwnerUpdate, fee: number | StdFee | 'auto' = 'auto', diff --git a/scripts/types/generated/mars-rewards-collector-base/MarsRewardsCollectorBase.react-query.ts b/scripts/types/generated/mars-rewards-collector-base/MarsRewardsCollectorBase.react-query.ts index 08e66795..de5be0cf 100644 --- a/scripts/types/generated/mars-rewards-collector-base/MarsRewardsCollectorBase.react-query.ts +++ b/scripts/types/generated/mars-rewards-collector-base/MarsRewardsCollectorBase.react-query.ts @@ -1,6 +1,6 @@ // @ts-nocheck /** - * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. + * This file was automatically generated by @cosmwasm/ts-codegen@0.35.3. * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ @@ -42,19 +42,10 @@ export const marsRewardsCollectorBaseQueryKeys = { }, ] as const, address: (contractAddress: string | undefined) => - [ - { - ...marsRewardsCollectorBaseQueryKeys.contract[0], - address: contractAddress, - }, - ] as const, + [{ ...marsRewardsCollectorBaseQueryKeys.contract[0], address: contractAddress }] as const, config: (contractAddress: string | undefined, args?: Record) => [ - { - ...marsRewardsCollectorBaseQueryKeys.address(contractAddress)[0], - method: 'config', - args, - }, + { ...marsRewardsCollectorBaseQueryKeys.address(contractAddress)[0], method: 'config', args }, ] as const, } export interface MarsRewardsCollectorBaseReactQuery { @@ -75,10 +66,7 @@ export function useMarsRewardsCollectorBaseConfigQuery({ return useQuery( marsRewardsCollectorBaseQueryKeys.config(client?.contractAddress), () => (client ? client.config() : Promise.reject(new Error('Invalid client'))), - { - ...options, - enabled: !!client && (options?.enabled != undefined ? options.enabled : true), - }, + { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }, ) } export interface MarsRewardsCollectorBaseClaimIncentiveRewardsMutation { diff --git a/scripts/types/generated/mars-rewards-collector-base/MarsRewardsCollectorBase.types.ts b/scripts/types/generated/mars-rewards-collector-base/MarsRewardsCollectorBase.types.ts index eddc861d..66710628 100644 --- a/scripts/types/generated/mars-rewards-collector-base/MarsRewardsCollectorBase.types.ts +++ b/scripts/types/generated/mars-rewards-collector-base/MarsRewardsCollectorBase.types.ts @@ -1,6 +1,6 @@ // @ts-nocheck /** - * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. + * This file was automatically generated by @cosmwasm/ts-codegen@0.35.3. * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ @@ -168,6 +168,21 @@ export type Action = slippage: Decimal } } + | { + stake_astro_lp: { + lp_token: ActionCoin + } + } + | { + unstake_astro_lp: { + lp_token: ActionCoin + } + } + | { + claim_astro_lp_rewards: { + lp_denom: string + } + } | { refund_all_coin_balances: {} } diff --git a/scripts/types/generated/mars-rewards-collector-base/bundle.ts b/scripts/types/generated/mars-rewards-collector-base/bundle.ts index dea007b4..cb483255 100644 --- a/scripts/types/generated/mars-rewards-collector-base/bundle.ts +++ b/scripts/types/generated/mars-rewards-collector-base/bundle.ts @@ -1,6 +1,6 @@ // @ts-nocheck /** - * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. + * This file was automatically generated by @cosmwasm/ts-codegen@0.35.3. * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ @@ -9,9 +9,5 @@ import * as _27 from './MarsRewardsCollectorBase.types' import * as _28 from './MarsRewardsCollectorBase.client' import * as _29 from './MarsRewardsCollectorBase.react-query' export namespace contracts { - export const MarsRewardsCollectorBase = { - ..._27, - ..._28, - ..._29, - } + export const MarsRewardsCollectorBase = { ..._27, ..._28, ..._29 } } diff --git a/scripts/types/generated/mars-rover-health-computer/MarsRoverHealthComputer.client.ts b/scripts/types/generated/mars-rover-health-computer/MarsRoverHealthComputer.client.ts index d7a0ed68..7489b612 100644 --- a/scripts/types/generated/mars-rover-health-computer/MarsRoverHealthComputer.client.ts +++ b/scripts/types/generated/mars-rover-health-computer/MarsRoverHealthComputer.client.ts @@ -1,6 +1,6 @@ // @ts-nocheck /** - * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. + * This file was automatically generated by @cosmwasm/ts-codegen@0.35.3. * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ diff --git a/scripts/types/generated/mars-rover-health-computer/MarsRoverHealthComputer.react-query.ts b/scripts/types/generated/mars-rover-health-computer/MarsRoverHealthComputer.react-query.ts index dea04321..b89502a5 100644 --- a/scripts/types/generated/mars-rover-health-computer/MarsRoverHealthComputer.react-query.ts +++ b/scripts/types/generated/mars-rover-health-computer/MarsRoverHealthComputer.react-query.ts @@ -1,6 +1,6 @@ // @ts-nocheck /** - * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. + * This file was automatically generated by @cosmwasm/ts-codegen@0.35.3. * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ diff --git a/scripts/types/generated/mars-rover-health-computer/MarsRoverHealthComputer.types.ts b/scripts/types/generated/mars-rover-health-computer/MarsRoverHealthComputer.types.ts index cd1c1ba5..5e6e0825 100644 --- a/scripts/types/generated/mars-rover-health-computer/MarsRoverHealthComputer.types.ts +++ b/scripts/types/generated/mars-rover-health-computer/MarsRoverHealthComputer.types.ts @@ -1,6 +1,6 @@ // @ts-nocheck /** - * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. + * This file was automatically generated by @cosmwasm/ts-codegen@0.35.3. * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ @@ -85,6 +85,7 @@ export interface Positions { debts: DebtAmount[] deposits: Coin[] lends: Coin[] + staked_lp: Coin[] vaults: VaultPosition[] } export interface DebtAmount { diff --git a/scripts/types/generated/mars-rover-health-computer/bundle.ts b/scripts/types/generated/mars-rover-health-computer/bundle.ts index 9bf5785e..27b5d1eb 100644 --- a/scripts/types/generated/mars-rover-health-computer/bundle.ts +++ b/scripts/types/generated/mars-rover-health-computer/bundle.ts @@ -1,6 +1,6 @@ // @ts-nocheck /** - * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. + * This file was automatically generated by @cosmwasm/ts-codegen@0.35.3. * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ @@ -9,9 +9,5 @@ import * as _33 from './MarsRoverHealthComputer.types' import * as _34 from './MarsRoverHealthComputer.client' import * as _35 from './MarsRoverHealthComputer.react-query' export namespace contracts { - export const MarsRoverHealthComputer = { - ..._33, - ..._34, - ..._35, - } + export const MarsRoverHealthComputer = { ..._33, ..._34, ..._35 } } diff --git a/scripts/types/generated/mars-rover-health/MarsRoverHealth.client.ts b/scripts/types/generated/mars-rover-health/MarsRoverHealth.client.ts index 1568d5df..8b863418 100644 --- a/scripts/types/generated/mars-rover-health/MarsRoverHealth.client.ts +++ b/scripts/types/generated/mars-rover-health/MarsRoverHealth.client.ts @@ -1,6 +1,6 @@ // @ts-nocheck /** - * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. + * This file was automatically generated by @cosmwasm/ts-codegen@0.35.3. * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ @@ -46,6 +46,7 @@ export interface MarsRoverHealthReadOnlyInterface { export class MarsRoverHealthQueryClient implements MarsRoverHealthReadOnlyInterface { client: CosmWasmClient contractAddress: string + constructor(client: CosmWasmClient, contractAddress: string) { this.client = client this.contractAddress = contractAddress @@ -53,6 +54,7 @@ export class MarsRoverHealthQueryClient implements MarsRoverHealthReadOnlyInterf this.healthState = this.healthState.bind(this) this.config = this.config.bind(this) } + healthValues = async ({ accountId, action, @@ -120,6 +122,7 @@ export class MarsRoverHealthClient client: SigningCosmWasmClient sender: string contractAddress: string + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { super(client, contractAddress) this.client = client @@ -128,6 +131,7 @@ export class MarsRoverHealthClient this.updateOwner = this.updateOwner.bind(this) this.updateConfig = this.updateConfig.bind(this) } + updateOwner = async ( ownerUpdate: OwnerUpdate, fee: number | StdFee | 'auto' = 'auto', diff --git a/scripts/types/generated/mars-rover-health/MarsRoverHealth.react-query.ts b/scripts/types/generated/mars-rover-health/MarsRoverHealth.react-query.ts index 7557fd9f..6da6d48a 100644 --- a/scripts/types/generated/mars-rover-health/MarsRoverHealth.react-query.ts +++ b/scripts/types/generated/mars-rover-health/MarsRoverHealth.react-query.ts @@ -1,6 +1,6 @@ // @ts-nocheck /** - * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. + * This file was automatically generated by @cosmwasm/ts-codegen@0.35.3. * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ @@ -30,36 +30,17 @@ export const marsRoverHealthQueryKeys = { }, ] as const, address: (contractAddress: string | undefined) => - [ - { - ...marsRoverHealthQueryKeys.contract[0], - address: contractAddress, - }, - ] as const, + [{ ...marsRoverHealthQueryKeys.contract[0], address: contractAddress }] as const, healthValues: (contractAddress: string | undefined, args?: Record) => [ - { - ...marsRoverHealthQueryKeys.address(contractAddress)[0], - method: 'health_values', - args, - }, + { ...marsRoverHealthQueryKeys.address(contractAddress)[0], method: 'health_values', args }, ] as const, healthState: (contractAddress: string | undefined, args?: Record) => [ - { - ...marsRoverHealthQueryKeys.address(contractAddress)[0], - method: 'health_state', - args, - }, + { ...marsRoverHealthQueryKeys.address(contractAddress)[0], method: 'health_state', args }, ] as const, config: (contractAddress: string | undefined, args?: Record) => - [ - { - ...marsRoverHealthQueryKeys.address(contractAddress)[0], - method: 'config', - args, - }, - ] as const, + [{ ...marsRoverHealthQueryKeys.address(contractAddress)[0], method: 'config', args }] as const, } export interface MarsRoverHealthReactQuery { client: MarsRoverHealthQueryClient | undefined @@ -79,10 +60,7 @@ export function useMarsRoverHealthConfigQuery({ return useQuery( marsRoverHealthQueryKeys.config(client?.contractAddress), () => (client ? client.config() : Promise.reject(new Error('Invalid client'))), - { - ...options, - enabled: !!client && (options?.enabled != undefined ? options.enabled : true), - }, + { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }, ) } export interface MarsRoverHealthHealthStateQuery @@ -108,10 +86,7 @@ export function useMarsRoverHealthHealthStateQuery({ kind: args.kind, }) : Promise.reject(new Error('Invalid client')), - { - ...options, - enabled: !!client && (options?.enabled != undefined ? options.enabled : true), - }, + { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }, ) } export interface MarsRoverHealthHealthValuesQuery @@ -137,10 +112,7 @@ export function useMarsRoverHealthHealthValuesQuery => { return this.client.queryContractSmart(this.contractAddress, { owner: {}, @@ -198,6 +200,7 @@ export class MarsSwapperAstroportClient client: SigningCosmWasmClient sender: string contractAddress: string + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { super(client, contractAddress) this.client = client @@ -209,6 +212,7 @@ export class MarsSwapperAstroportClient this.transferResult = this.transferResult.bind(this) this.updateConfig = this.updateConfig.bind(this) } + updateOwner = async ( ownerUpdate: OwnerUpdate, fee: number | StdFee | 'auto' = 'auto', diff --git a/scripts/types/generated/mars-swapper-astroport/MarsSwapperAstroport.react-query.ts b/scripts/types/generated/mars-swapper-astroport/MarsSwapperAstroport.react-query.ts index 87e4d330..8dbd0082 100644 --- a/scripts/types/generated/mars-swapper-astroport/MarsSwapperAstroport.react-query.ts +++ b/scripts/types/generated/mars-swapper-astroport/MarsSwapperAstroport.react-query.ts @@ -1,6 +1,6 @@ // @ts-nocheck /** - * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. + * This file was automatically generated by @cosmwasm/ts-codegen@0.35.3. * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ @@ -43,35 +43,18 @@ export const marsSwapperAstroportQueryKeys = { }, ] as const, address: (contractAddress: string | undefined) => - [ - { - ...marsSwapperAstroportQueryKeys.contract[0], - address: contractAddress, - }, - ] as const, + [{ ...marsSwapperAstroportQueryKeys.contract[0], address: contractAddress }] as const, owner: (contractAddress: string | undefined, args?: Record) => [ - { - ...marsSwapperAstroportQueryKeys.address(contractAddress)[0], - method: 'owner', - args, - }, + { ...marsSwapperAstroportQueryKeys.address(contractAddress)[0], method: 'owner', args }, ] as const, route: (contractAddress: string | undefined, args?: Record) => [ - { - ...marsSwapperAstroportQueryKeys.address(contractAddress)[0], - method: 'route', - args, - }, + { ...marsSwapperAstroportQueryKeys.address(contractAddress)[0], method: 'route', args }, ] as const, routes: (contractAddress: string | undefined, args?: Record) => [ - { - ...marsSwapperAstroportQueryKeys.address(contractAddress)[0], - method: 'routes', - args, - }, + { ...marsSwapperAstroportQueryKeys.address(contractAddress)[0], method: 'routes', args }, ] as const, estimateExactInSwap: (contractAddress: string | undefined, args?: Record) => [ @@ -83,11 +66,7 @@ export const marsSwapperAstroportQueryKeys = { ] as const, config: (contractAddress: string | undefined, args?: Record) => [ - { - ...marsSwapperAstroportQueryKeys.address(contractAddress)[0], - method: 'config', - args, - }, + { ...marsSwapperAstroportQueryKeys.address(contractAddress)[0], method: 'config', args }, ] as const, } export interface MarsSwapperAstroportReactQuery { @@ -108,10 +87,7 @@ export function useMarsSwapperAstroportConfigQuery({ return useQuery( marsSwapperAstroportQueryKeys.config(client?.contractAddress), () => (client ? client.config() : Promise.reject(new Error('Invalid client'))), - { - ...options, - enabled: !!client && (options?.enabled != undefined ? options.enabled : true), - }, + { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }, ) } export interface MarsSwapperAstroportEstimateExactInSwapQuery @@ -135,10 +111,7 @@ export function useMarsSwapperAstroportEstimateExactInSwapQuery< route: args.route, }) : Promise.reject(new Error('Invalid client')), - { - ...options, - enabled: !!client && (options?.enabled != undefined ? options.enabled : true), - }, + { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }, ) } export interface MarsSwapperAstroportRoutesQuery @@ -162,10 +135,7 @@ export function useMarsSwapperAstroportRoutesQuery @@ -189,10 +159,7 @@ export function useMarsSwapperAstroportRouteQuery denomOut: args.denomOut, }) : Promise.reject(new Error('Invalid client')), - { - ...options, - enabled: !!client && (options?.enabled != undefined ? options.enabled : true), - }, + { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }, ) } export interface MarsSwapperAstroportOwnerQuery @@ -204,10 +171,7 @@ export function useMarsSwapperAstroportOwnerQuery({ return useQuery( marsSwapperAstroportQueryKeys.owner(client?.contractAddress), () => (client ? client.owner() : Promise.reject(new Error('Invalid client'))), - { - ...options, - enabled: !!client && (options?.enabled != undefined ? options.enabled : true), - }, + { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }, ) } export interface MarsSwapperAstroportUpdateConfigMutation { diff --git a/scripts/types/generated/mars-swapper-astroport/MarsSwapperAstroport.types.ts b/scripts/types/generated/mars-swapper-astroport/MarsSwapperAstroport.types.ts index 92909899..d2e1faa2 100644 --- a/scripts/types/generated/mars-swapper-astroport/MarsSwapperAstroport.types.ts +++ b/scripts/types/generated/mars-swapper-astroport/MarsSwapperAstroport.types.ts @@ -1,6 +1,6 @@ // @ts-nocheck /** - * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. + * This file was automatically generated by @cosmwasm/ts-codegen@0.35.3. * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ diff --git a/scripts/types/generated/mars-swapper-astroport/bundle.ts b/scripts/types/generated/mars-swapper-astroport/bundle.ts index 79f61688..05c745c1 100644 --- a/scripts/types/generated/mars-swapper-astroport/bundle.ts +++ b/scripts/types/generated/mars-swapper-astroport/bundle.ts @@ -1,6 +1,6 @@ // @ts-nocheck /** - * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. + * This file was automatically generated by @cosmwasm/ts-codegen@0.35.3. * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ @@ -9,9 +9,5 @@ import * as _36 from './MarsSwapperAstroport.types' import * as _37 from './MarsSwapperAstroport.client' import * as _38 from './MarsSwapperAstroport.react-query' export namespace contracts { - export const MarsSwapperAstroport = { - ..._36, - ..._37, - ..._38, - } + export const MarsSwapperAstroport = { ..._36, ..._37, ..._38 } } diff --git a/scripts/types/generated/mars-swapper-base/MarsSwapperBase.client.ts b/scripts/types/generated/mars-swapper-base/MarsSwapperBase.client.ts index 820f369c..7ec62c05 100644 --- a/scripts/types/generated/mars-swapper-base/MarsSwapperBase.client.ts +++ b/scripts/types/generated/mars-swapper-base/MarsSwapperBase.client.ts @@ -1,6 +1,6 @@ // @ts-nocheck /** - * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. + * This file was automatically generated by @cosmwasm/ts-codegen@0.35.3. * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ @@ -58,6 +58,7 @@ export interface MarsSwapperBaseReadOnlyInterface { export class MarsSwapperBaseQueryClient implements MarsSwapperBaseReadOnlyInterface { client: CosmWasmClient contractAddress: string + constructor(client: CosmWasmClient, contractAddress: string) { this.client = client this.contractAddress = contractAddress @@ -67,6 +68,7 @@ export class MarsSwapperBaseQueryClient implements MarsSwapperBaseReadOnlyInterf this.estimateExactInSwap = this.estimateExactInSwap.bind(this) this.config = this.config.bind(this) } + owner = async (): Promise => { return this.client.queryContractSmart(this.contractAddress, { owner: {}, @@ -194,6 +196,7 @@ export class MarsSwapperBaseClient client: SigningCosmWasmClient sender: string contractAddress: string + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { super(client, contractAddress) this.client = client @@ -205,6 +208,7 @@ export class MarsSwapperBaseClient this.transferResult = this.transferResult.bind(this) this.updateConfig = this.updateConfig.bind(this) } + updateOwner = async ( ownerUpdate: OwnerUpdate, fee: number | StdFee | 'auto' = 'auto', diff --git a/scripts/types/generated/mars-swapper-base/MarsSwapperBase.react-query.ts b/scripts/types/generated/mars-swapper-base/MarsSwapperBase.react-query.ts index c711daa7..4daaa901 100644 --- a/scripts/types/generated/mars-swapper-base/MarsSwapperBase.react-query.ts +++ b/scripts/types/generated/mars-swapper-base/MarsSwapperBase.react-query.ts @@ -1,6 +1,6 @@ // @ts-nocheck /** - * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. + * This file was automatically generated by @cosmwasm/ts-codegen@0.35.3. * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ @@ -36,36 +36,13 @@ export const marsSwapperBaseQueryKeys = { }, ] as const, address: (contractAddress: string | undefined) => - [ - { - ...marsSwapperBaseQueryKeys.contract[0], - address: contractAddress, - }, - ] as const, + [{ ...marsSwapperBaseQueryKeys.contract[0], address: contractAddress }] as const, owner: (contractAddress: string | undefined, args?: Record) => - [ - { - ...marsSwapperBaseQueryKeys.address(contractAddress)[0], - method: 'owner', - args, - }, - ] as const, + [{ ...marsSwapperBaseQueryKeys.address(contractAddress)[0], method: 'owner', args }] as const, route: (contractAddress: string | undefined, args?: Record) => - [ - { - ...marsSwapperBaseQueryKeys.address(contractAddress)[0], - method: 'route', - args, - }, - ] as const, + [{ ...marsSwapperBaseQueryKeys.address(contractAddress)[0], method: 'route', args }] as const, routes: (contractAddress: string | undefined, args?: Record) => - [ - { - ...marsSwapperBaseQueryKeys.address(contractAddress)[0], - method: 'routes', - args, - }, - ] as const, + [{ ...marsSwapperBaseQueryKeys.address(contractAddress)[0], method: 'routes', args }] as const, estimateExactInSwap: (contractAddress: string | undefined, args?: Record) => [ { @@ -75,13 +52,7 @@ export const marsSwapperBaseQueryKeys = { }, ] as const, config: (contractAddress: string | undefined, args?: Record) => - [ - { - ...marsSwapperBaseQueryKeys.address(contractAddress)[0], - method: 'config', - args, - }, - ] as const, + [{ ...marsSwapperBaseQueryKeys.address(contractAddress)[0], method: 'config', args }] as const, } export interface MarsSwapperBaseReactQuery { client: MarsSwapperBaseQueryClient | undefined @@ -101,10 +72,7 @@ export function useMarsSwapperBaseConfigQuery({ return useQuery( marsSwapperBaseQueryKeys.config(client?.contractAddress), () => (client ? client.config() : Promise.reject(new Error('Invalid client'))), - { - ...options, - enabled: !!client && (options?.enabled != undefined ? options.enabled : true), - }, + { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }, ) } export interface MarsSwapperBaseEstimateExactInSwapQuery @@ -130,10 +98,7 @@ export function useMarsSwapperBaseEstimateExactInSwapQuery @@ -157,10 +122,7 @@ export function useMarsSwapperBaseRoutesQuery @@ -184,10 +146,7 @@ export function useMarsSwapperBaseRouteQuery({ denomOut: args.denomOut, }) : Promise.reject(new Error('Invalid client')), - { - ...options, - enabled: !!client && (options?.enabled != undefined ? options.enabled : true), - }, + { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }, ) } export interface MarsSwapperBaseOwnerQuery @@ -199,10 +158,7 @@ export function useMarsSwapperBaseOwnerQuery({ return useQuery( marsSwapperBaseQueryKeys.owner(client?.contractAddress), () => (client ? client.owner() : Promise.reject(new Error('Invalid client'))), - { - ...options, - enabled: !!client && (options?.enabled != undefined ? options.enabled : true), - }, + { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }, ) } export interface MarsSwapperBaseUpdateConfigMutation { diff --git a/scripts/types/generated/mars-swapper-base/MarsSwapperBase.types.ts b/scripts/types/generated/mars-swapper-base/MarsSwapperBase.types.ts index 17a006cf..8cd96168 100644 --- a/scripts/types/generated/mars-swapper-base/MarsSwapperBase.types.ts +++ b/scripts/types/generated/mars-swapper-base/MarsSwapperBase.types.ts @@ -1,6 +1,6 @@ // @ts-nocheck /** - * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. + * This file was automatically generated by @cosmwasm/ts-codegen@0.35.3. * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ diff --git a/scripts/types/generated/mars-swapper-base/bundle.ts b/scripts/types/generated/mars-swapper-base/bundle.ts index 95e00774..43ad2b7a 100644 --- a/scripts/types/generated/mars-swapper-base/bundle.ts +++ b/scripts/types/generated/mars-swapper-base/bundle.ts @@ -1,6 +1,6 @@ // @ts-nocheck /** - * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. + * This file was automatically generated by @cosmwasm/ts-codegen@0.35.3. * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ @@ -9,9 +9,5 @@ import * as _39 from './MarsSwapperBase.types' import * as _40 from './MarsSwapperBase.client' import * as _41 from './MarsSwapperBase.react-query' export namespace contracts { - export const MarsSwapperBase = { - ..._39, - ..._40, - ..._41, - } + export const MarsSwapperBase = { ..._39, ..._40, ..._41 } } diff --git a/scripts/types/generated/mars-swapper-osmosis/MarsSwapperOsmosis.client.ts b/scripts/types/generated/mars-swapper-osmosis/MarsSwapperOsmosis.client.ts index f1bc80e8..1f5a07bf 100644 --- a/scripts/types/generated/mars-swapper-osmosis/MarsSwapperOsmosis.client.ts +++ b/scripts/types/generated/mars-swapper-osmosis/MarsSwapperOsmosis.client.ts @@ -1,6 +1,6 @@ // @ts-nocheck /** - * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. + * This file was automatically generated by @cosmwasm/ts-codegen@0.35.3. * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ @@ -61,6 +61,7 @@ export interface MarsSwapperOsmosisReadOnlyInterface { export class MarsSwapperOsmosisQueryClient implements MarsSwapperOsmosisReadOnlyInterface { client: CosmWasmClient contractAddress: string + constructor(client: CosmWasmClient, contractAddress: string) { this.client = client this.contractAddress = contractAddress @@ -70,6 +71,7 @@ export class MarsSwapperOsmosisQueryClient implements MarsSwapperOsmosisReadOnly this.estimateExactInSwap = this.estimateExactInSwap.bind(this) this.config = this.config.bind(this) } + owner = async (): Promise => { return this.client.queryContractSmart(this.contractAddress, { owner: {}, @@ -197,6 +199,7 @@ export class MarsSwapperOsmosisClient client: SigningCosmWasmClient sender: string contractAddress: string + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { super(client, contractAddress) this.client = client @@ -208,6 +211,7 @@ export class MarsSwapperOsmosisClient this.transferResult = this.transferResult.bind(this) this.updateConfig = this.updateConfig.bind(this) } + updateOwner = async ( ownerUpdate: OwnerUpdate, fee: number | StdFee | 'auto' = 'auto', diff --git a/scripts/types/generated/mars-swapper-osmosis/MarsSwapperOsmosis.react-query.ts b/scripts/types/generated/mars-swapper-osmosis/MarsSwapperOsmosis.react-query.ts index 025b339d..969c367d 100644 --- a/scripts/types/generated/mars-swapper-osmosis/MarsSwapperOsmosis.react-query.ts +++ b/scripts/types/generated/mars-swapper-osmosis/MarsSwapperOsmosis.react-query.ts @@ -1,6 +1,6 @@ // @ts-nocheck /** - * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. + * This file was automatically generated by @cosmwasm/ts-codegen@0.35.3. * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ @@ -42,35 +42,18 @@ export const marsSwapperOsmosisQueryKeys = { }, ] as const, address: (contractAddress: string | undefined) => - [ - { - ...marsSwapperOsmosisQueryKeys.contract[0], - address: contractAddress, - }, - ] as const, + [{ ...marsSwapperOsmosisQueryKeys.contract[0], address: contractAddress }] as const, owner: (contractAddress: string | undefined, args?: Record) => [ - { - ...marsSwapperOsmosisQueryKeys.address(contractAddress)[0], - method: 'owner', - args, - }, + { ...marsSwapperOsmosisQueryKeys.address(contractAddress)[0], method: 'owner', args }, ] as const, route: (contractAddress: string | undefined, args?: Record) => [ - { - ...marsSwapperOsmosisQueryKeys.address(contractAddress)[0], - method: 'route', - args, - }, + { ...marsSwapperOsmosisQueryKeys.address(contractAddress)[0], method: 'route', args }, ] as const, routes: (contractAddress: string | undefined, args?: Record) => [ - { - ...marsSwapperOsmosisQueryKeys.address(contractAddress)[0], - method: 'routes', - args, - }, + { ...marsSwapperOsmosisQueryKeys.address(contractAddress)[0], method: 'routes', args }, ] as const, estimateExactInSwap: (contractAddress: string | undefined, args?: Record) => [ @@ -82,11 +65,7 @@ export const marsSwapperOsmosisQueryKeys = { ] as const, config: (contractAddress: string | undefined, args?: Record) => [ - { - ...marsSwapperOsmosisQueryKeys.address(contractAddress)[0], - method: 'config', - args, - }, + { ...marsSwapperOsmosisQueryKeys.address(contractAddress)[0], method: 'config', args }, ] as const, } export interface MarsSwapperOsmosisReactQuery { @@ -107,10 +86,7 @@ export function useMarsSwapperOsmosisConfigQuery({ return useQuery( marsSwapperOsmosisQueryKeys.config(client?.contractAddress), () => (client ? client.config() : Promise.reject(new Error('Invalid client'))), - { - ...options, - enabled: !!client && (options?.enabled != undefined ? options.enabled : true), - }, + { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }, ) } export interface MarsSwapperOsmosisEstimateExactInSwapQuery @@ -136,10 +112,7 @@ export function useMarsSwapperOsmosisEstimateExactInSwapQuery @@ -163,10 +136,7 @@ export function useMarsSwapperOsmosisRoutesQuery @@ -190,10 +160,7 @@ export function useMarsSwapperOsmosisRouteQuery({ denomOut: args.denomOut, }) : Promise.reject(new Error('Invalid client')), - { - ...options, - enabled: !!client && (options?.enabled != undefined ? options.enabled : true), - }, + { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }, ) } export interface MarsSwapperOsmosisOwnerQuery @@ -205,10 +172,7 @@ export function useMarsSwapperOsmosisOwnerQuery({ return useQuery( marsSwapperOsmosisQueryKeys.owner(client?.contractAddress), () => (client ? client.owner() : Promise.reject(new Error('Invalid client'))), - { - ...options, - enabled: !!client && (options?.enabled != undefined ? options.enabled : true), - }, + { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }, ) } export interface MarsSwapperOsmosisUpdateConfigMutation { diff --git a/scripts/types/generated/mars-swapper-osmosis/MarsSwapperOsmosis.types.ts b/scripts/types/generated/mars-swapper-osmosis/MarsSwapperOsmosis.types.ts index 0f549650..d76d682d 100644 --- a/scripts/types/generated/mars-swapper-osmosis/MarsSwapperOsmosis.types.ts +++ b/scripts/types/generated/mars-swapper-osmosis/MarsSwapperOsmosis.types.ts @@ -1,6 +1,6 @@ // @ts-nocheck /** - * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. + * This file was automatically generated by @cosmwasm/ts-codegen@0.35.3. * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ diff --git a/scripts/types/generated/mars-swapper-osmosis/bundle.ts b/scripts/types/generated/mars-swapper-osmosis/bundle.ts index 06363205..c0c3a3d7 100644 --- a/scripts/types/generated/mars-swapper-osmosis/bundle.ts +++ b/scripts/types/generated/mars-swapper-osmosis/bundle.ts @@ -1,6 +1,6 @@ // @ts-nocheck /** - * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. + * This file was automatically generated by @cosmwasm/ts-codegen@0.35.3. * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ @@ -9,9 +9,5 @@ import * as _42 from './MarsSwapperOsmosis.types' import * as _43 from './MarsSwapperOsmosis.client' import * as _44 from './MarsSwapperOsmosis.react-query' export namespace contracts { - export const MarsSwapperOsmosis = { - ..._42, - ..._43, - ..._44, - } + export const MarsSwapperOsmosis = { ..._42, ..._43, ..._44 } } diff --git a/scripts/types/generated/mars-vault/MarsVault.client.ts b/scripts/types/generated/mars-vault/MarsVault.client.ts index 46ab6249..7d99e384 100644 --- a/scripts/types/generated/mars-vault/MarsVault.client.ts +++ b/scripts/types/generated/mars-vault/MarsVault.client.ts @@ -1,6 +1,6 @@ // @ts-nocheck /** - * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. + * This file was automatically generated by @cosmwasm/ts-codegen@0.35.3. * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ @@ -35,6 +35,7 @@ export interface MarsVaultReadOnlyInterface { export class MarsVaultQueryClient implements MarsVaultReadOnlyInterface { client: CosmWasmClient contractAddress: string + constructor(client: CosmWasmClient, contractAddress: string) { this.client = client this.contractAddress = contractAddress @@ -48,6 +49,7 @@ export class MarsVaultQueryClient implements MarsVaultReadOnlyInterface { this.convertToAssets = this.convertToAssets.bind(this) this.vaultExtension = this.vaultExtension.bind(this) } + vaultStandardInfo = async (): Promise => { return this.client.queryContractSmart(this.contractAddress, { vault_standard_info: {}, @@ -140,6 +142,7 @@ export class MarsVaultClient extends MarsVaultQueryClient implements MarsVaultIn client: SigningCosmWasmClient sender: string contractAddress: string + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { super(client, contractAddress) this.client = client @@ -149,6 +152,7 @@ export class MarsVaultClient extends MarsVaultQueryClient implements MarsVaultIn this.redeem = this.redeem.bind(this) this.vaultExtension = this.vaultExtension.bind(this) } + deposit = async ( { amount, diff --git a/scripts/types/generated/mars-vault/MarsVault.react-query.ts b/scripts/types/generated/mars-vault/MarsVault.react-query.ts index d7098785..2195d484 100644 --- a/scripts/types/generated/mars-vault/MarsVault.react-query.ts +++ b/scripts/types/generated/mars-vault/MarsVault.react-query.ts @@ -1,6 +1,6 @@ // @ts-nocheck /** - * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. + * This file was automatically generated by @cosmwasm/ts-codegen@0.35.3. * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ @@ -29,52 +29,23 @@ export const marsVaultQueryKeys = { }, ] as const, address: (contractAddress: string | undefined) => - [ - { - ...marsVaultQueryKeys.contract[0], - address: contractAddress, - }, - ] as const, + [{ ...marsVaultQueryKeys.contract[0], address: contractAddress }] as const, vaultStandardInfo: (contractAddress: string | undefined, args?: Record) => [ - { - ...marsVaultQueryKeys.address(contractAddress)[0], - method: 'vault_standard_info', - args, - }, + { ...marsVaultQueryKeys.address(contractAddress)[0], method: 'vault_standard_info', args }, ] as const, info: (contractAddress: string | undefined, args?: Record) => - [ - { - ...marsVaultQueryKeys.address(contractAddress)[0], - method: 'info', - args, - }, - ] as const, + [{ ...marsVaultQueryKeys.address(contractAddress)[0], method: 'info', args }] as const, previewDeposit: (contractAddress: string | undefined, args?: Record) => [ - { - ...marsVaultQueryKeys.address(contractAddress)[0], - method: 'preview_deposit', - args, - }, + { ...marsVaultQueryKeys.address(contractAddress)[0], method: 'preview_deposit', args }, ] as const, previewRedeem: (contractAddress: string | undefined, args?: Record) => [ - { - ...marsVaultQueryKeys.address(contractAddress)[0], - method: 'preview_redeem', - args, - }, + { ...marsVaultQueryKeys.address(contractAddress)[0], method: 'preview_redeem', args }, ] as const, totalAssets: (contractAddress: string | undefined, args?: Record) => - [ - { - ...marsVaultQueryKeys.address(contractAddress)[0], - method: 'total_assets', - args, - }, - ] as const, + [{ ...marsVaultQueryKeys.address(contractAddress)[0], method: 'total_assets', args }] as const, totalVaultTokenSupply: (contractAddress: string | undefined, args?: Record) => [ { @@ -85,27 +56,15 @@ export const marsVaultQueryKeys = { ] as const, convertToShares: (contractAddress: string | undefined, args?: Record) => [ - { - ...marsVaultQueryKeys.address(contractAddress)[0], - method: 'convert_to_shares', - args, - }, + { ...marsVaultQueryKeys.address(contractAddress)[0], method: 'convert_to_shares', args }, ] as const, convertToAssets: (contractAddress: string | undefined, args?: Record) => [ - { - ...marsVaultQueryKeys.address(contractAddress)[0], - method: 'convert_to_assets', - args, - }, + { ...marsVaultQueryKeys.address(contractAddress)[0], method: 'convert_to_assets', args }, ] as const, vaultExtension: (contractAddress: string | undefined, args?: Record) => [ - { - ...marsVaultQueryKeys.address(contractAddress)[0], - method: 'vault_extension', - args, - }, + { ...marsVaultQueryKeys.address(contractAddress)[0], method: 'vault_extension', args }, ] as const, } export interface MarsVaultReactQuery { @@ -125,10 +84,7 @@ export function useMarsVaultVaultExtensionQuery({ return useQuery( marsVaultQueryKeys.vaultExtension(client?.contractAddress), () => (client ? client.vaultExtension() : Promise.reject(new Error('Invalid client'))), - { - ...options, - enabled: !!client && (options?.enabled != undefined ? options.enabled : true), - }, + { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }, ) } export interface MarsVaultConvertToAssetsQuery extends MarsVaultReactQuery { @@ -149,10 +105,7 @@ export function useMarsVaultConvertToAssetsQuery({ amount: args.amount, }) : Promise.reject(new Error('Invalid client')), - { - ...options, - enabled: !!client && (options?.enabled != undefined ? options.enabled : true), - }, + { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }, ) } export interface MarsVaultConvertToSharesQuery extends MarsVaultReactQuery { @@ -173,10 +126,7 @@ export function useMarsVaultConvertToSharesQuery({ amount: args.amount, }) : Promise.reject(new Error('Invalid client')), - { - ...options, - enabled: !!client && (options?.enabled != undefined ? options.enabled : true), - }, + { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }, ) } export interface MarsVaultTotalVaultTokenSupplyQuery @@ -188,10 +138,7 @@ export function useMarsVaultTotalVaultTokenSupplyQuery({ return useQuery( marsVaultQueryKeys.totalVaultTokenSupply(client?.contractAddress), () => (client ? client.totalVaultTokenSupply() : Promise.reject(new Error('Invalid client'))), - { - ...options, - enabled: !!client && (options?.enabled != undefined ? options.enabled : true), - }, + { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }, ) } export interface MarsVaultTotalAssetsQuery extends MarsVaultReactQuery {} @@ -202,10 +149,7 @@ export function useMarsVaultTotalAssetsQuery({ return useQuery( marsVaultQueryKeys.totalAssets(client?.contractAddress), () => (client ? client.totalAssets() : Promise.reject(new Error('Invalid client'))), - { - ...options, - enabled: !!client && (options?.enabled != undefined ? options.enabled : true), - }, + { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }, ) } export interface MarsVaultPreviewRedeemQuery extends MarsVaultReactQuery { @@ -226,10 +170,7 @@ export function useMarsVaultPreviewRedeemQuery({ amount: args.amount, }) : Promise.reject(new Error('Invalid client')), - { - ...options, - enabled: !!client && (options?.enabled != undefined ? options.enabled : true), - }, + { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }, ) } export interface MarsVaultPreviewDepositQuery extends MarsVaultReactQuery { @@ -250,10 +191,7 @@ export function useMarsVaultPreviewDepositQuery({ amount: args.amount, }) : Promise.reject(new Error('Invalid client')), - { - ...options, - enabled: !!client && (options?.enabled != undefined ? options.enabled : true), - }, + { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }, ) } export interface MarsVaultInfoQuery extends MarsVaultReactQuery {} @@ -264,10 +202,7 @@ export function useMarsVaultInfoQuery({ return useQuery( marsVaultQueryKeys.info(client?.contractAddress), () => (client ? client.info() : Promise.reject(new Error('Invalid client'))), - { - ...options, - enabled: !!client && (options?.enabled != undefined ? options.enabled : true), - }, + { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }, ) } export interface MarsVaultVaultStandardInfoQuery @@ -279,10 +214,7 @@ export function useMarsVaultVaultStandardInfoQuery( marsVaultQueryKeys.vaultStandardInfo(client?.contractAddress), () => (client ? client.vaultStandardInfo() : Promise.reject(new Error('Invalid client'))), - { - ...options, - enabled: !!client && (options?.enabled != undefined ? options.enabled : true), - }, + { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }, ) } export interface MarsVaultVaultExtensionMutation { diff --git a/scripts/types/generated/mars-vault/MarsVault.types.ts b/scripts/types/generated/mars-vault/MarsVault.types.ts index c3ecd761..a19ee4fa 100644 --- a/scripts/types/generated/mars-vault/MarsVault.types.ts +++ b/scripts/types/generated/mars-vault/MarsVault.types.ts @@ -1,6 +1,6 @@ // @ts-nocheck /** - * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. + * This file was automatically generated by @cosmwasm/ts-codegen@0.35.3. * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ diff --git a/scripts/types/generated/mars-vault/bundle.ts b/scripts/types/generated/mars-vault/bundle.ts index 2541d6ed..50ac4cd1 100644 --- a/scripts/types/generated/mars-vault/bundle.ts +++ b/scripts/types/generated/mars-vault/bundle.ts @@ -1,6 +1,6 @@ // @ts-nocheck /** - * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. + * This file was automatically generated by @cosmwasm/ts-codegen@0.35.3. * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ @@ -9,9 +9,5 @@ import * as _45 from './MarsVault.types' import * as _46 from './MarsVault.client' import * as _47 from './MarsVault.react-query' export namespace contracts { - export const MarsVault = { - ..._45, - ..._46, - ..._47, - } + export const MarsVault = { ..._45, ..._46, ..._47 } } diff --git a/scripts/types/generated/mars-zapper-base/MarsZapperBase.client.ts b/scripts/types/generated/mars-zapper-base/MarsZapperBase.client.ts index fc6161fc..4a10eb33 100644 --- a/scripts/types/generated/mars-zapper-base/MarsZapperBase.client.ts +++ b/scripts/types/generated/mars-zapper-base/MarsZapperBase.client.ts @@ -1,6 +1,6 @@ // @ts-nocheck /** - * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. + * This file was automatically generated by @cosmwasm/ts-codegen@0.35.3. * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ @@ -31,12 +31,14 @@ export interface MarsZapperBaseReadOnlyInterface { export class MarsZapperBaseQueryClient implements MarsZapperBaseReadOnlyInterface { client: CosmWasmClient contractAddress: string + constructor(client: CosmWasmClient, contractAddress: string) { this.client = client this.contractAddress = contractAddress this.estimateProvideLiquidity = this.estimateProvideLiquidity.bind(this) this.estimateWithdrawLiquidity = this.estimateWithdrawLiquidity.bind(this) } + estimateProvideLiquidity = async ({ coinsIn, lpTokenOut, @@ -102,6 +104,7 @@ export class MarsZapperBaseClient client: SigningCosmWasmClient sender: string contractAddress: string + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { super(client, contractAddress) this.client = client @@ -111,6 +114,7 @@ export class MarsZapperBaseClient this.withdrawLiquidity = this.withdrawLiquidity.bind(this) this.callback = this.callback.bind(this) } + provideLiquidity = async ( { lpTokenOut, diff --git a/scripts/types/generated/mars-zapper-base/MarsZapperBase.react-query.ts b/scripts/types/generated/mars-zapper-base/MarsZapperBase.react-query.ts index 8c17ecd8..870dc73c 100644 --- a/scripts/types/generated/mars-zapper-base/MarsZapperBase.react-query.ts +++ b/scripts/types/generated/mars-zapper-base/MarsZapperBase.react-query.ts @@ -1,6 +1,6 @@ // @ts-nocheck /** - * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. + * This file was automatically generated by @cosmwasm/ts-codegen@0.35.3. * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ @@ -26,12 +26,7 @@ export const marsZapperBaseQueryKeys = { }, ] as const, address: (contractAddress: string | undefined) => - [ - { - ...marsZapperBaseQueryKeys.contract[0], - address: contractAddress, - }, - ] as const, + [{ ...marsZapperBaseQueryKeys.contract[0], address: contractAddress }] as const, estimateProvideLiquidity: (contractAddress: string | undefined, args?: Record) => [ { @@ -80,10 +75,7 @@ export function useMarsZapperBaseEstimateWithdrawLiquidityQuery @@ -107,10 +99,7 @@ export function useMarsZapperBaseEstimateProvideLiquidityQuery( lpTokenOut: args.lpTokenOut, }) : Promise.reject(new Error('Invalid client')), - { - ...options, - enabled: !!client && (options?.enabled != undefined ? options.enabled : true), - }, + { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }, ) } export interface MarsZapperBaseCallbackMutation { diff --git a/scripts/types/generated/mars-zapper-base/MarsZapperBase.types.ts b/scripts/types/generated/mars-zapper-base/MarsZapperBase.types.ts index b9b89b3f..dbb6c81f 100644 --- a/scripts/types/generated/mars-zapper-base/MarsZapperBase.types.ts +++ b/scripts/types/generated/mars-zapper-base/MarsZapperBase.types.ts @@ -1,6 +1,6 @@ // @ts-nocheck /** - * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. + * This file was automatically generated by @cosmwasm/ts-codegen@0.35.3. * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ diff --git a/scripts/types/generated/mars-zapper-base/bundle.ts b/scripts/types/generated/mars-zapper-base/bundle.ts index a5afaad7..8f6aad8f 100644 --- a/scripts/types/generated/mars-zapper-base/bundle.ts +++ b/scripts/types/generated/mars-zapper-base/bundle.ts @@ -1,6 +1,6 @@ // @ts-nocheck /** - * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. + * This file was automatically generated by @cosmwasm/ts-codegen@0.35.3. * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ @@ -9,9 +9,5 @@ import * as _48 from './MarsZapperBase.types' import * as _49 from './MarsZapperBase.client' import * as _50 from './MarsZapperBase.react-query' export namespace contracts { - export const MarsZapperBase = { - ..._48, - ..._49, - ..._50, - } + export const MarsZapperBase = { ..._48, ..._49, ..._50 } }