-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(smart-contracts): add bidding balance & treasure chest contracts…
… qieries
- Loading branch information
Showing
7 changed files
with
77 additions
and
11 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,11 @@ | ||
[package] | ||
name = "injective-auction-pool" | ||
description = "Smart contract that allows for community members to pool together INJ to participate in burn auctions" | ||
authors = ["Kerber0x <[email protected]>", "Nahem <[email protected]>", "PFC <[email protected]>"] | ||
authors = [ | ||
"Kerber0x <[email protected]>", | ||
"Nahem <[email protected]>", | ||
"PFC <[email protected]>", | ||
] | ||
version = "0.1.0" | ||
|
||
edition = { workspace = true } | ||
|
@@ -22,7 +26,7 @@ backtraces = ["cosmwasm-std/backtraces"] | |
|
||
[dependencies] | ||
cosmwasm-schema = { workspace = true } | ||
cosmwasm-std = { workspace = true} | ||
cosmwasm-std = { workspace = true } | ||
schemars = { workspace = true } | ||
serde = { workspace = true } | ||
cw2 = { workspace = true } | ||
|
@@ -32,6 +36,7 @@ injective_auction = { workspace = true } | |
prost = { workspace = true } | ||
cw-utils = { workspace = true } | ||
treasurechest = { workspace = true } | ||
cw-paginate-storage = { workspace = true } | ||
|
||
[dev-dependencies] | ||
cw-multi-test = { workspace = true } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,36 @@ | ||
use cosmwasm_std::{to_json_binary, Binary, Deps, StdResult}; | ||
use injective_auction::auction_pool::ConfigResponse; | ||
use injective_auction::auction_pool::{ | ||
BiddingBalanceResponse, ConfigResponse, TreasureChestContractsResponse, | ||
}; | ||
|
||
use crate::state::CONFIG; | ||
use crate::state::{BIDDING_BALANCE, CONFIG, TREASURE_CHEST_CONTRACTS}; | ||
|
||
pub fn query_config(deps: Deps) -> StdResult<Binary> { | ||
to_json_binary(&ConfigResponse { | ||
config: CONFIG.load(deps.storage)?, | ||
}) | ||
} | ||
pub fn query_treasure_chest_contracts( | ||
deps: Deps, | ||
start_after: Option<u64>, | ||
limit: Option<u32>, | ||
) -> StdResult<Binary> { | ||
let treasure_chest_contracts = cw_paginate_storage::paginate_map( | ||
deps, | ||
&TREASURE_CHEST_CONTRACTS, | ||
start_after, | ||
limit, | ||
cosmwasm_std::Order::Ascending, | ||
)?; | ||
|
||
to_json_binary(&TreasureChestContractsResponse { | ||
treasure_chest_contracts, | ||
}) | ||
} | ||
|
||
pub fn query_bidding_balance(deps: Deps) -> StdResult<Binary> { | ||
let bidding_balance = BIDDING_BALANCE.load(deps.storage)?; | ||
to_json_binary(&BiddingBalanceResponse { | ||
bidding_balance, | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters