{ "contract_name": "example-cw-contract", "contract_version": "0.1.0", "idl_version": "1.0.0", "instantiate": { "$schema": "http://json-schema.org/draft-07/schema#", "title": "InstantiateMsg", "type": "object", "required": ["price_feed_id", "pyth_contract_addr"], "properties": { "price_feed_id": { "$ref": "#/definitions/Identifier" }, "pyth_contract_addr": { "type": "string" } }, "additionalProperties": false, "definitions": { "Identifier": { "type": "string" } } }, "execute": { "$schema": "http://json-schema.org/draft-07/schema#", "title": "ExecuteMsg", "type": "string", "enum": [] }, "query": { "$schema": "http://json-schema.org/draft-07/schema#", "title": "QueryMsg", "oneOf": [ { "type": "string", "enum": ["fetch_valid_time_period"] }, { "type": "object", "required": ["fetch_price"], "properties": { "fetch_price": { "type": "object", "additionalProperties": false } }, "additionalProperties": false }, { "type": "object", "required": ["fetch_update_fee"], "properties": { "fetch_update_fee": { "type": "object", "required": ["vaas"], "properties": { "vaas": { "type": "array", "items": { "$ref": "#/definitions/Binary" } } }, "additionalProperties": false } }, "additionalProperties": false } ], "definitions": { "Binary": { "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", "type": "string" } } }, "migrate": { "$schema": "http://json-schema.org/draft-07/schema#", "title": "MigrateMsg", "type": "object", "additionalProperties": false }, "sudo": null, "responses": { "fetch_price": { "$schema": "http://json-schema.org/draft-07/schema#", "title": "FetchPriceResponse", "type": "object", "required": ["current_price", "ema_price"], "properties": { "current_price": { "$ref": "#/definitions/Price" }, "ema_price": { "$ref": "#/definitions/Price" } }, "additionalProperties": false, "definitions": { "Price": { "description": "A price with a degree of uncertainty at a certain time, represented as a price +- a confidence interval.\n\nPlease refer to the documentation at https://docs.pyth.network/consumers/best-practices for using this price safely.\n\nThe confidence interval roughly corresponds to the standard error of a normal distribution. Both the price and confidence are stored in a fixed-point numeric representation, `x * 10^expo`, where `expo` is the exponent. For example:\n\n``` use pyth_sdk::Price; Price { price: 12345, conf: 267, expo: -2, publish_time: 100 }; // represents 123.45 +- 2.67 published at UnixTimestamp 100 Price { price: 123, conf: 1, expo: 2, publish_time: 100 }; // represents 12300 +- 100 published at UnixTimestamp 100 ```\n\n`Price` supports a limited set of mathematical operations. All of these operations will propagate any uncertainty in the arguments into the result. However, the uncertainty in the result may overestimate the true uncertainty (by at most a factor of `sqrt(2)`) due to computational limitations. Furthermore, all of these operations may return `None` if their result cannot be represented within the numeric representation (e.g., the exponent is so small that the price does not fit into an i64). Users of these methods should (1) select their exponents to avoid this problem, and (2) handle the `None` case gracefully.", "type": "object", "required": ["conf", "expo", "price", "publish_time"], "properties": { "conf": { "description": "Confidence interval.", "type": "string" }, "expo": { "description": "Exponent.", "type": "integer", "format": "int32" }, "price": { "description": "Price.", "type": "string" }, "publish_time": { "description": "Publish time.", "type": "integer", "format": "int64" } } } } }, "fetch_update_fee": { "$schema": "http://json-schema.org/draft-07/schema#", "title": "Coin", "type": "object", "required": ["amount", "denom"], "properties": { "amount": { "$ref": "#/definitions/Uint128" }, "denom": { "type": "string" } }, "definitions": { "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" } } }, "fetch_valid_time_period": { "$schema": "http://json-schema.org/draft-07/schema#", "title": "Duration", "type": "object", "required": ["nanos", "secs"], "properties": { "nanos": { "type": "integer", "format": "uint32", "minimum": 0.0 }, "secs": { "type": "integer", "format": "uint64", "minimum": 0.0 } } } } }