This repository has been archived by the owner on Dec 29, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* merge fix * save change * feat: bindings repository integration * feat: add quering endpoint * feat: query margin order(s) * Update query_msg.rs --------- Co-authored-by: Cosmic Vagabond <[email protected]>
- Loading branch information
1 parent
472f88a
commit ec28760
Showing
6 changed files
with
50 additions
and
3 deletions.
There are no files selected for viewing
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
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
use cosmwasm_std::StdError; | ||
|
||
use super::*; | ||
|
||
pub fn get_margin_order( | ||
deps: Deps<ElysQuery>, | ||
address: String, | ||
id: u64, | ||
) -> Result<Mtp, ContractError> { | ||
let querier = ElysQuerier::new(&deps.querier); | ||
|
||
let resp: MarginMtpResponse = querier.mtp(address, id)?; | ||
|
||
if let Some(mtp) = resp.mtp { | ||
Ok(mtp) | ||
} else { | ||
Err(StdError::not_found("margin trading prosition").into()) | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
use super::*; | ||
|
||
pub fn get_margin_orders( | ||
deps: Deps<ElysQuery>, | ||
pagination: PageRequest, | ||
) -> Result<MarginQueryPositionsResponse, ContractError> { | ||
let querier = ElysQuerier::new(&deps.querier); | ||
|
||
let resp: MarginQueryPositionsResponse = querier.positions(pagination)?; | ||
|
||
Ok(resp) | ||
} |
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