Skip to content

Commit 317a04a

Browse files
committed
Added cw2 adapters updated
1 parent bcbab6d commit 317a04a

File tree

16 files changed

+59
-62
lines changed

16 files changed

+59
-62
lines changed

integrations/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ members = [
44
"astrovault-adapter",
55
# "bundles/*",
66
"osmosis-adapter",
7-
# "wyndex-adapter",
8-
# "kujira-adapter",
7+
"wyndex-adapter",
8+
"kujira-adapter",
99
# "mars-adapter",
1010
]
1111

integrations/astrovault-adapter/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,5 @@ cw20 = { workspace = true, optional = true }
2525

2626
[dev-dependencies]
2727
abstract-dex-standard = { workspace = true, features = ["testing"] }
28-
astrovault = { version = "0.1.1" }
28+
astrovault = { version = "2.0.1" }
2929
cw-orch = { workspace = true }

integrations/kujira-adapter/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ full_integration = ["dep:kujira", "dep:cw20", "dep:cw-asset", "dep:cw-utils"]
1212
local = []
1313

1414
[dependencies]
15-
kujira = { version = "0.8.2", optional = true }
15+
kujira = { version = "1.3.0", optional = true }
1616

1717
abstract-dex-standard = { workspace = true }
1818
abstract-money-market-standard = { workspace = true }

integrations/kujira-adapter/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#[cfg(feature = "local")]
2-
pub const AVAILABLE_CHAINS: &[&str] = abstract_sdk::std::registry::LOCAL_CHAIN;
2+
pub const AVAILABLE_CHAINS: &[&str] = abstract_sdk::std::constants::LOCAL_CHAIN;
33
#[cfg(not(feature = "local"))]
4-
pub const AVAILABLE_CHAINS: &[&str] = abstract_sdk::std::registry::KUJIRA;
4+
pub const AVAILABLE_CHAINS: &[&str] = abstract_sdk::std::constants::KUJIRA;
55

66
pub mod dex;
77
pub mod money_market;

integrations/kujira-adapter/src/money_market.rs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ use ::{
2424
std::objects::{ans_host::AnsHostError, AssetEntry, ContractEntry},
2525
},
2626
cosmwasm_std::{
27-
coins, wasm_execute, Addr, CosmosMsg, Decimal, Deps, QuerierWrapper, StdError, StdResult,
28-
Uint128,
27+
coins, wasm_execute, Addr, CosmosMsg, Decimal, Deps, GrpcQuery, QuerierWrapper, StdError,
28+
StdResult, Uint128,
2929
},
3030
cw_asset::{Asset, AssetInfo},
3131
kujira::ghost::{
@@ -76,7 +76,7 @@ impl MoneyMarketCommand for Ghost {
7676
&vault_msg,
7777
coins(
7878
((Decimal::from_ratio(asset.amount, 1u128) / status.deposit_redemption_ratio)
79-
* Uint128::one())
79+
.to_uint_floor())
8080
.u128(),
8181
config.receipt_denom,
8282
),
@@ -364,10 +364,11 @@ impl Ghost {
364364
querier: &QuerierWrapper,
365365
denom: String,
366366
) -> Result<HumanPrice, StdError> {
367-
let res: ExchangeRateResponse = querier.query(&cosmwasm_std::QueryRequest::Stargate {
368-
path: exchange_rate_type_url(denom),
369-
data: QueryExchangeRateRequest {}.encode_to_vec().into(),
370-
})?;
367+
let res: ExchangeRateResponse =
368+
querier.query(&cosmwasm_std::QueryRequest::Grpc(GrpcQuery {
369+
path: exchange_rate_type_url(denom),
370+
data: QueryExchangeRateRequest {}.encode_to_vec().into(),
371+
}))?;
371372

372373
Ok(res.rate.into())
373374
}

integrations/osmosis-adapter/src/dex.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
use abstract_dex_standard::Identify;
2-
use abstract_sdk::feature_objects::RegistryContract;
32
use cosmwasm_std::Addr;
43

54
use crate::{AVAILABLE_CHAINS, OSMOSIS};
@@ -21,7 +20,10 @@ impl Identify for Osmosis {
2120
#[cfg(feature = "full_integration")]
2221
use {
2322
abstract_dex_standard::{DexCommand, DexError, Fee, FeeOnInput, Return, Spread, SwapNode},
24-
abstract_sdk::{feature_objects::AnsHost, std::objects::PoolAddress},
23+
abstract_sdk::{
24+
feature_objects::{AnsHost, RegistryContract},
25+
std::objects::PoolAddress,
26+
},
2527
cosmwasm_std::{
2628
Coin, CosmosMsg, Decimal, Decimal256, Deps, StdError, StdResult, Uint128, Uint256,
2729
},

integrations/osmosis-adapter/src/staking.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
use abstract_sdk::std::objects::registry::RegistryContract;
21
use abstract_staking_standard::Identify;
32
use cosmwasm_std::Addr;
43

@@ -29,7 +28,8 @@ pub mod fns {
2928
use std::str::FromStr;
3029

3130
use abstract_sdk::std::objects::{
32-
ans_host::AnsHost, AnsAsset, AnsEntryConvertor, AssetEntry, PoolReference, PoolType,
31+
ans_host::AnsHost, registry::RegistryContract, AnsAsset, AnsEntryConvertor, AssetEntry,
32+
PoolReference, PoolType,
3333
};
3434

3535
use abstract_staking_standard::{

integrations/wyndex-adapter/Cargo.toml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,11 @@ full_integration = [
2121
local = []
2222

2323
[dependencies]
24-
wyndex = { git = "https://github.com/wynddao/wynddex", tag = "v1.1.2", optional = true }
25-
wyndex-stake = { git = "https://github.com/wynddao/wynddex", tag = "v1.1.2", features = ["library"], optional = true }
24+
# wyndex = { git = "https://github.com/wynddao/wynddex", tag = "v1.1.2", optional = true }
25+
# wyndex-stake = { git = "https://github.com/wynddao/wynddex", tag = "v1.1.2", features = ["library"], optional = true }
26+
# Abstract maintained cosmwasm std 2 update
27+
wyndex = { git = "https://github.com/abstractsdk/wynddex", rev = "cbe316f17c4a89d0c3938ea66747a5ff1fc5a5e9", optional = true }
28+
wyndex-stake = { git = "https://github.com/abstractsdk/wynddex", rev = "cbe316f17c4a89d0c3938ea66747a5ff1fc5a5e9", features = ["library"], optional = true }
2629

2730
abstract-dex-standard = { workspace = true }
2831
abstract-sdk = { workspace = true }

integrations/wyndex-adapter/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
pub const WYNDEX: &str = "wyndex";
33

44
#[cfg(feature = "local")]
5-
pub const AVAILABLE_CHAINS: &[&str] = abstract_sdk::std::registry::LOCAL_CHAIN;
5+
pub const AVAILABLE_CHAINS: &[&str] = abstract_sdk::std::constants::LOCAL_CHAIN;
66
#[cfg(not(feature = "local"))]
7-
pub const AVAILABLE_CHAINS: &[&str] = abstract_sdk::std::registry::JUNO;
7+
pub const AVAILABLE_CHAINS: &[&str] = abstract_sdk::std::constants::JUNO;
88

99
pub mod dex;
1010
pub mod staking;

integrations/wyndex-adapter/src/staking.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ use {
4444
cw20::Cw20ExecuteMsg,
4545
cw_asset::{AssetInfo, AssetInfoBase},
4646
cw_utils::Duration,
47+
wyndex::stake::ReceiveMsg,
4748
wyndex_stake::msg::DistributionDataResponse,
48-
wyndex_stake::msg::ReceiveDelegationMsg,
4949
wyndex_stake::{
5050
msg::{BondingInfoResponse, ExecuteMsg as StakeCw20ExecuteMsg},
5151
state::{BondingInfo, STAKE},
@@ -98,7 +98,7 @@ impl CwStakingCommand for WynDex {
9898
unbonding_period: Option<Duration>,
9999
) -> Result<Vec<CosmosMsg>, CwStakingError> {
100100
let unbonding_period = unwrap_unbond(self, unbonding_period)?;
101-
let msg = to_json_binary(&ReceiveDelegationMsg::Delegate {
101+
let msg = to_json_binary(&ReceiveMsg::Delegate {
102102
unbonding_period,
103103
delegate_as: None,
104104
})?;

modules/contracts/adapters/cw-staking/Cargo.toml

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -34,28 +34,24 @@ schema = ["abstract-adapter/schema"]
3434
testing = ["dep:abstract-client", "dep:cw20", "abstract-adapter/test-utils"]
3535

3636
# Supported Dexes
37-
# wynd = ["abstract-wyndex-adapter/full_integration", "dep:cw-controllers"]
3837
osmosis = ["abstract-osmosis-adapter/full_integration"]
38+
wynd = ["abstract-wyndex-adapter/full_integration", "dep:cw-controllers"]
3939
# astroport = ["abstract-astroport-adapter/full_integration"]
40-
# bow = ["abstract-kujira-adapter/full_integration"]
4140
astrovault = ["abstract-astrovault-adapter/full_integration"]
41+
bow = ["abstract-kujira-adapter/full_integration"]
4242

4343
# Builds
4444
[package.metadata.optimizer]
4545
builds = [
46-
# { name = "juno", features = [
47-
# "wynd",
48-
# ] },
46+
{ name = "juno", features = ["wynd"] },
4947
# { name = "terra2", features = [
5048
# "astroport",
5149
# ] },
5250
# { name = "neutron", features = [
5351
# "astroport",
5452
# ] },
5553
{ name = "osmosis", features = ["osmosis"] },
56-
# { name = "kujira", features = [
57-
# "bow",
58-
# ] },
54+
{ name = "kujira", features = ["bow"] },
5955
# { name = "injective", features = [
6056
# "astroport",
6157
# ] },
@@ -80,16 +76,17 @@ abstract-adapter-utils = { workspace = true }
8076
abstract-staking-standard = { workspace = true }
8177

8278
# # Juno dexes #
83-
# abstract-wyndex-adapter = { workspace = true }
79+
abstract-wyndex-adapter = { workspace = true }
80+
cw-controllers = { workspace = true, optional = true }
8481

8582
# # Osmosis #
8683
abstract-osmosis-adapter = { workspace = true }
8784

8885
# # Terra #
8986
# abstract-astroport-adapter = { workspace = true }
9087

91-
# # Kujira #
92-
# abstract-kujira-adapter = { workspace = true }
88+
# Kujira #
89+
abstract-kujira-adapter = { workspace = true }
9390

9491
# Astrovault #
9592
abstract-astrovault-adapter = { workspace = true }

modules/contracts/adapters/dex/Cargo.toml

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,30 +28,26 @@ schema = ["abstract-adapter/schema"]
2828
testing = ["dep:abstract-client", "dep:cw20", "dep:serde_json", "abstract-adapter/test-utils"]
2929

3030
# Supported Dexes
31-
# wynd = ["abstract-wyndex-adapter/full_integration"]
3231
osmosis = ["abstract-osmosis-adapter/full_integration"]
32+
wynd = ["abstract-wyndex-adapter/full_integration"]
3333
# astroport = ["abstract-astroport-adapter/full_integration"]
34-
# fin = ["abstract-kujira-adapter/full_integration"]
3534
astrovault = ["abstract-astrovault-adapter/full_integration"]
35+
fin = ["abstract-kujira-adapter/full_integration"]
3636

3737
osmosis-test = ["dep:cw-orch-osmosis-test-tube"]
3838

3939
# Builds
4040
[package.metadata.optimizer]
4141
builds = [
42-
# { name = "juno", features = [
43-
# "wynd",
44-
# ] },
42+
{ name = "juno", features = ["wynd"] },
4543
# { name = "terra2", features = [
4644
# "astroport",
4745
# ] },
4846
# { name = "neutron", features = [
4947
# "astroport",
5048
# ] },
5149
{ name = "osmosis", features = ["osmosis"] },
52-
# { name = "kujira", features = [
53-
# "fin",
54-
# ] },
50+
{ name = "kujira", features = ["fin"] },
5551
# { name = "injective", features = [
5652
# "astroport",
5753
# ] },
@@ -76,16 +72,16 @@ abstract-adapter-utils = { workspace = true }
7672
abstract-dex-standard = { workspace = true }
7773

7874
# # Wyndex #
79-
# abstract-wyndex-adapter = { workspace = true }
75+
abstract-wyndex-adapter = { workspace = true }
8076

8177
# Osmosis #
8278
abstract-osmosis-adapter = { workspace = true }
8379

8480
# # Terra #
8581
# abstract-astroport-adapter = { workspace = true }
8682

87-
# # Kujira #
88-
# abstract-kujira-adapter = { workspace = true }
83+
# Kujira #
84+
abstract-kujira-adapter = { workspace = true }
8985

9086
# # Terra dexes #
9187
# terraswap = { version = "2.8.0", optional = true }

modules/contracts/adapters/dex/src/api.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ pub trait DexInterface:
2424
AccountIdentification + Dependencies + ModuleIdentification + AbstractNameService
2525
{
2626
/// Construct a new dex interface.
27-
fn dex<'a>(&'a self, deps: Deps<'a>, env: &'a Env, name: DexName) -> Dex<Self> {
27+
fn dex<'a>(&'a self, deps: Deps<'a>, env: &'a Env, name: DexName) -> Dex<'a, Self> {
2828
Dex {
2929
base: self,
3030
env,
@@ -34,7 +34,7 @@ pub trait DexInterface:
3434
}
3535
}
3636
/// Construct a new dex interface with ANS support.
37-
fn ans_dex<'a>(&'a self, deps: Deps<'a>, env: &'a Env, name: DexName) -> AnsDex<Self> {
37+
fn ans_dex<'a>(&'a self, deps: Deps<'a>, env: &'a Env, name: DexName) -> AnsDex<'a, Self> {
3838
AnsDex {
3939
base: self,
4040
env,
@@ -147,7 +147,7 @@ pub mod raw {
147147
}
148148
}
149149

150-
impl<'a, T: DexInterface> Dex<'a, T> {
150+
impl<T: DexInterface> Dex<'_, T> {
151151
/// Do a query in the DEX
152152
fn query<R: DeserializeOwned>(&self, query_msg: DexQueryMsg) -> AbstractSdkResult<R> {
153153
let adapters = self.base.adapters(self.deps);
@@ -283,7 +283,7 @@ pub mod ans {
283283
}
284284
}
285285

286-
impl<'a, T: DexInterface> AnsDex<'a, T> {
286+
impl<T: DexInterface> AnsDex<'_, T> {
287287
/// Do a query in the DEX
288288
fn query<R: DeserializeOwned>(&self, query_msg: DexQueryMsg) -> AbstractSdkResult<R> {
289289
let adapters = self.base.adapters(self.deps);

modules/contracts/adapters/money-market/Cargo.toml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ testing = ["dep:abstract-client", "dep:cw20", "abstract-adapter/test-utils"]
2929

3030
# Supported Moneymarkets
3131
# mars = ["abstract-mars-adapter/full_integration"]
32-
# ghost = ["abstract-kujira-adapter/full_integration"]
32+
ghost = ["abstract-kujira-adapter/full_integration"]
3333

3434
# osmosis-test = ["dep:cw-orch-osmosis-test-tube"]
3535

@@ -39,9 +39,7 @@ builds = [
3939
# { name = "osmosis", features = [
4040
# "mars",
4141
# ] },
42-
# { name = "kujira", features = [
43-
# "ghost",
44-
# ] },
42+
{ name = "kujira", features = ["ghost"] },
4543
]
4644

4745
[dependencies]
@@ -59,8 +57,8 @@ cw-orch = { workspace = true }
5957
abstract-adapter-utils = { workspace = true }
6058
abstract-money-market-standard = { workspace = true }
6159

62-
# # Kujira #
63-
# abstract-kujira-adapter = { workspace = true }
60+
# Kujira #
61+
abstract-kujira-adapter = { workspace = true }
6462

6563
# # Mars #
6664
# abstract-mars-adapter = { workspace = true }

modules/contracts/adapters/money-market/src/api.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ pub trait MoneyMarketInterface:
2121
AccountIdentification + Dependencies + ModuleIdentification
2222
{
2323
/// Construct a new money_market interface.
24-
fn money_market<'a>(&'a self, deps: Deps<'a>, name: MoneyMarketName) -> MoneyMarket<Self> {
24+
fn money_market<'a>(&'a self, deps: Deps<'a>, name: MoneyMarketName) -> MoneyMarket<'a, Self> {
2525
MoneyMarket {
2626
base: self,
2727
deps,
@@ -34,7 +34,7 @@ pub trait MoneyMarketInterface:
3434
&'a self,
3535
deps: Deps<'a>,
3636
name: MoneyMarketName,
37-
) -> AnsMoneyMarket<Self> {
37+
) -> AnsMoneyMarket<'a, Self> {
3838
AnsMoneyMarket {
3939
base: self,
4040
deps,
@@ -191,7 +191,7 @@ pub mod raw {
191191
}
192192
}
193193

194-
impl<'a, T: MoneyMarketInterface> MoneyMarket<'a, T> {
194+
impl<T: MoneyMarketInterface> MoneyMarket<'_, T> {
195195
// Queries
196196
pub fn user_deposit(
197197
&self,
@@ -396,7 +396,7 @@ pub mod ans {
396396
}
397397
}
398398

399-
impl<'a, T: MoneyMarketInterface> AnsMoneyMarket<'a, T> {
399+
impl<T: MoneyMarketInterface> AnsMoneyMarket<'_, T> {
400400
// Queries
401401
pub fn user_deposit(&self, user: String, asset: AssetEntry) -> AbstractSdkResult<Uint128> {
402402
self.query(MoneyMarketQueryMsg::AnsUserDeposit {

modules/contracts/adapters/money-market/src/platform_resolver.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ use cosmwasm_std::Env;
99
/// This provides superior UX in case of an IBC execution
1010
pub(crate) fn identify_money_market(value: &str) -> Result<Box<dyn Identify>, MoneyMarketError> {
1111
match value {
12-
// abstract_kujira_adapter::money_market::GHOST => {
13-
// Ok(Box::<abstract_kujira_adapter::money_market::Ghost>::default())
14-
// }
12+
abstract_kujira_adapter::money_market::GHOST => {
13+
Ok(Box::<abstract_kujira_adapter::money_market::Ghost>::default())
14+
}
1515
// abstract_mars_adapter::MARS => {
1616
// Ok(Box::<abstract_mars_adapter::money_market::Mars>::default())
1717
// }

0 commit comments

Comments
 (0)