cw-rules-core

Crates.iocw-rules-core
lib.rscw-rules-core
version0.1.2
sourcesrc
created_at2022-10-17 05:24:04.57531
updated_at2022-12-12 20:43:59.465612
descriptionCronCat rules logic for tasks that require conditions
homepage
repository
max_upload_size
id689806
size74,471
Trevor Clarke (TrevorJTClarke)

documentation

README

CwRules core

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.

Queries

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.

Commit count: 0

cargo fmt