Closed Jcaster99 closed 1 year ago
What are the tokens/denoms you are trying to use for a new pool? Which pool type do you want to create? Does your wallet balance is >0 and you ever made any transaction on injective testnet before?
@epanchee Thanks for answer i have solved the problem now i need to automatic create pair and store pair info to storage but not succeess here is code
use astroport::asset::AssetInfo;
use astroport::factory::{PairType, ExecuteMsg};
use astroport::factory::ExecuteMsg::CreatePair;
use cosmwasm_std::{Addr, attr, Response, to_binary, WasmMsg, DepsMut, Env, MessageInfo};
use cw20_base::ContractError;
const FACTORY: &str = "inj1c4e2787cwawlqslph0yzn62wq4xpzzq9y9kjwj";
pub fn try_create_pair(
deps: DepsMut,
env: Env,
info: MessageInfo,
token_code_id: u64,
) -> Result<Response, ContractError> {
let assets: Vec<AssetInfo> = vec![
AssetInfo::NativeToken {
denom: "inj".to_string(),
},
AssetInfo::Token {
contract_addr: env.contract.address,
},
];
let create_pair_msg = to_binary(&CreatePair {
pair_type: PairType::Xyk {},
asset_infos:assets,
init_params: None,
})?;
let msg = WasmMsg::Execute {
contract_addr: FACTORY.to_string(),
msg: create_pair_msg,
funds: vec![],
};
//create error
failed to execute message; message index: 0: dispatch: submessages: Error parsing into type astroport::factory::ExecuteMsg: unknown variant `asset_infos`, expected one of `update_config`, `update_pair_config`, `create_pair`, `deregister`, `propose_new_owner`, `drop_ownership_proposal`, `claim_ownership`, `mark_as_migrated`: execute wasm contract failed
//get pair address and store to storage
Ok(Response::new()
.add_message(msg)
.add_attributes(vec![
attr("action", "create_pair"),
]))
}
}
Hi,
Sorry for the long reply.
Are you using test-tube? Please note that Astroport doesn't provide test-tube support and you have to figure out it yourself. The error denotes that you're trying to send wrong execute message on factory. Consult with factory execute messages here.
When i try to add pools the request error
this error from astro side or on my side ?