github.com/fibonacci-chain/fbc@v0.0.0-20231124064014-c7636198c1e9/dev/wasm/escrow/src/msg.rs (about) 1 use cosmwasm_std::{Addr, Coin}; 2 use schemars::JsonSchema; 3 use serde::{Deserialize, Serialize}; 4 5 #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)] 6 pub struct InstantiateMsg { 7 pub arbiter: String, 8 pub recipient: String, 9 /// When end height set and block height exceeds this value, the escrow is expired. 10 /// Once an escrow is expired, it can be returned to the original funder (via "refund"). 11 pub end_height: Option<u64>, 12 /// When end time (in seconds since epoch 00:00:00 UTC on 1 January 1970) is set and 13 /// block time exceeds this value, the escrow is expired. 14 /// Once an escrow is expired, it can be returned to the original funder (via "refund"). 15 pub end_time: Option<u64>, 16 } 17 18 #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)] 19 #[serde(rename_all = "snake_case")] 20 pub enum ExecuteMsg { 21 Approve { 22 // release some coins - if quantity is None, release all coins in balance 23 quantity: Option<Vec<Coin>>, 24 }, 25 Refund {}, 26 } 27 28 #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)] 29 #[serde(rename_all = "snake_case")] 30 pub enum QueryMsg { 31 /// Returns a human-readable representation of the arbiter. 32 Arbiter {}, 33 } 34 35 #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)] 36 pub struct ArbiterResponse { 37 pub arbiter: Addr, 38 }