Crates.io | cw-rules-core |
lib.rs | cw-rules-core |
version | 0.1.2 |
source | src |
created_at | 2022-10-17 05:24:04.57531 |
updated_at | 2022-12-12 20:43:59.465612 |
description | CronCat rules logic for tasks that require conditions |
homepage | |
repository | |
max_upload_size | |
id | 689806 |
size | 74,471 |
This CosmWasm based library provides types and messages for rules contract. It is used in both CronCat Manager contract and CronCat Agent for checking the status of tasks with rules. Tasks with rules are executed only if all rules succeed, hence agents and manager contract must query rules contract.
QueryMsg
defines several option for rules conditions.
RuleResponse<T> = (bool, T)
allows to return boolean result for the query together with some optional specification about the rule failure/success.
GetBalance
queries balance of the address.
GetCw20Balance
queries cw20 balance of the address for the specified cw20_contract
.
HasBalanceGte
checks whether the address has at least required_balance
(might be both native and cw20)
CheckOwnerOfNft
checks whether the address owns the NFT.
CheckProposalStatus
checks whether DAO DAO proposal has passed.
QueryConstruct
checks a vector of rules, in case of failure returns false
and the index of the failed rule.
GenericQuery
is used for creating queries with generic rules, see generic-query
crate for details.