sg_std/
lib.rs

1mod msg;
2mod query;
3mod route;
4
5pub const NATIVE_DENOM: &str = "ustars";
6// 3/11/2022 16:00:00 ET
7pub const GENESIS_MINT_START_TIME: u64 = 1647032400000000000;
8
9use cosmwasm_std::{coin, coins, Addr, BankMsg, Coin};
10pub use msg::{
11    create_claim_for_msg, create_fund_community_pool_msg, create_fund_fairburn_pool_msg,
12    ClaimAction, StargazeMsg, StargazeMsgWrapper,
13};
14
15pub type Response = cosmwasm_std::Response<StargazeMsgWrapper>;
16pub type SubMsg = cosmwasm_std::SubMsg<StargazeMsgWrapper>;
17pub type CosmosMsg = cosmwasm_std::CosmosMsg<StargazeMsgWrapper>;
18
19pub use query::StargazeQuery;
20pub use route::StargazeRoute;
21
22// This export is added to all contracts that import this package, signifying that they require
23// "stargaze" support on the chain they run on.
24#[no_mangle]
25extern "C" fn requires_stargaze() {}
26
27pub fn stars(amount: impl Into<u128>) -> Vec<Coin> {
28    coins(amount.into(), NATIVE_DENOM)
29}
30
31pub fn star(amount: impl Into<u128>) -> Coin {
32    coin(amount.into(), NATIVE_DENOM)
33}
34
35pub fn send_msg(to_address: &Addr, amount: impl Into<u128>) -> BankMsg {
36    BankMsg::Send {
37        to_address: to_address.to_string(),
38        amount: stars(amount),
39    }
40}