var img = document.createElement('img'); img.src = "https://terradocs.matomo.cloud//piwik.php?idsite=4&rec=1&url=https://docs.enterprise.money" + location.pathname; img.style = "border:0"; img.alt = "tracker"; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(img,s);
Skip to main content

Queries

This section outlines the various query messages for Enterprise smart contracts.

DaoInfo

Returns all available info on a particular DAO.

  • dao_membership_contract refers to the contract that is used to calculate DAO membership.
  • dao_code_version is the version of the Enterprise code that the DAO is currently running.
Query
Copy

_1
DaoInfo {}

Response
Copy

_7
struct DaoInfoResponse {
_7
pub metadata: DaoMetadata,
_7
pub gov_config: DaoGovConfig,
_7
pub dao_type: DaoType,
_7
pub dao_membership_contract: Addr,
_7
pub dao_code_version: Uint64,
_7
}

QueryMemberInfoMsg

Returns the voting power or weight of a DAO member.

  • member_address: The address of a particular DAO member.

  • voting_power: The weight or number of votes given to the requested DAO member expressed as a decimal. This query returns 0 if the address is not a member of the DAO.

For example, a voting power of 0.31 means that the member holds 31% of available votes.

Query
Copy

_3
struct QueryMemberInfoMsg {
_3
member_address: String,
_3
}

Response
Copy

_3
struct MemberInfoResponse {
_3
pub voting_power: Decimal,
_3
}

AssetWhitelist

Returns a list of a DAOs current whitelisted assets.

Query
Copy

_1
AssetWhitelist {}

Response
Copy

_3
struct AssetWhitelistResponse {
_3
pub assets: Vec<AssetInfo>,
_3
}

NftWhitelistResponse

The whitelist response for an NFT DAO.

Query
Copy

_1
AssetWhitelist {}

Response
Copy

_3
struct NftWhitelistResponse {
_3
pub nfts: Vec<Addr>,
_3
}

ProposalParams

Returns the parameters for a single proposal.

Query
Copy

_3
struct ProposalParams {
_3
pub proposal_id: ProposalId,
_3
}

Response
Copy

_10
struct ProposalResponse {
_10
pub proposal: Proposal,
_10
_10
/// means this is serialized as an array of (int, String)
_10
/// where the String is a string representation of unsigned 128 integer
_10
#[schemars(with = "Vec<(u8, Uint128)>")]
_10
#[serde_as(as = "Vec<(_, _)>")]
_10
/// Total vote-count (value) for each outcome (key).
_10
pub results: BTreeMap<u8, u128>,
_10
}

ProposalStatusParams

Returns all proposals. Proposal types can be specified to filter by a proposal's status.

Query
Copy

_12
struct ProposalsParams {
_12
/// Optional proposal status to filter for.
_12
pub filter: Option<ProposalStatusFilter>,
_12
pub start_after: Option<ProposalId>,
_12
pub limit: Option<u32>,
_12
}
_12
_12
enum ProposalStatusFilter {
_12
InProgress,
_12
Passed,
_12
Rejected,
_12
}

Response
Copy

_3
struct ProposalsResponse {
_3
pub proposals: Vec<ProposalResponse>,
_3
}

ProposalStatusParams

Returns the status parameters of a proposal, including the status, expiration time, and the total vote count (value) for each outcome (key).

Query
Copy

_3
struct ProposalStatusParams {
_3
pub proposal_id: ProposalId,
_3
}

Response
Copy

_6
struct ProposalStatusResponse {
_6
pub status: ProposalStatus,
_6
pub expires: Expiration,
_6
_6
pub results: BTreeMap<u8, u128>,
_6
}

PollVoterParams

Returns the vote outcome and the number of votes of a specific DAO member given a poll id and an address.

Query
Copy

_4
struct PollVoterParams {
_4
pub poll_id: Uint64,
_4
pub voter_addr: String,
_4
}

Response
Copy

_12
struct PollVoterResponse {
_12
pub vote: Option<Vote>,
_12
}
_12
_12
struct Vote {
_12
pub poll_id: PollId,
_12
pub voter: Addr,
_12
/// The outcome voted for, 0-indexed.
_12
pub outcome: u8,
_12
/// Number of votes on the outcome.
_12
pub amount: u128,
_12
}

DaoInfo

Returns all available info on a particular DAO.

  • dao_membership_contract refers to the contract that is used to calculate DAO membership.
  • dao_code_version is the version of the Enterprise code that the DAO is currently running.

QueryMemberInfoMsg

Returns the voting power or weight of a DAO member.

  • member_address: The address of a particular DAO member.

  • voting_power: The weight or number of votes given to the requested DAO member expressed as a decimal. This query returns 0 if the address is not a member of the DAO.

For example, a voting power of 0.31 means that the member holds 31% of available votes.

AssetWhitelist

Returns a list of a DAOs current whitelisted assets.

NftWhitelistResponse

The whitelist response for an NFT DAO.

ProposalParams

Returns the parameters for a single proposal.

ProposalStatusParams

Returns all proposals. Proposal types can be specified to filter by a proposal's status.

ProposalStatusParams

Returns the status parameters of a proposal, including the status, expiration time, and the total vote count (value) for each outcome (key).

PollVoterParams

Returns the vote outcome and the number of votes of a specific DAO member given a poll id and an address.

Query
CopyExpandClose

_1
DaoInfo {}

Response
Copy

_7
struct DaoInfoResponse {
_7
pub metadata: DaoMetadata,
_7
pub gov_config: DaoGovConfig,
_7
pub dao_type: DaoType,
_7
pub dao_membership_contract: Addr,
_7
pub dao_code_version: Uint64,
_7
}