diff --git a/schema/query_msg.json b/schema/query_msg.json index 7b9b8b9..49728c7 100644 --- a/schema/query_msg.json +++ b/schema/query_msg.json @@ -212,6 +212,21 @@ "description": "Binary is a wrapper around Vec to add base64 de/serialization with serde. It also adds some helper methods to help encode inline.\n\nThis is only needed as serde-json-{core,wasm} has a horrible encoding for Vec. See also .", "type": "string" }, + "Coin": { + "type": "object", + "required": [ + "amount", + "denom" + ], + "properties": { + "amount": { + "$ref": "#/definitions/Uint128" + }, + "denom": { + "type": "string" + } + } + }, "CompletedIncentiveProgramsParams": { "type": "object" }, @@ -402,6 +417,68 @@ } } }, + "MetokenIndexPriceParams": { + "type": "object", + "required": [ + "metoken_denom" + ], + "properties": { + "metoken_denom": { + "type": "string" + } + } + }, + "MetokenIndexbalancesParams": { + "type": "object", + "required": [ + "metoken_denom" + ], + "properties": { + "metoken_denom": { + "type": "string" + } + } + }, + "MetokenIndexesParams": { + "type": "object", + "required": [ + "metoken_denom" + ], + "properties": { + "metoken_denom": { + "type": "string" + } + } + }, + "MetokenParametersParams": { + "type": "object" + }, + "MetokenRedeemfeeParams": { + "type": "object", + "required": [ + "asset_denom", + "metoken" + ], + "properties": { + "asset_denom": { + "type": "string" + }, + "metoken": { + "$ref": "#/definitions/Coin" + } + } + }, + "MetokenSwapfeeParams": { + "type": "object", + "required": [ + "metoken_denom" + ], + "properties": { + "metoken_denom": { + "type": "string" + } + } + }, "MissCounterParams": { "type": "object", "required": [ @@ -872,6 +949,66 @@ } ] }, + "metoken_indexbalances": { + "anyOf": [ + { + "$ref": "#/definitions/MetokenIndexbalancesParams" + }, + { + "type": "null" + } + ] + }, + "metoken_indexes": { + "anyOf": [ + { + "$ref": "#/definitions/MetokenIndexesParams" + }, + { + "type": "null" + } + ] + }, + "metoken_indexprice": { + "anyOf": [ + { + "$ref": "#/definitions/MetokenIndexPriceParams" + }, + { + "type": "null" + } + ] + }, + "metoken_parameters": { + "anyOf": [ + { + "$ref": "#/definitions/MetokenParametersParams" + }, + { + "type": "null" + } + ] + }, + "metoken_redeemfee": { + "anyOf": [ + { + "$ref": "#/definitions/MetokenRedeemfeeParams" + }, + { + "type": "null" + } + ] + }, + "metoken_swapfee": { + "anyOf": [ + { + "$ref": "#/definitions/MetokenSwapfeeParams" + }, + { + "type": "null" + } + ] + }, "miss_counter": { "anyOf": [ { @@ -986,6 +1123,10 @@ } } }, + "Uint128": { + "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```", + "type": "string" + }, "UmeeQuery": { "oneOf": [ { @@ -1023,6 +1164,18 @@ } }, "additionalProperties": false + }, + { + "type": "object", + "required": [ + "metoken" + ], + "properties": { + "metoken": { + "$ref": "#/definitions/UmeeQueryMeToken" + } + }, + "additionalProperties": false } ] }, @@ -1286,6 +1439,82 @@ } ] }, + "UmeeQueryMeToken": { + "oneOf": [ + { + "type": "object", + "required": [ + "metoken_parameters" + ], + "properties": { + "metoken_parameters": { + "$ref": "#/definitions/MetokenParametersParams" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "metoken_indexes" + ], + "properties": { + "metoken_indexes": { + "$ref": "#/definitions/MetokenIndexesParams" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "metoken_swapfee" + ], + "properties": { + "metoken_swapfee": { + "$ref": "#/definitions/MetokenSwapfeeParams" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "metoken_redeemfee" + ], + "properties": { + "metoken_redeemfee": { + "$ref": "#/definitions/MetokenRedeemfeeParams" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "metoken_indexbalances" + ], + "properties": { + "metoken_indexbalances": { + "$ref": "#/definitions/MetokenIndexbalancesParams" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "metoken_index_price" + ], + "properties": { + "metoken_index_price": { + "$ref": "#/definitions/MetokenIndexPriceParams" + } + }, + "additionalProperties": false + } + ] + }, "UmeeQueryOracle": { "oneOf": [ { diff --git a/src/contract.rs b/src/contract.rs index f63d0ce..e571a08 100644 --- a/src/contract.rs +++ b/src/contract.rs @@ -19,7 +19,10 @@ use cw_umee_types::query_leverage::{ MaxWithdrawResponse, }; use cw_umee_types::query_metoken::{ - MetokenParametersParams, MetokenParametersResponse, UmeeQueryMeToken, MetokenIndexesParams, MetokenIndexesResponse, MetokenSwapfeeParams, MetokenSwapfeeResponse, MetokenRedeemfeeParams, MetokenRedeemfeeResponse, MetokenIndexbalancesParams, MetokenIndexbalancesResponse, MetokenIndexPriceParams, MetokenIndexPriceResponse, + MetokenIndexPriceParams, MetokenIndexPriceResponse, MetokenIndexbalancesParams, + MetokenIndexbalancesResponse, MetokenIndexesParams, MetokenIndexesResponse, + MetokenParametersParams, MetokenParametersResponse, MetokenRedeemfeeParams, + MetokenRedeemfeeResponse, MetokenSwapfeeParams, MetokenSwapfeeResponse, UmeeQueryMeToken, }; use cw_umee_types::query_oracle::{ MedianDeviationsParams, MedianDeviationsParamsResponse, MediansParams, MediansParamsResponse, @@ -342,13 +345,18 @@ fn query_metoken(deps: Deps, _env: Env, msg: UmeeQueryMeToken) -> StdResult to_binary(&query_metoken_params(deps, params)?), UmeeQueryMeToken::MetokenIndexes(params) => to_binary(&query_metoken_indexes(deps, params)?), UmeeQueryMeToken::MetokenSwapfee(params) => to_binary(&query_metoken_swapfee(deps, params)?), - UmeeQueryMeToken::MetokenRedeemfee(params) => to_binary(&query_metoken_redeemfee(deps, params)?), - UmeeQueryMeToken::MetokenIndexbalances(params) => to_binary(&query_metoken_indexbalances(deps, params)?), - UmeeQueryMeToken::MetokenIndexPrice(params) => to_binary(&query_metoken_indexprice(deps, params)?), + UmeeQueryMeToken::MetokenRedeemfee(params) => { + to_binary(&query_metoken_redeemfee(deps, params)?) + } + UmeeQueryMeToken::MetokenIndexbalances(params) => { + to_binary(&query_metoken_indexbalances(deps, params)?) + } + UmeeQueryMeToken::MetokenIndexPrice(params) => { + to_binary(&query_metoken_indexprice(deps, params)?) + } } } - // query_metoken_indexprice fn query_metoken_indexprice( deps: Deps, @@ -373,7 +381,6 @@ fn query_metoken_indexprice( Ok(response) } - // query_metoken_indexbalances fn query_metoken_indexbalances( deps: Deps, @@ -470,7 +477,6 @@ fn query_metoken_indexes( Ok(response) } - // query_metoken_params fn query_metoken_params( deps: Deps,