cw-croncat-core

Crates.iocw-croncat-core
lib.rscw-croncat-core
version0.1.5
sourcesrc
created_at2022-10-17 05:34:56.530459
updated_at2022-12-22 21:43:56.305747
descriptionCronCat core logic allowing automated scheduling of transactions and IFTTT for the interchain
homepage
repository
max_upload_size
id689809
size459,228
Trevor Clarke (TrevorJTClarke)

documentation

README

CronCat core

This library is based on CosmWasm and contains all messages, types and traits for the CronCat Manager contract. It is also used by CronCat Agent and rules contract.

Messages

Instantiate message

InstantiateMsg defines denom, cw_rules_addr for contract address for the queries and some other optional parameters.

Execute message

pub enum ExecuteMsg {
    // Task managment
    CreateTask {
        task: TaskRequest,
    },
    RemoveTask {
        task_hash: String,
    },
    RefillTaskBalance {
        task_hash: String,
    },
    RefillTaskCw20Balance {..},

    // For handling agent
    RegisterAgent {..},
    UpdateAgent {..},
    CheckInAgent {},
    UnregisterAgent {},
    WithdrawReward {},

    // Executing a task
    ProxyCall {
        task_hash: Option<String>,
    },

    // Updating config 
    UpdateSettings {..},

    // Moving balance to DAO or letting treasury transfer to itself
    MoveBalances {..},

    // Adding and withdrawing cw20 coins from user balance
    Receive(cw20::Cw20ReceiveMsg),
    WithdrawWalletBalance {
        cw20_amounts: Vec<Cw20Coin>,
    },

    // Helps manage and cleanup agents
    Tick {},
}

Query messages

pub enum QueryMsg {
    // Query all tasks with queries starting with `from_index` till `limit`
    GetTasks {
        from_index: Option<u64>,
        limit: Option<u64>,
    },
    // Query all tasks without queries starting with `from_index` till `limit`
    GetTasksWithQueries {
        from_index: Option<u64>,
        limit: Option<u64>,
    },
    // Query tasks created by owner_id
    GetTasksByOwner {
        owner_id: String,
    },
    // Query task by hash and vice versa
    GetTask {
        task_hash: String,
    },
    GetTaskHash {
        task: Box<Task>,
    },

    // Queries the information about all agents or the specific agent with address `account_id`
    GetAgent {
        account_id: String,
    },
    GetAgentIds {},
    GetAgentTasks {
        account_id: String,
    },

    // Checks if the interval is valid, returns bool
    ValidateInterval {
        interval: Interval,
    },

    // Query the current config
    GetConfig {},

    // Query native and cw20 balances
    GetBalances {},
    // Query user's cw20 balances
    GetWalletBalances {
        wallet: String,
    },

    // Query a list of active slot ids 
    GetSlotIds {},
    // Query list of task hashes by the slot
    GetSlotHashes {
        slot: Option<u64>,
    },

    // Returns the current state, including config, tasks and agents
    GetState {
        from_index: Option<u64>,
        limit: Option<u64>,
    },
}
Commit count: 0

cargo fmt