pub struct PostsQuerier<'a> { /* private fields */ }Expand description
Querier allows to query data from the Desmos x/posts module.
Implementations§
Source§impl<'a> PostsQuerier<'a>
impl<'a> PostsQuerier<'a>
Sourcepub fn new(querier: &'a QuerierWrapper<'a, Empty>) -> Self
pub fn new(querier: &'a QuerierWrapper<'a, Empty>) -> Self
Creates a new instance of PostsQuerier.
§Example
use cosmwasm_std::{DepsMut, MessageInfo};
use desmos_bindings::posts::querier::PostsQuerier;
pub fn contract_action(deps: DepsMut, _: MessageInfo) {
let querier = PostsQuerier::new(&deps.querier);
}Sourcepub fn query_subspace_posts(
&self,
subspace_id: u64,
pagination: Option<PageRequest>,
) -> StdResult<QuerySubspacePostsResponse>
pub fn query_subspace_posts( &self, subspace_id: u64, pagination: Option<PageRequest>, ) -> StdResult<QuerySubspacePostsResponse>
Queries posts created inside a subspace.
subspace_id- Subspace to query the posts for.pagination- Optional pagination configs.
Sourcepub fn iterate_subspace_posts(
&self,
subspace_id: u64,
page_size: u64,
) -> PageIterator<'_, Post, Binary> ⓘ
pub fn iterate_subspace_posts( &self, subspace_id: u64, page_size: u64, ) -> PageIterator<'_, Post, Binary> ⓘ
Gives an iterator to scan over the posts created inside a subspace.
subspace_id- Subspace to query the posts for.page_size- Size of the page requested to the chain.
Sourcepub fn query_section_posts(
&self,
subspace_id: u64,
section_id: u32,
pagination: Option<PageRequest>,
) -> StdResult<QuerySectionPostsResponse>
pub fn query_section_posts( &self, subspace_id: u64, section_id: u32, pagination: Option<PageRequest>, ) -> StdResult<QuerySectionPostsResponse>
Queries all the posts inside a give section.
subspace_id- Subspace to query the posts for.section_id- Section to query the post for.pagination- Optional pagination configs.
Sourcepub fn iterate_section_posts(
&self,
subspace_id: u64,
section_id: u32,
page_size: u64,
) -> PageIterator<'_, Post, Binary> ⓘ
pub fn iterate_section_posts( &self, subspace_id: u64, section_id: u32, page_size: u64, ) -> PageIterator<'_, Post, Binary> ⓘ
Gives an iterator to scan over the posts created inside a give section.
subspace_id- Subspace to query the posts for.section_id- Section to query the post for.page_size- Size of the page requested to the chain.
Sourcepub fn query_post(
&self,
subspace_id: u64,
post_id: u64,
) -> StdResult<QueryPostResponse>
pub fn query_post( &self, subspace_id: u64, post_id: u64, ) -> StdResult<QueryPostResponse>
Queries a single post inside a given subspace.
subspace_id- Id of the subspace where the post is stored.post_id- Id of the post to query for.
Sourcepub fn query_post_attachments(
&self,
subspace_id: u64,
post_id: u64,
pagination: Option<PageRequest>,
) -> StdResult<QueryPostAttachmentsResponse>
pub fn query_post_attachments( &self, subspace_id: u64, post_id: u64, pagination: Option<PageRequest>, ) -> StdResult<QueryPostAttachmentsResponse>
Queries the attachments of the post having the given post_id.
subspace_id- Id of the subspace where the post is stored.post_id- Id of the post to query the attachments for.pagination- Optional pagination configs.
Sourcepub fn iterate_post_attachments(
&self,
subspace_id: u64,
post_id: u64,
page_size: u64,
) -> PageIterator<'_, Attachment, Binary> ⓘ
pub fn iterate_post_attachments( &self, subspace_id: u64, post_id: u64, page_size: u64, ) -> PageIterator<'_, Attachment, Binary> ⓘ
Gives an iterator to scan over the attachments of the post having the given post_id.
subspace_id- Id of the subspace where the post is stored.post_id- Id of the post to query the attachments for.page_size- Size of the page requested to the chain.
Sourcepub fn query_poll_answers(
&self,
subspace_id: u64,
post_id: u64,
poll_id: u32,
user: Option<Addr>,
pagination: Option<PageRequest>,
) -> StdResult<QueryPollAnswersResponse>
pub fn query_poll_answers( &self, subspace_id: u64, post_id: u64, poll_id: u32, user: Option<Addr>, pagination: Option<PageRequest>, ) -> StdResult<QueryPollAnswersResponse>
Queries the answers for the poll having the given post_id.
subspace_id- Id of the subspace where the post is stored.poll_id- Id of the post that holds the poll.user- Optional address of the user to query the responses for.pagination- Optional pagination configs.
Sourcepub fn iterate_poll_answers(
&self,
subspace_id: u64,
post_id: u64,
poll_id: u32,
user: Option<Addr>,
page_size: u64,
) -> PageIterator<'_, UserAnswer, Binary> ⓘ
pub fn iterate_poll_answers( &self, subspace_id: u64, post_id: u64, poll_id: u32, user: Option<Addr>, page_size: u64, ) -> PageIterator<'_, UserAnswer, Binary> ⓘ
Gives an iterator to scan over the answers for the poll having the given post_id.
subspace_id- Id of the subspace where the post is stored.poll_id- Id of the post that holds the poll.user- Optional address of the user to query the responses for.page_size- Size of the page requested to the chain.
Sourcepub fn query_incoming_post_transfer_requests(
&self,
subspace_id: u64,
receiver: Option<Addr>,
pagination: Option<PageRequest>,
) -> StdResult<QueryIncomingPostOwnerTransferRequestsResponse>
pub fn query_incoming_post_transfer_requests( &self, subspace_id: u64, receiver: Option<Addr>, pagination: Option<PageRequest>, ) -> StdResult<QueryIncomingPostOwnerTransferRequestsResponse>
Queries the incoming post transfer requests having the given subspace_id.
subspace_id- Id of the subspace where the requests are stored.receiver- Optional the address of the user to which query the incoming requests for.pagination- Optional pagination for the request.
Sourcepub fn iterate_incoming_post_transfer_requests(
&self,
subspace_id: u64,
receiver: Option<Addr>,
page_size: u64,
) -> PageIterator<'_, PostOwnerTransferRequest, Binary> ⓘ
pub fn iterate_incoming_post_transfer_requests( &self, subspace_id: u64, receiver: Option<Addr>, page_size: u64, ) -> PageIterator<'_, PostOwnerTransferRequest, Binary> ⓘ
Gives an iterator to scan over the incoming post transfer requests having the given subspace_id.
subspace_id- Id of the subspace where the requests are stored.receiver- Optional the address of the user to which query the incoming requests for.page_size- Size of the page requested to the chain.