AndromedaQuery V1.0.0
The set of query messages common to all ADOs in the Andromeda Logic Library.
AndromedaQuery
All of the ADOs can call the base query messages found in the AndromedaMsg.
AMP ADOs are the only ADOs that do not implement the AndromedaQuery base queries.
pub enum AndromedaQuery {
#[returns(self::ownership::ContractOwnerResponse)]
Owner {},
#[returns(self::ownership::ContractPotentialOwnerResponse)]
OwnershipRequest {},
#[returns(self::ado_type::TypeResponse)]
Type {},
#[returns(self::kernel_address::KernelAddressResponse)]
KernelAddress {},
#[returns(self::ownership::PublisherResponse)]
OriginalPublisher {},
#[returns(self::block_height::BlockHeightResponse)]
BlockHeightUponCreation {},
#[returns(self::version::VersionResponse)]
Version {},
#[returns(Option<::cosmwasm_std::Addr>)]
AppContract {},
#[returns(::cosmwasm_std::BalanceResponse)]
Balance { address: AndrAddr },
#[returns(Vec<self::permissioning::PermissionInfo>)]
Permissions {
actor: AndrAddr,
limit: Option<u32>,
start_after: Option<String>,
},
#[returns(Vec<self::permissioning::PermissionedActionsResponse>)]
PermissionedActions {},
}
Owner
Queries the owner of the contract.
pub enum AndromedaQuery {
#[returns(self::ownership::ContractOwnerResponse)]
Owner{}
}
ContractOwnerResponse
pub struct ContractOwnerResponse {
pub owner: String
}
{
"owner":"andr1..."
}
OwnershipRequest
Returns the owner that has a request to take ownership of the ADO.
An OwnershipRequest is present when UpdateOwner is called.
pub enum AndromedaQuery {
#[returns(self::ownership::ContractPotentialOwnerResponse)]
OwnershipRequest {},
}
{
"ownership_request":{}
}
ContractPotentialOwnerResponse
A struct that returns the address that has the ownership offer for the ADO.
{
pub struct ContractPotentialOwnerResponse {
pub potential_owner: Option<Addr>,
}
{
"potential_owner":"andr1..."
}
Type
Queries the ADO type.
pub enum AndromedaQuery {
#[returns(self::ado_type::TypeResponse)]
Type {}
}
TypeResponse
pub struct TypeResponse {
pub ado_type: String,
}
{
"ado_type":"auction"
}
KernelAddress
Queries the kernel address of the chain the ADO is deployed on.
pub enum AndromedaQuery {
#[returns(self::kernel_address::KernelAddressResponse)]
KernelAddress {},
}
{
"kernel_address":{}
}
Returns a String containing the contract address of the Kernel.
BlockHeightUponCreation
Queries the block height when the ADO was created.
pub enum AndromedaQuery{
#[returns(self::block_height::BlockHeightResponse)]
BlockHeightUponCreation {},
}
{
"block_height_upon_creation":{}
}
BlockHeightResponse
pub struct BlockHeightResponse {
pub block_height: u64,
}
{
"block_height": 2000134
}
Version
Queries the version of the ADO.
pub enum AndromedaQuery {
#[returns(self::version::VersionResponse)]
Version {}
}
VersionResponse
pub struct VersionResponse {
pub version: String,
}
{
"version": "0.1.0"
}
AppContract
Returns the address of the App ADO that instantiated the ADO.
pub enum AndromedaQuery {
#[returns(self::app_contract::AppContractResponse)]
AppContract {}
}
{
"app_contract":{}
}
AppContractResponse
The struct containing the address of the App ADO.
pub struct AppContractResponse {
pub app_contract: Addr,
}
{
"app_contract":"andr1..."
}
OriginalPublisher
Queries the orginal address that published/instantiated the ADO.
pub enum AndromedaQuery {
#[returns(self::ownership::PublisherResponse)]
OriginalPublisher {}
}
{
"original_publisher":{}
}
PublisherResponse
pub struct PublisherResponse {
pub original_publisher: String,
}
{
"original_publisher":"andr1..."
}
Permisions
Queries the permissions set for the specified actor address.
pub enum AndromedaQuery {
#[returns(Vec<self::permissioning::PermissionInfo>)]
Permissions {
actor: AndrAddr,
limit: Option<u32>,
start_after: Option<String>,
}
}
{
"permissions":{
"actor":"andr1...",
}
}
PermissionInfo
Returns a vector of the PermissionInfo struct containing all the permissions for the actor.
pub struct PermissionInfo {
pub permission: Permission,
pub action: String,
pub actor: String,
}
PermissionedActions
Queries the actions or execute messages that are permissioned in the ADO.
The actions that are permissioned are the ones that have PermissionAction called on them.
pub enum AndromedaQuery {
#[returns(Vec<self::permissioning::PermissionedActionsResponse>)]
PermissionedActions {},
}
{
"permissioned_actions":{}
}
Returns a Vector of String containing the actions that are permissioned.
Last updated