{ "$schema": "http://json-schema.org/draft-07/schema#", "title": "Schema", "type": "object", "required": [ "execute", "instantiate", "query" ], "properties": { "execute": { "$ref": "#/definitions/ExecuteMsg" }, "instantiate": { "$ref": "#/definitions/InstantiateMsg" }, "query": { "$ref": "#/definitions/QueryMsg" } }, "definitions": { "Addr": { "description": "A human readable address.\n\nIn Cosmos, this is typically bech32 encoded. But for multi-chain smart contracts no assumptions should be made other than being UTF-8 encoded and of reasonable length.\n\nThis type represents a validated address. It can be created in the following ways 1. Use `Addr::unchecked(input)` 2. Use `let checked: Addr = deps.api.addr_validate(input)?` 3. Use `let checked: Addr = deps.api.addr_humanize(canonical_addr)?` 4. Deserialize from JSON. This must only be done from JSON that was validated before such as a contract's state. `Addr` must not be used in messages sent by the user because this would result in unvalidated instances.\n\nThis type is immutable. If you really need to mutate it (Really? Are you sure?), create a mutable copy using `let mut mutable = Addr::to_string()` and operate on that `String` instance.", "type": "string" }, "CancelMsg": { "type": "object", "required": [ "id" ], "properties": { "id": { "type": "string" } } }, "Config": { "type": "object", "required": [ "admin", "denom", "fees" ], "properties": { "admin": { "$ref": "#/definitions/Addr" }, "denom": { "type": "string" }, "fees": { "type": "integer", "format": "uint64", "minimum": 0.0 } } }, "ExecuteMsg": { "oneOf": [ { "type": "object", "required": [ "create" ], "properties": { "create": { "$ref": "#/definitions/SwapMsg" } }, "additionalProperties": false }, { "type": "object", "required": [ "finish" ], "properties": { "finish": { "$ref": "#/definitions/FinishSwapMsg" } }, "additionalProperties": false }, { "type": "object", "required": [ "cancel" ], "properties": { "cancel": { "$ref": "#/definitions/CancelMsg" } }, "additionalProperties": false }, { "type": "object", "required": [ "update" ], "properties": { "update": { "$ref": "#/definitions/UpdateMsg" } }, "additionalProperties": false }, { "type": "object", "required": [ "update_config" ], "properties": { "update_config": { "type": "object", "required": [ "config" ], "properties": { "config": { "$ref": "#/definitions/Config" } } } }, "additionalProperties": false }, { "type": "object", "required": [ "withdraw" ], "properties": { "withdraw": { "$ref": "#/definitions/WithdrawMsg" } }, "additionalProperties": false } ] }, "Expiration": { "description": "Expiration represents a point in time when some event happens. It can compare with a BlockInfo and will return is_expired() == true once the condition is hit (and for every block in the future)", "oneOf": [ { "description": "AtHeight will expire when `env.block.height` >= height", "type": "object", "required": [ "at_height" ], "properties": { "at_height": { "type": "integer", "format": "uint64", "minimum": 0.0 } }, "additionalProperties": false }, { "description": "AtTime will expire when `env.block.time` >= time", "type": "object", "required": [ "at_time" ], "properties": { "at_time": { "$ref": "#/definitions/Timestamp" } }, "additionalProperties": false }, { "description": "Never will never expire. Used to express the empty variant", "type": "object", "required": [ "never" ], "properties": { "never": { "type": "object" } }, "additionalProperties": false } ] }, "FinishSwapMsg": { "type": "object", "required": [ "id" ], "properties": { "id": { "type": "string" } } }, "InstantiateMsg": { "type": "object", "required": [ "admin", "denom", "fee_percentage" ], "properties": { "admin": { "$ref": "#/definitions/Addr" }, "denom": { "type": "string" }, "fee_percentage": { "type": "integer", "format": "uint64", "minimum": 0.0 } } }, "QueryMsg": { "oneOf": [ { "description": "Get all swaps (enumerable) Return type: ListResponse", "type": "object", "required": [ "list" ], "properties": { "list": { "type": "object", "properties": { "limit": { "type": [ "integer", "null" ], "format": "uint32", "minimum": 0.0 }, "start_after": { "type": [ "string", "null" ] } } } }, "additionalProperties": false }, { "type": "object", "required": [ "get_total" ], "properties": { "get_total": { "type": "object", "properties": { "swap_type": { "anyOf": [ { "$ref": "#/definitions/SwapType" }, { "type": "null" } ] } } } }, "additionalProperties": false }, { "description": "Get all swaps of type `SwapType::Offer`", "type": "object", "required": [ "get_offers" ], "properties": { "get_offers": { "type": "object", "properties": { "limit": { "type": [ "integer", "null" ], "format": "uint32", "minimum": 0.0 }, "page": { "type": [ "integer", "null" ], "format": "uint32", "minimum": 0.0 } } } }, "additionalProperties": false }, { "description": "Get all swaps of type `SwapType::Sale`", "type": "object", "required": [ "get_listings" ], "properties": { "get_listings": { "type": "object", "properties": { "limit": { "type": [ "integer", "null" ], "format": "uint32", "minimum": 0.0 }, "page": { "type": [ "integer", "null" ], "format": "uint32", "minimum": 0.0 } } } }, "additionalProperties": false }, { "description": "Get all listings for a token of type `Swap::Sale` and `Swap::Offer` or both (`None`)", "type": "object", "required": [ "listings_of_token" ], "properties": { "listings_of_token": { "type": "object", "required": [ "cw721", "token_id" ], "properties": { "cw721": { "$ref": "#/definitions/Addr" }, "limit": { "type": [ "integer", "null" ], "format": "uint32", "minimum": 0.0 }, "page": { "type": [ "integer", "null" ], "format": "uint32", "minimum": 0.0 }, "swap_type": { "anyOf": [ { "$ref": "#/definitions/SwapType" }, { "type": "null" } ] }, "token_id": { "type": "string" } } } }, "additionalProperties": false }, { "description": "Show all swaps created by a specific address Defaults to SwapType::Sale if no `swap_type`", "type": "object", "required": [ "swaps_of" ], "properties": { "swaps_of": { "type": "object", "required": [ "address" ], "properties": { "address": { "$ref": "#/definitions/Addr" }, "cw721": { "anyOf": [ { "$ref": "#/definitions/Addr" }, { "type": "null" } ] }, "limit": { "type": [ "integer", "null" ], "format": "uint32", "minimum": 0.0 }, "page": { "type": [ "integer", "null" ], "format": "uint32", "minimum": 0.0 }, "swap_type": { "anyOf": [ { "$ref": "#/definitions/SwapType" }, { "type": "null" } ] } } } }, "additionalProperties": false }, { "description": "Show all swaps of a given price range", "type": "object", "required": [ "swaps_by_price" ], "properties": { "swaps_by_price": { "type": "object", "properties": { "cw721": { "anyOf": [ { "$ref": "#/definitions/Addr" }, { "type": "null" } ] }, "limit": { "type": [ "integer", "null" ], "format": "uint32", "minimum": 0.0 }, "max": { "anyOf": [ { "$ref": "#/definitions/Uint128" }, { "type": "null" } ] }, "min": { "anyOf": [ { "$ref": "#/definitions/Uint128" }, { "type": "null" } ] }, "page": { "type": [ "integer", "null" ], "format": "uint32", "minimum": 0.0 }, "swap_type": { "anyOf": [ { "$ref": "#/definitions/SwapType" }, { "type": "null" } ] } } } }, "additionalProperties": false }, { "description": "Show all swaps of a given denom (contract address) Defaults to ARCH if no contract is sent", "type": "object", "required": [ "swaps_by_denom" ], "properties": { "swaps_by_denom": { "type": "object", "properties": { "cw721": { "anyOf": [ { "$ref": "#/definitions/Addr" }, { "type": "null" } ] }, "limit": { "type": [ "integer", "null" ], "format": "uint32", "minimum": 0.0 }, "page": { "type": [ "integer", "null" ], "format": "uint32", "minimum": 0.0 }, "payment_token": { "anyOf": [ { "$ref": "#/definitions/Addr" }, { "type": "null" } ] }, "swap_type": { "anyOf": [ { "$ref": "#/definitions/SwapType" }, { "type": "null" } ] } } } }, "additionalProperties": false }, { "description": "Show all cw20 swaps, or all ARCH swaps", "type": "object", "required": [ "swaps_by_payment_type" ], "properties": { "swaps_by_payment_type": { "type": "object", "required": [ "cw20" ], "properties": { "cw20": { "type": "boolean" }, "cw721": { "anyOf": [ { "$ref": "#/definitions/Addr" }, { "type": "null" } ] }, "limit": { "type": [ "integer", "null" ], "format": "uint32", "minimum": 0.0 }, "page": { "type": [ "integer", "null" ], "format": "uint32", "minimum": 0.0 }, "swap_type": { "anyOf": [ { "$ref": "#/definitions/SwapType" }, { "type": "null" } ] } } } }, "additionalProperties": false }, { "description": "Returns the details of the named swap, error if not created. Return type: DetailsResponse.", "type": "object", "required": [ "details" ], "properties": { "details": { "type": "object", "required": [ "id" ], "properties": { "id": { "type": "string" } } } }, "additionalProperties": false }, { "description": "Query Config (useful for determining parameters for ExecuteMsg::UpdateConfig)", "type": "object", "required": [ "config" ], "properties": { "config": { "type": "object" } }, "additionalProperties": false } ] }, "SwapMsg": { "type": "object", "required": [ "cw721", "expires", "id", "price", "swap_type", "token_id" ], "properties": { "cw721": { "$ref": "#/definitions/Addr" }, "expires": { "$ref": "#/definitions/Expiration" }, "id": { "type": "string" }, "payment_token": { "anyOf": [ { "$ref": "#/definitions/Addr" }, { "type": "null" } ] }, "price": { "$ref": "#/definitions/Uint128" }, "swap_type": { "$ref": "#/definitions/SwapType" }, "token_id": { "type": "string" } } }, "SwapType": { "type": "string", "enum": [ "Offer", "Sale" ] }, "Timestamp": { "description": "A point in time in nanosecond precision.\n\nThis type can represent times from 1970-01-01T00:00:00Z to 2554-07-21T23:34:33Z.\n\n## Examples\n\n``` # use cosmwasm_std::Timestamp; let ts = Timestamp::from_nanos(1_000_000_202); assert_eq!(ts.nanos(), 1_000_000_202); assert_eq!(ts.seconds(), 1); assert_eq!(ts.subsec_nanos(), 202);\n\nlet ts = ts.plus_seconds(2); assert_eq!(ts.nanos(), 3_000_000_202); assert_eq!(ts.seconds(), 3); assert_eq!(ts.subsec_nanos(), 202); ```", "allOf": [ { "$ref": "#/definitions/Uint64" } ] }, "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" }, "Uint64": { "description": "A thin wrapper around u64 that is using strings for JSON encoding/decoding, such that the full u64 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 `u64` to get the value out:\n\n``` # use cosmwasm_std::Uint64; let a = Uint64::from(42u64); assert_eq!(a.u64(), 42);\n\nlet b = Uint64::from(70u32); assert_eq!(b.u64(), 70); ```", "type": "string" }, "UpdateMsg": { "type": "object", "required": [ "expires", "id", "price" ], "properties": { "expires": { "$ref": "#/definitions/Expiration" }, "id": { "type": "string" }, "price": { "$ref": "#/definitions/Uint128" } } }, "WithdrawMsg": { "type": "object", "required": [ "amount", "denom" ], "properties": { "amount": { "$ref": "#/definitions/Uint128" }, "denom": { "type": "string" }, "payment_token": { "anyOf": [ { "$ref": "#/definitions/Addr" }, { "type": "null" } ] } } } } }